decocms 3.83.2 → 3.83.3

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 (212) hide show
  1. package/dist/client/assets/{AlertCircle-DM0HzopE.js → AlertCircle-Dq_G2Nzm.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CoxAwUHc.js → ArrowUpRight-CQ9V3qZ2.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-D5UuMIIH.js → CheckCircle-M-SB_oIp.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CW3qqv2x.js → ChevronDown-BfYdHkpN.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-LzGuMB2U.js → ChevronLeft-C491iKrG.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-B0GGkNIH.js → ChevronRight-BY1HqVE6.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DZQVuDwV.js → ChevronUp-BLP78FPA.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CGmC-AuM.js → DotsVertical-CCea0DBY.js} +1 -1
  9. package/dist/client/assets/{Eye-DRB5PFSd.js → Eye-LeoubK3e.js} +1 -1
  10. package/dist/client/assets/{FilterLines-uyaFw99Z.js → FilterLines-BS68ypb2.js} +1 -1
  11. package/dist/client/assets/{Globe01-J_5kAZ2G.js → Globe01-BcsvYW1p.js} +1 -1
  12. package/dist/client/assets/{Globe04-DzVxOgG6.js → Globe04-BVNSKsf5.js} +1 -1
  13. package/dist/client/assets/{HardDrive-BD491-6A.js → HardDrive-BYvsH8om.js} +1 -1
  14. package/dist/client/assets/{Key01-DpArIwgm.js → Key01-BuD8mP7N.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-i76gAzb8.js → LayoutLeft-CYKuZwii.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BGVgwGxd.js → LinkExternal01-DU5nTXy3.js} +1 -1
  17. package/dist/client/assets/{Monitor01-C4cglHcn.js → Monitor01-DiwEyrIh.js} +1 -1
  18. package/dist/client/assets/{Palette-NYPFTebi.js → Palette-CYyTNBF1.js} +1 -1
  19. package/dist/client/assets/{Play-CIhVolnk.js → Play-oEOHn7Kl.js} +1 -1
  20. package/dist/client/assets/{Plus-DEhikgBr.js → Plus-p2e2tk7T.js} +1 -1
  21. package/dist/client/assets/{SearchMd-1YEF5GNC.js → SearchMd-DLvQebgX.js} +1 -1
  22. package/dist/client/assets/{Settings02-B_oiQbnJ.js → Settings02-C9u5iyRe.js} +1 -1
  23. package/dist/client/assets/{Shield01-BrCb9Fbq.js → Shield01-CeaSgNsE.js} +1 -1
  24. package/dist/client/assets/{Star01-K5E2EVFR.js → Star01--VHLdkhz.js} +1 -1
  25. package/dist/client/assets/{Stars01-D-F-KCAY.js → Stars01-1RvLNgsH.js} +1 -1
  26. package/dist/client/assets/{Stars02-D5rVREl5.js → Stars02-Er9DZAE5.js} +1 -1
  27. package/dist/client/assets/{Sun-0LQy_BRh.js → Sun-DDm9LtlE.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Y2S_GG49.js → SwitchHorizontal01-772sqvX3.js} +1 -1
  29. package/dist/client/assets/{Tool01-B21_bo9F.js → Tool01-B4pupQ7x.js} +1 -1
  30. package/dist/client/assets/{Trash01-D4qJL0O5.js → Trash01-BOAu4VFs.js} +1 -1
  31. package/dist/client/assets/{Upload01-B89V4QHh.js → Upload01-Bb4xamfI.js} +1 -1
  32. package/dist/client/assets/{User01-676cwM-d.js → User01-CRJiYDWT.js} +1 -1
  33. package/dist/client/assets/{Users01-Wg2zRTbW.js → Users01-D8fzZILN.js} +1 -1
  34. package/dist/client/assets/{Users03-ClYFKrw1.js → Users03-BC-_ZtVi.js} +1 -1
  35. package/dist/client/assets/{X-B9D2h3Td.js → X-5CnCtsJU.js} +1 -1
  36. package/dist/client/assets/{XCircle-CSFP3d9h.js → XCircle-Dsot7agl.js} +1 -1
  37. package/dist/client/assets/{XClose-DBh1WmP1.js → XClose-B8-m6Ysp.js} +1 -1
  38. package/dist/client/assets/{Zap-BRPDiIJ_.js → Zap-DbdLJbyv.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-Dnw5HzjO.js → ZapSquare-BD-d-pzC.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-Cz0dpIX0.js → ZoomOut-DvNle-6p.js} +1 -1
  41. package/dist/client/assets/{access-gate-BrhqO3VF.js → access-gate-Bfo1MN-6.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-D2CiFRjh.js → add-section-modal-C8cK4YYY.js} +1 -1
  43. package/dist/client/assets/{agent-icon-o19yp48z.js → agent-icon-OikJQ0tD.js} +1 -1
  44. package/dist/client/assets/{agents-list-CZG4qszH.js → agents-list-CP6nVUf_.js} +1 -1
  45. package/dist/client/assets/{ai-providers-CO0WuHGD.js → ai-providers-BUUJWdPq.js} +1 -1
  46. package/dist/client/assets/{alert-D1A1Zc_j.js → alert-BEdX_qhI.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BOS0dCJh.js → alert-dialog-B35bQh9V.js} +1 -1
  48. package/dist/client/assets/{app-editor-CIfs2FL1.js → app-editor-4WQA1zYh.js} +1 -1
  49. package/dist/client/assets/{auth-BdbahkUc.js → auth-9EhfyRsv.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-CNPgs4YU.js → auth-catchall-5sn9wiIr.js} +1 -1
  51. package/dist/client/assets/{auth-entry-B1WtHQhf.js → auth-entry-DxGnHSZi.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-nvPMwr8u.js → auth-split-layout-akB0devr.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-BMdVL1CA.js → authenticate-and-persist-oauth-tBiMyMPG.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CyNcj0ry.js → automation-list-row-Cdw0YVrC.js} +1 -1
  55. package/dist/client/assets/{automation-runs-Bk8JCPKW.js → automation-runs-CgHl-onu.js} +1 -1
  56. package/dist/client/assets/{automations-D5t0_F84.js → automations-Dg84pPYA.js} +1 -1
  57. package/dist/client/assets/{avatar-3AHqY5tt.js → avatar-CWHc4EZj.js} +1 -1
  58. package/dist/client/assets/{badge-DAumNibn.js → badge-DUbO_RN4.js} +1 -1
  59. package/dist/client/assets/{block-document-CyMP0Nwa.js → block-document-CHDcd7GV.js} +1 -1
  60. package/dist/client/assets/{brand-context-yzHlJmXd.js → brand-context-84fuZTux.js} +1 -1
  61. package/dist/client/assets/{buckets-D9fspdLY.js → buckets-BtWZ7TTY.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-B4Sf_UJj.js → capability-load-error-efC7JvaJ.js} +1 -1
  63. package/dist/client/assets/{card-DPMEGAqZ.js → card-CNNf5saL.js} +1 -1
  64. package/dist/client/assets/category-editor-D-q4clOB.js +1 -0
  65. package/dist/client/assets/{chat-context-DANWEvls.js → chat-context-CVPSA0cN.js} +1 -1
  66. package/dist/client/assets/{checkbox-ByFK_aep.js → checkbox-C9da9yB_.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-s1Ge9151.js → cli-auth-success-VJOTMDXR.js} +1 -1
  68. package/dist/client/assets/{collection-detail-NWtLzyq5.js → collection-detail-CjdbzQ7n.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-CTz7X8CM.js → collection-display-button-DzmDbICa.js} +1 -1
  70. package/dist/client/assets/{collection-search-CQMKW4Jp.js → collection-search-Do7Cp7BP.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-jlQTSy-i.js → collection-tabs-NlIGO6dT.js} +1 -1
  72. package/dist/client/assets/{command-DNx5Uhv2.js → command-DMfMyCz6.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-BGm-51c6.js → commerce-onboarding-DG1WmOiH.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-BeQBPgXI.js → connect-desktop-dialog-BpO---Ho.js} +1 -1
  75. package/dist/client/assets/{connection-card-CHIFmA8R.js → connection-card-D2GNuFJz.js} +1 -1
  76. package/dist/client/assets/{connection-detail-BTDN1t-U.js → connection-detail-DGvDSyd2.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-CWhKbOwZ.js → connection-form-helpers-B19OLFDN.js} +1 -1
  78. package/dist/client/assets/{connections-Df79XqMS.js → connections-DagbmY0t.js} +1 -1
  79. package/dist/client/assets/{context-menu-DkDkJvo8.js → context-menu-qcMftRg7.js} +1 -1
  80. package/dist/client/assets/{decopilot-CmY0uQsK.js → decopilot-b_zAKgPV.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-CXkkAKQx.js → decopilot-sse-pool-DelsNiOI.js} +1 -1
  82. package/dist/client/assets/{dialog-fVpV_18N.js → dialog-DHc-iPx9.js} +1 -1
  83. package/dist/client/assets/{domain-settings-BIaZaqXi.js → domain-settings-BUi0oMEx.js} +1 -1
  84. package/dist/client/assets/{drawer-iojIyQ7Z.js → drawer-Cwhc32-v.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-HRW3zYBQ.js → dropdown-menu-9t4d4l4a.js} +1 -1
  86. package/dist/client/assets/{empty-state-ySGQGV31.js → empty-state-Dg_iHbDT.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-CrjpOcI0.js → extract-connection-data-DNQRXpX9.js} +1 -1
  88. package/dist/client/assets/{file-explorer-D1OUZ8cU.js → file-explorer-Ch_-pBTl.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-BSAfTQY6.js → file-type-icon-DYGh6lpU.js} +1 -1
  90. package/dist/client/assets/{files-Dvw5nwbp.js → files-DU9-Yfzy.js} +1 -1
  91. package/dist/client/assets/{form-dD3QczZa.js → form-DKjNHSgl.js} +1 -1
  92. package/dist/client/assets/{general-C6KcKAXv.js → general-BV5-cxzn.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-YqP06Fto.js → github-repo-picker-D85COA-s.js} +1 -1
  94. package/dist/client/assets/{hooks-C3qiFxIG.js → hooks-DK3MSO7c.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-DDsiz0pE.js → import-from-deco-dialog-DdNn_Vm5.js} +1 -1
  96. package/dist/client/assets/{index-BO-4uKUn.js → index-B6XJrY37.js} +1 -1
  97. package/dist/client/assets/{index-jh_AV7fc.js → index-BRDh59qB.js} +1 -1
  98. package/dist/client/assets/{index-C102AH4s.js → index-BZ1n_eeg.js} +1 -1
  99. package/dist/client/assets/{index-BMCJlhk3.js → index-Ba-qr1CW.js} +3 -3
  100. package/dist/client/assets/{index-q8ngIE68.js → index-BgSq9_gk.js} +1 -1
  101. package/dist/client/assets/{index-DqK88OS0.js → index-BiDBbTkI.js} +1 -1
  102. package/dist/client/assets/{index-CpgQ8CBr.js → index-ChXm-kke.js} +1 -1
  103. package/dist/client/assets/{index-BodEVjlg.js → index-CtYIN751.js} +1 -1
  104. package/dist/client/assets/{index-CXXnf1Qe.js → index-D6Goqiqa.js} +1 -1
  105. package/dist/client/assets/{index-B7xwJlcR.js → index-DLD_CxqI.js} +5 -5
  106. package/dist/client/assets/{index-Ci5DmEN0.js → index-DPCQ9W7J.js} +1 -1
  107. package/dist/client/assets/{index-BK10Xdph.js → index-DhgDI0NK.js} +1 -1
  108. package/dist/client/assets/{index-FKJOX04p.js → index-Dis4Pr9Y.js} +1 -1
  109. package/dist/client/assets/{index-Cvy8WHIB.js → index-DoNPC42T.js} +1 -1
  110. package/dist/client/assets/{index-redirect-B05if20n.js → index-redirect-BAZCiFNw.js} +1 -1
  111. package/dist/client/assets/{input-Bk-XA8aE.js → input-BBCESNsB.js} +1 -1
  112. package/dist/client/assets/{integration-icon-D5R24LMd.js → integration-icon-qruX57ku.js} +1 -1
  113. package/dist/client/assets/{label-DbgfgBJH.js → label-B485QK8V.js} +1 -1
  114. package/dist/client/assets/{login-BnanKvfh.js → login-ltMol0GQ.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-Ge7_9DJm.js → mcp-oauth-dU1JqorS.js} +1 -1
  116. package/dist/client/assets/{members-OMqqgRie.js → members-OJ7G0YUL.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-CLbivzeA.js → monaco-editor-BIiIfKcK.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-D988ksKz.js → monitoring-stats-row-D6qosWnk.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-CMcTYSQ9.js → oauth-callback-DOOGhQs-.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-CPlg-Iun.js → oauth-callback-ai-provider-Bmuhx9bM.js} +1 -1
  121. package/dist/client/assets/{onboarding-BQtZWhzG.js → onboarding-B61MPRWq.js} +1 -1
  122. package/dist/client/assets/{org-install-EHXdq4o2.js → org-install-CEh8CLxc.js} +1 -1
  123. package/dist/client/assets/{org-layout-qDY2vnUU.js → org-layout-CMZz9TrX.js} +1 -1
  124. package/dist/client/assets/{organization-choice-BOiOzldx.js → organization-choice-DtJ-TCYP.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-DeK8_ys8.js → page-seo-form-snxzdzwx.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-B2tZgmq5.js +1 -0
  127. package/dist/client/assets/{popover-BTH_4TON.js → popover-Cv6LCVas.js} +1 -1
  128. package/dist/client/assets/{post-editor-DJSqRdmQ.js → post-editor-CSzzEUXL.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-C4U9zVzk.js → preview-dialog-B4xvQs8x.js} +1 -1
  130. package/dist/client/assets/{primitives-CXIIxbFE.js → primitives-BuTs77_N.js} +1 -1
  131. package/dist/client/assets/{profile-OkUeU-xS.js → profile-Cq91ylKm.js} +1 -1
  132. package/dist/client/assets/project-app-view-DEcY821H.js +1 -0
  133. package/dist/client/assets/record-editor-DKwCdsae.js +1 -0
  134. package/dist/client/assets/registry-CXRQtC1R.js +2 -0
  135. package/dist/client/assets/{registry-layout-CmbVIFjk.js → registry-layout-hgoaCWQE.js} +1 -1
  136. package/dist/client/assets/{require-capability-B3YVeyKQ.js → require-capability-KHCur5VM.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-hwOac595.js → required-auth-layout-D-J1BueF.js} +1 -1
  138. package/dist/client/assets/{reset-password-DYADQ6t-.js → reset-password-Btve25Sd.js} +1 -1
  139. package/dist/client/assets/{roles-CwZxDmMd.js → roles-DDuyJ6YR.js} +1 -1
  140. package/dist/client/assets/{save-status-cz-ufgN_.js → save-status-CJES-J6W.js} +1 -1
  141. package/dist/client/assets/{scroll-area-BliS1K3p.js → scroll-area-DrAN9Fvu.js} +1 -1
  142. package/dist/client/assets/{search-input-CUOcSr_7.js → search-input-fHPtOP7y.js} +1 -1
  143. package/dist/client/assets/{secrets-CyW5acaW.js → secrets-CiTh5KLj.js} +1 -1
  144. package/dist/client/assets/{sections-editor-Dv8SUTjk.js → sections-editor-DB30d9vt.js} +1 -1
  145. package/dist/client/assets/{select-8EVXQGwX.js → select-Dd_an4jF.js} +1 -1
  146. package/dist/client/assets/{select-model-iQAMpxgJ.js → select-model-BKUEE8m5.js} +1 -1
  147. package/dist/client/assets/{seo-editor-BNVUsXCz.js → seo-editor-CTBBS5En.js} +1 -1
  148. package/dist/client/assets/{settings-layout-D-yUHTQc.js → settings-layout-Coikikdv.js} +1 -1
  149. package/dist/client/assets/{settings-section-DHTir3TC.js → settings-section-ZNhTRSX3.js} +1 -1
  150. package/dist/client/assets/{sheet-ZPG9h0Fj.js → sheet-B69G1O5h.js} +1 -1
  151. package/dist/client/assets/{shell-controls-Zawsretc.js → shell-controls-B16XaWpP.js} +1 -1
  152. package/dist/client/assets/{shell-layout-CWAvk5Go.js → shell-layout-DQpppXAg.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-mpOo6h4k.js → shell-route-loading-BhN3sCYk.js} +1 -1
  154. package/dist/client/assets/{sidebar-DU6XXtnA.js → sidebar-Pqq_WVl7.js} +1 -1
  155. package/dist/client/assets/{skeleton-CKrKTMUA.js → skeleton-DDfTse6v.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-B3t9DDZ6.js → sortable.esm-Zgc8llTJ.js} +1 -1
  157. package/dist/client/assets/{sso-CERYxMuj.js → sso-5g-PCMCm.js} +1 -1
  158. package/dist/client/assets/{store-mnbDCvL0.js → store-0O9jG9RN.js} +1 -1
  159. package/dist/client/assets/store-registry-BE28Qqir.js +2 -0
  160. package/dist/client/assets/{studio-tools-BdR8-wJW.js → studio-tools-Zf2j5Vw6.js} +1 -1
  161. package/dist/client/assets/{switch-DLwkt3ng.js → switch-DVGIVYD-.js} +1 -1
  162. package/dist/client/assets/{table-CHbuq2So.js → table-CaQbuRGR.js} +1 -1
  163. package/dist/client/assets/{tabs-C3tau4Eq.js → tabs-CNn3gT-l.js} +1 -1
  164. package/dist/client/assets/{task-status-Cpo5H16E.js → task-status-C22YJZSD.js} +1 -1
  165. package/dist/client/assets/{textarea-CJuB4hQ7.js → textarea-BNj8LeAc.js} +1 -1
  166. package/dist/client/assets/{toggle-group-Ckfjs-c4.js → toggle-group-BGuBCRpR.js} +1 -1
  167. package/dist/client/assets/{toolbar-D1N_WILM.js → toolbar-MHh5nkt1.js} +1 -1
  168. package/dist/client/assets/{tooltip-DjHKSu56.js → tooltip-Bv4DpGHU.js} +1 -1
  169. package/dist/client/assets/{types-CNWQoCyo.js → types-DV4xEeHM.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BxzRSeJ0.js → use-ai-providers-rovOwk8E.js} +1 -1
  171. package/dist/client/assets/{use-automations-Br1p5DHc.js → use-automations-5rZgDplp.js} +1 -1
  172. package/dist/client/assets/{use-capability-E8ccWznH.js → use-capability-DrYAgeoP.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-BW4BJ8Tt.js → use-clock-tick-CPqO-BWO.js} +1 -1
  174. package/dist/client/assets/{use-collections-CsNhZa6R.js → use-collections-CdkIpoPj.js} +1 -1
  175. package/dist/client/assets/{use-connection-_slG13py.js → use-connection-BvI4z5Go.js} +1 -1
  176. package/dist/client/assets/{use-copy-60B0ujzD.js → use-copy-Cud6yKog.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-aSsDb_hC.js → use-create-virtual-mcp-DvBuDwwU.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-DlQ25v46.js → use-debounced-autosave-1NuS6x2p.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-BSgRrEnr.js → use-delete-connection-CUPyGyfe.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-TueoM3xk.js → use-file-configs-iLxbpR0W.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-B7KmD1ay.js → use-infinite-scroll-CMIncUkM.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-Bugx9GLx.js → use-join-requests-Rcyk6COV.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client--_ZSmyGd.js → use-mcp-client-DNt8z_cQ.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-Bi0YM-MV.js → use-mcp-prompts-BvvmYT5d.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-C6z5gFrv.js → use-mcp-tools-DmQFC6-r.js} +1 -1
  186. package/dist/client/assets/{use-members-D4NNP_ry.js → use-members-Ddo88B9U.js} +1 -1
  187. package/dist/client/assets/{use-navigate-to-agent-C2eJezkw.js → use-navigate-to-agent-BKUFyiJj.js} +1 -1
  188. package/dist/client/assets/{use-org-auth-client-Bn9WqUMO.js → use-org-auth-client-CiDUlr9j.js} +1 -1
  189. package/dist/client/assets/{use-org-sso-CgbvxseW.js → use-org-sso-BFHNwstz.js} +1 -1
  190. package/dist/client/assets/{use-organization-roles-Cg0ug59K.js → use-organization-roles-Dq9V89Eq.js} +1 -1
  191. package/dist/client/assets/{use-organization-settings-DQ5ROkEQ.js → use-organization-settings-gIQB6FWt.js} +1 -1
  192. package/dist/client/assets/{use-registry-connections-Ba1xQHz9.js → use-registry-connections-BASvWu3z.js} +1 -1
  193. package/dist/client/assets/{use-secrets-B1jqMRBn.js → use-secrets-BghcHplb.js} +1 -1
  194. package/dist/client/assets/{use-status-sounds-Bj_NbDO6.js → use-status-sounds-uYZzmwes.js} +1 -1
  195. package/dist/client/assets/{use-view-mode-BvWJalT6.js → use-view-mode-lCZKY_ek.js} +1 -1
  196. package/dist/client/assets/{use-virtual-mcp-BZlyJ3on.js → use-virtual-mcp-C-sRaXYQ.js} +1 -1
  197. package/dist/client/assets/useInfiniteQuery-C_KTVASW.js +1 -0
  198. package/dist/client/assets/useSuspenseInfiniteQuery-CsMnvHSV.js +1 -0
  199. package/dist/client/assets/{variant-calendar-C0Qs1GnN.js → variant-calendar-B-ZaZ0O3.js} +1 -1
  200. package/dist/client/assets/{view-mode-toggle-DcivAyKH.js → view-mode-toggle-CjqQoLPT.js} +1 -1
  201. package/dist/client/index.html +1 -1
  202. package/dist/server/cli.js +36 -36
  203. package/dist/server/server.js +31 -31
  204. package/package.json +1 -1
  205. package/dist/client/assets/category-editor-nDclmHNc.js +0 -1
  206. package/dist/client/assets/page-seo-sheet-CnuTSA1a.js +0 -1
  207. package/dist/client/assets/project-app-view-ClFsE-uv.js +0 -1
  208. package/dist/client/assets/record-editor-Ba_-uY6W.js +0 -1
  209. package/dist/client/assets/registry-OeyyY_3h.js +0 -2
  210. package/dist/client/assets/store-registry-CJLz8NHB.js +0 -2
  211. package/dist/client/assets/useInfiniteQuery-DDGqv00b.js +0 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DI0bMzys.js +0 -1
@@ -1 +1 @@
1
- import{c as l,l as u,j as g,bf as v,bF as b}from"./index-BMCJlhk3.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as l,l as u,j as g,bf as v,bF as b}from"./index-Ba-qr1CW.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
@@ -1,3 +1,3 @@
1
- import{r as K,c as $,j as o,l as V,k as Se,K as Ie}from"./index-BMCJlhk3.js";import{e as Be,C as $e,b as Ae,c as fe,K as Te,P as Le,s as Pe,l as De,S as _e,v as Ee,D as Ue,d as Re}from"./sortable.esm-B3t9DDZ6.js";import{au as Oe,ax as ze,ay as Fe,p as Ve,ab as Ke,az as Me}from"./index-B7xwJlcR.js";import{ah as qe,l as Ge,N as Je,O as He,P as Xe}from"./agent-icon-o19yp48z.js";import{s as Qe}from"./Plus-DEhikgBr.js";import{e as me,a as We,b as Ye,C as Ze,d as et,c as tt}from"./command-DNx5Uhv2.js";import{a as lt,b as st,P as ot}from"./popover-BTH_4TON.js";import{a as rt}from"./Eye-DRB5PFSd.js";import{c as nt}from"./ZoomOut-Cz0dpIX0.js";import{s as it}from"./Trash01-D4qJL0O5.js";import{b as at}from"./XCircle-CSFP3d9h.js";import{d as ct,i as dt,E as ut}from"./scroll-area-BliS1K3p.js";import{i as ft}from"./index-Ci5DmEN0.js";import{I as R,F as ue,T as re,s as I,p as ne,R as W,A as Y}from"./primitives-CXIIxbFE.js";import{i as mt}from"./ChevronUp-DZQVuDwV.js";import{L as oe}from"./label-DbgfgBJH.js";const ye=K.createContext(null);function vl(c){const e=$.c(7),{orgSlug:t,virtualMcpId:r,branch:l,children:i}=c;let d;e[0]!==l||e[1]!==t||e[2]!==r?(d={orgSlug:t,virtualMcpId:r,branch:l},e[0]=l,e[1]=t,e[2]=r,e[3]=d):d=e[3];let f;return e[4]!==i||e[5]!==d?(f=o.jsx(ye.Provider,{value:d,children:i}),e[4]=i,e[5]=d,e[6]=f):f=e[6],f}function pt(){return K.useContext(ye)}const pe={app:"Blocks",site:"Custom blocks"};function xt(c){const e=$.c(6),{iconName:t,iconUrl:r,alt:l}=c;let i;e[0]!==t?(i=Ge(t)??qe,e[0]=t,e[1]=i):i=e[1];const d=i;let f;return e[2]!==d||e[3]!==l||e[4]!==r?(f=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?o.jsx("img",{src:r,alt:l,className:"size-5 object-contain"}):o.jsx(d,{size:16,className:"text-muted-foreground"})}),e[2]=d,e[3]=l,e[4]=r,e[5]=f):f=e[5],f}function xe(c){const e=$.c(19),{type:t,onInsert:r}=c,l=`${t.title} ${t.resolveType} ${t.description??""}`;let i;e[0]!==r||e[1]!==t.resolveType?(i=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=i):i=e[2];let d;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(d=o.jsx(xt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=d):d=e[6];let f;e[7]!==t.title?(f=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let p;e[9]!==t.description?(p=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=p):p=e[10];let x;e[11]!==f||e[12]!==p?(x=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,p]}),e[11]=f,e[12]=p,e[13]=x):x=e[13];let u;return e[14]!==l||e[15]!==i||e[16]!==d||e[17]!==x?(u=o.jsxs(We,{value:l,onSelect:i,className:"flex items-center gap-2.5",children:[d,x]}),e[14]=l,e[15]=i,e[16]=d,e[17]=x,e[18]=u):u=e[18],u}function ge(c){const e=$.c(37),{blockTypes:t,onInsert:r,alwaysShow:l}=c,i=l===void 0?!1:l,[d,f]=K.useState(!1);let p,x;if(e[0]!==t){p=[],x=[];for(const T of t)(T.source==="site"?x:p).push(T);e[0]=t,e[1]=p,e[2]=x}else p=e[1],x=e[2];let u;e[3]!==r?(u=T=>{r(T),f(!1)},e[3]=r,e[4]=u):u=e[4];const h=u,s=p.length>0&&x.length>0,n=i?"h-10":"";let a;e[5]!==n?(a=V("group/insert relative flex h-6 items-center justify-center",n),e[5]=n,e[6]=a):a=e[6];const m=d||i?"opacity-100":"opacity-0 group-hover/insert:opacity-100";let g;e[7]!==m?(g=V("absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border transition-opacity",m),e[7]=m,e[8]=g):g=e[8];let b;e[9]!==g?(b=o.jsx("div",{className:g}),e[9]=g,e[10]=b):b=e[10];const y=d||i?"opacity-100":"opacity-0 group-hover/insert:opacity-100";let v;e[11]!==y?(v=V("relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",y),e[11]=y,e[12]=v):v=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(Qe,{size:14}),e[13]=k):k=e[13];let N;e[14]!==v?(N=o.jsx(lt,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":"Insert block",className:v,children:k})}),e[14]=v,e[15]=N):N=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Ye,{placeholder:"Search blocks…"}),e[16]=C):C=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Ze,{children:"No blocks found."}),e[17]=j):j=e[17];let S;e[18]!==h||e[19]!==s||e[20]!==x?(S=x.length>0&&o.jsx(me,{heading:s?pe.site:void 0,children:x.map(T=>o.jsx(xe,{type:T,onInsert:h},T.resolveType))}),e[18]=h,e[19]=s,e[20]=x,e[21]=S):S=e[21];let B;e[22]!==p||e[23]!==h||e[24]!==s?(B=p.length>0&&o.jsx(me,{heading:s?pe.app:void 0,children:p.map(T=>o.jsx(xe,{type:T,onInsert:h},T.resolveType))}),e[22]=p,e[23]=h,e[24]=s,e[25]=B):B=e[25];let w;e[26]!==S||e[27]!==B?(w=o.jsx(st,{className:"w-80 p-0",align:"center",children:o.jsxs(et,{children:[C,o.jsxs(tt,{className:"max-h-80",children:[j,S,B]})]})}),e[26]=S,e[27]=B,e[28]=w):w=e[28];let A;e[29]!==d||e[30]!==N||e[31]!==w?(A=o.jsxs(ot,{open:d,onOpenChange:f,children:[N,w]}),e[29]=d,e[30]=N,e[31]=w,e[32]=A):A=e[32];let _;return e[33]!==A||e[34]!==a||e[35]!==b?(_=o.jsxs("div",{className:a,children:[b,A]}),e[33]=A,e[34]=a,e[35]=b,e[36]=_):_=e[36],_}function gt({html:c,placeholder:e,onChange:t}){const r=K.useRef(t);r.current=t;const l=ct({extensions:[dt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ft.configure({placeholder:e??"Write something…"})],content:c||"",editorProps:{attributes:{class:V("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:i})=>{const d=i.getHTML();r.current(d==="<p></p>"?"":d)}});return l?o.jsxs("div",{className:"relative",children:[l.isFocused&&o.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[o.jsx(le,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:o.jsx(Je,{size:14})}),o.jsx(le,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:o.jsx(He,{size:14})}),o.jsx(le,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:o.jsx(Xe,{size:14})}),o.jsx(le,{active:l.isActive("link"),label:"Link",onClick:()=>{const i=l.getAttributes("link").href,d=window.prompt("Link URL",i??"https://");d!==null&&(d===""?l.chain().focus().unsetLink().run():l.chain().focus().setLink({href:d}).run())},children:o.jsx(at,{size:14})})]}),o.jsx(ut,{editor:l,className:"text-[15px] text-foreground"})]}):null}function le(c){const e=$.c(8),{active:t,label:r,onClick:l,children:i}=c,d=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[0]!==d?(f=V("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",d),e[0]=d,e[1]=f):f=e[1];let p;return e[2]!==t||e[3]!==i||e[4]!==r||e[5]!==l||e[6]!==f?(p=o.jsx("button",{type:"button","aria-label":r,"aria-pressed":t,onMouseDown:ht,onClick:l,className:f,children:i}),e[2]=t,e[3]=i,e[4]=r,e[5]=l,e[6]=f,e[7]=p):p=e[7],p}function ht(c){return c.preventDefault()}const bt=["1","2","3"],he={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function vt(c){const e=$.c(19),{text:t,level:r,onChange:l}=c,[i,d]=K.useState(!1),f=r||"2";let p;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==t?(p=i&&o.jsx(ue,{children:bt.map(g=>o.jsxs(re,{active:f===g,label:`Heading ${g}`,onClick:()=>l({text:t,level:g}),children:["H",g]},g))}),e[0]=i,e[1]=f,e[2]=l,e[3]=t,e[4]=p):p=e[4];let x;e[5]!==f||e[6]!==l?(x=g=>l({text:g,level:f}),e[5]=f,e[6]=l,e[7]=x):x=e[7];let u,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(!0),h=()=>d(!1),e[8]=u,e[9]=h):(u=e[8],h=e[9]);const s=he[f]??he[2];let n;e[10]!==s?(n=V("text-foreground",s),e[10]=s,e[11]=n):n=e[11];let a;e[12]!==x||e[13]!==n||e[14]!==t?(a=o.jsx(R,{value:t,onChange:x,onFocus:u,onBlur:h,placeholder:"Heading",className:n}),e[12]=x,e[13]=n,e[14]=t,e[15]=a):a=e[15];let m;return e[16]!==p||e[17]!==a?(m=o.jsxs("div",{className:"relative",children:[p,a]}),e[16]=p,e[17]=a,e[18]=m):m=e[18],m}function yt(c){const e=$.c(3),{quote:t,onChange:r}=c;let l;return e[0]!==r||e[1]!==t?(l=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(R,{value:t,onChange:r,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=r,e[1]=t,e[2]=l):l=e[2],l}function jt(c){const e=$.c(15),{code:t,language:r,onChange:l}=c;let i;e[0]!==t||e[1]!==l?(i=u=>l({code:t,language:u.target.value}),e[0]=t,e[1]=l,e[2]=i):i=e[2];let d;e[3]!==r||e[4]!==i?(d=o.jsx("input",{value:r,onChange:i,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=r,e[4]=i,e[5]=d):d=e[5];let f;e[6]!==r||e[7]!==l?(f=u=>l({code:u,language:r}),e[6]=r,e[7]=l,e[8]=f):f=e[8];let p;e[9]!==t||e[10]!==f?(p=o.jsx(R,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=p):p=e[11];let x;return e[12]!==d||e[13]!==p?(x=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[d,p]}),e[12]=d,e[13]=p,e[14]=x):x=e[14],x}function Nt(c){const e=$.c(17),{items:t,style:r,onChange:l}=c,i=r==="ordered",d=t.length?t.split(`
1
+ import{r as K,c as $,j as o,l as V,k as Se,K as Ie}from"./index-Ba-qr1CW.js";import{e as Be,C as $e,b as Ae,c as fe,K as Te,P as Le,s as Pe,l as De,S as _e,v as Ee,D as Ue,d as Re}from"./sortable.esm-Zgc8llTJ.js";import{au as Oe,ax as ze,ay as Fe,p as Ve,ab as Ke,az as Me}from"./index-DLD_CxqI.js";import{ah as qe,l as Ge,N as Je,O as He,P as Xe}from"./agent-icon-OikJQ0tD.js";import{s as Qe}from"./Plus-p2e2tk7T.js";import{e as me,a as We,b as Ye,C as Ze,d as et,c as tt}from"./command-DMfMyCz6.js";import{a as lt,b as st,P as ot}from"./popover-Cv6LCVas.js";import{a as rt}from"./Eye-LeoubK3e.js";import{c as nt}from"./ZoomOut-DvNle-6p.js";import{s as it}from"./Trash01-BOAu4VFs.js";import{b as at}from"./XCircle-Dsot7agl.js";import{d as ct,i as dt,E as ut}from"./scroll-area-DrAN9Fvu.js";import{i as ft}from"./index-DPCQ9W7J.js";import{I as R,F as ue,T as re,s as I,p as ne,R as W,A as Y}from"./primitives-BuTs77_N.js";import{i as mt}from"./ChevronUp-BLP78FPA.js";import{L as oe}from"./label-B485QK8V.js";const ye=K.createContext(null);function vl(c){const e=$.c(7),{orgSlug:t,virtualMcpId:r,branch:l,children:i}=c;let d;e[0]!==l||e[1]!==t||e[2]!==r?(d={orgSlug:t,virtualMcpId:r,branch:l},e[0]=l,e[1]=t,e[2]=r,e[3]=d):d=e[3];let f;return e[4]!==i||e[5]!==d?(f=o.jsx(ye.Provider,{value:d,children:i}),e[4]=i,e[5]=d,e[6]=f):f=e[6],f}function pt(){return K.useContext(ye)}const pe={app:"Blocks",site:"Custom blocks"};function xt(c){const e=$.c(6),{iconName:t,iconUrl:r,alt:l}=c;let i;e[0]!==t?(i=Ge(t)??qe,e[0]=t,e[1]=i):i=e[1];const d=i;let f;return e[2]!==d||e[3]!==l||e[4]!==r?(f=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?o.jsx("img",{src:r,alt:l,className:"size-5 object-contain"}):o.jsx(d,{size:16,className:"text-muted-foreground"})}),e[2]=d,e[3]=l,e[4]=r,e[5]=f):f=e[5],f}function xe(c){const e=$.c(19),{type:t,onInsert:r}=c,l=`${t.title} ${t.resolveType} ${t.description??""}`;let i;e[0]!==r||e[1]!==t.resolveType?(i=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=i):i=e[2];let d;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(d=o.jsx(xt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=d):d=e[6];let f;e[7]!==t.title?(f=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let p;e[9]!==t.description?(p=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=p):p=e[10];let x;e[11]!==f||e[12]!==p?(x=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,p]}),e[11]=f,e[12]=p,e[13]=x):x=e[13];let u;return e[14]!==l||e[15]!==i||e[16]!==d||e[17]!==x?(u=o.jsxs(We,{value:l,onSelect:i,className:"flex items-center gap-2.5",children:[d,x]}),e[14]=l,e[15]=i,e[16]=d,e[17]=x,e[18]=u):u=e[18],u}function ge(c){const e=$.c(37),{blockTypes:t,onInsert:r,alwaysShow:l}=c,i=l===void 0?!1:l,[d,f]=K.useState(!1);let p,x;if(e[0]!==t){p=[],x=[];for(const T of t)(T.source==="site"?x:p).push(T);e[0]=t,e[1]=p,e[2]=x}else p=e[1],x=e[2];let u;e[3]!==r?(u=T=>{r(T),f(!1)},e[3]=r,e[4]=u):u=e[4];const h=u,s=p.length>0&&x.length>0,n=i?"h-10":"";let a;e[5]!==n?(a=V("group/insert relative flex h-6 items-center justify-center",n),e[5]=n,e[6]=a):a=e[6];const m=d||i?"opacity-100":"opacity-0 group-hover/insert:opacity-100";let g;e[7]!==m?(g=V("absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border transition-opacity",m),e[7]=m,e[8]=g):g=e[8];let b;e[9]!==g?(b=o.jsx("div",{className:g}),e[9]=g,e[10]=b):b=e[10];const y=d||i?"opacity-100":"opacity-0 group-hover/insert:opacity-100";let v;e[11]!==y?(v=V("relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",y),e[11]=y,e[12]=v):v=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(Qe,{size:14}),e[13]=k):k=e[13];let N;e[14]!==v?(N=o.jsx(lt,{asChild:!0,children:o.jsx("button",{type:"button","aria-label":"Insert block",className:v,children:k})}),e[14]=v,e[15]=N):N=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Ye,{placeholder:"Search blocks…"}),e[16]=C):C=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Ze,{children:"No blocks found."}),e[17]=j):j=e[17];let S;e[18]!==h||e[19]!==s||e[20]!==x?(S=x.length>0&&o.jsx(me,{heading:s?pe.site:void 0,children:x.map(T=>o.jsx(xe,{type:T,onInsert:h},T.resolveType))}),e[18]=h,e[19]=s,e[20]=x,e[21]=S):S=e[21];let B;e[22]!==p||e[23]!==h||e[24]!==s?(B=p.length>0&&o.jsx(me,{heading:s?pe.app:void 0,children:p.map(T=>o.jsx(xe,{type:T,onInsert:h},T.resolveType))}),e[22]=p,e[23]=h,e[24]=s,e[25]=B):B=e[25];let w;e[26]!==S||e[27]!==B?(w=o.jsx(st,{className:"w-80 p-0",align:"center",children:o.jsxs(et,{children:[C,o.jsxs(tt,{className:"max-h-80",children:[j,S,B]})]})}),e[26]=S,e[27]=B,e[28]=w):w=e[28];let A;e[29]!==d||e[30]!==N||e[31]!==w?(A=o.jsxs(ot,{open:d,onOpenChange:f,children:[N,w]}),e[29]=d,e[30]=N,e[31]=w,e[32]=A):A=e[32];let _;return e[33]!==A||e[34]!==a||e[35]!==b?(_=o.jsxs("div",{className:a,children:[b,A]}),e[33]=A,e[34]=a,e[35]=b,e[36]=_):_=e[36],_}function gt({html:c,placeholder:e,onChange:t}){const r=K.useRef(t);r.current=t;const l=ct({extensions:[dt.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ft.configure({placeholder:e??"Write something…"})],content:c||"",editorProps:{attributes:{class:V("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:i})=>{const d=i.getHTML();r.current(d==="<p></p>"?"":d)}});return l?o.jsxs("div",{className:"relative",children:[l.isFocused&&o.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[o.jsx(le,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:o.jsx(Je,{size:14})}),o.jsx(le,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:o.jsx(He,{size:14})}),o.jsx(le,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:o.jsx(Xe,{size:14})}),o.jsx(le,{active:l.isActive("link"),label:"Link",onClick:()=>{const i=l.getAttributes("link").href,d=window.prompt("Link URL",i??"https://");d!==null&&(d===""?l.chain().focus().unsetLink().run():l.chain().focus().setLink({href:d}).run())},children:o.jsx(at,{size:14})})]}),o.jsx(ut,{editor:l,className:"text-[15px] text-foreground"})]}):null}function le(c){const e=$.c(8),{active:t,label:r,onClick:l,children:i}=c,d=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[0]!==d?(f=V("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",d),e[0]=d,e[1]=f):f=e[1];let p;return e[2]!==t||e[3]!==i||e[4]!==r||e[5]!==l||e[6]!==f?(p=o.jsx("button",{type:"button","aria-label":r,"aria-pressed":t,onMouseDown:ht,onClick:l,className:f,children:i}),e[2]=t,e[3]=i,e[4]=r,e[5]=l,e[6]=f,e[7]=p):p=e[7],p}function ht(c){return c.preventDefault()}const bt=["1","2","3"],he={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function vt(c){const e=$.c(19),{text:t,level:r,onChange:l}=c,[i,d]=K.useState(!1),f=r||"2";let p;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==t?(p=i&&o.jsx(ue,{children:bt.map(g=>o.jsxs(re,{active:f===g,label:`Heading ${g}`,onClick:()=>l({text:t,level:g}),children:["H",g]},g))}),e[0]=i,e[1]=f,e[2]=l,e[3]=t,e[4]=p):p=e[4];let x;e[5]!==f||e[6]!==l?(x=g=>l({text:g,level:f}),e[5]=f,e[6]=l,e[7]=x):x=e[7];let u,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(!0),h=()=>d(!1),e[8]=u,e[9]=h):(u=e[8],h=e[9]);const s=he[f]??he[2];let n;e[10]!==s?(n=V("text-foreground",s),e[10]=s,e[11]=n):n=e[11];let a;e[12]!==x||e[13]!==n||e[14]!==t?(a=o.jsx(R,{value:t,onChange:x,onFocus:u,onBlur:h,placeholder:"Heading",className:n}),e[12]=x,e[13]=n,e[14]=t,e[15]=a):a=e[15];let m;return e[16]!==p||e[17]!==a?(m=o.jsxs("div",{className:"relative",children:[p,a]}),e[16]=p,e[17]=a,e[18]=m):m=e[18],m}function yt(c){const e=$.c(3),{quote:t,onChange:r}=c;let l;return e[0]!==r||e[1]!==t?(l=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(R,{value:t,onChange:r,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=r,e[1]=t,e[2]=l):l=e[2],l}function jt(c){const e=$.c(15),{code:t,language:r,onChange:l}=c;let i;e[0]!==t||e[1]!==l?(i=u=>l({code:t,language:u.target.value}),e[0]=t,e[1]=l,e[2]=i):i=e[2];let d;e[3]!==r||e[4]!==i?(d=o.jsx("input",{value:r,onChange:i,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=r,e[4]=i,e[5]=d):d=e[5];let f;e[6]!==r||e[7]!==l?(f=u=>l({code:u,language:r}),e[6]=r,e[7]=l,e[8]=f):f=e[8];let p;e[9]!==t||e[10]!==f?(p=o.jsx(R,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=p):p=e[11];let x;return e[12]!==d||e[13]!==p?(x=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[d,p]}),e[12]=d,e[13]=p,e[14]=x):x=e[14],x}function Nt(c){const e=$.c(17),{items:t,style:r,onChange:l}=c,i=r==="ordered",d=t.length?t.split(`
2
2
  `):[""],[f,p]=K.useState(!1),x=K.useRef([]);let u;e[0]!==l||e[1]!==r?(u=N=>l({items:N.join(`
3
3
  `),style:r}),e[0]=l,e[1]=r,e[2]=u):u=e[2];const h=u,s=(N,C)=>requestAnimationFrame(()=>{const j=x.current[N];if(!j)return;j.focus();const S=C==="end"?j.value.length:0;j.setSelectionRange(S,S)}),n="relative";let a,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>p(!0),m=N=>{N.currentTarget.contains(N.relatedTarget)||p(!1)},e[3]=a,e[4]=m):(a=e[3],m=e[4]);let g;e[5]!==f||e[6]!==t||e[7]!==l||e[8]!==i?(g=f&&o.jsxs(ue,{children:[o.jsx(re,{active:!i,label:"Bulleted",onClick:()=>l({items:t,style:"unordered"}),children:"•"}),o.jsx(re,{active:i,label:"Numbered",onClick:()=>l({items:t,style:"ordered"}),children:"1."})]}),e[5]=f,e[6]=t,e[7]=l,e[8]=i,e[9]=g):g=e[9];const b="space-y-1",y=d.map((N,C)=>o.jsxs("li",{className:"flex items-start gap-2.5",children:[o.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:i?`${C+1}.`:"•"}),o.jsx(R,{inputRef:j=>{x.current[C]=j},value:N,onChange:j=>{const S=[...d];S[C]=j,h(S)},onKeyDown:j=>{const S=j.currentTarget;if(j.key==="Enter"){j.preventDefault();const B=[...d];B.splice(C+1,0,""),h(B),s(C+1,"start")}else j.key==="Backspace"&&N===""&&d.length>1?(j.preventDefault(),h(d.filter((B,w)=>w!==C)),s(Math.max(0,C-1),"end")):j.key==="ArrowUp"&&S.selectionStart===0&&C>0?(j.preventDefault(),s(C-1,"end")):j.key==="ArrowDown"&&S.selectionEnd===N.length&&C<d.length-1&&(j.preventDefault(),s(C+1,"end"))},placeholder:"List item",className:"text-[15px] leading-relaxed text-foreground"})]},C));let v;e[10]!==y?(v=o.jsx("ul",{className:b,children:y}),e[10]=y,e[11]=v):v=e[11];let k;return e[12]!==a||e[13]!==m||e[14]!==g||e[15]!==v?(k=o.jsxs("div",{className:n,onFocus:a,onBlur:m,children:[g,v]}),e[12]=a,e[13]=m,e[14]=g,e[15]=v,e[16]=k):k=e[16],k}function Ct(c){const e=$.c(37),{block:t,onChange:r}=c;let l;e[0]!==t.size?(l=I(t.size)||"normal",e[0]=t.size,e[1]=l):l=e[1];const i=l;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d={type:"string",format:"image-uri",title:"Image"},e[2]=d):d=e[2];let f;e[3]!==t||e[4]!==r?(f=v=>r({...t,url:v}),e[3]=t,e[4]=r,e[5]=f):f=e[5];let p;e[6]!==t.url||e[7]!==f?(p=o.jsx(Oe,{schema:d,value:t.url,onChange:f,path:"block-image-url",label:"Image"}),e[6]=t.url,e[7]=f,e[8]=p):p=e[8];let x;e[9]!==t.caption?(x=I(t.caption),e[9]=t.caption,e[10]=x):x=e[10];let u;e[11]!==t||e[12]!==r?(u=v=>r({...t,caption:v}),e[11]=t,e[12]=r,e[13]=u):u=e[13];let h;e[14]!==x||e[15]!==u?(h=o.jsx(R,{value:x,onChange:u,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=x,e[15]=u,e[16]=h):h=e[16];let s;e[17]===Symbol.for("react.memo_cache_sentinel")?(s=["normal","full"],e[17]=s):s=e[17];let n;e[18]!==t||e[19]!==r||e[20]!==i?(n=o.jsx("div",{className:"flex items-center gap-1",children:s.map(v=>o.jsx("button",{type:"button",onClick:()=>r({...t,size:v}),className:V("rounded px-2 py-0.5 transition-colors cursor-pointer",i===v?"bg-accent text-accent-foreground":"hover:bg-muted"),children:v==="full"?"Full width":"Normal"},v))}),e[18]=t,e[19]=r,e[20]=i,e[21]=n):n=e[21];let a;e[22]!==t.alt?(a=I(t.alt),e[22]=t.alt,e[23]=a):a=e[23];let m;e[24]!==t||e[25]!==r?(m=v=>r({...t,alt:v.target.value}),e[24]=t,e[25]=r,e[26]=m):m=e[26];let g;e[27]!==a||e[28]!==m?(g=o.jsx("input",{value:a,onChange:m,placeholder:"Alt text (accessibility)",className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[27]=a,e[28]=m,e[29]=g):g=e[29];let b;e[30]!==g||e[31]!==n?(b=o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[n,g]}),e[30]=g,e[31]=n,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==p||e[35]!==h?(y=o.jsxs("div",{className:"space-y-2",children:[p,h,b]}),e[33]=b,e[34]=p,e[35]=h,e[36]=y):y=e[36],y}function kt(c){const e=c.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=c.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function wt(c){const e=$.c(21),{url:t,caption:r,onChange:l}=c;let i;e[0]!==t?(i=kt(t),e[0]=t,e[1]=i):i=e[1];const d=i;let f;e[2]!==r||e[3]!==d?(f=d?o.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:o.jsx("iframe",{src:d,title:r||"Video",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):o.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:"Paste a YouTube or Vimeo URL to preview"}),e[2]=r,e[3]=d,e[4]=f):f=e[4];let p;e[5]!==r||e[6]!==l?(p=n=>l({url:n.target.value,caption:r}),e[5]=r,e[6]=l,e[7]=p):p=e[7];let x;e[8]!==p||e[9]!==t?(x=o.jsx("input",{value:t,onChange:p,placeholder:"https://youtube.com/watch?v=…",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[8]=p,e[9]=t,e[10]=x):x=e[10];let u;e[11]!==l||e[12]!==t?(u=n=>l({url:t,caption:n}),e[11]=l,e[12]=t,e[13]=u):u=e[13];let h;e[14]!==r||e[15]!==u?(h=o.jsx(R,{value:r,onChange:u,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=r,e[15]=u,e[16]=h):h=e[16];let s;return e[17]!==f||e[18]!==x||e[19]!==h?(s=o.jsxs("div",{className:"space-y-2",children:[f,x,h]}),e[17]=f,e[18]=x,e[19]=h,e[20]=s):s=e[20],s}function St(){const c=$.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center py-3","aria-label":"Divider",children:o.jsx("span",{className:"h-px flex-1 bg-border"})}),c[0]=e):e=c[0],e}function It(c){const e=$.c(16),{text:t,href:r,onChange:l}=c;let i;e[0]!==r||e[1]!==l?(i=h=>l({text:h.target.value,href:r}),e[0]=r,e[1]=l,e[2]=i):i=e[2];const d=Math.max(t.length||11,8);let f;e[3]!==i||e[4]!==d||e[5]!==t?(f=o.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:o.jsx("input",{value:t,onChange:i,placeholder:"Button label",size:d,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[3]=i,e[4]=d,e[5]=t,e[6]=f):f=e[6];let p;e[7]!==l||e[8]!==t?(p=h=>l({text:t,href:h.target.value}),e[7]=l,e[8]=t,e[9]=p):p=e[9];let x;e[10]!==r||e[11]!==p?(x=o.jsx("input",{value:r,onChange:p,placeholder:"https://destination-url.com",className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[10]=r,e[11]=p,e[12]=x):x=e[12];let u;return e[13]!==f||e[14]!==x?(u=o.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,x]}),e[13]=f,e[14]=x,e[15]=u):u=e[15],u}const ae=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function Bt(c){const e=$.c(45),{title:t,body:r,variant:l,onChange:i}=c,[d,f]=K.useState(!1);let p;e[0]!==l?(p=ae.find(w=>w.value===l)??ae[0],e[0]=l,e[1]=p):p=e[1];const x=p;let u,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>f(!0),h=w=>{w.currentTarget.contains(w.relatedTarget)||f(!1)},e[2]=u,e[3]=h):(u=e[2],h=e[3]);let s;e[4]!==r||e[5]!==d||e[6]!==i||e[7]!==t||e[8]!==x.value?(s=d&&o.jsx(ue,{children:ae.map(w=>o.jsx(re,{active:x.value===w.value,label:w.value,onClick:()=>i({title:t,body:r,variant:w.value}),children:o.jsx("span",{style:{color:w.color},children:w.icon})},w.value))}),e[4]=r,e[5]=d,e[6]=i,e[7]=t,e[8]=x.value,e[9]=s):s=e[9];const n=`3px solid ${x.color}`,a=`color-mix(in oklch, ${x.color} 8%, transparent)`;let m;e[10]!==n||e[11]!==a?(m={borderLeft:n,backgroundColor:a},e[10]=n,e[11]=a,e[12]=m):m=e[12];let g;e[13]!==x.color?(g={color:x.color},e[13]=x.color,e[14]=g):g=e[14];let b;e[15]!==x.icon?(b=o.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:x.icon}),e[15]=x.icon,e[16]=b):b=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==l?(y=w=>i({title:w.target.value,body:r,variant:l}),e[17]=r,e[18]=i,e[19]=l,e[20]=y):y=e[20];let v;e[21]!==x.color?(v={color:x.color},e[21]=x.color,e[22]=v):v=e[22];let k;e[23]!==y||e[24]!==v||e[25]!==t?(k=o.jsx("input",{value:t,onChange:y,placeholder:"Callout title",className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:v}),e[23]=y,e[24]=v,e[25]=t,e[26]=k):k=e[26];let N;e[27]!==k||e[28]!==g||e[29]!==b?(N=o.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:g,children:[b,k]}),e[27]=k,e[28]=g,e[29]=b,e[30]=N):N=e[30];let C;e[31]!==i||e[32]!==t||e[33]!==l?(C=w=>i({title:t,body:w,variant:l}),e[31]=i,e[32]=t,e[33]=l,e[34]=C):C=e[34];let j;e[35]!==r||e[36]!==C?(j=o.jsx(R,{value:r,onChange:C,placeholder:"Callout text…",className:"text-[15px] leading-relaxed text-foreground"}),e[35]=r,e[36]=C,e[37]=j):j=e[37];let S;e[38]!==N||e[39]!==j||e[40]!==m?(S=o.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:m,children:[N,j]}),e[38]=N,e[39]=j,e[40]=m,e[41]=S):S=e[41];let B;return e[42]!==S||e[43]!==s?(B=o.jsxs("div",{className:"relative",onFocus:u,onBlur:h,children:[s,S]}),e[42]=S,e[43]=s,e[44]=B):B=e[44],B}function $t(c){const e=$.c(25),{value:t,label:r,description:l,onChange:i}=c;let d;e[0]!==l||e[1]!==r||e[2]!==i?(d=n=>i({value:n.target.value,label:r,description:l}),e[0]=l,e[1]=r,e[2]=i,e[3]=d):d=e[3];let f;e[4]!==d||e[5]!==t?(f=o.jsx("input",{value:t,onChange:d,placeholder:"42%",className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[4]=d,e[5]=t,e[6]=f):f=e[6];let p;e[7]!==l||e[8]!==i||e[9]!==t?(p=n=>i({value:t,label:n.target.value,description:l}),e[7]=l,e[8]=i,e[9]=t,e[10]=p):p=e[10];let x;e[11]!==r||e[12]!==p?(x=o.jsx("input",{value:r,onChange:p,placeholder:"Label",className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[11]=r,e[12]=p,e[13]=x):x=e[13];let u;e[14]!==r||e[15]!==i||e[16]!==t?(u=n=>i({value:t,label:r,description:n}),e[14]=r,e[15]=i,e[16]=t,e[17]=u):u=e[17];let h;e[18]!==l||e[19]!==u?(h=o.jsx(R,{value:l,onChange:u,placeholder:"Optional description",className:"max-w-md text-center text-sm text-muted-foreground"}),e[18]=l,e[19]=u,e[20]=h):h=e[20];let s;return e[21]!==f||e[22]!==x||e[23]!==h?(s=o.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,x,h]}),e[21]=f,e[22]=x,e[23]=h,e[24]=s):s=e[24],s}function At(c){const e=$.c(19),{cards:t,onChange:r}=c;let l,i,d,f,p;if(e[0]!==t||e[1]!==r){i=ne(t);let s;e[7]!==r?(s=a=>r(JSON.stringify(a)),e[7]=r,e[8]=s):s=e[8],l=s;const n=(a,m)=>l(i.map((g,b)=>b===a?{...g,...m}:g));p="space-y-2",d="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,m)=>o.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(W,{label:"Remove card",onClick:()=>l(i.filter((g,b)=>b!==m))})}),o.jsx("input",{value:I(a.icon),onChange:g=>n(m,{icon:g.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),o.jsx("input",{value:I(a.title),onChange:g=>n(m,{title:g.target.value}),placeholder:"Card title",className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx(R,{value:I(a.body),onChange:g=>n(m,{body:g}),placeholder:"Card body",className:"text-sm text-muted-foreground"})]},m)),e[0]=t,e[1]=r,e[2]=l,e[3]=i,e[4]=d,e[5]=f,e[6]=p}else l=e[2],i=e[3],d=e[4],f=e[5],p=e[6];let x;e[9]!==d||e[10]!==f?(x=o.jsx("div",{className:d,children:f}),e[9]=d,e[10]=f,e[11]=x):x=e[11];let u;e[12]!==l||e[13]!==i?(u=i.length<3&&o.jsx(Y,{label:"Add card",onClick:()=>l([...i,{title:"",body:""}])}),e[12]=l,e[13]=i,e[14]=u):u=e[14];let h;return e[15]!==p||e[16]!==x||e[17]!==u?(h=o.jsxs("div",{className:p,children:[x,u]}),e[15]=p,e[16]=x,e[17]=u,e[18]=h):h=e[18],h}function Tt(c){const e=$.c(27),{title:t,items:r,onChange:l}=c;let i,d,f,p,x;if(e[0]!==r||e[1]!==l||e[2]!==t){d=ne(r);let n;e[8]!==l||e[9]!==t?(n=m=>l({title:t,items:JSON.stringify(m)}),e[8]=l,e[9]=t,e[10]=n):n=e[10],i=n,p="space-y-2";let a;e[11]!==r||e[12]!==l?(a=m=>l({title:m.target.value,items:r}),e[11]=r,e[12]=l,e[13]=a):a=e[13],e[14]!==a||e[15]!==t?(x=o.jsx("input",{value:t,onChange:a,placeholder:"Checklist title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[14]=a,e[15]=t,e[16]=x):x=e[16],f=d.map((m,g)=>o.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[o.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:o.jsx(mt,{size:15})}),o.jsx(R,{value:m,onChange:b=>i(d.map((y,v)=>v===g?b:y)),placeholder:"Checklist item",className:"text-[15px] text-foreground"}),o.jsx(W,{label:"Remove item",onClick:()=>i(d.filter((b,y)=>y!==g))})]},g)),e[0]=r,e[1]=l,e[2]=t,e[3]=i,e[4]=d,e[5]=f,e[6]=p,e[7]=x}else i=e[3],d=e[4],f=e[5],p=e[6],x=e[7];let u;e[17]!==f?(u=o.jsx("ul",{children:f}),e[17]=f,e[18]=u):u=e[18];let h;e[19]!==i||e[20]!==d?(h=o.jsx(Y,{label:"Add item",onClick:()=>i([...d,""])}),e[19]=i,e[20]=d,e[21]=h):h=e[21];let s;return e[22]!==p||e[23]!==x||e[24]!==u||e[25]!==h?(s=o.jsxs("div",{className:p,children:[x,u,h]}),e[22]=p,e[23]=x,e[24]=u,e[25]=h,e[26]=s):s=e[26],s}function Lt(c){const e=$.c(19),{stats:t,onChange:r}=c;let l,i,d,f,p;if(e[0]!==r||e[1]!==t){i=ne(t);let s;e[7]!==r?(s=a=>r(JSON.stringify(a)),e[7]=r,e[8]=s):s=e[8],l=s;const n=(a,m)=>l(i.map((g,b)=>b===a?{...g,...m}:g));p="space-y-2",d="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,m)=>o.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(W,{label:"Remove stat",onClick:()=>l(i.filter((g,b)=>b!==m))})}),o.jsx("input",{value:I(a.value),onChange:g=>n(m,{value:g.target.value}),placeholder:"99%",className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),o.jsx("input",{value:I(a.label),onChange:g=>n(m,{label:g.target.value}),placeholder:"Label",className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},m)),e[0]=r,e[1]=t,e[2]=l,e[3]=i,e[4]=d,e[5]=f,e[6]=p}else l=e[2],i=e[3],d=e[4],f=e[5],p=e[6];let x;e[9]!==d||e[10]!==f?(x=o.jsx("div",{className:d,children:f}),e[9]=d,e[10]=f,e[11]=x):x=e[11];let u;e[12]!==l||e[13]!==i?(u=i.length<3&&o.jsx(Y,{label:"Add stat",onClick:()=>l([...i,{value:"",label:""}])}),e[12]=l,e[13]=i,e[14]=u):u=e[14];let h;return e[15]!==p||e[16]!==x||e[17]!==u?(h=o.jsxs("div",{className:p,children:[x,u]}),e[15]=p,e[16]=x,e[17]=u,e[18]=h):h=e[18],h}function Pt(c){const e=$.c(29),{title:t,steps:r,onChange:l}=c;let i,d,f,p,x,u;if(e[0]!==l||e[1]!==r||e[2]!==t){d=ne(r);let a;e[9]!==l||e[10]!==t?(a=b=>l({title:t,steps:JSON.stringify(b)}),e[9]=l,e[10]=t,e[11]=a):a=e[11],i=a;const m=(b,y)=>i(d.map((v,k)=>k===b?{...v,...y}:v));x="space-y-2";let g;e[12]!==l||e[13]!==r?(g=b=>l({title:b.target.value,steps:r}),e[12]=l,e[13]=r,e[14]=g):g=e[14],e[15]!==g||e[16]!==t?(u=o.jsx("input",{value:t,onChange:g,placeholder:"Steps title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=g,e[16]=t,e[17]=u):u=e[17],f="space-y-3",p=d.map((b,y)=>o.jsxs("li",{className:"group/item flex gap-4",children:[o.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:y+1}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[o.jsx("input",{value:I(b.title),onChange:v=>m(y,{title:v.target.value}),placeholder:"Step title",className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx(R,{value:I(b.description),onChange:v=>m(y,{description:v}),placeholder:"Step description",className:"text-sm text-muted-foreground"})]}),o.jsx(W,{label:"Remove step",onClick:()=>i(d.filter((v,k)=>k!==y))})]},y)),e[0]=l,e[1]=r,e[2]=t,e[3]=i,e[4]=d,e[5]=f,e[6]=p,e[7]=x,e[8]=u}else i=e[3],d=e[4],f=e[5],p=e[6],x=e[7],u=e[8];let h;e[18]!==f||e[19]!==p?(h=o.jsx("ol",{className:f,children:p}),e[18]=f,e[19]=p,e[20]=h):h=e[20];let s;e[21]!==i||e[22]!==d?(s=o.jsx(Y,{label:"Add step",onClick:()=>i([...d,{title:"",description:""}])}),e[21]=i,e[22]=d,e[23]=s):s=e[23];let n;return e[24]!==x||e[25]!==u||e[26]!==h||e[27]!==s?(n=o.jsxs("div",{className:x,children:[u,h,s]}),e[24]=x,e[25]=u,e[26]=h,e[27]=s,e[28]=n):n=e[28],n}function be(c,e){try{const t=JSON.parse(c||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function Dt(c){const e=$.c(7),{left:t,right:r,onChange:l}=c;let i;if(e[0]!==t||e[1]!==l||e[2]!==r){const d={left:be(t,"Option A"),right:be(r,"Option B")},f=(h,s)=>l({left:h==="left"?JSON.stringify(s):t,right:h==="right"?JSON.stringify(s):r});let p;e[4]!==f?(p=(h,s,n)=>{const a=s.items??[];return o.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[o.jsx("input",{value:I(s.title),onChange:m=>f(h,{...s,title:m.target.value}),placeholder:"Column title",className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),o.jsx("ul",{className:"space-y-1.5",children:a.map((m,g)=>o.jsxs("li",{className:"group/item flex items-start gap-2",children:[o.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:n},children:"✓"}),o.jsx(R,{value:m,onChange:b=>f(h,{...s,items:a.map((y,v)=>v===g?b:y)}),placeholder:"Item",className:"text-sm text-foreground"}),o.jsx(W,{label:"Remove item",onClick:()=>f(h,{...s,items:a.filter((b,y)=>y!==g)})})]},g))}),o.jsx(Y,{label:"Add item",onClick:()=>f(h,{...s,items:[...a,""]})})]})},e[4]=f,e[5]=p):p=e[5];const x=p;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=V("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[6]=u):u=e[6],i=o.jsxs("div",{className:u,children:[x("left",d.left,"oklch(0.65 0.17 150)"),x("right",d.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=r,e[3]=i}else i=e[3];return i}const _t="vtex/loaders/intelligentSearch/productList.ts";function G(c){return c&&typeof c=="object"&&!Array.isArray(c)?c:null}function Z(c){const e=G(G(c)?.props);return!e||!Array.isArray(e.ids)?[]:e.ids.map(t=>typeof t=="string"||typeof t=="number"?String(t):"").filter(Boolean)}function Et(c){const e=G(c)??{},t=je(c),r=G(e.props)??{},i={ids:Z(c)};return typeof r.hideUnavailableItems=="boolean"&&(i.hideUnavailableItems=r.hideUnavailableItems),{__resolveType:t,props:i}}function je(c){const e=G(c)??{};return typeof e.__resolveType=="string"?e.__resolveType:_t}function Ne(c,e){const t=G(c)??{},r=G(t.props)??{},l=je(c);return{...t,__resolveType:l,props:{...r,ids:e,simulationBehavior:r.simulationBehavior??"default"}}}function F(c){return c&&typeof c=="object"&&!Array.isArray(c)?c:null}function D(c){return typeof c=="string"?c:""}function se(c){return typeof c=="number"?String(c):D(c)}function Ut(c){const e=D(F(c)?.__resolveType),t=Z(c).join(",");return`${e}|${t}`}function Rt(c){const e=F(c.product);return e?{...c,...e}:c}function Ce(c){const e=F(c.product);if(e){const r=Ce(e);if(r)return r}const t=D(c.imageUrl)||D(c.thumbnailUrl);if(t)return t;for(const r of["image","images"]){const l=c[r];if(typeof l=="string"&&l)return l;if(Array.isArray(l))for(const i of l){if(typeof i=="string"&&i)return i;const d=F(i),f=D(d?.url)||D(d?.contentUrl);if(f)return f}}return null}function Ot(c){return/^\d{8,14}$/.test(c.trim())}function zt(c){for(const e of c){const t=e.trim();if(t&&!Ot(t))return t}return c.find(e=>e.trim())?.trim()??""}function Ft(c){const e=F(c.isVariantOf),t=F(c.product),r=t?F(t.isVariantOf):null;return zt([D(e?.name),D(r?.name),D(c.productName),t?D(t.productName):"",t?D(t.name):"",D(c.name),D(c.alternateName),D(F(c.brand)?.name)])}function ce(c){const e=F(c);if(!e)return null;const t=Rt(e),r=se(t.sku)||se(t.productID),l=se(t.inProductGroupWithID);return{id:r||l||se(t.productId)||D(t["@id"]),sku:r,groupId:l,name:Ft(t),imageUrl:Ce(t)}}function ve(c){return c.map(e=>e==null?null:ce(e))}function Vt(c){if(Array.isArray(c))return ve(c);const e=F(c);if(!e)return[];for(const r of["products","product","items","data","result"]){const l=e[r];if(Array.isArray(l))return ve(l);const i=ce(l);if(i)return[i]}const t=ce(c);return t?[t]:[]}function Kt(c){return[...new Set([c.id,c.sku,c.groupId].filter(Boolean))]}function Mt(c,e){const t=c.map(l=>l.trim()).filter(Boolean),r=new Map;for(const l of e)if(l)for(const i of Kt(l))r.set(i,l);return t.map((l,i)=>r.get(l)??e[i]??null)}async function qt(c,e){const t=await fetch(`/api/${c.orgSlug}/sandbox/${encodeURIComponent(c.virtualMcpId)}/${encodeURIComponent(c.branch)}/preview-invoke`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Et(e))});if(!t.ok)throw new Error(`Failed to resolve product loader: ${t.status}`);const r=await t.json();if(r&&typeof r=="object"&&!Array.isArray(r)&&"error"in r&&typeof r.error=="string")throw new Error(r.error);return r}function ke(c){const e=$.c(12),t=pt(),r=Z(c),l=Ut(c),i=t?`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`:"";let d;e[0]!==c||e[1]!==t?(d=async()=>{const n=await qt(t,c);return Vt(n)},e[0]=c,e[1]=t,e[2]=d):d=e[2];const f=Se({queryKey:Ie.sandboxInvoke(i,l),queryFn:d,enabled:!!t&&r.some(Jt),staleTime:6e4,retry:1});let p;e[3]!==f.data?(p=f.data??[],e[3]=f.data,e[4]=p):p=e[4];const x=p;let u;e[5]!==x?(u=x.filter(Gt),e[5]=x,e[6]=u):u=e[6];const h=Mt(r,x);let s;return e[7]!==f.isError||e[8]!==f.isLoading||e[9]!==u||e[10]!==h?(s={products:u,productsById:h,isLoading:f.isLoading,isError:f.isError},e[7]=f.isError,e[8]=f.isLoading,e[9]=u,e[10]=h,e[11]=s):s=e[11],s}function Gt(c){return c!==null}function Jt(c){return c.trim()}function we(c){const e=$.c(5),{preview:t,loading:r}=c;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"h-12 w-12 shrink-0 animate-pulse rounded-md bg-muted"}),e[0]=i):i=e[0],i}if(t?.imageUrl){let i;return e[1]!==t.imageUrl||e[2]!==t.name?(i=o.jsx("img",{src:t.imageUrl,alt:t.name,className:"h-12 w-12 shrink-0 rounded-md border object-cover"}),e[1]=t.imageUrl,e[2]=t.name,e[3]=i):i=e[3],i}let l;return e[4]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-md border bg-muted text-[10px] text-muted-foreground",children:"No img"}),e[4]=l):l=e[4],l}function Ht(c){const e=$.c(26),{loader:t,ids:r,onChange:l,label:i}=c,{productsById:d,isLoading:f,isError:p}=ke(t);let x;e[0]!==r||e[1]!==l?(x=(y,v)=>l(r.map((k,N)=>N===y?v:k)),e[0]=r,e[1]=l,e[2]=x):x=e[2];const u=x;let h;e[3]!==i?(h=o.jsx(oe,{className:"text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=h):h=e[4];let s;e[5]!==p?(s=p&&o.jsx("p",{className:"text-xs text-destructive",children:"Could not load product details from VTEX."}),e[5]=p,e[6]=s):s=e[6];let n;e[7]!==r.length?(n=r.length===0&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"No product IDs yet — add one below."}),e[7]=r.length,e[8]=n):n=e[8];let a;e[9]!==r||e[10]!==f||e[11]!==l||e[12]!==d||e[13]!==u?(a=r.map((y,v)=>{const k=d[v]??null;return o.jsxs("li",{className:"group/item flex items-center gap-3",children:[o.jsx(we,{preview:k,loading:f&&!!y}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[o.jsx("p",{className:V("truncate text-sm font-medium",k?.name?"text-foreground":"text-muted-foreground"),children:k?.name||(f&&y?"Loading product…":"Product")}),o.jsx("input",{value:y,onChange:N=>u(v,N.target.value),placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),o.jsx(W,{label:"Remove product ID",onClick:()=>l(r.filter((N,C)=>C!==v))})]},v)}),e[9]=r,e[10]=f,e[11]=l,e[12]=d,e[13]=u,e[14]=a):a=e[14];let m;e[15]!==a?(m=o.jsx("ul",{className:"space-y-2",children:a}),e[15]=a,e[16]=m):m=e[16];let g;e[17]!==r||e[18]!==l?(g=o.jsx(Y,{label:"Add product ID",onClick:()=>l([...r,""])}),e[17]=r,e[18]=l,e[19]=g):g=e[19];let b;return e[20]!==h||e[21]!==s||e[22]!==n||e[23]!==m||e[24]!==g?(b=o.jsxs("div",{className:"space-y-2",children:[h,s,n,m,g]}),e[20]=h,e[21]=s,e[22]=n,e[23]=m,e[24]=g,e[25]=b):b=e[25],b}function Xt(c){const e=$.c(49),{block:t,onChange:r}=c;let l;e[0]!==t.product?(l=Z(t.product),e[0]=t.product,e[1]=l):l=e[1];const d=l[0]??"",{productsById:f,isLoading:p,isError:x}=ke(t.product),u=f[0]??null;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Product card"}),e[2]=h):h=e[2];const s=p&&!!d;let n;e[3]!==u||e[4]!==s?(n=o.jsx(we,{preview:u,loading:s}),e[3]=u,e[4]=s,e[5]=n):n=e[5];const a=u?.name||(p&&d?"Loading product…":"Product preview");let m;e[6]!==a?(m=o.jsx("p",{className:"truncate text-sm font-medium",children:a}),e[6]=a,e[7]=m):m=e[7];let g;e[8]!==d?(g=d&&o.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["ID ",d]}),e[8]=d,e[9]=g):g=e[9];let b;e[10]!==x?(b=x&&o.jsx("p",{className:"text-xs text-destructive",children:"Could not load product details from VTEX."}),e[10]=x,e[11]=b):b=e[11];let y;e[12]!==m||e[13]!==g||e[14]!==b?(y=o.jsxs("div",{className:"min-w-0 flex-1",children:[m,g,b]}),e[12]=m,e[13]=g,e[14]=b,e[15]=y):y=e[15];let v;e[16]!==n||e[17]!==y?(v=o.jsxs("div",{className:"flex items-center gap-3 rounded-md border bg-background p-3",children:[n,y]}),e[16]=n,e[17]=y,e[18]=v):v=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(oe,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:"CTA label"}),e[19]=k):k=e[19];let N;e[20]!==t.textCta?(N=I(t.textCta),e[20]=t.textCta,e[21]=N):N=e[21];let C;e[22]!==t||e[23]!==r?(C=E=>r({...t,textCta:E.target.value}),e[22]=t,e[23]=r,e[24]=C):C=e[24];let j;e[25]!==N||e[26]!==C?(j=o.jsxs("div",{className:"space-y-2",children:[k,o.jsx("input",{id:"product-card-cta",value:N,onChange:C,placeholder:"Ver produto",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[25]=N,e[26]=C,e[27]=j):j=e[27];let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(oe,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:"Product slug"}),e[28]=S):S=e[28];let B;e[29]!==t.productSlug?(B=I(t.productSlug),e[29]=t.productSlug,e[30]=B):B=e[30];let w;e[31]!==t||e[32]!==r?(w=E=>r({...t,productSlug:E.target.value}),e[31]=t,e[32]=r,e[33]=w):w=e[33];let A;e[34]!==B||e[35]!==w?(A=o.jsxs("div",{className:"space-y-2",children:[S,o.jsx("input",{id:"product-card-slug",value:B,onChange:w,placeholder:"product-slug",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[34]=B,e[35]=w,e[36]=A):A=e[36];let _;e[37]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(oe,{htmlFor:"product-card-id",className:"text-xs text-muted-foreground",children:"VTEX product ID"}),e[37]=_):_=e[37];let T;e[38]!==t||e[39]!==r?(T=E=>r({...t,product:Ne(t.product,E.target.value?[E.target.value]:[])}),e[38]=t,e[39]=r,e[40]=T):T=e[40];let z;e[41]!==d||e[42]!==T?(z=o.jsxs("div",{className:"space-y-2",children:[_,o.jsx("input",{id:"product-card-id",value:d,onChange:T,placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[41]=d,e[42]=T,e[43]=z):z=e[43];let O;return e[44]!==v||e[45]!==j||e[46]!==A||e[47]!==z?(O=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[h,v,j,A,z]}),e[44]=v,e[45]=j,e[46]=A,e[47]=z,e[48]=O):O=e[48],O}function Qt(c){const e=$.c(20),{block:t,onChange:r}=c;let l;e[0]!==t.products?(l=Z(t.products),e[0]=t.products,e[1]=l):l=e[1];const i=l;let d;e[2]!==t.title?(d=I(t.title),e[2]=t.title,e[3]=d):d=e[3];let f;e[4]!==t||e[5]!==r?(f=s=>r({...t,title:s.target.value}),e[4]=t,e[5]=r,e[6]=f):f=e[6];let p;e[7]!==d||e[8]!==f?(p=o.jsx("input",{value:d,onChange:f,placeholder:"Shelf title",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[7]=d,e[8]=f,e[9]=p):p=e[9];let x;e[10]!==t||e[11]!==r?(x=s=>r({...t,products:Ne(t.products,s)}),e[10]=t,e[11]=r,e[12]=x):x=e[12];let u;e[13]!==t.products||e[14]!==i||e[15]!==x?(u=o.jsx(Ht,{loader:t.products,label:"VTEX product IDs",ids:i,onChange:x}),e[13]=t.products,e[14]=i,e[15]=x,e[16]=u):u=e[16];let h;return e[17]!==p||e[18]!==u?(h=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[p,u]}),e[17]=p,e[18]=u,e[19]=h):h=e[19],h}function Wt(c){const e=$.c(169),{block:t,meta:r,onChange:l}=c,i=t.__resolveType??"",d=ze(i);if(Fe(i))switch(d){case"Paragraph":{let s;e[0]!==t.html?(s=I(t.html),e[0]=t.html,e[1]=s):s=e[1];let n;e[2]!==t||e[3]!==l?(n=m=>l({...t,html:m}),e[2]=t,e[3]=l,e[4]=n):n=e[4];let a;return e[5]!==s||e[6]!==n?(a=o.jsx(gt,{html:s,placeholder:"Write something…",onChange:n}),e[5]=s,e[6]=n,e[7]=a):a=e[7],a}case"Heading":{let s;e[8]!==t.text?(s=I(t.text),e[8]=t.text,e[9]=s):s=e[9];let n;e[10]!==t.level?(n=I(t.level),e[10]=t.level,e[11]=n):n=e[11];let a;e[12]!==t||e[13]!==l?(a=g=>l({...t,...g}),e[12]=t,e[13]=l,e[14]=a):a=e[14];let m;return e[15]!==s||e[16]!==n||e[17]!==a?(m=o.jsx(vt,{text:s,level:n,onChange:a}),e[15]=s,e[16]=n,e[17]=a,e[18]=m):m=e[18],m}case"Quote":{let s;e[19]!==t.quote?(s=I(t.quote),e[19]=t.quote,e[20]=s):s=e[20];let n;e[21]!==t||e[22]!==l?(n=m=>l({...t,quote:m}),e[21]=t,e[22]=l,e[23]=n):n=e[23];let a;return e[24]!==s||e[25]!==n?(a=o.jsx(yt,{quote:s,onChange:n}),e[24]=s,e[25]=n,e[26]=a):a=e[26],a}case"Code":{let s;e[27]!==t.code?(s=I(t.code),e[27]=t.code,e[28]=s):s=e[28];let n;e[29]!==t.language?(n=I(t.language),e[29]=t.language,e[30]=n):n=e[30];let a;e[31]!==t||e[32]!==l?(a=g=>l({...t,...g}),e[31]=t,e[32]=l,e[33]=a):a=e[33];let m;return e[34]!==s||e[35]!==n||e[36]!==a?(m=o.jsx(jt,{code:s,language:n,onChange:a}),e[34]=s,e[35]=n,e[36]=a,e[37]=m):m=e[37],m}case"List":{let s;e[38]!==t.items?(s=I(t.items),e[38]=t.items,e[39]=s):s=e[39];let n;e[40]!==t.style?(n=I(t.style),e[40]=t.style,e[41]=n):n=e[41];let a;e[42]!==t||e[43]!==l?(a=g=>l({...t,...g}),e[42]=t,e[43]=l,e[44]=a):a=e[44];let m;return e[45]!==s||e[46]!==n||e[47]!==a?(m=o.jsx(Nt,{items:s,style:n,onChange:a}),e[45]=s,e[46]=n,e[47]=a,e[48]=m):m=e[48],m}case"BlockImage":{let s;return e[49]!==t||e[50]!==l?(s=o.jsx(Ct,{block:t,onChange:l}),e[49]=t,e[50]=l,e[51]=s):s=e[51],s}case"Video":{let s;e[52]!==t.url?(s=I(t.url),e[52]=t.url,e[53]=s):s=e[53];let n;e[54]!==t.caption?(n=I(t.caption),e[54]=t.caption,e[55]=n):n=e[55];let a;e[56]!==t||e[57]!==l?(a=g=>l({...t,...g}),e[56]=t,e[57]=l,e[58]=a):a=e[58];let m;return e[59]!==s||e[60]!==n||e[61]!==a?(m=o.jsx(wt,{url:s,caption:n,onChange:a}),e[59]=s,e[60]=n,e[61]=a,e[62]=m):m=e[62],m}case"Divider":{let s;return e[63]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(St,{}),e[63]=s):s=e[63],s}case"Cta":{let s;e[64]!==t.text?(s=I(t.text),e[64]=t.text,e[65]=s):s=e[65];let n;e[66]!==t.href?(n=I(t.href),e[66]=t.href,e[67]=n):n=e[67];let a;e[68]!==t||e[69]!==l?(a=g=>l({...t,...g}),e[68]=t,e[69]=l,e[70]=a):a=e[70];let m;return e[71]!==s||e[72]!==n||e[73]!==a?(m=o.jsx(It,{text:s,href:n,onChange:a}),e[71]=s,e[72]=n,e[73]=a,e[74]=m):m=e[74],m}case"Callout":{let s;e[75]!==t.title?(s=I(t.title),e[75]=t.title,e[76]=s):s=e[76];let n;e[77]!==t.body?(n=I(t.body),e[77]=t.body,e[78]=n):n=e[78];let a;e[79]!==t.variant?(a=I(t.variant),e[79]=t.variant,e[80]=a):a=e[80];let m;e[81]!==t||e[82]!==l?(m=b=>l({...t,...b}),e[81]=t,e[82]=l,e[83]=m):m=e[83];let g;return e[84]!==s||e[85]!==n||e[86]!==a||e[87]!==m?(g=o.jsx(Bt,{title:s,body:n,variant:a,onChange:m}),e[84]=s,e[85]=n,e[86]=a,e[87]=m,e[88]=g):g=e[88],g}case"Stat":{let s;e[89]!==t.value?(s=I(t.value),e[89]=t.value,e[90]=s):s=e[90];let n;e[91]!==t.label?(n=I(t.label),e[91]=t.label,e[92]=n):n=e[92];let a;e[93]!==t.description?(a=I(t.description),e[93]=t.description,e[94]=a):a=e[94];let m;e[95]!==t||e[96]!==l?(m=b=>l({...t,...b}),e[95]=t,e[96]=l,e[97]=m):m=e[97];let g;return e[98]!==s||e[99]!==n||e[100]!==a||e[101]!==m?(g=o.jsx($t,{value:s,label:n,description:a,onChange:m}),e[98]=s,e[99]=n,e[100]=a,e[101]=m,e[102]=g):g=e[102],g}case"StatGroup":{let s;e[103]!==t.stats?(s=I(t.stats),e[103]=t.stats,e[104]=s):s=e[104];let n;e[105]!==t||e[106]!==l?(n=m=>l({...t,stats:m}),e[105]=t,e[106]=l,e[107]=n):n=e[107];let a;return e[108]!==s||e[109]!==n?(a=o.jsx(Lt,{stats:s,onChange:n}),e[108]=s,e[109]=n,e[110]=a):a=e[110],a}case"CardGroup":{let s;e[111]!==t.cards?(s=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[111]=t.cards,e[112]=s):s=e[112];let n;e[113]!==t||e[114]!==l?(n=m=>l({...t,cards:m}),e[113]=t,e[114]=l,e[115]=n):n=e[115];let a;return e[116]!==s||e[117]!==n?(a=o.jsx(At,{cards:s,onChange:n}),e[116]=s,e[117]=n,e[118]=a):a=e[118],a}case"Checklist":{let s;e[119]!==t.title?(s=I(t.title),e[119]=t.title,e[120]=s):s=e[120];let n;e[121]!==t.items?(n=I(t.items),e[121]=t.items,e[122]=n):n=e[122];let a;e[123]!==t||e[124]!==l?(a=g=>l({...t,...g}),e[123]=t,e[124]=l,e[125]=a):a=e[125];let m;return e[126]!==s||e[127]!==n||e[128]!==a?(m=o.jsx(Tt,{title:s,items:n,onChange:a}),e[126]=s,e[127]=n,e[128]=a,e[129]=m):m=e[129],m}case"Steps":{let s;e[130]!==t.title?(s=I(t.title),e[130]=t.title,e[131]=s):s=e[131];let n;e[132]!==t.steps?(n=I(t.steps),e[132]=t.steps,e[133]=n):n=e[133];let a;e[134]!==t||e[135]!==l?(a=g=>l({...t,...g}),e[134]=t,e[135]=l,e[136]=a):a=e[136];let m;return e[137]!==s||e[138]!==n||e[139]!==a?(m=o.jsx(Pt,{title:s,steps:n,onChange:a}),e[137]=s,e[138]=n,e[139]=a,e[140]=m):m=e[140],m}case"Comparison":{let s;e[141]!==t.left?(s=I(t.left),e[141]=t.left,e[142]=s):s=e[142];let n;e[143]!==t.right?(n=I(t.right),e[143]=t.right,e[144]=n):n=e[144];let a;e[145]!==t||e[146]!==l?(a=g=>l({...t,...g}),e[145]=t,e[146]=l,e[147]=a):a=e[147];let m;return e[148]!==s||e[149]!==n||e[150]!==a?(m=o.jsx(Dt,{left:s,right:n,onChange:a}),e[148]=s,e[149]=n,e[150]=a,e[151]=m):m=e[151],m}case"ProductCard":{let s;return e[152]!==t||e[153]!==l?(s=o.jsx(Xt,{block:t,onChange:l}),e[152]=t,e[153]=l,e[154]=s):s=e[154],s}case"ProductShelf":{let s;return e[155]!==t||e[156]!==l?(s=o.jsx(Qt,{block:t,onChange:l}),e[155]=t,e[156]=l,e[157]=s):s=e[157],s}}let p;e[158]!==r||e[159]!==i?(p=i?Ve(i,r):null,e[158]=r,e[159]=i,e[160]=p):p=e[160];const x=p;if(!x){const s=i?` (${i})`:"";let n;return e[161]!==s?(n=o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Unknown block type",s,"."]}),e[161]=s,e[162]=n):n=e[162],n}let u;e[163]!==l?(u=s=>l(s),e[163]=l,e[164]=u):u=e[164];let h;return e[165]!==t||e[166]!==x||e[167]!==u?(h=o.jsx(Ke,{schema:x,value:t,onChange:u,basePath:""}),e[165]=t,e[166]=x,e[167]=u,e[168]=h):h=e[168],h}function Yt(c){const e=$.c(33),{id:t,block:r,meta:l,onChange:i,onDelete:d,onDuplicate:f}=c;let p;e[0]!==t?(p={id:t},e[0]=t,e[1]=p):p=e[1];const{attributes:x,listeners:u,setNodeRef:h,transform:s,transition:n,isDragging:a}=Be(p);let m;e[2]!==s?(m=$e.Transform.toString(s),e[2]=s,e[3]=m):m=e[3];let g;e[4]!==m||e[5]!==n?(g={transform:m,transition:n},e[4]=m,e[5]=n,e[6]=g):g=e[6];const b=a&&"opacity-50";let y;e[7]!==b?(y=V("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",b),e[7]=b,e[8]=y):y=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(nt,{size:14}),e[9]=v):v=e[9];let k;e[10]!==x||e[11]!==u?(k=o.jsx("button",{type:"button","aria-label":"Drag to reorder",className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100",...x,...u,children:v}),e[10]=x,e[11]=u,e[12]=k):k=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(rt,{size:14}),e[13]=N):N=e[13];let C;e[14]!==f?(C=o.jsx("button",{type:"button","aria-label":"Duplicate block",onClick:f,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",children:N}),e[14]=f,e[15]=C):C=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(it,{size:14}),e[16]=j):j=e[16];let S;e[17]!==d?(S=o.jsx("button",{type:"button","aria-label":"Delete block",onClick:d,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:j}),e[17]=d,e[18]=S):S=e[18];let B;e[19]!==S||e[20]!==C?(B=o.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[C,S]}),e[19]=S,e[20]=C,e[21]=B):B=e[21];let w;e[22]!==r||e[23]!==l||e[24]!==i?(w=o.jsx(Wt,{block:r,meta:l,onChange:i}),e[22]=r,e[23]=l,e[24]=i,e[25]=w):w=e[25];let A;return e[26]!==h||e[27]!==B||e[28]!==w||e[29]!==g||e[30]!==y||e[31]!==k?(A=o.jsxs("div",{ref:h,style:g,className:y,children:[k,B,w]}),e[26]=h,e[27]=B,e[28]=w,e[29]=g,e[30]=y,e[31]=k,e[32]=A):A=e[32],A}function yl(c){return Array.isArray(c)?c:[]}function jl(c){const e=$.c(62),{value:t,onChange:r,meta:l,emptyMessage:i}=c,d=i===void 0?"No content yet. Use ⊕ to add your first block.":i;let f;e[0]!==l?(f=Me(l),e[0]=l,e[1]=f):f=e[1];const p=f;let x;e[2]!==t?(x=()=>t.map(ll),e[2]=t,e[3]=x):x=e[3];const[u,h]=K.useState(x);let s;e[4]!==u?(s=u.map(tl),e[4]=u,e[5]=s):s=e[5];const n=s;let a;e[6]!==u?(a=u.map(el),e[6]=u,e[7]=a):a=e[7];const m=a;let g;e[8]!==r?(g=L=>{h(L),r(L.map(Zt))},e[8]=r,e[9]=g):g=e[9];const b=g;let y;e[10]!==u||e[11]!==b?(y=(L,U)=>{const P=[...u];P.splice(L,0,{id:de(),block:{__resolveType:U}}),b(P)},e[10]=u,e[11]=b,e[12]=y):y=e[12];const v=y;let k;e[13]!==u||e[14]!==b?(k=(L,U)=>{b(u.map((P,M)=>M===L?{...P,block:U}:P))},e[13]=u,e[14]=b,e[15]=k):k=e[15];const N=k;let C;e[16]!==u||e[17]!==b?(C=L=>{b(u.filter((U,P)=>P!==L))},e[16]=u,e[17]=b,e[18]=C):C=e[18];const j=C;let S;e[19]!==u||e[20]!==b?(S=L=>{const U=u[L];if(!U)return;const P=[...u];P.splice(L+1,0,{id:de(),block:structuredClone(U.block)}),b(P)},e[19]=u,e[20]=b,e[21]=S):S=e[21];const B=S;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w={activationConstraint:{distance:6}},e[22]=w):w=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A={coordinateGetter:Pe},e[23]=A):A=e[23];const _=Ae(fe(Le,w),fe(Te,A));let T;e[24]!==u||e[25]!==b?(T=L=>{const{active:U,over:P}=L;if(!P||U.id===P.id)return;const M=u.findIndex(q=>q.id===String(U.id)),te=u.findIndex(q=>q.id===String(P.id));M===-1||te===-1||b(De(u,M,te))},e[24]=u,e[25]=b,e[26]=T):T=e[26];const z=T;let O;e[27]!==m.length||e[28]!==d?(O=m.length===0&&o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:d}),e[27]=m.length,e[28]=d,e[29]=O):O=e[29];let E;e[30]!==v?(E=L=>v(0,L),e[30]=v,e[31]=E):E=e[31];const ie=m.length===0;let J;e[32]!==p||e[33]!==E||e[34]!==ie?(J=o.jsx(ge,{blockTypes:p,onInsert:E,alwaysShow:ie}),e[32]=p,e[33]=E,e[34]=ie,e[35]=J):J=e[35];let H;if(e[36]!==u||e[37]!==p||e[38]!==B||e[39]!==v||e[40]!==l||e[41]!==j||e[42]!==N){let L;e[44]!==p||e[45]!==B||e[46]!==v||e[47]!==l||e[48]!==j||e[49]!==N?(L=(U,P)=>{const{id:M,block:te}=U;return o.jsxs("div",{children:[o.jsx(Yt,{id:M,block:te,meta:l,onChange:q=>N(P,q),onDelete:()=>j(P),onDuplicate:()=>B(P)}),o.jsx(ge,{blockTypes:p,onInsert:q=>v(P+1,q)})]},M)},e[44]=p,e[45]=B,e[46]=v,e[47]=l,e[48]=j,e[49]=N,e[50]=L):L=e[50],H=u.map(L),e[36]=u,e[37]=p,e[38]=B,e[39]=v,e[40]=l,e[41]=j,e[42]=N,e[43]=H}else H=e[43];let X;e[51]!==n||e[52]!==J||e[53]!==H?(X=o.jsxs(_e,{items:n,strategy:Ee,children:[J,H]}),e[51]=n,e[52]=J,e[53]=H,e[54]=X):X=e[54];let Q;e[55]!==z||e[56]!==_||e[57]!==X?(Q=o.jsx(Ue,{sensors:_,collisionDetection:Re,onDragEnd:z,children:X}),e[55]=z,e[56]=_,e[57]=X,e[58]=Q):Q=e[58];let ee;return e[59]!==O||e[60]!==Q?(ee=o.jsxs("div",{className:"mt-2",children:[O,Q]}),e[59]=O,e[60]=Q,e[61]=ee):ee=e[61],ee}function Zt(c){return c.block}function el(c){return c.block}function tl(c){return c.id}function ll(c){return{id:de(),block:c}}function de(){return crypto.randomUUID()}export{jl as B,yl as a,vl as b};
@@ -1 +1 @@
1
- import{c as K,x as ze,w as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,s as H,t as L,r as Te,G as Ue,l as _e,ae as fe}from"./index-BMCJlhk3.js";import{t as Xe}from"./ChevronDown-CW3qqv2x.js";import{i as He}from"./ChevronRight-B0GGkNIH.js";import{s as qe,t as Me}from"./Star01-K5E2EVFR.js";import{n as Ve}from"./LinkExternal01-BGVgwGxd.js";import{s as Re}from"./Plus-DEhikgBr.js";import{s as Ge}from"./Trash01-D4qJL0O5.js";import{i as Qe}from"./Zap-BRPDiIJ_.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-BOS0dCJh.js";import{I as ue}from"./input-Bk-XA8aE.js";import{T as lt}from"./textarea-CJuB4hQ7.js";import{P as Ne}from"./index-DqK88OS0.js";import{u as $e}from"./studio-tools-BdR8-wJW.js";import{u as ot}from"./use-debounced-autosave-DlQ25v46.js";import{R as rt}from"./require-capability-B3YVeyKQ.js";import"./sidebar-DU6XXtnA.js";import"./LayoutLeft-i76gAzb8.js";import"./tooltip-DjHKSu56.js";import"./sheet-ZPG9h0Fj.js";import"./X-B9D2h3Td.js";import"./use-capability-E8ccWznH.js";import"./access-gate-BrhqO3VF.js";import"./capability-load-error-B4Sf_UJj.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Qe,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[63]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=G):G=e[64];let Q,Y;e[65]!==X?(Q=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=Q,e[67]=Y):(Q=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==G||e[73]!==Q||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[72]=G,e[73]=Q,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ge,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
1
+ import{c as K,x as ze,w as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,s as H,t as L,r as Te,G as Ue,l as _e,ae as fe}from"./index-Ba-qr1CW.js";import{t as Xe}from"./ChevronDown-BfYdHkpN.js";import{i as He}from"./ChevronRight-BY1HqVE6.js";import{s as qe,t as Me}from"./Star01--VHLdkhz.js";import{n as Ve}from"./LinkExternal01-DU5nTXy3.js";import{s as Re}from"./Plus-p2e2tk7T.js";import{s as Ge}from"./Trash01-BOAu4VFs.js";import{i as Qe}from"./Zap-DbdLJbyv.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-B35bQh9V.js";import{I as ue}from"./input-BBCESNsB.js";import{T as lt}from"./textarea-BNj8LeAc.js";import{P as Ne}from"./index-BiDBbTkI.js";import{u as $e}from"./studio-tools-Zf2j5Vw6.js";import{u as ot}from"./use-debounced-autosave-1NuS6x2p.js";import{R as rt}from"./require-capability-KHCur5VM.js";import"./sidebar-Pqq_WVl7.js";import"./LayoutLeft-CYKuZwii.js";import"./tooltip-Bv4DpGHU.js";import"./sheet-B69G1O5h.js";import"./X-5CnCtsJU.js";import"./use-capability-DrYAgeoP.js";import"./access-gate-Bfo1MN-6.js";import"./capability-load-error-efC7JvaJ.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Qe,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[63]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=G):G=e[64];let Q,Y;e[65]!==X?(Q=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=Q,e[67]=Y):(Q=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==G||e[73]!==Q||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[72]=G,e[73]=Q,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ge,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
@@ -1 +1 @@
1
- import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-BMCJlhk3.js";import{i as J}from"./AlertCircle-DM0HzopE.js";import{i as O}from"./HardDrive-BD491-6A.js";import{s as L}from"./Plus-DEhikgBr.js";import{s as Q}from"./Trash01-D4qJL0O5.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-BOS0dCJh.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-fVpV_18N.js";import{I as N}from"./input-Bk-XA8aE.js";import{L as C}from"./label-DbgfgBJH.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-8EVXQGwX.js";import{S as xe}from"./switch-DLwkt3ng.js";import{S as he}from"./skeleton-CKrKTMUA.js";import{T as ge}from"./textarea-CJuB4hQ7.js";import{P}from"./index-DqK88OS0.js";import{c as je}from"./settings-section-DHTir3TC.js";import{u as ye,b as be,c as ve}from"./use-file-configs-TueoM3xk.js";import{R as Se}from"./require-capability-B3YVeyKQ.js";import"./X-B9D2h3Td.js";import"./tooltip-DjHKSu56.js";import"./ChevronUp-DZQVuDwV.js";import"./ChevronDown-CW3qqv2x.js";import"./sidebar-DU6XXtnA.js";import"./LayoutLeft-i76gAzb8.js";import"./sheet-ZPG9h0Fj.js";import"./card-DPMEGAqZ.js";import"./ArrowUpRight-CoxAwUHc.js";import"./studio-tools-BdR8-wJW.js";import"./use-capability-E8ccWznH.js";import"./access-gate-BrhqO3VF.js";import"./capability-load-error-B4Sf_UJj.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
1
+ import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-Ba-qr1CW.js";import{i as J}from"./AlertCircle-Dq_G2Nzm.js";import{i as O}from"./HardDrive-BYvsH8om.js";import{s as L}from"./Plus-p2e2tk7T.js";import{s as Q}from"./Trash01-BOAu4VFs.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-B35bQh9V.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-DHc-iPx9.js";import{I as N}from"./input-BBCESNsB.js";import{L as C}from"./label-B485QK8V.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-Dd_an4jF.js";import{S as xe}from"./switch-DVGIVYD-.js";import{S as he}from"./skeleton-DDfTse6v.js";import{T as ge}from"./textarea-BNj8LeAc.js";import{P}from"./index-BiDBbTkI.js";import{c as je}from"./settings-section-ZNhTRSX3.js";import{u as ye,b as be,c as ve}from"./use-file-configs-iLxbpR0W.js";import{R as Se}from"./require-capability-KHCur5VM.js";import"./X-5CnCtsJU.js";import"./tooltip-Bv4DpGHU.js";import"./ChevronUp-BLP78FPA.js";import"./ChevronDown-BfYdHkpN.js";import"./sidebar-Pqq_WVl7.js";import"./LayoutLeft-CYKuZwii.js";import"./sheet-B69G1O5h.js";import"./card-CNNf5saL.js";import"./ArrowUpRight-CQ9V3qZ2.js";import"./studio-tools-Zf2j5Vw6.js";import"./use-capability-DrYAgeoP.js";import"./access-gate-Bfo1MN-6.js";import"./capability-load-error-efC7JvaJ.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
@@ -1 +1 @@
1
- import{c as n,m as o,w as c,j as t,a7 as m,B as u,K as x}from"./index-BMCJlhk3.js";function f(){const e=n.c(5),l=o(),{locator:a}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==a||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(a)}),children:"Try again"})]}),e[2]=a,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
1
+ import{c as n,m as o,w as c,j as t,a7 as m,B as u,K as x}from"./index-Ba-qr1CW.js";function f(){const e=n.c(5),l=o(),{locator:a}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==a||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(a)}),children:"Try again"})]}),e[2]=a,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
@@ -1 +1 @@
1
- import{c as o,l as n,j as c}from"./index-BMCJlhk3.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
1
+ import{c as o,l as n,j as c}from"./index-Ba-qr1CW.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
@@ -0,0 +1 @@
1
+ import{c as st,j as e,B as mt}from"./index-Ba-qr1CW.js";import{i as lt}from"./XCircle-Dsot7agl.js";import{U as pt}from"./agent-icon-OikJQ0tD.js";import{I as tt}from"./input-BBCESNsB.js";import{L as et}from"./label-B485QK8V.js";import{ar as at,as as nt,aA as ct,at as ft}from"./index-DLD_CxqI.js";import{u as dt,s as M,I as gt}from"./primitives-BuTs77_N.js";import{S as ut}from"./save-status-CJES-J6W.js";import{a as xt,B as ht,b as yt}from"./block-document-CHDcd7GV.js";import"./AlertCircle-Dq_G2Nzm.js";import"./Tool01-B4pupQ7x.js";import"./SwitchHorizontal01-772sqvX3.js";import"./Settings02-C9u5iyRe.js";import"./ArrowUpRight-CQ9V3qZ2.js";import"./ZapSquare-BD-d-pzC.js";import"./Users03-BC-_ZtVi.js";import"./CheckCircle-M-SB_oIp.js";import"./ChevronUp-BLP78FPA.js";import"./ChevronDown-BfYdHkpN.js";import"./ChevronLeft-C491iKrG.js";import"./ChevronRight-BY1HqVE6.js";import"./DotsVertical-CCea0DBY.js";import"./Stars02-Er9DZAE5.js";import"./Eye-LeoubK3e.js";import"./ZoomOut-DvNle-6p.js";import"./Globe01-BcsvYW1p.js";import"./FilterLines-BS68ypb2.js";import"./Star01--VHLdkhz.js";import"./Globe04-BVNSKsf5.js";import"./HardDrive-BYvsH8om.js";import"./Key01-BuD8mP7N.js";import"./LayoutLeft-CYKuZwii.js";import"./LinkExternal01-DU5nTXy3.js";import"./Monitor01-DiwEyrIh.js";import"./Sun-DDm9LtlE.js";import"./Palette-CYyTNBF1.js";import"./Play-oEOHn7Kl.js";import"./Plus-p2e2tk7T.js";import"./SearchMd-DLvQebgX.js";import"./Shield01-CeaSgNsE.js";import"./Stars01-1RvLNgsH.js";import"./Trash01-BOAu4VFs.js";import"./Upload01-Bb4xamfI.js";import"./User01-CRJiYDWT.js";import"./Users01-D8fzZILN.js";import"./XClose-B8-m6Ysp.js";import"./X-5CnCtsJU.js";import"./Zap-DbdLJbyv.js";import"./index-DPCQ9W7J.js";import"./chat-context-CVPSA0cN.js";import"./hooks-DK3MSO7c.js";import"./use-mcp-client-DNt8z_cQ.js";import"./auth-9EhfyRsv.js";import"./decopilot-sse-pool-DelsNiOI.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C-sRaXYQ.js";import"./use-collections-CdkIpoPj.js";import"./use-ai-providers-rovOwk8E.js";import"./studio-tools-Zf2j5Vw6.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-gIQB6FWt.js";import"./scroll-area-DrAN9Fvu.js";import"./use-clock-tick-CPqO-BWO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cud6yKog.js";import"./tooltip-Bv4DpGHU.js";import"./file-type-icon-DYGh6lpU.js";import"./dialog-DHc-iPx9.js";import"./content-blocks-o63cs2vh.js";import"./types-DV4xEeHM.js";import"./shell-layout-DQpppXAg.js";import"./avatar-CWHc4EZj.js";import"./required-auth-layout-D-J1BueF.js";import"./use-org-sso-BFHNwstz.js";import"./sheet-B69G1O5h.js";import"./integration-icon-qruX57ku.js";import"./use-navigate-to-agent-BKUFyiJj.js";import"./use-connection-BvI4z5Go.js";import"./use-mcp-prompts-BvvmYT5d.js";import"./form-DKjNHSgl.js";import"./select-Dd_an4jF.js";import"./drawer-Cwhc32-v.js";import"./collection-search-Do7Cp7BP.js";import"./tabs-CNn3gT-l.js";import"./toggle-group-BGuBCRpR.js";import"./sortable.esm-Zgc8llTJ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-D2GNuFJz.js";import"./use-registry-connections-BASvWu3z.js";import"./useInfiniteQuery-C_KTVASW.js";import"./use-infinite-scroll-CMIncUkM.js";import"./extract-connection-data-DNQRXpX9.js";import"./card-CNNf5saL.js";import"./collection-tabs-NlIGO6dT.js";import"./badge-DUbO_RN4.js";import"./textarea-BNj8LeAc.js";import"./connection-form-helpers-B19OLFDN.js";import"./authenticate-and-persist-oauth-tBiMyMPG.js";import"./mcp-oauth-dU1JqorS.js";import"./useSuspenseInfiniteQuery-CsMnvHSV.js";import"./connect-desktop-dialog-BpO---Ho.js";import"./decopilot-b_zAKgPV.js";import"./checkbox-C9da9yB_.js";import"./skeleton-DDfTse6v.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ZNhTRSX3.js";import"./popover-Cv6LCVas.js";import"./command-DMfMyCz6.js";import"./index-BRDh59qB.js";import"./dropdown-menu-9t4d4l4a.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-uYZzmwes.js";import"./empty-state-Dg_iHbDT.js";import"./toolbar-MHh5nkt1.js";import"./preview-dialog-B4xvQs8x.js";import"./index-BZ1n_eeg.js";import"./use-mcp-tools-DmQFC6-r.js";import"./use-capability-DrYAgeoP.js";import"./shell-route-loading-BhN3sCYk.js";import"./index-BgSq9_gk.js";import"./alert-dialog-B35bQh9V.js";import"./switch-DVGIVYD-.js";import"./use-debounced-autosave-1NuS6x2p.js";import"./index-BiDBbTkI.js";import"./sidebar-Pqq_WVl7.js";import"./search-input-fHPtOP7y.js";import"./github-repo-picker-D85COA-s.js";import"./use-secrets-BghcHplb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CjqQoLPT.js";import"./automation-runs-CgHl-onu.js";import"./table-CaQbuRGR.js";import"./use-members-Ddo88B9U.js";import"./use-org-auth-client-CiDUlr9j.js";import"./task-status-C22YJZSD.js";import"./use-automations-5rZgDplp.js";import"./use-file-configs-iLxbpR0W.js";import"./monaco-editor-BIiIfKcK.js";import"./select-model-BKUEE8m5.js";import"./automation-list-row-Cdw0YVrC.js";function Yi(it){const t=st.c(87),{orgSlug:l,virtualMcpId:p,branch:a,blockKey:z,block:G,decofile:H,meta:O,onManagePosts:Q}=it;let F;t[0]!==a||t[1]!==l||t[2]!==p?(F={orgSlug:l,virtualMcpId:p,branch:a},t[0]=a,t[1]=l,t[2]=p,t[3]=F):F=t[3];const m=at(F);let U;t[4]!==G?(U=nt(G,"categories"),t[4]=G,t[5]=U):U=t[5];const ot=U;let A;t[6]!==z||t[7]!==m?(A=o=>{m.mutate({blockKey:z,data:ft(z,"categories",o)})},t[6]=z,t[7]=m,t[8]=A):A=t[8];const[i,V]=dt(ot,A);let D;t[9]!==i||t[10]!==V?(D=(o,rt)=>V({...i,[o]:rt}),t[9]=i,t[10]=V,t[11]=D):D=t[11];const r=D;let s,L;t[12]!==i.slug||t[13]!==H?(s=M(i.slug),L=s?ct(H).filter(o=>o.categorySlugs.includes(s)).length:0,t[12]=i.slug,t[13]=H,t[14]=s,t[15]=L):(s=t[14],L=t[15]);const R=L;let n;t[16]!==i.name?(n=M(i.name)||"Untitled category",t[16]=i.name,t[17]=n):n=t[17];let c;t[18]!==n?(c=e.jsx("span",{className:"truncate text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let f;t[20]!==m.isError||t[21]!==m.isPending?(f=e.jsx(ut,{isPending:m.isPending,isError:m.isError}),t[20]=m.isError,t[21]=m.isPending,t[22]=f):f=t[22];let d;t[23]!==c||t[24]!==f?(d=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,f]}),t[23]=c,t[24]=f,t[25]=d):d=t[25];let g;t[26]!==i.name?(g=M(i.name),t[26]=i.name,t[27]=g):g=t[27];let u;t[28]!==r?(u=o=>r("name",o),t[28]=r,t[29]=u):u=t[29];let x;t[30]!==g||t[31]!==u?(x=e.jsx(gt,{value:g,onChange:u,placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t[30]=g,t[31]=u,t[32]=x):x=t[32];let T;t[33]===Symbol.for("react.memo_cache_sentinel")?(T=e.jsx(et,{htmlFor:"category-slug",children:"Slug"}),t[33]=T):T=t[33];let h;t[34]!==i.slug?(h=M(i.slug),t[34]=i.slug,t[35]=h):h=t[35];let y;t[36]!==r?(y=o=>r("slug",o.target.value),t[36]=r,t[37]=y):y=t[37];let j;t[38]!==h||t[39]!==y?(j=e.jsxs("div",{className:"mt-4 space-y-2",children:[T,e.jsx(tt,{id:"category-slug",value:h,onChange:y,placeholder:"my-category",className:"h-10"})]}),t[38]=h,t[39]=y,t[40]=j):j=t[40];let $;t[41]===Symbol.for("react.memo_cache_sentinel")?($=e.jsx(et,{htmlFor:"category-description",children:"Description"}),t[41]=$):$=t[41];let b;t[42]!==i.description?(b=M(i.description),t[42]=i.description,t[43]=b):b=t[43];let v;t[44]!==r?(v=o=>r("description",o.target.value),t[44]=r,t[45]=v):v=t[45];let N;t[46]!==b||t[47]!==v?(N=e.jsxs("div",{className:"mt-4 space-y-2",children:[$,e.jsx(tt,{id:"category-description",value:b,onChange:v,placeholder:"Short description for this category",className:"h-10"})]}),t[46]=b,t[47]=v,t[48]=N):N=t[48];let J;t[49]===Symbol.for("react.memo_cache_sentinel")?(J=e.jsx(pt,{size:16,className:"shrink-0 text-muted-foreground"}),t[49]=J):J=t[49];const X=R===1?"post":"posts";let S;t[50]!==R||t[51]!==X?(S=e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[J,e.jsxs("span",{className:"text-sm",children:[R," ",X," in this category"]})]}),t[50]=R,t[51]=X,t[52]=S):S=t[52];const Y=!s,Z=s?"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts";let B;t[53]!==Q||t[54]!==s?(B=()=>Q(s),t[53]=Q,t[54]=s,t[55]=B):B=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=e.jsx(lt,{size:14}),t[56]=K):K=t[56];let k;t[57]!==Y||t[58]!==Z||t[59]!==B?(k=e.jsxs(mt,{type:"button",variant:"outline",size:"sm",disabled:Y,title:Z,onClick:B,children:["Manage posts",K]}),t[57]=Y,t[58]=Z,t[59]=B,t[60]=k):k=t[60];let _;t[61]!==S||t[62]!==k?(_=e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3 rounded-lg border bg-muted/30 px-4 py-3",children:[S,k]}),t[61]=S,t[62]=k,t[63]=_):_=t[63];let W;t[64]===Symbol.for("react.memo_cache_sentinel")?(W=e.jsx("div",{className:"mt-6 border-t"}),t[64]=W):W=t[64];let C;t[65]!==i.sections?(C=xt(i.sections),t[65]=i.sections,t[66]=C):C=t[66];let P;t[67]!==r?(P=o=>r("sections",o),t[67]=r,t[68]=P):P=t[68];let E;t[69]!==O||t[70]!==C||t[71]!==P?(E=e.jsx(ht,{value:C,onChange:P,meta:O,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."}),t[69]=O,t[70]=C,t[71]=P,t[72]=E):E=t[72];let w;t[73]!==x||t[74]!==j||t[75]!==N||t[76]!==_||t[77]!==E?(w=e.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[x,j,N,_,W,E]})}),t[73]=x,t[74]=j,t[75]=N,t[76]=_,t[77]=E,t[78]=w):w=t[78];let I;t[79]!==w||t[80]!==d?(I=e.jsxs("div",{className:"flex h-full flex-col",children:[d,w]}),t[79]=w,t[80]=d,t[81]=I):I=t[81];let q;return t[82]!==a||t[83]!==l||t[84]!==I||t[85]!==p?(q=e.jsx(yt,{orgSlug:l,virtualMcpId:p,branch:a,children:I}),t[82]=a,t[83]=l,t[84]=I,t[85]=p,t[86]=q):q=t[86],q}export{Yi as CategoryEditor};
@@ -1,4 +1,4 @@
1
- import{c as pe,l as Fe,bF as Ue,j as L,cv as qe,H as Me,m as Ee,w as re,K as ue,t as _e,v as ae,L as oe,b as we,u as Ae,e as Ke,r as h,s as Ve,a as We,I as He,aI as Qe}from"./index-BMCJlhk3.js";import{A as Re,a as Be,d as ze,e as Ge,f as Xe,u as Ze,w as Ye}from"./hooks-C3qiFxIG.js";import{a as Je,u as et,S as tt}from"./use-mcp-client--_ZSmyGd.js";import{a as nt}from"./use-virtual-mcp-BZlyJ3on.js";import{u as st,b as de}from"./use-ai-providers-BxzRSeJ0.js";import{n as at,k as ot}from"./tab-id-BptcWVWa.js";import{d as rt}from"./use-organization-settings-DQ5ROkEQ.js";const it={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.4-mini"]},ct={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.4"]},lt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.5"]},dt={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],google:["gemini-2.0-flash-image"]},ut={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},pt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Pe(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function ht(t){return Pe(t).includes("deepresearch")}const ft=["sonar","searchpreview","online"];function De(t){const e=Pe(t);return e.includes("deepresearch")?!1:ft.some(a=>e.includes(a))}function $e(t){return t.asyncResearch!==!0&&De(t.modelId)}function Oe(t){return t.asyncResearch===!0||ht(t.modelId)||De(t.modelId)}function ne(t,e,a,n){for(const s of a){const o=t.find(r=>r.modelId===s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const s of a){const o=t.find(r=>r.modelId.includes(s));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(n){const s=t.find(n);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}return null}function mt(t,e){const a={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of t){const s=e[n.id]??[],o=n.providerId;a.chat.fast||(a.chat.fast=ne(s,n.id,it[o]??[])),a.chat.smart||(a.chat.smart=ne(s,n.id,ct[o]??[])),a.chat.thinking||(a.chat.thinking=ne(s,n.id,lt[o]??[])),a.image||(a.image=ne(s,n.id,dt[o]??[],r=>r.capabilities?.includes("image")===!0)),a.webSearch||(a.webSearch=ne(s,n.id,ut[o]??[],$e)),a.deepResearch||(a.deepResearch=ne(s,n.id,pt[o]??[],Oe))}return a}const gt=Ue("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function Kt(t){const e=pe.c(10),{variant:a,size:n}=t;let s;e[0]!==n||e[1]!==a?(s=Fe(gt({variant:a,size:n})),e[0]=n,e[1]=a,e[2]=s):s=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=L.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=L.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let i;e[5]!==s?(i=L.jsxs("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=s,e[6]=i):i=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=L.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=f):f=e[7];let g;return e[8]!==i?(g=L.jsxs("div",{role:"status",children:[i,f]}),e[8]=i,e[9]=g):g=e[9],g}function xt(t,e=[]){return t==="stop"?e.filter(s=>s.type==="text"&&s.text).map(s=>s.text).join(`
1
+ import{c as pe,l as Fe,bF as Ue,j as L,cv as qe,H as Me,m as Ee,w as re,K as ue,t as _e,v as ae,L as oe,b as we,u as Ae,e as Ke,r as h,s as Ve,a as We,I as He,aI as Qe}from"./index-Ba-qr1CW.js";import{A as Re,a as Be,d as ze,e as Ge,f as Xe,u as Ze,w as Ye}from"./hooks-DK3MSO7c.js";import{a as Je,u as et,S as tt}from"./use-mcp-client-DNt8z_cQ.js";import{a as nt}from"./use-virtual-mcp-C-sRaXYQ.js";import{u as st,b as de}from"./use-ai-providers-rovOwk8E.js";import{n as at,k as ot}from"./tab-id-BptcWVWa.js";import{d as rt}from"./use-organization-settings-gIQB6FWt.js";const it={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.4-mini"]},ct={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.4"]},lt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.5"]},dt={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],google:["gemini-2.0-flash-image"]},ut={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},pt={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Pe(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function ht(t){return Pe(t).includes("deepresearch")}const ft=["sonar","searchpreview","online"];function De(t){const e=Pe(t);return e.includes("deepresearch")?!1:ft.some(a=>e.includes(a))}function $e(t){return t.asyncResearch!==!0&&De(t.modelId)}function Oe(t){return t.asyncResearch===!0||ht(t.modelId)||De(t.modelId)}function ne(t,e,a,n){for(const s of a){const o=t.find(r=>r.modelId===s);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const s of a){const o=t.find(r=>r.modelId.includes(s));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(n){const s=t.find(n);if(s)return{keyId:e,modelId:s.modelId,title:s.title}}return null}function mt(t,e){const a={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of t){const s=e[n.id]??[],o=n.providerId;a.chat.fast||(a.chat.fast=ne(s,n.id,it[o]??[])),a.chat.smart||(a.chat.smart=ne(s,n.id,ct[o]??[])),a.chat.thinking||(a.chat.thinking=ne(s,n.id,lt[o]??[])),a.image||(a.image=ne(s,n.id,dt[o]??[],r=>r.capabilities?.includes("image")===!0)),a.webSearch||(a.webSearch=ne(s,n.id,ut[o]??[],$e)),a.deepResearch||(a.deepResearch=ne(s,n.id,pt[o]??[],Oe))}return a}const gt=Ue("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function Kt(t){const e=pe.c(10),{variant:a,size:n}=t;let s;e[0]!==n||e[1]!==a?(s=Fe(gt({variant:a,size:n})),e[0]=n,e[1]=a,e[2]=s):s=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=L.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=L.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let i;e[5]!==s?(i=L.jsxs("svg",{"aria-hidden":"true",className:s,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=s,e[6]=i):i=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=L.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=f):f=e[7];let g;return e[8]!==i?(g=L.jsxs("div",{role:"status",children:[i,f]}),e[8]=i,e[9]=g):g=e[9],g}function xt(t,e=[]){return t==="stop"?e.filter(s=>s.type==="text"&&s.text).map(s=>s.text).join(`
2
2
  `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Ie={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"decopilot-desktop":{harness:"decopilot",sandbox:"user-desktop"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function yt(t,e){if(!t)return null;const a=e?qe(e):null;if(t==="decopilot"&&a===null)return"decopilot";for(const[n,s]of Object.entries(Ie))if(s.harness===t&&s.sandbox===a)return n;return null}function It(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function St(t){const e=pe.c(10);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=a):a=e[0];const n=Me(a);let s;if(e[1]!==n?.params.appSlug||e[2]!==n?.params.collectionName||e[3]!==n?.params.itemId||e[4]!==t){s=[],t&&s.push(`### Selected Agent
3
3
  - ID: ${t}`);let o;e[6]!==n?.params.appSlug||e[7]!==n?.params.collectionName||e[8]!==n?.params.itemId?(o=[],n?.params.appSlug&&o.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&o.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&o.push(`- Item ID: ${n?.params.itemId}`),e[6]=n?.params.appSlug,e[7]=n?.params.collectionName,e[8]=n?.params.itemId,e[9]=o):o=e[9],o.length>0&&s.push(`### Current Resource
4
4
  The user is viewing the following resource:
@@ -1 +1 @@
1
- import{c as n,l as d,j as c,bG as l,bH as b}from"./index-BMCJlhk3.js";import{i as m}from"./ChevronUp-DZQVuDwV.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
1
+ import{c as n,l as d,j as c,bG as l,bH as b}from"./index-Ba-qr1CW.js";import{i as m}from"./ChevronUp-BLP78FPA.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +1 @@
1
- import{c as a,a as c,r as m,j as o}from"./index-BMCJlhk3.js";import{A as u}from"./auth-split-layout-nvPMwr8u.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
1
+ import{c as a,a as c,r as m,j as o}from"./index-Ba-qr1CW.js";import{A as u}from"./auth-split-layout-akB0devr.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};