decocms 3.26.2 → 3.27.0

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 (272) hide show
  1. package/dist/client/assets/{AlertCircle-9EFUZenf.js → AlertCircle-Dk6vk346.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-97355q5v.js → ArrowUpRight-4oEjocH3.js} +1 -1
  3. package/dist/client/assets/{Check-D-9dblUn.js → Check-xMlMIzVH.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C2ualSpf.js → CheckCircle-ieh2HpZJ.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-Cf2Q-GlB.js → ChevronDown-DXk0XLak.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-BaV4nFMQ.js → ChevronLeft-z0R4UDTf.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CrZy8tHx.js → ChevronRight-TZkuqway.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BAxoXhnT.js → ChevronUp-CDwUhj6r.js} +1 -1
  9. package/dist/client/assets/{Container-CYcITvPW.js → Container-BuYdkyve.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-SvwN4CeV.js → DotsVertical-dauL8_mz.js} +1 -1
  11. package/dist/client/assets/{Eye-ByuwKsdh.js → Eye-DjmQZ2p3.js} +1 -1
  12. package/dist/client/assets/{FilterLines-BJZdiggU.js → FilterLines-DCVUz1mF.js} +1 -1
  13. package/dist/client/assets/{Globe01-DfGFlik1.js → Globe01-BFX2DjNo.js} +1 -1
  14. package/dist/client/assets/{HardDrive-DNFvbooP.js → HardDrive-ep-sJwLU.js} +1 -1
  15. package/dist/client/assets/{Key01-CzmPnHuw.js → Key01-u8nOkLN5.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CQ8Vq9nI.js → LayoutLeft-Ozgz9jeL.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CgI1VTqi.js → LinkExternal01-C_bnt3ki.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Cw6kmClm.js → Monitor01-BBuvzSNf.js} +1 -1
  19. package/dist/client/assets/{Palette-Druykvzw.js → Palette-CJj0LVDj.js} +1 -1
  20. package/dist/client/assets/{Play-CMJ2IWYR.js → Play-BUy7F0as.js} +1 -1
  21. package/dist/client/assets/{Plus-CjrtKB-Y.js → Plus-CSmw6cpp.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-3BsQQkRx.js → RefreshCcw01-Ct_5xx8z.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BL2y99rx.js → SearchMd-DXp3IUvU.js} +1 -1
  24. package/dist/client/assets/{Settings02-Cd4DIqaJ.js → Settings02-DttqwSGe.js} +1 -1
  25. package/dist/client/assets/{Shield01-zIbMct6w.js → Shield01-BlrpeOP8.js} +1 -1
  26. package/dist/client/assets/{Star01-eRdSY4QW.js → Star01-s_hRJjwq.js} +1 -1
  27. package/dist/client/assets/{Stars01-v0yz6PCZ.js → Stars01-U1zM7H-d.js} +1 -1
  28. package/dist/client/assets/{Stars02-EuAFDZ5E.js → Stars02-Cg2K8h2t.js} +1 -1
  29. package/dist/client/assets/{Sun-CH2HWLCn.js → Sun-D1pch37z.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BMnNI1Fi.js → SwitchHorizontal01-DUBxuMB8.js} +1 -1
  31. package/dist/client/assets/{Tool01-Dcq7KP8Y.js → Tool01-CSM07Bd3.js} +1 -1
  32. package/dist/client/assets/{Trash01-Cup7-ZTT.js → Trash01-BOiUMUTV.js} +1 -1
  33. package/dist/client/assets/{Upload01-C9yi1Bdg.js → Upload01-B45bupsd.js} +1 -1
  34. package/dist/client/assets/{User01-thAIxsAs.js → User01-CMlKZMq6.js} +1 -1
  35. package/dist/client/assets/{Users01-DPJm6-u-.js → Users01-CHcmgQX1.js} +1 -1
  36. package/dist/client/assets/{Users03-BlNe2PnN.js → Users03-C19XPgsH.js} +1 -1
  37. package/dist/client/assets/{X-1KR4wibP.js → X-LT7RIKGm.js} +1 -1
  38. package/dist/client/assets/{XCircle-UPVnJx4i.js → XCircle-fZmWWsk8.js} +1 -1
  39. package/dist/client/assets/{XClose-pR-QU0OQ.js → XClose-CXQHotFO.js} +1 -1
  40. package/dist/client/assets/{Zap-Cl-JM7N9.js → Zap-DhYBCL8w.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-B1o2Q9OR.js → ZapSquare-Br5HjwCx.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-D8vQ49we.js → ZoomOut-DiWWUJB1.js} +1 -1
  43. package/dist/client/assets/{access-gate-CWPebMdP.js → access-gate-CAbN0Agd.js} +1 -1
  44. package/dist/client/assets/{accordion-aX0NKKKh.js → accordion-CqS3rCYY.js} +1 -1
  45. package/dist/client/assets/add-section-modal-Xtytp9xF.js +1 -0
  46. package/dist/client/assets/agent-capabilities-CH2iEpSS.js +3 -0
  47. package/dist/client/assets/{agent-icon-DT8dQ9tq.js → agent-icon-DyETFFvd.js} +1 -1
  48. package/dist/client/assets/agent-icons-0as3WkuR.js +4 -0
  49. package/dist/client/assets/{agents-list-DDhPNISh.js → agents-list-CDTD2QQV.js} +1 -1
  50. package/dist/client/assets/ai-providers-CmBK6tVa.js +1 -0
  51. package/dist/client/assets/{alert-DyB_hFGI.js → alert-BvaxqAIW.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CSkQIwm8.js → alert-dialog-C_C5CWIi.js} +1 -1
  53. package/dist/client/assets/app-editor-BeU6l_dS.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BUwhIhze.js → auth-catchall-DBSfiKWC.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CY4CpKKX.js → auth-split-layout-CEZXGHtA.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-5M4PNEWw.js → automation-list-row-s3KQqnbA.js} +1 -1
  57. package/dist/client/assets/automation-runs-RFg521Hi.js +1 -0
  58. package/dist/client/assets/{automations-Cy981ltn.js → automations-C4zBnLxc.js} +1 -1
  59. package/dist/client/assets/{avatar-BHEXMwdE.js → avatar-DI2KQvq0.js} +1 -1
  60. package/dist/client/assets/{badge-Da0IsrqH.js → badge-DqS5s_eb.js} +1 -1
  61. package/dist/client/assets/brand-context-Cg_N2T5g.js +1 -0
  62. package/dist/client/assets/buckets-CGFQSBKU.js +1 -0
  63. package/dist/client/assets/{calendar-BbhbS2FE.js → calendar-CuCfbpTI.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-Dfw4xb8a.js → capability-load-error-DMe1nIxk.js} +1 -1
  65. package/dist/client/assets/{card-BUTabNLA.js → card-C0qmaAJH.js} +1 -1
  66. package/dist/client/assets/chat-context-DEKG6yp4.js +20 -0
  67. package/dist/client/assets/{checkbox--nDaSUZE.js → checkbox-ClCQ7aIa.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-CUSnxWUp.js → cli-auth-success-YaavH1FD.js} +1 -1
  69. package/dist/client/assets/collection-detail-TiY0uzM1.js +1 -0
  70. package/dist/client/assets/{collection-display-button-BfQyXSIv.js → collection-display-button-C6_DwOqJ.js} +1 -1
  71. package/dist/client/assets/{collection-search-LsgoMrVO.js → collection-search-uQS9yrST.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-D3ciIIEv.js → collection-table-wrapper-CTY0qyxJ.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CQJiHDMR.js → collection-tabs-dTL9gxGq.js} +1 -1
  74. package/dist/client/assets/{collections-C_j8CeI8.js → collections-5f6Mz9W3.js} +1 -1
  75. package/dist/client/assets/{command-BehF6pb8.js → command-DZekvH1G.js} +1 -1
  76. package/dist/client/assets/connect-desktop-dialog-Bi-Fd5NF.js +1 -0
  77. package/dist/client/assets/{connection-card-EXvV7rxl.js → connection-card-CVH5Hy6F.js} +1 -1
  78. package/dist/client/assets/connection-detail-mj8sHl20.js +1 -0
  79. package/dist/client/assets/{connection-form-helpers-DoJomSCQ.js → connection-form-helpers-DFXgro4O.js} +1 -1
  80. package/dist/client/assets/connections-D3Q6bIzz.js +1 -0
  81. package/dist/client/assets/{decopilot-sse-pool-BUhEcft-.js → decopilot-sse-pool-Keqs3wfV.js} +1 -1
  82. package/dist/client/assets/{dialog-Bm1pP7Vu.js → dialog-BE3BWPis.js} +1 -1
  83. package/dist/client/assets/domain-settings-Bq8L3_pf.js +1 -0
  84. package/dist/client/assets/{drawer-B51jkLaX.js → drawer-BSFXr7hp.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CIu58K9q.js → dropdown-menu-D7fqzmBS.js} +1 -1
  86. package/dist/client/assets/dynamic-plugin-layout-CK3Aqazw.js +1 -0
  87. package/dist/client/assets/{empty-state-1AbmTLd7.js → empty-state-BumLAiri.js} +1 -1
  88. package/dist/client/assets/{empty-state-BfmCVPeb.js → empty-state-Eik7Dn7e.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-LoMqboL3.js → extract-connection-data-BLVQkjXZ.js} +1 -1
  90. package/dist/client/assets/{features-DWJ09Fdz.js → features-BPRhAfHF.js} +1 -1
  91. package/dist/client/assets/file-explorer-D9JJ-ABp.js +2 -0
  92. package/dist/client/assets/{file-type-icon-CX5JEvCQ.js → file-type-icon-I99Qy2JI.js} +1 -1
  93. package/dist/client/assets/{files-QExlaPCQ.js → files-Bo9D7ZcJ.js} +1 -1
  94. package/dist/client/assets/{form-BcPtow5O.js → form-Bn5_lJ6b.js} +1 -1
  95. package/dist/client/assets/general-BKEEaSjd.js +1 -0
  96. package/dist/client/assets/{generate-id-CadHbHqX.js → generate-id-D0pLsbUu.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-B24_pGAu.js → github-repo-picker-CKp3ba8m.js} +1 -1
  98. package/dist/client/assets/header-tab-button-CbbR6n8q.js +5 -0
  99. package/dist/client/assets/{hover-card-DE2_8MLP.js → hover-card-NLGI_Z11.js} +1 -1
  100. package/dist/client/assets/image-field-Baxidks4.js +1 -0
  101. package/dist/client/assets/{index-BflNEs6l.js → index-B-No0lhl.js} +1 -1
  102. package/dist/client/assets/{index-50-dmJFK.js → index-B6YB9tmn.js} +1 -1
  103. package/dist/client/assets/{index-B1bHiM-j.js → index-BE8dVooN.js} +1 -1
  104. package/dist/client/assets/index-BGdRrrmO.js +1 -0
  105. package/dist/client/assets/{index-J2NhKqyZ.js → index-BM5cVzVa.js} +5 -5
  106. package/dist/client/assets/{index-Dr4Isy1j.js → index-BTFwMarm.js} +1 -1
  107. package/dist/client/assets/{index-r7-3fAFf.js → index-Bgv8YQhF.js} +1 -1
  108. package/dist/client/assets/{index-biiHZ5l9.js → index-Bll1AlZi.js} +26 -26
  109. package/dist/client/assets/{index-D6ELOmUq.js → index-Bz4SrPhc.js} +1 -1
  110. package/dist/client/assets/{index-Bo5bzoUm.js → index-CF_awNaT.js} +1 -1
  111. package/dist/client/assets/{index-YdX5UjUB.js → index-ClpGtndr.js} +1 -1
  112. package/dist/client/assets/{index-CZJ35dl3.css → index-DfYyH4IW.css} +1 -1
  113. package/dist/client/assets/{index-CR_LeyNj.js → index-DxNfIzhJ.js} +1 -1
  114. package/dist/client/assets/{index-CHdFXpqc.js → index-YVfCniqO.js} +1 -1
  115. package/dist/client/assets/index-apuzt69p.js +310 -0
  116. package/dist/client/assets/index-bSiT8Vjd.js +1 -0
  117. package/dist/client/assets/{index-redirect-pPYMz5D6.js → index-redirect-DjHBgih0.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-B0VBGXv5.js → infiniteQueryObserver-B-dakPwk.js} +1 -1
  119. package/dist/client/assets/{input-5PMMNPU9.js → input-CMMOM0dD.js} +1 -1
  120. package/dist/client/assets/{integration-icon-Dy-a3x5R.js → integration-icon-DblM7d27.js} +1 -1
  121. package/dist/client/assets/{label-CcC4_aKf.js → label-cKO6vIjy.js} +1 -1
  122. package/dist/client/assets/{layout-CbTbCjmA.js → layout-QBDJ_skY.js} +1 -1
  123. package/dist/client/assets/{login-Dn4EF5EK.js → login-BAGu_SJp.js} +1 -1
  124. package/dist/client/assets/members-C7uPVWw3.js +3 -0
  125. package/dist/client/assets/{monaco-editor-CJVi8Ty8.js → monaco-editor-BD33gVrt.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BAplEVfE.js → monitoring-stats-row-Bvt3RsAI.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-D5XAAL8p.js → oauth-callback-DvAeoSNI.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-tGQCB63I.js → oauth-callback-ai-provider-BuhDe7NV.js} +1 -1
  129. package/dist/client/assets/{onboarding-CgvYwT2C.js → onboarding-DiyHWSGI.js} +1 -1
  130. package/dist/client/assets/{org-install-CV5qvXsE.js → org-install-B1rM2juw.js} +1 -1
  131. package/dist/client/assets/{org-layout-BFil8fwL.js → org-layout-Ck7vt_mB.js} +1 -1
  132. package/dist/client/assets/org-plugin-layout-Cc5oLilE.js +1 -0
  133. package/dist/client/assets/{page-seo-form-Bbna5w2y.js → page-seo-form-CTM0Xp8N.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-nSdCZ-KL.js +1 -0
  135. package/dist/client/assets/pair-BidrJ4sX.js +39 -0
  136. package/dist/client/assets/{plugin-empty-state-DM8dR2Wk.js → plugin-empty-state-CERz9K1r.js} +1 -1
  137. package/dist/client/assets/{plugin-header-CaWKfaZE.js → plugin-header-CISIxXxk.js} +1 -1
  138. package/dist/client/assets/plugin-layout-UkXtyZlZ.js +1 -0
  139. package/dist/client/assets/{popover-Cvcd3A1d.js → popover-CNh3Ozeq.js} +1 -1
  140. package/dist/client/assets/{post-editor-CM-ESdP7.js → post-editor-C3YLiXXM.js} +3 -3
  141. package/dist/client/assets/{primitives-DWXKnou4.js → primitives-Y0YbWOD4.js} +1 -1
  142. package/dist/client/assets/{profile-DmCC3zYK.js → profile-o29P_MC2.js} +1 -1
  143. package/dist/client/assets/project-app-view-DHVFZPIZ.js +1 -0
  144. package/dist/client/assets/record-editor-DtXRmftd.js +1 -0
  145. package/dist/client/assets/registry-jlRh9TsH.js +2 -0
  146. package/dist/client/assets/registry-layout-zUgwlIce.js +27 -0
  147. package/dist/client/assets/{require-capability-DVI2cKO3.js → require-capability-CQkA6hP5.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-zYH6NIDF.js → required-auth-layout-Sv9_QEzP.js} +1 -1
  149. package/dist/client/assets/{reset-password-DXXx8e6Q.js → reset-password-C1pH8pyn.js} +1 -1
  150. package/dist/client/assets/{resizable-BbbLszRZ.js → resizable-BTpQlX-z.js} +1 -1
  151. package/dist/client/assets/{roles-vHYrQg5g.js → roles-CL5RMNps.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-JBVOc1Wy.js +1 -0
  153. package/dist/client/assets/{save-status-pJVz5vCQ.js → save-status-Dfy3Cw0L.js} +1 -1
  154. package/dist/client/assets/{schema-form-nZH-67HX.js → schema-form-BLq0KNxn.js} +1 -1
  155. package/dist/client/assets/{scroll-area-BqOijBAI.js → scroll-area-SRbC7c25.js} +1 -1
  156. package/dist/client/assets/{search-input-BgGthWir.js → search-input-JFEU6QlH.js} +1 -1
  157. package/dist/client/assets/secrets-DvkQvbwt.js +1 -0
  158. package/dist/client/assets/sections-editor-HXjdp6eB.js +2 -0
  159. package/dist/client/assets/{select-CNSUv3cw.js → select-CTk6Rsq0.js} +1 -1
  160. package/dist/client/assets/{select-model-0CGh6cKF.js → select-model-D2KMm6n2.js} +1 -1
  161. package/dist/client/assets/seo-editor-ifMY-Fw8.js +1 -0
  162. package/dist/client/assets/{settings-layout-DRYgevr6.js → settings-layout-BCPOwwNR.js} +1 -1
  163. package/dist/client/assets/{settings-section-V9kb8x32.js → settings-section-CcspUfab.js} +1 -1
  164. package/dist/client/assets/{sheet-D99KevZC.js → sheet-DokH5LKH.js} +1 -1
  165. package/dist/client/assets/{shell-controls-DSSWZ7Ia.js → shell-controls-rZZhpuW4.js} +1 -1
  166. package/dist/client/assets/{shell-layout-4LsIVsl3.js → shell-layout-DO1LZiwY.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-DI9OtFHe.js +1 -0
  168. package/dist/client/assets/{sidebar-CPZXU-2w.js → sidebar-hk7mPADd.js} +1 -1
  169. package/dist/client/assets/{skeleton--DN75sg7.js → skeleton-CxMjy9Kg.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-g7bq1nDZ.js → sortable.esm-BnSJaRIy.js} +1 -1
  171. package/dist/client/assets/{spinner-DJD6-9r-.js → spinner-Dstb6AhM.js} +1 -1
  172. package/dist/client/assets/sso-lfWsp7Wf.js +1 -0
  173. package/dist/client/assets/{store-DTK5DubB.js → store-CHpKgn9g.js} +1 -1
  174. package/dist/client/assets/store-registry-D9xAoVoW.js +2 -0
  175. package/dist/client/assets/studio-tools-I8Y7AvNq.js +1 -0
  176. package/dist/client/assets/{switch-D6SWnoi2.js → switch-Ds4XHhlB.js} +1 -1
  177. package/dist/client/assets/{tab-id-D4SJwEQy.js → tab-id-D_jK7L5o.js} +2 -2
  178. package/dist/client/assets/{table-Cx3PhNth.js → table-BvWfaT33.js} +1 -1
  179. package/dist/client/assets/{tabs-DCDCb9Pz.js → tabs-2_PrfGe1.js} +1 -1
  180. package/dist/client/assets/{task-status-P3BULAyA.js → task-status-CyBgq1B0.js} +1 -1
  181. package/dist/client/assets/{textarea-QEULyLXh.js → textarea-D7mZzw_Y.js} +1 -1
  182. package/dist/client/assets/{toggle-group-DhVqXGfs.js → toggle-group-CcV2qfqh.js} +1 -1
  183. package/dist/client/assets/{toolbar-BsB4Mvyv.js → toolbar-Vk0X9zFW.js} +1 -1
  184. package/dist/client/assets/{tools-list-Ch5RlbiL.js → tools-list-DZyHvyxj.js} +1 -1
  185. package/dist/client/assets/{tooltip-bsrBmmjV.js → tooltip-B2vnmSMM.js} +1 -1
  186. package/dist/client/assets/{types-jBdXInU0.js → types-DsBzghfJ.js} +1 -1
  187. package/dist/client/assets/use-ai-providers-BDbyWdvc.js +1 -0
  188. package/dist/client/assets/{use-automations-Db8x6SNU.js → use-automations-DjpksCFK.js} +1 -1
  189. package/dist/client/assets/{use-capability-BPM45mbW.js → use-capability-cYRWRLhr.js} +1 -1
  190. package/dist/client/assets/{use-collections-B5Jh_wGd.js → use-collections-DI2EpqEk.js} +1 -1
  191. package/dist/client/assets/{use-connection-DyJtuHQI.js → use-connection-Cam2HslE.js} +1 -1
  192. package/dist/client/assets/{use-copy-P6tx-uOp.js → use-copy-CyNGh3eK.js} +1 -1
  193. package/dist/client/assets/{use-create-virtual-mcp-CWYOy45e.js → use-create-virtual-mcp-TPoPQ6hG.js} +1 -1
  194. package/dist/client/assets/{use-debounced-autosave-ClLbciGl.js → use-debounced-autosave-b8Qk2OvK.js} +1 -1
  195. package/dist/client/assets/use-delete-connection-DXpw9Kqu.js +1 -0
  196. package/dist/client/assets/use-file-configs-J3tDrhRd.js +1 -0
  197. package/dist/client/assets/{use-infinite-scroll-xQQ6lYk4.js → use-infinite-scroll-CF4jvsDL.js} +1 -1
  198. package/dist/client/assets/{use-list-state-BZmeG7gi.js → use-list-state-C3OBf8IN.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-CWFUu1lY.js → use-mcp-client-Des-fSV9.js} +2 -2
  200. package/dist/client/assets/{use-mcp-prompts-B5RhBVzg.js → use-mcp-prompts-d7xtcVsP.js} +1 -1
  201. package/dist/client/assets/{use-mcp-tools-DePRGZE5.js → use-mcp-tools-DVBLMBo3.js} +1 -1
  202. package/dist/client/assets/{use-members-Cw70r_Wh.js → use-members-CTowYB9Z.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-CdsMYUzL.js → use-navigate-to-agent-TzPRxzJx.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client--i_Sx92M.js → use-org-auth-client-uSzlmndB.js} +1 -1
  205. package/dist/client/assets/{use-org-sso-C1cJTBIx.js → use-org-sso-Bez1Sajf.js} +1 -1
  206. package/dist/client/assets/{use-organization-roles-ATKYiNpl.js → use-organization-roles-DfnjRa-5.js} +1 -1
  207. package/dist/client/assets/{use-organization-settings-Izqk1Gkk.js → use-organization-settings-B5dKExdR.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-C-WVKjSU.js → use-registry-connections-CWiPZtVM.js} +1 -1
  209. package/dist/client/assets/use-secrets-CrukgaJs.js +1 -0
  210. package/dist/client/assets/{use-status-sounds-BJ_LqdGJ.js → use-status-sounds-B1WepgCG.js} +1 -1
  211. package/dist/client/assets/{use-view-mode-CbT8E3wV.js → use-view-mode-q_aFx9Fj.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-0jbEmvOc.js → use-virtual-mcp-71PpEQrs.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-Dl7i7ptk.js +1 -0
  214. package/dist/client/assets/{useRouterState-Dm0UHjU4.js → useRouterState-l6E4h2DF.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-CmT2FyND.js +1 -0
  216. package/dist/client/assets/user-ZvpM4E3a.js +1 -0
  217. package/dist/client/assets/{view-mode-toggle-G0qNMbJ1.js → view-mode-toggle-oQJDkJzK.js} +1 -1
  218. package/dist/client/assets/workflow-detail-Ba-EIKe1.js +1 -0
  219. package/dist/client/assets/workflow-i0CMnn6N.js +1 -0
  220. package/dist/client/index.html +2 -2
  221. package/dist/server/cli.js +439 -419
  222. package/dist/server/migrate.js +95 -95
  223. package/dist/server/server.js +287 -282
  224. package/package.json +1 -1
  225. package/dist/client/assets/add-section-modal-DbuGc2qc.js +0 -1
  226. package/dist/client/assets/agent-capabilities-BJLQSkAN.js +0 -3
  227. package/dist/client/assets/agent-icons-DRrDyR7j.js +0 -4
  228. package/dist/client/assets/ai-providers-GxPLAPId.js +0 -1
  229. package/dist/client/assets/app-editor-BsxVHV86.js +0 -1
  230. package/dist/client/assets/automation-runs-BJTRztep.js +0 -1
  231. package/dist/client/assets/brand-context-DTmvDRqf.js +0 -1
  232. package/dist/client/assets/buckets-Cv3AB_TT.js +0 -1
  233. package/dist/client/assets/chat-context-Bu6qpu9K.js +0 -20
  234. package/dist/client/assets/collection-detail-DHxXW6T4.js +0 -1
  235. package/dist/client/assets/connect-desktop-dialog-DPqrgnkS.js +0 -1
  236. package/dist/client/assets/connection-detail-58UbdFd3.js +0 -1
  237. package/dist/client/assets/connections-BMZIGugH.js +0 -1
  238. package/dist/client/assets/domain-settings-DHsRsnmX.js +0 -1
  239. package/dist/client/assets/dynamic-plugin-layout-DWE13BKk.js +0 -1
  240. package/dist/client/assets/file-explorer-Dmpsw-4-.js +0 -2
  241. package/dist/client/assets/general-CLesrOe8.js +0 -1
  242. package/dist/client/assets/header-tab-button-DSX6YPkf.js +0 -5
  243. package/dist/client/assets/image-field-D00iYa4G.js +0 -1
  244. package/dist/client/assets/index-BZvxagUr.js +0 -310
  245. package/dist/client/assets/index-CCs3Chg3.js +0 -1
  246. package/dist/client/assets/index-Db3P8pHg.js +0 -1
  247. package/dist/client/assets/members-BwcNzXwU.js +0 -3
  248. package/dist/client/assets/org-plugin-layout-DyCflrr1.js +0 -1
  249. package/dist/client/assets/page-seo-sheet-D9M3CoUb.js +0 -1
  250. package/dist/client/assets/pair-Ba1UoSSJ.js +0 -39
  251. package/dist/client/assets/plugin-layout-DrVKV-lp.js +0 -1
  252. package/dist/client/assets/project-app-view-C9azYjZP.js +0 -1
  253. package/dist/client/assets/record-editor-DJucp492.js +0 -1
  254. package/dist/client/assets/registry-hKns5OCc.js +0 -2
  255. package/dist/client/assets/registry-layout-DPaKDLDg.js +0 -27
  256. package/dist/client/assets/save-referenced-block-q2CPWVkl.js +0 -1
  257. package/dist/client/assets/secrets-YkTDT7yT.js +0 -1
  258. package/dist/client/assets/sections-editor-CSz4pxMw.js +0 -2
  259. package/dist/client/assets/seo-editor-CspZxazh.js +0 -1
  260. package/dist/client/assets/shell-route-loading-5KSwc3hj.js +0 -1
  261. package/dist/client/assets/sso-D04DjSnZ.js +0 -1
  262. package/dist/client/assets/store-registry-nABlp_7k.js +0 -2
  263. package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +0 -1
  264. package/dist/client/assets/use-ai-providers-v0sCRzMO.js +0 -1
  265. package/dist/client/assets/use-delete-connection-C60uGs0b.js +0 -1
  266. package/dist/client/assets/use-file-configs-CC8ghNUa.js +0 -1
  267. package/dist/client/assets/use-secrets-BpdIBEe6.js +0 -1
  268. package/dist/client/assets/useInfiniteQuery-BGg7INCQ.js +0 -1
  269. package/dist/client/assets/useSuspenseInfiniteQuery-B4dQiTEq.js +0 -1
  270. package/dist/client/assets/user-DRDdFgUw.js +0 -1
  271. package/dist/client/assets/workflow-D1PUPL3K.js +0 -1
  272. package/dist/client/assets/workflow-detail-CRUxUbKb.js +0 -1
@@ -1,2 +0,0 @@
1
- import{e as Me,r as R,j as t,B as Ve,l as Yt,c as pe,G as Qs,o as ce,K as Xs}from"./index-biiHZ5l9.js";import{t as $n}from"./ChevronDown-Cf2Q-GlB.js";import{i as ea}from"./ChevronRight-CrZy8tHx.js";import{n as ta}from"./ChevronUp-BAxoXhnT.js";import{D as qt,u as Wt,J as On,g as _t,E as na,F as sa}from"./agent-icon-DT8dQ9tq.js";import{i as aa}from"./Globe01-DfGFlik1.js";import{S as ft}from"./scroll-area-BqOijBAI.js";import{T as nt,a as st,b as at}from"./tooltip-bsrBmmjV.js";import{c as Ln,b as In,e as zn,d as Fn,a as Bn,D as Kn}from"./dialog-Bm1pP7Vu.js";import{I as Hn}from"./input-5PMMNPU9.js";import{r as oa,i as vt,P as ra,S as ia,N as la,l as He,c as ca,G as ua,a as da,b as xt,u as ma,d as fa,e as pa,f as ha,g as ga,h as va,j as xa,k as ba,m as pt,n as Lt,o as tt,p as _n,q as jn,s as Sa,t as It,v as ya,w as _a,x as ja,y as ka,z as wa,A as Na,B as Ca,C as Ta,D as ht,E as Ra,F as Aa,H as Da,I as Pa,J as Va,K as Ma,L as zt,M as Ea,O as $a,Q as Oa,R as Ft,T as La,U as Ia,V as kn}from"./index-BZvxagUr.js";import{a as Un,s as za}from"./Eye-ByuwKsdh.js";import{d as Fa}from"./ZoomOut-D8vQ49we.js";import{a as Ba}from"./RefreshCcw01-3BsQQkRx.js";import{s as bt}from"./Plus-CjrtKB-Y.js";import{s as jt}from"./Trash01-Cup7-ZTT.js";import{i as Ka}from"./Zap-Cl-JM7N9.js";import{a as Gt,c as Ze,b as Jt,D as Zt,d as Ha}from"./dropdown-menu-CIu58K9q.js";import{u as Yn,a as St,K as qn,P as Wn,b as Gn,C as Jn,s as Zn,d as yt,D as Qn,c as Xn,S as es,v as Ua,e as ts,h as Ya}from"./sortable.esm-g7bq1nDZ.js";import{r as qa,s as Wa,u as it,S as Ut}from"./schema-form-nZH-67HX.js";import{r as wn,u as Ga,d as Ja,a as Za,i as Qa,f as Xa,P as eo,b as to,S as no}from"./page-seo-form-Bbna5w2y.js";import{c as so,C as ao,e as Nn,d as oo,a as ro,g as io}from"./command-BehF6pb8.js";import{i as lo}from"./FilterLines-BJZdiggU.js";import{i as co}from"./Tool01-Dcq7KP8Y.js";import{AddSectionModal as uo}from"./add-section-modal-DbuGc2qc.js";import{c as mo}from"./save-referenced-block-q2CPWVkl.js";import"./AlertCircle-9EFUZenf.js";import"./SwitchHorizontal01-BMnNI1Fi.js";import"./XCircle-UPVnJx4i.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./Check-D-9dblUn.js";import"./ChevronLeft-BaV4nFMQ.js";import"./DotsVertical-SvwN4CeV.js";import"./Container-CYcITvPW.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./Key01-CzmPnHuw.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Play-CMJ2IWYR.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./X-1KR4wibP.js";import"./select-CNSUv3cw.js";import"./agent-capabilities-BJLQSkAN.js";import"./chat-context-Bu6qpu9K.js";import"./tab-id-D4SJwEQy.js";import"./use-mcp-client-CWFUu1lY.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-0jbEmvOc.js";import"./use-collections-B5Jh_wGd.js";import"./use-ai-providers-v0sCRzMO.js";import"./use-organization-settings-Izqk1Gkk.js";import"./pair-Ba1UoSSJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./content-blocks-o63cs2vh.js";import"./types-jBdXInU0.js";import"./shell-layout-4LsIVsl3.js";import"./avatar-BHEXMwdE.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./integration-icon-Dy-a3x5R.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./use-connection-DyJtuHQI.js";import"./use-mcp-prompts-B5RhBVzg.js";import"./form-BcPtow5O.js";import"./label-CcC4_aKf.js";import"./spinner-DJD6-9r-.js";import"./drawer-B51jkLaX.js";import"./collection-search-LsgoMrVO.js";import"./tabs-DCDCb9Pz.js";import"./toggle-group-DhVqXGfs.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./agent-icons-DRrDyR7j.js";import"./checkbox--nDaSUZE.js";import"./skeleton--DN75sg7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-V9kb8x32.js";import"./card-BUTabNLA.js";import"./popover-Cvcd3A1d.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./index-Bo5bzoUm.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-5KSwc3hj.js";import"./sidebar-CPZXU-2w.js";import"./sheet-D99KevZC.js";import"./toolbar-BsB4Mvyv.js";import"./use-create-virtual-mcp-CWYOy45e.js";import"./github-repo-picker-B24_pGAu.js";import"./use-mcp-tools-DePRGZE5.js";import"./extract-connection-data-LoMqboL3.js";import"./generate-id-CadHbHqX.js";import"./collections-C_j8CeI8.js";import"./alert-dialog-CSkQIwm8.js";import"./index-B1bHiM-j.js";import"./use-org-auth-client--i_Sx92M.js";import"./hover-card-DE2_8MLP.js";import"./task-status-P3BULAyA.js";import"./use-status-sounds-BJ_LqdGJ.js";import"./empty-state-1AbmTLd7.js";import"./resizable-BbbLszRZ.js";import"./use-capability-BPM45mbW.js";import"./header-tab-button-DSX6YPkf.js";import"./index-BflNEs6l.js";import"./textarea-QEULyLXh.js";import"./user-DRDdFgUw.js";import"./tools-list-Ch5RlbiL.js";import"./badge-Da0IsrqH.js";import"./connection-slug-eyAPH6o3.js";import"./switch-D6SWnoi2.js";import"./use-debounced-autosave-ClLbciGl.js";import"./index-r7-3fAFf.js";import"./search-input-BgGthWir.js";import"./collection-tabs-CQJiHDMR.js";import"./use-secrets-BpdIBEe6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-aX0NKKKh.js";import"./view-mode-toggle-G0qNMbJ1.js";import"./select-model-0CGh6cKF.js";import"./use-automations-Db8x6SNU.js";import"./monaco-editor-CJVi8Ty8.js";import"./automation-runs-BJTRztep.js";import"./table-Cx3PhNth.js";import"./use-infinite-scroll-xQQ6lYk4.js";import"./use-members-Cw70r_Wh.js";import"./useSuspenseInfiniteQuery-B4dQiTEq.js";import"./automation-list-row-5M4PNEWw.js";import"./connection-card-EXvV7rxl.js";import"./use-registry-connections-C-WVKjSU.js";import"./connection-form-helpers-DoJomSCQ.js";import"./calendar-BbhbS2FE.js";import"./image-field-D00iYa4G.js";import"./use-file-configs-CC8ghNUa.js";import"./index-CR_LeyNj.js";function fo(r){const e=Me.c(38),{open:s,initialName:a,autoLabel:i,isPending:c,onSubmit:p,onOpenChange:d}=r,l=c===void 0?!1:c,[g,v]=R.useState(a),[b,_]=R.useState(s);s!==b&&(_(s),s&&v(a));let w;e[0]!==l||e[1]!==d?(w=E=>{!E&&!l&&d(!1)},e[0]=l,e[1]=d,e[2]=w):w=e[2];const u=w;let x;e[3]!==l||e[4]!==g||e[5]!==p?(x=async E=>{E.preventDefault(),!l&&await p(g.trim())},e[3]=l,e[4]=g,e[5]=p,e[6]=x):x=e[6];const f=x;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ln,{children:"Rename variant"}),e[7]=N):N=e[7];const h=i||"the rule";let S;e[8]!==h?(S=t.jsxs(In,{children:[N,t.jsxs(zn,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:h}),"."]})]}),e[8]=h,e[9]=S):S=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=C):C=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=E=>v(E.target.value),e[11]=j):j=e[11];let P;e[12]!==i||e[13]!==l||e[14]!==g?(P=t.jsxs("div",{className:"space-y-1.5 py-4",children:[C,t.jsx(Hn,{id:"variant-rename-name",value:g,onChange:j,placeholder:i,autoFocus:!0,disabled:l})]}),e[12]=i,e[13]=l,e[14]=g,e[15]=P):P=e[15];let k;e[16]!==d?(k=()=>d(!1),e[16]=d,e[17]=k):k=e[17];let A;e[18]!==l||e[19]!==k?(A=t.jsx(Ve,{type:"button",variant:"outline",onClick:k,disabled:l,children:"Cancel"}),e[18]=l,e[19]=k,e[20]=A):A=e[20];let D;e[21]!==l?(D=l?t.jsxs(t.Fragment,{children:[t.jsx(Yt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=l,e[22]=D):D=e[22];let V;e[23]!==l||e[24]!==D?(V=t.jsx(Ve,{type:"submit",disabled:l,children:D}),e[23]=l,e[24]=D,e[25]=V):V=e[25];let I;e[26]!==A||e[27]!==V?(I=t.jsxs(Fn,{children:[A,V]}),e[26]=A,e[27]=V,e[28]=I):I=e[28];let F;e[29]!==f||e[30]!==I||e[31]!==S||e[32]!==P?(F=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:f,children:[S,P,I]})}),e[29]=f,e[30]=I,e[31]=S,e[32]=P,e[33]=F):F=e[33];let M;return e[34]!==u||e[35]!==s||e[36]!==F?(M=t.jsx(Kn,{open:s,onOpenChange:u,children:F}),e[34]=u,e[35]=s,e[36]=F,e[37]=M):M=e[37],M}function Bt(r,e,s,a,i){const c={...r[e]};if(i.length>1){const p=c.sections,d=[...p?.variants??[]];d[a]&&(d[a]={...d[a],value:s}),c.sections={...p,variants:d}}else c.sections=s;return c}function po(r){return structuredClone(r)}function ho(r){return!r.isSavedBlock&&!r.isMultivariate}function Cn(r){const e=r.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Tn(r,e){const s=r.trim();return s?s.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,s)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(s)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}const go="oklch(0.65 0.15 160)",vo="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",xo="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]",bo="text-[oklch(0.45_0.15_160)] focus:bg-[oklch(0.65_0.15_160/0.12)] focus:text-[oklch(0.45_0.15_160)] dark:text-[oklch(0.78_0.15_160)] dark:focus:bg-[oklch(0.65_0.15_160/0.15)] dark:focus:text-[oklch(0.78_0.15_160)]";function So(r){const e=Me.c(33),{variant:s,selected:a,canDelete:i,onSelect:c,onDuplicate:p,onDelete:d}=r;let l;e[0]!==c?(l=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),c())},e[0]=c,e[1]=l):l=e[1];const g=a?xo:vo;let v;e[2]!==g?(v=pe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",g),e[2]=g,e[3]=v):v=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(qt,{className:"h-4 w-4 shrink-0",style:{color:go}}),e[4]=b):b=e[4];let _;e[5]!==s.label?(_=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:s.label}),e[5]=s.label,e[6]=_):_=e[6];const w=`Open actions for ${s.label}`;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Wt,{size:14}),e[7]=u):u=e[7];let x;e[8]!==w?(x=t.jsx(Gt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":w,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:_o,onPointerDown:yo,children:u})}),e[8]=w,e[9]=x):x=e[9];let f;e[10]!==p?(f=V=>{V.stopPropagation(),p()},e[10]=p,e[11]=f):f=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Un,{size:14}),e[12]=N):N=e[12];let h;e[13]!==f?(h=t.jsxs(Ze,{onClick:f,children:[N,"Duplicate"]}),e[13]=f,e[14]=h):h=e[14];const S=!i;let C;e[15]!==d?(C=V=>{V.stopPropagation(),d()},e[15]=d,e[16]=C):C=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(jt,{size:14}),e[17]=j):j=e[17];let P;e[18]!==S||e[19]!==C?(P=t.jsxs(Ze,{variant:"destructive",disabled:S,onClick:C,children:[j,"Delete"]}),e[18]=S,e[19]=C,e[20]=P):P=e[20];let k;e[21]!==h||e[22]!==P?(k=t.jsxs(Jt,{align:"end",children:[h,P]}),e[21]=h,e[22]=P,e[23]=k):k=e[23];let A;e[24]!==k||e[25]!==x?(A=t.jsxs(Zt,{children:[x,k]}),e[24]=k,e[25]=x,e[26]=A):A=e[26];let D;return e[27]!==c||e[28]!==l||e[29]!==A||e[30]!==v||e[31]!==_?(D=t.jsxs("div",{role:"button",tabIndex:0,onClick:c,onKeyDown:l,className:v,children:[b,_,A]}),e[27]=c,e[28]=l,e[29]=A,e[30]=v,e[31]=_,e[32]=D):D=e[32],D}function yo(r){return r.stopPropagation()}function _o(r){return r.stopPropagation()}function jo(r){const e=Me.c(34),{variants:s,selectedIndex:a,onSelect:i,onDuplicate:c,onDelete:p,onRemoveAll:d,onAdd:l}=r,g=s.length>1;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=v):v=e[0];let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(bt,{size:14}),e[1]=b):b=e[1];let _;e[2]!==l?(_=t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:l,children:b})}),e[2]=l,e[3]=_):_=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(st,{children:"Add variant"}),e[4]=w):w=e[4];let u;e[5]!==_?(u=t.jsxs(at,{children:[_,w]}),e[5]=_,e[6]=u):u=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(jt,{size:14}),e[7]=x):x=e[7];let f;e[8]!==d?(f=t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:d,children:x})}),e[8]=d,e[9]=f):f=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(st,{children:"Remove all variants"}),e[10]=N):N=e[10];let h;e[11]!==f?(h=t.jsxs(at,{children:[f,N]}),e[11]=f,e[12]=h):h=e[12];let S;e[13]!==u||e[14]!==h?(S=t.jsxs("div",{className:"flex items-center justify-between",children:[v,t.jsxs("div",{className:"flex items-center gap-0.5",children:[u,h]})]}),e[13]=u,e[14]=h,e[15]=S):S=e[15];let C;if(e[16]!==g||e[17]!==p||e[18]!==c||e[19]!==i||e[20]!==a||e[21]!==s){let k;e[23]!==g||e[24]!==p||e[25]!==c||e[26]!==i||e[27]!==a?(k=A=>t.jsx(So,{variant:A,selected:A.index===a,canDelete:g,onSelect:()=>i(A.index),onDuplicate:()=>c(A.index),onDelete:()=>p(A.index)},`${A.label}-${A.index}`),e[23]=g,e[24]=p,e[25]=c,e[26]=i,e[27]=a,e[28]=k):k=e[28],C=s.map(k),e[16]=g,e[17]=p,e[18]=c,e[19]=i,e[20]=a,e[21]=s,e[22]=C}else C=e[22];let j;e[29]!==C?(j=t.jsx("div",{className:"space-y-0.5",children:C}),e[29]=C,e[30]=j):j=e[30];let P;return e[31]!==S||e[32]!==j?(P=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[S,j]}),e[31]=S,e[32]=j,e[33]=P):P=e[33],P}function ko(r){return r.schema?.definitions??r.schema?.$defs??{}}function wo(r,e){const s=ko(e),a=s[btoa(r)];if(!a)return;let i=typeof a.image=="string"?a.image:void 0;if(!i&&Array.isArray(a.allOf)){const c=a.allOf.find(p=>typeof p.$ref=="string")?.$ref;if(typeof c=="string"){const p=c.replace("#/definitions/",""),d=s[p];i=typeof d?.image=="string"?d.image:void 0}}if(i?.includes("{{{"))return i}function No(r,e){if(!e)return;const s=oa(r);if(!s)return;const a=wo(s.resolveType,e);if(!a)return;const i=qa(a,s.data);if(i)return Wa(i)}function gt(r,e){return r.map((s,a)=>{const i=s.__resolveType??"",c=vt(i);if(!c&&i!==""&&!i.includes("/")&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!1,isSavedBlock:!0}}const p=c?s.section:void 0,d=c?p?.__resolveType??"":i;if(d===ra||d===ia){const g=c?p:s,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===la){const w=v[0]?.value??{};let u=w.__resolveType??"";const x=vt(u);return x&&(u=w.section?.__resolveType??u),{index:a,resolveType:i,label:He(u)||`Section ${a+1}`,isHidden:!0,isLazy:x}}const b=v[0]?.value?.__resolveType,_=b?He(b):"Section";return{index:a,resolveType:i,label:`Variants of ${_}`,isMultivariate:!0,isLazy:c}}const l=c?s.section?.__resolveType??i:i;if(c&&l!==""&&!l.includes("/")&&l in e){const g=e[l],v=typeof g?.name=="string"&&g.name||l.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!0,isSavedBlock:!0}}return{index:a,resolveType:i,label:He(l)||`Section ${a+1}`,isLazy:c}})}const Co="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",To="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Rn(r){return Array.from({length:r},(e,s)=>({id:crypto.randomUUID(),index:s}))}function ns(r){return r.map((e,s)=>({...e,index:s}))}function Ro(r,e){if(e===r.length)return r;if(e<r.length)return ns(r.slice(0,e));const s=Array.from({length:e-r.length},(a,i)=>({id:crypto.randomUUID(),index:r.length+i}));return[...r,...s]}function ss(r){const e=Me.c(20),{section:s,raw:a,meta:i}=r,c=s.isSavedBlock===!0,p=s.isMultivariate===!0;let d;e[0]!==i||e[1]!==a?(d=a&&i?No(a,i):void 0,e[0]=i,e[1]=a,e[2]=d):d=e[2];const l=d;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Fa,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==l?(v=l&&t.jsx("img",{src:l,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=l,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==c?(b=c?{color:ua}:p?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=p,e[7]=c,e[8]=b):b=e[8];let _;e[9]!==b?(_=t.jsx(qt,{className:"h-4 w-4 shrink-0",style:b}),e[9]=b,e[10]=_):_=e[10];const w=s.isHidden&&"line-through opacity-50";let u;e[11]!==w?(u=pe("min-w-0 flex-1 truncate text-sm font-medium",w),e[11]=w,e[12]=u):u=e[12];let x;e[13]!==s.label||e[14]!==u?(x=t.jsx("span",{className:u,children:s.label}),e[13]=s.label,e[14]=u,e[15]=x):x=e[15];let f;return e[16]!==v||e[17]!==_||e[18]!==x?(f=t.jsxs(t.Fragment,{children:[g,v,_,x]}),e[16]=v,e[17]=_,e[18]=x,e[19]=f):f=e[19],f}function as(r,e){const s=r.isSavedBlock===!0,a=r.isMultivariate===!0;return pe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":s?Co:a?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ao(r){const e=Me.c(59),{section:s,raw:a,meta:i,sortableId:c,selected:p,onSelect:d,onDelete:l,onDuplicate:g,onMakeReusable:v,onToggleHidden:b,onToggleLazy:_,onAddVariant:w}=r,u=a?vt(a.__resolveType??""):!1;let x;e[0]!==s?(x=ca(s),e[0]=s,e[1]=x):x=e[1];const f=x;let N;e[2]!==c?(N={id:c,animateLayoutChanges:Eo},e[2]=c,e[3]=N):N=e[3];const{attributes:h,listeners:S,setNodeRef:C,transform:j,isDragging:P}=Gn(N);let k;e[4]!==j?(k=Jn.Transform.toString(j?{...j,x:0}:null),e[4]=j,e[5]=k):k=e[5];const A=P?0:void 0;let D;e[6]!==k||e[7]!==A?(D={transform:k,opacity:A},e[6]=k,e[7]=A,e[8]=D):D=e[8];const V=D;let I;e[9]!==s?(I=ho(s),e[9]=s,e[10]=I):I=e[10];const F=I,M="button",E=0;let J;e[11]!==d?(J=U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),d())},e[11]=d,e[12]=J):J=e[12];const se=P?"cursor-grabbing":"cursor-pointer";let $;e[13]!==s||e[14]!==p||e[15]!==se?($=pe("touch-none transition-colors",se,as(s,p)),e[13]=s,e[14]=p,e[15]=se,e[16]=$):$=e[16];let he;e[17]!==i||e[18]!==a||e[19]!==s?(he=t.jsx(ss,{section:s,raw:a,meta:i}),e[17]=i,e[18]=a,e[19]=s,e[20]=he):he=e[20];const K=!s.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":u?"Disable async render":"Enable async render",className:pe("h-7 w-7 shrink-0",u?"":"opacity-0 group-hover:opacity-100"),onClick:U=>{U.stopPropagation(),_()},onPointerDown:Mo,children:t.jsx(Ka,{className:pe("h-3.5 w-3.5",u&&"text-yellow-500")})});let X;e[21]!==b||e[22]!==s.isHidden||e[23]!==s.isMultivariate?(X=!s.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":s.isHidden?"Show section":"Hide section",className:pe("h-7 w-7 shrink-0",s.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:U=>{U.stopPropagation(),b()},onPointerDown:Vo,children:s.isHidden?t.jsx(Ba,{className:"h-3.5 w-3.5"}):t.jsx(za,{className:"h-3.5 w-3.5"})}),e[21]=b,e[22]=s.isHidden,e[23]=s.isMultivariate,e[24]=X):X=e[24];let re;e[25]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx(Gt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Po,onPointerDown:Do,children:t.jsx(Wt,{className:"h-3.5 w-3.5"})})}),e[25]=re):re=e[25];let ue;e[26]!==g?(ue=U=>{U.stopPropagation(),g()},e[26]=g,e[27]=ue):ue=e[27];let Z;e[28]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Un,{className:"h-4 w-4"}),e[28]=Z):Z=e[28];let Q;e[29]!==ue?(Q=t.jsxs(Ze,{onClick:ue,children:[Z,"Duplicate"]}),e[29]=ue,e[30]=Q):Q=e[30];let W;e[31]!==f||e[32]!==w?(W=f&&t.jsxs(Ze,{className:bo,onClick:U=>{U.stopPropagation(),w()},children:[t.jsx(On,{className:"h-4 w-4"}),"Add variant"]}),e[31]=f,e[32]=w,e[33]=W):W=e[33];let Y;e[34]!==F||e[35]!==v?(Y=F&&t.jsxs(Ze,{className:To,onClick:U=>{U.stopPropagation(),v()},children:[t.jsx(qt,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=F,e[35]=v,e[36]=Y):Y=e[36];let G;e[37]!==l?(G=U=>{U.stopPropagation(),l()},e[37]=l,e[38]=G):G=e[38];let ae;e[39]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(jt,{className:"h-4 w-4"}),e[39]=ae):ae=e[39];let ie;e[40]!==G?(ie=t.jsxs(Ze,{className:"text-destructive focus:text-destructive",onClick:G,children:[ae,"Delete"]}),e[40]=G,e[41]=ie):ie=e[41];let H;e[42]!==Q||e[43]!==W||e[44]!==Y||e[45]!==ie?(H=t.jsxs(Zt,{children:[re,t.jsxs(Jt,{align:"end",className:"w-44",children:[Q,W,Y,ie]})]}),e[42]=Q,e[43]=W,e[44]=Y,e[45]=ie,e[46]=H):H=e[46];let le;return e[47]!==h||e[48]!==S||e[49]!==d||e[50]!==C||e[51]!==V||e[52]!==$||e[53]!==he||e[54]!==K||e[55]!==X||e[56]!==H||e[57]!==J?(le=t.jsxs("div",{ref:C,style:V,...h,...S,role:M,tabIndex:E,onClick:d,onKeyDown:J,className:$,children:[he,K,X,H]}),e[47]=h,e[48]=S,e[49]=d,e[50]=C,e[51]=V,e[52]=$,e[53]=he,e[54]=K,e[55]=X,e[56]=H,e[57]=J,e[58]=le):le=e[58],le}function Do(r){return r.stopPropagation()}function Po(r){return r.stopPropagation()}function Vo(r){return r.stopPropagation()}function Mo(r){return r.stopPropagation()}function Eo(){return!1}function $o(r){const e=Me.c(89),{listKey:s,rawSections:a,sections:i,meta:c,selectedIndex:p,onSelect:d,onReorder:l,onDelete:g,onDuplicate:v,onMakeReusable:b,onToggleHidden:_,onToggleLazy:w,onAddVariant:u,onAddSection:x,canAddSection:f}=r,N=f===void 0?!0:f;let h;e[0]!==i.length?(h=()=>Rn(i.length),e[0]=i.length,e[1]=h):h=e[1];const[S,C]=R.useState(h),[j,P]=R.useState(null),[k,A]=R.useState(s),[D,V]=R.useState(i.length),I=R.useRef(!1);k!==s?(A(s),V(i.length),C(Rn(i.length))):D!==i.length&&(V(i.length),C(q=>Ro(q,i.length)));let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[2]=F):F=e[2];let M;e[3]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:Zn},e[3]=M):M=e[3];const E=Yn(St(Wn,F),St(qn,M));let J;e[4]!==S?(J=S.map(Oo),e[4]=S,e[5]=J):J=e[5];const se=J;let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($=q=>{P(String(q.active.id))},e[6]=$):$=e[6];const he=$;let K;e[7]!==se||e[8]!==l?(K=q=>{P(null);const{active:O,over:de}=q;if(!de||O.id===de.id)return;const Ie=se.indexOf(String(O.id)),Be=se.indexOf(String(de.id));Ie===-1||Be===-1||(C(Ue=>ns(yt([...Ue],Ie,Be))),I.current=!0,requestAnimationFrame(()=>{I.current=!1}),l?.(Ie,Be))},e[7]=se,e[8]=l,e[9]=K):K=e[9];const X=K;let re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{P(null)},e[10]=re):re=e[10];const ue=re;let Z,Q,W,Y,G,ae,ie,H,le,U,Ce,Ee,ge,Te,we;if(e[11]!==j||e[12]!==N||e[13]!==S||e[14]!==se||e[15]!==X||e[16]!==c||e[17]!==x||e[18]!==u||e[19]!==g||e[20]!==v||e[21]!==b||e[22]!==d||e[23]!==_||e[24]!==w||e[25]!==a||e[26]!==i||e[27]!==p||e[28]!==E){Te=Symbol.for("react.early_return_sentinel");e:{const q=O=>{I.current||d(O)};if(e[44]!==j||e[45]!==N||e[46]!==S||e[47]!==x||e[48]!==a||e[49]!==i){const O=j?S.find(de=>de.id===j):null;if(Y=O!=null?i[O.index]:null,W=O!=null?a[O.index]:void 0,S.length===0){let de;e[53]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[53]=de):de=e[53];const Ie=!N;let Be;e[54]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx(bt,{size:14}),e[54]=Be):Be=e[54];let Ue;e[55]!==x||e[56]!==Ie?(Ue=t.jsxs("div",{className:"space-y-2",children:[de,t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:x,children:[Be,"Add section"]})]}),e[55]=x,e[56]=Ie,e[57]=Ue):Ue=e[57],Te=Ue;break e}ge=pe(O&&"cursor-grabbing"),e[44]=j,e[45]=N,e[46]=S,e[47]=x,e[48]=a,e[49]=i,e[50]=W,e[51]=Y,e[52]=ge}else W=e[50],Y=e[51],ge=e[52];Q=Qn,H=E,le=Xn,U=he,Ce=X,Ee=ue,Z=es,ae=se,ie=Ua,we="space-y-1",G=S.map(O=>{const de=i[O.index];return de?t.jsx(Ao,{sortableId:O.id,section:de,raw:a[O.index],meta:c,selected:p===O.index,onSelect:()=>q(O.index),onDelete:()=>g(O.index),onDuplicate:()=>v(O.index),onMakeReusable:()=>b(O.index),onToggleHidden:()=>_(O.index),onToggleLazy:()=>w(O.index),onAddVariant:()=>u(O.index)},O.id):null})}e[11]=j,e[12]=N,e[13]=S,e[14]=se,e[15]=X,e[16]=c,e[17]=x,e[18]=u,e[19]=g,e[20]=v,e[21]=b,e[22]=d,e[23]=_,e[24]=w,e[25]=a,e[26]=i,e[27]=p,e[28]=E,e[29]=Z,e[30]=Q,e[31]=W,e[32]=Y,e[33]=G,e[34]=ae,e[35]=ie,e[36]=H,e[37]=le,e[38]=U,e[39]=Ce,e[40]=Ee,e[41]=ge,e[42]=Te,e[43]=we}else Z=e[29],Q=e[30],W=e[31],Y=e[32],G=e[33],ae=e[34],ie=e[35],H=e[36],le=e[37],U=e[38],Ce=e[39],Ee=e[40],ge=e[41],Te=e[42],we=e[43];if(Te!==Symbol.for("react.early_return_sentinel"))return Te;let Re;e[58]!==G||e[59]!==we?(Re=t.jsx("div",{className:we,children:G}),e[58]=G,e[59]=we,e[60]=Re):Re=e[60];let ve;e[61]!==Z||e[62]!==ae||e[63]!==ie||e[64]!==Re?(ve=t.jsx(Z,{items:ae,strategy:ie,children:Re}),e[61]=Z,e[62]=ae,e[63]=ie,e[64]=Re,e[65]=ve):ve=e[65];let Le;e[66]!==W||e[67]!==Y||e[68]!==c?(Le=Y?t.jsx("div",{className:pe("cursor-grabbing shadow-lg ring-1 ring-border/60",as(Y,!1)),children:t.jsx(ss,{section:Y,raw:W,meta:c})}):null,e[66]=W,e[67]=Y,e[68]=c,e[69]=Le):Le=e[69];let Ne;e[70]!==Le?(Ne=t.jsx(ts,{dropAnimation:null,children:Le}),e[70]=Le,e[71]=Ne):Ne=e[71];let xe;e[72]!==Q||e[73]!==H||e[74]!==le||e[75]!==U||e[76]!==Ce||e[77]!==Ee||e[78]!==ve||e[79]!==Ne?(xe=t.jsxs(Q,{sensors:H,collisionDetection:le,onDragStart:U,onDragEnd:Ce,onDragCancel:Ee,children:[ve,Ne]}),e[72]=Q,e[73]=H,e[74]=le,e[75]=U,e[76]=Ce,e[77]=Ee,e[78]=ve,e[79]=Ne,e[80]=xe):xe=e[80];const be=!N;let Oe;e[81]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(bt,{size:14}),e[81]=Oe):Oe=e[81];let oe;e[82]!==x||e[83]!==be?(oe=t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:be,onClick:x,children:[Oe,"Add section"]}),e[82]=x,e[83]=be,e[84]=oe):oe=e[84];let ke;return e[85]!==ge||e[86]!==xe||e[87]!==oe?(ke=t.jsxs("div",{className:ge,children:[xe,oe]}),e[85]=ge,e[86]=xe,e[87]=oe,e[88]=ke):ke=e[88],ke}function Oo(r){return r.id}const Lo=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Io={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Kt(r){return _t(r)!==void 0}function Qt(r,e){if(e){if(Kt(e))return e;const s=Io[e];if(s&&Kt(s))return s}for(const[s,a]of Lo)if(s.test(r)&&Kt(a))return a;return"FilterLines"}function zo(r){return _t(r)??lo}function An(r){const e=Me.c(11),{iconName:s,size:a,className:i}=r,c=a===void 0?"md":a;let p;e[0]!==s?(p=zo(s),e[0]=s,e[1]=p):p=e[1];const d=p,l=c==="sm"?"size-7":"size-9",g=c==="sm"?16:18;let v;e[2]!==l||e[3]!==i?(v=pe("flex shrink-0 items-center justify-center rounded-full bg-muted",l,i),e[2]=l,e[3]=i,e[4]=v):v=e[4];let b;e[5]!==d||e[6]!==g?(b=t.jsx(d,{size:g,className:"text-muted-foreground"}),e[5]=d,e[6]=g,e[7]=b):b=e[7];let _;return e[8]!==v||e[9]!==b?(_=t.jsx("div",{className:v,children:b}),e[8]=v,e[9]=b,e[10]=_):_=e[10],_}const os="Users03";function Fo(r){const e=r.manifest?.blocks??{},s=[];for(const[a,i]of Object.entries(e))if(a.includes("matchers"))for(const c of Object.keys(i)){if(c.includes("always"))continue;const p=da(c,r);s.push({resolveType:c,title:p.title??He(c),description:p.description,iconName:Qt(c,p.icon)})}return s}function Bo(r,e){if(!r)return os;const s=e.find(a=>a.resolveType===r);return s?s.iconName:Qt(r)}function Dn(r){const e=Me.c(41),{currentRt:s,currentLabel:a,matchers:i,onSelect:c}=r,[p,d]=R.useState(!1);let l;if(e[0]!==s||e[1]!==i){const M=Bo(s,i);l=_t(M),e[0]=s,e[1]=i,e[2]=l}else l=e[2];const g=l;let v;e[3]!==c?(v=M=>{c(M),d(!1)},e[3]=c,e[4]=v):v=e[4];const b=v;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>d(!0),e[5]=_):_=e[5];let w;e[6]!==g?(w=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=w):w=e[7];let u;e[8]!==a?(u=t.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=u):u=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx($n,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=x):x=e[10];let f;e[11]!==w||e[12]!==u?(f=t.jsxs("button",{type:"button",onClick:_,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[w,u,x]}),e[11]=w,e[12]=u,e[13]=f):f=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(so,{placeholder:"Search rules..."}),e[14]=N):N=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ao,{children:"No rules found."}),e[15]=h):h=e[15];let S;e[16]!==b?(S=()=>b(""),e[16]=b,e[17]=S):S=e[17];const C=!s&&"bg-accent/60";let j;e[18]!==C?(j=pe("gap-2.5",C),e[18]=C,e[19]=j):j=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(An,{iconName:os,size:"sm"}),e[20]=P):P=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=k):k=e[21];let A;e[22]!==S||e[23]!==j?(A=t.jsxs(Nn,{value:"always Target all users",onSelect:S,className:j,children:[P,k]}),e[22]=S,e[23]=j,e[24]=A):A=e[24];let D;if(e[25]!==s||e[26]!==b||e[27]!==i){let M;e[29]!==s||e[30]!==b?(M=E=>t.jsxs(Nn,{value:`${E.title} ${E.resolveType} ${E.description??""}`,onSelect:()=>b(E.resolveType),className:pe("gap-2.5",s===E.resolveType&&"bg-accent/60"),children:[t.jsx(An,{iconName:E.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:E.title}),E.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:E.description})]})]},E.resolveType),e[29]=s,e[30]=b,e[31]=M):M=e[31],D=i.map(M),e[25]=s,e[26]=b,e[27]=i,e[28]=D}else D=e[28];let V;e[32]!==A||e[33]!==D?(V=t.jsxs(oo,{children:[h,t.jsxs(ro,{children:[A,D]})]}),e[32]=A,e[33]=D,e[34]=V):V=e[34];let I;e[35]!==p||e[36]!==V?(I=t.jsxs(io,{open:p,onOpenChange:d,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[N,V]}),e[35]=p,e[36]=V,e[37]=I):I=e[37];let F;return e[38]!==I||e[39]!==f?(F=t.jsxs(t.Fragment,{children:[f,I]}),e[38]=I,e[39]=f,e[40]=F):F=e[40],F}const Ko="oklch(0.65 0.15 160)",rs="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Xt(r){const e=Me.c(5),{rule:s,matchers:a}=r,i=s?.__resolveType??"";let c;if(e[0]!==a||e[1]!==i){const g=a.find(v=>v.resolveType===i)?.iconName??Qt(i);c=_t(g),e[0]=a,e[1]=i,e[2]=c}else c=e[2];const p=c;if(!p)return null;let d;return e[3]!==p?(d=t.jsx(p,{size:14,className:"shrink-0"}),e[3]=p,e[4]=d):d=e[4],d}function Pn(r){return r.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function Ht(r){return r.map((e,s)=>({id:crypto.randomUUID(),index:s,variant:e}))}function Ho(r){return r.map((e,s)=>({...e,index:s}))}function Uo(r){const e=Me.c(51),{entry:s,sortableId:a,isActive:i,canDelete:c,decofile:p,meta:d,matchers:l,onSelect:g,onRename:v,onDelete:b}=r;let _;e[0]!==a?(_={id:a,animateLayoutChanges:Wo},e[0]=a,e[1]=_):_=e[1];const{attributes:w,listeners:u,setNodeRef:x,transform:f,isDragging:N}=Gn(_);let h;e[2]!==f?(h=Jn.Transform.toString(f?{...f,y:0}:null),e[2]=f,e[3]=h):h=e[3];const S=N?0:void 0;let C;e[4]!==h||e[5]!==S?(C={transform:h,opacity:S},e[4]=h,e[5]=S,e[6]=C):C=e[6];const j=C,P=d??void 0;let k;e[7]!==p||e[8]!==s.variant.rule||e[9]!==P?(k=xt(s.variant.rule,p,P),e[7]=p,e[8]=s.variant.rule,e[9]=P,e[10]=k):k=e[10];const A=k,D=i?rs:"text-muted-foreground hover:bg-muted hover:text-foreground",V=N?"cursor-grabbing":"cursor-grab";let I;e[11]!==D||e[12]!==V?(I=pe("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",D,V),e[11]=D,e[12]=V,e[13]=I):I=e[13];let F;e[14]!==A||e[15]!==l?(F=t.jsx(Xt,{rule:A,matchers:l}),e[14]=A,e[15]=l,e[16]=F):F=e[16];let M;e[17]!==s.variant.label?(M=t.jsx("span",{className:"truncate",children:s.variant.label}),e[17]=s.variant.label,e[18]=M):M=e[18];let E;e[19]!==w||e[20]!==u||e[21]!==g||e[22]!==F||e[23]!==M?(E=t.jsxs("button",{type:"button",...w,...u,onClick:g,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[F,M]}),e[19]=w,e[20]=u,e[21]=g,e[22]=F,e[23]=M,e[24]=E):E=e[24];const J=`Actions for ${s.variant.label}`,se=i&&"opacity-100";let $;e[25]!==se?($=pe("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",se),e[25]=se,e[26]=$):$=e[26];let he;e[27]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Wt,{size:12}),e[27]=he):he=e[27];let K;e[28]!==J||e[29]!==$?(K=t.jsx(Gt,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":J,onClick:qo,onPointerDown:Yo,className:$,children:he})}),e[28]=J,e[29]=$,e[30]=K):K=e[30];let X;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(co,{size:14}),e[31]=X):X=e[31];let re;e[32]!==v?(re=t.jsxs(Ze,{onClick:v,children:[X,"Rename"]}),e[32]=v,e[33]=re):re=e[33];let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Ha,{}),e[34]=ue):ue=e[34];const Z=!c;let Q;e[35]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(jt,{size:14}),e[35]=Q):Q=e[35];let W;e[36]!==b||e[37]!==Z?(W=t.jsxs(Ze,{variant:"destructive",disabled:Z,onClick:b,children:[Q,"Delete"]}),e[36]=b,e[37]=Z,e[38]=W):W=e[38];let Y;e[39]!==re||e[40]!==W?(Y=t.jsxs(Jt,{align:"start",className:"w-36",children:[re,ue,W]}),e[39]=re,e[40]=W,e[41]=Y):Y=e[41];let G;e[42]!==K||e[43]!==Y?(G=t.jsxs(Zt,{children:[K,Y]}),e[42]=K,e[43]=Y,e[44]=G):G=e[44];let ae;return e[45]!==x||e[46]!==j||e[47]!==E||e[48]!==G||e[49]!==I?(ae=t.jsxs("div",{ref:x,style:j,className:I,children:[E,G]}),e[45]=x,e[46]=j,e[47]=E,e[48]=G,e[49]=I,e[50]=ae):ae=e[50],ae}function Yo(r){return r.stopPropagation()}function qo(r){return r.stopPropagation()}function Wo(){return!1}function Go(r){const e=Me.c(13),{variant:s,decofile:a,meta:i,matchers:c}=r,p=i??void 0;let d;e[0]!==a||e[1]!==p||e[2]!==s.rule?(d=xt(s.rule,a,p),e[0]=a,e[1]=p,e[2]=s.rule,e[3]=d):d=e[3];const l=d;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=pe("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",rs),e[4]=g):g=e[4];let v;e[5]!==l||e[6]!==c?(v=t.jsx(Xt,{rule:l,matchers:c}),e[5]=l,e[6]=c,e[7]=v):v=e[7];let b;e[8]!==s.label?(b=t.jsx("span",{className:"truncate",children:s.label}),e[8]=s.label,e[9]=b):b=e[9];let _;return e[10]!==v||e[11]!==b?(_=t.jsxs("div",{className:g,children:[v,b]}),e[10]=v,e[11]=b,e[12]=_):_=e[12],_}function Jo(r){const e=Me.c(77),{listKey:s,variants:a,activeIndex:i,decofile:c,meta:p,matchers:d,onSelect:l,onReorder:g,onRename:v,onDelete:b,onAdd:_}=r;let w;e[0]!==a?(w=()=>Ht(a),e[0]=a,e[1]=w):w=e[1];const[u,x]=R.useState(w),[f,N]=R.useState(null),[h,S]=R.useState(s),[C,j]=R.useState(a.length);let P;e[2]!==a?(P=()=>Pn(a),e[2]=a,e[3]=P):P=e[3];const[k,A]=R.useState(P),D=R.useRef(!1),V=Pn(a);h!==s?(S(s),j(a.length),A(V),x(Ht(a))):C!==a.length?(j(a.length),A(V),x(Ht(a))):k!==V&&(A(V),x(ke=>a.map((q,O)=>({id:ke[O]?.id??crypto.randomUUID(),index:O,variant:q}))));let I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:8}},e[4]=I):I=e[4];let F;e[5]===Symbol.for("react.memo_cache_sentinel")?(F={coordinateGetter:Zn},e[5]=F):F=e[5];const M=Yn(St(Wn,I),St(qn,F));let E;e[6]!==u?(E=u.map(Zo),e[6]=u,e[7]=E):E=e[7];const J=E,se=a.length>1;let $;e[8]!==u?($=ke=>{const q=String(ke.active.id);N(u.find(O=>O.id===q)??null)},e[8]=u,e[9]=$):$=e[9];const he=$;let K;e[10]!==J||e[11]!==g?(K=ke=>{N(null);const{active:q,over:O}=ke;if(!O||q.id===O.id)return;const de=J.indexOf(String(q.id)),Ie=J.indexOf(String(O.id));de===-1||Ie===-1||(x(Be=>Ho(yt([...Be],de,Ie))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(de,Ie))},e[10]=J,e[11]=g,e[12]=K):K=e[12];const X=K;let re;e[13]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{N(null)},e[13]=re):re=e[13];const ue=re;let Z,Q,W,Y,G,ae,ie,H,le,U,Ce,Ee;if(e[14]!==f||e[15]!==i||e[16]!==se||e[17]!==c||e[18]!==u||e[19]!==J||e[20]!==X||e[21]!==he||e[22]!==d||e[23]!==p||e[24]!==b||e[25]!==v||e[26]!==l||e[27]!==M){const ke=O=>{D.current||l(O)};Ce="flex items-center border-b shrink-0";const q=f&&"cursor-grabbing";e[40]!==q?(U=pe("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",q),e[40]=q,e[41]=U):U=e[41],Q=Qn,G=M,ae=Xn,ie=he,H=X,le=ue,Z=es,Ee=J,W=Ya,Y=u.map(O=>t.jsx(Uo,{sortableId:O.id,entry:O,isActive:O.index===i,canDelete:se,decofile:c,meta:p,matchers:d,onSelect:()=>ke(O.index),onRename:()=>v(O.index),onDelete:()=>b(O.index)},O.id)),e[14]=f,e[15]=i,e[16]=se,e[17]=c,e[18]=u,e[19]=J,e[20]=X,e[21]=he,e[22]=d,e[23]=p,e[24]=b,e[25]=v,e[26]=l,e[27]=M,e[28]=Z,e[29]=Q,e[30]=W,e[31]=Y,e[32]=G,e[33]=ae,e[34]=ie,e[35]=H,e[36]=le,e[37]=U,e[38]=Ce,e[39]=Ee}else Z=e[28],Q=e[29],W=e[30],Y=e[31],G=e[32],ae=e[33],ie=e[34],H=e[35],le=e[36],U=e[37],Ce=e[38],Ee=e[39];let ge;e[42]!==Z||e[43]!==W||e[44]!==Y||e[45]!==Ee?(ge=t.jsx(Z,{items:Ee,strategy:W,children:Y}),e[42]=Z,e[43]=W,e[44]=Y,e[45]=Ee,e[46]=ge):ge=e[46];let Te;e[47]!==f||e[48]!==c||e[49]!==d||e[50]!==p?(Te=f?t.jsx(Go,{variant:f.variant,decofile:c,meta:p,matchers:d}):null,e[47]=f,e[48]=c,e[49]=d,e[50]=p,e[51]=Te):Te=e[51];let we;e[52]!==Te?(we=t.jsx(ts,{dropAnimation:null,children:Te}),e[52]=Te,e[53]=we):we=e[53];let Re;e[54]!==Q||e[55]!==G||e[56]!==ae||e[57]!==ie||e[58]!==H||e[59]!==le||e[60]!==ge||e[61]!==we?(Re=t.jsxs(Q,{sensors:G,collisionDetection:ae,onDragStart:ie,onDragEnd:H,onDragCancel:le,children:[ge,we]}),e[54]=Q,e[55]=G,e[56]=ae,e[57]=ie,e[58]=H,e[59]=le,e[60]=ge,e[61]=we,e[62]=Re):Re=e[62];let ve;e[63]!==U||e[64]!==Re?(ve=t.jsx("div",{className:U,children:Re}),e[63]=U,e[64]=Re,e[65]=ve):ve=e[65];let Le;e[66]===Symbol.for("react.memo_cache_sentinel")?(Le={color:Ko},e[66]=Le):Le=e[66];let Ne;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx(bt,{size:14}),e[67]=Ne):Ne=e[67];let xe;e[68]!==_?(xe=t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:Le,onClick:_,children:Ne})}),e[68]=_,e[69]=xe):xe=e[69];let be;e[70]===Symbol.for("react.memo_cache_sentinel")?(be=t.jsx(st,{side:"bottom",children:"Add variant"}),e[70]=be):be=e[70];let Oe;e[71]!==xe?(Oe=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(at,{children:[xe,be]})}),e[71]=xe,e[72]=Oe):Oe=e[72];let oe;return e[73]!==Ce||e[74]!==ve||e[75]!==Oe?(oe=t.jsxs("div",{className:Ce,children:[ve,Oe]}),e[73]=Ce,e[74]=ve,e[75]=Oe,e[76]=oe):oe=e[76],oe}function Zo(r){return r.id}function Qo(r){const e=Me.c(37),{open:s,onOpenChange:a,defaultBlockId:i,isPending:c,onSubmit:p}=r,d=i===void 0?"":i,l=c===void 0?!1:c,[g,v]=R.useState(d),[b,_]=R.useState(s);s!==b&&(_(s),s&&v(d));let w;e[0]!==l||e[1]!==a?(w=M=>{!M&&!l&&a(!1)},e[0]=l,e[1]=a,e[2]=w):w=e[2];const u=w;let x;e[3]!==g||e[4]!==l||e[5]!==p?(x=async M=>{M.preventDefault();const E=g.trim();!E||l||await p(E)},e[3]=g,e[4]=l,e[5]=p,e[6]=x):x=e[6];const f=x;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs(In,{children:[t.jsx(Ln,{children:"Save as global"}),t.jsx(zn,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=N):N=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=h):h=e[8];let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=M=>v(M.target.value),e[9]=S):S=e[9];let C;e[10]!==g||e[11]!==l?(C=t.jsxs("div",{className:"py-4 space-y-2",children:[h,t.jsx(Hn,{id:"block-id",value:g,onChange:S,placeholder:"MyNewBlock",autoFocus:!0,disabled:l})]}),e[10]=g,e[11]=l,e[12]=C):C=e[12];let j;e[13]!==a?(j=()=>a(!1),e[13]=a,e[14]=j):j=e[14];let P;e[15]!==l||e[16]!==j?(P=t.jsx(Ve,{type:"button",variant:"outline",onClick:j,disabled:l,children:"Cancel"}),e[15]=l,e[16]=j,e[17]=P):P=e[17];let k;e[18]!==g||e[19]!==l?(k=!g.trim()||l,e[18]=g,e[19]=l,e[20]=k):k=e[20];let A;e[21]!==l?(A=l?t.jsxs(t.Fragment,{children:[t.jsx(Yt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=l,e[22]=A):A=e[22];let D;e[23]!==k||e[24]!==A?(D=t.jsx(Ve,{type:"submit",disabled:k,children:A}),e[23]=k,e[24]=A,e[25]=D):D=e[25];let V;e[26]!==P||e[27]!==D?(V=t.jsxs(Fn,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=V):V=e[28];let I;e[29]!==f||e[30]!==V||e[31]!==C?(I=t.jsx(Bn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:f,children:[N,C,V]})}),e[29]=f,e[30]=V,e[31]=C,e[32]=I):I=e[32];let F;return e[33]!==u||e[34]!==s||e[35]!==I?(F=t.jsx(Kn,{open:s,onOpenChange:u,children:I}),e[33]=u,e[34]=s,e[35]=I,e[36]=F):F=e[36],F}function Vn(r){const e=Me.c(20),{activeSchema:s,formValue:a,formResetKey:i,onFormChange:c,onBreadcrumbChange:p,breadcrumbPath:d,emptyMessage:l,beforeForm:g,seoResolveType:v,siteDefaultSeo:b,meta:_,decofile:w,onSaveReferencedBlock:u}=r;let x;e[0]!==d?(x=d===void 0?[]:d,e[0]=d,e[1]=x):x=e[1];const f=x;let N;e[2]!==s||e[3]!==f||e[4]!==w||e[5]!==i||e[6]!==a||e[7]!==_||e[8]!==p||e[9]!==c||e[10]!==u||e[11]!==v||e[12]!==b?(N=s&&a?v?t.jsx(no,{schema:s,resolveType:v,value:a,formResetKey:i,onChange:c,onBreadcrumbChange:p,siteDefaultSeo:b}):t.jsx(Ut,{schema:s,value:a,onChange:c,basePath:"",breadcrumbPath:f,onBreadcrumbChange:p,meta:_,decofile:w,onSaveReferencedBlock:u},i):null,e[2]=s,e[3]=f,e[4]=w,e[5]=i,e[6]=a,e[7]=_,e[8]=p,e[9]=c,e[10]=u,e[11]=v,e[12]=b,e[13]=N):N=e[13];const h=N;let S;e[14]!==l||e[15]!==h?(S=h??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[14]=l,e[15]=h,e[16]=S):S=e[16];let C;return e[17]!==g||e[18]!==S?(C=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,S]})}),e[17]=g,e[18]=S,e[19]=C):C=e[19],C}const Xo="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]",er=r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();function Mn(r){const{start:e,end:s}=r,a=typeof e=="string"?e:"",i=typeof s=="string"?s:"";if(!a&&!i)return null;const c=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}),p=g=>{if(!g)return null;const v=new Date(g);return Number.isNaN(v.getTime())?null:c.format(v)},d=p(a),l=p(i);return d&&l?`${d} → ${l}`:d?`From ${d}`:l?`Until ${l}`:null}function Je(r){if(!r)return"Default";const e=r.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(e)||e==="")return"Default";switch(e){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:a,tablet:i,desktop:c,devices:p=[]}=r,d=[...p];return a&&d.push("Mobile"),i&&d.push("Tablet"),c&&d.push("Desktop"),d.length>0?d.map(er).join(" & "):He(e)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return Mn(r)??He(e);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:a}=r;return typeof a=="number"?`${Math.ceil(a*100)}% of sessions`:He(e)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:a,match:i}=r,c=[];return a&&c.push(a),i&&c.push(i),c.length>0?c.join(" - "):He(e)}case"website/matchers/pathname.ts":{const a=r.case,{type:i,pathname:c}=a??{};return i&&c?`Pathname ${i} ${c}`:He(e)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:a,excludeLocations:i}=r,c=l=>[l.city,l.regionCode,l.country].filter(Boolean).join(" - "),p=a?.[0];if(p){const l=(a?.length??0)-1;return`${c(p)}${l>0?` +${l}`:""}`}const d=i?.[0];if(d){const l=(i?.length??0)-1;return`Except ${c(d)}${l>0?` +${l}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:a,op:i="AND"}=r;return a&&a.length>0?a.map(Je).join(` ${i} `):He(e)}default:{const a=Mn(r);return a||He(e)||"Default"}}}function tr(r,e){return ya(r,e,Je)}function nr(r){const e=Me.c(13),{pageKey:s,initialName:a,initialPath:i,onFieldChange:c}=r,[p,d]=R.useState(a),[l,g]=R.useState(i),[v,b]=R.useState(s);v!==s&&(b(s),d(a),g(i));let _;e[0]!==c?(_=N=>{d(N.target.value),c("name",N.target.value)},e[0]=c,e[1]=_):_=e[1];let w;e[2]!==p||e[3]!==_?(w=t.jsx("input",{type:"text",value:p,onChange:_,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=p,e[3]=_,e[4]=w):w=e[4];let u;e[5]!==c?(u=N=>{g(N.target.value),c("path",N.target.value)},e[5]=c,e[6]=u):u=e[6];let x;e[7]!==l||e[8]!==u?(x=t.jsx("input",{type:"text",value:l,onChange:u,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=l,e[8]=u,e[9]=x):x=e[9];let f;return e[10]!==w||e[11]!==x?(f=t.jsxs("div",{className:"space-y-1",children:[w,x]}),e[10]=w,e[11]=x,e[12]=f):f=e[12],f}function En(r){const e=Me.c(6),{onClick:s}=r;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(On,{size:14}),e[0]=a):a=e[0];let i;e[1]!==s?(i=t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:s,children:a})}),e[1]=s,e[2]=i):i=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(st,{side:"bottom",children:"Add variant"}),e[3]=c):c=e[3];let p;return e[4]!==i?(p=t.jsxs(at,{children:[i,c]}),e[4]=i,e[5]=p):p=e[5],p}function Gl({orgSlug:r,virtualMcpId:e,branch:s,previewReady:a=!0,previewUrl:i,currentPath:c,activePageBlockKey:p=null,activeGlobalBlockKey:d=null,externalSelectedIndex:l,onSaved:g,initialEditSeo:v=!1,onExitSeo:b,onViewJsonFile:_}){const w=a?{orgSlug:r,virtualMcpId:e,branch:s}:null,{data:u,isLoading:x}=ma(w),{data:f,isLoading:N}=fa(w),[h,S]=R.useState(null),[C,j]=R.useState(null),[P,k]=R.useState(null),[A,D]=R.useState(0),[V,I]=R.useState(void 0),[F,M]=R.useState(null),[E,J]=R.useState(null),[se,$]=R.useState([]),[he,K]=R.useState(0),[X,re]=R.useState(null),[ue,Z]=R.useState(null),[Q,W]=R.useState(!0),[Y,G]=R.useState(!1),[ae,ie]=R.useState(!1),[H,le]=R.useState(v),[U,Ce]=R.useState(v);v&&!U&&(Ce(!0),le(!0),S(null),j(null),k(null),$([])),!v&&U&&Ce(!1);const[Ee,ge]=R.useState(null),[Te,we]=R.useState(void 0),[Re,ve]=R.useState([]),[Le,Ne]=R.useState(0),[xe,be]=R.useState(0),[Oe,oe]=R.useState(null),[ke,q]=R.useState(null),[O,de]=R.useState(null),Ie=Qs(),Be=`${r}/${e}/${s}`,Ue=pa({orgSlug:r,virtualMcpId:e,branch:s}),[is,ls]=R.useState(c),[cs,us]=R.useState(p),[ds,ms]=R.useState(d);(is!==c||cs!==p||ds!==d)&&(queueMicrotask(()=>Ue.flush()),ls(c),us(p),ms(d),S(null),j(null),k(null),D(0),M(null),J(null),be(0),oe(null),q(null),$([]),K(n=>n+1),le(!1),ge(null),we(void 0),ve([]),Ne(n=>n+1));const Ae=ha({orgSlug:r,virtualMcpId:e,branch:s}),en=mo((n,o)=>{Ae.mutate({blockKey:n,data:o},{onSuccess:()=>g?.(),onError:m=>ce.error(`Save failed: ${m.message}`)})}),tn=ga({orgSlug:r,virtualMcpId:e,branch:s}),[kt,nn]=R.useState(!1),wt=R.useRef(null),ot=R.useRef(null),rt=R.useRef(null),Nt=R.useRef({}),qe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!a||x||N)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(Yt,{size:20,className:"animate-spin text-muted-foreground"})});if(!u||!f)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const fs=va(u),Se=!!d,ze=Se?null:xa(fs,c,p),L=Se?d:ze?.key??null,Ct=Se&&d?u[d]:void 0,sn=Se&&d&&Ct?ba(d,Ct):Se&&d?d:"",Tt=!Se&&L&&u[L]?u[L]:null,Rt=H&&u&&f&&L&&ze?wn(u,{kind:"page",pageKey:L,pageName:String(ze.name??""),path:String(ze.path??"")},f):null,ps=H?Tt?.seo:void 0,At=Te!==void 0?Te:ps,hs=H?Ga(At):void 0,gs=Rt?.seoTypeOptions??[],vs=H&&f?Ja(f):"",an=Ee??hs??{},Dt=H&&Rt?Za(an,Rt):null,xs=H&&Dt&&Qa(At)?pt(Dt,f):null,bs=H?Xa(u,f)?.seoData:void 0,Fe=Se?[{label:"Default",sections:[{__resolveType:d}]}]:tr(Tt?.sections,u??{}),ut=Fe.length>1,De=Math.min(A,Fe.length-1),Qe=Fe[De],ee=Qe?.sections??[],$e=gt(ee,u);if(Se&&d&&O!==d){de(d);const n=ee[0],o=$e[0];if(n&&o){S(0),be(0),$([]);const m=it(n,o,u);m&&(j(m.data),k(m.resolveType),q(null),oe(null))}}!Se&&O!==null&&de(null),qe.current={rawSections:ee,parsedSections:$e,decofile:u??{},activePageKey:L,pageVariants:Fe,variantIndex:De,sectionVariantIndex:xe,selectedSectionIndex:h};const Xe=(n,o,m)=>{const y=tt(n,o);if(!y){j(null),k(null),q(null),oe(null);return}const B=_n(y,Je)[m];if(!B){j(null),k(null),q(null),oe(null);return}const z=_a(B.value,u);j(z?.data??null),k(z?.resolveType??null);const{resolveType:te,formValue:me}=Lt(B.rule,u,f??void 0);q(te),oe(me)};if(l!==void 0&&l!==V&&(I(l??null),typeof l=="number")){const n=ee[l],o=$e[l];if(n&&o)if(S(l),be(0),$([]),K(m=>m+1),o.isMultivariate)Xe(n,o,0);else{const m=it(n,o,u);m?(j(m.data),k(m.resolveType)):(j(null),k(null)),q(null),oe(null)}}const Pt=P&&f?pt(P,f):null,Ye=(n,o)=>{if(!L)return;const m=Bt(u,L,n,De,Fe);Ae.mutate({blockKey:L,data:m},{onSuccess:()=>o?.onSuccess?.()??g?.(),onError:y=>ce.error(`Save failed: ${y.message}`)})},lt=()=>{S(null),j(null),k(null),be(0),oe(null),q(null),$([]),K(n=>n+1)},Ss=(n,o)=>{wt.current&&clearTimeout(wt.current);const m=qe.current.sectionVariantIndex;wt.current=setTimeout(()=>{const{rawSections:y,parsedSections:T,decofile:B,activePageKey:z,pageVariants:te,variantIndex:me}=qe.current,ne=y[o];if(!ne)return;const fe=T[o];if(!fe)return;if(fe.isSavedBlock){const _e=fe.isLazy?ne.section?.__resolveType??ne.__resolveType:ne.__resolveType;Ae.mutate({blockKey:_e,data:n},{onSuccess:()=>g?.(),onError:je=>ce.error(`Save failed: ${je.message}`)});return}if(!z)return;const ye={...B[z]},Pe=[...y];if(fe.isMultivariate){const _e=tt(ne,fe);if(!_e||!z)return;const je=La(_e,m,n);Pe[o]=ht(ne,fe,je)}else if(fe.isHidden){const _e=vt(ne.__resolveType),je=_e?{...ne.section}:{...ne},Ke=Array.isArray(je.variants)?[...je.variants]:[];Ke[0]&&(Ke[0]={...Ke[0],value:n}),je.variants=Ke,_e?Pe[o]={...ne,section:je}:Pe[o]=je}else fe.isLazy?Pe[o]={...ne,section:n}:Pe[o]=n;if(te.length>1){const _e=ye.sections,je=[..._e?.variants??[]];je[me]&&(je[me]={...je[me],value:Pe}),ye.sections={..._e,variants:je}}else ye.sections=Pe;Ae.mutate({blockKey:z,data:ye},{onSuccess:()=>g?.(),onError:_e=>ce.error(`Save failed: ${_e.message}`)})},Ft)},ys=n=>{S(n),be(0),$([]),K(T=>T+1);const o=ee[n],m=$e[n];if(!o||!m)return;if(m.isMultivariate){Xe(o,m,0);return}const y=it(o,m,u);if(!y){j(null),k(null),q(null),oe(null);return}j(y.data),k(y.resolveType),q(null),oe(null)},on=n=>{const o=n;j(o),h!==null&&Ss(o,h)},Vt=n=>{if(!L||!u||!f||!ze)return;const o={kind:"page",pageKey:L,pageName:String(ze.name??""),path:String(ze.path??"")},m=wn(u,o,f);m&&Ue.save(L,()=>{const y=Ie.getQueryData(Xs.decofile(Be))?.[L];if(!y||typeof y!="object"||y===null||Array.isArray(y))return null;const T={...y,...Nt.current};return Nt.current={},n?.raw!==void 0?{...T,seo:n.raw}:n?.inner!==void 0?to(o,m,T,n.inner):T})},_s=(n,o)=>{L&&(Nt.current[n]=o,Vt())},js=(n,o)=>{if(!L)return;const m=yt([...ee],n,o);h!==null&&(h===n?S(o):n<h&&o>=h?S(h-1):n>h&&o<=h&&S(h+1)),Ye(m)},ks=n=>{if(!L)return;const o=ee.filter((m,y)=>y!==n);h===n?lt():h!==null&&h>n&&S(h-1),Ye(o)},ws=n=>{if(!L)return;const o=ee[n];if(!o)return;const m=[...ee];m.splice(n+1,0,po(o)),h!==null&&h>n&&S(h+1),Ye(m)},Ns=n=>{if(!L)return;const o=ee[n],m=$e[n];if(!o||!m||m.isMultivariate)return;const y=m.isHidden?Da(o):Pa(o);if(!y)return;const T=[...ee];T[n]=y,h===n&&lt(),Ye(T)},Cs=n=>{if(!L)return;const o=ee[n],m=$e[n];if(!o||!m||m.isMultivariate)return;const y=Aa(o);if(!y)return;const T=[...ee];T[n]=y,h===n&&lt(),Ye(T)},Ts=n=>{if(!L)return;const o=[...ee,{__resolveType:n.resolveType}],m=o.length-1;Ye(o,{onSuccess:()=>{G(!1),S(m),be(0),$([]),K(z=>z+1);const y=o[m],T=gt(o,u)[m];if(!y||!T)return;if(T.isMultivariate){Xe(y,T,0);return}const B=it(y,T,u);if(!B){j(null),k(null),q(null),oe(null);return}j(B.data),k(B.resolveType),q(null),oe(null)}})},Rs=n=>{if(h===null)return;const o=ee[h],m=$e[h];!o||!m?.isMultivariate||(be(n),$([]),K(y=>y+1),Xe(o,m,n))},As=n=>{if(h===null||!L)return;const o=ee[h],m=$e[h];if(!o||!m?.isMultivariate)return;const y=tt(o,m);if(!y)return;const T=Ta(y,n);if(!T){ce.error("Cannot delete the only variant.");return}const B=[...ee];B[h]=ht(o,m,T);const z=T.variants;let te=xe;n===xe?te=Math.min(n,z.length-1):n<xe&&(te=xe-1),be(te),$([]),K(me=>me+1),Xe(B[h],m,te),Ye(B)},Ds=n=>{if(h===null||!L)return;const o=ee[h],m=$e[h];if(!o||!m?.isMultivariate)return;const y=tt(o,m);if(!y)return;const T=Ra(y,n),B=[...ee];B[h]=ht(o,m,T);const z=n+1;be(z),$([]),K(te=>te+1),Xe(B[h],m,z),Ye(B)},Mt=n=>{const o=n??h;if(o===null||!L)return;const m=ee[o],y=$e[o];if(!m||!y)return;const T=ja(m,y);if(!T){ce.error("This section cannot have variants.");return}const B=[...ee];B[o]=T.section;const z=gt(B,u)[o];if(!z?.isMultivariate){ce.error("Could not add variant.");return}S(o),be(T.newVariantIndex),$([]),K(te=>te+1),Xe(T.section,z,T.newVariantIndex),Ye(B)},Ps=()=>{if(h===null||!L)return;const n=ee[h],o=$e[h];if(!n||!o?.isMultivariate)return;const m=tt(n,o);if(!m)return;const y=Ca(n,o,m);if(!y){ce.error("Could not remove variants.");return}const T=[...ee];T[h]=y;const B=gt(T,u)[h];if(!B)return;be(0),q(null),oe(null),$([]),K(te=>te+1);const z=it(y,B,u);z?(j(z.data),k(z.resolveType)):(j(null),k(null)),Ye(T)},Vs=async n=>{if(X===null||!L)return;const o=Tn(n,u);if(o){ce.error(o);return}const m=ee[X],y=$e[X];if(!m||!y)return;const T=it(m,y,u);if(!T){ce.error("This section cannot be saved as global.");return}const B={...T.data,name:n};try{await Ae.mutateAsync({blockKey:n,data:B});const z=[...ee];z[X]={__resolveType:n},await Ae.mutateAsync({blockKey:L,data:Bt(u,L,z,De,Fe)}),h===X&&lt(),re(null),ce.success(`Saved global block "${n}"`),g?.()}catch(z){ce.error(z instanceof Error?z.message:"Failed to save global block")}},rn=Qe?.rule;if(ut&&h===null&&E===null&&rn){const{resolveType:n,formValue:o}=Lt(rn,u??{},f??void 0);J(n),M(o)}const dt=f?Fo(f):[],Ms=!Se&&!!(i&&f&&u),ln=E&&f?pt(E,f):null,Es=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),rt.current&&(clearTimeout(rt.current),rt.current=null)},cn=async(n,o)=>{if(!(Ia(o,n,f)>0))try{await tn.mutateAsync({blockKey:n})}catch(m){ce.error(m instanceof Error?m.message:"Could not delete matcher block")}},un=n=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:o,decofile:m,variantIndex:y}=qe.current;if(!o)return;const T={...m[o]},B={...T.sections},z=[...B.variants??[]],te=z[y],me=te?.rule;if(It(me,m,f)){const ne=me?.__resolveType??"",fe=m[ne],ye=typeof fe?.name=="string"?fe.name:ne,{__resolveType:Pe,..._e}=n;Ae.mutate({blockKey:ne,data:zt(Pe??"",_e,ye)},{onSuccess:()=>g?.(),onError:je=>ce.error(`Save failed: ${je.message}`)});return}te&&(z[y]={...te,rule:n}),T.sections={...B,variants:z},Ae.mutate({blockKey:o,data:T},{onSuccess:()=>g?.(),onError:ne=>ce.error(`Save failed: ${ne.message}`)})},Ft)},$s=n=>{J(n);const o=n?{__resolveType:n}:{__resolveType:kn};M({}),un(o)},Os=n=>{const o=n;M(o);const m=E?{__resolveType:E,...o}:{...o};un(m)},dn=n=>{rt.current&&clearTimeout(rt.current);const{selectedSectionIndex:o,sectionVariantIndex:m}=qe.current;o!==null&&(rt.current=setTimeout(()=>{const{rawSections:y,parsedSections:T,decofile:B,activePageKey:z,pageVariants:te,variantIndex:me}=qe.current;if(!z)return;const ne=y[o],fe=T[o];if(!ne||!fe?.isMultivariate)return;const ye=tt(ne,fe);if(!ye)return;const Pe=Oa(ye,m,n),_e=[...y];_e[o]=ht(ne,fe,Pe);const je=Bt(B,z,_e,me,te);Ae.mutate({blockKey:z,data:je},{onSuccess:()=>g?.(),onError:Ke=>ce.error(`Save failed: ${Ke.message}`)})},Ft))},Ls=n=>{q(n),oe({}),dn(n?{__resolveType:n}:{__resolveType:kn})},Is=n=>{const o=n;oe(o);const m=ke?{__resolveType:ke,...o}:{...o};dn(m)};if(!Se&&!ze)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",c]});if(Se&&!Ct)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const We=h!==null?$e[h]??null:null,mn=h!==null?ee[h]:null,fn=mn&&We?.isMultivariate?tt(mn,We):null,mt=fn?_n(fn,Je):[],pn=Math.min(xe,Math.max(mt.length-1,0)),Et=mt[pn]??null,et=We?.isMultivariate===!0,hn=h!==null&&We!==null,ct=hn&&(et||!!(Pt&&C)),zs=ct&&!Se&&We?.isSavedBlock===!0,Ge=Se||zs,Fs=Se?sn:We?.label??"",gn=ke&&f?pt(ke,f):null,$t=ct&&(!Se||se.length>0)?Se?[sn,...se]:[ze.name,We.label,...et&&Et?[Et.label]:[],...se]:[],Bs=H&&ze?[ze.name,"SEO",...Re]:[],vn=H?Bs:Ge?$t.length>0?$t:[Fs]:$t,xn=()=>{if(!L)return;const n=u[L],o=ka(n.sections,ee);if(!o)return;const m=wa(o);Ae.mutate({blockKey:L,data:{...n,sections:o}},{onSuccess:()=>{D(m),S(null),j(null),k(null),$([]),M(null),J(null)},onError:y=>ce.error(`Save failed: ${y.message}`)})},bn=(n,o,m)=>{if(!L)return;const y=u[L],T=y.sections;if(!T||typeof T!="object"||Array.isArray(T))return;const B=T;if(!Array.isArray(B.variants))return;const z=n([...B.variants]);if(!z)return;const te=$a(B,z),me={...u,[L]:{...y,sections:te}};Ae.mutate({blockKey:L,data:me[L]},{onSuccess:()=>{o?.(),m&&cn(m,me)},onError:ne=>ce.error(`Save failed: ${ne.message}`)})},Ks=n=>{Z(null),D(n),S(null),j(null),k(null),$([]);const o=Fe[n]?.rule,{resolveType:m,formValue:y}=Lt(o,u??{},f??void 0);J(m),M(y)},Hs=(n,o)=>{n!==o&&(De===n?D(o):n<De&&o>=De?D(De-1):n>De&&o<=De&&D(De+1),bn(m=>yt(m,n,o)))},Us=n=>{const o=Fe[n]?.rule,m=Na(o,u??{},f??void 0);bn(y=>y.length<=1?null:(y.splice(n,1),y),()=>{Fe.length-1===1?D(0):n<De?D(De-1):n===De&&D(Math.max(0,n-1)),S(null),j(null),k(null),$([]),M(null),J(null)},m)},Ys=async(n,o)=>{Es();const m=qe.current.activePageKey,y=qe.current.decofile;if(!m)return;const T=y[m],B=T.sections;if(!B||typeof B!="object"||Array.isArray(B))return;const z=B;if(!Array.isArray(z.variants))return;const te=[...z.variants],me=te[n];if(!me?.rule||typeof me.rule!="object"){ce.error("This variant has no matcher rule to rename.");return}const ne=me.rule,fe=o.trim();nn(!0);try{if(!fe){if(!It(ne,y,f)){Z(null);return}const Ot=ne.__resolveType??"";te[n]={...me,rule:Va(ne,y,f)};const yn={...y,[m]:{...T,sections:{...z,variants:te}}};await Ae.mutateAsync({blockKey:m,data:yn[m]}),await cn(Ot,yn),Z(null),g?.();return}const ye=Ma(ne,y,f);if(!ye){ce.error("Could not read this variant's matcher rule.");return}if(ye.blockKey){await Ae.mutateAsync({blockKey:ye.blockKey,data:zt(ye.resolveType,ye.data,fe)}),Z(null),g?.();return}const Pe=Cn(fe),_e=Tn(Pe,y);if(_e){ce.error(_e);return}const je=zt(ye.resolveType,ye.data,fe);let Ke=null;try{await Ae.mutateAsync({blockKey:Pe,data:je}),Ke=Pe,te[n]={...me,rule:Ea(Pe)},await Ae.mutateAsync({blockKey:m,data:{...T,sections:{...z,variants:te}}}),Ke=null}catch(Ot){throw Ke&&await tn.mutateAsync({blockKey:Ke}).catch(()=>{}),Ot}Z(null),ce.success(`Saved matcher as global block "${fe}"`),g?.()}catch(ye){ce.error(ye instanceof Error?ye.message:"Failed to rename variant")}finally{nn(!1)}},Sn=()=>{lt()},qs=n=>{ge(n),Vt({inner:n})},Ws=n=>{we(n),Vt({raw:n})},Gs=()=>{ge(null),ve([])},Js=()=>Ne(n=>n+1),Zs=n=>{if(H){if(n===0){Ue.flush(),le(!1),ge(null),we(void 0),ve([]),Ne(m=>m+1),b?.();return}if(n===1){ve([]),Ne(m=>m+1);return}ve(Re.slice(0,n-1)),Ne(m=>m+1);return}if(Se){$(se.slice(0,n)),K(m=>m+1);return}if(n===0){Sn();return}if(n===1){$([]),K(m=>m+1);return}if(et&&n===2){$([]),K(m=>m+1);return}const o=et?2:1;$(se.slice(0,n-o))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:Ge||ct||H?t.jsxs("div",{className:pe("border-b px-3 py-2.5",Ge&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Se&&ut&&Qe&&t.jsxs("button",{type:"button",onClick:Sn,title:`Editing in variant: ${Qe.label}`,className:pe("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Xo),children:[t.jsx(Xt,{rule:xt(Qe.rule,u??{},f??void 0),matchers:dt}),t.jsx("span",{className:"max-w-[160px] truncate",children:Qe.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:vn.map((n,o)=>{const m=o===vn.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o>0&&t.jsx(ea,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>Zs(o),title:n,className:pe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",m?Ge?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Ge?"text-foreground/80":"text-muted-foreground",Ge?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:n})]},`${n}-${o}`)})}),Ge&&t.jsxs(at,{children:[t.jsx(nt,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(aa,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(st,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),hn&&!et&&!We?.isHidden&&L&&t.jsx(En,{onClick:()=>Mt()})]}),Ge&&t.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(nr,{pageKey:L,initialName:ze.name,initialPath:ze.path,onFieldChange:_s})}),t.jsxs(at,{children:[t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>le(!0),children:t.jsx(na,{size:14})})}),t.jsx(st,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(at,{children:[t.jsx(nt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>_&&L?_(L):ie(!0),children:t.jsx(sa,{size:14})})}),t.jsx(st,{side:"bottom",children:"View JSON"})]}),t.jsx(En,{onClick:xn})]})}),ut&&!ct&&!H&&L&&t.jsx(Jo,{listKey:L,variants:Fe,activeIndex:De,decofile:u??{},meta:f,matchers:dt,onSelect:Ks,onReorder:Hs,onRename:Z,onDelete:Us,onAdd:xn}),H?t.jsx(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:Tt&&L?t.jsx(eo,{rawSeo:At,innerSeo:an,defaultResolveType:vs,seoSchema:xs,activeResolveType:Dt,seoTypeOptions:gs,formResetKey:Le,siteDefaultSeo:bs,onBreadcrumbChange:ve,onPersistRaw:Ws,onInnerChange:qs,onClearForm:Gs,onBumpFormKey:Js}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ct?t.jsxs(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&mt.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(jo,{variants:mt.map((n,o)=>({index:o,label:n.label})),selectedIndex:pn,onSelect:Rs,onDuplicate:Ds,onDelete:As,onRemoveAll:Ps,onAdd:()=>Mt()}),et&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(Dn,{currentRt:ke??"",currentLabel:Je(Et?.rule),matchers:dt,onSelect:Ls}),gn&&Oe&&t.jsx("div",{className:"pt-1",children:t.jsx(Ut,{schema:gn,value:Oe,onChange:Is,basePath:""})})]})]}),t.jsx(Vn,{activeSchema:Pt,formValue:C,formResetKey:he,onFormChange:on,onBreadcrumbChange:$,breadcrumbPath:se,emptyMessage:"No editable fields for this variant.",meta:f,decofile:u,onSaveReferencedBlock:en})]}):Se?t.jsx(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(Vn,{activeSchema:Pt,formValue:C,formResetKey:he,onFormChange:on,onBreadcrumbChange:$,breadcrumbPath:se,emptyMessage:"No editable fields for this global block.",meta:f,decofile:u,onSaveReferencedBlock:en})}):t.jsxs(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ut&&E!==null&&t.jsxs("div",{className:pe("px-3 border-b",Q?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>W(n=>!n),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":Q,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),Q?t.jsx(ta,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx($n,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Q&&t.jsxs("div",{className:pe("space-y-3",kt&&"pointer-events-none opacity-50"),children:[t.jsx(Dn,{currentRt:E,currentLabel:jn(Qe?.rule,u??{},Je,f??void 0),matchers:dt,onSelect:$s}),ln&&F&&t.jsx("div",{className:"space-y-3",children:t.jsx(Ut,{schema:ln,value:F,onChange:Os,basePath:""})})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx($o,{listKey:`${L??""}-${De}`,rawSections:ee,sections:$e,meta:f,selectedIndex:h,onSelect:ys,onReorder:js,onDelete:ks,onDuplicate:ws,onMakeReusable:re,onToggleHidden:Ns,onToggleLazy:Cs,onAddVariant:Mt,onAddSection:()=>G(!0),canAddSection:Ms})})]}),t.jsx(Qo,{open:X!==null,onOpenChange:n=>{n||re(null)},defaultBlockId:X!==null?Cn($e[X]?.label??""):"",isPending:Ae.isPending,onSubmit:Vs}),i&&t.jsx(uo,{open:Y,onOpenChange:G,meta:f,decofile:u,previewBaseUrl:i,onSelect:Ts}),ae&&L&&u&&t.jsx(Sa,{open:ae,onOpenChange:ie,pageKey:L,decofile:u}),ue!==null&&t.jsx(fo,{open:!0,initialName:It(Fe[ue]?.rule,u??{},f??void 0)?jn(Fe[ue]?.rule,u??{},Je,f??void 0):"",autoLabel:Je(xt(Fe[ue]?.rule,u??{},f??void 0)),isPending:kt,onSubmit:async n=>{await Ys(ue,n)},onOpenChange:n=>{!n&&!kt&&Z(null)}})]})}export{Gl as SectionsEditor};
@@ -1 +0,0 @@
1
- import{e as T,j as t,r as Q,B as je,l as Se}from"./index-biiHZ5l9.js";import{i as be}from"./ChevronRight-CrZy8tHx.js";import{E as fe}from"./agent-icon-DT8dQ9tq.js";import{S as ue}from"./scroll-area-BqOijBAI.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Ee,S as Re}from"./page-seo-form-Bbna5w2y.js";import{m as ze}from"./index-BZvxagUr.js";import{a as ge}from"./Tool01-Dcq7KP8Y.js";import{s as xe}from"./schema-form-nZH-67HX.js";import"./AlertCircle-9EFUZenf.js";import"./SwitchHorizontal01-BMnNI1Fi.js";import"./RefreshCcw01-3BsQQkRx.js";import"./XCircle-UPVnJx4i.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./Check-D-9dblUn.js";import"./ChevronDown-Cf2Q-GlB.js";import"./ChevronLeft-BaV4nFMQ.js";import"./ChevronUp-BAxoXhnT.js";import"./DotsVertical-SvwN4CeV.js";import"./Container-CYcITvPW.js";import"./Eye-ByuwKsdh.js";import"./ZoomOut-D8vQ49we.js";import"./Globe01-DfGFlik1.js";import"./FilterLines-BJZdiggU.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./Key01-CzmPnHuw.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Play-CMJ2IWYR.js";import"./Plus-CjrtKB-Y.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Trash01-Cup7-ZTT.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./X-1KR4wibP.js";import"./Zap-Cl-JM7N9.js";import"./select-CNSUv3cw.js";import"./tooltip-bsrBmmjV.js";import"./label-CcC4_aKf.js";import"./switch-D6SWnoi2.js";import"./agent-capabilities-BJLQSkAN.js";import"./chat-context-Bu6qpu9K.js";import"./tab-id-D4SJwEQy.js";import"./use-mcp-client-CWFUu1lY.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-0jbEmvOc.js";import"./use-collections-B5Jh_wGd.js";import"./use-ai-providers-v0sCRzMO.js";import"./use-organization-settings-Izqk1Gkk.js";import"./pair-Ba1UoSSJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./dialog-Bm1pP7Vu.js";import"./content-blocks-o63cs2vh.js";import"./types-jBdXInU0.js";import"./shell-layout-4LsIVsl3.js";import"./avatar-BHEXMwdE.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./integration-icon-Dy-a3x5R.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./use-connection-DyJtuHQI.js";import"./use-mcp-prompts-B5RhBVzg.js";import"./form-BcPtow5O.js";import"./input-5PMMNPU9.js";import"./spinner-DJD6-9r-.js";import"./drawer-B51jkLaX.js";import"./collection-search-LsgoMrVO.js";import"./tabs-DCDCb9Pz.js";import"./toggle-group-DhVqXGfs.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./agent-icons-DRrDyR7j.js";import"./checkbox--nDaSUZE.js";import"./skeleton--DN75sg7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-V9kb8x32.js";import"./card-BUTabNLA.js";import"./popover-Cvcd3A1d.js";import"./command-BehF6pb8.js";import"./index-CR_LeyNj.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./sortable.esm-g7bq1nDZ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-EXvV7rxl.js";import"./use-registry-connections-C-WVKjSU.js";import"./extract-connection-data-LoMqboL3.js";import"./generate-id-CadHbHqX.js";import"./collections-C_j8CeI8.js";import"./collection-tabs-CQJiHDMR.js";import"./badge-Da0IsrqH.js";import"./textarea-QEULyLXh.js";import"./connection-form-helpers-DoJomSCQ.js";import"./use-infinite-scroll-xQQ6lYk4.js";import"./useSuspenseInfiniteQuery-B4dQiTEq.js";import"./index-Bo5bzoUm.js";import"./dropdown-menu-CIu58K9q.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-5KSwc3hj.js";import"./sidebar-CPZXU-2w.js";import"./sheet-D99KevZC.js";import"./toolbar-BsB4Mvyv.js";import"./use-create-virtual-mcp-CWYOy45e.js";import"./github-repo-picker-B24_pGAu.js";import"./use-mcp-tools-DePRGZE5.js";import"./alert-dialog-CSkQIwm8.js";import"./index-B1bHiM-j.js";import"./use-org-auth-client--i_Sx92M.js";import"./hover-card-DE2_8MLP.js";import"./task-status-P3BULAyA.js";import"./use-status-sounds-BJ_LqdGJ.js";import"./empty-state-1AbmTLd7.js";import"./resizable-BbbLszRZ.js";import"./use-capability-BPM45mbW.js";import"./header-tab-button-DSX6YPkf.js";import"./index-BflNEs6l.js";import"./user-DRDdFgUw.js";import"./tools-list-Ch5RlbiL.js";import"./use-debounced-autosave-ClLbciGl.js";import"./index-r7-3fAFf.js";import"./search-input-BgGthWir.js";import"./use-secrets-BpdIBEe6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-aX0NKKKh.js";import"./view-mode-toggle-G0qNMbJ1.js";import"./select-model-0CGh6cKF.js";import"./use-automations-Db8x6SNU.js";import"./monaco-editor-CJVi8Ty8.js";import"./automation-runs-BJTRztep.js";import"./table-Cx3PhNth.js";import"./use-members-Cw70r_Wh.js";import"./automation-list-row-5M4PNEWw.js";import"./calendar-BbhbS2FE.js";import"./image-field-D00iYa4G.js";import"./use-file-configs-CC8ghNUa.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Di(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let E,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(E=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(E,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=E,e[7]=G):(E=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=R=>{if(!c)return;const de=R;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==E?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Ee,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:E,onPersistRaw:R=>{N(R),k(R)},onInnerChange:R=>{v(R),b(R)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Re,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=E,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Di as SeoEditor};
@@ -1 +0,0 @@
1
- import{e as S,c as K,j as s,l as qt,r as T,t as Z,q as fe,b as Ne,X as ks,K as Yt,n as Xt,f as Oe,g as Is,d as Fn,P as Gn,Y as Ln,Z as Bn,T as Hn,W as Un,I as Kn,H as Vn,a as Wn,B as $t,$ as qn,a0 as Yn,o as Ae,a1 as Xn,a2 as Qn,a3 as Zn,G as Jn,a4 as er,a5 as tr,a6 as sr,a7 as nr,a8 as xt,a9 as rr,aa as or,ab as ir,ac as lr,ad as ar,ae as cr,af as Ms,ag as dr,ah as ur,ai as mr,aj as fr,ak as xr,al as hr,am as pr,an as gr,ao as br,ap as jr,aq as vr,p as yr,E as As}from"./index-biiHZ5l9.js";import{u as _r}from"./useRouterState-Dm0UHjU4.js";import{c as Sr,a as Cr,i as Nr}from"./ZoomOut-D8vQ49we.js";import{u as Xe,c as xe,d as ke,e as zt,f as Pt,g as $e,h as $s,i as Ts,j as wr,k as kr,l as Ut}from"./sidebar-CPZXU-2w.js";import{T as we}from"./toolbar-BsB4Mvyv.js";import{u as Os,T as Ve,a as We,b as qe,c as ns}from"./tooltip-bsrBmmjV.js";import{S as Se}from"./skeleton--DN75sg7.js";import{P as Et,a as ut,b as Rt}from"./popover-Cvcd3A1d.js";import{b as zs,a as Ps,D as Es}from"./drawer-B51jkLaX.js";import{i as Rs}from"./SearchMd-BL2y99rx.js";import{s as Ir}from"./Star01-eRdSY4QW.js";import{s as Ce}from"./Plus-CjrtKB-Y.js";import{i as Mr,S as Dt,u as Ft,g as Ar}from"./use-mcp-client-CWFUu1lY.js";import{a as Ds,u as ht,b as $r}from"./use-virtual-mcp-0jbEmvOc.js";import{u as Tr}from"./use-create-virtual-mcp-CWYOy45e.js";import{I as Or,a as zr,u as Pr,W as Er,H as Rr,S as Dr,G as Fr}from"./github-repo-picker-B24_pGAu.js";import{A as Te,V as rs,W as os,X as Fs,Y as Gr,Z as Lr,_ as Br}from"./agent-icon-DT8dQ9tq.js";import{u as Gs,d as Hr,l as Ls,m as is}from"./tab-id-D4SJwEQy.js";import{r as Ur,a as Kr,R as Vr,b as Wr,u as Bs}from"./shell-layout-4LsIVsl3.js";import{u as qr,a as Yr,b as Xr,s as Qr,c as Zr,r as Jr,d as eo,e as to,f as so,p as no,T as Hs,g as ro,h as oo,i as io,j as lo,k as ao,l as co,m as uo,n as mo,S as ls,o as Us}from"./use-navigate-to-agent-CdsMYUzL.js";import{A as as}from"./avatar-BHEXMwdE.js";import{i as Ks}from"./Check-D-9dblUn.js";import{a as cs}from"./Eye-ByuwKsdh.js";import{n as fo,i as xo}from"./Globe01-DfGFlik1.js";import{i as ho,a as Vs}from"./ZapSquare-B1o2Q9OR.js";import{i as po}from"./Monitor01-Cw6kmClm.js";import{n as go,a as bo}from"./Sun-CH2HWLCn.js";import{a as pt}from"./Settings02-Cd4DIqaJ.js";import{i as jo}from"./Shield01-zIbMct6w.js";import{a as vo}from"./Users03-BlNe2PnN.js";import{s as Ws}from"./XClose-pR-QU0OQ.js";import{f as yo,a as _o,b as So,c as Co,d as No,e as wo,A as ko}from"./alert-dialog-CSkQIwm8.js";import{F as Io,a as Mo,b as Ao,c as $o,d as To,e as Oo,f as zo}from"./form-BcPtow5O.js";import{I as Po}from"./input-5PMMNPU9.js";import{S as Eo}from"./spinner-DJD6-9r-.js";import"./index-B1bHiM-j.js";import{i as Ro,a as Do}from"./RefreshCcw01-3BsQQkRx.js";import{n as Qt}from"./Stars02-EuAFDZ5E.js";import{A as qs,g as Fo,u as Go,a as ds,K as Lo,P as Bo,s as Ho,S as Uo,v as Ko,D as Vo,c as Wo,b as qo,C as Yo}from"./sortable.esm-g7bq1nDZ.js";import{i as Zt}from"./ChevronRight-CrZy8tHx.js";import{u as Ys}from"./use-mcp-tools-DePRGZE5.js";import{u as Xs}from"./use-ai-providers-v0sCRzMO.js";import{i as Xo}from"./FilterLines-BJZdiggU.js";import{t as Qo}from"./Users01-DPJm6-u-.js";import{b as us,c as Qs,S as ms,a as fs,d as xs}from"./select-CNSUv3cw.js";import{b as Zo,c as Jo,e as ei,a as ti,D as si}from"./dialog-Bm1pP7Vu.js";import{C as ni,e as ri,c as oi,d as ii,b as li}from"./command-BehF6pb8.js";import{i as Zs}from"./Zap-Cl-JM7N9.js";import{u as ai}from"./use-org-auth-client--i_Sx92M.js";import{H as ci,a as di,b as ui}from"./hover-card-DE2_8MLP.js";import{g as mi,S as fi}from"./task-status-P3BULAyA.js";import{f as xi}from"./format-time-Cy7tTmZp.js";import{t as Js}from"./ChevronDown-Cf2Q-GlB.js";function hi(t){const e=S.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,u=o===void 0?"Search...":o;let d;e[0]!==a?(d=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=d):d=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(qt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Rs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let h;e[6]!==r?(h=b=>r(b.target.value),e[6]=r,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==u||e[11]!==h||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:h,onKeyDown:i,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=u,e[11]=h,e[12]=n,e[13]=x):x=e[13];let p;e[14]!==f||e[15]!==g||e[16]!==x?(p=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=p):p=e[17];let v;return e[18]!==d||e[19]!==p?(v=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=v):v=e[20],v}const pi="Select an existing agent";function gi(t){const e=S.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Ve,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(We,{side:"right",sideOffset:8,children:pi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(qe,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function bi(){const t=S.c(5),{enableDecoImport:e}=ks(),{data:n}=Ne.useSession();let r;t[0]!==n?.user?.email?(r=Yt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:ji,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=Xt(i);return a?.isDecoUser??!1}async function ji(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function vi(t){const e=Oe(),{create:n}=Gs(),{locator:r}=fe(),o=Is({strict:!1}),i=Fn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Ur(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function yi(t){const e=S.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Te,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=a):a=e[8],a}function _i(t){const e=S.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=T.useState(""),l=Ds(),{org:c}=fe(),{data:u}=Ne.useSession(),d=u?.user?.id??"anon",m=l.filter(Ni).map(Ci),f=Yr();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:h,isCreating:x}=Tr(g),{createFromTemplate:p,isCreating:v}=Pr(),b=bi(),_=vi(c.slug),j=i.toLowerCase(),y=l.filter(Si).filter(le=>!i||le.title.toLowerCase().includes(j)),N=le=>{Xr({orgId:c.id,userId:d},le.id,m),f(),n(),a(""),_(le.id)},C="flex flex-col max-h-[min(640px,80dvh)]";let I;e[1]!==i?(I=s.jsx(hi,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=I):I=e[2];const $="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const P="grid grid-cols-3 gap-1";let O;e[4]!==h||e[5]!==n?(O=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await h(),n()},e[4]=h,e[5]=n,e[6]=O):O=e[6];let M,w;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ce,{size:16,className:"text-muted-foreground"})}),w=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=M,e[8]=w):(M=e[7],w=e[8]);let D;e[9]!==x||e[10]!==O?(D=s.jsxs("button",{type:"button",disabled:x,onClick:O,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[M,w]}),e[9]=x,e[10]=O,e[11]=D):D=e[11];let z;e[12]!==p||e[13]!==n?(z=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await p(Er),n()},e[12]=p,e[13]=n,e[14]=z):z=e[14];let H,F;e[15]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ir,{className:"size-5 text-muted-foreground"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=H,e[16]=F):(H=e[15],F=e[16]);let U;e[17]!==v||e[18]!==z?(U=s.jsxs("button",{type:"button",disabled:v,onClick:z,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[H,F]}),e[17]=v,e[18]=z,e[19]=U):U=e[19];let E;e[20]!==p||e[21]!==n?(E=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await p(Rr),n()},e[20]=p,e[21]=n,e[22]=E):E=e[22];let L,G;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Dr,alt:"",className:"size-5 object-contain"})}),G=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=L,e[24]=G):(L=e[23],G=e[24]);let R;e[25]!==v||e[26]!==E?(R=s.jsxs("button",{type:"button",disabled:v,onClick:E,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[L,G]}),e[25]=v,e[26]=E,e[27]=R):R=e[27];let V;e[28]!==n||e[29]!==o?(V=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=V):V=e[30];let W,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Fr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=W,e[32]=X):(W=e[31],X=e[32]);let re;e[33]!==V?(re=s.jsxs("button",{type:"button",onClick:V,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[W,X]}),e[33]=V,e[34]=re):re=e[34];let Y;e[35]!==b||e[36]!==n||e[37]!==r?(Y=b&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=b,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=y.map(le=>s.jsx(yi,{agent:le,onClick:()=>N(le)},le.id));let q;e[39]!==D||e[40]!==U||e[41]!==R||e[42]!==re||e[43]!==Y||e[44]!==oe?(q=s.jsxs("div",{className:P,children:[D,U,R,re,Y,oe]}),e[39]=D,e[40]=U,e[41]=R,e[42]=re,e[43]=Y,e[44]=oe,e[45]=q):q=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==y.length?(J=y.length===0&&!x&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=x,e[47]=i,e[48]=y.length,e[49]=J):J=e[49];let Q;e[50]!==q||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:$,children:[A,q,J]}),e[50]=q,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Gn,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==I||e[63]!==se?(ie=s.jsxs("div",{className:C,children:[I,Q,se]}),e[61]=Q,e[62]=I,e[63]=se,e[64]=ie):ie=e[64],ie}function Si(t){return!Mr(t.id)}function Ci(t){return t.id}function Ni(t){return t.pinned}function en(t){const e=S.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,a]=T.useState(!1),[l,c]=T.useState(!1),[u,d]=T.useState(!1),m=Os(),{setOpenMobile:f}=Xe(),g=qr(),h=g?"border border-border":void 0;let x;e[2]!==g?(x=$=>g?s.jsx(gi,{children:$}):$,e[2]=g,e[3]=x):x=e[3];const p=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const b=v;let _;e[7]!==b||e[8]!==i?(_=i&&s.jsx(T.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Se,{className:"h-4 w-24"})}),children:s.jsx(_i,{onClose:b,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{d(!0),b()}})}),e[7]=b,e[8]=i,e[9]=_):_=e[9];const j=_;let y;e[10]!==o||e[11]!==h||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==j||e[16]!==p?(y=m?s.jsxs(s.Fragment,{children:[o?p(s.jsx(we,{"aria-label":"Browse agents",className:K(h),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(xe,{children:p(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(h),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(zs,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs(Ps,{className:"max-h-[85dvh] p-0",children:[s.jsx(Es,{className:"sr-only",children:"Browse agents"}),j]})})]}):s.jsxs(Et,{open:i,onOpenChange:$=>{$&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),a($)},children:[o?p(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(h),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(xe,{children:p(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(h),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Rt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:j})]}),e[10]=o,e[11]=h,e[12]=g,e[13]=m,e[14]=i,e[15]=j,e[16]=p,e[17]=y):y=e[17];let N;e[18]!==l?(N=s.jsx(Or,{open:l,onOpenChange:c}),e[18]=l,e[19]=N):N=e[19];let C;e[20]!==u?(C=s.jsx(zr,{open:u,onOpenChange:d}),e[20]=u,e[21]=C):C=e[21];let I;return e[22]!==y||e[23]!==N||e[24]!==C?(I=s.jsxs(s.Fragment,{children:[y,N,C]}),e[22]=y,e[23]=N,e[24]=C,e[25]=I):I=e[25],I}function tn(){const t=S.c(24),{org:e}=fe(),n=Oe(),o=_r().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Sr,{className:"size-4!"}),t[0]=u):u=t[0];const d=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==d||t[5]!==m?(f={key:"home",label:"Home",icon:u,isActive:d,onClick:m},t[4]=d,t[5]=m,t[6]=f):f=t[6];const g=f;let h;t[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Cr,{className:"size-4!"}),t[7]=h):h=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let p;t[11]!==n||t[12]!==i?(p=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=p):p=t[13];let v;t[14]!==x||t[15]!==p?(v={key:"files",label:"Library",icon:h,isActive:x,onClick:p},t[14]=x,t[15]=p,t[16]=v):v=t[16];const b=v;let _;t[17]!==b||t[18]!==g?(_={type:"items",items:[g,b]},t[17]=b,t[18]=g,t[19]=_):_=t[19];let j;if(t[20]!==c||t[21]!==_){if(j=[_],c){let y;t[23]===Symbol.for("react.memo_cache_sentinel")?(y={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(en,{})})})})},t[23]=y):y=t[23],j.push(y)}t[20]=c,t[21]=_,t[22]=j}else j=t[22];return j}function Tt(t){const e=S.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(u=s.jsx(Ln,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function sn(t){const e=S.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function nn(t){const e=S.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const a=i,l=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=K(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let m;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(m=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==u||e[16]!==m?(f=s.jsx(xe,{className:u,children:m},l),e[14]=n.key,e[15]=u,e[16]=m,e[17]=f):f=e[17],f}function wi(t){const e=S.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx($s,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ii),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(sn,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(ki),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function ki(t){return s.jsx(nn,{item:t},t.key)}function Ii(t){return s.jsx(nn,{item:t},t.key)}function Mi(t){const e=S.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==n?(u=n.map(Ai),e[2]=n,e[3]=u):u=e[3];let d;e[4]!==o?(d=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=d):d=e[5];let m;e[6]!==c||e[7]!==u||e[8]!==d?(m=s.jsxs(Ts,{className:c,children:[u,d]}),e[6]=c,e[7]=u,e[8]=d,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==l?(f=s.jsxs(wr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function Ai(t,e){return s.jsx(wi,{section:t},e)}function rn(t){const e=S.c(2);let n;return e[0]!==t?(n=s.jsx(Mi,{...t}),e[0]=t,e[1]=n):n=e[1],n}rn.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Se,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function $i(){const t=S.c(7),n=ks().logo??Bn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(kr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function hs(t){const e=S.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let u;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==l||e[13]!==c?(u=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,e[13]=c,e[14]=u):u=e[14];let d;return e[15]!==i||e[16]!==u?(d=s.jsx(xe,{className:i,children:u}),e[15]=i,e[16]=u,e[17]=d):d=e[17],d}function Ti(t){const e=S.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx($s,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let a;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=u=>s.jsx(hs,{item:u,onClose:r},u.key),e[5]=r,e[6]=c):c=e[6],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(sn,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(hs,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Oi(t){const e=S.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(T.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx($i,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(Ti,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let u;e[8]!==l||e[9]!==c?(u=s.jsxs(Ts,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=u):u=e[10];let d;return e[11]!==o||e[12]!==u?(d=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[11]=o,e[12]=u,e[13]=d):d=e[13],d}function on(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zi=Hn({name:Un().min(2,"Organization name is required")});function Pi(t){const e=S.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Kn(zi),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Vn(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Ri,onSuccess:Ei},e[1]=a):a=e[1];const l=Wn(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(So,{children:[s.jsx(Co,{children:"Create a new organization"}),s.jsx(No,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==l||e[4]!==i){let C;e[6]!==l?(C=I=>l.mutateAsync(I),e[6]=l,e[7]=C):C=e[7],d=i.handleSubmit(C),e[3]=l,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=C=>{const{field:I}=C;return s.jsxs(Ao,{children:[s.jsx($o,{children:"Organization Name"}),s.jsx(To,{children:s.jsx(Po,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Oo,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",on(I.value)]})]}),s.jsx(zo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(Io,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let h;e[15]!==l||e[16]!==i?(h=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=h):h=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==h?(x=s.jsx(yo,{disabled:i.formState.isSubmitting,onClick:h,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=h,e[20]=x):x=e[20];const p=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Eo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let b;e[23]!==p||e[24]!==v?(b=s.jsx($t,{type:"submit",variant:"default",disabled:p,children:v}),e[23]=p,e[24]=v,e[25]=b):b=e[25];let _;e[26]!==b||e[27]!==x?(_=s.jsxs(wo,{children:[x,b]}),e[26]=b,e[27]=x,e[28]=_):_=e[28];let j;e[29]!==_||e[30]!==d||e[31]!==f||e[32]!==g?(j=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,g,_]}),e[29]=_,e[30]=d,e[31]=f,e[32]=g,e[33]=j):j=e[33];let y;e[34]!==i||e[35]!==j?(y=s.jsxs(_o,{children:[u,s.jsx(Mo,{...i,children:j})]}),e[34]=i,e[35]=j,e[36]=y):y=e[36];let N;return e[37]!==r||e[38]!==n||e[39]!==y?(N=s.jsx(ko,{open:n,onOpenChange:r,children:y}),e[37]=r,e[38]=n,e[39]=y,e[40]=N):N=e[40],N}function Ei(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ri(t){const e=on(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ne.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Kt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Di(t){const e=S.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Kt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=u):u=e[8];let d;return e[9]!==l||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:l,style:c,children:u}),e[9]=l,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function wt(t){const e=S.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[d,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function ps(t){const e=S.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Zn();let a;e[0]!==n?(a=(M,w)=>M.slug===n?-1:w.slug===n?1:M.name.localeCompare(w.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,u]=T.useState(!1),[d,m]=T.useState(""),f=d.toLowerCase(),g=f?l.filter(M=>M.name.toLowerCase().includes(f)||M.slug.toLowerCase().includes(f)):l;let h;e[2]!==c?(h=function(){c&&m(""),u(Fi)},e[2]=c,e[3]=h):h=e[3];const x=h;let p;e[4]!==d||e[5]!==c||e[6]!==x?(p=c?s.jsx("input",{autoFocus:!0,type:"text",value:d,onChange:M=>m(M.target.value),onKeyDown:M=>M.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=d,e[5]=c,e[6]=x,e[7]=p):p=e[7];let v;e[8]!==c?(v=c?s.jsx(Ws,{size:16}):s.jsx(Rs,{size:16}),e[8]=c,e[9]=v):v=e[9];let b;e[10]!==v||e[11]!==x?(b=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:v}),e[10]=v,e[11]=x,e[12]=b):b=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ce,{size:16}),e[13]=_):_=e[13];let j;e[14]!==o?(j=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:_}),e[14]=o,e[15]=j):j=e[15];let y;e[16]!==b||e[17]!==j?(y=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,j]}),e[16]=b,e[17]=j,e[18]=y):y=e[18];let N;e[19]!==p||e[20]!==y?(N=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[p,y]}),e[19]=p,e[20]=y,e[21]=N):N=e[21];const C="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let $;e[22]!==r||e[23]!==n?($=M=>s.jsxs("button",{type:"button",onClick:()=>r(M.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",M.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Di,{org:M,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:M.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.slug})]}),M.slug===n&&s.jsx(Ks,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},M.id),e[22]=r,e[23]=n,e[24]=$):$=e[24];const A=g.map($);let P;e[25]!==I||e[26]!==A?(P=s.jsxs("div",{className:C,children:[I,A]}),e[25]=I,e[26]=A,e[27]=P):P=e[27];let O;return e[28]!==P||e[29]!==N?(O=s.jsxs(s.Fragment,{children:[N,P]}),e[28]=P,e[29]=N,e[30]=O):O=e[30],O}function Fi(t){return!t}function gs(t){const e=S.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:u,onSelectOrg:d,onCreateOrg:m,close:f,isMobile:g,open:h}=t;if(g){const q=n?.name??"U";let J;e[0]!==q||e[1]!==r?(J=s.jsx(as,{url:r,fallback:q,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=q,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Hi)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(cs,{size:14}),e[12]=Ie):Ie=e[12];let ze;e[13]!==le?(ze=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(We,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let he;e[16]!==ze?(he=s.jsx(ns,{delayDuration:300,children:s.jsxs(qe,{children:[ze,Pe]})}),e[16]=ze,e[17]=he):he=e[17];let Ee;e[18]!==he||e[19]!==J||e[20]!==ie?(Ee=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Ee):Ee=e[21];const mt=String(h);let Re;e[22]!==m||e[23]!==d||e[24]!==u||e[25]!==mt?(Re=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(ps,{orgParam:u,onSelectOrg:d,onCreateOrg:m},mt)}),e[22]=m,e[23]=d,e[24]=u,e[25]=mt,e[26]=Re):Re=e[26];let De;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],De=o.map(de),e[27]=f,e[28]=o,e[29]=De}else De=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==De||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[De,Me]}),e[35]=De,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==Re||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Re,ae]}),e[38]=Re,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let de;e[45]!==l.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=l.theme,e[46]=c,e[47]=de):de=e[47],Ge=a.map(de),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Bi),e[50]=c,e[51]=be):be=e[51];const je=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==l.enableSounds?(pe=l.enableSounds?s.jsx(rs,{size:14}):s.jsx(os,{size:14}),e[54]=l.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Le;e[61]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.26.2"]}),e[61]=Le):Le=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Le]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Be;return e[67]!==Ee||e[68]!==Fe||e[69]!==ve?(Be=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Ee,Fe,ve]}),e[67]=Ee,e[68]=Fe,e[69]=ve,e[70]=Be):Be=e[70],Be}const x=n?.name??"U";let p;e[71]!==x||e[72]!==r?(p=s.jsx(as,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=p):p=e[73];const v=n?.name??"User";let b;e[74]!==v?(b=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=b):b=e[75];const _=n?.email;let j;e[76]!==_?(j=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_}),e[76]=_,e[77]=j):j=e[77];let y;e[78]!==b||e[79]!==j?(y=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,j]}),e[78]=b,e[79]=j,e[80]=y):y=e[80];let N;e[81]!==n?(N=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Li)},e[81]=n,e[82]=N):N=e[82];let C;e[83]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(cs,{size:14}),e[83]=C):C=e[83];let I;e[84]!==N?(I=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:N,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:C})}),e[84]=N,e[85]=I):I=e[85];let $;e[86]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(We,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=$):$=e[86];let A;e[87]!==I?(A=s.jsx(ns,{delayDuration:300,children:s.jsxs(qe,{children:[I,$]})}),e[87]=I,e[88]=A):A=e[88];let P;e[89]!==A||e[90]!==p||e[91]!==y?(P=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[p,y,A]}),e[89]=A,e[90]=p,e[91]=y,e[92]=P):P=e[92];let O;if(e[93]!==f||e[94]!==o){let q;e[96]!==f?(q=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=q):q=e[97],O=o.map(q),e[93]=f,e[94]=o,e[95]=O}else O=e[95];let M;e[98]!==f||e[99]!==i?(M=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=M):M=e[100];let w;e[101]!==O||e[102]!==M?(w=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,M]}),e[101]=O,e[102]=M,e[103]=w):w=e[103];let D;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let q;e[108]!==l.theme||e[109]!==c?(q=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=l.theme,e[109]=c,e[110]=q):q=e[110],D=a.map(q),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=D}else D=e[107];let z;e[111]!==D?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:D}),e[111]=D,e[112]=z):z=e[112];const H=l.enableSounds?"Disable sounds":"Enable sounds";let F;e[113]!==c?(F=()=>c(Gi),e[113]=c,e[114]=F):F=e[114];const U=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let E;e[115]!==U?(E=K("size-7 rounded-md flex items-center justify-center transition-colors",U),e[115]=U,e[116]=E):E=e[116];let L;e[117]!==l.enableSounds?(L=l.enableSounds?s.jsx(rs,{size:14}):s.jsx(os,{size:14}),e[117]=l.enableSounds,e[118]=L):L=e[118];let G;e[119]!==H||e[120]!==F||e[121]!==E||e[122]!==L?(G=s.jsx("button",{type:"button","aria-label":H,onClick:F,className:E,children:L}),e[119]=H,e[120]=F,e[121]=E,e[122]=L,e[123]=G):G=e[123];let R;e[124]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.26.2"]}),e[124]=R):R=e[124];let V;e[125]!==G?(V=s.jsxs("div",{className:"flex items-center gap-2",children:[G,R]}),e[125]=G,e[126]=V):V=e[126];let W;e[127]!==z||e[128]!==V?(W=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,V]}),e[127]=z,e[128]=V,e[129]=W):W=e[129];let X;e[130]!==P||e[131]!==w||e[132]!==W?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[P,w,W]}),e[130]=P,e[131]=w,e[132]=W,e[133]=X):X=e[133];const re=String(h);let Y;e[134]!==m||e[135]!==d||e[136]!==u||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(ps,{orgParam:u,onSelectOrg:d,onCreateOrg:m},re)}),e[134]=m,e[135]=d,e[136]=u,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Gi(t){return{...t,enableSounds:!t.enableSounds}}function Li(){Ae.success("User ID copied")}function Bi(t){return{...t,enableSounds:!t.enableSounds}}function Hi(){Ae.success("User ID copied")}function Vt(){const t=S.c(44),{data:e}=Ne.useSession(),{org:n}=fe(),r=Oe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=qn(o)?.params.org,[l,c]=Yn(),u=Os(),[d,m]=T.useState(!1),[f,g]=T.useState(!1),h=e?.user,x=h?.image;let p;t[1]!==r?(p=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=p):p=t[2];const v=p;let b;t[3]===Symbol.for("react.memo_cache_sentinel")?(b=()=>m(!1),t[3]=b):b=t[3];const _=b;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pt,{size:16}),t[4]=j):j=t[4];let y;t[5]!==r||t[6]!==a?(y={key:"preferences",label:"Preferences",icon:j,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=y):y=t[7];let N;t[8]!==n||t[9]!==r?(N=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(fo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=N):N=t[10];let C;t[11]===Symbol.for("react.memo_cache_sentinel")?(C={key:"terms",label:"Terms of Use",icon:s.jsx(Nr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=C):C=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(jo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let $;t[13]===Symbol.for("react.memo_cache_sentinel")?($={key:"github",label:"decocms/studio",icon:s.jsx(Xn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=$):$=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(vo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P={key:"homepage",label:"Homepage",icon:s.jsx(xo,{size:16}),href:"https://decocms.com",external:!0},t[15]=P):P=t[15];let O;t[16]!==y||t[17]!==N?(O=[y,...N,C,I,$,A,P],t[16]=y,t[17]=N,t[18]=O):O=t[18];const M=O;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w={key:"logout",label:"Sign out",icon:s.jsx(ho,{size:16}),onClick:Ki},t[19]=w):w=t[19];const D=w;let z;t[20]===Symbol.for("react.memo_cache_sentinel")?(z={value:"light",icon:s.jsx(go,{size:14}),label:"Light theme"},t[20]=z):z=t[20];let H;t[21]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:s.jsx(bo,{size:14}),label:"Dark theme"},t[21]=H):H=t[21];let F;t[22]===Symbol.for("react.memo_cache_sentinel")?(F=[z,H,{value:"system",icon:s.jsx(po,{size:14}),label:"System theme"}],t[22]=F):F=t[22];const U=F;let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{m(!1),g(!0)},t[23]=E):E=t[23];let L;t[24]!==v||t[25]!==u||t[26]!==M||t[27]!==d||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==h||t[32]!==x?(L={user:h,userImage:x,menuItems:M,signOutItem:D,themeOptions:U,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:E,close:_,isMobile:u,open:d},t[24]=v,t[25]=u,t[26]=M,t[27]=d,t[28]=a,t[29]=l,t[30]=c,t[31]=h,t[32]=x,t[33]=L):L=t[33];const G=L;let R;t[34]!==n||t[35]!==u||t[36]!==d||t[37]!==G?(R=u?s.jsxs(zs,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Kt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(Ps,{className:"h-[80dvh] p-0",children:[s.jsx(Es,{className:"sr-only",children:"Account"}),s.jsx(gs,{...G})]})]}):s.jsxs(Et,{open:d,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Kt(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Rt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Ui,children:s.jsx(gs,{...G})})]}),t[34]=n,t[35]=u,t[36]=d,t[37]=G,t[38]=R):R=t[38];let V;t[39]!==f?(V=s.jsx(Pi,{open:f,onOpenChange:g}),t[39]=f,t[40]=V):V=t[40];let W;return t[41]!==R||t[42]!==V?(W=s.jsxs(s.Fragment,{children:[R,V]}),t[41]=R,t[42]=V,t[43]=W):W=t[43],W}function Ui(t){return t.preventDefault()}function Ki(){Z("signed_out",{source:"account_popover"}),Qn(),Ne.signOut()}function Vi({invitation:t}){const[e,n]=T.useState(!1),[r,o]=T.useState(!1),i=Jn(),a=async()=>{n(!0);try{const u=await Ne.organization.acceptInvitation({invitationId:t.id});if(u.error){Ae.error(u.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),er();let c;try{c=(await Ne.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Ne.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Ks,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Ws,{size:14})})]})]})}function Wi(t){const e=S.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Zt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=u):u=e[9];let d;return e[10]!==o||e[11]!==i||e[12]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,u]}),e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function qi(){const t=T.useContext(tr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function ln(){const t=S.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Kr(),o=qi();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Qi).map(Xi);let u;t[3]!==e?(u=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=u):u=t[4];const d=[...Vr].sort(Yi).map(u);i=[...c,...d],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Yi(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Xi(t){return{type:"invitation",invitation:t}}function Qi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class an extends T.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function cn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Zi(){const t=S.c(25),e=Oe(),{org:n}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:Dt,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=Ft(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let a;t[4]!==o?(a={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Ji},t[4]=o,t[5]=a):a=t[5];const{data:l,isPending:c,isError:u}=Ys(a),d=l?.balanceCents!=null?l.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let g;t[10]!==d?(g=K(d!=null&&cn(d)),t[10]=d,t[11]=g):g=t[11];let h;t[12]!==e||t[13]!==n.slug?(h=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=h):h=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fs,{}),t[15]=x):x=t[15];let p;t[16]!==d?(p=d!=null?`$${d.toFixed(2)}`:"Credits",t[16]=d,t[17]=p):p=t[17];let v;t[18]!==p?(v=s.jsx("span",{children:p}),t[18]=p,t[19]=v):v=t[19];let b;return t[20]!==g||t[21]!==h||t[22]!==v||t[23]!==f?(b=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:f,className:g,onClick:h,children:[x,v]})})}),t[20]=g,t[21]=h,t[22]=v,t[23]=f,t[24]=b):b=t[24],b}function Ji(t){return t.structuredContent}function el(){const t=S.c(1);if(!Xs().some(tl))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Zi,{}),t[0]=r):r=t[0],r}function tl(t){return t.providerId==="deco"}function sl(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(an,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(el,{})})}),t[0]=e):e=t[0],e}function nl(){const t=S.c(25),e=Oe(),{org:n}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:Dt,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=Ft(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let a;t[4]!==o?(a={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:rl},t[4]=o,t[5]=a):a=t[5];const{data:l,isPending:c,isError:u}=Ys(a),d=l?.balanceCents!=null?l.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let g;t[10]!==e||t[11]!==n.slug?(g=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[10]=e,t[11]=n.slug,t[12]=g):g=t[12];let h;t[13]!==d?(h=K(d!=null&&cn(d)),t[13]=d,t[14]=h):h=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fs,{className:"size-4"}),t[15]=x):x=t[15];let p;t[16]!==g||t[17]!==h||t[18]!==f?(p=s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":f,onClick:g,className:h,children:x})}),t[16]=g,t[17]=h,t[18]=f,t[19]=p):p=t[19];let v;t[20]!==f?(v=s.jsx(We,{side:"top",children:f}),t[20]=f,t[21]=v):v=t[21];let b;return t[22]!==p||t[23]!==v?(b=s.jsxs(qe,{delayDuration:300,children:[p,v]}),t[22]=p,t[23]=v,t[24]=b):b=t[24],b}function rl(t){return t.structuredContent}function ol(){const t=S.c(1);if(!Xs().some(il))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(nl,{}),t[0]=r):r=t[0],r}function il(t){return t.providerId==="deco"}function ll(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(an,{children:s.jsx(T.Suspense,{fallback:null,children:s.jsx(ol,{})})}),t[0]=e):e=t[0],e}function dn(t){const e=S.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=ln(),[i,a]=T.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=p=>p.type==="release"&&p.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,u=c?.type==="release"?c.release:null;let d;e[5]!==o?(d=x=>{a(x),o(x)},e[5]=o,e[6]=d):d=e[6];const m=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==u?(g=s.jsx(Rt,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:u?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(Ro,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:u.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Wr,{release:u})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Qt,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Vi,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Wi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=u,e[11]=g):g=e[11];let h;return e[12]!==n||e[13]!==g?(h=s.jsxs(Et,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=h):h=e[14],h}function un(){const{redDotCount:t}=ln();return t>0}function al(){const t=S.c(6),e=un();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Qt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(dn,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function cl(){const t=S.c(8),e=un();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Qt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(ut,{asChild:!0,children:s.jsx(Ve,{asChild:!0,children:s.jsxs(we,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(We,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(dn,{children:s.jsxs(qe,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function dl(){const t=S.c(3),[e,n]=T.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Vs,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(qs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function ul(){const t=S.c(3),[e,n]=T.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(qe,{delayDuration:300,children:[s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Vs,{className:"size-4"})})}),s.jsx(We,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(qs,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function ml(){const t=S.c(7),e=Oe(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function fl(){const t=S.c(9),e=Oe(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Ve,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(We,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(qe,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function xl(){const t=S.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(sl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(dl,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(al,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(ml,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Ut,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(xe,{children:s.jsx(Vt,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ut,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Vt,{})})})}),s.jsx(fl,{}),s.jsx(cl,{}),s.jsx(ul,{}),s.jsx(ll,{})]})}),t[5]=r):r=t[5],r}function hl(){const t=S.c(8),e=Oe(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Vt,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Ut,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function pl(t,e){return t.filter(n=>!(e.ownerUserId!==void 0&&n.created_by!==e.ownerUserId||e.hasTrigger!==void 0&&!!n.trigger_id!==e.hasTrigger||!!n.hidden!==e.hidden))}function gl(t){const e=S.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(bl,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Zs,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function bl(t){const e=S.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Te,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Te,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function jl(t){const e=S.c(39),{open:n,onOpenChange:r}=t,[o,i]=T.useState(""),{org:a}=fe(),{setTaskId:l}=Bs();let c;e[0]!==a.id||e[1]!==a.slug?(c={connectionId:Dt,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=c):c=e[2];const u=Ft(c);let d,m,f;e[3]!==a.id||e[4]!==o?(f=o.trim(),m=Xt,d=Yt.globalSearch(a.id,f),e[3]=a.id,e[4]=o,e[5]=d,e[6]=m,e[7]=f):(d=e[5],m=e[6],f=e[7]);const g=n&&f.length>0;let h;e[8]!==u||e[9]!==f?(h=async()=>{if(!u)throw new Error("MCP client unavailable");const w=await u.callTool({name:"GLOBAL_SEARCH",arguments:{query:f,limit:20}});return w.structuredContent??w},e[8]=u,e[9]=f,e[10]=h):h=e[10];let x;e[11]!==d||e[12]!==g||e[13]!==h?(x={queryKey:d,enabled:g,queryFn:h,staleTime:1e4},e[11]=d,e[12]=g,e[13]=h,e[14]=x):x=e[14];const{data:p,isFetching:v}=m(x);let b;e[15]!==p?.items?(b=p?.items??[],e[15]=p?.items,e[16]=b):b=e[16];const _=b;let j;e[17]!==r?(j=w=>{w||i(""),r(w)},e[17]=r,e[18]=j):j=e[18];const y=j;let N;e[19]!==y||e[20]!==l?(N=w=>{y(!1),l(w.id,w.virtual_mcp_id??void 0)},e[19]=y,e[20]=l,e[21]=N):N=e[21];const C=N;let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(Zo,{className:"sr-only",children:[s.jsx(Jo,{children:"Search"}),s.jsx(ei,{children:"Search across your organization's resources."})]}),e[22]=I):I=e[22];let $;e[23]!==o?($=s.jsx(oi,{value:o,onValueChange:i,placeholder:"Search..."}),e[23]=o,e[24]=$):$=e[24];let A;e[25]!==C||e[26]!==v||e[27]!==_||e[28]!==f?(A=f?v&&_.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):_.length===0?s.jsx(ni,{children:"No results."}):_.map(w=>w.type==="thread"?s.jsxs(ri,{value:`thread:${w.id}:${w.title}`,onSelect:()=>C(w),className:"gap-2.5",children:[s.jsx(gl,{virtualMcpId:w.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[25]=C,e[26]=v,e[27]=_,e[28]=f,e[29]=A):A=e[29];let P;e[30]!==A?(P=s.jsx(ii,{children:A}),e[30]=A,e[31]=P):P=e[31];let O;e[32]!==$||e[33]!==P?(O=s.jsxs(ti,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[I,s.jsxs(li,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[$,P]})]}),e[32]=$,e[33]=P,e[34]=O):O=e[34];let M;return e[35]!==y||e[36]!==n||e[37]!==O?(M=s.jsx(si,{open:n,onOpenChange:y,children:O}),e[35]=y,e[36]=n,e[37]=O,e[38]=M):M=e[38],M}function vl(t){return t==="owner"||t==="admin"}function yl(){const t=S.c(11),{locator:e}=fe(),n=ai(),{data:r}=Ne.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=Yt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:u}=Xt(c);let d;if(t[8]!==u?.data?.members||t[9]!==o){const f=(u?.data?.members??[]).find(g=>g.userId===o)?.role;d=vl(f??void 0),t[8]=u?.data?.members,t[9]=o,t[10]=d}else d=t[10];return d}var Jt="ContextMenu",[_l]=dr(Jt,[Ms]),ce=Ms(),[Sl,mn]=_l(Jt),fn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=T.useState(!1),c=ce(e),u=ar(r),d=T.useCallback(m=>{l(m),u(m)},[u]);return s.jsx(Sl,{scope:e,open:a,onOpenChange:d,modal:i,children:s.jsx(cr,{...c,dir:o,open:a,onOpenChange:d,modal:i,children:n})})};fn.displayName=Jt;var xn="ContextMenuTrigger",hn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=mn(xn,n),a=ce(n),l=T.useRef({x:0,y:0}),c=T.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),u=T.useRef(0),d=T.useCallback(()=>window.clearTimeout(u.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return T.useEffect(()=>d,[d]),T.useEffect(()=>{r&&d()},[r,d]),s.jsxs(s.Fragment,{children:[s.jsx(sr,{...a,virtualRef:c}),s.jsx(nr.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{d(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{d(),u.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(d)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(d)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(d))})]})});hn.displayName=xn;var Cl="ContextMenuPortal",pn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(ir,{...r,...n})};pn.displayName=Cl;var gn="ContextMenuContent",bn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=mn(gn,n),i=ce(n),a=T.useRef(!1);return s.jsx(lr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bn.displayName=gn;var Nl="ContextMenuGroup",wl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});wl.displayName=Nl;var kl="ContextMenuLabel",Il=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Il.displayName=kl;var Ml="ContextMenuItem",jn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(rr,{...o,...r,ref:e})});jn.displayName=Ml;var Al="ContextMenuCheckboxItem",$l=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});$l.displayName=Al;var Tl="ContextMenuRadioGroup",Ol=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e})});Ol.displayName=Tl;var zl="ContextMenuRadioItem",Pl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(hr,{...o,...r,ref:e})});Pl.displayName=zl;var El="ContextMenuItemIndicator",Rl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(pr,{...o,...r,ref:e})});Rl.displayName=El;var Dl="ContextMenuSeparator",vn=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(or,{...o,...r,ref:e})});vn.displayName=Dl;var Fl="ContextMenuArrow",Gl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(gr,{...o,...r,ref:e})});Gl.displayName=Fl;var Ll="ContextMenuSubTrigger",Bl=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(br,{...o,...r,ref:e})});Bl.displayName=Ll;var Hl="ContextMenuSubContent",Ul=T.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(jr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ul.displayName=Hl;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Kl=fn,Vl=hn,Wl=pn,ql=bn,Yl=jn,Xl=vn;function yn(t){const e=S.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Kl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function _n(t){const e=S.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Vl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Sn(t){const e=S.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Wl,{children:s.jsx(ql,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=S.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(Yl,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function bs(t){const e=S.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Xl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function Cn(t){const e=S.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,onHideGroup:c}=t;let u;e[0]!==i||e[1]!==n?(u=()=>i(n),e[0]=i,e[1]=n,e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ce,{size:14,className:"mr-2"}),e[3]=d):d=e[3];let m;e[4]!==u?(m=s.jsxs(It,{onSelect:u,children:[d,"New task"]}),e[4]=u,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let h;e[10]!==f?(h=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(bs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Gr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let p;e[17]!==r||e[18]!==c||e[19]!==n?(p=!r&&s.jsxs(s.Fragment,{children:[s.jsx(bs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(Do,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=p):p=e[20];let v;return e[21]!==m||e[22]!==h||e[23]!==x||e[24]!==p?(v=s.jsxs(s.Fragment,{children:[m,h,x,p]}),e[21]=m,e[22]=h,e[23]=x,e[24]=p,e[25]=v):v=e[25],v}function Ql(t){return t==="ephemeral"||t.startsWith("thread:")}const js=new Map;function Nn(t){let e=js.get(t);return e||(e={tick:0,subscribers:new Set,intervalId:null},js.set(t,e)),e}function Zl(t,e){const n=Nn(t);return n.subscribers.add(e),n.intervalId===null&&(n.intervalId=setInterval(()=>{n.tick+=1;for(const r of n.subscribers)r()},t)),()=>{n.subscribers.delete(e),n.subscribers.size===0&&n.intervalId!==null&&(clearInterval(n.intervalId),n.intervalId=null)}}function Jl(t){const e=S.c(3),n=t;let r,o;return e[0]!==n?(r=i=>Zl(n,i),o=()=>Nn(n).tick,e[0]=n,e[1]=r,e[2]=o):(r=e[1],o=e[2]),T.useSyncExternalStore(r,o,ea)}function ea(){return 0}function Gt(t){const e=S.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,u=mi(n.status),d=u.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=Fo(f),e[0]=f,e[1]=g):g=e[1];const h=g;Jl(6e4);const x=a||!!n.trigger_id,p=n.id,v="button",b=0;let _;e[2]!==o?(_=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),o())},e[2]=o,e[3]=_):_=e[3];const j=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let y;e[4]!==j?(y=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",j),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(N=l&&!m&&s.jsx(Te,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=N):N=e[10];let C;e[11]!==x?(C=x&&s.jsx(Zs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=C):C=e[12];const I=n.title||"Untitled task";let $;e[13]!==I?($=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[13]=I,e[14]=$):$=e[14];let A;e[15]!==$||e[16]!==C?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[C,$]}),e[15]=$,e[16]=C,e[17]=A):A=e[17];let P;e[18]!==h||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(P=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ql(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):h?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[h.owner,"/",h.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:xi(new Date(n.updated_at))})]}),e[18]=h,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=P):P=e[22];let O;e[23]!==A||e[24]!==P?(O=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,P]}),e[23]=A,e[24]=P,e[25]=O):O=e[25];const M="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(d,{size:14,className:K(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[26]!==i?(D=G=>{G.stopPropagation(),i()},e[26]=i,e[27]=D):D=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(vr,{size:14}),e[28]=z):z=e[28];let H;e[29]!==D?(H=s.jsx(Ve,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:D,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:z})}),e[29]=D,e[30]=H):H=e[30];let F;e[31]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(We,{side:"right",children:"Archive"}),e[31]=F):F=e[31];let U;e[32]!==H?(U=s.jsxs(qe,{children:[H,F]}),e[32]=H,e[33]=U):U=e[33];let E;e[34]!==w||e[35]!==U?(E=s.jsxs("div",{className:M,children:[w,U]}),e[34]=w,e[35]=U,e[36]=E):E=e[36];let L;return e[37]!==o||e[38]!==O||e[39]!==E||e[40]!==_||e[41]!==y||e[42]!==N||e[43]!==n.id?(L=s.jsxs("div",{"data-task-id":p,role:v,tabIndex:b,onClick:o,onKeyDown:_,className:y,children:[N,O,E]}),e[37]=o,e[38]=O,e[39]=E,e[40]=_,e[41]=y,e[42]=N,e[43]=n.id,e[44]=L):L=e[44],L}function es(t){const e=S.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(qt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function ta(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function sa(t){return t.member==="mine"&&!t.currentUserId}const wn=4;let At=0;const Wt=[];function na(){for(;At<wn&&Wt.length>0;){const t=Wt.shift();t&&t()}}function kn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,na()})};At<wn?r():Wt.push(r)})}const Lt=10;function vs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function ra(t,e,n,r){let o=0;for(const i of t)ts(i,e,n,r)&&o++;return o}function Ht(t,e,n,r){return ra(t,e,n,r)}function oa(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&ts(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function ia(t,e){return!!(t>=Lt||t===0&&e)}function ys(t,e){return t<e}function la(t,e){return e===!1?!1:e===!0?!0:t}function ts(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Ot=new Map,Mt=new Map;function aa(t,e){return e?t>=Lt?!0:null:!1}function _s(t){return Ot.get(t)}function ca(t,e){Ot.set(t,e)}function da(t,e,n){const r=Ot.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=kn(e).then(i=>(Ot.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function Ss(t){const e=t.structuredContent??t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Lt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ua(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||ts(a,n,r,o)&&i++;return i}function ss(t,e,n,r){const{org:o}=fe(),i=ta(o.id,t,e,n),a=sa(n),[l,c]=T.useState({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==i&&c({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:null,serverHasMore:null});const u=Hr(),{threads:d,hasMore:m}=Ls(),f=r??Ht(d,t,e,n),g=ia(f,m),h=aa(f,m),x=Ft({connectionId:Dt,orgId:o.id,orgSlug:o.slug});if(l.identity===i&&l.serverHasMore===null){const j=h??_s(i);j!==void 0&&c({isFetching:!1,isProbing:!1,identity:i,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:j})}!a&&l.identity===i&&l.serverHasMore===null&&h===null&&_s(i)===void 0&&l.probeSubscribedIdentity!==i&&(c(j=>j.identity===i?{...j,isProbing:!0,probeSubscribedIdentity:i}:j),da(i,async()=>{const j=vs(t,e,0,n,1),y=await x.callTool({name:"COLLECTION_THREADS_LIST",arguments:j});if(y.isError)throw new Error(is(y,"COLLECTION_THREADS_LIST failed"));const{totalCount:N}=Ss(y),C=Ht(u.threads.get(),t,e,n);return N===void 0?!1:ys(C,N)},j=>{c(y=>y.identity!==i?y:{...y,isProbing:!1,serverHasMore:j})}));async function v(){if(l.isFetching||l.isProbing||a)return;const j=i;c(y=>y.identity===j?{...y,isFetching:!0}:y);try{const y=Ht(d,t,e,n),N=vs(t,e,y,n,Lt),C=await kn(()=>x.callTool({name:"COLLECTION_THREADS_LIST",arguments:N}));if(C.isError)throw new Error(is(C,"COLLECTION_THREADS_LIST failed"));const{items:I,hasMore:$,totalCount:A}=Ss(C),P=new Set(d.map(w=>w.id)),O=ua(I,P,t,e,n),M=y;u.mergeThreads(I),c(w=>{if(w.identity!==j)return w;let D;return A!==void 0?D=ys(M+O,A):D=I.length===0||O===0?!1:$,ca(j,D),{...w,isFetching:!1,serverHasMore:D}})}catch(y){const N=y instanceof Error?y.message:String(y);Ae.error(`Could not load more tasks: ${N}`),c(C=>C.identity===j?{...C,isFetching:!1}:C)}}const b=l.isFetching||l.isProbing;return{hasMore:!a&&!b&&la(g,l.serverHasMore),isFetching:b,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:v}}function In(t){const e=S.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:u,onHideGroup:d,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:h,groupVisibleCount:x}=t,p=m===void 0?!1:m,v=f===void 0?!1:f,b=ht(n),_=r[0];let j;e[0]!==_||e[1]!==c||e[2]!==a||e[3]!==n?(j=()=>{_?a(_):c(n)},e[0]=_,e[1]=c,e[2]=a,e[3]=n,e[4]=j):j=e[4];const y=j,N=h?.isDragging?!1:void 0;let C;e[5]!==h?.isDragging||e[6]!==n?(C=q=>{h?.isDragging||q&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=h?.isDragging,e[6]=n,e[7]=C):C=e[7];const I=!!(_&&o&&_.id===o),$=h?"Drag to reorder":void 0;let A;e[8]!==h?(A=h?{...h.attributes,...h.listeners}:{},e[8]=h,e[9]=A):A=e[9];const P=h&&"cursor-pointer active:cursor-grabbing touch-none",O=h?.isDragging&&"cursor-grabbing";let M;e[10]!==O||e[11]!==P?(M=K("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",P,O),e[10]=O,e[11]=P,e[12]=M):M=e[12];const w=b?.icon??null,D=b?.title??"?";let z;e[13]!==w||e[14]!==D?(z=s.jsx(Te,{icon:w,name:D,size:"sm+",className:"rounded-lg"}),e[13]=w,e[14]=D,e[15]=z):z=e[15];let H;e[16]!==y||e[17]!==M||e[18]!==z||e[19]!==I||e[20]!==$||e[21]!==A?(H=s.jsx(xe,{children:s.jsx(_n,{asChild:!0,children:s.jsx(ci,{asChild:!0,children:s.jsx(ke,{onClick:y,isActive:I,title:$,...A,className:M,children:z})})})}),e[16]=y,e[17]=M,e[18]=z,e[19]=I,e[20]=$,e[21]=A,e[22]=H):H=e[22];const F=g??ma;let U;e[23]!==v||e[24]!==p||e[25]!==d||e[26]!==c||e[27]!==u||e[28]!==F||e[29]!==n?(U=s.jsx(Sn,{className:"w-56",children:s.jsx(Cn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:u,onToggleOrgPin:F,onHideGroup:d})}),e[23]=v,e[24]=p,e[25]=d,e[26]=c,e[27]=u,e[28]=F,e[29]=n,e[30]=U):U=e[30];let E;e[31]!==H||e[32]!==U?(E=s.jsxs(yn,{children:[H,U]}),e[31]=H,e[32]=U,e[33]=E):E=e[33];const L=b?.title??"Agent";let G;e[34]!==L?(G=s.jsx("span",{className:"truncate",children:L}),e[34]=L,e[35]=G):G=e[35];let R;e[36]!==c||e[37]!==n?(R=()=>c(n),e[36]=c,e[37]=n,e[38]=R):R=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Ce,{size:14}),e[39]=V):V=e[39];let W;e[40]!==R?(W=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:R,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:V}),e[40]=R,e[41]=W):W=e[41];let X;e[42]!==G||e[43]!==W?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,W]}),e[42]=G,e[43]=W,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(re=s.jsx(fa,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(di,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==E||e[57]!==Y||e[58]!==N||e[59]!==C?(oe=s.jsxs(ui,{open:N,openDelay:120,closeDelay:150,onOpenChange:C,children:[E,Y]}),e[56]=E,e[57]=Y,e[58]=N,e[59]=C,e[60]=oe):oe=e[60],oe}function ma(){}function fa(t){const e=S.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,u=ss("agent",n,i,a);let d;return e[0]!==o||e[1]!==c||e[2]!==l||e[3]!==u||e[4]!==r?(d=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!u.hasMore&&!u.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Gt,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(u.hasMore||u.isFetching)&&s.jsx(es,{onClick:()=>{u.loadMore()},isFetching:u.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=u,e[4]=r,e[5]=d):d=e[5],d}function xa(t,e,n,r,o,i,a){const l=S.c(18),c=a===void 0?"expanded":a;let u;l[0]===Symbol.for("react.memo_cache_sentinel")?(u={activationConstraint:{distance:8}},l[0]=u):u=l[0];let d;l[1]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:Ho},l[1]=d):d=l[1];const m=Go(ds(Bo,u),ds(Lo,d));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=Qr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let h;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(h=v=>{const{active:b,over:_}=v;if(!_||b.id===_.id)return;const j=String(b.id),y=String(_.id);if(!Zr(j,y,o))return;const N=Jr(g,j,y),C=eo(e,n,o,N);e==="org"?to(n.orgId,C):so(n,C),Z("sidebar_group_reordered",{virtual_mcp_id:j,over_virtual_mcp_id:y,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=h):h=l[13];const x=h;let p;return l[14]!==x||l[15]!==m||l[16]!==g?(p={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=p):p=l[17],p}function ha(t){const e=S.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function pa(t){const e=S.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:a,setNodeRef:l,transform:c,transition:u,isDragging:d}=qo(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==d||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==u){const g={transform:Yo.Transform.toString(c),transition:u,zIndex:d?100:void 0};m=r({setNodeRef:l,style:g,isDragging:d,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=d,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Cs(t){const e=S.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:u,renderSortable:d,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:h}=xa(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let p;if(e[0]!==r||e[1]!==m||e[2]!==u||e[3]!==d||e[4]!==g){let _;e[6]!==m||e[7]!==u||e[8]!==d||e[9]!==g?(_=j=>{const y=u(j);return g.includes(j.virtualMcpId)?s.jsx(pa,{id:j.virtualMcpId,children:N=>{const{setNodeRef:C,style:I,isDragging:$,attributes:A,listeners:P}=N;return s.jsx("div",{ref:C,style:I,className:K($&&"opacity-50"),children:d(y,{attributes:A,listeners:P,isDragging:$})})}},j.virtualMcpId):s.jsx("div",{children:m(y)},j.virtualMcpId)},e[6]=m,e[7]=u,e[8]=d,e[9]=g,e[10]=_):_=e[10],p=r.map(_),e[0]=r,e[1]=m,e[2]=u,e[3]=d,e[4]=g,e[5]=p}else p=e[5];let v;e[11]!==x||e[12]!==p?(v=s.jsx(Uo,{items:x,strategy:Ko,children:p}),e[11]=x,e[12]=p,e[13]=v):v=e[13];let b;return e[14]!==h||e[15]!==f||e[16]!==v?(b=s.jsx(Vo,{sensors:f,collisionDetection:Wo,onDragEnd:h,children:v}),e[14]=h,e[15]=f,e[16]=v,e[17]=b):b=e[17],b}function Mn(t){const e=S.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:u,renderSortable:d,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==u||e[8]!==d||e[9]!==l){const{decopilot:g,orgPinned:h,user:x,toolCallRuns:p}=no(n,o,i),v=h.length>0&&x.length>0;let b;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==u||e[17]!==d||e[18]!==l?(b={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:u,renderSortable:d,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=u,e[17]=d,e[18]=l,e[19]=b):b=e[19];const _=b;let j;e[20]!==c||e[21]!==v?(j=v&&s.jsx(ha,{collapsed:c}),e[20]=c,e[21]=v,e[22]=j):j=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(u(g)),s.jsx(Cs,{section:"org",groups:h,..._}),j,s.jsx(Cs,{section:"user",groups:x,..._}),p&&m(u(p))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=u,e[8]=d,e[9]=l,e[10]=f}else f=e[10];return f}function ga(t){const e=S.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Mn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:ja,renderSortable:ba}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ba(t,e){return s.jsx(In,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function ja(t){return s.jsx(In,{...t},t.virtualMcpId)}const va="sidebar.group.expanded.";function An(t,e){const n=S.c(3),[r,o]=yr(`${va}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function $n(t){const e=S.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:u,isOrgPinned:d,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:h,sortable:x}=t,p=d===void 0?!1:d,v=m===void 0?!1:m,[b,_]=An(n,!1),j=n===Hs,y=x?.isDragging??!1;let N;e[0]!==b||e[1]!==_?(N=function(){_(!b)},e[0]=b,e[1]=_,e[2]=N):N=e[2];const C=N;let I;e[3]!==j||e[4]!==x?(I=x&&!j?{...x.attributes,...x.listeners}:{},e[3]=j,e[4]=x,e[5]=I):I=e[5];let $;e[6]!==C?($=R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),C())},e[6]=C,e[7]=$):$=e[7];const A=x&&!j&&"touch-none active:cursor-grabbing",P=y&&"shadow-md bg-accent/40 cursor-grabbing";let O;e[8]!==A||e[9]!==P?(O=K("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",A,P),e[8]=A,e[9]=P,e[10]=O):O=e[10];let M;e[11]!==j||e[12]!==n?(M=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(_a,{virtualMcpId:n,isToolCallRuns:j})}),e[11]=j,e[12]=n,e[13]=M):M=e[13];let w;e[14]!==b?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:b?s.jsx(Js,{size:14}):s.jsx(Zt,{size:14})}),e[14]=b,e[15]=w):w=e[15];let D;e[16]!==w||e[17]!==M?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[M,w]}),e[16]=w,e[17]=M,e[18]=D):D=e[18];let z;e[19]!==j||e[20]!==n?(z=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:j})}),e[19]=j,e[20]=n,e[21]=z):z=e[21];let H;e[22]!==j||e[23]!==l||e[24]!==n?(H=!j&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:R=>{R.stopPropagation(),l(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ce,{size:14})}),e[22]=j,e[23]=l,e[24]=n,e[25]=H):H=e[25];let F;e[26]!==b||e[27]!==C||e[28]!==D||e[29]!==z||e[30]!==H||e[31]!==I||e[32]!==$||e[33]!==O?(F=s.jsxs("div",{...I,role:"button",tabIndex:0,"aria-expanded":b,onClick:C,onKeyDown:$,className:O,children:[D,z,H]}),e[26]=b,e[27]=C,e[28]=D,e[29]=z,e[30]=H,e[31]=I,e[32]=$,e[33]=O,e[34]=F):F=e[34];const U=F;let E;e[35]!==v||e[36]!==U||e[37]!==p||e[38]!==j||e[39]!==u||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(E=j?U:s.jsxs(yn,{children:[s.jsx(_n,{asChild:!0,children:U}),s.jsx(Sn,{className:"w-56",children:s.jsx(Cn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??ya,onHideGroup:u})})]}),e[35]=v,e[36]=U,e[37]=p,e[38]=j,e[39]=u,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=E):E=e[44];let L;e[45]!==o||e[46]!==b||e[47]!==g||e[48]!==h||e[49]!==j||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(L=b&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:j?r.map(R=>s.jsx(Gt,{task:R,isActive:o===R.id,onClick:()=>i(R),onArchive:()=>a(R),showAutomationBadge:!!R.trigger_id},R.id)):s.jsx(wa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:h})}),e[45]=o,e[46]=b,e[47]=g,e[48]=h,e[49]=j,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=L):L=e[55];let G;return e[56]!==E||e[57]!==L?(G=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[E,L]}),e[56]=E,e[57]=L,e[58]=G):G=e[58],G}function ya(){}function _a(t){const e=S.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Te,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Sa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Sa(t){const e=S.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Te,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Te,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function Ca(t){const e=S.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Na,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Na(t){const e=S.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function wa(t){const e=S.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:u}=t,d=ss("agent",n,c,u),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:h}=d,[x,p]=T.useState(!1);!x&&r.length===0&&h===!0&&!m&&!f&&(p(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=d;let b;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(b=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ce,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(_=>s.jsx(Gt,{task:_,isActive:o===_.id,onClick:()=>i(_),onArchive:()=>a(_),showAutomationBadge:!!_.trigger_id},_.id)),(v||m)&&s.jsx(es,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=b):b=e[9],b}function ka(t){const e=S.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:u,loadMore:d,hasMore:m,serverHasMore:f}=ss("status",n,l),[g,h]=T.useState(!1);!g&&r.length===0&&f===!0&&!c&&!u&&(h(!0),queueMicrotask(()=>{d()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let b;e[5]!==o||e[6]!==a||e[7]!==i?(b=_=>s.jsx(Gt,{task:_,isActive:o===_.id,onClick:()=>i(_),onArchive:()=>a(_),showAutomationBadge:!!_.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},_.id),e[5]=o,e[6]=a,e[7]=i,e[8]=b):b=e[8],x=r.map(b),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let p;e[9]!==m||e[10]!==c||e[11]!==d?(p=(m||c)&&s.jsx(es,{onClick:()=>{d()},isFetching:c}),e[9]=m,e[10]=c,e[11]=d,e[12]=p):p=e[12];let v;return e[13]!==x||e[14]!==p?(v=s.jsxs(s.Fragment,{children:[x,p]}),e[13]=x,e[14]=p,e[15]=v):v=e[15],v}function Ia(t){const e=S.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=fi[n],u=c.icon,[d,m]=An(`status-${n}`,!1);let f;e[0]!==d||e[1]!==m?(f=function(){m(!d)},e[0]=d,e[1]=m,e[2]=f):f=e[2];const g=f;let h;e[3]!==g?(h=C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),g())},e[3]=g,e[4]=h):h=e[4];let x;e[5]!==u||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(u,{size:12,className:c.iconClassName})}),e[5]=u,e[6]=c.iconClassName,e[7]=x):x=e[7];let p;e[8]!==d?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:d?s.jsx(Js,{size:14}):s.jsx(Zt,{size:14})}),e[8]=d,e[9]=p):p=e[9];let v;e[10]!==x||e[11]!==p?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=v):v=e[12];let b;e[13]!==c.label?(b=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=b):b=e[14];let _;e[15]!==r.length?(_=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=_):_=e[16];let j;e[17]!==d||e[18]!==g||e[19]!==h||e[20]!==v||e[21]!==b||e[22]!==_?(j=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":d,onClick:g,onKeyDown:h,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,b,_]}),e[17]=d,e[18]=g,e[19]=h,e[20]=v,e[21]=b,e[22]=_,e[23]=j):j=e[23];let y;e[24]!==o||e[25]!==d||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(y=d&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(ka,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=d,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=y):y=e[31];let N;return e[32]!==j||e[33]!==y?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[j,y]}),e[32]=j,e[33]=y,e[34]=N):N=e[34],N}function Ma(t){const e=S.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Mn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:$a,renderSortable:Aa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function Aa(t,e){return s.jsx($n,{...t,sortable:e},t.virtualMcpId)}function $a(t){return s.jsx($n,{...t},t.virtualMcpId)}function Ta(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Oa(t,e,n,r,o){const i=S.c(5),a=Ta(t,e,r,o),[l,c]=T.useState("");l!==a&&(ro(t,e,n,r),c(a));let u;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(u=oo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=u):u=i[4],u}const Tn={all:"All tasks",manual:"Chats",automation:"Automation"},On={all:"All members",mine:"Mine only"},Ns={agent:"Agent",status:"Status"};function zn(){const t=S.c(92),{data:e}=Ne.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Ar(o.id).id,l=Ds().filter(Ha).map(Ba),c=yl(),u=$r();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={},t[0]=d):d=t[0];const[m,f]=T.useState(d),g=new Set(l),h={},x=[];let p;t[1]!==m?(p=Object.entries(m),t[1]=m,t[2]=p):p=t[2];for(const[k,B]of p)g.has(k)!==B?h[k]=B:x.push(k);x.length>0&&f(k=>{const B={...k};for(const ne of x)delete B[ne];return B});const v=new Set(l);for(const[k,B]of Object.entries(h))B?v.add(k):v.delete(k);const b=[...v],_=new Set(b),{threads:j}=Ls(),y=pl(j,{hidden:!1}),{hide:N}=Gs(),C=Oe(),{setTaskId:I,createNewTask:$}=Bs();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const O=Is(A).taskId??null,M=[...y].sort(La),[w,D]=T.useState("all"),[z,H]=T.useState("mine"),[F,U]=T.useState("agent"),[E,L]=T.useState(!1),[G,R]=T.useState(!1),[V,W]=T.useState(0),X=io(),re=V+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,q={type:w,member:z,currentUserId:n??null},J=oa(M,"agent",q),Q=Oa(oe,lo(M,i),i,b,re);let ee;t[7]!==n||t[8]!==z?(ee=k=>z==="mine"&&n?k.filter(B=>B.created_by===n):k,t[7]=n,t[8]=z,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==w?(se=k=>w==="automation"?k.filter(Ga):w==="manual"?k.filter(Fa):k,t[10]=w,t[11]=se):se=t[11];const ie=se,le=k=>{const B=k.id===O;if(N(k.id),!B)return;const ne=M.find(_e=>_e.id!==k.id&&_e.virtual_mcp_id===k.virtual_mcp_id);ne?I(ne.id,ne.virtual_mcp_id):C({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==$?(Ie=k=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:k}),$(k)},t[12]=$,t[13]=Ie):Ie=t[13];const ze=Ie,Pe=ao();let he;t[14]!==Pe?(he=k=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:k}),Pe(k,{search:{main:"instructions"}})},t[14]=Pe,t[15]=he):he=t[15];const Ee=he,mt=k=>{if(_.has(k))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:k});const B=Q.find(ne=>ne.virtualMcpId===k);if(B)for(const ne of B.threads)N(ne.id);uo(oe,k,b),W(Da)},Re=async(k,B)=>{if(c&&h[k]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:k,pinned:B}),f(ne=>({...ne,[k]:B}));try{await u.update.mutateAsync({id:k,data:{pinned:B}})}catch{mo(oe,k,!B),f(ne=>{const _e={...ne};return delete _e[k],_e})}}},De=k=>{const B=k===i||k===Hs;return{isOrgPinned:_.has(k),canManageOrgPin:B?!1:c,onToggleOrgPin:B?void 0:Re}},Me=k=>{const B=ie(te(k.threads));return{virtualMcpId:k.virtualMcpId,threads:B,activeTaskId:O,filters:q,groupVisibleCount:J.get(k.virtualMcpId)??0,onSelectTask:ne=>I(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:ze,onShowSettings:Ee,onHideGroup:mt,...De(k.virtualMcpId)}},ae=w!=="all"||z!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let k;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=Rn=>{const Dn=ie(te(Rn.threads));return!(ae&&Dn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],k=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=k}else k=t[20];const B=k,ne=F==="agent"&&Q.length===0;let _e;t[25]!==ne?(_e=s.jsx(ls,{value:ne}),t[25]=ne,t[26]=_e):_e=t[26];let Nt;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Nt=()=>W(Ra),t[27]=Nt):Nt=t[27],s.jsxs(s.Fragment,{children:[_e,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ga,{groups:B,orderScope:oe,decopilotId:i,orgPinnedIds:b,onReorder:Nt,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=F==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(ls,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==L?(ue=()=>{Z("tasks_panel_search_opened"),R(!0),L(!0)},t[30]=L,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Lr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Le=Ns[F==="agent"?"status":"agent"];let ge;t[35]!==Le?(ge=Le.toLowerCase(),t[35]=Le,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Be=Ns[F];let de;t[37]!==Be?(de=Be.toLowerCase(),t[37]=Be,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==F?(ye=()=>{const k=F==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:k}),U(k)},Ue=F==="agent"?s.jsx(Qo,{size:16}):s.jsx(Br,{size:16}),t[39]=F,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Xo,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==z?(et=k=>{const B=k;B!==z&&Z("tasks_panel_member_filter_changed",{to_value:B}),H(B)},t[52]=z,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(ms,{size:"sm",className:"w-full",children:s.jsx(fs,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(On),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(us,{children:bt.map(Ea)}),t[56]=jt):jt=t[56];let tt;t[57]!==z||t[58]!==et?(tt=s.jsx(ws,{label:"Members",children:s.jsxs(xs,{value:z,onValueChange:et,children:[gt,jt]})}),t[57]=z,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==w?(st=k=>{const B=k;B!==w&&Z("tasks_panel_filter_changed",{to_value:B}),D(B)},t[60]=w,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(ms,{size:"sm",className:"w-full",children:s.jsx(fs,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(Tn),t[63]=yt):yt=t[63];let _t;t[64]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(us,{children:yt.map(Pa)}),t[64]=_t):_t=t[64];let nt;t[65]!==st||t[66]!==w?(nt=s.jsx(ws,{label:"Type",children:s.jsxs(xs,{value:w,onValueChange:st,children:[vt,_t]})}),t[65]=st,t[66]=w,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Rt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Et,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let St;t[78]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(en,{compact:!0}),t[78]=St):St=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,St]}),t[79]=it,t[80]=lt):lt=t[80];const En="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Bt=F==="status"?s.jsx(s.Fragment,{children:co(ie(te(M))).map(k=>s.jsx(Ia,{status:k.status,threads:k.threads,activeTaskId:O,onSelectTask:B=>I(B.id,B.virtual_mcp_id),onArchiveTask:le,filters:q},k.status))}):s.jsx(Ma,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:b,onReorder:()=>W(za),renderGroup:k=>({...Me(k)})});let at;t[81]!==Bt?(at=s.jsx("div",{className:En,children:Bt}),t[81]=Bt,t[82]=at):at=t[82];let ct;t[83]!==G||t[84]!==E||t[85]!==L?(ct=G&&s.jsx(jl,{open:E,onOpenChange:L}),t[83]=G,t[84]=E,t[85]=L,t[86]=ct):ct=t[86];let Ct;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Ct=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Ct):Ct=t[91],Ct}function za(t){return t+1}function Pa(t){return s.jsx(Qs,{value:t,children:Tn[t]},t)}function Ea(t){return s.jsx(Qs,{value:t,children:On[t]},t)}function Ra(t){return t+1}function Da(t){return t+1}function Fa(t){return!t.trigger_id}function Ga(t){return!!t.trigger_id}function La(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ba(t){return t.id}function Ha(t){return t.pinned}function ws(t){const e=S.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Ua=5,Ka=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Pn(){const t=S.c(3),{state:e}=Xe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ua}).map(qa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Se,{className:"size-6 rounded-md"}),s.jsx(Se,{className:"size-6 rounded-md"}),s.jsx(Se,{className:"size-6 rounded-md"})]}),s.jsx(Se,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Ka.map(Va)})]}),t[2]=r):r=t[2],r}function Va(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(Se,{className:"size-5 rounded-full shrink-0"}),s.jsx(Se,{className:K("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Wa)})]},e)}function Wa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Se,{className:"h-3 flex-1 rounded-sm"})},e)}function qa(t,e){return s.jsx(Se,{className:"size-10 rounded-lg mx-auto"},e)}function qc(){const t=S.c(4),e=tn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(As,{children:s.jsxs(T.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(Pn,{})]}),children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(zn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Us,{children:s.jsx(rn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Yc(t){const e=S.c(5),{onClose:n}=t,r=tn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(hl,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(As,{children:s.jsxs(T.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(Pn,{})]}),children:[s.jsx(Tt,{className:"mb-2"}),s.jsx(zn,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Us,{children:s.jsx(Oi,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function Xc(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(qt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{_n as C,qc as S,Yc as a,Xc as b,It as c,bs as d,Sn as e,yn as f};
@@ -1 +0,0 @@
1
- import{q as D,r as v,j as e,B as p,t as S,o as c,e as N}from"./index-biiHZ5l9.js";import{D as k}from"./domain-settings-DHsRsnmX.js";import{P as f}from"./index-r7-3fAFf.js";import{I as l}from"./input-5PMMNPU9.js";import{S as z}from"./switch-D6SWnoi2.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-C1cJTBIx.js";import{c as q,S as y,a as C,b as r,d as O}from"./settings-section-V9kb8x32.js";import{s as F}from"./Trash01-Cup7-ZTT.js";import{R as L}from"./require-capability-DVI2cKO3.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-mcp-client-CWFUu1lY.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./tooltip-bsrBmmjV.js";import"./sheet-D99KevZC.js";import"./X-1KR4wibP.js";import"./card-BUTabNLA.js";import"./ArrowUpRight-97355q5v.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";function B(){const{org:t}=D(),{data:a,isLoading:E}=P(t.id,t.slug),x=R(t.id,t.slug),h=A(t.id,t.slug),j=T(t.id,t.slug),[s,d]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,g]=v.useState(!1),u=a?.configured&&a.config,o=a?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),g(!0)},b=async()=>{if(!s.issuer||!s.clientId||!s.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!s.clientSecret){c.error("Client Secret is required for initial setup");return}try{await x.mutateAsync({issuer:s.issuer,clientId:s.clientId,clientSecret:s.clientSecret,discoveryEndpoint:s.discoveryEndpoint||void 0,scopes:s.scopes.split(/\s+/).filter(Boolean),domain:s.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:t.id,email_domain:s.domain}),c.success("SSO configuration saved"),g(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},w=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:t.id}),c.success("SSO configuration removed"),g(!1)}catch{c.error("Failed to remove SSO config")}},_=async i=>{try{await j.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:t.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(f,{children:e.jsx(f.Content,{children:e.jsx(f.Body,{children:e.jsxs(q,{children:[e.jsx(f.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(r,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(r,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(r,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(r,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:_,disabled:j.isPending})}),e.jsxs(O,{children:[e.jsxs(p,{variant:"ghost",size:"sm",onClick:w,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(F,{size:14}),"Remove"]}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${t.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(p,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:s.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:s.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:s.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:s.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:s.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:s.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(p,{variant:"outline",size:"sm",onClick:()=>g(!1),children:"Cancel"}),e.jsx(p,{onClick:b,disabled:x.isPending,size:"sm",children:x.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function ce(){const t=N.c(1);let a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(L,{capability:"org:manage",area:"security",children:e.jsx(B,{})}),t[0]=a):a=t[0],a}export{ce as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DPaKDLDg.js","assets/index-biiHZ5l9.js","assets/index-CZJ35dl3.css","assets/XCircle-UPVnJx4i.js","assets/CheckCircle-C2ualSpf.js","assets/Container-CYcITvPW.js","assets/Settings02-Cd4DIqaJ.js","assets/use-mcp-client-CWFUu1lY.js","assets/useInfiniteQuery-BGg7INCQ.js","assets/infiniteQueryObserver-B0VBGXv5.js","assets/badge-Da0IsrqH.js","assets/input-5PMMNPU9.js","assets/dropdown-menu-CIu58K9q.js","assets/Check-D-9dblUn.js","assets/ChevronRight-CrZy8tHx.js","assets/DotsVertical-SvwN4CeV.js","assets/table-Cx3PhNth.js","assets/toggle-group-DhVqXGfs.js","assets/use-view-mode-CbT8E3wV.js","assets/tooltip-bsrBmmjV.js","assets/FilterLines-BJZdiggU.js","assets/Globe01-DfGFlik1.js","assets/SearchMd-BL2y99rx.js","assets/dialog-Bm1pP7Vu.js","assets/X-1KR4wibP.js","assets/AlertCircle-9EFUZenf.js","assets/Upload01-C9yi1Bdg.js","assets/alert-dialog-CSkQIwm8.js","assets/card-BUTabNLA.js","assets/Trash01-Cup7-ZTT.js","assets/label-CcC4_aKf.js","assets/select-CNSUv3cw.js","assets/ChevronDown-Cf2Q-GlB.js","assets/ChevronUp-BAxoXhnT.js","assets/switch-D6SWnoi2.js","assets/textarea-QEULyLXh.js","assets/RefreshCcw01-3BsQQkRx.js","assets/checkbox--nDaSUZE.js","assets/Eye-ByuwKsdh.js","assets/LinkExternal01-CgI1VTqi.js","assets/use-copy-P6tx-uOp.js","assets/Key01-CzmPnHuw.js","assets/Plus-CjrtKB-Y.js","assets/Play-CMJ2IWYR.js"])))=>i.map(i=>d[i]);
2
- import{e as m,f as n,g as c,j as t,l as f,r as l,_ as p}from"./index-biiHZ5l9.js";import{R as u}from"./require-capability-DVI2cKO3.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";const g=l.lazy(()=>p(()=>import("./registry-layout-DPaKDLDg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- function n(r){const o=r;if(o?.isError)throw new Error(o.content?.[0]?.text??"Tool call failed");const t=o?.structuredContent??r,e=t;if(e?.isError)throw new Error(e.content?.[0]?.text??"Tool call failed");return t}export{n as u};
@@ -1 +0,0 @@
1
- import{e as g,q as f,s as _,K as m,n as I}from"./index-biiHZ5l9.js";import{S,u as P}from"./use-mcp-client-CWFUu1lY.js";function A(t,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>(await t.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null}}function q(){const t=g.c(10),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==e.id?(i=m.aiProviders(e.id),t[3]=e.id,t[4]=i):i=t[4];let l;t[5]!==o?(l=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,t[5]=o,t[6]=l):l=t[6];let n;t[7]!==i||t[8]!==l?(n={queryKey:i,staleTime:1/0,queryFn:l},t[7]=i,t[8]=l,t[9]=n):n=t[9];const{data:r}=_(n);return r}function v(){const t=g.c(8),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==o||t[4]!==e.id?(i=A(o,e.id),t[3]=o,t[4]=e.id,t[5]=i):i=t[5];const{data:l}=_(i);let n;return t[6]!==l?.keys?(n=l?.keys??[],t[6]=l?.keys,t[7]=n):n=t[7],n}function R(t){const e=g.c(18),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t??""),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];const n=!!t;let r;e[6]!==i||e[7]!==t?(r=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=r):r=e[8];let u;e[9]!==l||e[10]!==n||e[11]!==r?(u={queryKey:l,enabled:n,staleTime:6e4,queryFn:r},e[9]=l,e[10]=n,e[11]=r,e[12]=u):u=e[12];const{data:c,isLoading:T}=I(u);let a;e[13]!==c?.models?(a=c?.models??[],e[13]=c?.models,e[14]=a):a=e[14];const y=!!t&&T;let d;return e[15]!==a||e[16]!==y?(d={models:a,isLoading:y},e[15]=a,e[16]=y,e[17]=d):d=e[17],d}function p(t){const e=g.c(14),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];let n;e[6]!==i||e[7]!==t?(n=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=n):n=e[8];let r;e[9]!==l||e[10]!==n?(r={queryKey:l,staleTime:6e4,queryFn:n},e[9]=l,e[10]=n,e[11]=r):r=e[11];const{data:u}=_(r);let c;return e[12]!==u?.models?(c=u?.models??[],e[12]=u?.models,e[13]=c):c=e[13],c}export{A as a,R as b,q as c,p as d,v as u};