decocms 4.344.3 → 4.344.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/client/assets/{AlertCircle-C3hNX-U3.js → AlertCircle-MMXQB5BT.js} +1 -1
  2. package/dist/client/assets/{AreaChart-V5K73xTf.js → AreaChart-yVeAt06n.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-xkekPehv.js → ArrowLeft-DcqEiCXC.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CYfoVlFX.js → ArrowUp-C0l-cSxr.js} +1 -1
  5. package/dist/client/assets/{Check-BcH3mbli.js → Check-COlZG_Iq.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-efnyoYbr.js → CheckCircle-DlrGO-LV.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-zWIGH7_7.js → ChevronRight-lhy77Wwp.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-Q_MhqA-g.js → ChevronSelectorVertical-DrBBU4AT.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CcnNOmjW.js → ChevronUp-BBoq4dQx.js} +1 -1
  10. package/dist/client/assets/{Copy01-B-07BGuw.js → Copy01-ByTSNoHg.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DZdhUpRr.js → CreditCard01-qqfxWQO_.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Cha1vnex.js → DotsVertical-BK7lUtpM.js} +1 -1
  13. package/dist/client/assets/{Download01-BH00OOK2.js → Download01-Cqs5gANt.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-DGy0g17o.js → ErrorBarContext-CaFlLJMw.js} +1 -1
  15. package/dist/client/assets/{Eye-s_5OI3rP.js → Eye-De6iXjt2.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-DPsdhEPj.js → GitBranch01-C7r39_B1.js} +1 -1
  17. package/dist/client/assets/{Globe01-BOLRhWz3.js → Globe01-BVw1J1dL.js} +1 -1
  18. package/dist/client/assets/{HardDrive-Jz5aKVF-.js → HardDrive-UD8cThYr.js} +1 -1
  19. package/dist/client/assets/{Image01-Dde0njV5.js → Image01-2rJjksWt.js} +1 -1
  20. package/dist/client/assets/{Key01-CL0l8cke.js → Key01-g1jGSd1T.js} +1 -1
  21. package/dist/client/assets/{Link01-c7H6evzR.js → Link01-BECijxK2.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-mF6LE9cE.js → LinkExternal01-CO1G1_g7.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxZPUqxw.js → Monitor01-BbOgpVrd.js} +1 -1
  24. package/dist/client/assets/{Package-D1Oz_AXu.js → Package-CLE_ytpB.js} +1 -1
  25. package/dist/client/assets/{Palette-BZi2CQIb.js → Palette-CLZ81RQu.js} +1 -1
  26. package/dist/client/assets/{Play-DL08uuDR.js → Play-BS6znGOA.js} +1 -1
  27. package/dist/client/assets/{Plus-UnZHTGwg.js → Plus-RDqtgmUn.js} +1 -1
  28. package/dist/client/assets/{SearchMd-BoghbLrR.js → SearchMd-BPJyn57v.js} +1 -1
  29. package/dist/client/assets/{Sector-CwzoDHdp.js → Sector-0dGAognD.js} +1 -1
  30. package/dist/client/assets/{Settings02-CRvAtfO0.js → Settings02-DCwLCWga.js} +1 -1
  31. package/dist/client/assets/{Share07-CTpIecy0.js → Share07-CZ9aibs3.js} +1 -1
  32. package/dist/client/assets/{Shield01-DPL17IT0.js → Shield01-D_ej3uf2.js} +1 -1
  33. package/dist/client/assets/{Stars01-DveEX2vy.js → Stars01-CpnggJLh.js} +1 -1
  34. package/dist/client/assets/{Sun-cPKIj7uq.js → Sun-BVXGJtHB.js} +1 -1
  35. package/dist/client/assets/{Tool01-DXqO9hP4.js → Tool01-lLgSUXVY.js} +1 -1
  36. package/dist/client/assets/{Tool02-B4NLpHjP.js → Tool02-DbSkbpld.js} +1 -1
  37. package/dist/client/assets/{Trash01-CRSthTGO.js → Trash01-BKalTQIS.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-Dug8rn5Y.js → TrendUp01-Cm7YwYbt.js} +1 -1
  39. package/dist/client/assets/{Upload01-D_Fv189I.js → Upload01-HHF0-qzw.js} +1 -1
  40. package/dist/client/assets/{User01-CDa2pgjQ.js → User01-r0_GbQ8r.js} +1 -1
  41. package/dist/client/assets/{UserSquare-CWhx4AsN.js → UserSquare-hcaj17gz.js} +1 -1
  42. package/dist/client/assets/{Users01-DZlH1wbC.js → Users01-Bu5fyBA6.js} +1 -1
  43. package/dist/client/assets/{Users03-CoUu6iB3.js → Users03-BOFJsacM.js} +1 -1
  44. package/dist/client/assets/{XCircle-TCv3gxEk.js → XCircle-Mj5ql-Qx.js} +1 -1
  45. package/dist/client/assets/{XClose-DqZ5Ef7p.js → XClose-Df2qGXCV.js} +1 -1
  46. package/dist/client/assets/{Zap-HRAvXFnr.js → Zap-Cokcdzem.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DC7lYRrH.js → ZoomOut-T2TmOAC7.js} +1 -1
  48. package/dist/client/assets/{access-gate-LG7Db20W.js → access-gate-tjl-KQc5.js} +1 -1
  49. package/dist/client/assets/{agent-icon-B0j2UorE.js → agent-icon-Dud4Dgyt.js} +1 -1
  50. package/dist/client/assets/{agents-list-DJgBBD1W.js → agents-list-C2SALbi7.js} +1 -1
  51. package/dist/client/assets/{ai-providers-D9b6lp9s.js → ai-providers-DrsNB3ZL.js} +1 -1
  52. package/dist/client/assets/{alert-Yw6picdx.js → alert-CSBIES1I.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-B6LS36Sm.js → alert-dialog-DR3U9WH-.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-D-B27giR.js → analytics-tab-NgL3s46L.js} +1 -1
  55. package/dist/client/assets/{api-keys-D7tL_p1k.js → api-keys-B9YvTwjr.js} +1 -1
  56. package/dist/client/assets/api-keys-BKUTfUtI.js +1 -0
  57. package/dist/client/assets/app-editor-B7bRgdBC.js +1 -0
  58. package/dist/client/assets/{auth-catchall-DU8qDYnm.js → auth-catchall-DlIPkq35.js} +1 -1
  59. package/dist/client/assets/{auth-entry-6o1YBMQ6.js → auth-entry-DYxJPWB9.js} +1 -1
  60. package/dist/client/assets/{auth-DBYGTgFE.js → auth-pxmXflMC.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-Csg-iIgy.js → auth-split-layout-BEtw3h52.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-AGm_2YIv.js → authenticate-and-persist-oauth-DEt4nWzC.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-yl7Jr9Us.js → automation-list-row-w_6dod7A.js} +1 -1
  64. package/dist/client/assets/{automation-runs-DBYd6ygh.js → automation-runs-CSMD6Fno.js} +1 -1
  65. package/dist/client/assets/{automations-Dlvl2Sbn.js → automations-Chklo3P6.js} +1 -1
  66. package/dist/client/assets/{autosend-9lrcbCup.js → autosend-BTepWx3_.js} +1 -1
  67. package/dist/client/assets/{avatar-BusY4imm.js → avatar--vQE0XAV.js} +1 -1
  68. package/dist/client/assets/{badge-COtyjjy2.js → badge-BsDrwMQC.js} +1 -1
  69. package/dist/client/assets/{block-document-pw3BZW3I.js → block-document-CvifDrCI.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-aEyQOqqG.js → breadcrumb--1eSMHFt.js} +1 -1
  71. package/dist/client/assets/{buckets-CrIxq0vO.js → buckets-CXTxvCv-.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-D7gbHLhl.js → bulk-category-panel-Bx5YHxjU.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-BeQsW5u1.js → capability-load-error-Dafmx4Ll.js} +1 -1
  74. package/dist/client/assets/{cards-CAtXduAN.js → cards-DWh17eYP.js} +1 -1
  75. package/dist/client/assets/{category-editor-CQj0g1PN.js → category-editor-BeXDYFhG.js} +1 -1
  76. package/dist/client/assets/{cdn-tab-VWG7A8ek.js → cdn-tab-C1FgbuSh.js} +1 -1
  77. package/dist/client/assets/{chart-BSIlcmgf.js → chart-DClpxfm_.js} +1 -1
  78. package/dist/client/assets/{chat-context-DU7jeH6U.js → chat-context-C9lWTtFJ.js} +1 -1
  79. package/dist/client/assets/{checkbox-D1r9ixw9.js → checkbox-QNc1bP0G.js} +1 -1
  80. package/dist/client/assets/{choose-editor-BEZHaCP7.js → choose-editor-CHBT1o2b.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-ChhNt2lr.js → cli-auth-success-ItLmOJgn.js} +1 -1
  82. package/dist/client/assets/{client-icons-CqD2Q5XK.js → client-icons-CAQi5x0D.js} +1 -1
  83. package/dist/client/assets/{collection-detail-Bc1N9_b4.js → collection-detail-D8x6ZU5_.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-Bc0_77tr.js → collection-display-button-sHhiXn17.js} +1 -1
  85. package/dist/client/assets/{collection-search-CkYj4zLQ.js → collection-search-BQUnJFre.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-DRVe2c2R.js → collection-table-wrapper-BEX1_xVZ.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-N31SqJ5M.js → collection-tabs-CPQ4VrZ9.js} +1 -1
  88. package/dist/client/assets/{command-M5Hy4Bca.js → command-CfiREnnD.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-g6xIZGng.js → commerce-onboarding-DiMj1pm4.js} +1 -1
  90. package/dist/client/assets/{connect-Cf-9oNPe.js → connect-C590HPCH.js} +1 -1
  91. package/dist/client/assets/{connect-layout-Z933g_CV.js → connect-layout-uoNJYOn4.js} +1 -1
  92. package/dist/client/assets/{connection-Cimig8VQ.js → connection-C8iBaknC.js} +1 -1
  93. package/dist/client/assets/{connection-card-kDFhfbya.js → connection-card-BRtH_NyF.js} +1 -1
  94. package/dist/client/assets/{connection-detail-D3l8WE-Y.js → connection-detail-DAZ9PGtT.js} +1 -1
  95. package/dist/client/assets/{connection-form-helpers-Bb00vWyO.js → connection-form-helpers-BExi3iUW.js} +1 -1
  96. package/dist/client/assets/{connections-BS7ow6ak.js → connections-DxzZcAAQ.js} +1 -1
  97. package/dist/client/assets/{create-organization-dialog-DF7Gz0pf.js → create-organization-dialog-CMEbcfeY.js} +1 -1
  98. package/dist/client/assets/{decopilot-sse-pool-C6z-rtNE.js → decopilot-sse-pool-BEKKOta-.js} +1 -1
  99. package/dist/client/assets/{dialog-CIbVvLCQ.js → dialog-Dn9dA6Rv.js} +1 -1
  100. package/dist/client/assets/{domain-settings-Bmfy9jDz.js → domain-settings-HD-p0a2P.js} +1 -1
  101. package/dist/client/assets/{drawer-CJFC-0Fv.js → drawer-C2zduVGY.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-BHHO3QAR.js → dropdown-menu-nFmVNZOj.js} +1 -1
  103. package/dist/client/assets/{e2e-tab-DNyiIyOa.js → e2e-tab-CPMFk97B.js} +1 -1
  104. package/dist/client/assets/{editor-D6mstx7z.js → editor-CTbgd0DG.js} +1 -1
  105. package/dist/client/assets/{empty-state-BOUJ1IRI.js → empty-state-B4rx-IxR.js} +1 -1
  106. package/dist/client/assets/{empty-state-CFTbSuP9.js → empty-state-BhGR8qhU.js} +1 -1
  107. package/dist/client/assets/{extract-connection-data-BAwcjEs9.js → extract-connection-data-BzkNyMFd.js} +1 -1
  108. package/dist/client/assets/{file-explorer-Bh9n4VYl.js → file-explorer-Czaff-IK.js} +1 -1
  109. package/dist/client/assets/{file-type-icon-VaomZQ4k.js → file-type-icon-DdLRSJG1.js} +1 -1
  110. package/dist/client/assets/{folder-icon-BPPBLsSQ.js → folder-icon-BmvMT_Zn.js} +1 -1
  111. package/dist/client/assets/{form-BLZF8D8t.js → form-fu44NVNg.js} +1 -1
  112. package/dist/client/assets/{general-1KXfjgkN.js → general-DbNOgsZ8.js} +1 -1
  113. package/dist/client/assets/{github-icon-BMwS5NHP.js → github-icon-CWspdq_p.js} +1 -1
  114. package/dist/client/assets/{hooks-Dx8_BRAv.js → hooks-DbYjnhUf.js} +1 -1
  115. package/dist/client/assets/{hosting-tab-HpfZRgGl.js → hosting-tab-Cgg1sG_u.js} +1 -1
  116. package/dist/client/assets/{index-816NyhfX.js → index-8Crc8SXX.js} +1 -1
  117. package/dist/client/assets/{index-DSjfYpae.js → index-BWDxLD35.js} +6 -6
  118. package/dist/client/assets/{index-B_lUDZ9B.js → index-BZsplvNT.js} +25 -25
  119. package/dist/client/assets/{index-CIa7ef_A.js → index-BjFdFeie.js} +1 -1
  120. package/dist/client/assets/{index-scWMkxhM.js → index-Ct5rA0-g.js} +1 -1
  121. package/dist/client/assets/{index-CiTAcnLT.js → index-CynzbMm4.js} +1 -1
  122. package/dist/client/assets/{index-BozOu9tc.js → index-DN-3imGW.js} +1 -1
  123. package/dist/client/assets/{index-BnQgQVCt.js → index-QjV5PBHw.js} +1 -1
  124. package/dist/client/assets/{index-Dd37LnAd.js → index-jvb5JpTh.js} +1 -1
  125. package/dist/client/assets/{index-CVcEeQb5.js → index-kyz_nUCi.js} +1 -1
  126. package/dist/client/assets/{index-redirect-CxyJoKV4.js → index-redirect-D3POnIh8.js} +1 -1
  127. package/dist/client/assets/{infiniteQueryObserver-CwY974C7.js → infiniteQueryObserver-OPx_IdGS.js} +1 -1
  128. package/dist/client/assets/{infra-billing-_yVOOYJd.js → infra-billing-CRZG7-9t.js} +1 -1
  129. package/dist/client/assets/{input-COX_MHDV.js → input-MZsLaCQZ.js} +1 -1
  130. package/dist/client/assets/{integration-icon-DCPy_52o.js → integration-icon-BN_v-AR8.js} +1 -1
  131. package/dist/client/assets/{invite-member-dialog-BHafD7C7.js → invite-member-dialog-BLEWp8gy.js} +1 -1
  132. package/dist/client/assets/{label-BWr2mmGs.js → label-CLbn6I-z.js} +1 -1
  133. package/dist/client/assets/{layout-C7V0gFy0.js → layout-Cndx-lJE.js} +1 -1
  134. package/dist/client/assets/{login-D1Nz670h.js → login-HuqqF-1k.js} +1 -1
  135. package/dist/client/assets/{markdown-BYbXDv7N.js → markdown-DAt9kqvI.js} +1 -1
  136. package/dist/client/assets/{mcp-app-renderer-C-wnTv6N.js → mcp-app-renderer-BWNi86_e.js} +1 -1
  137. package/dist/client/assets/{mcp-oauth-D4bG2HDW.js → mcp-oauth-Dwal9CtL.js} +1 -1
  138. package/dist/client/assets/{members-wTEykKnV.js → members-m6A5KiaB.js} +1 -1
  139. package/dist/client/assets/{monaco-editor-YC0wWRXT.js → monaco-editor-BDGu60Kj.js} +1 -1
  140. package/dist/client/assets/{monitoring-stats-row-BvTSmQaL.js → monitoring-stats-row-CbsfH-jC.js} +1 -1
  141. package/dist/client/assets/{multi-select-BmB9r4YL.js → multi-select-BWbyu4GD.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-D2Gp_wZF.js → oauth-callback-DI2eutSn.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-CoABKbtI.js → oauth-callback-ai-provider-Bq0wfzLm.js} +1 -1
  144. package/dist/client/assets/{onboarding-CftT1nG0.js → onboarding-CkiQtPaQ.js} +1 -1
  145. package/dist/client/assets/{org-layout-B1FHoYea.js → org-layout-d65Yldzy.js} +1 -1
  146. package/dist/client/assets/{organization-choice-CBe05Pnl.js → organization-choice-C88i014U.js} +1 -1
  147. package/dist/client/assets/{orgs-CtakA9D0.js → orgs-B2ed6u31.js} +1 -1
  148. package/dist/client/assets/{page-seo-form-ZY8ZbyqT.js → page-seo-form-wint5qXC.js} +1 -1
  149. package/dist/client/assets/{popover-BGEouS4O.js → popover-hKCv1VM6.js} +1 -1
  150. package/dist/client/assets/{post-calendar-C4PHtaZV.js → post-calendar-pp6SUqf1.js} +1 -1
  151. package/dist/client/assets/{post-editor-D6FwVD0B.js → post-editor-CmMNYzrc.js} +1 -1
  152. package/dist/client/assets/{primitives-BFeFdEFz.js → primitives-B-O1UE0A.js} +1 -1
  153. package/dist/client/assets/{profile-GTCpmwYq.js → profile-DM7rMY2F.js} +1 -1
  154. package/dist/client/assets/{project-app-view-BQZfjkf1.js → project-app-view-BNsHn5Uh.js} +1 -1
  155. package/dist/client/assets/{project-icon-mS3w82ZB.js → project-icon-D8jpcjeG.js} +1 -1
  156. package/dist/client/assets/{prompts-uofkMfaL.js → prompts-DkkC-eqS.js} +1 -1
  157. package/dist/client/assets/record-editor-BmqGb_Zo.js +1 -0
  158. package/dist/client/assets/redirect-editor-CyyPNlIj.js +1 -0
  159. package/dist/client/assets/{registry-layout-YOADDKZS.js → registry-layout-D4YhR76r.js} +1 -1
  160. package/dist/client/assets/registry-tFRQZakc.js +2 -0
  161. package/dist/client/assets/{reports-DYmaGRqW.js → reports-CH1NPn70.js} +1 -1
  162. package/dist/client/assets/repositories-VIP8TM6S.js +1 -0
  163. package/dist/client/assets/{repository-import-picker-DKCHkj_0.js → repository-import-picker-BtZlpocU.js} +1 -1
  164. package/dist/client/assets/repository-picker-nNmLRtMV.js +1 -0
  165. package/dist/client/assets/{require-capability-D7WPxMT8.js → require-capability-DeSNM-qc.js} +1 -1
  166. package/dist/client/assets/{required-auth-layout-BzHLhAY7.js → required-auth-layout-DDtOwDBP.js} +1 -1
  167. package/dist/client/assets/{reset-password-Db8RpI71.js → reset-password-CCPqEEuB.js} +1 -1
  168. package/dist/client/assets/{review-settings-CcgZS4Qu.js → review-settings-D7yIvq08.js} +1 -1
  169. package/dist/client/assets/{roles-D5JKlKQL.js → roles-ByD_eMtG.js} +1 -1
  170. package/dist/client/assets/{schema-7gcATtGd.js → schema-D-Yt_dVJ.js} +1 -1
  171. package/dist/client/assets/{scroll-area-BV67BPd_.js → scroll-area-BCJcp5qm.js} +1 -1
  172. package/dist/client/assets/{search-input-D-ESO_3b.js → search-input-CfYSReFc.js} +1 -1
  173. package/dist/client/assets/{secrets-DslGN31D.js → secrets-VhaU4I-n.js} +1 -1
  174. package/dist/client/assets/{sections-editor-Cl6Tz3LM.js → sections-editor-CbIx_gFP.js} +1 -1
  175. package/dist/client/assets/{select-DrcEVnZ2.js → select-NANblt2H.js} +1 -1
  176. package/dist/client/assets/{select-model-BxS8auXw.js → select-model-DUIjK9U7.js} +1 -1
  177. package/dist/client/assets/{self-tool-result-BJzf7f_D.js → self-tool-result-C6WuYAjK.js} +1 -1
  178. package/dist/client/assets/{seo-editor-BE4i-LT0.js → seo-editor-MilAfPeH.js} +1 -1
  179. package/dist/client/assets/settings-layout-qx89HSSt.js +1 -0
  180. package/dist/client/assets/{settings-sidebar-C6TvhfID.js → settings-sidebar-jJm3A_Wp.js} +1 -1
  181. package/dist/client/assets/{shell-controls-BxmxydXV.js → shell-controls-B0eaQlPV.js} +1 -1
  182. package/dist/client/assets/{shell-layout-Bx5eb743.js → shell-layout-CV8Ixl8_.js} +1 -1
  183. package/dist/client/assets/{skill-preview-DttG8VYN.js → skill-preview-DqgiXYj-.js} +1 -1
  184. package/dist/client/assets/{skills-DHAWKG4x.js → skills-PrvnaupX.js} +1 -1
  185. package/dist/client/assets/{sso-Bx-8EZnD.js → sso-gxLIhDQT.js} +1 -1
  186. package/dist/client/assets/{store-C6L68gEz.js → store-BTWjEs30.js} +1 -1
  187. package/dist/client/assets/store-registry-DIHiXDnw.js +2 -0
  188. package/dist/client/assets/{switch-6gOY7p_B.js → switch-2iiOxMIT.js} +1 -1
  189. package/dist/client/assets/{synced-repos-5BNmNf6C.js → synced-repos-Dq0mvbwm.js} +1 -1
  190. package/dist/client/assets/{table-CiqNoZ31.js → table-BI2-Msk8.js} +1 -1
  191. package/dist/client/assets/{tabs-Bkqs8f-5.js → tabs-KWxF94R5.js} +1 -1
  192. package/dist/client/assets/{task-board-DZmRPJBt.js → task-board-CIYSPfni.js} +1 -1
  193. package/dist/client/assets/{task-route-DFWTcvum.js → task-route-Qet1qaWg.js} +1 -1
  194. package/dist/client/assets/{tasks-CzRXtD5l.js → tasks-mySCoXvt.js} +1 -1
  195. package/dist/client/assets/{textarea-BPKnRKFj.js → textarea-BrZpmcDa.js} +1 -1
  196. package/dist/client/assets/{thread-intent-CFtt_nS5.js → thread-intent-D83P1YX-.js} +1 -1
  197. package/dist/client/assets/{thread-route-Cqs0O0Ez.js → thread-route-BJMImioz.js} +1 -1
  198. package/dist/client/assets/{toggle-group-dwqfI-na.js → toggle-group-B8axbJ88.js} +1 -1
  199. package/dist/client/assets/{toolbar-ClAV86ux.js → toolbar-CQ1c9TU5.js} +1 -1
  200. package/dist/client/assets/{toolbar-icon-button-_od4zlTM.js → toolbar-icon-button-TKQD0EoO.js} +1 -1
  201. package/dist/client/assets/{track-DR1-LwVK.js → track-DtXEYVxz.js} +1 -1
  202. package/dist/client/assets/{types-CXQqC75q.js → types-DIafnHyw.js} +1 -1
  203. package/dist/client/assets/{use-ai-providers-dsyrDnO9.js → use-ai-providers-C6jqS37t.js} +1 -1
  204. package/dist/client/assets/{use-automations-GJZG9mot.js → use-automations-0rXR_jur.js} +1 -1
  205. package/dist/client/assets/{use-autosave-edA5EL24.js → use-autosave-ONqifd0v.js} +1 -1
  206. package/dist/client/assets/{use-connection-BRJSF7XV.js → use-connection-BASuVort.js} +1 -1
  207. package/dist/client/assets/{use-copy-BYPpXCK2.js → use-copy-CfbW_sJF.js} +1 -1
  208. package/dist/client/assets/{use-create-virtual-mcp-CK3FIQpt.js → use-create-virtual-mcp-BFwR2LLd.js} +1 -1
  209. package/dist/client/assets/{use-date-fns-locale-xY0hnak0.js → use-date-fns-locale-rJyU17pO.js} +1 -1
  210. package/dist/client/assets/{use-debounced-autosave-BZz1Sh5T.js → use-debounced-autosave-DE2qvgUH.js} +1 -1
  211. package/dist/client/assets/{use-debounced-value-BBOX-Vjy.js → use-debounced-value-CPoNgVAT.js} +1 -1
  212. package/dist/client/assets/{use-decopilot-events-CrymWsPY.js → use-decopilot-events-Ba2e0p8u.js} +1 -1
  213. package/dist/client/assets/{use-delete-connection-BwDOMJxj.js → use-delete-connection-CLSY2jpQ.js} +1 -1
  214. package/dist/client/assets/{use-deployment-admin-BHuzOYuO.js → use-deployment-admin-DjyhNRVh.js} +1 -1
  215. package/dist/client/assets/{use-destination-route-OdrYRKi6.js → use-destination-route-BqyAy3Oj.js} +1 -1
  216. package/dist/client/assets/{use-file-configs-B8jXjEAi.js → use-file-configs-DEwUByyO.js} +1 -1
  217. package/dist/client/assets/{use-infinite-scroll-DQ_XrNCL.js → use-infinite-scroll-xe2j8vP-.js} +1 -1
  218. package/dist/client/assets/{use-join-requests-35XhVVHr.js → use-join-requests-DWRW4Nw6.js} +1 -1
  219. package/dist/client/assets/{use-mcp-auth-status-nQqJOE5j.js → use-mcp-auth-status-D_UjuiQT.js} +1 -1
  220. package/dist/client/assets/{use-mcp-client-xRPKqtBd.js → use-mcp-client-Czt5As3J.js} +1 -1
  221. package/dist/client/assets/{use-mcp-prompts-BH2161nI.js → use-mcp-prompts-BdJKj4LE.js} +1 -1
  222. package/dist/client/assets/{use-mcp-tools-DhWg8eQ9.js → use-mcp-tools-CrhdqfI1.js} +1 -1
  223. package/dist/client/assets/{use-members-CTCpXWvz.js → use-members-CjQN-pzi.js} +1 -1
  224. package/dist/client/assets/{use-navigate-to-agent-DEnupm5-.js → use-navigate-to-agent-CSvXEd48.js} +1 -1
  225. package/dist/client/assets/{use-org-auth-client-tX4pyhvY.js → use-org-auth-client-C1KTKuFD.js} +1 -1
  226. package/dist/client/assets/{use-org-notice-BrqrQNrZ.js → use-org-notice-CMibf9Lb.js} +1 -1
  227. package/dist/client/assets/{use-org-sso-ax_WPM-e.js → use-org-sso-Dt4n-uJ6.js} +1 -1
  228. package/dist/client/assets/{use-organization-roles-le6n88uk.js → use-organization-roles-BQX1Apru.js} +1 -1
  229. package/dist/client/assets/{use-organization-settings-DeqTyhDT.js → use-organization-settings-DUnuAPqv.js} +1 -1
  230. package/dist/client/assets/{use-panel-navigate-DufE4TQe.js → use-panel-navigate-CClWc1o5.js} +1 -1
  231. package/dist/client/assets/{use-registry-connections-CnQcaAch.js → use-registry-connections--YU44G6-.js} +1 -1
  232. package/dist/client/assets/{use-secrets-BKeXLH1Q.js → use-secrets-CAcbMNuV.js} +1 -1
  233. package/dist/client/assets/{use-section-preview-base-C_rHbM66.js → use-section-preview-base-BJKm5dYq.js} +1 -1
  234. package/dist/client/assets/{use-status-sounds-Cw977hrS.js → use-status-sounds-DRFYHjKx.js} +1 -1
  235. package/dist/client/assets/{use-tags-C-FksPQ4.js → use-tags-WZbYjj0q.js} +1 -1
  236. package/dist/client/assets/{use-view-mode-BzXvEzDG.js → use-view-mode-ClHuh5-e.js} +1 -1
  237. package/dist/client/assets/{use-virtual-mcp-8rv5G58S.js → use-virtual-mcp-B-ZmtBG6.js} +1 -1
  238. package/dist/client/assets/useInfiniteQuery-Cfow7UUh.js +1 -0
  239. package/dist/client/assets/useSuspenseInfiniteQuery-Btts--oR.js +1 -0
  240. package/dist/client/assets/{users-Hybgdqlv.js → users-CbysTzDo.js} +1 -1
  241. package/dist/client/assets/{variant-calendar-CVemYhc_.js → variant-calendar-COq-MIb2.js} +1 -1
  242. package/dist/client/assets/{view-mode-toggle-ZMf_pu5n.js → view-mode-toggle-CNRnTxNm.js} +1 -1
  243. package/dist/client/index.html +1 -1
  244. package/dist/server/cli.js +2 -2
  245. package/dist/server/server.js +2 -2
  246. package/package.json +1 -1
  247. package/dist/client/assets/api-keys-BpX-le77.js +0 -1
  248. package/dist/client/assets/app-editor-Dr01DzC2.js +0 -1
  249. package/dist/client/assets/record-editor-DZ_Ht_rf.js +0 -1
  250. package/dist/client/assets/redirect-editor-DLSqpC6c.js +0 -1
  251. package/dist/client/assets/registry-R33rTMC7.js +0 -2
  252. package/dist/client/assets/repositories-BgsdtnFm.js +0 -1
  253. package/dist/client/assets/repository-picker-hMZKUmSe.js +0 -1
  254. package/dist/client/assets/settings-layout-CUALOfuk.js +0 -1
  255. package/dist/client/assets/store-registry-DGHd6xRw.js +0 -2
  256. package/dist/client/assets/useInfiniteQuery-D-5t1K3F.js +0 -1
  257. package/dist/client/assets/useSuspenseInfiniteQuery-CzeWzIJb.js +0 -1
@@ -1 +1 @@
1
- import{bV as wn,b as ae,G as je,a as Yt,F as Dn,J as Tn,aq as Fn,ar as An,j as s,B as be,t as ce,c as Y,r as H,I as Bn,M as In,K as ue,l as re,h as Xe,o as ie,a4 as Je,a1 as Ze,a2 as et,n as it,d as Pn,a7 as kt,m as rt,bu as En,e as Le,bk as Vn,ap as Mn}from"./index-B_lUDZ9B.js";import{C as Ln}from"./collection-search-CkYj4zLQ.js";import{g as On,b as Rn,a as $n,e as Kn}from"./extract-connection-data-BAwcjEs9.js";import{u as Wt,a as Xt,g as zn,C as pt}from"./connection-card-kDFhfbya.js";import{D as Jt,b as Zt,c as en,d as tn,h as Un,e as Qn}from"./dialog-CIbVvLCQ.js";import{D as nn,a as sn,c as qn,b as on,e as Gn,f as rn,g as an,d as Hn}from"./drawer-CJFC-0Fv.js";import{d as me,a as pe,e as ge,b as he,c as xe,F as Et}from"./form-BLZF8D8t.js";import{I as _e}from"./input-COX_MHDV.js";import{S as Yn,b as Wn,a as Xn,d as Jn,c as $e}from"./select-DrcEVnZ2.js";import{T as Zn}from"./textarea-BPKnRKFj.js";import{b as ln}from"./use-connection-BRJSF7XV.js";import{n as tt,a as gt,i as cn}from"./Tool02-B4NLpHjP.js";import{j as ht,aK as es,aL as ts,aM as Vt,aN as ns,t as ss,aO as os,a7 as is,aP as rs,p as as,aQ as ls,a5 as xt,a4 as cs,ab as ds}from"./agent-icon-B0j2UorE.js";import{b as us,d as fs}from"./UserSquare-CWhx4AsN.js";import{s as ms}from"./XClose-DqZ5Ef7p.js";import{c as ps,i as Ge,a as Mt,E as gs,p as hs,b as xs,d as js}from"./connection-form-helpers-Bb00vWyO.js";import{a as jt}from"./authenticate-and-persist-oauth-AGm_2YIv.js";import{g as ys}from"./connection-slug-CITJ0kGN.js";import{C as bs}from"./collection-tabs-N31SqJ5M.js";import{u as Lt}from"./use-infinite-scroll-DQ_XrNCL.js";import{B as He}from"./badge-COtyjjy2.js";import{u as vs}from"./useSuspenseInfiniteQuery-CzeWzIJb.js";import{u as Cs}from"./use-mcp-client-xRPKqtBd.js";import{S as ks,e as Ns}from"./constants-Daqiz8AS.js";import{i as nt}from"./Check-BcH3mbli.js";import{s as _s}from"./Plus-UnZHTGwg.js";import{g as st}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-dsyrDnO9.js";import{a as ws}from"./use-file-configs-B8jXjEAi.js";import{d as Ds}from"./use-organization-settings-DeqTyhDT.js";import{r as Ts}from"./site-slug-uya6Wp4-.js";import{T as Fs,C as Nt,c as As,d as Bs,S as yt}from"./task-board-DZmRPJBt.js";import{a as Is}from"./decopilot-sse-pool-C6z-rtNE.js";import{u as Ps}from"./use-decopilot-events-CrymWsPY.js";import{A as Ot}from"./avatar-BusY4imm.js";import{h as ot,D as dn,b as un,g as fn,c as mn}from"./dropdown-menu-BHHO3QAR.js";import{a as _t,b as St,P as wt}from"./popover-BGEouS4O.js";import{e as Oe,a as Dt,c as Tt,d as Ce,b as Ft,C as At}from"./command-M5Hy4Bca.js";import{t as ze}from"./ChevronUp-CcnNOmjW.js";import{s as Es}from"./TrendUp01-Dug8rn5Y.js";import{a as Vs}from"./Settings02-CRvAtfO0.js";import{s as Rt}from"./User01-CDa2pgjQ.js";import{G as Ms}from"./github-icon-BMwS5NHP.js";import{P as Ls}from"./project-icon-mS3w82ZB.js";import{g as $t}from"./get-initials-D-f_fDFw.js";import{p as Os,a as Rs}from"./github-repo-CTPv5ZM2.js";import{i as $s}from"./AlertCircle-C3hNX-U3.js";import{i as Ks}from"./CheckCircle-efnyoYbr.js";import{a as pn}from"./DotsVertical-Cha1vnex.js";import{s as zs}from"./Eye-s_5OI3rP.js";import{i as Us}from"./Shield01-DPL17IT0.js";const Qs=wn("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function qs({open:t,onOpenChange:e,onCreated:n}){const o=ae(),{org:r}=je(),{data:a}=Yt.useSession(),{stdioEnabled:i}=Dn(),m=Tn(),c=ln(),d=Wt(),p=Xt(d,"").items,l=Fn({resolver:An(ps),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=l.watch("ui_type"),j=l.watch("connection_url"),g=l.watch("npx_package"),x=Ge({uiType:f,connectionUrl:j??"",npxPackage:g??""})??Mt({uiType:f,connectionUrl:j??"",registryItems:p}),y=h=>{const _=h.trim();if(!_)return;const w=!!l.formState.dirtyFields.title,P=!!l.formState.dirtyFields.description,V=!!l.formState.dirtyFields.env_vars,N=F=>{if(F&&(!w&&!l.getValues("title").trim()&&F.title&&l.setValue("title",F.title,{shouldDirty:!1}),!P&&!(l.getValues("description")??"").trim()&&F.description&&l.setValue("description",F.description,{shouldDirty:!1}),!V&&F.envVarKeys?.length)){const $=l.getValues("env_vars")??[],I=new Set($.map(R=>R.key)),B=F.envVarKeys.filter(R=>!I.has(R));B.length>0&&l.setValue("env_vars",[...$,...B.map(R=>({key:R,value:""}))],{shouldDirty:!0})}},T=hs(_);if(T&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",T.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(Ge({uiType:"NPX",npxPackage:T.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";l.setValue("ui_type",F,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),N(Ge({uiType:F,connectionUrl:_})??Mt({uiType:F,connectionUrl:_,registryItems:p}));return}f==="NPX"&&N(Ge({uiType:"NPX",npxPackage:_}))},S=h=>{h||l.reset(),e(h)},b=async h=>{let _,w=null,P=null,V=null;h.ui_type==="NPX"?(_="STDIO",w="",V=xs(h.npx_package||"",h.env_vars||[])):h.ui_type==="STDIO"?(_="STDIO",w="",V=js(h.stdio_command||"",h.stdio_args||"",h.stdio_cwd,h.env_vars||[])):(_=h.ui_type,w=h.connection_url||"",P=h.connection_token||null);const N=On("conn");try{await c.create.mutateAsync({id:N,title:h.title,description:h.description||null,connection_type:_,connection_url:w,connection_token:P,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:r.id,icon:h.icon??null,app_name:null,app_id:null,connection_headers:V,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),n?.(N)}catch{ce.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},k=o("connections.createConnectionDialog.title"),v=o("connections.createConnectionDialog.description"),C=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(me,{control:l.control,name:"ui_type",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.typeLabel")}),s.jsxs(Yn,{value:h.value,onValueChange:h.onChange,children:[s.jsx(he,{children:s.jsx(Wn,{children:s.jsx(Xn,{})})}),s.jsxs(Jn,{children:[s.jsx($e,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),s.jsx($e,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),s.jsx($e,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(tt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),s.jsx($e,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(xe,{})]})}),f==="NPX"&&s.jsx(me,{control:l.control,name:"npx_package",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("npx_package",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),f==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(me,{control:l.control,name:"stdio_command",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.commandLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"stdio_args",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.argumentsLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"stdio_cwd",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...h,value:h.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(xe,{})]})})]}),(f==="NPX"||f==="STDIO")&&s.jsx(me,{control:l.control,name:"env_vars",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(he,{children:s.jsx(gs,{value:h.value??[],onChange:h.onChange})}),s.jsx(xe,{})]})}),f!=="NPX"&&f!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(me,{control:l.control,name:"connection_url",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.urlLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("connection_url",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"connection_token",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(he,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...h,value:h.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"title",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.nameLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...h})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"description",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.descriptionLabel")}),s.jsx(he,{children:s.jsx(Zn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...h,value:h.value??""})}),s.jsx(xe,{})]})})]});return m?s.jsx(nn,{open:t,onOpenChange:S,children:s.jsxs(sn,{className:"max-h-[90vh]",children:[s.jsx(qn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(on,{children:k}),s.jsx(Gn,{className:"mt-1",children:v})]}),s.jsx(rn,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(ms,{size:16})})})]})}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),s.jsx(an,{children:s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(Jt,{open:t,onOpenChange:S,children:s.jsxs(Zt,{className:"sm:max-w-[525px]",children:[s.jsxs(en,{children:[s.jsx(tn,{children:k}),s.jsx(Un,{children:v})]}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"py-4",children:D}),s.jsxs(Qn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function Gs(t){const e=Y.c(72),{mode:n,agentId:o,addedConnectionIds:r,onAdd:a,onCloneAndAdd:i,onConnectAndAdd:m,connectingItemId:c,search:d,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=t,f=n===void 0?"add":n,j=l===void 0?"connected":l,g=ae(),{org:x}=je(),y=H.useDeferredValue(d),S=d!==y;let b;e[0]!==y?(b=y.trim().toLowerCase(),e[0]=y,e[1]=b):b=e[1];const k=b;let v;e[2]!==j?(v=A=>A??j,e[2]=j,e[3]=v):v=e[3];const[C,D]=Bn(In.connectionsTab(x.slug)+(j==="all"?":home-modal":":agent-modal"),v);let h;e[4]!==C||e[5]!==D?(h=A=>{A!==C&&ie("connections_dialog_tab_changed",{to_tab:A}),D(A)},e[4]=C,e[5]=D,e[6]=h):h=e[6];const _=h;let w;e[7]!==x.id||e[8]!==x.slug?(w={connectionId:ks,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=w):w=e[9];const P=Cs(w),V=y?.trim().split(/\s+/).filter(Boolean)??[],N=V.length>0?{operator:"or",conditions:V.flatMap(to)}:void 0,T={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},F=JSON.stringify(T),{data:$,fetchNextPage:I,hasNextPage:B,isFetchingNextPage:R}=vs({queryKey:ue.collectionListInfinite(P,x.id,"","CONNECTIONS",F),queryFn:async A=>{const{pageParam:q}=A,ye=q===void 0?0:q;return(await P.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ye}})).structuredContent},initialPageParam:0,getNextPageParam:Zs,staleTime:3e4}),G=$?.pages.flatMap(Js)??[],E=zn(G),U=new Set(G.filter(Xs).map(Ws)),M=Wt(),Q=Xt(M,y),Z=Lt(Q.loadMore,Q.hasMore,Q.isLoadingMore),ee=Lt(I,B??!1,R),K=C==="all"||!!k,ne=K?Q.items.filter(A=>{const q=Rn(A);if(q&&U.has(q))return!1;if(!k)return!0;const ye=st(A._meta),ke=[A.title,A.description,A.name,A.server?.title,A.server?.description,A.server?.name,ye?.friendly_name,ye?.friendlyName].filter(Boolean).join(" ").toLowerCase();return V.some(fe=>ke.includes(fe.toLowerCase()))}):[],W=ne.filter(Ys),X=ne.filter(Hs);let J;e[10]!==r?(J=A=>A.some(q=>r.has(q.id)),e[10]=r,e[11]=J):J=e[11];const te=J;let se;e[12]!==r||e[13]!==o||e[14]!==c||e[15]!==te||e[16]!==f||e[17]!==a||e[18]!==p||e[19]!==i||e[20]!==g?(se=(A,q,ye,ke,fe)=>{const qe=te(fe),Me=fe.find(Ne=>!r.has(Ne.id)),le=fe[0];if(f==="browse"){const Ne=ys(le);return s.jsx(pt,{connection:{title:q,icon:ye,description:fe.length>1?`${fe.length} instances`:ke??void 0},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{ie("connection_browse_clicked",{app_name:le.app_name??null,connection_id:le.id,instances_count:fe.length}),p?.(Ne)}},A)}return s.jsx(pt,{connection:{title:q,icon:ye,description:ke},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[qe&&s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(ie("connection_add_clicked",{action:"use_existing",app_name:le.app_name??null,connection_id:Me.id}),o&&ie("agent_connection_attached",{agent_id:o,connection_id:Me.id,app_name:le.app_name??null,mode:"existing"}),a(Me.id)):(ie("connection_add_clicked",{action:"clone",app_name:le.app_name??null,base_connection_id:le.id}),i(le))},children:g("virtualMcp.connectionDialogContent.add")})]})},A)},e[12]=r,e[13]=o,e[14]=c,e[15]=te,e[16]=f,e[17]=a,e[18]=p,e[19]=i,e[20]=g,e[21]=se):se=e[21];const L=se;let O;e[22]!==c||e[23]!==f||e[24]!==m||e[25]!==g?(O=A=>{const q=st(A._meta),ye=q?.friendlyName||q?.friendly_name||A.server?.title||A.title||A.server?.name||A.name||A.id||"",ke=A.server?.description||A.description||null,fe=A.server?.icons?.[0]?.src||$n(A.server?.repository)||null,qe=q?.official===!0,Me=q?.verified===!0,le=q?.owner==="deco";return s.jsx(pt,{connection:{title:ye,description:ke,icon:fe},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[le&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!le&&qe&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!le&&!qe&&Me&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),ie("connection_add_clicked",{action:"connect_new",registry_item_id:A.id,app_name:q?.friendlyName||A.server?.name||A.name||null}),m(A)},children:c===A.id?s.jsx(Xe,{className:"size-3.5"}):g(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${A.id}`)},e[22]=c,e[23]=f,e[24]=m,e[25]=g,e[26]=O):O=e[26];const oe=O;let z;e[27]!==C||e[28]!==_||e[29]!==u||e[30]!==k||e[31]!==g?(z=!k&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(bs,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:A=>_(A)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{ie("connections_dialog_custom_clicked"),u()},children:[s.jsx(_s,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=u,e[30]=k,e[31]=g,e[32]=z):z=e[32];const ve=S&&"opacity-50 pointer-events-none";let de;e[33]!==ve?(de=re("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=de):de=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Te;e[35]!==L?(Te=A=>{if(A.type==="group")return L(A.key,A.title,A.icon,null,A.connections);const q=A.connection;return L(q.id,q.title,q.icon,q.description??null,[q])},e[35]=L,e[36]=Te):Te=e[36];const ct=E.map(Te);let Fe;e[37]!==ee?(Fe=s.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[37]=ee,e[38]=Fe):Fe=e[38];let Ae;e[39]!==R?(Ae=R&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[39]=R,e[40]=Ae):Ae=e[40];const dt=K&&W.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(gt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ut=K&&W.map(oe),ft=K&&X.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),mt=K&&X.map(oe);let Be;e[41]!==Z||e[42]!==M||e[43]!==K?(Be=K&&M.length>0&&s.jsx("div",{ref:Z,className:"col-span-full h-1"}),e[41]=Z,e[42]=M,e[43]=K,e[44]=Be):Be=e[44];let Ie;e[45]!==Q.isLoadingMore||e[46]!==K?(Ie=K&&Q.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[45]=Q.isLoadingMore,e[46]=K,e[47]=Ie):Ie=e[47];let Pe;e[48]!==ct||e[49]!==Fe||e[50]!==Ae||e[51]!==dt||e[52]!==ut||e[53]!==ft||e[54]!==mt||e[55]!==Be||e[56]!==Ie?(Pe=s.jsxs("div",{className:De,children:[ct,Fe,Ae,dt,ut,ft,mt,Be,Ie]}),e[48]=ct,e[49]=Fe,e[50]=Ae,e[51]=dt,e[52]=ut,e[53]=ft,e[54]=mt,e[55]=Be,e[56]=Ie,e[57]=Pe):Pe=e[57];let Ee;e[58]!==C||e[59]!==E.length||e[60]!==X||e[61]!==d||e[62]!==g||e[63]!==W?(Ee=E.length===0&&W.length===0&&X.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):g(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=E.length,e[60]=X,e[61]=d,e[62]=g,e[63]=W,e[64]=Ee):Ee=e[64];let Ve;e[65]!==de||e[66]!==Pe||e[67]!==Ee?(Ve=s.jsxs("div",{className:de,children:[Pe,Ee]}),e[65]=de,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Qe;return e[69]!==z||e[70]!==Ve?(Qe=s.jsxs(s.Fragment,{children:[z,Ve]}),e[69]=z,e[70]=Ve,e[71]=Qe):Qe=e[71],Qe}function Hs(t){return!t.verified&&!st(t._meta)?.verified&&!t.meta?.verified}function Ys(t){return t.verified||st(t._meta)?.verified||t.meta?.verified}function Ws(t){return t.app_name}function Xs(t){return t.app_name}function Js(t){return t?.items??[]}function Zs(t,e){if(t?.hasMore)return e.reduce(eo,0)}function eo(t,e){return t+(e?.items?.length??0)}function to(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function Zi({open:t,onOpenChange:e,defaultTab:n,initialSearch:o="",...r}){const a=ae(),i=r.mode??"add",m="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:N=>{},u=(N,T,F)=>{m&&ie("agent_connection_attached",{agent_id:m,connection_id:N,app_name:T,mode:F})},[p,l]=H.useState(null),[f,j]=H.useState(o),[g,x]=H.useState(!1),[y,S]=H.useState(t);t!==y&&(S(t),t&&j(o));const{org:b}=je(),{data:k}=Yt.useSession(),v=ln(),C=it(),D=Pn(),h=N=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:b.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const T=N.queryKey;return T[1]===b.id&&T[3]==="collection"&&T[4]==="CONNECTIONS"}})},w=async(N,T)=>{ie("connection_oauth_succeeded",{connection_id:N,flow:T});const F=new URL(`/api/${b.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ue.isMCPAuthenticated(F.href,null)}),_()},P=async N=>{l(N.app_name??N.id);try{const F=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await v.create.mutateAsync({title:F,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,B=await jt({connectionId:I,orgId:b.id,orgSlug:b.slug,persistFallback:R=>v.update.mutateAsync({id:I,data:{connection_token:R}}).then(()=>{})});if(B.ran&&!B.ok){ie("connection_oauth_failed",{connection_id:I,flow:"clone",error:B.error??"no_token"}),ce.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await v.delete.mutateAsync(I);return}B.ran&&await w(I,"clone"),u(I,N.app_name??null,"clone"),d(I)}catch(T){console.error("Failed to add connection:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},V=async N=>{if(!(!b||!k?.user?.id)){l(N.id);try{const T=Kn(N,b.id,k.user.id,{remoteIndex:0}),F=T.connection_type==="STDIO",$=!!T.connection_url,I=F&&T.connection_headers&&typeof T.connection_headers=="object"&&"command"in T.connection_headers;if(!$&&!I){ce.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:B}=await v.create.mutateAsync(T),R=await jt({connectionId:B,orgId:b.id,orgSlug:b.slug,persistFallback:G=>v.update.mutateAsync({id:B,data:{connection_token:G}}).then(()=>{})});if(R.ran&&!R.ok){ie("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:R.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),u(B,T.app_name??null,"new"),d(B);return}R.ran?(await w(B,"connect_new"),ce.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):ce.success(a("virtualMcp.addConnectionDialog.connected")),u(B,T.app_name??null,"new"),d(B)}catch(T){console.error("Failed to connect:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return s.jsxs(Jt,{open:t,onOpenChange:e,children:[s.jsxs(Zt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(en,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(tn,{className:"text-base font-semibold",children:a(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(Ln,{value:f,onChange:j,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Gs,{mode:i,agentId:m,addedConnectionIds:c,onAdd:d,onCloneAndAdd:P,onConnectAndAdd:V,connectingItemId:p,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:h,defaultTab:n})})]}),s.jsx(qs,{open:g,onOpenChange:x,onCreated:async N=>{x(!1);const T=await jt({connectionId:N,orgId:b.id,orgSlug:b.slug,persistFallback:F=>v.update.mutateAsync({id:N,data:{connection_token:F}}).then(()=>{})});if(T.ran&&!T.ok){ie("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:T.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:T.error??"no token received"})}),u(N,null,"custom"),d(N),e(!1);return}T.ran&&await w(N,"custom_create"),u(N,null,"custom"),d(N),e(!1)}})]})}const Kt=new Map;function er(){const{org:t}=je(),e=kt(),n=Ss(),o=n.find(x=>x.providerId==="deco"),{data:r,isLoading:a,refetch:i,isFetching:m}=rt({queryKey:ue.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const x=Kt.get(t.id);u.current.get(t.id)&&x!=null&&c>x&&ie("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Kt.set(t.id,c),u.current.set(t.id,!0)}const p=!!o,l=c!=null&&c>0,f=c!=null&&c===0,j=c!=null&&c===200,g=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:d,hasCredits:l,isZeroBalance:f,isInitialFreeCredit:j,hasOnlyDecoProvider:g,isLoading:a,isFetching:m,refetch:i}}const no=4,so="TASK";function oo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,no)||so}function io(t,e){return e==null?null:`${oo(t)}-${String(e).padStart(2,"0")}`}const ro=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ao(t){const e=ro.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function zt(t){const e=Y.c(8),{size:n,className:o}=t,r=n===void 0?16:n;let a;e[0]!==r?(a={width:r,height:r},e[0]=r,e[1]=a):a=e[1];let i;e[2]!==o?(i=re("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let m;return e[4]!==r||e[5]!==a||e[6]!==i?(m=s.jsx("img",{src:Ns,alt:"Super Agent",width:r,height:r,style:a,className:i}),e[4]=r,e[5]=a,e[6]=i,e[7]=m):m=e[7],m}const Ue=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],lo=["overview","reports","board","site-editor"],Bt=1,co=["assets","hosting","e2e","analytics","cdn"];function tr(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const o=e?.id===t?e:n?.id===t?n:null;return{project:o,resolvedScopeId:o?t:null}}function nr(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function gn(t,e){const n=new Set(t??[]);if(e!==Bt)for(const o of lo)n.add(o);return Ue.filter(o=>n.has(o))}function uo(t){return Ue.some(e=>e===t)}function fo(t){return co.some(e=>e===t)}function mo(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function sr(t,e,n){const o=mo(e,n);return t?o:{...o,overview:!0,reports:!0,board:!0}}function or(t,e,n){const o=new Set(gn(t,n));return Ue.filter(r=>e[r]&&o.has(r))}function ir(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function rr(t){return Ue.filter(e=>t[e])}function po(t,e,n){return!uo(t)||e[t]?!1:fo(t)?!(t==="assets"?n.assets:n.siteAccess):!0}function ar(t,e,n,o,r){return po(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!o.includes("content")||t==="code"&&r&&!o.includes("code")}function lr(t,e,n,o){const r=new Set(gn(t,o));return n?r.add(e):r.delete(e),Ue.filter(a=>r.has(a))}function Ke(t,e){return ue.optimisticProjectSidebarViews(t,e)}function Ye(t){return typeof t=="object"&&t!==null}function hn(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function go(t,e){if(!Ye(t))return t;if("item"in t&&Ye(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!Ye(t.structuredContent))return t;const n=t.structuredContent.items;if(!Array.isArray(n))return t;let o=!1;const r=n.map(a=>!Ye(a)||a.id!==e.id?a:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:r}}:t}function cr(t,e,n){t.setQueriesData({predicate:o=>hn(o.queryKey,e)},o=>go(o,n))}function dr(t,e,n){const o=t.getQueriesData({predicate:r=>hn(r.queryKey,e)&&r.queryKey[5]===n});for(const[,r]of o)if(r?.item?.id===n)return r.item;return null}function It(t,e,n){return t.getQueryData(Ke(e,n))??null}function ho(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Bt};const n=t?.sidebarViews;return{sidebarViews:n===null?null:n?[...n]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function ur(t,e,n){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Bt}:n===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:ho(n,null)}function xo(t,e,n,o,r){const a=It(t,e,n),i={revision:(a?.revision??0)+1,views:[...o],rollbackViews:a?[...a.rollbackViews]:[...r]};return t.setQueryData(Ke(e,n),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function jo(t,e,n){const o=It(t,e,n);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function xn(t,e){const n=new Set(t),o=new Set(e);return n.size===o.size&&[...n].every(r=>o.has(r))}function fr(t){return t?!xn(t.views,t.persistedViews):!1}function yo(t,e,n,{snapshot:o,saved:r,authoritativeViews:a}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=It(t,e,n);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const m=a!==void 0?[...a]:r?[...o.views]:null,c={...i,rollbackViews:m??i.rollbackViews};return c.rollbackViews!==i.rollbackViews&&t.setQueryData(Ke(e,n),c),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(Ke(e,n),null),{settledLatest:!0,reconciledViews:r?m&&!xn(m,o.views)?m:null:[...c.rollbackViews]})}function mr(t){const e=Y.c(5),{org:n}=je(),o=t??"";let r;e[0]!==n.id||e[1]!==o?(r=Ke(n.id,o),e[0]=n.id,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==r?(a={queryKey:r,queryFn:bo,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=r,e[4]=a):a=e[4];const{data:i}=rt(a);return i?.views}async function bo(){return null}function pr(t){const e=Y.c(4),{org:n}=je(),o=it();let r;return e[0]!==n||e[1]!==o||e[2]!==t?(r={stage:(a,i)=>xo(o,n.id,t,a,i),snapshot:()=>jo(o,n.id,t),settle:a=>yo(o,n.id,t,a)},e[0]=n,e[1]=o,e[2]=t,e[3]=r):r=e[3],r}function vo(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(o=>{const r=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===n||r===n||r===`deco-assets-${n}`})??null}function gr(t){const e=Y.c(10),{org:n}=je(),o=En(),r=Ds(),a=ws(),i=Ts(t),m=o.hostingEnabled===!0,c=o.monitorEnabled===!0||o.auth.localMode===!0,d=(m||c)&&!!i,u=rt({queryKey:ue.hostingAccess(n.slug,i??""),queryFn:async()=>{const v=await fetch(`/api/${n.slug}/hosting/${encodeURIComponent(i??"")}/access`);return v.ok?await v.json():{owned:!1,canWrite:!1}},enabled:d,staleTime:6e4}),p=u.data?.owned===!0,l=!!vo(a.data?.configs??[],i),f=m&&p&&r.hosting,j=m&&p&&r.e2e,g=m&&p&&r.analytics,x=c&&p&&r.monitor;let y;e[0]!==l||e[1]!==f||e[2]!==j||e[3]!==g||e[4]!==x?(y={assets:l,hosting:f,e2e:j,analytics:g,cdn:x},e[0]=l,e[1]=f,e[2]=j,e[3]=g,e[4]=x,e[5]=y):y=e[5];const S=!!i&&a.isPending,b=d&&u.isPending;let k;return e[6]!==y||e[7]!==S||e[8]!==b?(k={presence:y,assetsPending:S,siteAccessPending:b},e[6]=y,e[7]=S,e[8]=b,e[9]=k):k=e[9],k}const Ut=()=>0;function Co(t){const{orgSlug:e,enabled:n=!0,onUpdate:o,onDelete:r,onResync:a}=t,i=H.useRef(o);i.current=o;const m=H.useRef(r);m.current=r;const c=H.useRef(a);c.current=a;const d=H.useRef(null),u=H.useRef(n),p=H.useRef(e);(!d.current||u.current!==n||p.current!==e)&&(u.current=n,p.current=e,d.current=f=>{if(!n||!e)return()=>{};const j=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===Fs?m.current?.(x.data.id):i.current(x.data)),f()};return Is.subscribe(e,j,()=>c.current?.())}),H.useSyncExternalStore(d.current,Ut,Ut)}function ko(t,e){return{queryKey:ue.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function No(){const t=Y.c(21),{org:e,locator:n}=je(),o=it();let r;t[0]!==n?(r=ue.taskBoardItems(n),t[0]=n,t[1]=r):r=t[1];const a=r;let i;t[2]!==n||t[3]!==o||t[4]!==a?(i=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.some(j=>j.id===l.id)?f.items.map(j=>j.id===l.id?l:j):[l,...f.items]}),o.invalidateQueries({queryKey:ue.taskBoardActivity(n,l.id)})},t[2]=n,t[3]=o,t[4]=a,t[5]=i):i=t[5];let m,c;t[6]!==o||t[7]!==a?(m=()=>{o.invalidateQueries({queryKey:a})},c=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.filter(j=>j.id!==l)})},t[6]=o,t[7]=a,t[8]=m,t[9]=c):(m=t[8],c=t[9]);let d;t[10]!==e.slug||t[11]!==i||t[12]!==m||t[13]!==c?(d={orgSlug:e.slug,onUpdate:i,onResync:m,onDelete:c},t[10]=e.slug,t[11]=i,t[12]=m,t[13]=c,t[14]=d):d=t[14],Co(d);let u;t[15]!==o||t[16]!==a?(u=l=>{const f=l.subject,j=l.data.status;o.cancelQueries({queryKey:a}),o.setQueryData(a,g=>g&&{...g,items:g.items.map(x=>x.threads.some(y=>y.threadId===f)?{...x,threads:x.threads.map(y=>y.threadId===f?{...y,status:j}:y)}:x)})},t[15]=o,t[16]=a,t[17]=u):u=t[17];let p;t[18]!==e.slug||t[19]!==u?(p={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=p):p=t[20],Ps(p)}function hr(){const t=Y.c(9),{locator:e}=je(),n=kt();let o;t[0]!==e||t[1]!==n?(o=ko(e,n),t[0]=e,t[1]=n,t[2]=o):o=t[2];const r=rt(o);No();let a;t[3]!==r.data?.items?(a=r.data?.items??[],t[3]=r.data?.items,t[4]=a):a=t[4];let i;return t[5]!==r.error||t[6]!==r.isLoading||t[7]!==a?(i={items:a,isLoading:r.isLoading,error:r.error},t[5]=r.error,t[6]=r.isLoading,t[7]=a,t[8]=i):i=t[8],i}function xr(){const t=Y.c(70),{org:e,locator:n}=je(),o=kt(),r=it(),a=ae();let i;t[0]!==n?(i=ue.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const m=i;let c;t[2]!==r||t[3]!==m?(c=()=>r.invalidateQueries({queryKey:m}),t[2]=r,t[3]=m,t[4]=c):c=t[4];const d=c;let u;t[5]!==o?(u=E=>o.call("TASK_BOARD_ITEM_CREATE",E),t[5]=o,t[6]=u):u=t[6];let p;t[7]!==d||t[8]!==u?(p={mutationFn:u,onSuccess:d},t[7]=d,t[8]=u,t[9]=p):p=t[9];const l=Le(p);let f;t[10]!==o?(f=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[10]=o,t[11]=f):f=t[11];let j;t[12]!==r||t[13]!==m?(j=async E=>{await r.cancelQueries({queryKey:m});const U=r.getQueryData(m);return r.setQueryData(m,M=>M&&{...M,items:M.items.map(Q=>Q.id===E.id?{...Q,...E}:Q)}),{previous:U}},t[12]=r,t[13]=m,t[14]=j):j=t[14];let g;t[15]!==e?(g=(E,U)=>{U.status==="done"&&ie("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==r||t[18]!==m?(x=(E,U,M)=>{M?.previous&&r.setQueryData(m,M.previous)},t[17]=r,t[18]=m,t[19]=x):x=t[19];let y;t[20]!==d||t[21]!==n||t[22]!==r?(y=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[20]=d,t[21]=n,t[22]=r,t[23]=y):y=t[23];let S;t[24]!==f||t[25]!==j||t[26]!==g||t[27]!==x||t[28]!==y?(S={mutationFn:f,onMutate:j,onSuccess:g,onError:x,onSettled:y},t[24]=f,t[25]=j,t[26]=g,t[27]=x,t[28]=y,t[29]=S):S=t[29];const b=Le(S);let k;t[30]!==o?(k=E=>o.call("TASK_BOARD_ITEM_DELETE",{id:E}),t[30]=o,t[31]=k):k=t[31];let v;t[32]!==d||t[33]!==a?(v=E=>{ce.error(E instanceof Error&&E.message?E.message:a("taskBoard.taskBoard.deleteError")),d()},t[32]=d,t[33]=a,t[34]=v):v=t[34];let C;t[35]!==d||t[36]!==k||t[37]!==v?(C={mutationFn:k,onSuccess:d,onError:v},t[35]=d,t[36]=k,t[37]=v,t[38]=C):C=t[38];const D=Le(C);let h;t[39]!==o?(h=async E=>{const U=await Promise.allSettled(E.map(M=>o.call("TASK_BOARD_ITEM_DELETE",{id:M})));return{total:E.length,failed:U.filter(_o).length}},t[39]=o,t[40]=h):h=t[40];let _,w;t[41]!==a?(_=E=>{const{total:U,failed:M}=E;M!==0&&ce.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(M),total:String(U)}))},w=()=>ce.error(a("taskBoard.taskBoard.deleteError")),t[41]=a,t[42]=_,t[43]=w):(_=t[42],w=t[43]);let P;t[44]!==d||t[45]!==h||t[46]!==_||t[47]!==w?(P={mutationFn:h,onSuccess:_,onError:w,onSettled:d},t[44]=d,t[45]=h,t[46]=_,t[47]=w,t[48]=P):P=t[48];const V=Le(P);let N;t[49]!==o?(N=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[49]=o,t[50]=N):N=t[50];let T;t[51]!==d||t[52]!==N?(T={mutationFn:N,onSuccess:d},t[51]=d,t[52]=N,t[53]=T):T=t[53];const F=Le(T);let $;t[54]!==o?($=E=>o.call("TASK_BOARD_ITEM_RERUN",E),t[54]=o,t[55]=$):$=t[55];let I;t[56]!==d||t[57]!==n||t[58]!==r?(I=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[56]=d,t[57]=n,t[58]=r,t[59]=I):I=t[59];let B;t[60]!==$||t[61]!==I?(B={mutationFn:$,onSettled:I},t[60]=$,t[61]=I,t[62]=B):B=t[62];const R=Le(B);let G;return t[63]!==l||t[64]!==F||t[65]!==D||t[66]!==V||t[67]!==R||t[68]!==b?(G={create:l,update:b,remove:D,removeMany:V,link:F,rerun:R},t[63]=l,t[64]=F,t[65]=D,t[66]=V,t[67]=R,t[68]=b,t[69]=G):G=t[69],G}function _o(t){return t.status==="rejected"}const So=["ended_after_delivery","superseded"];function wo(t){return!!t&&So.includes(t)}function jr(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function yr(t){return t.failureKind!=="superseded"}function jn(t){return t.threads.some(e=>e.status==="requires_action")}function br(t){return t.status==="in_review"&&!t.assigneeId}function vr(t){return jn(t)}function Cr(t){return t.status==="in_progress"&&jn(t)?"text-warning animate-pulse":bn(t.status).iconClassName}function kr(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!wo(n.failureKind))?"failed":null}function Nr(t,e,n){const o=t.findIndex(u=>u.id===n),r=e===n?t[o+1]?.id??null:e,a=t.filter(u=>u.id!==n),i=r?a.findIndex(u=>u.id===r):-1,m=i===-1?a.length:i,c=a[m-1],d=a[m];return c&&d?(c.sortOrder+d.sortOrder)/2:c?c.sortOrder+1:d?d.sortOrder-1:0}function _r(t,e){return Array.from({length:e},(n,o)=>t-(e-1-o)*1e-4)}const Do=["archived"],yn={triage:{labelKey:"taskBoard.config.statusBacklog",icon:$s,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:pn,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:is,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:zs,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:os,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:fs,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ss,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Ks,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Vn,iconClassName:"text-muted-foreground"}},To={icon:pn,iconClassName:"text-muted-foreground"},Fo=yn;function bn(t){return Fo[t]??To}function Sr(t,e){const n=yn[t];return{label:n?e(n.labelKey):t,visual:bn(t)}}const wr=["bug","feature","chore","spike","security"],Dr={bug:{labelKey:"taskBoard.config.typeBug",icon:Qs,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:ls,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:as,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:rs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Us,iconClassName:"text-purple-500"}};function bt(t){return Bs.includes(t)}function Tr(t){return Nt.filter(e=>t||!bt(e))}function Fr({deliveryEnabled:t,shownLanes:e,occupied:n}){const o=Nt.filter(i=>t||!bt(i)||n.includes(i)),r=o.filter(i=>Do.includes(i)||!t&&bt(i)),a=r.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!a.includes(i)),hidden:a,hideable:r}}const Qt="lane:";function Ao(t){return Nt.includes(t)}function Ar({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),o=n.startsWith(Qt)?n.slice(Qt.length):e(n);return o!==void 0&&Ao(o)?o:null}const Bo=["none","low","medium","high","urgent"],We={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Vt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ns,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Vt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:ts,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:es,iconClassName:"text-destructive"}};function Br(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Io*864e5?"soon":null}const Io=3;function qt(t){return`color-mix(in oklab, ${t??As} var(--user-color-strength), transparent)`}function vn(t){return t?.projects.length===1?t.projects[0]:void 0}function Po(t){return vn(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Cn(t){const e=Y.c(6),{entry:n}=t;let o;e[0]!==n?(o=vn(n),e[0]=n,e[1]=o):o=e[1];const r=o;if(r){let i;return e[2]!==r.icon||e[3]!==r.title?(i=s.jsx(Ls,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=i):i=e[4],i}let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(Ms,{className:"size-3"})}),e[5]=a):a=e[5],a}function Eo(t){const e=Y.c(14),{entry:n}=t;let o;e[0]!==n?(o=Po(n),e[0]=n,e[1]=o):o=e[1];const r=o;let a;e[2]!==n?(a=s.jsx(Cn,{entry:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==n.title?(i=s.jsx("span",{className:"truncate",children:n.title}),e[4]=n.title,e[5]=i):i=e[5];let m;e[6]!==r?(m=r&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=m):m=e[7];let c;e[8]!==i||e[9]!==m?(c=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[8]=i,e[9]=m,e[10]=c):c=e[10];let d;return e[11]!==a||e[12]!==c?(d=s.jsxs(s.Fragment,{children:[a,c]}),e[11]=a,e[12]=c,e[13]=d):d=e[13],d}const at="__no_repo__";function Se(t){return(t??"").trim().toLowerCase()}function Vo(t,e){const n=(t.created_at??"").localeCompare(e.created_at??"");return n!==0?n:t.id.localeCompare(e.id)}function Mo(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Ir(t,e=[]){const n=new Map,o=new Map,r=[],a=u=>{const p=Se(u),l=n.get(p);if(l)return l;const f={id:p,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return n.set(p,f),f};for(const u of t){const p=Os(u);if(p){const f=a(p);f.projects.push(u),o.set(u.id,f);continue}const l={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};r.push(l),o.set(u.id,l)}for(const u of e){const p=(u??"").trim();p&&a(p)}for(const u of n.values())u.projects.sort(Vo),u.title=Mo(u);const i=[...n.values()].filter(u=>u.projects.length>0),m=[...n.values()].filter(u=>u.projects.length===0),c=(u,p)=>u.title.localeCompare(p.title),d=[...[...i,...r].sort(c),...m.sort(c)];return{entries:d,byId:new Map(d.map(u=>[u.id,u])),byRepo:n,byProject:o}}function vt(t,e){for(const o of t.threads??[]){const r=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(r)return r}const n=Se(t.repo);return(n?e.byRepo.get(n):void 0)??null}function Lo(t,e){const n=vt(t,e);if(!n)return[];if(n.projects.length<=1)return n.projects;for(const o of t.threads??[]){const r=o.virtualMcpId?n.projects.find(a=>a.id===o.virtualMcpId):void 0;if(r)return[r]}return n.projects}function Pr(t,e){const n=Lo(t,e);return n.length===1?n[0]??null:null}function Pt(t,e){return e.byId.get(t)??e.byRepo.get(Se(t))??e.byProject.get(t)}function kn(t,e,n){if(e===null)return!0;if(e===at)return vt(t,n)===null;const o=Pt(e,n);return o?o.repo&&Se(t.repo)===Se(o.repo)?!0:vt(t,n)===o:e.includes("/")?Se(t.repo)===Se(e):!0}function lt(t,e){return t===null?!1:t===at?!0:!!Pt(t,e)||t.includes("/")}function Er(t,e,n){return e===null?null:kn(t,e,n)?e:null}function Vr(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(n=>Rs(n).status!=="detached")))}const Ct="__unassigned__",Re="__any__",Nn={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Oo(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||lt(t.project,e)||t.search.trim()!==""}function Ro(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(lt(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const $o=864e5;function Ko(t,e){const n=new Date(t),o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()}function _n(t,e){const n=t.trim();return n===""?!1:e!=null&&ao(n)===e}function zo(t,e){return t.assigneeId===e?!0:t.assigneeId===yt&&t.assignedBy===e}function Mr(t,e,n){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!_n(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===Ct){if(t.assigneeId!==null)return!1}else if(!zo(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const r=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&r>=a||e.due==="today"&&!Ko(r,a)||e.due==="week"&&(r<a||r>a+7*$o))return!1}if(e.tags.length>0){const r=t.tags.map(a=>a.id);if(!e.tags.some(a=>r.includes(a)))return!1}return!!kn(t,e.project,n)}const Gt={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function we(t,e=!1){return re("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Uo(t){const e=Y.c(107),{value:n,members:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rt,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,p;e[1]!==i?(p=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=p):p=e[2];let l=p;if(n===Ct){let L;e[3]!==i?(L=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=L):L=e[4],l=L}else if(n===yt){let L;e[5]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(zt,{size:14}),e[5]=L):L=e[5],u=L;let O;e[6]!==i?(O=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=O):O=e[7],l=O}else if(n){let L,O,oe,z;if(e[8]!==o||e[9]!==n){let De;e[14]!==n?(De=Te=>Te.userId===n,e[14]=n,e[15]=De):De=e[15],O=o.find(De),L=Ot,oe=O?.user?.image??void 0,z=$t(O?.user?.name),e[8]=o,e[9]=n,e[10]=L,e[11]=O,e[12]=oe,e[13]=z}else L=e[10],O=e[11],oe=e[12],z=e[13];let ve;e[16]!==L||e[17]!==oe||e[18]!==z?(ve=s.jsx(L,{url:oe,fallback:z,shape:"circle",size:"2xs"}),e[16]=L,e[17]=oe,e[18]=z,e[19]=ve):ve=e[19],u=ve;let de;e[20]!==O?.user?.name||e[21]!==i?(de=O?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=O?.user?.name,e[21]=i,e[22]=de):de=e[22],l=de}let f;e[23]!==r?(f=L=>{r(L),c(!1)},e[23]=r,e[24]=f):f=e[24];const j=f,g=n!==null;let x;e[25]!==a||e[26]!==g?(x=we(g,a),e[25]=a,e[26]=g,e[27]=x):x=e[27];const y=x,S=a&&"ml-auto";let b;e[28]!==S?(b=re("shrink-0 opacity-60",S),e[28]=S,e[29]=b):b=e[29];const k=b;let v;e[30]!==l?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[30]=l,e[31]=v):v=e[31];let C;e[32]!==k?(C=s.jsx(ze,{size:12,className:k}),e[32]=k,e[33]=C):C=e[33];let D;e[34]!==u||e[35]!==v||e[36]!==C||e[37]!==y?(D=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:y,children:[u,v,C]})}),e[34]=u,e[35]=v,e[36]=C,e[37]=y,e[38]=D):D=e[38];let h;e[39]!==i?(h=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=h):h=e[40];let _;e[41]!==i?(_=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=_):_=e[42];let w;e[43]!==h||e[44]!==_?(w=s.jsx(Dt,{placeholder:h,"aria-label":_,className:"h-9"}),e[43]=h,e[44]=_,e[45]=w):w=e[45];let P;e[46]!==i?(P=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=P):P=e[47];let V;e[48]!==P?(V=s.jsx(Tt,{children:P}),e[48]=P,e[49]=V):V=e[49];let N;e[50]!==i?(N=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=N):N=e[51];let T;e[52]!==j?(T=()=>j(null),e[52]=j,e[53]=T):T=e[53];let F;e[54]!==i?(F=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=F):F=e[55];let $;e[56]!==N||e[57]!==T||e[58]!==F?($=s.jsx(Ce,{value:N,onSelect:T,children:F}),e[56]=N,e[57]=T,e[58]=F,e[59]=$):$=e[59];let I;e[60]!==i?(I=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=I):I=e[61];let B;e[62]!==j?(B=()=>j(Ct),e[62]=j,e[63]=B):B=e[63];let R;e[64]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Rt,{size:16,className:"text-muted-foreground"}),e[64]=R):R=e[64];let G;e[65]!==i?(G=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=G):G=e[66];let E;e[67]!==I||e[68]!==B||e[69]!==G?(E=s.jsxs(Ce,{value:I,onSelect:B,className:"gap-2",children:[R,G]}),e[67]=I,e[68]=B,e[69]=G,e[70]=E):E=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let M;e[73]!==j?(M=()=>j(yt),e[73]=j,e[74]=M):M=e[74];let Q;e[75]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(zt,{size:16}),e[75]=Q):Q=e[75];let Z;e[76]!==i?(Z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=Z):Z=e[77];let ee;e[78]!==U||e[79]!==M||e[80]!==Z?(ee=s.jsxs(Ce,{value:U,onSelect:M,className:"gap-2",children:[Q,Z]}),e[78]=U,e[79]=M,e[80]=Z,e[81]=ee):ee=e[81];let K;e[82]!==$||e[83]!==E||e[84]!==ee?(K=s.jsxs(Oe,{children:[$,E,ee]}),e[82]=$,e[83]=E,e[84]=ee,e[85]=K):K=e[85];let ne;e[86]!==i?(ne=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ne):ne=e[87];let W;if(e[88]!==o||e[89]!==j){let L;e[91]!==j?(L=O=>s.jsxs(Ce,{value:O.user?.name??O.userId,onSelect:()=>j(O.userId),className:"gap-2",children:[s.jsx(Ot,{url:O.user?.image??void 0,fallback:$t(O.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:O.user?.name??O.userId})]},O.userId),e[91]=j,e[92]=L):L=e[92],W=o.map(L),e[88]=o,e[89]=j,e[90]=W}else W=e[90];let X;e[93]!==ne||e[94]!==W?(X=s.jsx(Oe,{heading:ne,children:W}),e[93]=ne,e[94]=W,e[95]=X):X=e[95];let J;e[96]!==V||e[97]!==K||e[98]!==X?(J=s.jsxs(Ft,{children:[V,K,X]}),e[96]=V,e[97]=K,e[98]=X,e[99]=J):J=e[99];let te;e[100]!==w||e[101]!==J?(te=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[w,J]})}),e[100]=w,e[101]=J,e[102]=te):te=e[102];let se;return e[103]!==m||e[104]!==D||e[105]!==te?(se=s.jsxs(wt,{open:m,onOpenChange:c,children:[D,te]}),e[103]=m,e[104]=D,e[105]=te,e[106]=se):se=e[106],se}function Qo(t){const e=Y.c(33),{value:n,onChange:o,block:r}=t,a=ae(),i=n!==null;let m;e[0]!==r||e[1]!==i?(m=we(i,r),e[0]=r,e[1]=i,e[2]=m):m=e[2];const c=m,d=r&&"ml-auto";let u;e[3]!==d?(u=re("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const p=u;let l;e[5]!==n?(l=n?s.jsx("span",{className:re("size-2 shrink-0 rounded-full",We[n].dotClassName)}):s.jsx(Es,{size:14,className:"shrink-0"}),e[5]=n,e[6]=l):l=e[6];let f;e[7]!==a||e[8]!==n?(f=a(n?We[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=a,e[8]=n,e[9]=f):f=e[9];let j;e[10]!==p?(j=s.jsx(ze,{size:12,className:p}),e[10]=p,e[11]=j):j=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==j||e[15]!==c?(g=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[l,f,j]})}),e[12]=l,e[13]=f,e[14]=j,e[15]=c,e[16]=g):g=e[16];const x=n??Re;let y;e[17]!==o?(y=D=>o(D===Re?null:D),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==a?(S=a("taskBoard.taskFilters.priorityAnyPriority"),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==S?(b=s.jsx(ot,{value:Re,children:S}),e[21]=S,e[22]=b):b=e[22];let k;e[23]!==a?(k=Bo.map(D=>s.jsxs(ot,{value:D,className:"gap-2",children:[s.jsx("span",{className:re("size-2 rounded-full",We[D].dotClassName)}),a(We[D].labelKey)]},D)),e[23]=a,e[24]=k):k=e[24];let v;e[25]!==y||e[26]!==b||e[27]!==k||e[28]!==x?(v=s.jsx(un,{align:"start",className:"w-40",children:s.jsxs(fn,{value:x,onValueChange:y,children:[b,k]})}),e[25]=y,e[26]=b,e[27]=k,e[28]=x,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==g?(C=s.jsxs(mn,{children:[g,v]}),e[30]=v,e[31]=g,e[32]=C):C=e[32],C}function qo(t){const e=Y.c(35),{value:n,onChange:o,block:r}=t,a=ae();let i;e[0]!==a||e[1]!==n?(i=n?a(Gt[n]):void 0,e[0]=a,e[1]=n,e[2]=i):i=e[2];const m=i,c=n!==null;let d;e[3]!==r||e[4]!==c?(d=we(c,r),e[3]=r,e[4]=c,e[5]=d):d=e[5];const u=d,p=r&&"ml-auto";let l;e[6]!==p?(l=re("shrink-0 opacity-60",p),e[6]=p,e[7]=l):l=e[7];const f=l;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xt,{size:14,className:"shrink-0"}),e[8]=j):j=e[8];let g;e[9]!==m||e[10]!==a?(g=m??a("taskBoard.taskFilters.dueDateLabel"),e[9]=m,e[10]=a,e[11]=g):g=e[11];let x;e[12]!==f?(x=s.jsx(ze,{size:12,className:f}),e[12]=f,e[13]=x):x=e[13];let y;e[14]!==g||e[15]!==x||e[16]!==u?(y=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[j,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=y):y=e[17];const S=n??Re;let b;e[18]!==o?(b=w=>o(w===Re?null:w),e[18]=o,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(xt,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==a?(v=a("taskBoard.taskFilters.dueDateAnyTime"),e[21]=a,e[22]=v):v=e[22];let C;e[23]!==v?(C=s.jsxs(ot,{value:Re,className:"gap-2",children:[k,v]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]!==a?(D=Object.entries(Gt).map(w=>{const[P,V]=w,N=P==="overdue";return s.jsxs(ot,{value:P,className:re("gap-2",N&&"text-destructive"),children:[s.jsx(xt,{size:16,className:re("shrink-0",N?"text-destructive":"text-muted-foreground")}),a(V)]},P)}),e[25]=a,e[26]=D):D=e[26];let h;e[27]!==S||e[28]!==b||e[29]!==C||e[30]!==D?(h=s.jsx(un,{align:"start",className:"w-44",children:s.jsxs(fn,{value:S,onValueChange:b,children:[C,D]})}),e[27]=S,e[28]=b,e[29]=C,e[30]=D,e[31]=h):h=e[31];let _;return e[32]!==h||e[33]!==y?(_=s.jsxs(mn,{children:[y,h]}),e[32]=h,e[33]=y,e[34]=_):_=e[34],_}function Go(t){const e=Y.c(56),{value:n,tags:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]!==r||e[1]!==n?(d=I=>r(n.includes(I)?n.filter(B=>B!==I):[...n,I]),e[0]=r,e[1]=n,e[2]=d):d=e[2];const u=d;let p;e[3]!==i||e[4]!==o||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?i("taskBoard.taskFilters.tagsLabel"):n.length===1?o.find(I=>I.id===n[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=i,e[4]=o,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const l=p,f=n.length>0;let j;e[8]!==a||e[9]!==f?(j=we(f,a),e[8]=a,e[9]=f,e[10]=j):j=e[10];const g=j,x=a&&"ml-auto";let y;e[11]!==x?(y=re("shrink-0 opacity-60",x),e[11]=x,e[12]=y):y=e[12];const S=y;let b;e[13]!==o||e[14]!==n[0]||e[15]!==n.length?(b=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(o.find(I=>I.id===n[0])?.color)}}):s.jsx(cs,{size:14,className:"shrink-0"}),e[13]=o,e[14]=n[0],e[15]=n.length,e[16]=b):b=e[16];let k;e[17]!==l?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[17]=l,e[18]=k):k=e[18];let v;e[19]!==S?(v=s.jsx(ze,{size:12,className:S}),e[19]=S,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==k||e[23]!==v||e[24]!==g?(C=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[b,k,v]})}),e[21]=b,e[22]=k,e[23]=v,e[24]=g,e[25]=C):C=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let h;e[28]!==i?(h=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=h):h=e[29];let _;e[30]!==D||e[31]!==h?(_=s.jsx(Dt,{placeholder:D,"aria-label":h,className:"h-9"}),e[30]=D,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==i?(w=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=w):w=e[34];let P;e[35]!==w?(P=s.jsx(Tt,{children:w}),e[35]=w,e[36]=P):P=e[36];let V;if(e[37]!==o||e[38]!==u||e[39]!==n){let I;e[41]!==u||e[42]!==n?(I=B=>s.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(B.color)}}),s.jsx("span",{className:"flex-1 truncate",children:B.name}),n.includes(B.id)&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=n,e[43]=I):I=e[43],V=o.map(I),e[37]=o,e[38]=u,e[39]=n,e[40]=V}else V=e[40];let N;e[44]!==V?(N=s.jsx(Oe,{children:V}),e[44]=V,e[45]=N):N=e[45];let T;e[46]!==P||e[47]!==N?(T=s.jsxs(Ft,{children:[P,N]}),e[46]=P,e[47]=N,e[48]=T):T=e[48];let F;e[49]!==_||e[50]!==T?(F=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[_,T]})}),e[49]=_,e[50]=T,e[51]=F):F=e[51];let $;return e[52]!==m||e[53]!==C||e[54]!==F?($=s.jsxs(wt,{open:m,onOpenChange:c,children:[C,F]}),e[52]=m,e[53]=C,e[54]=F,e[55]=$):$=e[55],$}function Ht(t){const e=Y.c(11),{entry:n,selected:o,onSelect:r}=t,a=n.id,i=n.title;let m;e[0]!==n.projects?(m=n.projects.map(Ho).join(" "),e[0]=n.projects,e[1]=m):m=e[1];const c=`${a} ${i} ${n.repo??""} ${m}`;let d;e[2]!==n?(d=s.jsx(Eo,{entry:n}),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==c||e[8]!==d||e[9]!==u?(p=s.jsxs(Ce,{value:c,onSelect:r,className:"gap-2",children:[d,u]}),e[6]=r,e[7]=c,e[8]=d,e[9]=u,e[10]=p):p=e[10],p}function Ho(t){return t.title}function Yo(t,e,n,o){return t===null||!n?o("taskBoard.taskFilters.projectLabel"):t===at?o("taskBoard.taskFilters.projectNone"):e?.title??t}function Wo(t){const e=Y.c(90),{value:n,index:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d,u,p,l,f,j,g,x,y,S,b,k,v,C;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==m||e[4]!==i||e[5]!==n){const P=n===null?void 0:Pt(n,o),V=lt(n,o),N=Yo(n,P,V,i);let T;e[20]!==r?(T=z=>{r(z),c(!1)},e[20]=r,e[21]=T):T=e[21];const F=T,$=o.entries.filter(Jo),I=o.entries.filter(Xo),B=we(V,a),R=a&&"ml-auto";let G;e[22]!==R?(G=re("shrink-0 opacity-60",R),e[22]=R,e[23]=G):G=e[23];const E=G;l=wt,v=m,C=c;const U=V?P:void 0;let M;e[24]!==U?(M=s.jsx(Cn,{entry:U}),e[24]=U,e[25]=M):M=e[25];let Q;e[26]!==N?(Q=s.jsx("span",{className:"max-w-[12rem] truncate",children:N}),e[26]=N,e[27]=Q):Q=e[27];let Z;e[28]!==E?(Z=s.jsx(ze,{size:12,className:E}),e[28]=E,e[29]=Z):Z=e[29],e[30]!==M||e[31]!==Q||e[32]!==Z||e[33]!==B?(j=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:B,children:[M,Q,Z]})}),e[30]=M,e[31]=Q,e[32]=Z,e[33]=B,e[34]=j):j=e[34],p=St,b="start",k="w-72 p-0",u=At;let ee;e[35]!==i?(ee=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=ee):ee=e[36];let K;e[37]!==i?(K=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=K):K=e[38],e[39]!==ee||e[40]!==K?(S=s.jsx(Dt,{placeholder:ee,"aria-label":K,className:"h-9"}),e[39]=ee,e[40]=K,e[41]=S):S=e[41],d=Ft;let ne;e[42]!==i?(ne=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ne):ne=e[43],e[44]!==ne?(f=s.jsx(Tt,{children:ne}),e[44]=ne,e[45]=f):f=e[45];let W;e[46]!==i?(W=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=W):W=e[47];let X;e[48]!==F?(X=()=>F(null),e[48]=F,e[49]=X):X=e[49];let J;e[50]!==i?(J=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=J):J=e[51];let te;e[52]!==W||e[53]!==X||e[54]!==J?(te=s.jsx(Ce,{value:W,onSelect:X,children:J}),e[52]=W,e[53]=X,e[54]=J,e[55]=te):te=e[55];let se;e[56]!==i?(se=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=se):se=e[57];let L;e[58]!==F?(L=()=>F(at),e[58]=F,e[59]=L):L=e[59];let O;e[60]!==i?(O=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=O):O=e[61];let oe;e[62]!==se||e[63]!==L||e[64]!==O?(oe=s.jsx(Ce,{value:se,onSelect:L,children:O}),e[62]=se,e[63]=L,e[64]=O,e[65]=oe):oe=e[65],e[66]!==te||e[67]!==oe?(g=s.jsxs(Oe,{children:[te,oe]}),e[66]=te,e[67]=oe,e[68]=g):g=e[68],x=$.length>0&&s.jsx(Oe,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:$.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),y=I.length>0&&s.jsx(Oe,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:I.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),e[0]=a,e[1]=o,e[2]=r,e[3]=m,e[4]=i,e[5]=n,e[6]=d,e[7]=u,e[8]=p,e[9]=l,e[10]=f,e[11]=j,e[12]=g,e[13]=x,e[14]=y,e[15]=S,e[16]=b,e[17]=k,e[18]=v,e[19]=C}else d=e[6],u=e[7],p=e[8],l=e[9],f=e[10],j=e[11],g=e[12],x=e[13],y=e[14],S=e[15],b=e[16],k=e[17],v=e[18],C=e[19];let D;e[69]!==d||e[70]!==f||e[71]!==g||e[72]!==x||e[73]!==y?(D=s.jsxs(d,{children:[f,g,x,y]}),e[69]=d,e[70]=f,e[71]=g,e[72]=x,e[73]=y,e[74]=D):D=e[74];let h;e[75]!==u||e[76]!==D||e[77]!==S?(h=s.jsxs(u,{children:[S,D]}),e[75]=u,e[76]=D,e[77]=S,e[78]=h):h=e[78];let _;e[79]!==p||e[80]!==h||e[81]!==b||e[82]!==k?(_=s.jsx(p,{align:b,className:k,children:h}),e[79]=p,e[80]=h,e[81]=b,e[82]=k,e[83]=_):_=e[83];let w;return e[84]!==l||e[85]!==j||e[86]!==_||e[87]!==v||e[88]!==C?(w=s.jsxs(l,{open:v,onOpenChange:C,children:[j,_]}),e[84]=l,e[85]=j,e[86]=_,e[87]=v,e[88]=C,e[89]=w):w=e[89],w}function Xo(t){return t.projects.length===0}function Jo(t){return t.projects.length>0}function Zo(t){const e=Y.c(25),{value:n,onChange:o,block:r}=t,a=ae(),[i,m]=H.useState(n!==""),[c,d]=H.useState(!1),[u,p]=H.useState(n);n!==u&&(p(n),n===""&&!c&&m(!1));const l=i||r,f=l?"w-32 sm:w-44":"w-8 px-0 justify-center",j=r&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==f||e[1]!==j?(g=re("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,j),e[0]=f,e[1]=j,e[2]=g):g=e[2];let x;e[3]!==a?(x=a("taskBoard.taskFilters.searchLabel"),e[3]=a,e[4]=x):x=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ds,{size:14}),e[6]=S):S=e[6];let b;e[7]!==x?(b=s.jsx("button",{type:"button","aria-label":x,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=b):b=e[8];let k;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==a||e[13]!==n?(k=l&&s.jsx("input",{autoFocus:!r,value:n,onChange:D=>o(D.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),n===""&&m(!1)},placeholder:a("taskBoard.taskFilters.searchPlaceholder"),"aria-label":a("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=r,e[10]=l,e[11]=o,e[12]=a,e[13]=n,e[14]=k):k=e[14];let v;e[15]!==r||e[16]!==o||e[17]!==a||e[18]!==n?(v=n!==""&&s.jsx("button",{type:"button","aria-label":a("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ei,onClick:()=>{o(""),r||m(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx(Mn,{size:14})}),e[15]=r,e[16]=o,e[17]=a,e[18]=n,e[19]=v):v=e[19];let C;return e[20]!==g||e[21]!==b||e[22]!==k||e[23]!==v?(C=s.jsxs("div",{className:g,children:[b,k,v]}),e[20]=g,e[21]=b,e[22]=k,e[23]=v,e[24]=C):C=e[24],C}function ei(t){return t.preventDefault()}function ti(t){const e=Y.c(20),{block:n,onClick:o}=t,r=ae();let a;e[0]!==r?(a=r("taskBoard.taskFilters.boardSettingsLabel"),e[0]=r,e[1]=a):a=e[1];const i=a;let m;e[2]!==n?(m=re(we(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vs,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==i?(d=n&&s.jsx("span",{children:i}),e[5]=n,e[6]=i,e[7]=d):d=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==m||e[11]!==d?(u=s.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:m,children:[c,d]}),e[8]=i,e[9]=o,e[10]=m,e[11]=d,e[12]=u):u=e[12];const p=u;if(n)return p;let l;e[13]!==p?(l=s.jsx(Ze,{asChild:!0,children:p}),e[13]=p,e[14]=l):l=e[14];let f;e[15]!==i?(f=s.jsx(et,{side:"top",children:i}),e[15]=i,e[16]=f):f=e[16];let j;return e[17]!==l||e[18]!==f?(j=s.jsxs(Je,{children:[l,f]}),e[17]=l,e[18]=f,e[19]=j):j=e[19],j}function Sn(t){const e=Y.c(53),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m,block:c}=t;let d;e[0]!==n||e[1]!==i?(d=C=>i({...n,search:C}),e[0]=n,e[1]=i,e[2]=d):d=e[2];let u;e[3]!==c||e[4]!==n.search||e[5]!==d?(u=s.jsx(Zo,{block:c,value:n.search,onChange:d}),e[3]=c,e[4]=n.search,e[5]=d,e[6]=u):u=e[6];let p;e[7]!==n||e[8]!==i?(p=C=>i({...n,assignee:C}),e[7]=n,e[8]=i,e[9]=p):p=e[9];let l;e[10]!==c||e[11]!==n.assignee||e[12]!==o||e[13]!==p?(l=s.jsx(Uo,{block:c,value:n.assignee,members:o,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=o,e[13]=p,e[14]=l):l=e[14];let f;e[15]!==n||e[16]!==i?(f=C=>i({...n,priority:C}),e[15]=n,e[16]=i,e[17]=f):f=e[17];let j;e[18]!==c||e[19]!==n.priority||e[20]!==f?(j=s.jsx(Qo,{block:c,value:n.priority,onChange:f}),e[18]=c,e[19]=n.priority,e[20]=f,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i?(g=C=>i({...n,due:C}),e[22]=n,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==g?(x=s.jsx(qo,{block:c,value:n.due,onChange:g}),e[25]=c,e[26]=n.due,e[27]=g,e[28]=x):x=e[28];let y;e[29]!==n||e[30]!==i?(y=C=>i({...n,tags:C}),e[29]=n,e[30]=i,e[31]=y):y=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==y||e[35]!==r?(S=s.jsx(Go,{block:c,value:n.tags,tags:r,onChange:y}),e[32]=c,e[33]=n.tags,e[34]=y,e[35]=r,e[36]=S):S=e[36];let b;e[37]!==c||e[38]!==n||e[39]!==a||e[40]!==i?(b=(a.entries.length>0||lt(n.project,a))&&s.jsx(Wo,{block:c,value:n.project,index:a,onChange:C=>i({...n,project:C})}),e[37]=c,e[38]=n,e[39]=a,e[40]=i,e[41]=b):b=e[41];let k;e[42]!==c||e[43]!==m?(k=s.jsx(ti,{block:c,onClick:m}),e[42]=c,e[43]=m,e[44]=k):k=e[44];let v;return e[45]!==S||e[46]!==b||e[47]!==k||e[48]!==u||e[49]!==l||e[50]!==j||e[51]!==x?(v=s.jsxs(s.Fragment,{children:[u,l,j,x,S,b,k]}),e[45]=S,e[46]=b,e[47]=k,e[48]=u,e[49]=l,e[50]=j,e[51]=x,e[52]=v):v=e[52],v}function Lr(t){const e=Y.c(16),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cn,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];let u;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==m||e[6]!==r?(u=s.jsx(Sn,{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}),e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=m,e[6]=r,e[7]=u):u=e[7];let p;e[8]!==n||e[9]!==a||e[10]!==i||e[11]!==c?(p=Oo(n,a)&&s.jsx("button",{type:"button",onClick:()=>i(Nn),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=a,e[10]=i,e[11]=c,e[12]=p):p=e[12];let l;return e[13]!==u||e[14]!==p?(l=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p]}),e[13]=u,e[14]=p,e[15]=l):l=e[15],l}function Or(t){const e=Y.c(41),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae(),[d,u]=H.useState(!1),p=Ro(n,a),l=p>0;let f;e[0]!==l?(f=we(l),e[0]=l,e[1]=f):f=e[1];const j=f;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(cn,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let y;e[5]!==p?(y=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=y):y=e[6];let S;e[7]!==x||e[8]!==y||e[9]!==j?(S=s.jsx(Hn,{asChild:!0,children:s.jsxs("button",{type:"button",className:j,children:[g,x,y]})}),e[7]=x,e[8]=y,e[9]=j,e[10]=S):S=e[10];let b;e[11]!==c?(b=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=b):b=e[12];let k;e[13]!==b?(k=s.jsx(on,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=k):k=e[14];let v;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==i||e[19]!==m||e[20]!==r?(v=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Sn,{block:!0,filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m})}),e[15]=n,e[16]=a,e[17]=o,e[18]=i,e[19]=m,e[20]=r,e[21]=v):v=e[21];let C;e[22]!==p||e[23]!==i||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>i(Nn),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=i,e[24]=c,e[25]=C):C=e[25];let D;e[26]!==c?(D=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=D):D=e[27];let h;e[28]!==D?(h=s.jsx(rn,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:D})}),e[28]=D,e[29]=h):h=e[29];let _;e[30]!==C||e[31]!==h?(_=s.jsxs(an,{className:"flex-row gap-2",children:[C,h]}),e[30]=C,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==_||e[34]!==k||e[35]!==v?(w=s.jsxs(sn,{className:"p-0",children:[k,v,_]}),e[33]=_,e[34]=k,e[35]=v,e[36]=w):w=e[36];let P;return e[37]!==d||e[38]!==w||e[39]!==S?(P=s.jsxs(nn,{open:d,onOpenChange:u,direction:"bottom",children:[S,w]}),e[37]=d,e[38]=w,e[39]=S,e[40]=P):P=e[40],P}function Rr(t,e){return io(t,e.keySeq)??e.id}function $r(t,e){const n=e?.trim();if(n)return t.find(o=>_n(n,o.keySeq))??t.find(o=>o.id===n)}export{hr as $,Zi as A,cr as B,hn as C,Bt as D,No as E,vt as F,Pr as G,Sr as H,We as I,Pt as J,xr as K,Bo as L,wr as M,qt as N,Vr as O,co as P,Cr as Q,bn as R,zt as S,Dr as T,Tr as U,Cn as V,Eo as W,jr as X,yr as Y,wo as Z,yn as _,mr as a,$r as a0,Or as a1,Lr as a2,_r as a3,Fr as a4,Nn as a5,kr as a6,vr as a7,Qt as a8,Nr as a9,Ar as aa,Mr as ab,Do as ac,Er as ad,Br as ae,vo as af,gr as b,Ir as c,Lo as d,gn as e,Rr as f,br as g,ko as h,jn as i,tr as j,sr as k,ar as l,po as m,pr as n,rr as o,mo as p,lr as q,nr as r,or as s,io as t,er as u,ir as v,ho as w,fr as x,dr as y,ur as z};
1
+ import{bV as wn,b as ae,G as je,a as Yt,F as Dn,J as Tn,aq as Fn,ar as An,j as s,B as be,t as ce,c as Y,r as H,I as Bn,M as In,K as ue,l as re,h as Xe,o as ie,a4 as Je,a1 as Ze,a2 as et,n as it,d as Pn,a7 as kt,m as rt,bu as En,e as Le,bk as Vn,ap as Mn}from"./index-BZsplvNT.js";import{C as Ln}from"./collection-search-BQUnJFre.js";import{g as On,b as Rn,a as $n,e as Kn}from"./extract-connection-data-BzkNyMFd.js";import{u as Wt,a as Xt,g as zn,C as pt}from"./connection-card-BRtH_NyF.js";import{D as Jt,b as Zt,c as en,d as tn,h as Un,e as Qn}from"./dialog-Dn9dA6Rv.js";import{D as nn,a as sn,c as qn,b as on,e as Gn,f as rn,g as an,d as Hn}from"./drawer-C2zduVGY.js";import{d as me,a as pe,e as ge,b as he,c as xe,F as Et}from"./form-fu44NVNg.js";import{I as _e}from"./input-MZsLaCQZ.js";import{S as Yn,b as Wn,a as Xn,d as Jn,c as $e}from"./select-NANblt2H.js";import{T as Zn}from"./textarea-BrZpmcDa.js";import{b as ln}from"./use-connection-BASuVort.js";import{n as tt,a as gt,i as cn}from"./Tool02-DbSkbpld.js";import{j as ht,aK as es,aL as ts,aM as Vt,aN as ns,t as ss,aO as os,a7 as is,aP as rs,p as as,aQ as ls,a5 as xt,a4 as cs,ab as ds}from"./agent-icon-Dud4Dgyt.js";import{b as us,d as fs}from"./UserSquare-hcaj17gz.js";import{s as ms}from"./XClose-Df2qGXCV.js";import{c as ps,i as Ge,a as Mt,E as gs,p as hs,b as xs,d as js}from"./connection-form-helpers-BExi3iUW.js";import{a as jt}from"./authenticate-and-persist-oauth-DEt4nWzC.js";import{g as ys}from"./connection-slug-CITJ0kGN.js";import{C as bs}from"./collection-tabs-CPQ4VrZ9.js";import{u as Lt}from"./use-infinite-scroll-xe2j8vP-.js";import{B as He}from"./badge-BsDrwMQC.js";import{u as vs}from"./useSuspenseInfiniteQuery-Btts--oR.js";import{u as Cs}from"./use-mcp-client-Czt5As3J.js";import{S as ks,e as Ns}from"./constants-Daqiz8AS.js";import{i as nt}from"./Check-COlZG_Iq.js";import{s as _s}from"./Plus-RDqtgmUn.js";import{g as st}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-C6jqS37t.js";import{a as ws}from"./use-file-configs-DEwUByyO.js";import{d as Ds}from"./use-organization-settings-DUnuAPqv.js";import{r as Ts}from"./site-slug-uya6Wp4-.js";import{T as Fs,C as Nt,c as As,d as Bs,S as yt}from"./task-board-CIYSPfni.js";import{a as Is}from"./decopilot-sse-pool-BEKKOta-.js";import{u as Ps}from"./use-decopilot-events-Ba2e0p8u.js";import{A as Ot}from"./avatar--vQE0XAV.js";import{h as ot,D as dn,b as un,g as fn,c as mn}from"./dropdown-menu-nFmVNZOj.js";import{a as _t,b as St,P as wt}from"./popover-hKCv1VM6.js";import{e as Oe,a as Dt,c as Tt,d as Ce,b as Ft,C as At}from"./command-CfiREnnD.js";import{t as ze}from"./ChevronUp-BBoq4dQx.js";import{s as Es}from"./TrendUp01-Cm7YwYbt.js";import{a as Vs}from"./Settings02-DCwLCWga.js";import{s as Rt}from"./User01-r0_GbQ8r.js";import{G as Ms}from"./github-icon-CWspdq_p.js";import{P as Ls}from"./project-icon-D8jpcjeG.js";import{g as $t}from"./get-initials-D-f_fDFw.js";import{p as Os,a as Rs}from"./github-repo-CTPv5ZM2.js";import{i as $s}from"./AlertCircle-MMXQB5BT.js";import{i as Ks}from"./CheckCircle-DlrGO-LV.js";import{a as pn}from"./DotsVertical-BK7lUtpM.js";import{s as zs}from"./Eye-De6iXjt2.js";import{i as Us}from"./Shield01-D_ej3uf2.js";const Qs=wn("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function qs({open:t,onOpenChange:e,onCreated:n}){const o=ae(),{org:r}=je(),{data:a}=Yt.useSession(),{stdioEnabled:i}=Dn(),m=Tn(),c=ln(),d=Wt(),p=Xt(d,"").items,l=Fn({resolver:An(ps),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=l.watch("ui_type"),j=l.watch("connection_url"),g=l.watch("npx_package"),x=Ge({uiType:f,connectionUrl:j??"",npxPackage:g??""})??Mt({uiType:f,connectionUrl:j??"",registryItems:p}),y=h=>{const _=h.trim();if(!_)return;const w=!!l.formState.dirtyFields.title,P=!!l.formState.dirtyFields.description,V=!!l.formState.dirtyFields.env_vars,N=F=>{if(F&&(!w&&!l.getValues("title").trim()&&F.title&&l.setValue("title",F.title,{shouldDirty:!1}),!P&&!(l.getValues("description")??"").trim()&&F.description&&l.setValue("description",F.description,{shouldDirty:!1}),!V&&F.envVarKeys?.length)){const $=l.getValues("env_vars")??[],I=new Set($.map(R=>R.key)),B=F.envVarKeys.filter(R=>!I.has(R));B.length>0&&l.setValue("env_vars",[...$,...B.map(R=>({key:R,value:""}))],{shouldDirty:!0})}},T=hs(_);if(T&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",T.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(Ge({uiType:"NPX",npxPackage:T.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";l.setValue("ui_type",F,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),N(Ge({uiType:F,connectionUrl:_})??Mt({uiType:F,connectionUrl:_,registryItems:p}));return}f==="NPX"&&N(Ge({uiType:"NPX",npxPackage:_}))},S=h=>{h||l.reset(),e(h)},b=async h=>{let _,w=null,P=null,V=null;h.ui_type==="NPX"?(_="STDIO",w="",V=xs(h.npx_package||"",h.env_vars||[])):h.ui_type==="STDIO"?(_="STDIO",w="",V=js(h.stdio_command||"",h.stdio_args||"",h.stdio_cwd,h.env_vars||[])):(_=h.ui_type,w=h.connection_url||"",P=h.connection_token||null);const N=On("conn");try{await c.create.mutateAsync({id:N,title:h.title,description:h.description||null,connection_type:_,connection_url:w,connection_token:P,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:r.id,icon:h.icon??null,app_name:null,app_id:null,connection_headers:V,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),n?.(N)}catch{ce.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},k=o("connections.createConnectionDialog.title"),v=o("connections.createConnectionDialog.description"),C=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(me,{control:l.control,name:"ui_type",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.typeLabel")}),s.jsxs(Yn,{value:h.value,onValueChange:h.onChange,children:[s.jsx(he,{children:s.jsx(Wn,{children:s.jsx(Xn,{})})}),s.jsxs(Jn,{children:[s.jsx($e,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),s.jsx($e,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),s.jsx($e,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(tt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),s.jsx($e,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(xe,{})]})}),f==="NPX"&&s.jsx(me,{control:l.control,name:"npx_package",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("npx_package",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),f==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(me,{control:l.control,name:"stdio_command",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.commandLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"stdio_args",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.argumentsLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"stdio_cwd",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...h,value:h.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(xe,{})]})})]}),(f==="NPX"||f==="STDIO")&&s.jsx(me,{control:l.control,name:"env_vars",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(he,{children:s.jsx(gs,{value:h.value??[],onChange:h.onChange})}),s.jsx(xe,{})]})}),f!=="NPX"&&f!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(me,{control:l.control,name:"connection_url",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.urlLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("connection_url",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"connection_token",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(he,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...h,value:h.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"title",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.nameLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...h})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"description",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.descriptionLabel")}),s.jsx(he,{children:s.jsx(Zn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...h,value:h.value??""})}),s.jsx(xe,{})]})})]});return m?s.jsx(nn,{open:t,onOpenChange:S,children:s.jsxs(sn,{className:"max-h-[90vh]",children:[s.jsx(qn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(on,{children:k}),s.jsx(Gn,{className:"mt-1",children:v})]}),s.jsx(rn,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(ms,{size:16})})})]})}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),s.jsx(an,{children:s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(Jt,{open:t,onOpenChange:S,children:s.jsxs(Zt,{className:"sm:max-w-[525px]",children:[s.jsxs(en,{children:[s.jsx(tn,{children:k}),s.jsx(Un,{children:v})]}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"py-4",children:D}),s.jsxs(Qn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function Gs(t){const e=Y.c(72),{mode:n,agentId:o,addedConnectionIds:r,onAdd:a,onCloneAndAdd:i,onConnectAndAdd:m,connectingItemId:c,search:d,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=t,f=n===void 0?"add":n,j=l===void 0?"connected":l,g=ae(),{org:x}=je(),y=H.useDeferredValue(d),S=d!==y;let b;e[0]!==y?(b=y.trim().toLowerCase(),e[0]=y,e[1]=b):b=e[1];const k=b;let v;e[2]!==j?(v=A=>A??j,e[2]=j,e[3]=v):v=e[3];const[C,D]=Bn(In.connectionsTab(x.slug)+(j==="all"?":home-modal":":agent-modal"),v);let h;e[4]!==C||e[5]!==D?(h=A=>{A!==C&&ie("connections_dialog_tab_changed",{to_tab:A}),D(A)},e[4]=C,e[5]=D,e[6]=h):h=e[6];const _=h;let w;e[7]!==x.id||e[8]!==x.slug?(w={connectionId:ks,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=w):w=e[9];const P=Cs(w),V=y?.trim().split(/\s+/).filter(Boolean)??[],N=V.length>0?{operator:"or",conditions:V.flatMap(to)}:void 0,T={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},F=JSON.stringify(T),{data:$,fetchNextPage:I,hasNextPage:B,isFetchingNextPage:R}=vs({queryKey:ue.collectionListInfinite(P,x.id,"","CONNECTIONS",F),queryFn:async A=>{const{pageParam:q}=A,ye=q===void 0?0:q;return(await P.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ye}})).structuredContent},initialPageParam:0,getNextPageParam:Zs,staleTime:3e4}),G=$?.pages.flatMap(Js)??[],E=zn(G),U=new Set(G.filter(Xs).map(Ws)),M=Wt(),Q=Xt(M,y),Z=Lt(Q.loadMore,Q.hasMore,Q.isLoadingMore),ee=Lt(I,B??!1,R),K=C==="all"||!!k,ne=K?Q.items.filter(A=>{const q=Rn(A);if(q&&U.has(q))return!1;if(!k)return!0;const ye=st(A._meta),ke=[A.title,A.description,A.name,A.server?.title,A.server?.description,A.server?.name,ye?.friendly_name,ye?.friendlyName].filter(Boolean).join(" ").toLowerCase();return V.some(fe=>ke.includes(fe.toLowerCase()))}):[],W=ne.filter(Ys),X=ne.filter(Hs);let J;e[10]!==r?(J=A=>A.some(q=>r.has(q.id)),e[10]=r,e[11]=J):J=e[11];const te=J;let se;e[12]!==r||e[13]!==o||e[14]!==c||e[15]!==te||e[16]!==f||e[17]!==a||e[18]!==p||e[19]!==i||e[20]!==g?(se=(A,q,ye,ke,fe)=>{const qe=te(fe),Me=fe.find(Ne=>!r.has(Ne.id)),le=fe[0];if(f==="browse"){const Ne=ys(le);return s.jsx(pt,{connection:{title:q,icon:ye,description:fe.length>1?`${fe.length} instances`:ke??void 0},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{ie("connection_browse_clicked",{app_name:le.app_name??null,connection_id:le.id,instances_count:fe.length}),p?.(Ne)}},A)}return s.jsx(pt,{connection:{title:q,icon:ye,description:ke},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[qe&&s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(ie("connection_add_clicked",{action:"use_existing",app_name:le.app_name??null,connection_id:Me.id}),o&&ie("agent_connection_attached",{agent_id:o,connection_id:Me.id,app_name:le.app_name??null,mode:"existing"}),a(Me.id)):(ie("connection_add_clicked",{action:"clone",app_name:le.app_name??null,base_connection_id:le.id}),i(le))},children:g("virtualMcp.connectionDialogContent.add")})]})},A)},e[12]=r,e[13]=o,e[14]=c,e[15]=te,e[16]=f,e[17]=a,e[18]=p,e[19]=i,e[20]=g,e[21]=se):se=e[21];const L=se;let O;e[22]!==c||e[23]!==f||e[24]!==m||e[25]!==g?(O=A=>{const q=st(A._meta),ye=q?.friendlyName||q?.friendly_name||A.server?.title||A.title||A.server?.name||A.name||A.id||"",ke=A.server?.description||A.description||null,fe=A.server?.icons?.[0]?.src||$n(A.server?.repository)||null,qe=q?.official===!0,Me=q?.verified===!0,le=q?.owner==="deco";return s.jsx(pt,{connection:{title:ye,description:ke,icon:fe},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[le&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!le&&qe&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!le&&!qe&&Me&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),ie("connection_add_clicked",{action:"connect_new",registry_item_id:A.id,app_name:q?.friendlyName||A.server?.name||A.name||null}),m(A)},children:c===A.id?s.jsx(Xe,{className:"size-3.5"}):g(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${A.id}`)},e[22]=c,e[23]=f,e[24]=m,e[25]=g,e[26]=O):O=e[26];const oe=O;let z;e[27]!==C||e[28]!==_||e[29]!==u||e[30]!==k||e[31]!==g?(z=!k&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(bs,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:A=>_(A)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{ie("connections_dialog_custom_clicked"),u()},children:[s.jsx(_s,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=u,e[30]=k,e[31]=g,e[32]=z):z=e[32];const ve=S&&"opacity-50 pointer-events-none";let de;e[33]!==ve?(de=re("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=de):de=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Te;e[35]!==L?(Te=A=>{if(A.type==="group")return L(A.key,A.title,A.icon,null,A.connections);const q=A.connection;return L(q.id,q.title,q.icon,q.description??null,[q])},e[35]=L,e[36]=Te):Te=e[36];const ct=E.map(Te);let Fe;e[37]!==ee?(Fe=s.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[37]=ee,e[38]=Fe):Fe=e[38];let Ae;e[39]!==R?(Ae=R&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[39]=R,e[40]=Ae):Ae=e[40];const dt=K&&W.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(gt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ut=K&&W.map(oe),ft=K&&X.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),mt=K&&X.map(oe);let Be;e[41]!==Z||e[42]!==M||e[43]!==K?(Be=K&&M.length>0&&s.jsx("div",{ref:Z,className:"col-span-full h-1"}),e[41]=Z,e[42]=M,e[43]=K,e[44]=Be):Be=e[44];let Ie;e[45]!==Q.isLoadingMore||e[46]!==K?(Ie=K&&Q.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[45]=Q.isLoadingMore,e[46]=K,e[47]=Ie):Ie=e[47];let Pe;e[48]!==ct||e[49]!==Fe||e[50]!==Ae||e[51]!==dt||e[52]!==ut||e[53]!==ft||e[54]!==mt||e[55]!==Be||e[56]!==Ie?(Pe=s.jsxs("div",{className:De,children:[ct,Fe,Ae,dt,ut,ft,mt,Be,Ie]}),e[48]=ct,e[49]=Fe,e[50]=Ae,e[51]=dt,e[52]=ut,e[53]=ft,e[54]=mt,e[55]=Be,e[56]=Ie,e[57]=Pe):Pe=e[57];let Ee;e[58]!==C||e[59]!==E.length||e[60]!==X||e[61]!==d||e[62]!==g||e[63]!==W?(Ee=E.length===0&&W.length===0&&X.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):g(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=E.length,e[60]=X,e[61]=d,e[62]=g,e[63]=W,e[64]=Ee):Ee=e[64];let Ve;e[65]!==de||e[66]!==Pe||e[67]!==Ee?(Ve=s.jsxs("div",{className:de,children:[Pe,Ee]}),e[65]=de,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Qe;return e[69]!==z||e[70]!==Ve?(Qe=s.jsxs(s.Fragment,{children:[z,Ve]}),e[69]=z,e[70]=Ve,e[71]=Qe):Qe=e[71],Qe}function Hs(t){return!t.verified&&!st(t._meta)?.verified&&!t.meta?.verified}function Ys(t){return t.verified||st(t._meta)?.verified||t.meta?.verified}function Ws(t){return t.app_name}function Xs(t){return t.app_name}function Js(t){return t?.items??[]}function Zs(t,e){if(t?.hasMore)return e.reduce(eo,0)}function eo(t,e){return t+(e?.items?.length??0)}function to(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function Zi({open:t,onOpenChange:e,defaultTab:n,initialSearch:o="",...r}){const a=ae(),i=r.mode??"add",m="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:N=>{},u=(N,T,F)=>{m&&ie("agent_connection_attached",{agent_id:m,connection_id:N,app_name:T,mode:F})},[p,l]=H.useState(null),[f,j]=H.useState(o),[g,x]=H.useState(!1),[y,S]=H.useState(t);t!==y&&(S(t),t&&j(o));const{org:b}=je(),{data:k}=Yt.useSession(),v=ln(),C=it(),D=Pn(),h=N=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:b.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const T=N.queryKey;return T[1]===b.id&&T[3]==="collection"&&T[4]==="CONNECTIONS"}})},w=async(N,T)=>{ie("connection_oauth_succeeded",{connection_id:N,flow:T});const F=new URL(`/api/${b.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ue.isMCPAuthenticated(F.href,null)}),_()},P=async N=>{l(N.app_name??N.id);try{const F=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await v.create.mutateAsync({title:F,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,B=await jt({connectionId:I,orgId:b.id,orgSlug:b.slug,persistFallback:R=>v.update.mutateAsync({id:I,data:{connection_token:R}}).then(()=>{})});if(B.ran&&!B.ok){ie("connection_oauth_failed",{connection_id:I,flow:"clone",error:B.error??"no_token"}),ce.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await v.delete.mutateAsync(I);return}B.ran&&await w(I,"clone"),u(I,N.app_name??null,"clone"),d(I)}catch(T){console.error("Failed to add connection:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},V=async N=>{if(!(!b||!k?.user?.id)){l(N.id);try{const T=Kn(N,b.id,k.user.id,{remoteIndex:0}),F=T.connection_type==="STDIO",$=!!T.connection_url,I=F&&T.connection_headers&&typeof T.connection_headers=="object"&&"command"in T.connection_headers;if(!$&&!I){ce.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:B}=await v.create.mutateAsync(T),R=await jt({connectionId:B,orgId:b.id,orgSlug:b.slug,persistFallback:G=>v.update.mutateAsync({id:B,data:{connection_token:G}}).then(()=>{})});if(R.ran&&!R.ok){ie("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:R.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),u(B,T.app_name??null,"new"),d(B);return}R.ran?(await w(B,"connect_new"),ce.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):ce.success(a("virtualMcp.addConnectionDialog.connected")),u(B,T.app_name??null,"new"),d(B)}catch(T){console.error("Failed to connect:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return s.jsxs(Jt,{open:t,onOpenChange:e,children:[s.jsxs(Zt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(en,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(tn,{className:"text-base font-semibold",children:a(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(Ln,{value:f,onChange:j,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Gs,{mode:i,agentId:m,addedConnectionIds:c,onAdd:d,onCloneAndAdd:P,onConnectAndAdd:V,connectingItemId:p,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:h,defaultTab:n})})]}),s.jsx(qs,{open:g,onOpenChange:x,onCreated:async N=>{x(!1);const T=await jt({connectionId:N,orgId:b.id,orgSlug:b.slug,persistFallback:F=>v.update.mutateAsync({id:N,data:{connection_token:F}}).then(()=>{})});if(T.ran&&!T.ok){ie("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:T.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:T.error??"no token received"})}),u(N,null,"custom"),d(N),e(!1);return}T.ran&&await w(N,"custom_create"),u(N,null,"custom"),d(N),e(!1)}})]})}const Kt=new Map;function er(){const{org:t}=je(),e=kt(),n=Ss(),o=n.find(x=>x.providerId==="deco"),{data:r,isLoading:a,refetch:i,isFetching:m}=rt({queryKey:ue.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const x=Kt.get(t.id);u.current.get(t.id)&&x!=null&&c>x&&ie("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Kt.set(t.id,c),u.current.set(t.id,!0)}const p=!!o,l=c!=null&&c>0,f=c!=null&&c===0,j=c!=null&&c===200,g=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:d,hasCredits:l,isZeroBalance:f,isInitialFreeCredit:j,hasOnlyDecoProvider:g,isLoading:a,isFetching:m,refetch:i}}const no=4,so="TASK";function oo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,no)||so}function io(t,e){return e==null?null:`${oo(t)}-${String(e).padStart(2,"0")}`}const ro=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ao(t){const e=ro.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function zt(t){const e=Y.c(8),{size:n,className:o}=t,r=n===void 0?16:n;let a;e[0]!==r?(a={width:r,height:r},e[0]=r,e[1]=a):a=e[1];let i;e[2]!==o?(i=re("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let m;return e[4]!==r||e[5]!==a||e[6]!==i?(m=s.jsx("img",{src:Ns,alt:"Super Agent",width:r,height:r,style:a,className:i}),e[4]=r,e[5]=a,e[6]=i,e[7]=m):m=e[7],m}const Ue=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],lo=["overview","reports","board","site-editor"],Bt=1,co=["assets","hosting","e2e","analytics","cdn"];function tr(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const o=e?.id===t?e:n?.id===t?n:null;return{project:o,resolvedScopeId:o?t:null}}function nr(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function gn(t,e){const n=new Set(t??[]);if(e!==Bt)for(const o of lo)n.add(o);return Ue.filter(o=>n.has(o))}function uo(t){return Ue.some(e=>e===t)}function fo(t){return co.some(e=>e===t)}function mo(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function sr(t,e,n){const o=mo(e,n);return t?o:{...o,overview:!0,reports:!0,board:!0}}function or(t,e,n){const o=new Set(gn(t,n));return Ue.filter(r=>e[r]&&o.has(r))}function ir(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function rr(t){return Ue.filter(e=>t[e])}function po(t,e,n){return!uo(t)||e[t]?!1:fo(t)?!(t==="assets"?n.assets:n.siteAccess):!0}function ar(t,e,n,o,r){return po(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!o.includes("content")||t==="code"&&r&&!o.includes("code")}function lr(t,e,n,o){const r=new Set(gn(t,o));return n?r.add(e):r.delete(e),Ue.filter(a=>r.has(a))}function Ke(t,e){return ue.optimisticProjectSidebarViews(t,e)}function Ye(t){return typeof t=="object"&&t!==null}function hn(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function go(t,e){if(!Ye(t))return t;if("item"in t&&Ye(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!Ye(t.structuredContent))return t;const n=t.structuredContent.items;if(!Array.isArray(n))return t;let o=!1;const r=n.map(a=>!Ye(a)||a.id!==e.id?a:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:r}}:t}function cr(t,e,n){t.setQueriesData({predicate:o=>hn(o.queryKey,e)},o=>go(o,n))}function dr(t,e,n){const o=t.getQueriesData({predicate:r=>hn(r.queryKey,e)&&r.queryKey[5]===n});for(const[,r]of o)if(r?.item?.id===n)return r.item;return null}function It(t,e,n){return t.getQueryData(Ke(e,n))??null}function ho(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Bt};const n=t?.sidebarViews;return{sidebarViews:n===null?null:n?[...n]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function ur(t,e,n){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Bt}:n===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:ho(n,null)}function xo(t,e,n,o,r){const a=It(t,e,n),i={revision:(a?.revision??0)+1,views:[...o],rollbackViews:a?[...a.rollbackViews]:[...r]};return t.setQueryData(Ke(e,n),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function jo(t,e,n){const o=It(t,e,n);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function xn(t,e){const n=new Set(t),o=new Set(e);return n.size===o.size&&[...n].every(r=>o.has(r))}function fr(t){return t?!xn(t.views,t.persistedViews):!1}function yo(t,e,n,{snapshot:o,saved:r,authoritativeViews:a}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=It(t,e,n);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const m=a!==void 0?[...a]:r?[...o.views]:null,c={...i,rollbackViews:m??i.rollbackViews};return c.rollbackViews!==i.rollbackViews&&t.setQueryData(Ke(e,n),c),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(Ke(e,n),null),{settledLatest:!0,reconciledViews:r?m&&!xn(m,o.views)?m:null:[...c.rollbackViews]})}function mr(t){const e=Y.c(5),{org:n}=je(),o=t??"";let r;e[0]!==n.id||e[1]!==o?(r=Ke(n.id,o),e[0]=n.id,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==r?(a={queryKey:r,queryFn:bo,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=r,e[4]=a):a=e[4];const{data:i}=rt(a);return i?.views}async function bo(){return null}function pr(t){const e=Y.c(4),{org:n}=je(),o=it();let r;return e[0]!==n||e[1]!==o||e[2]!==t?(r={stage:(a,i)=>xo(o,n.id,t,a,i),snapshot:()=>jo(o,n.id,t),settle:a=>yo(o,n.id,t,a)},e[0]=n,e[1]=o,e[2]=t,e[3]=r):r=e[3],r}function vo(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(o=>{const r=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===n||r===n||r===`deco-assets-${n}`})??null}function gr(t){const e=Y.c(10),{org:n}=je(),o=En(),r=Ds(),a=ws(),i=Ts(t),m=o.hostingEnabled===!0,c=o.monitorEnabled===!0||o.auth.localMode===!0,d=(m||c)&&!!i,u=rt({queryKey:ue.hostingAccess(n.slug,i??""),queryFn:async()=>{const v=await fetch(`/api/${n.slug}/hosting/${encodeURIComponent(i??"")}/access`);return v.ok?await v.json():{owned:!1,canWrite:!1}},enabled:d,staleTime:6e4}),p=u.data?.owned===!0,l=!!vo(a.data?.configs??[],i),f=m&&p&&r.hosting,j=m&&p&&r.e2e,g=m&&p&&r.analytics,x=c&&p&&r.monitor;let y;e[0]!==l||e[1]!==f||e[2]!==j||e[3]!==g||e[4]!==x?(y={assets:l,hosting:f,e2e:j,analytics:g,cdn:x},e[0]=l,e[1]=f,e[2]=j,e[3]=g,e[4]=x,e[5]=y):y=e[5];const S=!!i&&a.isPending,b=d&&u.isPending;let k;return e[6]!==y||e[7]!==S||e[8]!==b?(k={presence:y,assetsPending:S,siteAccessPending:b},e[6]=y,e[7]=S,e[8]=b,e[9]=k):k=e[9],k}const Ut=()=>0;function Co(t){const{orgSlug:e,enabled:n=!0,onUpdate:o,onDelete:r,onResync:a}=t,i=H.useRef(o);i.current=o;const m=H.useRef(r);m.current=r;const c=H.useRef(a);c.current=a;const d=H.useRef(null),u=H.useRef(n),p=H.useRef(e);(!d.current||u.current!==n||p.current!==e)&&(u.current=n,p.current=e,d.current=f=>{if(!n||!e)return()=>{};const j=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===Fs?m.current?.(x.data.id):i.current(x.data)),f()};return Is.subscribe(e,j,()=>c.current?.())}),H.useSyncExternalStore(d.current,Ut,Ut)}function ko(t,e){return{queryKey:ue.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function No(){const t=Y.c(21),{org:e,locator:n}=je(),o=it();let r;t[0]!==n?(r=ue.taskBoardItems(n),t[0]=n,t[1]=r):r=t[1];const a=r;let i;t[2]!==n||t[3]!==o||t[4]!==a?(i=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.some(j=>j.id===l.id)?f.items.map(j=>j.id===l.id?l:j):[l,...f.items]}),o.invalidateQueries({queryKey:ue.taskBoardActivity(n,l.id)})},t[2]=n,t[3]=o,t[4]=a,t[5]=i):i=t[5];let m,c;t[6]!==o||t[7]!==a?(m=()=>{o.invalidateQueries({queryKey:a})},c=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.filter(j=>j.id!==l)})},t[6]=o,t[7]=a,t[8]=m,t[9]=c):(m=t[8],c=t[9]);let d;t[10]!==e.slug||t[11]!==i||t[12]!==m||t[13]!==c?(d={orgSlug:e.slug,onUpdate:i,onResync:m,onDelete:c},t[10]=e.slug,t[11]=i,t[12]=m,t[13]=c,t[14]=d):d=t[14],Co(d);let u;t[15]!==o||t[16]!==a?(u=l=>{const f=l.subject,j=l.data.status;o.cancelQueries({queryKey:a}),o.setQueryData(a,g=>g&&{...g,items:g.items.map(x=>x.threads.some(y=>y.threadId===f)?{...x,threads:x.threads.map(y=>y.threadId===f?{...y,status:j}:y)}:x)})},t[15]=o,t[16]=a,t[17]=u):u=t[17];let p;t[18]!==e.slug||t[19]!==u?(p={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=p):p=t[20],Ps(p)}function hr(){const t=Y.c(9),{locator:e}=je(),n=kt();let o;t[0]!==e||t[1]!==n?(o=ko(e,n),t[0]=e,t[1]=n,t[2]=o):o=t[2];const r=rt(o);No();let a;t[3]!==r.data?.items?(a=r.data?.items??[],t[3]=r.data?.items,t[4]=a):a=t[4];let i;return t[5]!==r.error||t[6]!==r.isLoading||t[7]!==a?(i={items:a,isLoading:r.isLoading,error:r.error},t[5]=r.error,t[6]=r.isLoading,t[7]=a,t[8]=i):i=t[8],i}function xr(){const t=Y.c(70),{org:e,locator:n}=je(),o=kt(),r=it(),a=ae();let i;t[0]!==n?(i=ue.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const m=i;let c;t[2]!==r||t[3]!==m?(c=()=>r.invalidateQueries({queryKey:m}),t[2]=r,t[3]=m,t[4]=c):c=t[4];const d=c;let u;t[5]!==o?(u=E=>o.call("TASK_BOARD_ITEM_CREATE",E),t[5]=o,t[6]=u):u=t[6];let p;t[7]!==d||t[8]!==u?(p={mutationFn:u,onSuccess:d},t[7]=d,t[8]=u,t[9]=p):p=t[9];const l=Le(p);let f;t[10]!==o?(f=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[10]=o,t[11]=f):f=t[11];let j;t[12]!==r||t[13]!==m?(j=async E=>{await r.cancelQueries({queryKey:m});const U=r.getQueryData(m);return r.setQueryData(m,M=>M&&{...M,items:M.items.map(Q=>Q.id===E.id?{...Q,...E}:Q)}),{previous:U}},t[12]=r,t[13]=m,t[14]=j):j=t[14];let g;t[15]!==e?(g=(E,U)=>{U.status==="done"&&ie("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==r||t[18]!==m?(x=(E,U,M)=>{M?.previous&&r.setQueryData(m,M.previous)},t[17]=r,t[18]=m,t[19]=x):x=t[19];let y;t[20]!==d||t[21]!==n||t[22]!==r?(y=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[20]=d,t[21]=n,t[22]=r,t[23]=y):y=t[23];let S;t[24]!==f||t[25]!==j||t[26]!==g||t[27]!==x||t[28]!==y?(S={mutationFn:f,onMutate:j,onSuccess:g,onError:x,onSettled:y},t[24]=f,t[25]=j,t[26]=g,t[27]=x,t[28]=y,t[29]=S):S=t[29];const b=Le(S);let k;t[30]!==o?(k=E=>o.call("TASK_BOARD_ITEM_DELETE",{id:E}),t[30]=o,t[31]=k):k=t[31];let v;t[32]!==d||t[33]!==a?(v=E=>{ce.error(E instanceof Error&&E.message?E.message:a("taskBoard.taskBoard.deleteError")),d()},t[32]=d,t[33]=a,t[34]=v):v=t[34];let C;t[35]!==d||t[36]!==k||t[37]!==v?(C={mutationFn:k,onSuccess:d,onError:v},t[35]=d,t[36]=k,t[37]=v,t[38]=C):C=t[38];const D=Le(C);let h;t[39]!==o?(h=async E=>{const U=await Promise.allSettled(E.map(M=>o.call("TASK_BOARD_ITEM_DELETE",{id:M})));return{total:E.length,failed:U.filter(_o).length}},t[39]=o,t[40]=h):h=t[40];let _,w;t[41]!==a?(_=E=>{const{total:U,failed:M}=E;M!==0&&ce.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(M),total:String(U)}))},w=()=>ce.error(a("taskBoard.taskBoard.deleteError")),t[41]=a,t[42]=_,t[43]=w):(_=t[42],w=t[43]);let P;t[44]!==d||t[45]!==h||t[46]!==_||t[47]!==w?(P={mutationFn:h,onSuccess:_,onError:w,onSettled:d},t[44]=d,t[45]=h,t[46]=_,t[47]=w,t[48]=P):P=t[48];const V=Le(P);let N;t[49]!==o?(N=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[49]=o,t[50]=N):N=t[50];let T;t[51]!==d||t[52]!==N?(T={mutationFn:N,onSuccess:d},t[51]=d,t[52]=N,t[53]=T):T=t[53];const F=Le(T);let $;t[54]!==o?($=E=>o.call("TASK_BOARD_ITEM_RERUN",E),t[54]=o,t[55]=$):$=t[55];let I;t[56]!==d||t[57]!==n||t[58]!==r?(I=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[56]=d,t[57]=n,t[58]=r,t[59]=I):I=t[59];let B;t[60]!==$||t[61]!==I?(B={mutationFn:$,onSettled:I},t[60]=$,t[61]=I,t[62]=B):B=t[62];const R=Le(B);let G;return t[63]!==l||t[64]!==F||t[65]!==D||t[66]!==V||t[67]!==R||t[68]!==b?(G={create:l,update:b,remove:D,removeMany:V,link:F,rerun:R},t[63]=l,t[64]=F,t[65]=D,t[66]=V,t[67]=R,t[68]=b,t[69]=G):G=t[69],G}function _o(t){return t.status==="rejected"}const So=["ended_after_delivery","superseded"];function wo(t){return!!t&&So.includes(t)}function jr(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function yr(t){return t.failureKind!=="superseded"}function jn(t){return t.threads.some(e=>e.status==="requires_action")}function br(t){return t.status==="in_review"&&!t.assigneeId}function vr(t){return jn(t)}function Cr(t){return t.status==="in_progress"&&jn(t)?"text-warning animate-pulse":bn(t.status).iconClassName}function kr(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!wo(n.failureKind))?"failed":null}function Nr(t,e,n){const o=t.findIndex(u=>u.id===n),r=e===n?t[o+1]?.id??null:e,a=t.filter(u=>u.id!==n),i=r?a.findIndex(u=>u.id===r):-1,m=i===-1?a.length:i,c=a[m-1],d=a[m];return c&&d?(c.sortOrder+d.sortOrder)/2:c?c.sortOrder+1:d?d.sortOrder-1:0}function _r(t,e){return Array.from({length:e},(n,o)=>t-(e-1-o)*1e-4)}const Do=["archived"],yn={triage:{labelKey:"taskBoard.config.statusBacklog",icon:$s,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:pn,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:is,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:zs,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:os,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:fs,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ss,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Ks,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Vn,iconClassName:"text-muted-foreground"}},To={icon:pn,iconClassName:"text-muted-foreground"},Fo=yn;function bn(t){return Fo[t]??To}function Sr(t,e){const n=yn[t];return{label:n?e(n.labelKey):t,visual:bn(t)}}const wr=["bug","feature","chore","spike","security"],Dr={bug:{labelKey:"taskBoard.config.typeBug",icon:Qs,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:ls,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:as,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:rs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Us,iconClassName:"text-purple-500"}};function bt(t){return Bs.includes(t)}function Tr(t){return Nt.filter(e=>t||!bt(e))}function Fr({deliveryEnabled:t,shownLanes:e,occupied:n}){const o=Nt.filter(i=>t||!bt(i)||n.includes(i)),r=o.filter(i=>Do.includes(i)||!t&&bt(i)),a=r.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!a.includes(i)),hidden:a,hideable:r}}const Qt="lane:";function Ao(t){return Nt.includes(t)}function Ar({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),o=n.startsWith(Qt)?n.slice(Qt.length):e(n);return o!==void 0&&Ao(o)?o:null}const Bo=["none","low","medium","high","urgent"],We={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Vt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ns,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Vt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:ts,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:es,iconClassName:"text-destructive"}};function Br(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Io*864e5?"soon":null}const Io=3;function qt(t){return`color-mix(in oklab, ${t??As} var(--user-color-strength), transparent)`}function vn(t){return t?.projects.length===1?t.projects[0]:void 0}function Po(t){return vn(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Cn(t){const e=Y.c(6),{entry:n}=t;let o;e[0]!==n?(o=vn(n),e[0]=n,e[1]=o):o=e[1];const r=o;if(r){let i;return e[2]!==r.icon||e[3]!==r.title?(i=s.jsx(Ls,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=i):i=e[4],i}let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(Ms,{className:"size-3"})}),e[5]=a):a=e[5],a}function Eo(t){const e=Y.c(14),{entry:n}=t;let o;e[0]!==n?(o=Po(n),e[0]=n,e[1]=o):o=e[1];const r=o;let a;e[2]!==n?(a=s.jsx(Cn,{entry:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==n.title?(i=s.jsx("span",{className:"truncate",children:n.title}),e[4]=n.title,e[5]=i):i=e[5];let m;e[6]!==r?(m=r&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=m):m=e[7];let c;e[8]!==i||e[9]!==m?(c=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[8]=i,e[9]=m,e[10]=c):c=e[10];let d;return e[11]!==a||e[12]!==c?(d=s.jsxs(s.Fragment,{children:[a,c]}),e[11]=a,e[12]=c,e[13]=d):d=e[13],d}const at="__no_repo__";function Se(t){return(t??"").trim().toLowerCase()}function Vo(t,e){const n=(t.created_at??"").localeCompare(e.created_at??"");return n!==0?n:t.id.localeCompare(e.id)}function Mo(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Ir(t,e=[]){const n=new Map,o=new Map,r=[],a=u=>{const p=Se(u),l=n.get(p);if(l)return l;const f={id:p,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return n.set(p,f),f};for(const u of t){const p=Os(u);if(p){const f=a(p);f.projects.push(u),o.set(u.id,f);continue}const l={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};r.push(l),o.set(u.id,l)}for(const u of e){const p=(u??"").trim();p&&a(p)}for(const u of n.values())u.projects.sort(Vo),u.title=Mo(u);const i=[...n.values()].filter(u=>u.projects.length>0),m=[...n.values()].filter(u=>u.projects.length===0),c=(u,p)=>u.title.localeCompare(p.title),d=[...[...i,...r].sort(c),...m.sort(c)];return{entries:d,byId:new Map(d.map(u=>[u.id,u])),byRepo:n,byProject:o}}function vt(t,e){for(const o of t.threads??[]){const r=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(r)return r}const n=Se(t.repo);return(n?e.byRepo.get(n):void 0)??null}function Lo(t,e){const n=vt(t,e);if(!n)return[];if(n.projects.length<=1)return n.projects;for(const o of t.threads??[]){const r=o.virtualMcpId?n.projects.find(a=>a.id===o.virtualMcpId):void 0;if(r)return[r]}return n.projects}function Pr(t,e){const n=Lo(t,e);return n.length===1?n[0]??null:null}function Pt(t,e){return e.byId.get(t)??e.byRepo.get(Se(t))??e.byProject.get(t)}function kn(t,e,n){if(e===null)return!0;if(e===at)return vt(t,n)===null;const o=Pt(e,n);return o?o.repo&&Se(t.repo)===Se(o.repo)?!0:vt(t,n)===o:e.includes("/")?Se(t.repo)===Se(e):!0}function lt(t,e){return t===null?!1:t===at?!0:!!Pt(t,e)||t.includes("/")}function Er(t,e,n){return e===null?null:kn(t,e,n)?e:null}function Vr(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(n=>Rs(n).status!=="detached")))}const Ct="__unassigned__",Re="__any__",Nn={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Oo(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||lt(t.project,e)||t.search.trim()!==""}function Ro(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(lt(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const $o=864e5;function Ko(t,e){const n=new Date(t),o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()}function _n(t,e){const n=t.trim();return n===""?!1:e!=null&&ao(n)===e}function zo(t,e){return t.assigneeId===e?!0:t.assigneeId===yt&&t.assignedBy===e}function Mr(t,e,n){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!_n(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===Ct){if(t.assigneeId!==null)return!1}else if(!zo(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const r=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&r>=a||e.due==="today"&&!Ko(r,a)||e.due==="week"&&(r<a||r>a+7*$o))return!1}if(e.tags.length>0){const r=t.tags.map(a=>a.id);if(!e.tags.some(a=>r.includes(a)))return!1}return!!kn(t,e.project,n)}const Gt={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function we(t,e=!1){return re("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Uo(t){const e=Y.c(107),{value:n,members:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rt,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,p;e[1]!==i?(p=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=p):p=e[2];let l=p;if(n===Ct){let L;e[3]!==i?(L=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=L):L=e[4],l=L}else if(n===yt){let L;e[5]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(zt,{size:14}),e[5]=L):L=e[5],u=L;let O;e[6]!==i?(O=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=O):O=e[7],l=O}else if(n){let L,O,oe,z;if(e[8]!==o||e[9]!==n){let De;e[14]!==n?(De=Te=>Te.userId===n,e[14]=n,e[15]=De):De=e[15],O=o.find(De),L=Ot,oe=O?.user?.image??void 0,z=$t(O?.user?.name),e[8]=o,e[9]=n,e[10]=L,e[11]=O,e[12]=oe,e[13]=z}else L=e[10],O=e[11],oe=e[12],z=e[13];let ve;e[16]!==L||e[17]!==oe||e[18]!==z?(ve=s.jsx(L,{url:oe,fallback:z,shape:"circle",size:"2xs"}),e[16]=L,e[17]=oe,e[18]=z,e[19]=ve):ve=e[19],u=ve;let de;e[20]!==O?.user?.name||e[21]!==i?(de=O?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=O?.user?.name,e[21]=i,e[22]=de):de=e[22],l=de}let f;e[23]!==r?(f=L=>{r(L),c(!1)},e[23]=r,e[24]=f):f=e[24];const j=f,g=n!==null;let x;e[25]!==a||e[26]!==g?(x=we(g,a),e[25]=a,e[26]=g,e[27]=x):x=e[27];const y=x,S=a&&"ml-auto";let b;e[28]!==S?(b=re("shrink-0 opacity-60",S),e[28]=S,e[29]=b):b=e[29];const k=b;let v;e[30]!==l?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[30]=l,e[31]=v):v=e[31];let C;e[32]!==k?(C=s.jsx(ze,{size:12,className:k}),e[32]=k,e[33]=C):C=e[33];let D;e[34]!==u||e[35]!==v||e[36]!==C||e[37]!==y?(D=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:y,children:[u,v,C]})}),e[34]=u,e[35]=v,e[36]=C,e[37]=y,e[38]=D):D=e[38];let h;e[39]!==i?(h=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=h):h=e[40];let _;e[41]!==i?(_=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=_):_=e[42];let w;e[43]!==h||e[44]!==_?(w=s.jsx(Dt,{placeholder:h,"aria-label":_,className:"h-9"}),e[43]=h,e[44]=_,e[45]=w):w=e[45];let P;e[46]!==i?(P=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=P):P=e[47];let V;e[48]!==P?(V=s.jsx(Tt,{children:P}),e[48]=P,e[49]=V):V=e[49];let N;e[50]!==i?(N=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=N):N=e[51];let T;e[52]!==j?(T=()=>j(null),e[52]=j,e[53]=T):T=e[53];let F;e[54]!==i?(F=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=F):F=e[55];let $;e[56]!==N||e[57]!==T||e[58]!==F?($=s.jsx(Ce,{value:N,onSelect:T,children:F}),e[56]=N,e[57]=T,e[58]=F,e[59]=$):$=e[59];let I;e[60]!==i?(I=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=I):I=e[61];let B;e[62]!==j?(B=()=>j(Ct),e[62]=j,e[63]=B):B=e[63];let R;e[64]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Rt,{size:16,className:"text-muted-foreground"}),e[64]=R):R=e[64];let G;e[65]!==i?(G=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=G):G=e[66];let E;e[67]!==I||e[68]!==B||e[69]!==G?(E=s.jsxs(Ce,{value:I,onSelect:B,className:"gap-2",children:[R,G]}),e[67]=I,e[68]=B,e[69]=G,e[70]=E):E=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let M;e[73]!==j?(M=()=>j(yt),e[73]=j,e[74]=M):M=e[74];let Q;e[75]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(zt,{size:16}),e[75]=Q):Q=e[75];let Z;e[76]!==i?(Z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=Z):Z=e[77];let ee;e[78]!==U||e[79]!==M||e[80]!==Z?(ee=s.jsxs(Ce,{value:U,onSelect:M,className:"gap-2",children:[Q,Z]}),e[78]=U,e[79]=M,e[80]=Z,e[81]=ee):ee=e[81];let K;e[82]!==$||e[83]!==E||e[84]!==ee?(K=s.jsxs(Oe,{children:[$,E,ee]}),e[82]=$,e[83]=E,e[84]=ee,e[85]=K):K=e[85];let ne;e[86]!==i?(ne=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ne):ne=e[87];let W;if(e[88]!==o||e[89]!==j){let L;e[91]!==j?(L=O=>s.jsxs(Ce,{value:O.user?.name??O.userId,onSelect:()=>j(O.userId),className:"gap-2",children:[s.jsx(Ot,{url:O.user?.image??void 0,fallback:$t(O.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:O.user?.name??O.userId})]},O.userId),e[91]=j,e[92]=L):L=e[92],W=o.map(L),e[88]=o,e[89]=j,e[90]=W}else W=e[90];let X;e[93]!==ne||e[94]!==W?(X=s.jsx(Oe,{heading:ne,children:W}),e[93]=ne,e[94]=W,e[95]=X):X=e[95];let J;e[96]!==V||e[97]!==K||e[98]!==X?(J=s.jsxs(Ft,{children:[V,K,X]}),e[96]=V,e[97]=K,e[98]=X,e[99]=J):J=e[99];let te;e[100]!==w||e[101]!==J?(te=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[w,J]})}),e[100]=w,e[101]=J,e[102]=te):te=e[102];let se;return e[103]!==m||e[104]!==D||e[105]!==te?(se=s.jsxs(wt,{open:m,onOpenChange:c,children:[D,te]}),e[103]=m,e[104]=D,e[105]=te,e[106]=se):se=e[106],se}function Qo(t){const e=Y.c(33),{value:n,onChange:o,block:r}=t,a=ae(),i=n!==null;let m;e[0]!==r||e[1]!==i?(m=we(i,r),e[0]=r,e[1]=i,e[2]=m):m=e[2];const c=m,d=r&&"ml-auto";let u;e[3]!==d?(u=re("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const p=u;let l;e[5]!==n?(l=n?s.jsx("span",{className:re("size-2 shrink-0 rounded-full",We[n].dotClassName)}):s.jsx(Es,{size:14,className:"shrink-0"}),e[5]=n,e[6]=l):l=e[6];let f;e[7]!==a||e[8]!==n?(f=a(n?We[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=a,e[8]=n,e[9]=f):f=e[9];let j;e[10]!==p?(j=s.jsx(ze,{size:12,className:p}),e[10]=p,e[11]=j):j=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==j||e[15]!==c?(g=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[l,f,j]})}),e[12]=l,e[13]=f,e[14]=j,e[15]=c,e[16]=g):g=e[16];const x=n??Re;let y;e[17]!==o?(y=D=>o(D===Re?null:D),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==a?(S=a("taskBoard.taskFilters.priorityAnyPriority"),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==S?(b=s.jsx(ot,{value:Re,children:S}),e[21]=S,e[22]=b):b=e[22];let k;e[23]!==a?(k=Bo.map(D=>s.jsxs(ot,{value:D,className:"gap-2",children:[s.jsx("span",{className:re("size-2 rounded-full",We[D].dotClassName)}),a(We[D].labelKey)]},D)),e[23]=a,e[24]=k):k=e[24];let v;e[25]!==y||e[26]!==b||e[27]!==k||e[28]!==x?(v=s.jsx(un,{align:"start",className:"w-40",children:s.jsxs(fn,{value:x,onValueChange:y,children:[b,k]})}),e[25]=y,e[26]=b,e[27]=k,e[28]=x,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==g?(C=s.jsxs(mn,{children:[g,v]}),e[30]=v,e[31]=g,e[32]=C):C=e[32],C}function qo(t){const e=Y.c(35),{value:n,onChange:o,block:r}=t,a=ae();let i;e[0]!==a||e[1]!==n?(i=n?a(Gt[n]):void 0,e[0]=a,e[1]=n,e[2]=i):i=e[2];const m=i,c=n!==null;let d;e[3]!==r||e[4]!==c?(d=we(c,r),e[3]=r,e[4]=c,e[5]=d):d=e[5];const u=d,p=r&&"ml-auto";let l;e[6]!==p?(l=re("shrink-0 opacity-60",p),e[6]=p,e[7]=l):l=e[7];const f=l;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xt,{size:14,className:"shrink-0"}),e[8]=j):j=e[8];let g;e[9]!==m||e[10]!==a?(g=m??a("taskBoard.taskFilters.dueDateLabel"),e[9]=m,e[10]=a,e[11]=g):g=e[11];let x;e[12]!==f?(x=s.jsx(ze,{size:12,className:f}),e[12]=f,e[13]=x):x=e[13];let y;e[14]!==g||e[15]!==x||e[16]!==u?(y=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[j,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=y):y=e[17];const S=n??Re;let b;e[18]!==o?(b=w=>o(w===Re?null:w),e[18]=o,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(xt,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==a?(v=a("taskBoard.taskFilters.dueDateAnyTime"),e[21]=a,e[22]=v):v=e[22];let C;e[23]!==v?(C=s.jsxs(ot,{value:Re,className:"gap-2",children:[k,v]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]!==a?(D=Object.entries(Gt).map(w=>{const[P,V]=w,N=P==="overdue";return s.jsxs(ot,{value:P,className:re("gap-2",N&&"text-destructive"),children:[s.jsx(xt,{size:16,className:re("shrink-0",N?"text-destructive":"text-muted-foreground")}),a(V)]},P)}),e[25]=a,e[26]=D):D=e[26];let h;e[27]!==S||e[28]!==b||e[29]!==C||e[30]!==D?(h=s.jsx(un,{align:"start",className:"w-44",children:s.jsxs(fn,{value:S,onValueChange:b,children:[C,D]})}),e[27]=S,e[28]=b,e[29]=C,e[30]=D,e[31]=h):h=e[31];let _;return e[32]!==h||e[33]!==y?(_=s.jsxs(mn,{children:[y,h]}),e[32]=h,e[33]=y,e[34]=_):_=e[34],_}function Go(t){const e=Y.c(56),{value:n,tags:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]!==r||e[1]!==n?(d=I=>r(n.includes(I)?n.filter(B=>B!==I):[...n,I]),e[0]=r,e[1]=n,e[2]=d):d=e[2];const u=d;let p;e[3]!==i||e[4]!==o||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?i("taskBoard.taskFilters.tagsLabel"):n.length===1?o.find(I=>I.id===n[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=i,e[4]=o,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const l=p,f=n.length>0;let j;e[8]!==a||e[9]!==f?(j=we(f,a),e[8]=a,e[9]=f,e[10]=j):j=e[10];const g=j,x=a&&"ml-auto";let y;e[11]!==x?(y=re("shrink-0 opacity-60",x),e[11]=x,e[12]=y):y=e[12];const S=y;let b;e[13]!==o||e[14]!==n[0]||e[15]!==n.length?(b=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(o.find(I=>I.id===n[0])?.color)}}):s.jsx(cs,{size:14,className:"shrink-0"}),e[13]=o,e[14]=n[0],e[15]=n.length,e[16]=b):b=e[16];let k;e[17]!==l?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[17]=l,e[18]=k):k=e[18];let v;e[19]!==S?(v=s.jsx(ze,{size:12,className:S}),e[19]=S,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==k||e[23]!==v||e[24]!==g?(C=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[b,k,v]})}),e[21]=b,e[22]=k,e[23]=v,e[24]=g,e[25]=C):C=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let h;e[28]!==i?(h=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=h):h=e[29];let _;e[30]!==D||e[31]!==h?(_=s.jsx(Dt,{placeholder:D,"aria-label":h,className:"h-9"}),e[30]=D,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==i?(w=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=w):w=e[34];let P;e[35]!==w?(P=s.jsx(Tt,{children:w}),e[35]=w,e[36]=P):P=e[36];let V;if(e[37]!==o||e[38]!==u||e[39]!==n){let I;e[41]!==u||e[42]!==n?(I=B=>s.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(B.color)}}),s.jsx("span",{className:"flex-1 truncate",children:B.name}),n.includes(B.id)&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=n,e[43]=I):I=e[43],V=o.map(I),e[37]=o,e[38]=u,e[39]=n,e[40]=V}else V=e[40];let N;e[44]!==V?(N=s.jsx(Oe,{children:V}),e[44]=V,e[45]=N):N=e[45];let T;e[46]!==P||e[47]!==N?(T=s.jsxs(Ft,{children:[P,N]}),e[46]=P,e[47]=N,e[48]=T):T=e[48];let F;e[49]!==_||e[50]!==T?(F=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[_,T]})}),e[49]=_,e[50]=T,e[51]=F):F=e[51];let $;return e[52]!==m||e[53]!==C||e[54]!==F?($=s.jsxs(wt,{open:m,onOpenChange:c,children:[C,F]}),e[52]=m,e[53]=C,e[54]=F,e[55]=$):$=e[55],$}function Ht(t){const e=Y.c(11),{entry:n,selected:o,onSelect:r}=t,a=n.id,i=n.title;let m;e[0]!==n.projects?(m=n.projects.map(Ho).join(" "),e[0]=n.projects,e[1]=m):m=e[1];const c=`${a} ${i} ${n.repo??""} ${m}`;let d;e[2]!==n?(d=s.jsx(Eo,{entry:n}),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==c||e[8]!==d||e[9]!==u?(p=s.jsxs(Ce,{value:c,onSelect:r,className:"gap-2",children:[d,u]}),e[6]=r,e[7]=c,e[8]=d,e[9]=u,e[10]=p):p=e[10],p}function Ho(t){return t.title}function Yo(t,e,n,o){return t===null||!n?o("taskBoard.taskFilters.projectLabel"):t===at?o("taskBoard.taskFilters.projectNone"):e?.title??t}function Wo(t){const e=Y.c(90),{value:n,index:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d,u,p,l,f,j,g,x,y,S,b,k,v,C;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==m||e[4]!==i||e[5]!==n){const P=n===null?void 0:Pt(n,o),V=lt(n,o),N=Yo(n,P,V,i);let T;e[20]!==r?(T=z=>{r(z),c(!1)},e[20]=r,e[21]=T):T=e[21];const F=T,$=o.entries.filter(Jo),I=o.entries.filter(Xo),B=we(V,a),R=a&&"ml-auto";let G;e[22]!==R?(G=re("shrink-0 opacity-60",R),e[22]=R,e[23]=G):G=e[23];const E=G;l=wt,v=m,C=c;const U=V?P:void 0;let M;e[24]!==U?(M=s.jsx(Cn,{entry:U}),e[24]=U,e[25]=M):M=e[25];let Q;e[26]!==N?(Q=s.jsx("span",{className:"max-w-[12rem] truncate",children:N}),e[26]=N,e[27]=Q):Q=e[27];let Z;e[28]!==E?(Z=s.jsx(ze,{size:12,className:E}),e[28]=E,e[29]=Z):Z=e[29],e[30]!==M||e[31]!==Q||e[32]!==Z||e[33]!==B?(j=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:B,children:[M,Q,Z]})}),e[30]=M,e[31]=Q,e[32]=Z,e[33]=B,e[34]=j):j=e[34],p=St,b="start",k="w-72 p-0",u=At;let ee;e[35]!==i?(ee=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=ee):ee=e[36];let K;e[37]!==i?(K=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=K):K=e[38],e[39]!==ee||e[40]!==K?(S=s.jsx(Dt,{placeholder:ee,"aria-label":K,className:"h-9"}),e[39]=ee,e[40]=K,e[41]=S):S=e[41],d=Ft;let ne;e[42]!==i?(ne=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ne):ne=e[43],e[44]!==ne?(f=s.jsx(Tt,{children:ne}),e[44]=ne,e[45]=f):f=e[45];let W;e[46]!==i?(W=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=W):W=e[47];let X;e[48]!==F?(X=()=>F(null),e[48]=F,e[49]=X):X=e[49];let J;e[50]!==i?(J=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=J):J=e[51];let te;e[52]!==W||e[53]!==X||e[54]!==J?(te=s.jsx(Ce,{value:W,onSelect:X,children:J}),e[52]=W,e[53]=X,e[54]=J,e[55]=te):te=e[55];let se;e[56]!==i?(se=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=se):se=e[57];let L;e[58]!==F?(L=()=>F(at),e[58]=F,e[59]=L):L=e[59];let O;e[60]!==i?(O=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=O):O=e[61];let oe;e[62]!==se||e[63]!==L||e[64]!==O?(oe=s.jsx(Ce,{value:se,onSelect:L,children:O}),e[62]=se,e[63]=L,e[64]=O,e[65]=oe):oe=e[65],e[66]!==te||e[67]!==oe?(g=s.jsxs(Oe,{children:[te,oe]}),e[66]=te,e[67]=oe,e[68]=g):g=e[68],x=$.length>0&&s.jsx(Oe,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:$.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),y=I.length>0&&s.jsx(Oe,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:I.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),e[0]=a,e[1]=o,e[2]=r,e[3]=m,e[4]=i,e[5]=n,e[6]=d,e[7]=u,e[8]=p,e[9]=l,e[10]=f,e[11]=j,e[12]=g,e[13]=x,e[14]=y,e[15]=S,e[16]=b,e[17]=k,e[18]=v,e[19]=C}else d=e[6],u=e[7],p=e[8],l=e[9],f=e[10],j=e[11],g=e[12],x=e[13],y=e[14],S=e[15],b=e[16],k=e[17],v=e[18],C=e[19];let D;e[69]!==d||e[70]!==f||e[71]!==g||e[72]!==x||e[73]!==y?(D=s.jsxs(d,{children:[f,g,x,y]}),e[69]=d,e[70]=f,e[71]=g,e[72]=x,e[73]=y,e[74]=D):D=e[74];let h;e[75]!==u||e[76]!==D||e[77]!==S?(h=s.jsxs(u,{children:[S,D]}),e[75]=u,e[76]=D,e[77]=S,e[78]=h):h=e[78];let _;e[79]!==p||e[80]!==h||e[81]!==b||e[82]!==k?(_=s.jsx(p,{align:b,className:k,children:h}),e[79]=p,e[80]=h,e[81]=b,e[82]=k,e[83]=_):_=e[83];let w;return e[84]!==l||e[85]!==j||e[86]!==_||e[87]!==v||e[88]!==C?(w=s.jsxs(l,{open:v,onOpenChange:C,children:[j,_]}),e[84]=l,e[85]=j,e[86]=_,e[87]=v,e[88]=C,e[89]=w):w=e[89],w}function Xo(t){return t.projects.length===0}function Jo(t){return t.projects.length>0}function Zo(t){const e=Y.c(25),{value:n,onChange:o,block:r}=t,a=ae(),[i,m]=H.useState(n!==""),[c,d]=H.useState(!1),[u,p]=H.useState(n);n!==u&&(p(n),n===""&&!c&&m(!1));const l=i||r,f=l?"w-32 sm:w-44":"w-8 px-0 justify-center",j=r&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==f||e[1]!==j?(g=re("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,j),e[0]=f,e[1]=j,e[2]=g):g=e[2];let x;e[3]!==a?(x=a("taskBoard.taskFilters.searchLabel"),e[3]=a,e[4]=x):x=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ds,{size:14}),e[6]=S):S=e[6];let b;e[7]!==x?(b=s.jsx("button",{type:"button","aria-label":x,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=b):b=e[8];let k;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==a||e[13]!==n?(k=l&&s.jsx("input",{autoFocus:!r,value:n,onChange:D=>o(D.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),n===""&&m(!1)},placeholder:a("taskBoard.taskFilters.searchPlaceholder"),"aria-label":a("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=r,e[10]=l,e[11]=o,e[12]=a,e[13]=n,e[14]=k):k=e[14];let v;e[15]!==r||e[16]!==o||e[17]!==a||e[18]!==n?(v=n!==""&&s.jsx("button",{type:"button","aria-label":a("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ei,onClick:()=>{o(""),r||m(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx(Mn,{size:14})}),e[15]=r,e[16]=o,e[17]=a,e[18]=n,e[19]=v):v=e[19];let C;return e[20]!==g||e[21]!==b||e[22]!==k||e[23]!==v?(C=s.jsxs("div",{className:g,children:[b,k,v]}),e[20]=g,e[21]=b,e[22]=k,e[23]=v,e[24]=C):C=e[24],C}function ei(t){return t.preventDefault()}function ti(t){const e=Y.c(20),{block:n,onClick:o}=t,r=ae();let a;e[0]!==r?(a=r("taskBoard.taskFilters.boardSettingsLabel"),e[0]=r,e[1]=a):a=e[1];const i=a;let m;e[2]!==n?(m=re(we(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vs,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==i?(d=n&&s.jsx("span",{children:i}),e[5]=n,e[6]=i,e[7]=d):d=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==m||e[11]!==d?(u=s.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:m,children:[c,d]}),e[8]=i,e[9]=o,e[10]=m,e[11]=d,e[12]=u):u=e[12];const p=u;if(n)return p;let l;e[13]!==p?(l=s.jsx(Ze,{asChild:!0,children:p}),e[13]=p,e[14]=l):l=e[14];let f;e[15]!==i?(f=s.jsx(et,{side:"top",children:i}),e[15]=i,e[16]=f):f=e[16];let j;return e[17]!==l||e[18]!==f?(j=s.jsxs(Je,{children:[l,f]}),e[17]=l,e[18]=f,e[19]=j):j=e[19],j}function Sn(t){const e=Y.c(53),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m,block:c}=t;let d;e[0]!==n||e[1]!==i?(d=C=>i({...n,search:C}),e[0]=n,e[1]=i,e[2]=d):d=e[2];let u;e[3]!==c||e[4]!==n.search||e[5]!==d?(u=s.jsx(Zo,{block:c,value:n.search,onChange:d}),e[3]=c,e[4]=n.search,e[5]=d,e[6]=u):u=e[6];let p;e[7]!==n||e[8]!==i?(p=C=>i({...n,assignee:C}),e[7]=n,e[8]=i,e[9]=p):p=e[9];let l;e[10]!==c||e[11]!==n.assignee||e[12]!==o||e[13]!==p?(l=s.jsx(Uo,{block:c,value:n.assignee,members:o,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=o,e[13]=p,e[14]=l):l=e[14];let f;e[15]!==n||e[16]!==i?(f=C=>i({...n,priority:C}),e[15]=n,e[16]=i,e[17]=f):f=e[17];let j;e[18]!==c||e[19]!==n.priority||e[20]!==f?(j=s.jsx(Qo,{block:c,value:n.priority,onChange:f}),e[18]=c,e[19]=n.priority,e[20]=f,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i?(g=C=>i({...n,due:C}),e[22]=n,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==g?(x=s.jsx(qo,{block:c,value:n.due,onChange:g}),e[25]=c,e[26]=n.due,e[27]=g,e[28]=x):x=e[28];let y;e[29]!==n||e[30]!==i?(y=C=>i({...n,tags:C}),e[29]=n,e[30]=i,e[31]=y):y=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==y||e[35]!==r?(S=s.jsx(Go,{block:c,value:n.tags,tags:r,onChange:y}),e[32]=c,e[33]=n.tags,e[34]=y,e[35]=r,e[36]=S):S=e[36];let b;e[37]!==c||e[38]!==n||e[39]!==a||e[40]!==i?(b=(a.entries.length>0||lt(n.project,a))&&s.jsx(Wo,{block:c,value:n.project,index:a,onChange:C=>i({...n,project:C})}),e[37]=c,e[38]=n,e[39]=a,e[40]=i,e[41]=b):b=e[41];let k;e[42]!==c||e[43]!==m?(k=s.jsx(ti,{block:c,onClick:m}),e[42]=c,e[43]=m,e[44]=k):k=e[44];let v;return e[45]!==S||e[46]!==b||e[47]!==k||e[48]!==u||e[49]!==l||e[50]!==j||e[51]!==x?(v=s.jsxs(s.Fragment,{children:[u,l,j,x,S,b,k]}),e[45]=S,e[46]=b,e[47]=k,e[48]=u,e[49]=l,e[50]=j,e[51]=x,e[52]=v):v=e[52],v}function Lr(t){const e=Y.c(16),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cn,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];let u;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==m||e[6]!==r?(u=s.jsx(Sn,{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}),e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=m,e[6]=r,e[7]=u):u=e[7];let p;e[8]!==n||e[9]!==a||e[10]!==i||e[11]!==c?(p=Oo(n,a)&&s.jsx("button",{type:"button",onClick:()=>i(Nn),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=a,e[10]=i,e[11]=c,e[12]=p):p=e[12];let l;return e[13]!==u||e[14]!==p?(l=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p]}),e[13]=u,e[14]=p,e[15]=l):l=e[15],l}function Or(t){const e=Y.c(41),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae(),[d,u]=H.useState(!1),p=Ro(n,a),l=p>0;let f;e[0]!==l?(f=we(l),e[0]=l,e[1]=f):f=e[1];const j=f;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(cn,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let y;e[5]!==p?(y=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=y):y=e[6];let S;e[7]!==x||e[8]!==y||e[9]!==j?(S=s.jsx(Hn,{asChild:!0,children:s.jsxs("button",{type:"button",className:j,children:[g,x,y]})}),e[7]=x,e[8]=y,e[9]=j,e[10]=S):S=e[10];let b;e[11]!==c?(b=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=b):b=e[12];let k;e[13]!==b?(k=s.jsx(on,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=k):k=e[14];let v;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==i||e[19]!==m||e[20]!==r?(v=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Sn,{block:!0,filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m})}),e[15]=n,e[16]=a,e[17]=o,e[18]=i,e[19]=m,e[20]=r,e[21]=v):v=e[21];let C;e[22]!==p||e[23]!==i||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>i(Nn),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=i,e[24]=c,e[25]=C):C=e[25];let D;e[26]!==c?(D=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=D):D=e[27];let h;e[28]!==D?(h=s.jsx(rn,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:D})}),e[28]=D,e[29]=h):h=e[29];let _;e[30]!==C||e[31]!==h?(_=s.jsxs(an,{className:"flex-row gap-2",children:[C,h]}),e[30]=C,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==_||e[34]!==k||e[35]!==v?(w=s.jsxs(sn,{className:"p-0",children:[k,v,_]}),e[33]=_,e[34]=k,e[35]=v,e[36]=w):w=e[36];let P;return e[37]!==d||e[38]!==w||e[39]!==S?(P=s.jsxs(nn,{open:d,onOpenChange:u,direction:"bottom",children:[S,w]}),e[37]=d,e[38]=w,e[39]=S,e[40]=P):P=e[40],P}function Rr(t,e){return io(t,e.keySeq)??e.id}function $r(t,e){const n=e?.trim();if(n)return t.find(o=>_n(n,o.keySeq))??t.find(o=>o.id===n)}export{hr as $,Zi as A,cr as B,hn as C,Bt as D,No as E,vt as F,Pr as G,Sr as H,We as I,Pt as J,xr as K,Bo as L,wr as M,qt as N,Vr as O,co as P,Cr as Q,bn as R,zt as S,Dr as T,Tr as U,Cn as V,Eo as W,jr as X,yr as Y,wo as Z,yn as _,mr as a,$r as a0,Or as a1,Lr as a2,_r as a3,Fr as a4,Nn as a5,kr as a6,vr as a7,Qt as a8,Nr as a9,Ar as aa,Mr as ab,Do as ac,Er as ad,Br as ae,vo as af,gr as b,Ir as c,Lo as d,gn as e,Rr as f,br as g,ko as h,jn as i,tr as j,sr as k,ar as l,po as m,pr as n,rr as o,mo as p,lr as q,nr as r,or as s,io as t,er as u,ir as v,ho as w,fr as x,dr as y,ur as z};
@@ -1 +1 @@
1
- import{c as N,r as J,j as a,l as W,B as H,G as U,a7 as z,K as G,m as V,n as te,e as se,b as K,b4 as ie,t as q,dq as Z,dr as Q,dp as re,P as X,ds as fe,p as ue}from"./index-B_lUDZ9B.js";import{I as ee}from"./input-COX_MHDV.js";import{i as oe}from"./Check-BcH3mbli.js";import{i as ce}from"./ChevronSelectorVertical-Q_MhqA-g.js";import{s as ge}from"./Plus-UnZHTGwg.js";import{s as pe}from"./Trash01-CRSthTGO.js";import{a as xe,c as je,d as he,e as be,b as ye,C as Se}from"./command-M5Hy4Bca.js";import{a as ve,P as Ne,b as Te}from"./popover-BGEouS4O.js";import{S as we}from"./switch-6gOY7p_B.js";import{T as de}from"./textarea-BPKnRKFj.js";import{c as _e,d as Ce,b as Pe,f as Ae,g as ke,e as Ie,a as Re,A as Ee}from"./alert-dialog-B6LS36Sm.js";import{R as Oe,A as $e}from"./review-settings-CcgZS4Qu.js";import{g as De}from"./task-board-DZmRPJBt.js";import{R as Be}from"./require-capability-D7WPxMT8.js";import"./index-scWMkxhM.js";import"./dialog-CIbVvLCQ.js";import"./SearchMd-BoghbLrR.js";import"./UserSquare-CWhx4AsN.js";import"./GitBranch01-DPsdhEPj.js";import"./use-organization-settings-DeqTyhDT.js";import"./constants-Daqiz8AS.js";import"./schema-7gcATtGd.js";import"./access-gate-LG7Db20W.js";import"./capability-load-error-BeQsW5u1.js";function Fe(t){const e=N.c(41),{options:n,value:s,onChange:i,placeholder:l,triggerClassName:r,contentClassName:o,width:u,renderTrigger:f,renderItem:d,emptyMessage:c,searchPlaceholder:m,filter:g}=t,p=l===void 0?"Select...":l,b=u===void 0?"w-[200px]":u,j=c===void 0?"No results found.":c,x=m===void 0?"Search...":m;let h;e[0]!==s?(h=L=>L.value===s,e[0]=s,e[1]=h):h=e[1];const y=n.find(h),[S,v]=J.useState(!1),T=Ne,w=ve,P=!0,_=f?a.jsx("div",{className:W("cursor-pointer",r),children:f(y)}):a.jsxs(H,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let C;e[2]!==w||e[3]!==_?(C=a.jsx(w,{asChild:P,children:_}),e[2]=w,e[3]=_,e[4]=C):C=e[4];let A;e[5]!==o?(A=W("p-0",o),e[5]=o,e[6]=A):A=e[6];let D;e[7]===Symbol.for("react.memo_cache_sentinel")?(D={width:"var(--radix-popover-trigger-width)"},e[7]=D):D=e[7];let B;e[8]!==x?(B=a.jsx(xe,{placeholder:x,className:"h-9"}),e[8]=x,e[9]=B):B=e[9];let I;e[10]!==j?(I=a.jsx(je,{children:j}),e[10]=j,e[11]=I):I=e[11];let R;if(e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==v||e[16]!==s){let L;e[18]!==i||e[19]!==d||e[20]!==v||e[21]!==s?(L=k=>{const ne=s===k.value;return a.jsx(he,{value:k.label,onSelect:()=>{i(k.value===s?"":k.value),v(!1)},children:d?d(k,ne):a.jsxs(a.Fragment,{children:[k.label,a.jsx(oe,{className:W("ml-auto",ne?"opacity-100":"opacity-0")})]})},k.value)},e[18]=i,e[19]=d,e[20]=v,e[21]=s,e[22]=L):L=e[22],R=n.map(L),e[12]=i,e[13]=n,e[14]=d,e[15]=v,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(be,{children:R}),e[23]=R,e[24]=E):E=e[24];let M;e[25]!==I||e[26]!==E?(M=a.jsxs(ye,{children:[I,E]}),e[25]=I,e[26]=E,e[27]=M):M=e[27];let O;e[28]!==g||e[29]!==B||e[30]!==M?(O=a.jsxs(Se,{filter:g,children:[B,M]}),e[28]=g,e[29]=B,e[30]=M,e[31]=O):O=e[31];let $;e[32]!==O||e[33]!==A?($=a.jsx(Te,{className:A,style:D,children:O}),e[32]=O,e[33]=A,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==S||e[37]!==v||e[38]!==$||e[39]!==C?(F=a.jsxs(T,{open:S,onOpenChange:v,children:[C,$]}),e[35]=T,e[36]=S,e[37]=v,e[38]=$,e[39]=C,e[40]=F):F=e[40],F}function Le(t){const e=N.c(4),{size:n,className:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=i):i=e[0];let l;return e[1]!==s||e[2]!==n?(l=a.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:i}),e[1]=s,e[2]=n,e[3]=l):l=e[3],l}function me(t){const e=t.projectName?.replace(/\s+/g," ").trim(),n=t.name.trim();return e?{primary:e,secondary:[n,t.projectKey].filter(Boolean).join(" · ")}:{primary:n,secondary:t.projectKey??""}}function qe(t){const{primary:e,secondary:n}=me(t);return[e,n,`#${t.id}`].filter(Boolean).join(" ")}function ae(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const n=ae(e).trim();if(!n)return 1;const s=ae(t);return n.split(/\s+/).every(i=>s.includes(i))?1:0}function Me(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function le(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>(await n.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Je(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=()=>n.call("JIRA_INTEGRATION_DELETE",{}),t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ue(t){const e=N.c(8),{org:n}=U(),s=z();let i;e[0]!==n.id?(i=G.jiraBoards(n.id),e[0]=n.id,e[1]=i):i=e[1];let l;e[2]!==s?(l=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==i||e[6]!==l?(r={queryKey:i,enabled:t,staleTime:6e4,queryFn:l},e[4]=t,e[5]=i,e[6]=l,e[7]=r):r=e[7],V(r)}function ze(t){const e=N.c(10),{org:n}=U(),s=z();let i;e[0]!==t||e[1]!==n.id?(i=G.jiraBoardColumns(n.id,t),e[0]=t,e[1]=n.id,e[2]=i):i=e[2];const l=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==l||e[8]!==r?(o={queryKey:i,enabled:l,staleTime:6e4,queryFn:r},e[6]=i,e[7]=l,e[8]=r,e[9]=o):o=e[9],V(o)}function Ge(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraAutomations(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function He(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{if(o.prompt===null){await n.call("JIRA_AUTOMATION_DELETE",{jiraStatus:o.jiraStatus});return}await n.call("JIRA_AUTOMATION_UPSERT",{jiraStatus:o.jiraStatus,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraAutomations(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Qe(){const t=N.c(12),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=n,t[3]=i):i=t[3];let l;t[4]!==s||t[5]!==i?(l={queryKey:s,staleTime:6e4,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6];const r=V(l);let o;t[7]!==r.data?(o=r.data?.find(We)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let u;return t[9]!==r.isPending||t[10]!==o?(u={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=u):u=t[11],u}function We(t){return t.columnKey===null}function Ve(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{const u=o.trim();if(!u){await n.call("TASK_BOARD_PROMPT_DELETE",{});return}await n.call("TASK_BOARD_PROMPT_UPSERT",{prompt:u})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ye(){const t=N.c(16),e=K(),{prompt:n,isPending:s}=Qe(),i=Ve(),[l,r]=J.useState(n),[o,u]=J.useState(n);o!==n&&(u(n),r(n));let f;t[0]!==e?(f=e("settings.taskPrompt.title"),t[0]=e,t[1]=f):f=t[1];let d;t[2]!==e?(d=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=d):d=t[3];let c;t[4]!==l||t[5]!==s||t[6]!==n||t[7]!==i||t[8]!==e?(c=s?a.jsx(ie,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(de,{value:l,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(H,{size:"sm",disabled:l===n||i.isPending,onClick:()=>i.mutate(l,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=l,t[5]=s,t[6]=n,t[7]=i,t[8]=e,t[9]=c):c=t[9];let m;t[10]!==d||t[11]!==c?(m=a.jsx(Z,{children:a.jsx(Q,{title:d,children:c})}),t[10]=d,t[11]=c,t[12]=m):m=t[12];let g;return t[13]!==f||t[14]!==m?(g=a.jsx(re,{title:f,children:m}),t[13]=f,t[14]=m,t[15]=g):g=t[15],g}function Y(t,e){return t instanceof Error?t.message:e}const Xe="https://id.atlassian.com/manage-profile/security/api-tokens";function Ze(t){const e=N.c(7),{stepKeys:n}=t,s=K();let i;if(e[0]!==n||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],i=n.map(r),e[0]=n,e[1]=s,e[2]=i}else i=e[2];let l;return e[5]!==i?(l=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=l):l=e[6],l}function et(){const t=N.c(69),e=K(),n=le(),[s,i]=J.useState(""),[l,r]=J.useState(""),[o,u]=J.useState("");let f;t[0]!==o||t[1]!==l||t[2]!==s?(f=s.trim()!==""&&l.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=l,t[2]=s,t[3]=f):f=t[3];const d=f;let c;t[4]!==e?(c=e("settings.jira.siteLabel"),t[4]=e,t[5]=c):c=t[5];let m;t[6]!==c?(m=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c}),t[6]=c,t[7]=m):m=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=k=>i(k.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(ee,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let j;t[14]!==m||t[15]!==b?(j=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,b]}),t[14]=m,t[15]=b,t[16]=j):j=t[16];let x;t[17]!==e?(x=e("settings.jira.emailLabel"),t[17]=e,t[18]=x):x=t[18];let h;t[19]!==x?(h=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:x}),t[19]=x,t[20]=h):h=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=k=>r(k.target.value),t[21]=y):y=t[21];let S;t[22]!==e?(S=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=S):S=t[23];let v;t[24]!==l||t[25]!==S?(v=a.jsx(ee,{value:l,onChange:y,placeholder:S,autoComplete:"off"}),t[24]=l,t[25]=S,t[26]=v):v=t[26];let T;t[27]!==v||t[28]!==h?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,v]}),t[27]=v,t[28]=h,t[29]=T):T=t[29];let w;t[30]!==e?(w=e("settings.jira.tokenLabel"),t[30]=e,t[31]=w):w=t[31];let P;t[32]!==w?(P=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),t[32]=w,t[33]=P):P=t[33];let _;t[34]!==e?(_=e("settings.jira.createTokenLink"),t[34]=e,t[35]=_):_=t[35];let C;t[36]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(ue,{size:12}),t[36]=C):C=t[36];let A;t[37]!==_?(A=a.jsxs("a",{href:Xe,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[_,C]}),t[37]=_,t[38]=A):A=t[38];let D;t[39]!==P||t[40]!==A?(D=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,A]}),t[39]=P,t[40]=A,t[41]=D):D=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=k=>u(k.target.value),t[42]=B):B=t[42];let I;t[43]!==e?(I=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=I):I=t[44];let R;t[45]!==o||t[46]!==I?(R=a.jsx(ee,{type:"password",value:o,onChange:B,placeholder:I,autoComplete:"off"}),t[45]=o,t[46]=I,t[47]=R):R=t[47];let E;t[48]!==D||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[D,R]}),t[48]=D,t[49]=R,t[50]=E):E=t[50];const M=!d||n.isPending;let O;t[51]!==o||t[52]!==l||t[53]!==s||t[54]!==e||t[55]!==n?(O=()=>n.mutate({siteUrl:s.trim(),email:l.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:k=>q.error(Y(k,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=l,t[53]=s,t[54]=e,t[55]=n,t[56]=O):O=t[56];let $;t[57]!==e||t[58]!==n.isPending?($=n.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=n.isPending,t[59]=$):$=t[59];let F;t[60]!==M||t[61]!==O||t[62]!==$?(F=a.jsx(H,{size:"sm",className:"w-fit",disabled:M,onClick:O,children:$}),t[60]=M,t[61]=O,t[62]=$,t[63]=F):F=t[63];let L;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==j?(L=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[j,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=j,t[68]=L):L=t[68],L}function tt(t){const e=N.c(44),{integration:n}=t,s=K(),i=Je(),[l,r]=J.useState(!1),o=n.siteUrl,u=n.email;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>r(!0),e[0]=f):f=e[0];let d;e[1]!==s?(d=s("settings.jira.disconnect"),e[1]=s,e[2]=d):d=e[2];let c;e[3]!==d?(c=a.jsx(H,{variant:"outline",size:"sm",onClick:f,children:d}),e[3]=d,e[4]=c):c=e[4];let m;e[5]!==n.email||e[6]!==n.siteUrl||e[7]!==c?(m=a.jsx(Q,{title:o,description:u,action:c}),e[5]=n.email,e[6]=n.siteUrl,e[7]=c,e[8]=m):m=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(_e,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let j;e[15]!==b?(j=a.jsx(Ce,{children:b}),e[15]=b,e[16]=j):j=e[16];let x;e[17]!==j||e[18]!==p?(x=a.jsxs(Pe,{children:[p,j]}),e[17]=j,e[18]=p,e[19]=x):x=e[19];let h;e[20]!==s?(h=s("settings.jira.cancel"),e[20]=s,e[21]=h):h=e[21];let y;e[22]!==h?(y=a.jsx(Ae,{children:h}),e[22]=h,e[23]=y):y=e[23];let S;e[24]!==i||e[25]!==s?(S=()=>i.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:A=>q.error(Y(A,s("settings.jira.saveFailed")))}),e[24]=i,e[25]=s,e[26]=S):S=e[26];let v;e[27]!==s?(v=s("settings.jira.disconnect"),e[27]=s,e[28]=v):v=e[28];let T;e[29]!==S||e[30]!==v?(T=a.jsx(ke,{onClick:S,children:v}),e[29]=S,e[30]=v,e[31]=T):T=e[31];let w;e[32]!==y||e[33]!==T?(w=a.jsxs(Ie,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=w):w=e[34];let P;e[35]!==x||e[36]!==w?(P=a.jsxs(Re,{children:[x,w]}),e[35]=x,e[36]=w,e[37]=P):P=e[37];let _;e[38]!==l||e[39]!==P?(_=a.jsx(Ee,{open:l,onOpenChange:r,children:P}),e[38]=l,e[39]=P,e[40]=_):_=e[40];let C;return e[41]!==_||e[42]!==m?(C=a.jsxs(a.Fragment,{children:[m,_]}),e[41]=_,e[42]=m,e[43]=C):C=e[43],C}function st(t){const e=N.c(36),{integration:n}=t,s=K(),i=le(),l=Ue(!0);let r,o;e[0]!==l.data||e[1]!==n.boardId||e[2]!==n.boardName?(r=(l.data??[]).map(lt),o=n.boardId?r.find(y=>y.value===n.boardId)?.primary??n.boardName??n.boardId:null,e[0]=l.data,e[1]=n.boardId,e[2]=n.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const u=o;let f;e[5]!==s?(f=s("settings.jira.boardLabel"),e[5]=s,e[6]=f):f=e[6];let d;e[7]!==s?(d=s("settings.jira.boardDescription"),e[7]=s,e[8]=d):d=e[8];const c=n.boardId??"";let m;e[9]!==s?(m=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=m):m=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==l.isPending||e[14]!==s?(p=l.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=l.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==u||e[17]!==s?(b=()=>a.jsxs(H,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:u??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=u,e[17]=s,e[18]=b):b=e[18];let j;e[19]!==r||e[20]!==n.boardId||e[21]!==s||e[22]!==i?(j=y=>{!y||y===n.boardId||i.mutate({boardId:y,boardName:r.find(S=>S.value===y)?.primary??null},{onError:S=>q.error(Y(S,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=n.boardId,e[21]=s,e[22]=i,e[23]=j):j=e[23];let x;e[24]!==r||e[25]!==c||e[26]!==m||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==j?(x=a.jsx(Fe,{options:r,value:c,width:"w-72",triggerClassName:"shrink-0",placeholder:m,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:it,onChange:j}),e[24]=r,e[25]=c,e[26]=m,e[27]=g,e[28]=p,e[29]=b,e[30]=j,e[31]=x):x=e[31];let h;return e[32]!==x||e[33]!==f||e[34]!==d?(h=a.jsx(Q,{title:f,description:d,action:x}),e[32]=x,e[33]=f,e[34]=d,e[35]=h):h=e[35],h}function it(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(oe,{className:W("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function lt(t){const{primary:e,secondary:n}=me(t);return{value:String(t.id),label:qe(t),primary:e,secondary:n}}function nt(t){const e=N.c(30),{boardId:n}=t,s=K(),i=ze(n),l=Ge();let r;if(i.isPending||l.isPending){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ie,{className:"h-40 w-full"}),e[0]=c):c=e[0],r=c}else if(i.isError){let c;e[1]!==s?(c=s("settings.jira.columnsFailed"),e[1]=s,e[2]=c):c=e[2];let m;e[3]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[3]=c,e[4]=m):m=e[4],r=m}else if((i.data??[]).length===0){let c;e[5]!==s?(c=s("settings.jira.noColumnsYet"),e[5]=s,e[6]=c):c=e[6];let m;e[7]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8],r=m}else{let c;e[9]!==l.data?(c=new Map((l.data??[]).map(at)),e[9]=l.data,e[10]=c):c=e[10];const m=c;let g;e[11]!==i.data?(g=i.data??[],e[11]=i.data,e[12]=g):g=e[12];let p;if(e[13]!==m||e[14]!==g){let j;e[16]!==m?(j=x=>x.statuses.map(h=>a.jsx(rt,{columnName:x.name,status:h,showStatus:h!==x.name||x.statuses.length>1,hasAutomation:m.has(h),prompt:m.get(h)??null},`${x.name}:${h}`)),e[16]=m,e[17]=j):j=e[17],p=g.flatMap(j),e[13]=m,e[14]=g,e[15]=p}else p=e[15];let b;e[18]!==p?(b=a.jsx("div",{className:"flex w-full flex-col gap-3",children:p}),e[18]=p,e[19]=b):b=e[19],r=b}let o;e[20]!==s?(o=s("settings.jira.automationsLabel"),e[20]=s,e[21]=o):o=e[21];let u;e[22]!==s?(u=s("settings.jira.automationsDescription"),e[22]=s,e[23]=u):u=e[23];let f;e[24]!==r?(f=a.jsx("div",{className:"mt-3",children:r}),e[24]=r,e[25]=f):f=e[25];let d;return e[26]!==o||e[27]!==u||e[28]!==f?(d=a.jsx(Q,{title:o,description:u,children:f}),e[26]=o,e[27]=u,e[28]=f,e[29]=d):d=e[29],d}function at(t){return[t.jiraStatus,t.prompt]}function rt(t){const e=N.c(22),{columnName:n,status:s,showStatus:i,hasAutomation:l,prompt:r}=t,o=K(),u=He(),[f,d]=J.useState(r??""),[c,m]=J.useState(r);c!==r&&(m(r),d(r??""));let g;e[0]!==u||e[1]!==s||e[2]!==o?(g=S=>u.mutate({jiraStatus:s,prompt:S},{onError:v=>q.error(Y(v,o("settings.jira.saveFailed")))}),e[0]=u,e[1]=s,e[2]=o,e[3]=g):g=e[3];const p=g;let b;e[4]!==n?(b=a.jsx("span",{className:"truncate text-sm font-medium",children:n}),e[4]=n,e[5]=b):b=e[5];let j;e[6]!==i||e[7]!==s?(j=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s}),e[6]=i,e[7]=s,e[8]=j):j=e[8];let x;e[9]!==b||e[10]!==j?(x=a.jsxs("div",{className:"flex flex-col min-w-0",children:[b,j]}),e[9]=b,e[10]=j,e[11]=x):x=e[11];let h;e[12]!==f||e[13]!==l||e[14]!==r||e[15]!==p||e[16]!==s||e[17]!==o?(h=l?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.jira.automationOn")}),a.jsx(H,{variant:"ghost",size:"sm","aria-label":o("settings.jira.removeAriaLabel",{status:s}),onClick:()=>p(null),children:a.jsx(pe,{size:14})})]}),a.jsx(de,{value:f,rows:2,placeholder:o("settings.jira.promptPlaceholder"),onChange:S=>d(S.target.value),onBlur:()=>{f!==(r??"")&&p(f)},"data-jira-automation-prompt":s}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.jira.promptHelp")})]}):a.jsxs(H,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>p(""),children:[a.jsx(ge,{size:14}),o("settings.jira.addAutomation")]}),e[12]=f,e[13]=l,e[14]=r,e[15]=p,e[16]=s,e[17]=o,e[18]=h):h=e[18];let y;return e[19]!==x||e[20]!==h?(y=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[x,h]}),e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function ot(t){const e=N.c(16),{integration:n}=t,s=K(),i=le();let l;e[0]!==s?(l=s("settings.jira.enabledLabel"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n.boardId||e[5]!==s||e[6]!==i?(o=d=>{if(d&&!n.boardId){q.error(s("settings.jira.enableRequirements"));return}i.mutate({enabled:d},{onError:c=>q.error(Y(c,s("settings.jira.saveFailed")))})},e[4]=n.boardId,e[5]=s,e[6]=i,e[7]=o):o=e[7];let u;e[8]!==n.enabled||e[9]!==o||e[10]!==i.isPending?(u=a.jsx(we,{checked:n.enabled,disabled:i.isPending,onCheckedChange:o}),e[8]=n.enabled,e[9]=o,e[10]=i.isPending,e[11]=u):u=e[11];let f;return e[12]!==l||e[13]!==r||e[14]!==u?(f=a.jsx(Q,{title:l,description:r,action:u}),e[12]=l,e[13]=r,e[14]=u,e[15]=f):f=e[15],f}function ct(t){const e=N.c(24),{integration:n}=t,s=K(),i=`${window.location.origin}/api/_jira/webhook/${n.webhookSecret}`;let l;e[0]!==s?(l=s("settings.jira.webhookTitle"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==i?(o=a.jsx(ee,{readOnly:!0,value:i,className:"font-mono text-xs"}),e[4]=i,e[5]=o):o=e[5];let u;e[6]!==s||e[7]!==i?(u=()=>{navigator.clipboard.writeText(i),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==s?(f=s("settings.jira.webhookCopy"),e[9]=s,e[10]=f):f=e[10];let d;e[11]!==u||e[12]!==f?(d=a.jsx(H,{variant:"outline",size:"sm",className:"shrink-0",onClick:u,children:f}),e[11]=u,e[12]=f,e[13]=d):d=e[13];let c;e[14]!==o||e[15]!==d?(c=a.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[14]=o,e[15]=d,e[16]=c):c=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Ze,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=m):m=e[17];let g;e[18]!==c?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[c,m]}),e[18]=c,e[19]=g):g=e[19];let p;return e[20]!==l||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:l,description:r,children:g}),e[20]=l,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function dt(){const t=N.c(23),e=K(),n=Me();if(n.isPending){let d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Z,{children:a.jsx("div",{className:"p-4",children:a.jsx(ie,{className:"h-40 w-full"})})}),t[0]=d):d=t[0],d}if(!n.data){let d;t[1]!==e?(d=e("settings.jira.connectTitle"),t[1]=e,t[2]=d):d=t[2];let c;t[3]!==e?(c=e("settings.jira.connectDescription"),t[3]=e,t[4]=c):c=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(et,{}),t[5]=m):m=t[5];let g;return t[6]!==d||t[7]!==c?(g=a.jsx(Z,{children:a.jsx(Q,{title:d,description:c,children:m})}),t[6]=d,t[7]=c,t[8]=g):g=t[8],g}const s=n.data;let i,l;t[9]!==s?(i=a.jsx(tt,{integration:s}),l=a.jsx(st,{integration:s}),t[9]=s,t[10]=i,t[11]=l):(i=t[10],l=t[11]);let r;t[12]!==s.boardId?(r=s.boardId&&a.jsx(nt,{boardId:s.boardId}),t[12]=s.boardId,t[13]=r):r=t[13];let o,u;t[14]!==s?(o=a.jsx(ot,{integration:s}),u=a.jsx(ct,{integration:s}),t[14]=s,t[15]=o,t[16]=u):(o=t[15],u=t[16]);let f;return t[17]!==i||t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==u?(f=a.jsxs(Z,{children:[i,l,r,o,u]}),t[17]=i,t[18]=l,t[19]=r,t[20]=o,t[21]=u,t[22]=f):f=t[22],f}function mt(){const t=N.c(18),e=K();let n;t[0]!==e?(n=e("settings.nav.tasks"),t[0]=e,t[1]=n):n=t[1];let s;t[2]!==n?(s=a.jsx(X.Title,{children:n}),t[2]=n,t[3]=s):s=t[3];let i,l,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Oe,{}),l=a.jsx(Ye,{}),r=a.jsx($e,{}),t[4]=i,t[5]=l,t[6]=r):(i=t[4],l=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Le,{size:18}),t[7]=o):o=t[7];let u;t[8]!==e?(u=e("settings.jira.sectionTitle"),t[8]=e,t[9]=u):u=t[9];let f;t[10]!==u?(f=a.jsxs("span",{className:"flex items-center gap-2",children:[o,u]}),t[10]=u,t[11]=f):f=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(dt,{}),t[12]=d):d=t[12];let c;t[13]!==f?(c=a.jsx(re,{title:f,children:d}),t[13]=f,t[14]=c):c=t[14];let m;return t[15]!==s||t[16]!==c?(m=a.jsx(X,{children:a.jsx(X.Content,{children:a.jsx(X.Body,{children:a.jsxs(fe,{children:[s,i,l,r,c]})})})}),t[15]=s,t[16]=c,t[17]=m):m=t[17],m}function Dt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Be,{capability:"org:manage",area:"settings",children:a.jsx(mt,{})}),t[0]=e):e=t[0],e}export{Dt as default};
1
+ import{c as N,r as J,j as a,l as W,B as H,G as U,a7 as z,K as G,m as V,n as te,e as se,b as K,b4 as ie,t as q,dq as Z,dr as Q,dp as re,P as X,ds as fe,p as ue}from"./index-BZsplvNT.js";import{I as ee}from"./input-MZsLaCQZ.js";import{i as oe}from"./Check-COlZG_Iq.js";import{i as ce}from"./ChevronSelectorVertical-DrBBU4AT.js";import{s as ge}from"./Plus-RDqtgmUn.js";import{s as pe}from"./Trash01-BKalTQIS.js";import{a as xe,c as je,d as he,e as be,b as ye,C as Se}from"./command-CfiREnnD.js";import{a as ve,P as Ne,b as Te}from"./popover-hKCv1VM6.js";import{S as we}from"./switch-2iiOxMIT.js";import{T as de}from"./textarea-BrZpmcDa.js";import{c as _e,d as Ce,b as Pe,f as Ae,g as ke,e as Ie,a as Re,A as Ee}from"./alert-dialog-DR3U9WH-.js";import{R as Oe,A as $e}from"./review-settings-D7yIvq08.js";import{g as De}from"./task-board-CIYSPfni.js";import{R as Be}from"./require-capability-DeSNM-qc.js";import"./index-Ct5rA0-g.js";import"./dialog-Dn9dA6Rv.js";import"./SearchMd-BPJyn57v.js";import"./UserSquare-hcaj17gz.js";import"./GitBranch01-C7r39_B1.js";import"./use-organization-settings-DUnuAPqv.js";import"./constants-Daqiz8AS.js";import"./schema-D-Yt_dVJ.js";import"./access-gate-tjl-KQc5.js";import"./capability-load-error-Dafmx4Ll.js";function Fe(t){const e=N.c(41),{options:n,value:s,onChange:i,placeholder:l,triggerClassName:r,contentClassName:o,width:u,renderTrigger:f,renderItem:d,emptyMessage:c,searchPlaceholder:m,filter:g}=t,p=l===void 0?"Select...":l,b=u===void 0?"w-[200px]":u,j=c===void 0?"No results found.":c,x=m===void 0?"Search...":m;let h;e[0]!==s?(h=L=>L.value===s,e[0]=s,e[1]=h):h=e[1];const y=n.find(h),[S,v]=J.useState(!1),T=Ne,w=ve,P=!0,_=f?a.jsx("div",{className:W("cursor-pointer",r),children:f(y)}):a.jsxs(H,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let C;e[2]!==w||e[3]!==_?(C=a.jsx(w,{asChild:P,children:_}),e[2]=w,e[3]=_,e[4]=C):C=e[4];let A;e[5]!==o?(A=W("p-0",o),e[5]=o,e[6]=A):A=e[6];let D;e[7]===Symbol.for("react.memo_cache_sentinel")?(D={width:"var(--radix-popover-trigger-width)"},e[7]=D):D=e[7];let B;e[8]!==x?(B=a.jsx(xe,{placeholder:x,className:"h-9"}),e[8]=x,e[9]=B):B=e[9];let I;e[10]!==j?(I=a.jsx(je,{children:j}),e[10]=j,e[11]=I):I=e[11];let R;if(e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==v||e[16]!==s){let L;e[18]!==i||e[19]!==d||e[20]!==v||e[21]!==s?(L=k=>{const ne=s===k.value;return a.jsx(he,{value:k.label,onSelect:()=>{i(k.value===s?"":k.value),v(!1)},children:d?d(k,ne):a.jsxs(a.Fragment,{children:[k.label,a.jsx(oe,{className:W("ml-auto",ne?"opacity-100":"opacity-0")})]})},k.value)},e[18]=i,e[19]=d,e[20]=v,e[21]=s,e[22]=L):L=e[22],R=n.map(L),e[12]=i,e[13]=n,e[14]=d,e[15]=v,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(be,{children:R}),e[23]=R,e[24]=E):E=e[24];let M;e[25]!==I||e[26]!==E?(M=a.jsxs(ye,{children:[I,E]}),e[25]=I,e[26]=E,e[27]=M):M=e[27];let O;e[28]!==g||e[29]!==B||e[30]!==M?(O=a.jsxs(Se,{filter:g,children:[B,M]}),e[28]=g,e[29]=B,e[30]=M,e[31]=O):O=e[31];let $;e[32]!==O||e[33]!==A?($=a.jsx(Te,{className:A,style:D,children:O}),e[32]=O,e[33]=A,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==S||e[37]!==v||e[38]!==$||e[39]!==C?(F=a.jsxs(T,{open:S,onOpenChange:v,children:[C,$]}),e[35]=T,e[36]=S,e[37]=v,e[38]=$,e[39]=C,e[40]=F):F=e[40],F}function Le(t){const e=N.c(4),{size:n,className:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=i):i=e[0];let l;return e[1]!==s||e[2]!==n?(l=a.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:i}),e[1]=s,e[2]=n,e[3]=l):l=e[3],l}function me(t){const e=t.projectName?.replace(/\s+/g," ").trim(),n=t.name.trim();return e?{primary:e,secondary:[n,t.projectKey].filter(Boolean).join(" · ")}:{primary:n,secondary:t.projectKey??""}}function qe(t){const{primary:e,secondary:n}=me(t);return[e,n,`#${t.id}`].filter(Boolean).join(" ")}function ae(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const n=ae(e).trim();if(!n)return 1;const s=ae(t);return n.split(/\s+/).every(i=>s.includes(i))?1:0}function Me(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function le(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>(await n.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Je(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=()=>n.call("JIRA_INTEGRATION_DELETE",{}),t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ue(t){const e=N.c(8),{org:n}=U(),s=z();let i;e[0]!==n.id?(i=G.jiraBoards(n.id),e[0]=n.id,e[1]=i):i=e[1];let l;e[2]!==s?(l=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==i||e[6]!==l?(r={queryKey:i,enabled:t,staleTime:6e4,queryFn:l},e[4]=t,e[5]=i,e[6]=l,e[7]=r):r=e[7],V(r)}function ze(t){const e=N.c(10),{org:n}=U(),s=z();let i;e[0]!==t||e[1]!==n.id?(i=G.jiraBoardColumns(n.id,t),e[0]=t,e[1]=n.id,e[2]=i):i=e[2];const l=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==l||e[8]!==r?(o={queryKey:i,enabled:l,staleTime:6e4,queryFn:r},e[6]=i,e[7]=l,e[8]=r,e[9]=o):o=e[9],V(o)}function Ge(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraAutomations(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function He(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{if(o.prompt===null){await n.call("JIRA_AUTOMATION_DELETE",{jiraStatus:o.jiraStatus});return}await n.call("JIRA_AUTOMATION_UPSERT",{jiraStatus:o.jiraStatus,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraAutomations(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Qe(){const t=N.c(12),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=n,t[3]=i):i=t[3];let l;t[4]!==s||t[5]!==i?(l={queryKey:s,staleTime:6e4,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6];const r=V(l);let o;t[7]!==r.data?(o=r.data?.find(We)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let u;return t[9]!==r.isPending||t[10]!==o?(u={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=u):u=t[11],u}function We(t){return t.columnKey===null}function Ve(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{const u=o.trim();if(!u){await n.call("TASK_BOARD_PROMPT_DELETE",{});return}await n.call("TASK_BOARD_PROMPT_UPSERT",{prompt:u})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ye(){const t=N.c(16),e=K(),{prompt:n,isPending:s}=Qe(),i=Ve(),[l,r]=J.useState(n),[o,u]=J.useState(n);o!==n&&(u(n),r(n));let f;t[0]!==e?(f=e("settings.taskPrompt.title"),t[0]=e,t[1]=f):f=t[1];let d;t[2]!==e?(d=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=d):d=t[3];let c;t[4]!==l||t[5]!==s||t[6]!==n||t[7]!==i||t[8]!==e?(c=s?a.jsx(ie,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(de,{value:l,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(H,{size:"sm",disabled:l===n||i.isPending,onClick:()=>i.mutate(l,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=l,t[5]=s,t[6]=n,t[7]=i,t[8]=e,t[9]=c):c=t[9];let m;t[10]!==d||t[11]!==c?(m=a.jsx(Z,{children:a.jsx(Q,{title:d,children:c})}),t[10]=d,t[11]=c,t[12]=m):m=t[12];let g;return t[13]!==f||t[14]!==m?(g=a.jsx(re,{title:f,children:m}),t[13]=f,t[14]=m,t[15]=g):g=t[15],g}function Y(t,e){return t instanceof Error?t.message:e}const Xe="https://id.atlassian.com/manage-profile/security/api-tokens";function Ze(t){const e=N.c(7),{stepKeys:n}=t,s=K();let i;if(e[0]!==n||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],i=n.map(r),e[0]=n,e[1]=s,e[2]=i}else i=e[2];let l;return e[5]!==i?(l=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=l):l=e[6],l}function et(){const t=N.c(69),e=K(),n=le(),[s,i]=J.useState(""),[l,r]=J.useState(""),[o,u]=J.useState("");let f;t[0]!==o||t[1]!==l||t[2]!==s?(f=s.trim()!==""&&l.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=l,t[2]=s,t[3]=f):f=t[3];const d=f;let c;t[4]!==e?(c=e("settings.jira.siteLabel"),t[4]=e,t[5]=c):c=t[5];let m;t[6]!==c?(m=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c}),t[6]=c,t[7]=m):m=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=k=>i(k.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(ee,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let j;t[14]!==m||t[15]!==b?(j=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,b]}),t[14]=m,t[15]=b,t[16]=j):j=t[16];let x;t[17]!==e?(x=e("settings.jira.emailLabel"),t[17]=e,t[18]=x):x=t[18];let h;t[19]!==x?(h=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:x}),t[19]=x,t[20]=h):h=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=k=>r(k.target.value),t[21]=y):y=t[21];let S;t[22]!==e?(S=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=S):S=t[23];let v;t[24]!==l||t[25]!==S?(v=a.jsx(ee,{value:l,onChange:y,placeholder:S,autoComplete:"off"}),t[24]=l,t[25]=S,t[26]=v):v=t[26];let T;t[27]!==v||t[28]!==h?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,v]}),t[27]=v,t[28]=h,t[29]=T):T=t[29];let w;t[30]!==e?(w=e("settings.jira.tokenLabel"),t[30]=e,t[31]=w):w=t[31];let P;t[32]!==w?(P=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),t[32]=w,t[33]=P):P=t[33];let _;t[34]!==e?(_=e("settings.jira.createTokenLink"),t[34]=e,t[35]=_):_=t[35];let C;t[36]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(ue,{size:12}),t[36]=C):C=t[36];let A;t[37]!==_?(A=a.jsxs("a",{href:Xe,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[_,C]}),t[37]=_,t[38]=A):A=t[38];let D;t[39]!==P||t[40]!==A?(D=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,A]}),t[39]=P,t[40]=A,t[41]=D):D=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=k=>u(k.target.value),t[42]=B):B=t[42];let I;t[43]!==e?(I=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=I):I=t[44];let R;t[45]!==o||t[46]!==I?(R=a.jsx(ee,{type:"password",value:o,onChange:B,placeholder:I,autoComplete:"off"}),t[45]=o,t[46]=I,t[47]=R):R=t[47];let E;t[48]!==D||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[D,R]}),t[48]=D,t[49]=R,t[50]=E):E=t[50];const M=!d||n.isPending;let O;t[51]!==o||t[52]!==l||t[53]!==s||t[54]!==e||t[55]!==n?(O=()=>n.mutate({siteUrl:s.trim(),email:l.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:k=>q.error(Y(k,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=l,t[53]=s,t[54]=e,t[55]=n,t[56]=O):O=t[56];let $;t[57]!==e||t[58]!==n.isPending?($=n.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=n.isPending,t[59]=$):$=t[59];let F;t[60]!==M||t[61]!==O||t[62]!==$?(F=a.jsx(H,{size:"sm",className:"w-fit",disabled:M,onClick:O,children:$}),t[60]=M,t[61]=O,t[62]=$,t[63]=F):F=t[63];let L;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==j?(L=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[j,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=j,t[68]=L):L=t[68],L}function tt(t){const e=N.c(44),{integration:n}=t,s=K(),i=Je(),[l,r]=J.useState(!1),o=n.siteUrl,u=n.email;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>r(!0),e[0]=f):f=e[0];let d;e[1]!==s?(d=s("settings.jira.disconnect"),e[1]=s,e[2]=d):d=e[2];let c;e[3]!==d?(c=a.jsx(H,{variant:"outline",size:"sm",onClick:f,children:d}),e[3]=d,e[4]=c):c=e[4];let m;e[5]!==n.email||e[6]!==n.siteUrl||e[7]!==c?(m=a.jsx(Q,{title:o,description:u,action:c}),e[5]=n.email,e[6]=n.siteUrl,e[7]=c,e[8]=m):m=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(_e,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let j;e[15]!==b?(j=a.jsx(Ce,{children:b}),e[15]=b,e[16]=j):j=e[16];let x;e[17]!==j||e[18]!==p?(x=a.jsxs(Pe,{children:[p,j]}),e[17]=j,e[18]=p,e[19]=x):x=e[19];let h;e[20]!==s?(h=s("settings.jira.cancel"),e[20]=s,e[21]=h):h=e[21];let y;e[22]!==h?(y=a.jsx(Ae,{children:h}),e[22]=h,e[23]=y):y=e[23];let S;e[24]!==i||e[25]!==s?(S=()=>i.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:A=>q.error(Y(A,s("settings.jira.saveFailed")))}),e[24]=i,e[25]=s,e[26]=S):S=e[26];let v;e[27]!==s?(v=s("settings.jira.disconnect"),e[27]=s,e[28]=v):v=e[28];let T;e[29]!==S||e[30]!==v?(T=a.jsx(ke,{onClick:S,children:v}),e[29]=S,e[30]=v,e[31]=T):T=e[31];let w;e[32]!==y||e[33]!==T?(w=a.jsxs(Ie,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=w):w=e[34];let P;e[35]!==x||e[36]!==w?(P=a.jsxs(Re,{children:[x,w]}),e[35]=x,e[36]=w,e[37]=P):P=e[37];let _;e[38]!==l||e[39]!==P?(_=a.jsx(Ee,{open:l,onOpenChange:r,children:P}),e[38]=l,e[39]=P,e[40]=_):_=e[40];let C;return e[41]!==_||e[42]!==m?(C=a.jsxs(a.Fragment,{children:[m,_]}),e[41]=_,e[42]=m,e[43]=C):C=e[43],C}function st(t){const e=N.c(36),{integration:n}=t,s=K(),i=le(),l=Ue(!0);let r,o;e[0]!==l.data||e[1]!==n.boardId||e[2]!==n.boardName?(r=(l.data??[]).map(lt),o=n.boardId?r.find(y=>y.value===n.boardId)?.primary??n.boardName??n.boardId:null,e[0]=l.data,e[1]=n.boardId,e[2]=n.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const u=o;let f;e[5]!==s?(f=s("settings.jira.boardLabel"),e[5]=s,e[6]=f):f=e[6];let d;e[7]!==s?(d=s("settings.jira.boardDescription"),e[7]=s,e[8]=d):d=e[8];const c=n.boardId??"";let m;e[9]!==s?(m=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=m):m=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==l.isPending||e[14]!==s?(p=l.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=l.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==u||e[17]!==s?(b=()=>a.jsxs(H,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:u??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=u,e[17]=s,e[18]=b):b=e[18];let j;e[19]!==r||e[20]!==n.boardId||e[21]!==s||e[22]!==i?(j=y=>{!y||y===n.boardId||i.mutate({boardId:y,boardName:r.find(S=>S.value===y)?.primary??null},{onError:S=>q.error(Y(S,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=n.boardId,e[21]=s,e[22]=i,e[23]=j):j=e[23];let x;e[24]!==r||e[25]!==c||e[26]!==m||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==j?(x=a.jsx(Fe,{options:r,value:c,width:"w-72",triggerClassName:"shrink-0",placeholder:m,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:it,onChange:j}),e[24]=r,e[25]=c,e[26]=m,e[27]=g,e[28]=p,e[29]=b,e[30]=j,e[31]=x):x=e[31];let h;return e[32]!==x||e[33]!==f||e[34]!==d?(h=a.jsx(Q,{title:f,description:d,action:x}),e[32]=x,e[33]=f,e[34]=d,e[35]=h):h=e[35],h}function it(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(oe,{className:W("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function lt(t){const{primary:e,secondary:n}=me(t);return{value:String(t.id),label:qe(t),primary:e,secondary:n}}function nt(t){const e=N.c(30),{boardId:n}=t,s=K(),i=ze(n),l=Ge();let r;if(i.isPending||l.isPending){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ie,{className:"h-40 w-full"}),e[0]=c):c=e[0],r=c}else if(i.isError){let c;e[1]!==s?(c=s("settings.jira.columnsFailed"),e[1]=s,e[2]=c):c=e[2];let m;e[3]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[3]=c,e[4]=m):m=e[4],r=m}else if((i.data??[]).length===0){let c;e[5]!==s?(c=s("settings.jira.noColumnsYet"),e[5]=s,e[6]=c):c=e[6];let m;e[7]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8],r=m}else{let c;e[9]!==l.data?(c=new Map((l.data??[]).map(at)),e[9]=l.data,e[10]=c):c=e[10];const m=c;let g;e[11]!==i.data?(g=i.data??[],e[11]=i.data,e[12]=g):g=e[12];let p;if(e[13]!==m||e[14]!==g){let j;e[16]!==m?(j=x=>x.statuses.map(h=>a.jsx(rt,{columnName:x.name,status:h,showStatus:h!==x.name||x.statuses.length>1,hasAutomation:m.has(h),prompt:m.get(h)??null},`${x.name}:${h}`)),e[16]=m,e[17]=j):j=e[17],p=g.flatMap(j),e[13]=m,e[14]=g,e[15]=p}else p=e[15];let b;e[18]!==p?(b=a.jsx("div",{className:"flex w-full flex-col gap-3",children:p}),e[18]=p,e[19]=b):b=e[19],r=b}let o;e[20]!==s?(o=s("settings.jira.automationsLabel"),e[20]=s,e[21]=o):o=e[21];let u;e[22]!==s?(u=s("settings.jira.automationsDescription"),e[22]=s,e[23]=u):u=e[23];let f;e[24]!==r?(f=a.jsx("div",{className:"mt-3",children:r}),e[24]=r,e[25]=f):f=e[25];let d;return e[26]!==o||e[27]!==u||e[28]!==f?(d=a.jsx(Q,{title:o,description:u,children:f}),e[26]=o,e[27]=u,e[28]=f,e[29]=d):d=e[29],d}function at(t){return[t.jiraStatus,t.prompt]}function rt(t){const e=N.c(22),{columnName:n,status:s,showStatus:i,hasAutomation:l,prompt:r}=t,o=K(),u=He(),[f,d]=J.useState(r??""),[c,m]=J.useState(r);c!==r&&(m(r),d(r??""));let g;e[0]!==u||e[1]!==s||e[2]!==o?(g=S=>u.mutate({jiraStatus:s,prompt:S},{onError:v=>q.error(Y(v,o("settings.jira.saveFailed")))}),e[0]=u,e[1]=s,e[2]=o,e[3]=g):g=e[3];const p=g;let b;e[4]!==n?(b=a.jsx("span",{className:"truncate text-sm font-medium",children:n}),e[4]=n,e[5]=b):b=e[5];let j;e[6]!==i||e[7]!==s?(j=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s}),e[6]=i,e[7]=s,e[8]=j):j=e[8];let x;e[9]!==b||e[10]!==j?(x=a.jsxs("div",{className:"flex flex-col min-w-0",children:[b,j]}),e[9]=b,e[10]=j,e[11]=x):x=e[11];let h;e[12]!==f||e[13]!==l||e[14]!==r||e[15]!==p||e[16]!==s||e[17]!==o?(h=l?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.jira.automationOn")}),a.jsx(H,{variant:"ghost",size:"sm","aria-label":o("settings.jira.removeAriaLabel",{status:s}),onClick:()=>p(null),children:a.jsx(pe,{size:14})})]}),a.jsx(de,{value:f,rows:2,placeholder:o("settings.jira.promptPlaceholder"),onChange:S=>d(S.target.value),onBlur:()=>{f!==(r??"")&&p(f)},"data-jira-automation-prompt":s}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.jira.promptHelp")})]}):a.jsxs(H,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>p(""),children:[a.jsx(ge,{size:14}),o("settings.jira.addAutomation")]}),e[12]=f,e[13]=l,e[14]=r,e[15]=p,e[16]=s,e[17]=o,e[18]=h):h=e[18];let y;return e[19]!==x||e[20]!==h?(y=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[x,h]}),e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function ot(t){const e=N.c(16),{integration:n}=t,s=K(),i=le();let l;e[0]!==s?(l=s("settings.jira.enabledLabel"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n.boardId||e[5]!==s||e[6]!==i?(o=d=>{if(d&&!n.boardId){q.error(s("settings.jira.enableRequirements"));return}i.mutate({enabled:d},{onError:c=>q.error(Y(c,s("settings.jira.saveFailed")))})},e[4]=n.boardId,e[5]=s,e[6]=i,e[7]=o):o=e[7];let u;e[8]!==n.enabled||e[9]!==o||e[10]!==i.isPending?(u=a.jsx(we,{checked:n.enabled,disabled:i.isPending,onCheckedChange:o}),e[8]=n.enabled,e[9]=o,e[10]=i.isPending,e[11]=u):u=e[11];let f;return e[12]!==l||e[13]!==r||e[14]!==u?(f=a.jsx(Q,{title:l,description:r,action:u}),e[12]=l,e[13]=r,e[14]=u,e[15]=f):f=e[15],f}function ct(t){const e=N.c(24),{integration:n}=t,s=K(),i=`${window.location.origin}/api/_jira/webhook/${n.webhookSecret}`;let l;e[0]!==s?(l=s("settings.jira.webhookTitle"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==i?(o=a.jsx(ee,{readOnly:!0,value:i,className:"font-mono text-xs"}),e[4]=i,e[5]=o):o=e[5];let u;e[6]!==s||e[7]!==i?(u=()=>{navigator.clipboard.writeText(i),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==s?(f=s("settings.jira.webhookCopy"),e[9]=s,e[10]=f):f=e[10];let d;e[11]!==u||e[12]!==f?(d=a.jsx(H,{variant:"outline",size:"sm",className:"shrink-0",onClick:u,children:f}),e[11]=u,e[12]=f,e[13]=d):d=e[13];let c;e[14]!==o||e[15]!==d?(c=a.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[14]=o,e[15]=d,e[16]=c):c=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Ze,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=m):m=e[17];let g;e[18]!==c?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[c,m]}),e[18]=c,e[19]=g):g=e[19];let p;return e[20]!==l||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:l,description:r,children:g}),e[20]=l,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function dt(){const t=N.c(23),e=K(),n=Me();if(n.isPending){let d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Z,{children:a.jsx("div",{className:"p-4",children:a.jsx(ie,{className:"h-40 w-full"})})}),t[0]=d):d=t[0],d}if(!n.data){let d;t[1]!==e?(d=e("settings.jira.connectTitle"),t[1]=e,t[2]=d):d=t[2];let c;t[3]!==e?(c=e("settings.jira.connectDescription"),t[3]=e,t[4]=c):c=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(et,{}),t[5]=m):m=t[5];let g;return t[6]!==d||t[7]!==c?(g=a.jsx(Z,{children:a.jsx(Q,{title:d,description:c,children:m})}),t[6]=d,t[7]=c,t[8]=g):g=t[8],g}const s=n.data;let i,l;t[9]!==s?(i=a.jsx(tt,{integration:s}),l=a.jsx(st,{integration:s}),t[9]=s,t[10]=i,t[11]=l):(i=t[10],l=t[11]);let r;t[12]!==s.boardId?(r=s.boardId&&a.jsx(nt,{boardId:s.boardId}),t[12]=s.boardId,t[13]=r):r=t[13];let o,u;t[14]!==s?(o=a.jsx(ot,{integration:s}),u=a.jsx(ct,{integration:s}),t[14]=s,t[15]=o,t[16]=u):(o=t[15],u=t[16]);let f;return t[17]!==i||t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==u?(f=a.jsxs(Z,{children:[i,l,r,o,u]}),t[17]=i,t[18]=l,t[19]=r,t[20]=o,t[21]=u,t[22]=f):f=t[22],f}function mt(){const t=N.c(18),e=K();let n;t[0]!==e?(n=e("settings.nav.tasks"),t[0]=e,t[1]=n):n=t[1];let s;t[2]!==n?(s=a.jsx(X.Title,{children:n}),t[2]=n,t[3]=s):s=t[3];let i,l,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Oe,{}),l=a.jsx(Ye,{}),r=a.jsx($e,{}),t[4]=i,t[5]=l,t[6]=r):(i=t[4],l=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Le,{size:18}),t[7]=o):o=t[7];let u;t[8]!==e?(u=e("settings.jira.sectionTitle"),t[8]=e,t[9]=u):u=t[9];let f;t[10]!==u?(f=a.jsxs("span",{className:"flex items-center gap-2",children:[o,u]}),t[10]=u,t[11]=f):f=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(dt,{}),t[12]=d):d=t[12];let c;t[13]!==f?(c=a.jsx(re,{title:f,children:d}),t[13]=f,t[14]=c):c=t[14];let m;return t[15]!==s||t[16]!==c?(m=a.jsx(X,{children:a.jsx(X.Content,{children:a.jsx(X.Body,{children:a.jsxs(fe,{children:[s,i,l,r,c]})})})}),t[15]=s,t[16]=c,t[17]=m):m=t[17],m}function Dt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Be,{capability:"org:manage",area:"settings",children:a.jsx(mt,{})}),t[0]=e):e=t[0],e}export{Dt as default};
@@ -1 +1 @@
1
- import{c as o,l,j as n}from"./index-B_lUDZ9B.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
1
+ import{c as o,l,j as n}from"./index-BZsplvNT.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
@@ -1 +1 @@
1
- import{s as h}from"./slugify-CEUa2lfQ.js";import{M as m}from"./index-B_lUDZ9B.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
1
+ import{s as h}from"./slugify-CEUa2lfQ.js";import{M as m}from"./index-BZsplvNT.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
@@ -1 +1 @@
1
- import{c as j,b as D,j as n,B as T,r as C,u as R,f as k,G as L,d as E,Z as H,y as V,dy as z}from"./index-B_lUDZ9B.js";import{d as B,h as O,c as U,b as F,D as G}from"./dialog-CIbVvLCQ.js";import{i as K}from"./Check-BcH3mbli.js";import{a as W}from"./Copy01-B-07BGuw.js";import{n as Z}from"./Download01-BH00OOK2.js";import{u as $,D as A}from"./use-destination-route-OdrYRKi6.js";import{a as N}from"./constants-Daqiz8AS.js";const q="https://github.com/decocms/studio/releases";function J(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function Q(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function ve(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function X(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function Y(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function M(e){const t=j.c(12),{copiedLabel:o}=e,l=D(),[s,a]=C.useState(!1);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=J(),t[0]=c):c=t[0];const r=c;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:r}),t[1]=i):i=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{Y(navigator.clipboard,r).then(p=>{p&&(a(!0),setTimeout(()=>a(!1),2e3))})},t[2]=d):d=t[2];let f;t[3]!==s?(f=s?n.jsx(K,{size:16}):n.jsx(W,{size:16}),t[3]=s,t[4]=f):f=t[4];let u;t[5]!==s||t[6]!==o||t[7]!==l?(u=s?o:l("downloadApp.copyLabel"),t[5]=s,t[6]=o,t[7]=l,t[8]=u):u=t[8];let m;return t[9]!==f||t[10]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-3",children:[i,n.jsxs(T,{type:"button",className:"w-full gap-2",onClick:d,children:[f,u]})]}),t[9]=f,t[10]=u,t[11]=m):m=t[11],m}function ee(){const e=j.c(18),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabel"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.terminalHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;return e[15]!==l||e[16]!==i?(d=n.jsxs(n.Fragment,{children:[l,i]}),e[15]=l,e[16]=i,e[17]=d):d=e[17],d}function te(){const e=j.c(42),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let f;e[17]!==d?(f=n.jsx("p",{children:d}),e[17]=d,e[18]=f):f=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=Q("4.344.3"),e[19]=u):u=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Z,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=n.jsx(T,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:n.jsxs("a",{href:u,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let w;e[25]!==t?(w=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=w):w=e[26];let b;e[27]!==w?(b=n.jsx("p",{children:w}),e[27]=w,e[28]=b):b=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=n.jsx("a",{href:q,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let v;e[33]!==h||e[34]!==b||e[35]!==x||e[36]!==f?(v=n.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[f,h,b,x]}),e[33]=h,e[34]=b,e[35]=x,e[36]=f,e[37]=v):v=e[37];let S;return e[38]!==l||e[39]!==v||e[40]!==i?(S=n.jsxs(n.Fragment,{children:[l,i,v]}),e[38]=l,e[39]=v,e[40]=i,e[41]=S):S=e[41],S}function Ie(e){const t=j.c(19),{open:o,onOpenChange:l}=e,s=D();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=X(),t[0]=a):a=t[0];const c=a;let r;t[1]!==s?(r=s("downloadApp.title"),t[1]=s,t[2]=r):r=t[2];let i;t[3]!==r?(i=n.jsx(B,{children:r}),t[3]=r,t[4]=i):i=t[4];let d;t[5]!==s?(d=s(c?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=s,t[6]=d):d=t[6];let f;t[7]!==d?(f=n.jsx(O,{children:d}),t[7]=d,t[8]=f):f=t[8];let u;t[9]!==i||t[10]!==f?(u=n.jsxs(U,{children:[i,f]}),t[9]=i,t[10]=f,t[11]=u):u=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=c?n.jsx(te,{}):n.jsx(ee,{}),t[12]=m):m=t[12];let p;t[13]!==u?(p=n.jsxs(F,{className:"sm:max-w-md",children:[u,m]}),t[13]=u,t[14]=p):p=t[14];let h;return t[15]!==l||t[16]!==o||t[17]!==p?(h=n.jsx(G,{open:o,onOpenChange:l,children:p}),t[15]=l,t[16]=o,t[17]=p,t[18]=h):h=t[18],h}const oe="/shell/$org/org-shell/agent-shell";function le(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function se(e){return e.taskIdParam??e.threadSearch??null}function je(){const e=j.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[1]=l):l=e[1];const s=R(l);let a;return e[2]!==o.taskId||e[3]!==s.thread?(a=se({taskIdParam:o.taskId,threadSearch:s.thread}),e[2]=o.taskId,e[3]=s.thread,e[4]=a):a=e[4],a}function ae(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function re(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],k(t).taskId!==void 0}function ne(){const e=j.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=R(t),l=$(),s=re(),a=l===A.agents,c=l===A.home;let r;return e[1]!==s||e[2]!==o.virtualmcpid||e[3]!==a||e[4]!==c?(r=ae({virtualMcpIdSearch:o.virtualmcpid,onAgentsRoute:a,onHomeRoute:c,legacyRoute:s}),e[1]=s,e[2]=o.virtualmcpid,e[3]=a,e[4]=c,e[5]=r):r=e[5],r}function we(){const e=j.c(3),{org:t}=L(),o=ne();let l;return e[0]!==t||e[1]!==o?(l=o??N(t.id).id,e[0]=t,e[1]=o,e[2]=l):l=e[2],l}function ce(e){const{virtualmcpid:t,...o}=e.changes;return{...e.prev,...o,thread:e.threadId}}function be(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ie(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function de(){const e=j.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:oe,shouldThrow:!1},e[1]=l):l=e[1],!!H(l)&&o.taskId===void 0}function Se(){const e=j.c(12),t=E();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const l=k(o),s=de(),{org:a}=L(),c=l.org??"",r=$()===A.agents;let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[1]=i):i=e[1];const d=R(i),f=r?d.virtualmcpid:void 0,u=l.panel;let m;e[2]!==a.id?(m=N(a.id),e[2]=a.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==u||e[5]!==f||e[6]!==p||e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==s?(h=(w,b,g)=>{const x=le({threadInSearch:s,orgSlug:c,threadId:w}),v=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:b,replace:v});const S=ie({currentProject:f,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),y=g?.view&&g.view.tabId!==void 0?V(g.view.tabId):g?.view?{panel:void 0,payload:z()}:null,P=S.kind==="relocate"&&!r,_=I=>ce({prev:P?{sidepanel:I.sidepanel}:I,changes:{...b(I),...y?.payload??{}},threadId:w});return S.kind==="relocate"?t({to:A.agents,params:{org:c,panel:y?y.panel:u},search:I=>({...typeof _=="function"?_(I):_,virtualmcpid:S.project}),replace:v}):t({to:".",params:I=>y?{...I,panel:y.panel}:I,search:I=>({...typeof _=="function"?_(I):_,...r?{virtualmcpid:S.project}:{}}),replace:v})},e[4]=u,e[5]=f,e[6]=p,e[7]=t,e[8]=r,e[9]=c,e[10]=s,e[11]=h):h=e[11],h}export{Ie as D,X as a,Se as b,je as c,we as d,ve as i,be as r,ne as u};
1
+ import{c as j,b as D,j as n,B as T,r as C,u as R,f as k,G as L,d as E,Z as H,y as V,dy as z}from"./index-BZsplvNT.js";import{d as B,h as O,c as U,b as F,D as G}from"./dialog-Dn9dA6Rv.js";import{i as K}from"./Check-COlZG_Iq.js";import{a as W}from"./Copy01-ByTSNoHg.js";import{n as Z}from"./Download01-Cqs5gANt.js";import{u as $,D as A}from"./use-destination-route-BqyAy3Oj.js";import{a as N}from"./constants-Daqiz8AS.js";const q="https://github.com/decocms/studio/releases";function J(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function Q(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function ve(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function X(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function Y(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function M(e){const t=j.c(12),{copiedLabel:o}=e,l=D(),[s,a]=C.useState(!1);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=J(),t[0]=c):c=t[0];const r=c;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:r}),t[1]=i):i=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{Y(navigator.clipboard,r).then(p=>{p&&(a(!0),setTimeout(()=>a(!1),2e3))})},t[2]=d):d=t[2];let f;t[3]!==s?(f=s?n.jsx(K,{size:16}):n.jsx(W,{size:16}),t[3]=s,t[4]=f):f=t[4];let u;t[5]!==s||t[6]!==o||t[7]!==l?(u=s?o:l("downloadApp.copyLabel"),t[5]=s,t[6]=o,t[7]=l,t[8]=u):u=t[8];let m;return t[9]!==f||t[10]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-3",children:[i,n.jsxs(T,{type:"button",className:"w-full gap-2",onClick:d,children:[f,u]})]}),t[9]=f,t[10]=u,t[11]=m):m=t[11],m}function ee(){const e=j.c(18),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabel"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.terminalHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;return e[15]!==l||e[16]!==i?(d=n.jsxs(n.Fragment,{children:[l,i]}),e[15]=l,e[16]=i,e[17]=d):d=e[17],d}function te(){const e=j.c(42),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let f;e[17]!==d?(f=n.jsx("p",{children:d}),e[17]=d,e[18]=f):f=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=Q("4.344.4"),e[19]=u):u=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Z,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=n.jsx(T,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:n.jsxs("a",{href:u,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let w;e[25]!==t?(w=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=w):w=e[26];let b;e[27]!==w?(b=n.jsx("p",{children:w}),e[27]=w,e[28]=b):b=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=n.jsx("a",{href:q,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let v;e[33]!==h||e[34]!==b||e[35]!==x||e[36]!==f?(v=n.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[f,h,b,x]}),e[33]=h,e[34]=b,e[35]=x,e[36]=f,e[37]=v):v=e[37];let S;return e[38]!==l||e[39]!==v||e[40]!==i?(S=n.jsxs(n.Fragment,{children:[l,i,v]}),e[38]=l,e[39]=v,e[40]=i,e[41]=S):S=e[41],S}function Ie(e){const t=j.c(19),{open:o,onOpenChange:l}=e,s=D();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=X(),t[0]=a):a=t[0];const c=a;let r;t[1]!==s?(r=s("downloadApp.title"),t[1]=s,t[2]=r):r=t[2];let i;t[3]!==r?(i=n.jsx(B,{children:r}),t[3]=r,t[4]=i):i=t[4];let d;t[5]!==s?(d=s(c?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=s,t[6]=d):d=t[6];let f;t[7]!==d?(f=n.jsx(O,{children:d}),t[7]=d,t[8]=f):f=t[8];let u;t[9]!==i||t[10]!==f?(u=n.jsxs(U,{children:[i,f]}),t[9]=i,t[10]=f,t[11]=u):u=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=c?n.jsx(te,{}):n.jsx(ee,{}),t[12]=m):m=t[12];let p;t[13]!==u?(p=n.jsxs(F,{className:"sm:max-w-md",children:[u,m]}),t[13]=u,t[14]=p):p=t[14];let h;return t[15]!==l||t[16]!==o||t[17]!==p?(h=n.jsx(G,{open:o,onOpenChange:l,children:p}),t[15]=l,t[16]=o,t[17]=p,t[18]=h):h=t[18],h}const oe="/shell/$org/org-shell/agent-shell";function le(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function se(e){return e.taskIdParam??e.threadSearch??null}function je(){const e=j.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[1]=l):l=e[1];const s=R(l);let a;return e[2]!==o.taskId||e[3]!==s.thread?(a=se({taskIdParam:o.taskId,threadSearch:s.thread}),e[2]=o.taskId,e[3]=s.thread,e[4]=a):a=e[4],a}function ae(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function re(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],k(t).taskId!==void 0}function ne(){const e=j.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=R(t),l=$(),s=re(),a=l===A.agents,c=l===A.home;let r;return e[1]!==s||e[2]!==o.virtualmcpid||e[3]!==a||e[4]!==c?(r=ae({virtualMcpIdSearch:o.virtualmcpid,onAgentsRoute:a,onHomeRoute:c,legacyRoute:s}),e[1]=s,e[2]=o.virtualmcpid,e[3]=a,e[4]=c,e[5]=r):r=e[5],r}function we(){const e=j.c(3),{org:t}=L(),o=ne();let l;return e[0]!==t||e[1]!==o?(l=o??N(t.id).id,e[0]=t,e[1]=o,e[2]=l):l=e[2],l}function ce(e){const{virtualmcpid:t,...o}=e.changes;return{...e.prev,...o,thread:e.threadId}}function be(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ie(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function de(){const e=j.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:oe,shouldThrow:!1},e[1]=l):l=e[1],!!H(l)&&o.taskId===void 0}function Se(){const e=j.c(12),t=E();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const l=k(o),s=de(),{org:a}=L(),c=l.org??"",r=$()===A.agents;let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[1]=i):i=e[1];const d=R(i),f=r?d.virtualmcpid:void 0,u=l.panel;let m;e[2]!==a.id?(m=N(a.id),e[2]=a.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==u||e[5]!==f||e[6]!==p||e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==s?(h=(w,b,g)=>{const x=le({threadInSearch:s,orgSlug:c,threadId:w}),v=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:b,replace:v});const S=ie({currentProject:f,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),y=g?.view&&g.view.tabId!==void 0?V(g.view.tabId):g?.view?{panel:void 0,payload:z()}:null,P=S.kind==="relocate"&&!r,_=I=>ce({prev:P?{sidepanel:I.sidepanel}:I,changes:{...b(I),...y?.payload??{}},threadId:w});return S.kind==="relocate"?t({to:A.agents,params:{org:c,panel:y?y.panel:u},search:I=>({...typeof _=="function"?_(I):_,virtualmcpid:S.project}),replace:v}):t({to:".",params:I=>y?{...I,panel:y.panel}:I,search:I=>({...typeof _=="function"?_(I):_,...r?{virtualmcpid:S.project}:{}}),replace:v})},e[4]=u,e[5]=f,e[6]=p,e[7]=t,e[8]=r,e[9]=c,e[10]=s,e[11]=h):h=e[11],h}export{Ie as D,X as a,Se as b,je as c,we as d,ve as i,be as r,ne as u};