decocms 3.99.3 → 3.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/dist/client/assets/{AlertCircle-Bgopcarv.js → AlertCircle-CB5KvLwP.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-7XR-z7Ge.js → ArrowUpRight-CGiD8vy5.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DsdDhP4L.js → CheckCircle-BBV9CFFT.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CpzTl0cf.js → ChevronDown-BJhXIK-P.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BuOnLJw9.js → ChevronLeft-B1FMEVNc.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DqDeYsel.js → ChevronRight-Cxkz20f7.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cr2g1GDa.js → ChevronUp-CSnIUHk6.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BGprjE03.js → DotsVertical-D_Mc-7IQ.js} +1 -1
  9. package/dist/client/assets/{Eye-B9uHZVsM.js → Eye-v7KW9L98.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DgCFEQWk.js → FilterLines-BFU-HGPB.js} +1 -1
  11. package/dist/client/assets/{Globe01-H40eMg8D.js → Globe01-J206FB3X.js} +1 -1
  12. package/dist/client/assets/{Globe04-BNaAcUBp.js → Globe04-BVemAfGE.js} +1 -1
  13. package/dist/client/assets/{HardDrive-l0WQMFU9.js → HardDrive-CWgzi9wO.js} +1 -1
  14. package/dist/client/assets/{Key01-BDd1iQS4.js → Key01-BD-IJNJQ.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-DQOl0C9j.js → LayoutLeft-CB8DIaei.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BAME6PCB.js → LinkExternal01-B2EDdnZx.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CaJkUXyc.js → Monitor01-JBmV730I.js} +1 -1
  18. package/dist/client/assets/{Palette-C1u1Sxuh.js → Palette-wlYD__vW.js} +1 -1
  19. package/dist/client/assets/{Play-DSjj50Z1.js → Play-DUpdkISP.js} +1 -1
  20. package/dist/client/assets/{Plus-rHk0VScG.js → Plus-CSb3V8S8.js} +1 -1
  21. package/dist/client/assets/SearchLg-B9kqdzVX.js +1 -0
  22. package/dist/client/assets/{SearchMd-Bc8RVvtx.js → SearchMd-DhW8248m.js} +1 -1
  23. package/dist/client/assets/{Settings02-bfgJ4jKJ.js → Settings02-BsAGDeee.js} +1 -1
  24. package/dist/client/assets/{Shield01-C0erkp7L.js → Shield01-DU8KFrFU.js} +1 -1
  25. package/dist/client/assets/{Star01-DnRxcrb2.js → Star01-BG3nvXkE.js} +1 -1
  26. package/dist/client/assets/{Stars01-DN0i_OuW.js → Stars01-BleMq6lh.js} +1 -1
  27. package/dist/client/assets/{Stars02-DXKYKZ_y.js → Stars02-D1hTo9kS.js} +1 -1
  28. package/dist/client/assets/{Sun-BvgQbAIe.js → Sun-BHlOvrTC.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-CTCDUfta.js → SwitchHorizontal01-dtUU9yY1.js} +1 -1
  30. package/dist/client/assets/{Tool01-Dvmkyh1g.js → Tool01-BBDLAsiN.js} +1 -1
  31. package/dist/client/assets/{Trash01-BrvLbqQk.js → Trash01-DEQkTUig.js} +1 -1
  32. package/dist/client/assets/{Upload01-Cghimx9V.js → Upload01-aTx0MT4i.js} +1 -1
  33. package/dist/client/assets/{User01-BPjc8LiD.js → User01-y8ntusMn.js} +1 -1
  34. package/dist/client/assets/{Users01-DKr-dGyn.js → Users01-B-8sWltw.js} +1 -1
  35. package/dist/client/assets/{Users03-CBNK0aq-.js → Users03-Dlm3r0r-.js} +1 -1
  36. package/dist/client/assets/{X-BZf8Ua-f.js → X-BXn2_vYM.js} +1 -1
  37. package/dist/client/assets/{XCircle-CxfDN97v.js → XCircle-mXjRT0sF.js} +1 -1
  38. package/dist/client/assets/{XClose-Ca4NBXw9.js → XClose-BDAWssyq.js} +1 -1
  39. package/dist/client/assets/{Zap-D8ndRUQT.js → Zap-eZQ7TcmD.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BY_c_0SN.js → ZapSquare-DrbsMYOt.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-C9_8nvys.js → ZoomOut-DwwAa3X7.js} +1 -1
  42. package/dist/client/assets/{access-gate-CCm9ALRG.js → access-gate-BkQkZSw7.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-BsBYigCm.js → add-section-modal-BT0K2WGi.js} +1 -1
  44. package/dist/client/assets/agent-icon-DQ2UQuHh.js +1 -0
  45. package/dist/client/assets/agents-list-D4pW1eF3.js +1 -0
  46. package/dist/client/assets/{ai-providers-P6gTuznf.js → ai-providers-qdSfgAjS.js} +1 -1
  47. package/dist/client/assets/{alert-DpnpKBfm.js → alert-Bk7_b-_k.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CWTgvZp_.js → alert-dialog-DqsunxqN.js} +1 -1
  49. package/dist/client/assets/app-editor-Bb387cQo.js +1 -0
  50. package/dist/client/assets/{auth-DtR4b91D.js → auth-EMMal3Dz.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BfgSkxA3.js → auth-catchall-B0IwkpQE.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DiMotG9E.js → auth-entry-DUQxRcp9.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-Bithe63j.js → auth-split-layout-CozHTgSY.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-BYDKbSTj.js → authenticate-and-persist-oauth-cWdyk-4l.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-DmMT-Lmk.js → automation-list-row-DcfWPhsa.js} +1 -1
  56. package/dist/client/assets/{automation-runs-CglgtIyd.js → automation-runs-GIeVqtWs.js} +1 -1
  57. package/dist/client/assets/automations-BuY0n0pu.js +1 -0
  58. package/dist/client/assets/{avatar-DosbYSVo.js → avatar-CCs3cbGI.js} +1 -1
  59. package/dist/client/assets/{badge-7eW-Y90w.js → badge-B-Bz5at5.js} +1 -1
  60. package/dist/client/assets/{block-document-CU1UWO2l.js → block-document-BkT_K3Fj.js} +1 -1
  61. package/dist/client/assets/{brand-context-Bc4eOtey.js → brand-context-Budskn6L.js} +1 -1
  62. package/dist/client/assets/{buckets-C0c0s9n9.js → buckets-f0-ci-zH.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-BQe9cGJ_.js → capability-load-error-C31L1nr_.js} +1 -1
  64. package/dist/client/assets/{card-ChgC15JC.js → card-KfNIoaPf.js} +1 -1
  65. package/dist/client/assets/category-editor-B9pyPRue.js +1 -0
  66. package/dist/client/assets/{chat-context-C7e3nmPB.js → chat-context-B-cXtnc6.js} +1 -1
  67. package/dist/client/assets/{checkbox-D1J6-HGS.js → checkbox-L9WnatCJ.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Biv357Zc.js → cli-auth-success-D32UIzoT.js} +1 -1
  69. package/dist/client/assets/collection-detail-w19GYSpy.js +1 -0
  70. package/dist/client/assets/{collection-display-button-zkui4HfF.js → collection-display-button-DNZy72Lj.js} +1 -1
  71. package/dist/client/assets/{collection-search-SCB2wfQm.js → collection-search-Bw8ErL9A.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CasRXW3s.js → collection-tabs-CDQNfYku.js} +1 -1
  73. package/dist/client/assets/{command-BP2NK5GV.js → command-DM9QRA4h.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-BIIFNmxt.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-CUoIMZ9P.js → connect-desktop-dialog-CG0vg5V1.js} +1 -1
  76. package/dist/client/assets/{connection-card-Cw-v3-1B.js → connection-card-CFNuDsq8.js} +1 -1
  77. package/dist/client/assets/connection-detail-BgYdE75o.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BE_9JHz-.js → connection-form-helpers-DO3e40s1.js} +1 -1
  79. package/dist/client/assets/connections-6kxrxm_j.js +1 -0
  80. package/dist/client/assets/{context-menu-Cbyc6J5M.js → context-menu-gXAbOm7T.js} +1 -1
  81. package/dist/client/assets/{decopilot-D1XiRpB_.js → decopilot-YCL8e-nf.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DsG4E7i_.js → decopilot-sse-pool-DPxuN-3_.js} +1 -1
  83. package/dist/client/assets/{dialog-DKiQlf0Y.js → dialog-BxQnVy3N.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DZg105GS.js → domain-settings-Dj2fR8fd.js} +1 -1
  85. package/dist/client/assets/{drawer-UishvVn_.js → drawer-Cnet3QMz.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-B_TYOovI.js → dropdown-menu-C0QC0e-U.js} +1 -1
  87. package/dist/client/assets/{empty-state-BVh7wBPS.js → empty-state-B6QyYsPZ.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-C9MdxGy0.js → extract-connection-data-Bosa8zHT.js} +1 -1
  89. package/dist/client/assets/file-explorer-Dy4dTATI.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DouhlgA1.js → file-type-icon-C5be6uul.js} +1 -1
  91. package/dist/client/assets/{files-pYWmrODj.js → files-BFxWtXVO.js} +1 -1
  92. package/dist/client/assets/{form-B4g755Hl.js → form-CIlG55_C.js} +1 -1
  93. package/dist/client/assets/{general-5Yc9vnsv.js → general-rOZ7zQE0.js} +1 -1
  94. package/dist/client/assets/github-repo-picker-ClZplb89.js +1 -0
  95. package/dist/client/assets/{hooks-DWc2KmvK.js → hooks-BW_au6w-.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-Bih2Fm5A.js → import-from-deco-dialog-BRqiGd04.js} +1 -1
  97. package/dist/client/assets/{index-BgnTiSnU.js → index-3RYygtpZ.js} +1 -1
  98. package/dist/client/assets/index-BUsNDaiq.js +1 -0
  99. package/dist/client/assets/index-Bl1rlkAc.js +503 -0
  100. package/dist/client/assets/{index-DZqx_Cnp.js → index-BsT-8SKh.js} +1 -1
  101. package/dist/client/assets/index-C6oPDe4K.js +1 -0
  102. package/dist/client/assets/index-CAwZtBUO.js +169 -0
  103. package/dist/client/assets/{index-V36Mlak_.js → index-CI3DfI1l.js} +2 -2
  104. package/dist/client/assets/{index-DJGRW9ro.js → index-Cj1plGam.js} +1 -1
  105. package/dist/client/assets/{index-GbBrtIUx.js → index-DDDWgWz8.js} +1 -1
  106. package/dist/client/assets/{index-BSPCA2yy.js → index-DH054m17.js} +1 -1
  107. package/dist/client/assets/{index-tHbNbVHJ.js → index-DJ-0yJzO.js} +4 -4
  108. package/dist/client/assets/{index-CQ5sDlCR.js → index-DSFMxO70.js} +1 -1
  109. package/dist/client/assets/{index-Blw_ez7B.js → index-Dn5vAQDR.js} +1 -1
  110. package/dist/client/assets/index-h9qXUa58.css +1 -0
  111. package/dist/client/assets/{index-87hVDe9f.js → index-hIyA29hR.js} +1 -1
  112. package/dist/client/assets/{index-redirect-DwYyA5dK.js → index-redirect-BdBm--uy.js} +1 -1
  113. package/dist/client/assets/{input-C1uF2dQ1.js → input-C2eR67CX.js} +1 -1
  114. package/dist/client/assets/{integration-icon-DOeD9Yy1.js → integration-icon-CRPoStYp.js} +1 -1
  115. package/dist/client/assets/{label-Bg0TZhOq.js → label-dfUb2uoI.js} +1 -1
  116. package/dist/client/assets/{login-C4tPjUdy.js → login-BQhCM0sv.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DxJiJ187.js → mcp-oauth-DHLZTN3O.js} +1 -1
  118. package/dist/client/assets/{members-DwE4NR-t.js → members-CK_LQWOy.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-C6tm250p.js → monaco-editor-C1v3GK4B.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-BF3MVgko.js → monitoring-stats-row-sU5G_aur.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-DDvAz-C3.js → oauth-callback-BBcDGSVc.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-PWS5W0qh.js → oauth-callback-ai-provider-CYOtZ7DJ.js} +1 -1
  123. package/dist/client/assets/{onboarding-BfXFCDPk.js → onboarding-BZH5ergb.js} +1 -1
  124. package/dist/client/assets/{org-install-CRksScXH.js → org-install-BbRwzOKv.js} +1 -1
  125. package/dist/client/assets/{org-layout-D3Fm0DP7.js → org-layout-BCsbDhvJ.js} +1 -1
  126. package/dist/client/assets/{organization-choice-D0-tUZZw.js → organization-choice-DrYPCeGO.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BvkRv9HV.js → page-seo-form-DpOET_p-.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-DyoKBsS2.js +1 -0
  129. package/dist/client/assets/{popover-eHXpDYJ1.js → popover-NZJWCLt1.js} +1 -1
  130. package/dist/client/assets/post-editor-Bbt5yCh2.js +1 -0
  131. package/dist/client/assets/preview-dialog-C4yQrBab.js +5 -0
  132. package/dist/client/assets/{primitives-CkRAfBR-.js → primitives-_v-rLEEl.js} +1 -1
  133. package/dist/client/assets/{profile-CEx7RbYh.js → profile-_KXC62IE.js} +1 -1
  134. package/dist/client/assets/project-app-view-DXSz0pMJ.js +1 -0
  135. package/dist/client/assets/record-editor-VdfYg6pr.js +1 -0
  136. package/dist/client/assets/registry-iyhJaDcl.js +2 -0
  137. package/dist/client/assets/{registry-layout-BlqjOMOH.js → registry-layout-ueKfEeIx.js} +1 -1
  138. package/dist/client/assets/{require-capability-BOr4zKTd.js → require-capability-bIF6RhUp.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-DCkraGAX.js → required-auth-layout-Dto8wlZl.js} +1 -1
  140. package/dist/client/assets/{reset-password-BJpJyj5W.js → reset-password-BK5EbrE5.js} +1 -1
  141. package/dist/client/assets/roles-DK_1BIWv.js +1 -0
  142. package/dist/client/assets/{scroll-area-IfNZ394n.js → scroll-area-C1pOloFJ.js} +1 -1
  143. package/dist/client/assets/{search-input-DWWTgewM.js → search-input-Dv1TseVx.js} +1 -1
  144. package/dist/client/assets/{secrets-BKFEeATT.js → secrets-BAuZTTwK.js} +1 -1
  145. package/dist/client/assets/{sections-editor-uQUAGEex.js → sections-editor-0O2o_Y6K.js} +2 -2
  146. package/dist/client/assets/{select-Ufh1328y.js → select-P94u0CJo.js} +1 -1
  147. package/dist/client/assets/{select-model-CQ-f9ftL.js → select-model-BUU-K3y0.js} +1 -1
  148. package/dist/client/assets/seo-editor-C4nbRhPN.js +1 -0
  149. package/dist/client/assets/settings-layout-BS6pavFk.js +1 -0
  150. package/dist/client/assets/{settings-section-B4a4SAqB.js → settings-section-BOi1IsyE.js} +1 -1
  151. package/dist/client/assets/{sheet-DW12PvFQ.js → sheet-DBbd3xZ9.js} +1 -1
  152. package/dist/client/assets/{shell-controls-xlIGzcZ3.js → shell-controls-Cx99Qsog.js} +1 -1
  153. package/dist/client/assets/shell-layout-C7ri93NQ.js +1 -0
  154. package/dist/client/assets/{shell-route-loading-B_CHvxTG.js → shell-route-loading-tzhgNES0.js} +1 -1
  155. package/dist/client/assets/{sidebar-Cy5GVw74.js → sidebar-V0fgYf5d.js} +1 -1
  156. package/dist/client/assets/{skeleton-CpSca80L.js → skeleton-Dkde-wB2.js} +1 -1
  157. package/dist/client/assets/{sortable.esm-CoB59DXJ.js → sortable.esm-CuMhTk6a.js} +1 -1
  158. package/dist/client/assets/{sso-DMV0Y_YX.js → sso-D0Kl4hLV.js} +1 -1
  159. package/dist/client/assets/{store-B6JtITOy.js → store-Di_Xqz3q.js} +1 -1
  160. package/dist/client/assets/store-registry-bvwbkRZM.js +2 -0
  161. package/dist/client/assets/{studio-tools-Dd7dXWQL.js → studio-tools-Cdx_UHKK.js} +1 -1
  162. package/dist/client/assets/{switch-CuKs1fR0.js → switch-COQDKJ_b.js} +1 -1
  163. package/dist/client/assets/{table-BfyoFEgz.js → table-BV4PwUfw.js} +1 -1
  164. package/dist/client/assets/{tabs-C3buIvx_.js → tabs-DDSzGN2J.js} +1 -1
  165. package/dist/client/assets/{task-status-DXhUoFwL.js → task-status-DRFd52Gi.js} +1 -1
  166. package/dist/client/assets/{textarea-BiYr__3G.js → textarea-3Q-WOeg_.js} +1 -1
  167. package/dist/client/assets/{toggle-group-DFSFo_vP.js → toggle-group-BO6v5tfG.js} +1 -1
  168. package/dist/client/assets/{toolbar-DMYgRw5l.js → toolbar-CWj6rOG7.js} +1 -1
  169. package/dist/client/assets/{tooltip-DW1HpudV.js → tooltip-4wDbnU57.js} +1 -1
  170. package/dist/client/assets/{types-BpY6lzqy.js → types-CYxZXBM0.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-DS_7m4pz.js → use-ai-providers-DRi0TGR5.js} +1 -1
  172. package/dist/client/assets/{use-automations-BOSdn9Us.js → use-automations-BooH66Yd.js} +1 -1
  173. package/dist/client/assets/{use-capability-CeF0OpPy.js → use-capability-BsG-lChE.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-DLGdZmyk.js → use-clock-tick-CasxGSyY.js} +1 -1
  175. package/dist/client/assets/{use-collections-GNpTGYUv.js → use-collections-BpN1mXwR.js} +1 -1
  176. package/dist/client/assets/{use-connection-B65sInnd.js → use-connection-BqxUv0Rd.js} +1 -1
  177. package/dist/client/assets/{use-copy-I4sZTiJp.js → use-copy-CwggxRep.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-mtRixRQv.js → use-create-virtual-mcp-CZRe26ST.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-Hw4VW15I.js → use-debounced-autosave-CtylY127.js} +1 -1
  180. package/dist/client/assets/use-debounced-value-BRThlWXN.js +1 -0
  181. package/dist/client/assets/{use-delete-connection-DV4DJUaY.js → use-delete-connection-BHJOzx5H.js} +1 -1
  182. package/dist/client/assets/{use-file-configs-DObQhPxD.js → use-file-configs-Dw3oHwr6.js} +1 -1
  183. package/dist/client/assets/{use-infinite-scroll-Bk__8TxT.js → use-infinite-scroll-PHACyDPD.js} +1 -1
  184. package/dist/client/assets/{use-join-requests-D-QyHVW_.js → use-join-requests-DzK_EBfe.js} +1 -1
  185. package/dist/client/assets/{use-mcp-client-0BRd9S75.js → use-mcp-client-fiFo9WZN.js} +1 -1
  186. package/dist/client/assets/{use-mcp-prompts-D4ll_rda.js → use-mcp-prompts-Cc4XqYJp.js} +1 -1
  187. package/dist/client/assets/{use-mcp-tools-UJVs9gTs.js → use-mcp-tools-DZ2dmLN4.js} +1 -1
  188. package/dist/client/assets/{use-members-BAva2zEC.js → use-members-CaBsWevB.js} +1 -1
  189. package/dist/client/assets/{use-mobile-BD2-gXK-.js → use-mobile-LV4GsbgX.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-CFNRRTVg.js → use-navigate-to-agent-BMSd7x3f.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-7sV0tnvK.js → use-org-auth-client-VEUd0F6I.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-CWJ7VJxn.js → use-org-sso-axj6nKtT.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-GhUkwr8O.js → use-organization-roles-Dcl4Pns4.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-CLeV359D.js → use-organization-settings-BQsTdhD3.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections-D7ZBIfwl.js → use-registry-connections-Do_Rvk9e.js} +1 -1
  196. package/dist/client/assets/{use-secrets-_avq30K6.js → use-secrets-BIiRA5fw.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-DAUtYLJA.js → use-status-sounds-D3_nXyIH.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-DROl2yq4.js → use-view-mode-igg5URt-.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-CI9qouIO.js → use-virtual-mcp-sFB9DBP0.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-DpyG04IT.js +1 -0
  201. package/dist/client/assets/useSuspenseInfiniteQuery-C19LNIx7.js +1 -0
  202. package/dist/client/assets/{useSuspenseQueries-DuDQjlvx.js → useSuspenseQueries-DB9vVKVd.js} +1 -1
  203. package/dist/client/assets/variant-calendar-DYjpscqX.js +1 -0
  204. package/dist/client/assets/{view-mode-toggle-Del-VZlp.js → view-mode-toggle-CUNdRghN.js} +1 -1
  205. package/dist/client/index.html +2 -2
  206. package/dist/server/cli.js +424 -424
  207. package/dist/server/server.js +266 -266
  208. package/package.json +1 -1
  209. package/dist/client/assets/agent-icon-BbjKuSxW.js +0 -1
  210. package/dist/client/assets/agents-list-g0HlqLD8.js +0 -1
  211. package/dist/client/assets/app-editor-CJVdYBr2.js +0 -1
  212. package/dist/client/assets/automations-DfhbzTi8.js +0 -1
  213. package/dist/client/assets/category-editor-BWGJADot.js +0 -1
  214. package/dist/client/assets/collection-detail-B-FYgzNz.js +0 -1
  215. package/dist/client/assets/commerce-onboarding-CCTWN0Dv.js +0 -1
  216. package/dist/client/assets/connection-detail-D66t6r8n.js +0 -1
  217. package/dist/client/assets/connections-B7dKDvRD.js +0 -1
  218. package/dist/client/assets/file-explorer-Dvmu_Dcb.js +0 -2
  219. package/dist/client/assets/github-repo-picker-DDcB4OPT.js +0 -1
  220. package/dist/client/assets/index-BQjoq239.js +0 -1
  221. package/dist/client/assets/index-C0RjSTYg.js +0 -169
  222. package/dist/client/assets/index-CkflryUu.js +0 -503
  223. package/dist/client/assets/index-Cl3nu1dQ.js +0 -1
  224. package/dist/client/assets/index-NVhaWgyE.css +0 -1
  225. package/dist/client/assets/page-seo-sheet-DTF7F_WK.js +0 -1
  226. package/dist/client/assets/post-editor-DOULNreh.js +0 -1
  227. package/dist/client/assets/preview-dialog-QbgIb_4T.js +0 -5
  228. package/dist/client/assets/project-app-view-DHWSkD1u.js +0 -1
  229. package/dist/client/assets/record-editor-Dq4SLOu9.js +0 -1
  230. package/dist/client/assets/registry-fpLTXF0f.js +0 -2
  231. package/dist/client/assets/roles-C6kCiv-A.js +0 -1
  232. package/dist/client/assets/save-status-DVA4IHRx.js +0 -1
  233. package/dist/client/assets/seo-editor-BuTMaAaQ.js +0 -1
  234. package/dist/client/assets/settings-layout-DZdRUGWz.js +0 -1
  235. package/dist/client/assets/shell-layout-C09jnc4C.js +0 -1
  236. package/dist/client/assets/store-registry-BoPJCgP8.js +0 -2
  237. package/dist/client/assets/useInfiniteQuery-jWCtindg.js +0 -1
  238. package/dist/client/assets/useSuspenseInfiniteQuery-CwejNwQJ.js +0 -1
  239. package/dist/client/assets/variant-calendar-2pJ_kR62.js +0 -1
@@ -1 +1 @@
1
- import{c as I,j as t,a as re,i as X,r as O,k as ge,K as pe,d as oe,B as he,l as K,t as ce}from"./index-tHbNbVHJ.js";import{R as xe}from"./required-auth-layout-DCkraGAX.js";import{A as G}from"./auth-split-layout-Bithe63j.js";import{O as be}from"./organization-choice-D0-tUZZw.js";import{A as me}from"./avatar-DosbYSVo.js";import{I as je}from"./input-C1uF2dQ1.js";import{L as ye}from"./label-Bg0TZhOq.js";import{S as ve}from"./switch-CuKs1fR0.js";import{t as Ne,a as Se}from"./Users03-CBNK0aq-.js";import{i as we}from"./CheckCircle-DsdDhP4L.js";import{t as ze}from"./Globe04-BNaAcUBp.js";import{a as _e}from"./Palette-C1u1Sxuh.js";import{i as ke}from"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";const Ce=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function se(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Xe(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(Oe,{})}),i[0]=e):e=i[0],e}function ie(i){const e=I.c(13),{title:g,description:r,logoUrl:m,logoFallback:o}=i;let a;e[0]!==o||e[1]!==m?(a=t.jsx("div",{children:m?t.jsx(me,{url:m,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=m,e[2]=a):a=e[2];let l;e[3]!==g?(l=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=l):l=e[4];let n;e[5]!==r?(n=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:r}),e[5]=r,e[6]=n):n=e[6];let f;e[7]!==l||e[8]!==n?(f=t.jsxs("div",{className:"space-y-2",children:[l,n]}),e[7]=l,e[8]=n,e[9]=f):f=e[9];let s;return e[10]!==a||e[11]!==f?(s=t.jsxs("div",{className:"grid gap-10",children:[a,f]}),e[10]=a,e[11]=f,e[12]=s):s=e[12],s}function Oe(){const i=I.c(4),{data:e,isPending:g}=re.useSession();if(g){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"})})}),i[0]=a):a=i[0],a}const r=e?.user?.email??"",m=e?.user?.name;let o;return i[1]!==m||i[2]!==r?(o=t.jsx(Ee,{email:r,userName:m}),i[1]=m,i[2]=r,i[3]=o):o=i[3],o}function Ee(i){const e=I.c(47),{email:g,userName:r}=i;let m,o,a,l,n,f;if(e[0]!==g||e[1]!==r){a=g.split("@")[1]?.toLowerCase()??"",l=!!a&&!Ce.has(a);const d=a.split(".")[0]??"";o=d.charAt(0).toUpperCase()+d.slice(1);let u;e[8]!==o||e[9]!==l||e[10]!==r?(u=l?o:r?.split(" ")[0]??"",e[8]=o,e[9]=l,e[10]=r,e[11]=u):u=e[11],m=u,f=ge,n=pe.domainLookup(a),e[0]=g,e[1]=r,e[2]=m,e[3]=o,e[4]=a,e[5]=l,e[6]=n,e[7]=f}else m=e[2],o=e[3],a=e[4],l=e[5],n=e[6],f=e[7];let s;e[12]!==l||e[13]!==n?(s={queryKey:n,queryFn:Re,enabled:l},e[12]=l,e[13]=n,e[14]=s):s=e[14];const{data:y,isLoading:c}=f(s);let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[15]=v):v=e[15];const[p,B]=O.useState(v),[E,z]=O.useState(!1);if(c){let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=d):d=e[16];let u;return e[17]!==a?(u=t.jsx(G,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[d,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=u):u=e[18],u}let j,S;e[19]!==y?.organizations?(j=(y?.organizations??[]).flatMap(Pe),S=j.some(Ae),e[19]=y?.organizations,e[20]=j,e[21]=S):(j=e[20],S=e[21]);const L=S;if(E){let d;e[22]!==r?(d=r?.split(" ")[0]??"",e[22]=r,e[23]=d):d=e[23];let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>z(!1),e[24]=u):u=e[24];let h;return e[25]!==o||e[26]!==a||e[27]!==l||e[28]!==d?(h=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:d,allowDomainClaim:!1,onBack:u}),e[25]=o,e[26]=a,e[27]=l,e[28]=d,e[29]=h):h=e[29],h}if(j.length>0){const d=L?j.length===1?"You have access to an organization":"You have access to multiple organizations":"Request access to an organization",u=L?"Your email domain matches an existing organization.":"Your email domain matches an organization that requires admin approval to join.";let h;e[30]!==d||e[31]!==u?(h=t.jsx(ie,{title:d,description:u}),e[30]=d,e[31]=u,e[32]=h):h=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=Y=>B(A=>new Set(A).add(Y)),e[33]=k):k=e[33];let w;e[34]!==j||e[35]!==a||e[36]!==p?(w=t.jsx(be,{organizations:j,domain:a,requestedSlugs:p,onRequestedSlug:k,onJoined:Le}),e[34]=j,e[35]=a,e[36]=p,e[37]=w):w=e[37];let _;e[38]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>z(!0),children:"Create a new organization instead"}),e[38]=_):_=e[38];let C;return e[39]!==w||e[40]!==h?(C=t.jsx(G,{children:t.jsxs("div",{className:"grid gap-10",children:[h,w,_]})}),e[39]=w,e[40]=h,e[41]=C):C=e[41],C}let b;return e[42]!==m||e[43]!==o||e[44]!==a||e[45]!==l?(b=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:m}),e[42]=m,e[43]=o,e[44]=a,e[45]=l,e[46]=b):b=e[46],b}function Le(i,e){window.location.href=`/${e}`}function Ae(i){return i.joinMode==="auto"}function Pe(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Re(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function ne(i){const e=I.c(70),{isCorporateEmail:g,emailDomain:r,domainLabel:m,defaultName:o,allowDomainClaim:a,onBack:l}=i,n=a===void 0?!0:a,f=g&&n?`https://www.google.com/s2/favicons?domain=${r}&sz=128`:null,[s,y]=O.useState(o),[c,v]=O.useState(f),[p,B]=O.useState(!0),[E,z]=O.useState(null);let j;e[0]!==p||e[1]!==c||e[2]!==s?(j=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()||void 0,logo:c??void 0,claimDomain:p})}),N=await x.json();if(!x.ok||!N.success)throw new Error(N.error||"Failed to set up organization");return N},e[0]=p,e[1]=c,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==p?(S=x=>{if(!x.slug)return;const N=de.filter(fe=>p||!fe.claimOnly).length,J=ue*(N-1)+800;z(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},J)},e[4]=p,e[5]=S):S=e[5];let L;e[6]!==j||e[7]!==S?(L={mutationFn:j,onSuccess:S},e[6]=j,e[7]=S,e[8]=L):L=e[8];const b=oe(L);let d;e[9]!==c||e[10]!==s?(d={mutationFn:async()=>{const x=s.trim(),N=se(x);if(!N)throw new Error("Invalid organization name");const J=await re.organization.create({name:x,slug:N,...c?{logo:c}:{}});if(J?.error)throw new Error(J.error.message||"Failed to create organization");window.location.href=`/${J?.data?.slug??N}`}},e[9]=c,e[10]=s,e[11]=d):d=e[11];const u=oe(d);if(b.isPending||E){let x;e[12]!==m||e[13]!==s?(x=s.trim()||m,e[12]=m,e[13]=s,e[14]=x):x=e[14];let N;return e[15]!==p||e[16]!==r||e[17]!==c||e[18]!==x?(N=t.jsx(G,{children:t.jsx(Fe,{orgName:x,domain:r,claimDomain:p,logoUrl:c})}),e[15]=p,e[16]=r,e[17]=c,e[18]=x,e[19]=N):N=e[19],N}const h=u.isPending;let k;e[20]!==s?(k=se(s.trim()),e[20]=s,e[21]=k):k=e[21];const w=!!k,_=b.error||u.error||null;let C;e[22]!==n||e[23]!==w||e[24]!==u||e[25]!==b||e[26]!==g?(C=x=>{x.preventDefault(),w&&(g&&n?b.mutate():u.mutate())},e[22]=n,e[23]=w,e[24]=u,e[25]=b,e[26]=g,e[27]=C):C=e[27];const Y=C;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ie,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=A):A=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=W):W=e[29];let P;e[30]!==o||e[31]!==s?(P=(s.trim()||o||"?").charAt(0).toUpperCase(),e[30]=o,e[31]=s,e[32]=P):P=e[32];const Z=h||b.isPending;let R;e[33]!==c||e[34]!==P||e[35]!==Z?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[W,t.jsx($e,{value:c,fallback:P,onChange:v,disabled:Z})]}),e[33]=c,e[34]=P,e[35]=Z,e[36]=R):R=e[36];let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(ye,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=H):H=e[37];let Q;e[38]===Symbol.for("react.memo_cache_sentinel")?(Q=x=>y(x.target.value),e[38]=Q):Q=e[38];const ee=o||"My Organization",te=h||b.isPending;let $;e[39]!==s||e[40]!==ee||e[41]!==te?($=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[H,t.jsx(je,{id:"org-name",value:s,onChange:Q,placeholder:ee,disabled:te,className:"h-10 max-w-[220px]"})]}),e[39]=s,e[40]=ee,e[41]=te,e[42]=$):$=e[42];let D;e[43]!==n||e[44]!==p||e[45]!==b.isPending||e[46]!==r||e[47]!==g||e[48]!==h?(D=g&&n&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",r," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",r," email can join this org"]})]}),t.jsx(ve,{checked:p,onCheckedChange:B,disabled:h||b.isPending})]}),e[43]=n,e[44]=p,e[45]=b.isPending,e[46]=r,e[47]=g,e[48]=h,e[49]=D):D=e[49];let F;e[50]!==R||e[51]!==$||e[52]!==D?(F=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,$,D]}),e[50]=R,e[51]=$,e[52]=D,e[53]=F):F=e[53];let M;e[54]!==_?(M=_&&t.jsx("p",{className:"text-xs text-destructive",children:_ instanceof Error?_.message:"Failed to create organization"}),e[54]=_,e[55]=M):M=e[55];const ae=!w||h||b.isPending;let q;e[56]!==b.isPending||e[57]!==h?(q=h||b.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(X,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=b.isPending,e[57]=h,e[58]=q):q=e[58];let U;e[59]!==ae||e[60]!==q?(U=t.jsx(he,{type:"submit",size:"xl",className:"w-full",disabled:ae,children:q}),e[59]=ae,e[60]=q,e[61]=U):U=e[61];let T;e[62]!==l?(T=l&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:l,children:"See available organizations"}),e[62]=l,e[63]=T):T=e[63];let V;return e[64]!==Y||e[65]!==F||e[66]!==M||e[67]!==U||e[68]!==T?(V=t.jsx(G,{children:t.jsxs("form",{onSubmit:Y,className:"grid gap-10",children:[A,F,M,U,T]})}),e[64]=Y,e[65]=F,e[66]=M,e[67]=U,e[68]=T,e[69]=V):V=e[69],V}function $e(i){const e=I.c(14),{value:g,fallback:r,onChange:m,disabled:o}=i,a=O.useRef(null);let l;e[0]!==m?(l=B=>{const E=B.target.files?.[0];if(!E)return;if(E.size>2097152){ce.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const z=new FileReader;z.onerror=De,z.onloadend=()=>{z.result&&m(z.result),a.current&&(a.current.value="")},z.readAsDataURL(E)},e[0]=m,e[1]=l):l=e[1];const n=l;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a.current?.click(),e[2]=f):f=e[2];let s;e[3]!==o||e[4]!==n?(s=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];const y=g??void 0;let c;e[6]!==r||e[7]!==y?(c=t.jsx(me,{url:y,fallback:r,shape:"square",size:"base"}),e[6]=r,e[7]=y,e[8]=c):c=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ke,{size:14,className:"text-white"})}),e[9]=v):v=e[9];let p;return e[10]!==o||e[11]!==s||e[12]!==c?(p=t.jsxs("button",{type:"button",onClick:f,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[s,c,v]}),e[10]=o,e[11]=s,e[12]=c,e[13]=p):p=e[13],p}function De(){return ce.error("Failed to read image")}const de=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:ze,label:"Claiming email domain",claimOnly:!0},{icon:Se,label:"Enabling auto-join for your team",claimOnly:!0},{icon:_e,label:"Extracting brand context",claimOnly:!1}],ue=1500,le=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:i,domain:e,claimDomain:g,logoUrl:r}){const m=de.filter(n=>g||!n.claimOnly),[o,a]=O.useState(0),l=O.useRef(!1);if(!l.current){l.current=!0;for(let n=1;n<m.length;n++)setTimeout(()=>a(n),ue*n)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(ie,{title:`Setting up ${i}`,description:`Getting everything ready from ${e}`,logoUrl:r??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:m.map((n,f)=>{const s=n.icon,y=f===o,c=f<o,v=le[f%le.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:c||y?1:.4},children:[t.jsxs("span",{className:K("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!c&&(y?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:c?{backgroundColor:v.bg,color:v.fg}:void 0,children:[t.jsx(we,{size:16,className:K("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",c?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(X,{size:16,className:K("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",y?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(s,{size:16,className:K("absolute motion-safe:transition-opacity motion-safe:duration-200",!c&&!y?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:K("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",y||c?"text-foreground":"text-muted-foreground"),children:n.label})]},n.label)})})]})}export{Xe as default};
1
+ import{c as I,j as t,a as re,i as X,r as O,k as ge,K as pe,d as oe,B as he,l as K,t as ce}from"./index-DJ-0yJzO.js";import{R as xe}from"./required-auth-layout-Dto8wlZl.js";import{A as G}from"./auth-split-layout-CozHTgSY.js";import{O as be}from"./organization-choice-DrYPCeGO.js";import{A as me}from"./avatar-CCs3cbGI.js";import{I as je}from"./input-C2eR67CX.js";import{L as ye}from"./label-dfUb2uoI.js";import{S as ve}from"./switch-COQDKJ_b.js";import{t as Ne,a as Se}from"./Users03-Dlm3r0r-.js";import{i as we}from"./CheckCircle-BBV9CFFT.js";import{t as ze}from"./Globe04-BVemAfGE.js";import{a as _e}from"./Palette-wlYD__vW.js";import{i as ke}from"./Upload01-aTx0MT4i.js";import"./User01-y8ntusMn.js";const Ce=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function se(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Xe(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(Oe,{})}),i[0]=e):e=i[0],e}function ie(i){const e=I.c(13),{title:g,description:r,logoUrl:m,logoFallback:o}=i;let a;e[0]!==o||e[1]!==m?(a=t.jsx("div",{children:m?t.jsx(me,{url:m,fallback:o??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=o,e[1]=m,e[2]=a):a=e[2];let l;e[3]!==g?(l=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=l):l=e[4];let n;e[5]!==r?(n=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:r}),e[5]=r,e[6]=n):n=e[6];let f;e[7]!==l||e[8]!==n?(f=t.jsxs("div",{className:"space-y-2",children:[l,n]}),e[7]=l,e[8]=n,e[9]=f):f=e[9];let s;return e[10]!==a||e[11]!==f?(s=t.jsxs("div",{className:"grid gap-10",children:[a,f]}),e[10]=a,e[11]=f,e[12]=s):s=e[12],s}function Oe(){const i=I.c(4),{data:e,isPending:g}=re.useSession();if(g){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(G,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"})})}),i[0]=a):a=i[0],a}const r=e?.user?.email??"",m=e?.user?.name;let o;return i[1]!==m||i[2]!==r?(o=t.jsx(Ee,{email:r,userName:m}),i[1]=m,i[2]=r,i[3]=o):o=i[3],o}function Ee(i){const e=I.c(47),{email:g,userName:r}=i;let m,o,a,l,n,f;if(e[0]!==g||e[1]!==r){a=g.split("@")[1]?.toLowerCase()??"",l=!!a&&!Ce.has(a);const d=a.split(".")[0]??"";o=d.charAt(0).toUpperCase()+d.slice(1);let u;e[8]!==o||e[9]!==l||e[10]!==r?(u=l?o:r?.split(" ")[0]??"",e[8]=o,e[9]=l,e[10]=r,e[11]=u):u=e[11],m=u,f=ge,n=pe.domainLookup(a),e[0]=g,e[1]=r,e[2]=m,e[3]=o,e[4]=a,e[5]=l,e[6]=n,e[7]=f}else m=e[2],o=e[3],a=e[4],l=e[5],n=e[6],f=e[7];let s;e[12]!==l||e[13]!==n?(s={queryKey:n,queryFn:Re,enabled:l},e[12]=l,e[13]=n,e[14]=s):s=e[14];const{data:y,isLoading:c}=f(s);let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[15]=v):v=e[15];const[p,B]=O.useState(v),[E,z]=O.useState(!1);if(c){let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(X,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=d):d=e[16];let u;return e[17]!==a?(u=t.jsx(G,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[d,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=u):u=e[18],u}let j,S;e[19]!==y?.organizations?(j=(y?.organizations??[]).flatMap(Pe),S=j.some(Ae),e[19]=y?.organizations,e[20]=j,e[21]=S):(j=e[20],S=e[21]);const L=S;if(E){let d;e[22]!==r?(d=r?.split(" ")[0]??"",e[22]=r,e[23]=d):d=e[23];let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=()=>z(!1),e[24]=u):u=e[24];let h;return e[25]!==o||e[26]!==a||e[27]!==l||e[28]!==d?(h=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:d,allowDomainClaim:!1,onBack:u}),e[25]=o,e[26]=a,e[27]=l,e[28]=d,e[29]=h):h=e[29],h}if(j.length>0){const d=L?j.length===1?"You have access to an organization":"You have access to multiple organizations":"Request access to an organization",u=L?"Your email domain matches an existing organization.":"Your email domain matches an organization that requires admin approval to join.";let h;e[30]!==d||e[31]!==u?(h=t.jsx(ie,{title:d,description:u}),e[30]=d,e[31]=u,e[32]=h):h=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=Y=>B(A=>new Set(A).add(Y)),e[33]=k):k=e[33];let w;e[34]!==j||e[35]!==a||e[36]!==p?(w=t.jsx(be,{organizations:j,domain:a,requestedSlugs:p,onRequestedSlug:k,onJoined:Le}),e[34]=j,e[35]=a,e[36]=p,e[37]=w):w=e[37];let _;e[38]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:()=>z(!0),children:"Create a new organization instead"}),e[38]=_):_=e[38];let C;return e[39]!==w||e[40]!==h?(C=t.jsx(G,{children:t.jsxs("div",{className:"grid gap-10",children:[h,w,_]})}),e[39]=w,e[40]=h,e[41]=C):C=e[41],C}let b;return e[42]!==m||e[43]!==o||e[44]!==a||e[45]!==l?(b=t.jsx(ne,{isCorporateEmail:l,emailDomain:a,domainLabel:o,defaultName:m}),e[42]=m,e[43]=o,e[44]=a,e[45]=l,e[46]=b):b=e[46],b}function Le(i,e){window.location.href=`/${e}`}function Ae(i){return i.joinMode==="auto"}function Pe(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Re(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function ne(i){const e=I.c(70),{isCorporateEmail:g,emailDomain:r,domainLabel:m,defaultName:o,allowDomainClaim:a,onBack:l}=i,n=a===void 0?!0:a,f=g&&n?`https://www.google.com/s2/favicons?domain=${r}&sz=128`:null,[s,y]=O.useState(o),[c,v]=O.useState(f),[p,B]=O.useState(!0),[E,z]=O.useState(null);let j;e[0]!==p||e[1]!==c||e[2]!==s?(j=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()||void 0,logo:c??void 0,claimDomain:p})}),N=await x.json();if(!x.ok||!N.success)throw new Error(N.error||"Failed to set up organization");return N},e[0]=p,e[1]=c,e[2]=s,e[3]=j):j=e[3];let S;e[4]!==p?(S=x=>{if(!x.slug)return;const N=de.filter(fe=>p||!fe.claimOnly).length,J=ue*(N-1)+800;z(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},J)},e[4]=p,e[5]=S):S=e[5];let L;e[6]!==j||e[7]!==S?(L={mutationFn:j,onSuccess:S},e[6]=j,e[7]=S,e[8]=L):L=e[8];const b=oe(L);let d;e[9]!==c||e[10]!==s?(d={mutationFn:async()=>{const x=s.trim(),N=se(x);if(!N)throw new Error("Invalid organization name");const J=await re.organization.create({name:x,slug:N,...c?{logo:c}:{}});if(J?.error)throw new Error(J.error.message||"Failed to create organization");window.location.href=`/${J?.data?.slug??N}`}},e[9]=c,e[10]=s,e[11]=d):d=e[11];const u=oe(d);if(b.isPending||E){let x;e[12]!==m||e[13]!==s?(x=s.trim()||m,e[12]=m,e[13]=s,e[14]=x):x=e[14];let N;return e[15]!==p||e[16]!==r||e[17]!==c||e[18]!==x?(N=t.jsx(G,{children:t.jsx(Fe,{orgName:x,domain:r,claimDomain:p,logoUrl:c})}),e[15]=p,e[16]=r,e[17]=c,e[18]=x,e[19]=N):N=e[19],N}const h=u.isPending;let k;e[20]!==s?(k=se(s.trim()),e[20]=s,e[21]=k):k=e[21];const w=!!k,_=b.error||u.error||null;let C;e[22]!==n||e[23]!==w||e[24]!==u||e[25]!==b||e[26]!==g?(C=x=>{x.preventDefault(),w&&(g&&n?b.mutate():u.mutate())},e[22]=n,e[23]=w,e[24]=u,e[25]=b,e[26]=g,e[27]=C):C=e[27];const Y=C;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ie,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=A):A=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:"Organization avatar"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional"})]}),e[29]=W):W=e[29];let P;e[30]!==o||e[31]!==s?(P=(s.trim()||o||"?").charAt(0).toUpperCase(),e[30]=o,e[31]=s,e[32]=P):P=e[32];const Z=h||b.isPending;let R;e[33]!==c||e[34]!==P||e[35]!==Z?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[W,t.jsx($e,{value:c,fallback:P,onChange:v,disabled:Z})]}),e[33]=c,e[34]=P,e[35]=Z,e[36]=R):R=e[36];let H;e[37]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(ye,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=H):H=e[37];let Q;e[38]===Symbol.for("react.memo_cache_sentinel")?(Q=x=>y(x.target.value),e[38]=Q):Q=e[38];const ee=o||"My Organization",te=h||b.isPending;let $;e[39]!==s||e[40]!==ee||e[41]!==te?($=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[H,t.jsx(je,{id:"org-name",value:s,onChange:Q,placeholder:ee,disabled:te,className:"h-10 max-w-[220px]"})]}),e[39]=s,e[40]=ee,e[41]=te,e[42]=$):$=e[42];let D;e[43]!==n||e[44]!==p||e[45]!==b.isPending||e[46]!==r||e[47]!==g||e[48]!==h?(D=g&&n&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Allow @",r," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",r," email can join this org"]})]}),t.jsx(ve,{checked:p,onCheckedChange:B,disabled:h||b.isPending})]}),e[43]=n,e[44]=p,e[45]=b.isPending,e[46]=r,e[47]=g,e[48]=h,e[49]=D):D=e[49];let F;e[50]!==R||e[51]!==$||e[52]!==D?(F=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,$,D]}),e[50]=R,e[51]=$,e[52]=D,e[53]=F):F=e[53];let M;e[54]!==_?(M=_&&t.jsx("p",{className:"text-xs text-destructive",children:_ instanceof Error?_.message:"Failed to create organization"}),e[54]=_,e[55]=M):M=e[55];const ae=!w||h||b.isPending;let q;e[56]!==b.isPending||e[57]!==h?(q=h||b.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(X,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=b.isPending,e[57]=h,e[58]=q):q=e[58];let U;e[59]!==ae||e[60]!==q?(U=t.jsx(he,{type:"submit",size:"xl",className:"w-full",disabled:ae,children:q}),e[59]=ae,e[60]=q,e[61]=U):U=e[61];let T;e[62]!==l?(T=l&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:l,children:"See available organizations"}),e[62]=l,e[63]=T):T=e[63];let V;return e[64]!==Y||e[65]!==F||e[66]!==M||e[67]!==U||e[68]!==T?(V=t.jsx(G,{children:t.jsxs("form",{onSubmit:Y,className:"grid gap-10",children:[A,F,M,U,T]})}),e[64]=Y,e[65]=F,e[66]=M,e[67]=U,e[68]=T,e[69]=V):V=e[69],V}function $e(i){const e=I.c(14),{value:g,fallback:r,onChange:m,disabled:o}=i,a=O.useRef(null);let l;e[0]!==m?(l=B=>{const E=B.target.files?.[0];if(!E)return;if(E.size>2097152){ce.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const z=new FileReader;z.onerror=De,z.onloadend=()=>{z.result&&m(z.result),a.current&&(a.current.value="")},z.readAsDataURL(E)},e[0]=m,e[1]=l):l=e[1];const n=l;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a.current?.click(),e[2]=f):f=e[2];let s;e[3]!==o||e[4]!==n?(s=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),e[3]=o,e[4]=n,e[5]=s):s=e[5];const y=g??void 0;let c;e[6]!==r||e[7]!==y?(c=t.jsx(me,{url:y,fallback:r,shape:"square",size:"base"}),e[6]=r,e[7]=y,e[8]=c):c=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ke,{size:14,className:"text-white"})}),e[9]=v):v=e[9];let p;return e[10]!==o||e[11]!==s||e[12]!==c?(p=t.jsxs("button",{type:"button",onClick:f,disabled:o,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":"Upload organization logo",children:[s,c,v]}),e[10]=o,e[11]=s,e[12]=c,e[13]=p):p=e[13],p}function De(){return ce.error("Failed to read image")}const de=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:ze,label:"Claiming email domain",claimOnly:!0},{icon:Se,label:"Enabling auto-join for your team",claimOnly:!0},{icon:_e,label:"Extracting brand context",claimOnly:!1}],ue=1500,le=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Fe({orgName:i,domain:e,claimDomain:g,logoUrl:r}){const m=de.filter(n=>g||!n.claimOnly),[o,a]=O.useState(0),l=O.useRef(!1);if(!l.current){l.current=!0;for(let n=1;n<m.length;n++)setTimeout(()=>a(n),ue*n)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(ie,{title:`Setting up ${i}`,description:`Getting everything ready from ${e}`,logoUrl:r??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:m.map((n,f)=>{const s=n.icon,y=f===o,c=f<o,v=le[f%le.length];return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:c||y?1:.4},children:[t.jsxs("span",{className:K("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!c&&(y?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:c?{backgroundColor:v.bg,color:v.fg}:void 0,children:[t.jsx(we,{size:16,className:K("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",c?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(X,{size:16,className:K("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",y?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(s,{size:16,className:K("absolute motion-safe:transition-opacity motion-safe:duration-200",!c&&!y?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:K("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",y||c?"text-foreground":"text-muted-foreground"),children:n.label})]},n.label)})})]})}export{Xe as default};
@@ -1 +1 @@
1
- import{c as k,r as z,b5 as S,e as _,x as E,b6 as T,j as o,G as $}from"./index-tHbNbVHJ.js";const L="#f6f4ed",P="#ffffff",H=[{src:"/icons/icon-192.png",sizes:"192x192",type:"image/png"},{src:"/icons/icon-512.png",sizes:"512x512",type:"image/png"}];function R(e,n){const t=`${n}/${e.slug}`,i=[...e.logo?[{src:e.logo,sizes:"192x192",purpose:"any"},{src:e.logo,sizes:"512x512",purpose:"any"},{src:e.logo,sizes:"any",purpose:"any"}]:[],...H],l={id:t,name:e.name,short_name:e.name,start_url:t,scope:t,display:"standalone",display_override:["window-controls-overlay"],background_color:P,theme_color:L,icons:i};return`data:application/manifest+json,${encodeURIComponent(JSON.stringify(l))}`}function O(e){const n=document.querySelector(`link[rel="${e}"]`);if(n)return n;const t=document.createElement("link");return t.rel=e,document.head.appendChild(t),t}function U(e){const n=document.querySelector(`meta[name="${e}"]`);if(n)return n;const t=document.createElement("meta");return t.name=e,document.head.appendChild(t),t}function M(e){const n=k.c(5),t=e?.name??"",i=e?.slug??"",l=e?.logo??"";let a,c;n[0]!==l||n[1]!==t||n[2]!==i?(a=()=>{if(!i||!t||typeof document>"u"||typeof window>"u")return;const d=O("manifest"),m=O("apple-touch-icon"),u=U("apple-mobile-web-app-title"),r={manifest:d.getAttribute("href"),appleIcon:m.getAttribute("href"),appleTitle:u.getAttribute("content"),title:document.title};return d.setAttribute("href",R({name:t,slug:i,logo:l||null},window.location.origin)),l&&m.setAttribute("href",l),u.setAttribute("content",t),document.title=t,S(),()=>{r.manifest!==null&&d.setAttribute("href",r.manifest),r.appleIcon!==null&&m.setAttribute("href",r.appleIcon),r.appleTitle!==null&&u.setAttribute("content",r.appleTitle),document.title=r.title,S()}},c=[t,i,l],n[0]=l,n[1]=t,n[2]=i,n[3]=a,n[4]=c):(a=n[3],c=n[4]),z.useLayoutEffect(a,c)}function q(){const e=k.c(31);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const{org:t}=_(n),{data:i}=E();let l;e[1]!==i||e[2]!==t?(l=i?.find(N=>N.slug===t),e[1]=i,e[2]=t,e[3]=l):l=e[3];const a=l;let c;e[4]!==a?(c=a?{name:a.name,slug:a.slug,logo:a.logo??null}:null,e[4]=a,e[5]=c):c=e[5],M(c);const{canPrompt:d,installed:m,ios:u,promptInstall:r}=T(),[y,w]=z.useState(null),s=a?.name??"this organization",C=a?.logo;let b;e[6]!==s||e[7]!==r?(b=async()=>{const N=await r();w(N==="accepted"?`Installing ${s}…`:N==="dismissed"?"Install dismissed.":null)},e[6]=s,e[7]=r,e[8]=b):b=e[8];const A=b,I=C||"/icons/icon-192.png";let p;e[9]!==s||e[10]!==I?(p=o.jsx("img",{src:I,alt:s,className:"size-20 rounded-2xl border border-border/50 object-cover"}),e[9]=s,e[10]=I,e[11]=p):p=e[11];let f;e[12]!==s?(f=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Add ",s," to your Home Screen"]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install ",s," as its own app — a standalone window that opens straight into this organization. To install the full deco Studio app instead, use your browser's “Add to Home Screen” from any other page."]})]}),e[12]=s,e[13]=f):f=e[13];let x;e[14]!==d||e[15]!==A||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(x=m?o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[s," is already installed on this device."]}):u?o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[o.jsx("p",{className:"font-medium",children:"Install on iOS"}),o.jsxs("p",{className:"text-muted-foreground",children:["Tap the ",o.jsx("span",{className:"font-medium",children:"Share"})," button, then choose ",o.jsx("span",{className:"font-medium",children:"Add to Home Screen"}),"."]})]}):d?o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsxs("button",{type:"button",onClick:A,className:"rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:["Add ",s," to Home Screen"]}),y&&o.jsx("p",{className:"text-sm text-muted-foreground",children:y})]}):o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-muted-foreground",children:["To install, open your browser's menu and choose"," ",o.jsxs("span",{className:"font-medium text-foreground",children:["Install ",s]})," ","(or “Add to Home Screen”). If you don't see it yet, interact with the app for a moment and try again."]}),e[14]=d,e[15]=A,e[16]=m,e[17]=u,e[18]=s,e[19]=y,e[20]=x):x=e[20];const v=t??"";let g;e[21]!==v?(g={org:v},e[21]=v,e[22]=g):g=e[22];let h;e[23]!==s||e[24]!==g?(h=o.jsxs($,{to:"/$org",params:g,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=g,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==x?(j=o.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-6",children:o.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:[p,f,x,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=x,e[30]=j):j=e[30],j}export{q as default};
1
+ import{c as k,r as z,b5 as S,e as _,x as E,b6 as T,j as o,G as $}from"./index-DJ-0yJzO.js";const L="#f6f4ed",P="#ffffff",H=[{src:"/icons/icon-192.png",sizes:"192x192",type:"image/png"},{src:"/icons/icon-512.png",sizes:"512x512",type:"image/png"}];function R(e,n){const t=`${n}/${e.slug}`,i=[...e.logo?[{src:e.logo,sizes:"192x192",purpose:"any"},{src:e.logo,sizes:"512x512",purpose:"any"},{src:e.logo,sizes:"any",purpose:"any"}]:[],...H],l={id:t,name:e.name,short_name:e.name,start_url:t,scope:t,display:"standalone",display_override:["window-controls-overlay"],background_color:P,theme_color:L,icons:i};return`data:application/manifest+json,${encodeURIComponent(JSON.stringify(l))}`}function O(e){const n=document.querySelector(`link[rel="${e}"]`);if(n)return n;const t=document.createElement("link");return t.rel=e,document.head.appendChild(t),t}function U(e){const n=document.querySelector(`meta[name="${e}"]`);if(n)return n;const t=document.createElement("meta");return t.name=e,document.head.appendChild(t),t}function M(e){const n=k.c(5),t=e?.name??"",i=e?.slug??"",l=e?.logo??"";let a,c;n[0]!==l||n[1]!==t||n[2]!==i?(a=()=>{if(!i||!t||typeof document>"u"||typeof window>"u")return;const d=O("manifest"),m=O("apple-touch-icon"),u=U("apple-mobile-web-app-title"),r={manifest:d.getAttribute("href"),appleIcon:m.getAttribute("href"),appleTitle:u.getAttribute("content"),title:document.title};return d.setAttribute("href",R({name:t,slug:i,logo:l||null},window.location.origin)),l&&m.setAttribute("href",l),u.setAttribute("content",t),document.title=t,S(),()=>{r.manifest!==null&&d.setAttribute("href",r.manifest),r.appleIcon!==null&&m.setAttribute("href",r.appleIcon),r.appleTitle!==null&&u.setAttribute("content",r.appleTitle),document.title=r.title,S()}},c=[t,i,l],n[0]=l,n[1]=t,n[2]=i,n[3]=a,n[4]=c):(a=n[3],c=n[4]),z.useLayoutEffect(a,c)}function q(){const e=k.c(31);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const{org:t}=_(n),{data:i}=E();let l;e[1]!==i||e[2]!==t?(l=i?.find(N=>N.slug===t),e[1]=i,e[2]=t,e[3]=l):l=e[3];const a=l;let c;e[4]!==a?(c=a?{name:a.name,slug:a.slug,logo:a.logo??null}:null,e[4]=a,e[5]=c):c=e[5],M(c);const{canPrompt:d,installed:m,ios:u,promptInstall:r}=T(),[y,w]=z.useState(null),s=a?.name??"this organization",C=a?.logo;let b;e[6]!==s||e[7]!==r?(b=async()=>{const N=await r();w(N==="accepted"?`Installing ${s}…`:N==="dismissed"?"Install dismissed.":null)},e[6]=s,e[7]=r,e[8]=b):b=e[8];const A=b,I=C||"/icons/icon-192.png";let p;e[9]!==s||e[10]!==I?(p=o.jsx("img",{src:I,alt:s,className:"size-20 rounded-2xl border border-border/50 object-cover"}),e[9]=s,e[10]=I,e[11]=p):p=e[11];let f;e[12]!==s?(f=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Add ",s," to your Home Screen"]}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install ",s," as its own app — a standalone window that opens straight into this organization. To install the full deco Studio app instead, use your browser's “Add to Home Screen” from any other page."]})]}),e[12]=s,e[13]=f):f=e[13];let x;e[14]!==d||e[15]!==A||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(x=m?o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[s," is already installed on this device."]}):u?o.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted px-4 py-3 text-sm text-foreground",children:[o.jsx("p",{className:"font-medium",children:"Install on iOS"}),o.jsxs("p",{className:"text-muted-foreground",children:["Tap the ",o.jsx("span",{className:"font-medium",children:"Share"})," button, then choose ",o.jsx("span",{className:"font-medium",children:"Add to Home Screen"}),"."]})]}):d?o.jsxs("div",{className:"flex flex-col items-center gap-3",children:[o.jsxs("button",{type:"button",onClick:A,className:"rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:["Add ",s," to Home Screen"]}),y&&o.jsx("p",{className:"text-sm text-muted-foreground",children:y})]}):o.jsxs("p",{className:"rounded-lg bg-muted px-4 py-3 text-sm text-muted-foreground",children:["To install, open your browser's menu and choose"," ",o.jsxs("span",{className:"font-medium text-foreground",children:["Install ",s]})," ","(or “Add to Home Screen”). If you don't see it yet, interact with the app for a moment and try again."]}),e[14]=d,e[15]=A,e[16]=m,e[17]=u,e[18]=s,e[19]=y,e[20]=x):x=e[20];const v=t??"";let g;e[21]!==v?(g={org:v},e[21]=v,e[22]=g):g=e[22];let h;e[23]!==s||e[24]!==g?(h=o.jsxs($,{to:"/$org",params:g,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=g,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==x?(j=o.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-6",children:o.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-6 text-center",children:[p,f,x,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=x,e[30]=j):j=e[30],j}export{q as default};
@@ -1 +1 @@
1
- import{c as o,j as r,O as s}from"./index-tHbNbVHJ.js";function c(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(s,{}),e[0]=t):t=e[0],t}export{c as default};
1
+ import{c as o,j as r,O as s}from"./index-DJ-0yJzO.js";function c(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(s,{}),e[0]=t):t=e[0],t}export{c as default};
@@ -1 +1 @@
1
- import{c as L,r as B,d as O,j as t,B as M,i as F}from"./index-tHbNbVHJ.js";import{A as U}from"./avatar-DosbYSVo.js";function I(r){const e=L.c(41),{organizations:i,domain:l,requestedSlugs:v,onRequestedSlug:y,onSelected:p,onJoined:c,onRequestCompleted:k,selectLabel:E}=r,x=E===void 0?"Select":E;let q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q=new Set,e[0]=q):q=e[0];const[_,P]=B.useState(q);let b;e[1]!==y?(b=o=>{P(s=>new Set(s).add(o)),y?.(o)},e[1]=y,e[2]=b):b=e[2];const C=b;let w;e[3]!==c?(w={mutationFn:D,onSuccess:o=>{const{organization:s,slug:f}=o;c?.(s,f)}},e[3]=c,e[4]=w):w=e[4];const n=O(w);let z;e[5]!==C||e[6]!==c||e[7]!==k?(z={mutationFn:$,onSuccess:o=>{const{organization:s,slug:f,alreadyMember:J}=o;if(J&&f){c?.(s,f);return}C(s.slug),k?.(s)}},e[5]=C,e[6]=c,e[7]=k,e[8]=z):z=e[8];const a=O(z);let u;e[9]!==v?(u=v??[],e[9]=v,e[10]=u):u=e[10];let N;e[11]!==_||e[12]!==u?(N=new Set([...u,..._]),e[11]=_,e[12]=u,e[13]=N):N=e[13];const h=N,j=n.variables?.slug??null,S=a.variables?.slug??null;let d;if(e[14]!==l||e[15]!==h||e[16]!==n||e[17]!==p||e[18]!==i||e[19]!==j||e[20]!==S||e[21]!==a||e[22]!==x){let o;e[24]!==l||e[25]!==h||e[26]!==n||e[27]!==p||e[28]!==j||e[29]!==S||e[30]!==a||e[31]!==x?(o=s=>{const f=n.isPending&&j===s.slug,J=a.isPending&&S===s.slug,T=h.has(s.slug),A=s.logo??(l?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null);return t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(U,{url:A??void 0,fallback:s.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:s.name}),l&&t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",l]})]}),s.joinMode==="auto"?t.jsx(M,{size:"default",onClick:()=>n.mutate(s),disabled:n.isPending,children:f?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," Joining..."]}):"Join"}):s.joinMode==="request"?T?t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):t.jsx(M,{size:"default",variant:"outline",onClick:()=>a.mutate(s),disabled:a.isPending,children:J?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," ","Requesting..."]}):"Request to join"}):t.jsx(M,{size:"default",onClick:()=>p?.(s),children:x})]},s.id)},e[24]=l,e[25]=h,e[26]=n,e[27]=p,e[28]=j,e[29]=S,e[30]=a,e[31]=x,e[32]=o):o=e[32],d=i.map(o),e[14]=l,e[15]=h,e[16]=n,e[17]=p,e[18]=i,e[19]=j,e[20]=S,e[21]=a,e[22]=x,e[23]=d}else d=e[23];let m;e[33]!==n.error?(m=n.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[33]=n.error,e[34]=m):m=e[34];let g;e[35]!==a.error?(g=a.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[35]=a.error,e[36]=g):g=e[36];let R;return e[37]!==g||e[38]!==d||e[39]!==m?(R=t.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g]}),e[37]=g,e[38]=d,e[39]=m,e[40]=R):R=e[40],R}async function $(r){const e=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to request access");return{organization:r,slug:i.slug,alreadyMember:i.alreadyMember}}async function D(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to join organization");return{organization:r,slug:i.slug??r.slug}}export{I as O};
1
+ import{c as L,r as B,d as O,j as t,B as M,i as F}from"./index-DJ-0yJzO.js";import{A as U}from"./avatar-CCs3cbGI.js";function I(r){const e=L.c(41),{organizations:i,domain:l,requestedSlugs:v,onRequestedSlug:y,onSelected:p,onJoined:c,onRequestCompleted:k,selectLabel:E}=r,x=E===void 0?"Select":E;let q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q=new Set,e[0]=q):q=e[0];const[_,P]=B.useState(q);let b;e[1]!==y?(b=o=>{P(s=>new Set(s).add(o)),y?.(o)},e[1]=y,e[2]=b):b=e[2];const C=b;let w;e[3]!==c?(w={mutationFn:D,onSuccess:o=>{const{organization:s,slug:f}=o;c?.(s,f)}},e[3]=c,e[4]=w):w=e[4];const n=O(w);let z;e[5]!==C||e[6]!==c||e[7]!==k?(z={mutationFn:$,onSuccess:o=>{const{organization:s,slug:f,alreadyMember:J}=o;if(J&&f){c?.(s,f);return}C(s.slug),k?.(s)}},e[5]=C,e[6]=c,e[7]=k,e[8]=z):z=e[8];const a=O(z);let u;e[9]!==v?(u=v??[],e[9]=v,e[10]=u):u=e[10];let N;e[11]!==_||e[12]!==u?(N=new Set([...u,..._]),e[11]=_,e[12]=u,e[13]=N):N=e[13];const h=N,j=n.variables?.slug??null,S=a.variables?.slug??null;let d;if(e[14]!==l||e[15]!==h||e[16]!==n||e[17]!==p||e[18]!==i||e[19]!==j||e[20]!==S||e[21]!==a||e[22]!==x){let o;e[24]!==l||e[25]!==h||e[26]!==n||e[27]!==p||e[28]!==j||e[29]!==S||e[30]!==a||e[31]!==x?(o=s=>{const f=n.isPending&&j===s.slug,J=a.isPending&&S===s.slug,T=h.has(s.slug),A=s.logo??(l?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null);return t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(U,{url:A??void 0,fallback:s.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:s.name}),l&&t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",l]})]}),s.joinMode==="auto"?t.jsx(M,{size:"default",onClick:()=>n.mutate(s),disabled:n.isPending,children:f?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," Joining..."]}):"Join"}):s.joinMode==="request"?T?t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):t.jsx(M,{size:"default",variant:"outline",onClick:()=>a.mutate(s),disabled:a.isPending,children:J?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(F,{size:14,className:"animate-spin"})," ","Requesting..."]}):"Request to join"}):t.jsx(M,{size:"default",onClick:()=>p?.(s),children:x})]},s.id)},e[24]=l,e[25]=h,e[26]=n,e[27]=p,e[28]=j,e[29]=S,e[30]=a,e[31]=x,e[32]=o):o=e[32],d=i.map(o),e[14]=l,e[15]=h,e[16]=n,e[17]=p,e[18]=i,e[19]=j,e[20]=S,e[21]=a,e[22]=x,e[23]=d}else d=e[23];let m;e[33]!==n.error?(m=n.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[33]=n.error,e[34]=m):m=e[34];let g;e[35]!==a.error?(g=a.error&&t.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[35]=a.error,e[36]=g):g=e[36];let R;return e[37]!==g||e[38]!==d||e[39]!==m?(R=t.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g]}),e[37]=g,e[38]=d,e[39]=m,e[40]=R):R=e[40],R}async function $(r){const e=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to request access");return{organization:r,slug:i.slug,alreadyMember:i.alreadyMember}}async function D(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r.slug})}),i=await e.json();if(!e.ok||!i.success)throw new Error(i.error||"Failed to join organization");return{organization:r,slug:i.slug??r.slug}}export{I as O};
@@ -1 +1 @@
1
- import{c as L,m as te,K as U,j as a,r as M,l as ne}from"./index-tHbNbVHJ.js";import{i as oe,p as z,ae as se,af as re,ag as ie,j as le,ah as ce,ab as ae}from"./index-CkflryUu.js";import{L as Y}from"./label-Bg0TZhOq.js";import{S as $}from"./switch-CuKs1fR0.js";import{a as ue,b as fe,c as pe,S as de,d as ye}from"./select-Ufh1328y.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function F(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function je(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function Ee(t,e){for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(F(i)){const c=i;if(je(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function Ze(t,e,n){if(e.kind==="site"){const l=Ee(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!F(o))return null;const s=o,r=s.seo,i=w(r),c=i&&F(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function qe(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function He(t){const e=L.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=j=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,j)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=j=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:j}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=L.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Le=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Fe=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Le;case"plp":return Fe;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=L.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const E={...o};if(T)delete E[u];else{const D=r?.[u];E[u]=D??(u==="type"?"website":"")}s(E)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const j=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const E=p&&d.includes(u),D=E&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),E&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>j(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=L.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=L.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Je(t){const e=L.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const E=me(s);p(E),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const E=Se(T,n);p(E)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let j;e[8]!==h||e[9]!==f?(j=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=j):j=e[10];const P=j;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Je as P,Ie as S,qe as a,Ce as b,He as c,Z as d,Ee as f,k as i,Ze as r,w as u};
1
+ import{c as L,m as te,K as U,j as a,r as M,l as ne}from"./index-DJ-0yJzO.js";import{i as oe,p as z,ae as se,af as re,ag as ie,j as le,ah as ce,ab as ae}from"./index-Bl1rlkAc.js";import{L as Y}from"./label-dfUb2uoI.js";import{S as $}from"./switch-COQDKJ_b.js";import{a as ue,b as fe,c as pe,S as de,d as ye}from"./select-P94u0CJo.js";const he="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function G(t,e){return t===null?null:N(e)?{...e,section:t}:t}function me(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:he,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=z(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=z(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function F(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function je(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function Ee(t,e){for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(F(i)){const c=i;if(je(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function Ze(t,e,n){if(e.kind==="site"){const l=Ee(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!F(o))return null;const s=o,r=s.seo,i=w(r),c=i&&F(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:G(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:G(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function qe(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function He(t){const e=L.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:h}=le(y,p);let m;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(m=j=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,j)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=m):m=e[11];const g=m;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=j=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:j}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==h||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:h},e[18]=S,e[19]=h,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=L.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Le=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Fe=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Le;case"plp":return Fe;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=L.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=M.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=M.useState(h);f!==i&&(S(i),g({}));let v;e[3]!==m||e[4]!==o?(v=u=>m[u]!==void 0?m[u]:Ae(o,u),e[3]=m,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const E={...o};if(T)delete E[u];else{const D=r?.[u];E[u]=D??(u==="type"?"website":"")}s(E)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const j=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const E=p&&d.includes(u),D=E&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),E&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>j(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=L.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let m;e[0]!==i?(m=v=>i(v),e[0]=i,e[1]=m):m=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:m,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=m,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let h;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(h=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=h):h=e[17],h}function Ye(){}function Ve(t){const e=L.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Je(t){const e=L.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:h,beforeFields:m}=t;let g;e[0]!==s||e[1]!==h||e[2]!==S||e[3]!==p?(g=T=>{if(T){const E=me(s);p(E),S(),h();return}p(null),S(),h()},e[0]=s,e[1]=h,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const E=Se(T,n);p(E)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let j;e[8]!==h||e[9]!==f?(j=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=j):j=e[10];const P=j;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==m||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[m,b,_]}),e[26]=m,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Je as P,Ie as S,qe as a,Ce as b,He as c,Z as d,Ee as f,k as i,Ze as r,w as u};
@@ -0,0 +1 @@
1
+ import{c as it,r as E,j as e,i as rt}from"./index-DJ-0yJzO.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-DBbd3xZ9.js";import{S as nt}from"./scroll-area-C1pOloFJ.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-DpOET_p-.js";import{p as xt}from"./index-Bl1rlkAc.js";import"./X-BXn2_vYM.js";import"./agent-icon-DQ2UQuHh.js";import"./AlertCircle-CB5KvLwP.js";import"./Tool01-BBDLAsiN.js";import"./SwitchHorizontal01-dtUU9yY1.js";import"./Settings02-BsAGDeee.js";import"./XCircle-mXjRT0sF.js";import"./ArrowUpRight-CGiD8vy5.js";import"./ZapSquare-DrbsMYOt.js";import"./Users03-Dlm3r0r-.js";import"./CheckCircle-BBV9CFFT.js";import"./ChevronUp-CSnIUHk6.js";import"./ChevronDown-BJhXIK-P.js";import"./ChevronLeft-B1FMEVNc.js";import"./ChevronRight-Cxkz20f7.js";import"./DotsVertical-D_Mc-7IQ.js";import"./Stars02-D1hTo9kS.js";import"./Eye-v7KW9L98.js";import"./ZoomOut-DwwAa3X7.js";import"./Globe01-J206FB3X.js";import"./FilterLines-BFU-HGPB.js";import"./Star01-BG3nvXkE.js";import"./Globe04-BVemAfGE.js";import"./HardDrive-CWgzi9wO.js";import"./Key01-BD-IJNJQ.js";import"./LayoutLeft-CB8DIaei.js";import"./LinkExternal01-B2EDdnZx.js";import"./Monitor01-JBmV730I.js";import"./Sun-BHlOvrTC.js";import"./Palette-wlYD__vW.js";import"./Play-DUpdkISP.js";import"./Plus-CSb3V8S8.js";import"./SearchLg-B9kqdzVX.js";import"./SearchMd-DhW8248m.js";import"./Shield01-DU8KFrFU.js";import"./Stars01-BleMq6lh.js";import"./Trash01-DEQkTUig.js";import"./Upload01-aTx0MT4i.js";import"./User01-y8ntusMn.js";import"./Users01-B-8sWltw.js";import"./XClose-BDAWssyq.js";import"./Zap-eZQ7TcmD.js";import"./use-clock-tick-CasxGSyY.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CwggxRep.js";import"./tooltip-4wDbnU57.js";import"./file-type-icon-C5be6uul.js";import"./dialog-BxQnVy3N.js";import"./use-mobile-LV4GsbgX.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CYxZXBM0.js";import"./use-mcp-client-fiFo9WZN.js";import"./auth-EMMal3Dz.js";import"./chat-context-B-cXtnc6.js";import"./hooks-BW_au6w-.js";import"./decopilot-sse-pool-DPxuN-3_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-sFB9DBP0.js";import"./use-collections-BpN1mXwR.js";import"./use-ai-providers-DRi0TGR5.js";import"./studio-tools-Cdx_UHKK.js";import"./use-organization-settings-BQsTdhD3.js";import"./shell-layout-C7ri93NQ.js";import"./avatar-CCs3cbGI.js";import"./required-auth-layout-Dto8wlZl.js";import"./use-org-sso-axj6nKtT.js";import"./integration-icon-CRPoStYp.js";import"./use-navigate-to-agent-BMSd7x3f.js";import"./use-connection-BqxUv0Rd.js";import"./use-mcp-prompts-Cc4XqYJp.js";import"./form-CIlG55_C.js";import"./label-dfUb2uoI.js";import"./input-C2eR67CX.js";import"./select-P94u0CJo.js";import"./switch-COQDKJ_b.js";import"./index-Cj1plGam.js";import"./drawer-Cnet3QMz.js";import"./collection-search-Bw8ErL9A.js";import"./tabs-DDSzGN2J.js";import"./toggle-group-BO6v5tfG.js";import"./sortable.esm-CuMhTk6a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CFNuDsq8.js";import"./use-registry-connections-Do_Rvk9e.js";import"./useInfiniteQuery-DpyG04IT.js";import"./use-infinite-scroll-PHACyDPD.js";import"./extract-connection-data-Bosa8zHT.js";import"./card-KfNIoaPf.js";import"./collection-tabs-CDQNfYku.js";import"./badge-B-Bz5at5.js";import"./textarea-3Q-WOeg_.js";import"./connection-form-helpers-DO3e40s1.js";import"./authenticate-and-persist-oauth-cWdyk-4l.js";import"./mcp-oauth-DHLZTN3O.js";import"./useSuspenseInfiniteQuery-C19LNIx7.js";import"./connect-desktop-dialog-CG0vg5V1.js";import"./decopilot-YCL8e-nf.js";import"./checkbox-L9WnatCJ.js";import"./skeleton-Dkde-wB2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BOi1IsyE.js";import"./popover-NZJWCLt1.js";import"./command-DM9QRA4h.js";import"./index-DSFMxO70.js";import"./dropdown-menu-C0QC0e-U.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D3_nXyIH.js";import"./empty-state-B6QyYsPZ.js";import"./toolbar-CWj6rOG7.js";import"./preview-dialog-C4yQrBab.js";import"./index-DH054m17.js";import"./use-mcp-tools-DZ2dmLN4.js";import"./use-capability-BsG-lChE.js";import"./shell-route-loading-tzhgNES0.js";import"./index-3RYygtpZ.js";import"./alert-dialog-DqsunxqN.js";import"./use-debounced-autosave-CtylY127.js";import"./index-hIyA29hR.js";import"./sidebar-V0fgYf5d.js";import"./search-input-Dv1TseVx.js";import"./github-repo-picker-ClZplb89.js";import"./use-debounced-value-BRThlWXN.js";import"./use-secrets-BIiRA5fw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CUNdRghN.js";import"./automation-runs-GIeVqtWs.js";import"./table-BV4PwUfw.js";import"./use-members-CaBsWevB.js";import"./use-org-auth-client-VEUd0F6I.js";import"./task-status-DRFd52Gi.js";import"./use-automations-BooH66Yd.js";import"./use-file-configs-Dw3oHwr6.js";import"./monaco-editor-C1v3GK4B.js";import"./select-model-BUU-K3y0.js";import"./automation-list-row-DcfWPhsa.js";function ii(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ii as SeoSheet};
@@ -1 +1 @@
1
- import{r as i,a3 as $,j as c,a4 as z,ak as L,_ as O,V as _,W as g,U as j,Z as w,a2 as G,X as E,dz as H,dA as K,Y as U,dB as V,dC as W,dD as Z,$ as B,a0 as X,a1 as Y,c as R,l as q}from"./index-tHbNbVHJ.js";var C="Popover",[b]=U(C,[E]),P=E(),[J,u]=b(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(z,{...p,children:c.jsx(J,{scope:e,contentId:L(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(j,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=O(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(j,{asChild:!0,...s,children:p})});y.displayName=S;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(B,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(X,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(Y,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
1
+ import{r as i,a3 as $,j as c,a4 as z,ak as L,_ as O,V as _,W as g,U as j,Z as w,a2 as G,X as E,dz as H,dA as K,Y as U,dB as V,dC as W,dD as Z,$ as B,a0 as X,a1 as Y,c as R,l as q}from"./index-DJ-0yJzO.js";var C="Popover",[b]=U(C,[E]),P=E(),[J,u]=b(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(z,{...p,children:c.jsx(J,{scope:e,contentId:L(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(j,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=O(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(j,{asChild:!0,...s,children:p})});y.displayName=S;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(B,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(X,{"data-state":I(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(Y,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
@@ -0,0 +1 @@
1
+ import{c as H,j as t,B as Z}from"./index-DJ-0yJzO.js";import{n as ee}from"./LinkExternal01-B2EDdnZx.js";import{aB as te,a0 as oe}from"./agent-icon-DQ2UQuHh.js";import{I as J}from"./input-C2eR67CX.js";import{L as G}from"./label-dfUb2uoI.js";import{M as ie}from"./automation-runs-GIeVqtWs.js";import{T as Q,a as se,b as W,c as le}from"./tabs-DDSzGN2J.js";import{T as re}from"./textarea-3Q-WOeg_.js";import{at as ae,au as me,as as pe,av as ne,aw as ce,ax as de,ay as fe}from"./index-Bl1rlkAc.js";import{b as ue,a as xe,B as he}from"./block-document-BkT_K3Fj.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-_v-rLEEl.js";import"./AlertCircle-CB5KvLwP.js";import"./Tool01-BBDLAsiN.js";import"./SwitchHorizontal01-dtUU9yY1.js";import"./Settings02-BsAGDeee.js";import"./XCircle-mXjRT0sF.js";import"./ArrowUpRight-CGiD8vy5.js";import"./ZapSquare-DrbsMYOt.js";import"./Users03-Dlm3r0r-.js";import"./CheckCircle-BBV9CFFT.js";import"./ChevronUp-CSnIUHk6.js";import"./ChevronDown-BJhXIK-P.js";import"./ChevronLeft-B1FMEVNc.js";import"./ChevronRight-Cxkz20f7.js";import"./DotsVertical-D_Mc-7IQ.js";import"./Stars02-D1hTo9kS.js";import"./Eye-v7KW9L98.js";import"./ZoomOut-DwwAa3X7.js";import"./Globe01-J206FB3X.js";import"./FilterLines-BFU-HGPB.js";import"./Star01-BG3nvXkE.js";import"./Globe04-BVemAfGE.js";import"./HardDrive-CWgzi9wO.js";import"./Key01-BD-IJNJQ.js";import"./LayoutLeft-CB8DIaei.js";import"./Monitor01-JBmV730I.js";import"./Sun-BHlOvrTC.js";import"./Palette-wlYD__vW.js";import"./Play-DUpdkISP.js";import"./Plus-CSb3V8S8.js";import"./SearchLg-B9kqdzVX.js";import"./SearchMd-DhW8248m.js";import"./Shield01-DU8KFrFU.js";import"./Stars01-BleMq6lh.js";import"./Trash01-DEQkTUig.js";import"./Upload01-aTx0MT4i.js";import"./User01-y8ntusMn.js";import"./Users01-B-8sWltw.js";import"./XClose-BDAWssyq.js";import"./X-BXn2_vYM.js";import"./Zap-eZQ7TcmD.js";import"./useInfiniteQuery-DpyG04IT.js";import"./use-infinite-scroll-PHACyDPD.js";import"./use-connection-BqxUv0Rd.js";import"./use-collections-BpN1mXwR.js";import"./use-mcp-client-fiFo9WZN.js";import"./auth-EMMal3Dz.js";import"./use-virtual-mcp-sFB9DBP0.js";import"./card-KfNIoaPf.js";import"./sheet-DBbd3xZ9.js";import"./table-BV4PwUfw.js";import"./empty-state-B6QyYsPZ.js";import"./use-members-CaBsWevB.js";import"./use-org-auth-client-VEUd0F6I.js";import"./task-status-DRFd52Gi.js";import"./use-automations-BooH66Yd.js";import"./studio-tools-Cdx_UHKK.js";import"./useSuspenseInfiniteQuery-C19LNIx7.js";import"./badge-B-Bz5at5.js";import"./select-P94u0CJo.js";import"./tooltip-4wDbnU57.js";import"./checkbox-L9WnatCJ.js";import"./command-DM9QRA4h.js";import"./index-DSFMxO70.js";import"./dialog-BxQnVy3N.js";import"./popover-NZJWCLt1.js";import"./avatar-CCs3cbGI.js";import"./scroll-area-C1pOloFJ.js";import"./use-clock-tick-CasxGSyY.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CwggxRep.js";import"./file-type-icon-C5be6uul.js";import"./use-mobile-LV4GsbgX.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CYxZXBM0.js";import"./chat-context-B-cXtnc6.js";import"./hooks-BW_au6w-.js";import"./decopilot-sse-pool-DPxuN-3_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DRi0TGR5.js";import"./use-organization-settings-BQsTdhD3.js";import"./shell-layout-C7ri93NQ.js";import"./required-auth-layout-Dto8wlZl.js";import"./use-org-sso-axj6nKtT.js";import"./integration-icon-CRPoStYp.js";import"./use-navigate-to-agent-BMSd7x3f.js";import"./use-mcp-prompts-Cc4XqYJp.js";import"./form-CIlG55_C.js";import"./index-Cj1plGam.js";import"./drawer-Cnet3QMz.js";import"./collection-search-Bw8ErL9A.js";import"./toggle-group-BO6v5tfG.js";import"./sortable.esm-CuMhTk6a.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CFNuDsq8.js";import"./use-registry-connections-Do_Rvk9e.js";import"./extract-connection-data-Bosa8zHT.js";import"./collection-tabs-CDQNfYku.js";import"./connection-form-helpers-DO3e40s1.js";import"./authenticate-and-persist-oauth-cWdyk-4l.js";import"./mcp-oauth-DHLZTN3O.js";import"./connect-desktop-dialog-CG0vg5V1.js";import"./decopilot-YCL8e-nf.js";import"./skeleton-Dkde-wB2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BOi1IsyE.js";import"./dropdown-menu-C0QC0e-U.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D3_nXyIH.js";import"./toolbar-CWj6rOG7.js";import"./preview-dialog-C4yQrBab.js";import"./index-DH054m17.js";import"./use-mcp-tools-DZ2dmLN4.js";import"./use-capability-BsG-lChE.js";import"./shell-route-loading-tzhgNES0.js";import"./index-3RYygtpZ.js";import"./alert-dialog-DqsunxqN.js";import"./switch-COQDKJ_b.js";import"./use-debounced-autosave-CtylY127.js";import"./index-hIyA29hR.js";import"./sidebar-V0fgYf5d.js";import"./search-input-Dv1TseVx.js";import"./github-repo-picker-ClZplb89.js";import"./use-debounced-value-BRThlWXN.js";import"./use-secrets-BIiRA5fw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CUNdRghN.js";import"./use-file-configs-Dw3oHwr6.js";import"./monaco-editor-C1v3GK4B.js";import"./select-model-BUU-K3y0.js";import"./automation-list-row-DcfWPhsa.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function ri(A){const e=H.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:l,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ge(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Y)=>_({...r,[T]:Y}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==r||e[14]!==x?(S=ue({decofile:m,post:r,previewBaseUrl:x}),e[12]=m,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let U;e[40]!==L||e[41]!==R?(U=t.jsx(ve,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=U):U=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=O):O=e[43];let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(se,{children:[O,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=K):K=e[44];let $;e[45]!==r.sections?($=xe(r.sections),e[45]=r.sections,e[46]=$):$=e[46];let I;e[47]!==h?(I=T=>h("sections",T),e[47]=h,e[48]=I):I=e[48];let M;e[49]!==u||e[50]!==$||e[51]!==I?(M=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:$,onChange:I,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=$,e[51]=I,e[52]=M):M=e[52];let D;e[53]!==m||e[54]!==r||e[55]!==h?(D=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:r,decofile:m,onChange:h})})}),e[53]=m,e[54]=r,e[55]=h,e[56]=D):D=e[56];let V;e[57]!==M||e[58]!==D?(V=t.jsxs(le,{defaultValue:"content",className:"mt-6 gap-4",children:[K,M,D]}),e[57]=M,e[58]=D,e[59]=V):V=e[59];let z;e[60]!==U||e[61]!==V?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[U,V]})}),e[60]=U,e[61]=V,e[62]=z):z=e[62];let q;return e[63]!==v||e[64]!==z?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[v,z]}),e[63]=v,e[64]=z,e[65]=q):q=e[65],q}function Ce(A){const e=H.c(59),{post:i,decofile:d,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(re,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=H.c(15),{value:i,onChange:d}=A;let o,l,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(G,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=l,e[4]=p,e[5]=m}else o=e[2],l=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:l,children:[p,m,u]}),e[10]=l,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:d,kind:o,valueField:l,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==l){x=de(d,o);let f;e[6]!==l?(f=(c,g)=>F(c[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==l){const f=Array.isArray(m)?m:[];let a;e[13]!==l?(a=c=>F(c[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[l]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(G,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{ri as PostEditor};
@@ -0,0 +1,5 @@
1
+ import{r as x,aM as cn,c as A,l as ve,j as c,D as ne,m as st,d as Ie,K as Y,k as ge,b1 as Pt,J as un,i as dn,B as ee,ae as fn,t as Re,ag as pn,G as hn,e as mn}from"./index-DJ-0yJzO.js";import{d as gn,i as xn,g as yn,c as wn,e as bn,b as vn,h as Sn}from"./ZoomOut-DwwAa3X7.js";import{c as zn,d as Ze,b as Ct,a as $t}from"./dialog-BxQnVy3N.js";import{T as ue,a as de,b as fe}from"./tooltip-4wDbnU57.js";import{n as Te,i as Et}from"./Globe01-J206FB3X.js";import{n as Nt}from"./LinkExternal01-B2EDdnZx.js";import{s as jn}from"./XClose-BDAWssyq.js";import{S as _e}from"./skeleton-Dkde-wB2.js";import{l as kn,F as Pn}from"./index-DH054m17.js";import{F as et,M as Cn}from"./file-type-icon-C5be6uul.js";import{D as $n,a as En,b as Nn,c as dt}from"./dropdown-menu-C0QC0e-U.js";import{i as In}from"./LayoutLeft-CB8DIaei.js";import{I as Rn}from"./input-C2eR67CX.js";import{a as Mn,P as Dn,b as Ln}from"./popover-NZJWCLt1.js";import{i as _n}from"./ChevronUp-CSnIUHk6.js";import{a as An}from"./Eye-v7KW9L98.js";import{i as Fn}from"./Key01-BD-IJNJQ.js";const We=x.createContext(null);We.displayName="PanelGroupContext";const V={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},rt=10,we=x.useLayoutEffect,ft=cn.useId,Tn=typeof ft=="function"?ft:()=>null;let Un=0;function it(n=null){const e=Tn(),t=x.useRef(n||e||null);return t.current===null&&(t.current=""+Un++),n??t.current}function It({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:o,maxSize:l,minSize:a,onCollapse:u,onExpand:p,onResize:d,order:f,style:g,tagName:m="div",...z}){const b=x.useContext(We);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:P,getPanelSize:R,getPanelStyle:k,groupId:W,isPanelCollapsed:N,reevaluatePanelConstraints:w,registerPanel:K,resizePanel:B,unregisterPanel:H}=b,F=it(o),D=x.useRef({callbacks:{onCollapse:u,onExpand:p,onResize:d},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:l,minSize:a},id:F,idIsFromProps:o!==void 0,order:f});x.useRef({didLogMissingDefaultSizeWarning:!1}),we(()=>{const{callbacks:_,constraints:L}=D.current,T={...L};D.current.id=F,D.current.idIsFromProps=o!==void 0,D.current.order=f,_.onCollapse=u,_.onExpand=p,_.onResize=d,L.collapsedSize=t,L.collapsible=s,L.defaultSize=r,L.maxSize=l,L.minSize=a,(T.collapsedSize!==L.collapsedSize||T.collapsible!==L.collapsible||T.maxSize!==L.maxSize||T.minSize!==L.minSize)&&w(D.current,T)}),we(()=>{const _=D.current;return K(_),()=>{H(_)}},[f,F,K,H]),x.useImperativeHandle(i,()=>({collapse:()=>{y(D.current)},expand:_=>{P(D.current,_)},getId(){return F},getSize(){return R(D.current)},isCollapsed(){return N(D.current)},isExpanded(){return!N(D.current)},resize:_=>{B(D.current,_)}}),[y,P,R,N,F,B]);const X=k(D.current,r);return x.createElement(m,{...z,children:n,className:e,id:F,style:{...X,...g},[V.groupId]:W,[V.panel]:"",[V.panelCollapsible]:s||void 0,[V.panelId]:F,[V.panelSize]:parseFloat(""+X.flexGrow).toFixed(1)})}const Rt=x.forwardRef((n,e)=>x.createElement(It,{...n,forwardedRef:e}));It.displayName="Panel";Rt.displayName="forwardRef(Panel)";let tt=null,Fe=-1,me=null;function Hn(n,e){if(e){const t=(e&At)!==0,s=(e&Ft)!==0,r=(e&Tt)!==0,i=(e&Ut)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function On(){me!==null&&(document.head.removeChild(me),tt=null,me=null,Fe=-1)}function Ve(n,e){var t,s;const r=Hn(n,e);if(tt!==r){if(tt=r,me===null&&(me=document.createElement("style"),document.head.appendChild(me)),Fe>=0){var i;(i=me.sheet)===null||i===void 0||i.removeRule(Fe)}Fe=(t=(s=me.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Mt(n){return n.type==="keydown"}function Dt(n){return n.type.startsWith("pointer")}function Lt(n){return n.type.startsWith("mouse")}function Be(n){if(Dt(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Lt(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Wn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Bn(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function qn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:mt(n),b:mt(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;E(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:ht(pt(t.a)),b:ht(pt(t.b))};if(r.a===r.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let l=i.length;for(;l--;){const a=i[l];if(a===o.a)return 1;if(a===o.b)return-1}}return Math.sign(r.a-r.b)}const Kn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Gn(n){var e;const t=getComputedStyle((e=_t(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Vn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Gn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Kn.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function pt(n){let e=n.length;for(;e--;){const t=n[e];if(E(t,"Missing node"),Vn(t))return t}return null}function ht(n){return n&&Number(getComputedStyle(n).zIndex)||0}function mt(n){const e=[];for(;n;)e.push(n),n=_t(n);return e}function _t(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const At=1,Ft=2,Tt=4,Ut=8,Xn=Wn()==="coarse";let ie=[],Pe=!1,ye=new Map,qe=new Map;const Me=new Set;function Qn(n,e,t,s,r){var i;const{ownerDocument:o}=e,l={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},a=(i=ye.get(o))!==null&&i!==void 0?i:0;return ye.set(o,a+1),Me.add(l),Ue(),function(){var p;qe.delete(n),Me.delete(l);const d=(p=ye.get(o))!==null&&p!==void 0?p:1;if(ye.set(o,d-1),Ue(),d===1&&ye.delete(o),ie.includes(l)){const f=ie.indexOf(l);f>=0&&ie.splice(f,1),lt(),r("up",!0,null)}}}function Jn(n){const{target:e}=n,{x:t,y:s}=Be(n);Pe=!0,ot({target:e,x:t,y:s}),Ue(),ie.length>0&&(He("down",n),n.preventDefault(),Ht(e)||n.stopImmediatePropagation())}function Xe(n){const{x:e,y:t}=Be(n);if(Pe&&n.buttons===0&&(Pe=!1,He("up",n)),!Pe){const{target:s}=n;ot({target:s,x:e,y:t})}He("move",n),lt(),ie.length>0&&n.preventDefault()}function Qe(n){const{target:e}=n,{x:t,y:s}=Be(n);qe.clear(),Pe=!1,ie.length>0&&(n.preventDefault(),Ht(e)||n.stopImmediatePropagation()),He("up",n),ot({target:e,x:t,y:s}),lt(),Ue()}function Ht(n){let e=n;for(;e;){if(e.hasAttribute(V.resizeHandle))return!0;e=e.parentElement}return!1}function ot({target:n,x:e,y:t}){ie.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Me.forEach(r=>{const{element:i,hitAreaMargins:o}=r,l=i.getBoundingClientRect(),{bottom:a,left:u,right:p,top:d}=l,f=Xn?o.coarse:o.fine;if(e>=u-f&&e<=p+f&&t>=d-f&&t<=a+f){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&qn(s,i)>0){let m=s,z=!1;for(;m&&!m.contains(i);){if(Bn(m.getBoundingClientRect(),l)){z=!0;break}m=m.parentElement}if(z)return}ie.push(r)}})}function Je(n,e){qe.set(n,e)}function lt(){let n=!1,e=!1;ie.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;qe.forEach(s=>{t|=s}),n&&e?Ve("intersection",t):n?Ve("horizontal",t):e?Ve("vertical",t):On()}let Ye=new AbortController;function Ue(){Ye.abort(),Ye=new AbortController;const n={capture:!0,signal:Ye.signal};Me.size&&(Pe?(ie.length>0&&ye.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",Qe,n),s.addEventListener("pointerleave",Xe,n),s.addEventListener("pointermove",Xe,n))}),window.addEventListener("pointerup",Qe,n),window.addEventListener("pointercancel",Qe,n)):ye.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Jn,n),s.addEventListener("pointermove",Xe,n))}))}function He(n,e){Me.forEach(t=>{const{setResizeHandlerState:s}=t,r=ie.includes(t);s(n,r,e)})}function Yn(){const[n,e]=x.useState(0);return x.useCallback(()=>e(t=>t+1),[])}function E(n,e){if(!n)throw console.error(e),Error(e)}function be(n,e,t=rt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function pe(n,e,t=rt){return be(n,e,t)===0}function te(n,e,t){return be(n,e,t)===0}function Zn(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!te(r,i,t))return!1}return!0}function ke({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];E(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:l=0}=s;if(be(t,l)<0)if(i){const a=(r+l)/2;be(t,a)<0?t=r:t=l}else t=l;return t=Math.min(o,t),t=parseFloat(t.toFixed(rt)),t}function Ee({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(te(n,0))return e;const o=[...e],[l,a]=s;E(l!=null,"Invalid first pivot index"),E(a!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const d=n<0?a:l,f=t[d];E(f,`Panel constraints not found for index ${d}`);const{collapsedSize:g=0,collapsible:m,minSize:z=0}=f;if(m){const b=e[d];if(E(b!=null,`Previous layout not found for panel index ${d}`),te(b,g)){const y=z-b;be(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}{const d=n<0?l:a,f=t[d];E(f,`No panel constraints found for index ${d}`);const{collapsedSize:g=0,collapsible:m,minSize:z=0}=f;if(m){const b=e[d];if(E(b!=null,`Previous layout not found for panel index ${d}`),te(b,z)){const y=b-g;be(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}}{const d=n<0?1:-1;let f=n<0?a:l,g=0;for(;;){const z=e[f];E(z!=null,`Previous layout not found for panel index ${f}`);const y=ke({panelConstraints:t,panelIndex:f,size:100})-z;if(g+=y,f+=d,f<0||f>=t.length)break}const m=Math.min(Math.abs(n),Math.abs(g));n=n<0?0-m:m}{let f=n<0?l:a;for(;f>=0&&f<t.length;){const g=Math.abs(n)-Math.abs(u),m=e[f];E(m!=null,`Previous layout not found for panel index ${f}`);const z=m-g,b=ke({panelConstraints:t,panelIndex:f,size:z});if(!te(m,b)&&(u+=m-b,o[f]=b,u.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?f--:f++}}if(Zn(r,o))return r;{const d=n<0?a:l,f=e[d];E(f!=null,`Previous layout not found for panel index ${d}`);const g=f+u,m=ke({panelConstraints:t,panelIndex:d,size:g});if(o[d]=m,!te(m,g)){let z=g-m,y=n<0?a:l;for(;y>=0&&y<t.length;){const P=o[y];E(P!=null,`Previous layout not found for panel index ${y}`);const R=P+z,k=ke({panelConstraints:t,panelIndex:y,size:R});if(te(P,k)||(z-=k-P,o[y]=k),te(z,0))break;n>0?y--:y++}}}const p=o.reduce((d,f)=>f+d,0);return te(p,100)?o:r}function es({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,o=0;const l=t[0];E(l!=null,"No pivot index found"),e.forEach((d,f)=>{const{constraints:g}=d,{maxSize:m=100,minSize:z=0}=g;f===l?(s=z,r=m):(i+=z,o+=m)});const a=Math.min(r,100-i),u=Math.max(s,100-o),p=n[l];return{valueMax:a,valueMin:u,valueNow:p}}function De(n,e=document){return Array.from(e.querySelectorAll(`[${V.resizeHandleId}][data-panel-group-id="${n}"]`))}function Ot(n,e,t=document){const r=De(n,t).findIndex(i=>i.getAttribute(V.resizeHandleId)===e);return r??null}function Wt(n,e,t){const s=Ot(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Bt(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Ke(n,e=document){const t=e.querySelector(`[${V.resizeHandleId}="${n}"]`);return t||null}function ts(n,e,t,s=document){var r,i,o,l;const a=Ke(e,s),u=De(n,s),p=a?u.indexOf(a):-1,d=(r=(i=t[p])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(l=t[p+1])===null||l===void 0?void 0:l.id)!==null&&o!==void 0?o:null;return[d,f]}function ns({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:o}){x.useRef({didWarnAboutMissingResizeHandle:!1}),we(()=>{if(!i)return;const l=De(t,i);for(let a=0;a<r.length-1;a++){const{valueMax:u,valueMin:p,valueNow:d}=es({layout:s,panelsArray:r,pivotIndices:[a,a+1]}),f=l[a];if(f!=null){const g=r[a];E(g,`No panel data found for index "${a}"`),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(u)),f.setAttribute("aria-valuemin",""+Math.round(p)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{l.forEach((a,u)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,s,r,i]),x.useEffect(()=>{if(!i)return;const l=e.current;E(l,"Eager values not found");const{panelDataArray:a}=l,u=Bt(t,i);E(u!=null,`No group found for id "${t}"`);const p=De(t,i);E(p,`No resize handles found for group id "${t}"`);const d=p.map(f=>{const g=f.getAttribute(V.resizeHandleId);E(g,"Resize handle element has no handle id attribute");const[m,z]=ts(t,g,a,i);if(m==null||z==null)return()=>{};const b=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const P=a.findIndex(R=>R.id===m);if(P>=0){const R=a[P];E(R,`No panel data found for index ${P}`);const k=s[P],{collapsedSize:W=0,collapsible:N,minSize:w=0}=R.constraints;if(k!=null&&N){const K=Ee({delta:te(k,W)?w-W:W-k,initialLayout:s,panelConstraints:a.map(B=>B.constraints),pivotIndices:Wt(t,g,i),prevLayout:s,trigger:"keyboard"});s!==K&&o(K)}}break}}};return f.addEventListener("keydown",b),()=>{f.removeEventListener("keydown",b)}});return()=>{d.forEach(f=>f())}},[i,n,e,t,s,r,o])}function gt(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function qt(n,e){const t=n==="horizontal",{x:s,y:r}=Be(e);return t?s:r}function ss(n,e,t,s,r){const i=t==="horizontal",o=Ke(e,r);E(o,`No resize handle element found for id "${e}"`);const l=o.getAttribute(V.groupId);E(l,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=s;const u=qt(t,n),p=Bt(l,r);E(p,`No group element found for id "${l}"`);const d=p.getBoundingClientRect(),f=i?d.width:d.height;return(u-a)/f*100}function rs(n,e,t,s,r,i){if(Mt(n)){const o=t==="horizontal";let l=0;n.shiftKey?l=100:r!=null?l=r:l=10;let a=0;switch(n.key){case"ArrowDown":a=o?0:l;break;case"ArrowLeft":a=o?-l:0;break;case"ArrowRight":a=o?l:0;break;case"ArrowUp":a=o?0:-l;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return s==null?0:ss(n,e,t,s,i)}function is({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const o=t[i];E(o,`Panel constraints not found for index ${i}`);const{defaultSize:l}=o;l!=null&&(s++,e[i]=l,r-=l)}for(let i=0;i<n.length;i++){const o=t[i];E(o,`Panel constraints not found for index ${i}`);const{defaultSize:l}=o;if(l!=null)continue;const a=n.length-s,u=r/a;s++,e[i]=u,r-=u}return e}function Se(n,e,t){e.forEach((s,r)=>{const i=n[r];E(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:l,id:a}=i,{collapsedSize:u=0,collapsible:p}=l,d=t[a];if(d==null||s!==d){t[a]=s;const{onCollapse:f,onExpand:g,onResize:m}=o;m&&m(s,d),p&&(f||g)&&(g&&(d==null||pe(d,u))&&!pe(s,u)&&g(),f&&(d==null||!pe(d,u))&&pe(s,u)&&f())}})}function Ae(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function os({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const o=t[r];let l;return o==null?l=n!=null?n.toPrecision(i):"1":s.length===1?l="1":l=o.toPrecision(i),{flexBasis:0,flexGrow:l,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function ls(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function xt(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function Kt(n){return`react-resizable-panels:${n}`}function Gt(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function Vt(n,e){try{const t=Kt(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function as(n,e,t){var s,r;const i=(s=Vt(n,t))!==null&&s!==void 0?s:{},o=Gt(e);return(r=i[o])!==null&&r!==void 0?r:null}function cs(n,e,t,s,r){var i;const o=Kt(n),l=Gt(e),a=(i=Vt(n,r))!==null&&i!==void 0?i:{};a[l]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(o,JSON.stringify(a))}catch(u){console.error(u)}}function yt({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,o)=>i+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!te(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=100/s*o;t[i]=l}let r=0;for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=ke({panelConstraints:e,panelIndex:i,size:o});o!=l&&(r+=o-l,t[i]=l)}if(!te(r,0))for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=o+r,a=ke({panelConstraints:e,panelIndex:i,size:l});if(o!==a&&(r-=a-o,t[i]=a,te(r,0)))break}return t}const us=100,Ne={getItem:n=>(xt(Ne),Ne.getItem(n)),setItem:(n,e)=>{xt(Ne),Ne.setItem(n,e)}},wt={};function Xt({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:l=null,storage:a=Ne,style:u,tagName:p="div",...d}){const f=it(i),g=x.useRef(null),[m,z]=x.useState(null),[b,y]=x.useState([]),P=Yn(),R=x.useRef({}),k=x.useRef(new Map),W=x.useRef(0),N=x.useRef({autoSaveId:n,direction:s,dragState:m,id:f,keyboardResizeBy:l,onLayout:o,storage:a}),w=x.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});x.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),x.useImperativeHandle(r,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:h}=w.current;return h},setLayout:h=>{const{onLayout:j}=N.current,{layout:I,panelDataArray:C}=w.current,v=yt({layout:h,panelConstraints:C.map($=>$.constraints)});gt(I,v)||(y(v),w.current.layout=v,j&&j(v),Se(C,v,R.current))}}),[]),we(()=>{N.current.autoSaveId=n,N.current.direction=s,N.current.dragState=m,N.current.id=f,N.current.onLayout=o,N.current.storage=a}),ns({committedValuesRef:N,eagerValuesRef:w,groupId:f,layout:b,panelDataArray:w.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),x.useEffect(()=>{const{panelDataArray:h}=w.current;if(n){if(b.length===0||b.length!==h.length)return;let j=wt[n];j==null&&(j=ls(cs,us),wt[n]=j);const I=[...h],C=new Map(k.current);j(n,I,C,b,a)}},[n,b,a]),x.useEffect(()=>{});const K=x.useCallback(h=>{const{onLayout:j}=N.current,{layout:I,panelDataArray:C}=w.current;if(h.constraints.collapsible){const v=C.map(le=>le.constraints),{collapsedSize:$=0,panelSize:O,pivotIndices:Q}=xe(C,h,I);if(E(O!=null,`Panel size not found for panel "${h.id}"`),!pe(O,$)){k.current.set(h.id,O);const ae=ze(C,h)===C.length-1?O-$:$-O,G=Ee({delta:ae,initialLayout:I,panelConstraints:v,pivotIndices:Q,prevLayout:I,trigger:"imperative-api"});Ae(I,G)||(y(G),w.current.layout=G,j&&j(G),Se(C,G,R.current))}}},[]),B=x.useCallback((h,j)=>{const{onLayout:I}=N.current,{layout:C,panelDataArray:v}=w.current;if(h.constraints.collapsible){const $=v.map(re=>re.constraints),{collapsedSize:O=0,panelSize:Q=0,minSize:le=0,pivotIndices:ae}=xe(v,h,C),G=j??le;if(pe(Q,O)){const re=k.current.get(h.id),Ce=re!=null&&re>=G?re:G,Ge=ze(v,h)===v.length-1?Q-Ce:Ce-Q,Z=Ee({delta:Ge,initialLayout:C,panelConstraints:$,pivotIndices:ae,prevLayout:C,trigger:"imperative-api"});Ae(C,Z)||(y(Z),w.current.layout=Z,I&&I(Z),Se(v,Z,R.current))}}},[]),H=x.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{panelSize:C}=xe(I,h,j);return E(C!=null,`Panel size not found for panel "${h.id}"`),C},[]),F=x.useCallback((h,j)=>{const{panelDataArray:I}=w.current,C=ze(I,h);return os({defaultSize:j,dragState:m,layout:b,panelData:I,panelIndex:C})},[m,b]),D=x.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{collapsedSize:C=0,collapsible:v,panelSize:$}=xe(I,h,j);return E($!=null,`Panel size not found for panel "${h.id}"`),v===!0&&pe($,C)},[]),X=x.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{collapsedSize:C=0,collapsible:v,panelSize:$}=xe(I,h,j);return E($!=null,`Panel size not found for panel "${h.id}"`),!v||be($,C)>0},[]),_=x.useCallback(h=>{const{panelDataArray:j}=w.current;j.push(h),j.sort((I,C)=>{const v=I.order,$=C.order;return v==null&&$==null?0:v==null?-1:$==null?1:v-$}),w.current.panelDataArrayChanged=!0,P()},[P]);we(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:h,onLayout:j,storage:I}=N.current,{layout:C,panelDataArray:v}=w.current;let $=null;if(h){const Q=as(h,v,I);Q&&(k.current=new Map(Object.entries(Q.expandToSizes)),$=Q.layout)}$==null&&($=is({panelDataArray:v}));const O=yt({layout:$,panelConstraints:v.map(Q=>Q.constraints)});gt(C,O)||(y(O),w.current.layout=O,j&&j(O),Se(v,O,R.current))}}),we(()=>{const h=w.current;return()=>{h.layout=[]}},[]);const L=x.useCallback(h=>{let j=!1;const I=g.current;return I&&window.getComputedStyle(I,null).getPropertyValue("direction")==="rtl"&&(j=!0),function(v){v.preventDefault();const $=g.current;if(!$)return()=>null;const{direction:O,dragState:Q,id:le,keyboardResizeBy:ae,onLayout:G}=N.current,{layout:re,panelDataArray:Ce}=w.current,{initialLayout:Le}=Q??{},Ge=Wt(le,h,$);let Z=rs(v,h,O,Q,ae,$);const ct=O==="horizontal";ct&&j&&(Z=-Z);const ln=Ce.map(an=>an.constraints),$e=Ee({delta:Z,initialLayout:Le??re,panelConstraints:ln,pivotIndices:Ge,prevLayout:re,trigger:Mt(v)?"keyboard":"mouse-or-touch"}),ut=!Ae(re,$e);(Dt(v)||Lt(v))&&W.current!=Z&&(W.current=Z,!ut&&Z!==0?ct?Je(h,Z<0?At:Ft):Je(h,Z<0?Tt:Ut):Je(h,0)),ut&&(y($e),w.current.layout=$e,G&&G($e),Se(Ce,$e,R.current))}},[]),T=x.useCallback((h,j)=>{const{onLayout:I}=N.current,{layout:C,panelDataArray:v}=w.current,$=v.map(re=>re.constraints),{panelSize:O,pivotIndices:Q}=xe(v,h,C);E(O!=null,`Panel size not found for panel "${h.id}"`);const ae=ze(v,h)===v.length-1?O-j:j-O,G=Ee({delta:ae,initialLayout:C,panelConstraints:$,pivotIndices:Q,prevLayout:C,trigger:"imperative-api"});Ae(C,G)||(y(G),w.current.layout=G,I&&I(G),Se(v,G,R.current))},[]),U=x.useCallback((h,j)=>{const{layout:I,panelDataArray:C}=w.current,{collapsedSize:v=0,collapsible:$}=j,{collapsedSize:O=0,collapsible:Q,maxSize:le=100,minSize:ae=0}=h.constraints,{panelSize:G}=xe(C,h,I);G!=null&&($&&Q&&pe(G,v)?pe(v,O)||T(h,O):G<ae?T(h,ae):G>le&&T(h,le))},[T]),J=x.useCallback((h,j)=>{const{direction:I}=N.current,{layout:C}=w.current;if(!g.current)return;const v=Ke(h,g.current);E(v,`Drag handle element not found for id "${h}"`);const $=qt(I,j);z({dragHandleId:h,dragHandleRect:v.getBoundingClientRect(),initialCursorPosition:$,initialLayout:C})},[]),se=x.useCallback(()=>{z(null)},[]),q=x.useCallback(h=>{const{panelDataArray:j}=w.current,I=ze(j,h);I>=0&&(j.splice(I,1),delete R.current[h.id],w.current.panelDataArrayChanged=!0,P())},[P]),S=x.useMemo(()=>({collapsePanel:K,direction:s,dragState:m,expandPanel:B,getPanelSize:H,getPanelStyle:F,groupId:f,isPanelCollapsed:D,isPanelExpanded:X,reevaluatePanelConstraints:U,registerPanel:_,registerResizeHandle:L,resizePanel:T,startDragging:J,stopDragging:se,unregisterPanel:q,panelGroupElement:g.current}),[K,m,s,B,H,F,f,D,X,U,_,L,T,J,se,q]),M={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return x.createElement(We.Provider,{value:S},x.createElement(p,{...d,children:e,className:t,id:i,ref:g,style:{...M,...u},[V.group]:"",[V.groupDirection]:s,[V.groupId]:f}))}const Qt=x.forwardRef((n,e)=>x.createElement(Xt,{...n,forwardedRef:e}));Xt.displayName="PanelGroup";Qt.displayName="forwardRef(PanelGroup)";function ze(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function xe(n,e,t){const s=ze(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function ds({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){x.useEffect(()=>{if(n||t==null||s==null)return;const r=Ke(e,s);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const l=r.getAttribute(V.groupId);E(l,`No group element found for id "${l}"`);const a=De(l,s),u=Ot(l,e,s);E(u!==null,`No resize element found for id "${e}"`);const p=o.shiftKey?u>0?u-1:a.length-1:u+1<a.length?u+1:0;a[p].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function Jt({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:o,onDragging:l,onFocus:a,onPointerDown:u,onPointerUp:p,style:d={},tabIndex:f=0,tagName:g="div",...m}){var z,b;const y=x.useRef(null),P=x.useRef({onClick:o,onDragging:l,onPointerDown:u,onPointerUp:p});x.useEffect(()=>{P.current.onClick=o,P.current.onDragging=l,P.current.onPointerDown=u,P.current.onPointerUp=p});const R=x.useContext(We);if(R===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:k,groupId:W,registerResizeHandle:N,startDragging:w,stopDragging:K,panelGroupElement:B}=R,H=it(r),[F,D]=x.useState("inactive"),[X,_]=x.useState(!1),[L,T]=x.useState(null),U=x.useRef({state:F});we(()=>{U.current.state=F}),x.useEffect(()=>{if(t)T(null);else{const S=N(H);T(()=>S)}},[t,H,N]);const J=(z=s?.coarse)!==null&&z!==void 0?z:15,se=(b=s?.fine)!==null&&b!==void 0?b:5;x.useEffect(()=>{if(t||L==null)return;const S=y.current;E(S,"Element ref not attached");let M=!1;return Qn(H,S,k,{coarse:J,fine:se},(j,I,C)=>{if(!I){D("inactive");return}switch(j){case"down":{D("drag"),M=!1,E(C,'Expected event to be defined for "down" action'),w(H,C);const{onDragging:v,onPointerDown:$}=P.current;v?.(!0),$?.();break}case"move":{const{state:v}=U.current;M=!0,v!=="drag"&&D("hover"),E(C,'Expected event to be defined for "move" action'),L(C);break}case"up":{D("hover"),K();const{onClick:v,onDragging:$,onPointerUp:O}=P.current;$?.(!1),O?.(),M||v?.();break}}})},[J,k,t,se,N,H,L,w,K]),ds({disabled:t,handleId:H,resizeHandler:L,panelGroupElement:B});const q={touchAction:"none",userSelect:"none"};return x.createElement(g,{...m,children:n,className:e,id:r,onBlur:()=>{_(!1),i?.()},onFocus:()=>{_(!0),a?.()},ref:y,role:"separator",style:{...q,...d},tabIndex:f,[V.groupDirection]:k,[V.groupId]:W,[V.resizeHandle]:"",[V.resizeHandleActive]:F==="drag"?"pointer":X?"keyboard":void 0,[V.resizeHandleEnabled]:!t,[V.resizeHandleId]:H,[V.resizeHandleState]:F})}Jt.displayName="PanelResizeHandle";function fr(n){const e=A.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=ve("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let o;return e[6]!==s||e[7]!==r||e[8]!==i?(o=c.jsx(Qt,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=o):o=e[9],o}function pr(n){const e=A.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx(Rt,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function hr(n){const e=A.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=ve("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=i):i=e[5];let o;e[6]!==r?(o=r&&c.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:c.jsx(gn,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let l;return e[8]!==s||e[9]!==i||e[10]!==o?(l=c.jsx(Jt,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=l):l=e[11],l}function Yt(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function ce(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function oe(n,e){const t=await fetch(n,e);if(!t.ok){let s="";try{s=(await t.json()).error??""}catch{}throw new Error(s||`HTTP ${t.status}`)}return t}function mr(n,e){const t=A.c(11),{org:s}=ne();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Y.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await oe(ce(s.slug,n,"list",{path:e}))).json()).entries.toSorted(fs),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let o;return t[8]!==r||t[9]!==i?(o={queryKey:r,placeholderData:Pt,queryFn:i},t[8]=r,t[9]=i,t[10]=o):o=t[10],ge(o)}function fs(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function Zt(n,e,t){const s=A.c(15),{org:r}=ne();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const o=n!==null;let l;s[4]!==t?(l=t?.refetchIntervalWhenAbsent?p=>p.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=l):l=s[5];let a;s[6]!==r.slug||s[7]!==e||s[8]!==n?(a=async()=>{const p=await fetch(ce(r.slug,n??"","stat",{path:e}));if(p.status===404)return null;if(!p.ok)throw new Error(`HTTP ${p.status}`);return(await p.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=a):a=s[9];let u;return s[10]!==i||s[11]!==o||s[12]!==l||s[13]!==a?(u={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},s[10]=i,s[11]=o,s[12]=l,s[13]=a,s[14]=u):u=s[14],ge(u)}function gr(n){const e=A.c(9),{org:t}=ne();let s;e[0]!==t.id||e[1]!==n?(s=Y.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await oe(ce(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],ge(i)}function xr(n,e){const t=A.c(9),s=n===void 0?60:n,{org:r}=ne();let i;t[0]!==r.id?(i=Y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const o=e?.enabled;let l;t[2]!==s||t[3]!==r.slug?(l=async()=>(await(await oe(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=l):l=t[4];let a;return t[5]!==i||t[6]!==o||t[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},t[5]=i,t[6]=o,t[7]=l,t[8]=a):a=t[8],ge(a)}function yr(n,e){const t=A.c(11),s=50,{org:r}=ne();let i;t[0]!==r.id||t[1]!==n?(i=Y.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const o=n.length>0;let l;t[3]!==s||t[4]!==r.slug||t[5]!==n?(l=async()=>(await(await oe(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=l):l=t[6];let a;return t[7]!==i||t[8]!==o||t[9]!==l?(a={queryKey:i,enabled:o,placeholderData:Pt,queryFn:l},t[7]=i,t[8]=o,t[9]=l,t[10]=a):a=t[10],ge(a)}function wr(n){const e=A.c(8),{org:t}=ne();let s;e[0]!==t.id?(s=Y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const l=await oe(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(ps)},e[2]=t.slug,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==r||e[6]!==i?(o={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=o):o=e[7],ge(o)}function ps(n){return{volume:n.volume,path:n.path}}function br(){const n=A.c(7),{org:e}=ne();let t;n[0]!==e.id?(t=Y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await oe(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],ge(r)}function hs(n){const e=A.c(3),{org:t}=ne();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>ce(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function vr(){const n=A.c(2),{org:e}=ne();let t;return n[0]!==e.slug?(t=(s,r)=>ce(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ms(n){const e=A.c(3),{org:t}=ne();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await oe(ce(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],Ie(s)}function gs(n){const e=A.c(18),{org:t}=ne(),s=st();let r;e[0]!==t||e[1]!==n?(r=async u=>(await(await oe(ce(t.slug,n,"public",{path:u.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:u.mode,password:u.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async u=>{const p=Y.orgFsStat(t.id,n,u.path);await s.cancelQueries({queryKey:p});const d=s.getQueryData(p),f=u.mode!=="private";return s.setQueryData(p,g=>g&&{...g,readPublic:f,effectivePublic:f,shareMode:u.mode}),{key:p,previous:d}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(u,p,d)=>{d&&s.setQueryData(d.key,d.previous)},e[7]=s,e[8]=o):o=e[8];let l;e[9]!==t||e[10]!==s||e[11]!==n?(l=(u,p,d)=>{s.invalidateQueries({queryKey:Y.orgFsStat(t.id,n,d.path)}),s.invalidateQueries({queryKey:Y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=l):l=e[12];let a;return e[13]!==r||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:r,onMutate:i,onError:o,onSettled:l},e[13]=r,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],Ie(a)}function Sr(n){const e=A.c(26),{org:t}=ne(),s=st();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let o;e[4]!==t||e[5]!==n?(o=async b=>{for(const y of b.files){const P=b.dir?`${b.dir}/${y.name}`:y.name;await oe(ce(t.slug,n,"file",{path:P}),{method:"PUT",headers:{"content-type":y.type||"application/octet-stream"},body:y})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=Ie(l);let u;e[10]!==t||e[11]!==n?(u=async b=>{await oe(ce(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=u):u=e[12];let p;e[13]!==i||e[14]!==u?(p={mutationFn:u,onSuccess:i},e[13]=i,e[14]=u,e[15]=p):p=e[15];const d=Ie(p);let f;e[16]!==t||e[17]!==n?(f=async b=>{await oe(ce(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=f):f=e[18];let g;e[19]!==i||e[20]!==f?(g={mutationFn:f,onSuccess:i},e[19]=i,e[20]=f,e[21]=g):g=e[21];const m=Ie(g);let z;return e[22]!==d||e[23]!==m||e[24]!==a?(z={upload:a,mkdir:d,remove:m},e[22]=d,e[23]=m,e[24]=a,e[25]=z):z=e[25],z}function xs(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function ys(n){if(xs(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function ws(n){try{return decodeURIComponent(n)}catch{return n}}function bs(n){return ys(n),encodeURIComponent(n)}function vs(n){return`.deco/blocks/${bs(n)}.json`}function zr(n){return`/${vs(n)}`}const jr=1e4,Ss=3;function nt(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function at(n){return n.startsWith("/")?n.slice(1):n}function Oe(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function zs(n){const e=Oe(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function kr(n,e){const t=e.replace(/^\/+|\/+$/g,"");return Oe(t?`${n==="/"?"":n}/${t}`:n)}function Pr(n,e){return e==="directory"?n:zs(n)}function Cr(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function js(n){const e=at(n);return e?e.split("/").filter(Boolean).length:0}function $r(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Er(n,e){return js(n)>=Ss&&!e.has(n)}function Nr(n,e,t=[]){const s=at(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Ir(n){const e=at(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return ws(s)}function ks(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function Rr(n){const e=nt(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function Mr(n,e=[]){const t={children:[]},s=i=>{const l=nt(i).split("/").filter(Boolean);let a=t,u="";for(const p of l){u+=`/${p}`;let d=a.children.find(f=>f.name===p);d?d.kind==="file"&&(d.kind="directory"):(d={name:p,path:u,kind:"directory",children:[]},a.children.push(d)),a=d}};for(const i of n){const l=nt(i).split("/").filter(Boolean);let a=t,u="";l.forEach((p,d)=>{u+=`/${p}`;const f=d===l.length-1;let g=a.children.find(m=>m.name===p);g||(g={name:p,path:u,kind:f?"file":"directory",children:[]},a.children.push(g)),a=g})}for(const i of e)s(Oe(i));const r=i=>{i.sort((o,l)=>o.kind!==l.kind?o.kind==="directory"?-1:1:o.name.localeCompare(l.name));for(const o of i)o.children.length>0&&r(o.children)};return r(t.children),t.children}function Ps(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...Ps(r.children,e,t+1)));return s}function Dr(n){return n.split(`
2
+ `).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
3
+ `)}kn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Cs(n){const e=A.c(11),{value:t,filename:s}=n,[r]=un(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==s?(o=ks(s),e[0]=s,e[1]=o):o=e[1];const l=i?"vs-dark":"light";let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsx(dn,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let u,p;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={enabled:!1},p={top:12,bottom:12},e[3]=u,e[4]=p):(u=e[3],p=e[4]);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:u,padding:p,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=d):d=e[5];let f;return e[6]!==s||e[7]!==o||e[8]!==l||e[9]!==t?(f=c.jsx(Pn,{path:s,language:o,value:t,theme:l,loading:a,options:d},s),e[6]=s,e[7]=o,e[8]=l,e[9]=t,e[10]=f):f=e[10],f}function en(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const $s=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Es=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),bt=2*1024*1024;function Ns(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return $s.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=bt?"markdown":"download":Es.has(t)&&e<=bt?"text":"download"}function tn(){const n=A.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(_e,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx(_e,{className:"h-3 w-full"}),c.jsx(_e,{className:"h-3 w-5/6"}),c.jsx(_e,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function nn(n){const e=A.c(20),{file:t,note:s}=n;let r;e[0]!==t.filename?(r=c.jsx(et,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=r):r=e[1];let i;e[2]!==t.filename?(i=c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=i):i=e[3];let o;e[4]!==t.size?(o=en(t.size),e[4]=t.size,e[5]=o):o=e[5];const l=s?` · ${s}`:"";let a;e[6]!==o||e[7]!==l?(a=c.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,l]}),e[6]=o,e[7]=l,e[8]=a):a=e[8];let u;e[9]!==i||e[10]!==a?(u=c.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,a]}),e[9]=i,e[10]=a,e[11]=u):u=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Te,{size:14}),e[12]=p):p=e[12];let d;e[13]!==t.downloadUrl||e[14]!==t.filename?(d=c.jsx(ee,{asChild:!0,variant:"outline",size:"sm",children:c.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[p,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=d):d=e[15];let f;return e[16]!==r||e[17]!==u||e[18]!==d?(f=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,u,d]})}),e[16]=r,e[17]=u,e[18]=d,e[19]=f):f=e[19],f}function vt(n){const e=A.c(16),{file:t,markdown:s}=n;let r;e[0]!==t.downloadUrl?(r=Y.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const d=await fetch(t.downloadUrl,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=t.downloadUrl,e[3]=i):i=e[3];let o;e[4]!==r||e[5]!==i?(o={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=o):o=e[6];const{data:l,isPending:a,isError:u}=ge(o);if(a){let d;return e[7]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(tn,{}),e[7]=d):d=e[7],d}if(u||l===void 0){let d;return e[8]!==t?(d=c.jsx(nn,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=d):d=e[9],d}if(s){const d=`file-preview-${t.key}`;let f;return e[10]!==l||e[11]!==d?(f=c.jsx("div",{className:"h-full overflow-y-auto",children:c.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:c.jsx(Cn,{id:d,text:l})})}),e[10]=l,e[11]=d,e[12]=f):f=e[12],f}let p;return e[13]!==l||e[14]!==t.filename?(p=c.jsx(Cs,{value:l,filename:t.filename}),e[13]=l,e[14]=t.filename,e[15]=p):p=e[15],p}function Is(n){const e=A.c(15),{file:t}=n;switch(Ns(t.filename,t.size)){case"image":{let r;return e[0]!==t.downloadUrl||e[1]!==t.filename?(r=c.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:c.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==t.downloadUrl||e[4]!==t.filename?(r=c.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==t.downloadUrl||e[7]!==t.filename?(r=c.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==t?(r=c.jsx(vt,{file:t,markdown:!0}),e[9]=t,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==t?(r=c.jsx(vt,{file:t,markdown:!1}),e[11]=t,e[12]=r):r=e[12],r}default:{let r;return e[13]!==t?(r=c.jsx(nn,{file:t}),e[13]=t,e[14]=r):r=e[14],r}}}function Rs(n){const e=A.c(40),{readUrl:t,editor:s,downloadName:r,trailing:i}=n;let o;e[0]!==t?(o=new URL(t,window.location.origin).toString(),e[0]=t,e[1]=o):o=e[1];const l=o;let a;e[2]!==s?(a=s.deckDetected&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?"Hide slide list":"Show slide list",onClick:()=>s.setRailOpen(!s.railOpen),children:c.jsx(In,{size:14})})}),c.jsx(fe,{side:"bottom",children:s.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=s,e[3]=a):a=e[3];let u;e[4]!==l?(u=()=>window.open(l,"_blank","noopener"),e[4]=l,e[5]=u):u=e[5];let p;e[6]!==l?(p=c.jsx("span",{className:"truncate",children:l}),e[6]=l,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==u||e[10]!==p?(d=c.jsx("button",{type:"button",onClick:u,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:l,children:p}),e[8]=l,e[9]=u,e[10]=p,e[11]=d):d=e[11];let f;e[12]!==s.agentUpdated||e[13]!==s.reload?(f=s.agentUpdated&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsxs(ee,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[c.jsx(fn,{size:12}),"Agent updated — reload"]})}),c.jsx(fe,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=s.agentUpdated,e[13]=s.reload,e[14]=f):f=e[14];let g;e[15]!==s.saving?(g=s.saving&&c.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=s.saving,e[16]=g):g=e[16];let m;e[17]!==s?(m=s.deckDetected&&s.writable&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?"Done editing":"Edit inline",className:ve(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:c.jsx(xn,{size:14})})}),c.jsx(fe,{side:"bottom",children:s.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=s,e[18]=m):m=e[18];let z;e[19]!==l||e[20]!==r||e[21]!==s.deckDetected?(z=s.deckDetected?c.jsxs($n,{children:[c.jsx(En,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Download",children:c.jsx(Te,{size:14})})}),c.jsxs(Nn,{align:"end",children:[c.jsxs(dt,{onClick:()=>window.open(`${l}#print`,"_blank","noopener"),children:[c.jsx(yn,{size:14}),"Export as PDF"]}),c.jsx(dt,{asChild:!0,children:c.jsxs("a",{href:l,download:r,children:[c.jsx(wn,{size:14}),"Download HTML"]})})]})]}):c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:c.jsx("a",{href:l,download:r,children:c.jsx(Te,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Download"})]}),e[19]=l,e[20]=r,e[21]=s.deckDetected,e[22]=z):z=e[22];let b;e[23]!==l?(b=()=>window.open(l,"_blank","noopener"),e[23]=l,e[24]=b):b=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx(Nt,{size:14}),e[25]=y):y=e[25];let P;e[26]!==b?(P=c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:b,children:y})}),e[26]=b,e[27]=P):P=e[27];let R;e[28]===Symbol.for("react.memo_cache_sentinel")?(R=c.jsx(fe,{side:"bottom",children:"Open in new tab"}),e[28]=R):R=e[28];let k;e[29]!==P?(k=c.jsxs(ue,{children:[P,R]}),e[29]=P,e[30]=k):k=e[30];let W;return e[31]!==k||e[32]!==a||e[33]!==d||e[34]!==f||e[35]!==g||e[36]!==m||e[37]!==z||e[38]!==i?(W=c.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[a,d,f,g,m,z,k,i]}),e[31]=k,e[32]=a,e[33]=d,e[34]=f,e[35]=g,e[36]=m,e[37]=z,e[38]=i,e[39]=W):W=e[39],W}const je=1;function Ms(n){if(typeof n!="object"||n===null||n.v!==je||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class he extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function sn(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function Ds(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?sn(t).length:null}function Ls(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new he("no <deck-viewer> element in source","no-viewer");const r=sn(s),i=e.kind==="move"?e.from:e.at,o=r[i];if(!o)throw new he(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new he("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const a=o.cloneNode(!0);a.removeAttribute("id");for(const u of a.querySelectorAll("[id]"))u.removeAttribute("id");o.after(a);break}case"move":{if(e.to<0||e.to>=r.length)throw new he(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const a=e.to<e.from?r[e.to]:r[e.to].nextSibling;s.insertBefore(o,a)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new he(`invalid attribute name: ${e.name}`,"bad-op");o.setAttribute(e.name,e.value);break}case"remove-attr":{o.removeAttribute(e.name);break}case"replace":{const u=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!u)throw new he("replace html has no root element","bad-op");o.replaceWith(t.importNode(u,!0));break}default:throw new he(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
+ `:""}${t.documentElement.outerHTML}
5
+ `}const St="home",_s=400,As=800;function Fs(n){const e=n.savePath!==void 0,{org:t}=ne(),s=st(),r=ms(St),[i,o]=x.useState(!1),[l,a]=x.useState(!1),[u,p]=x.useState(!1),[d,f]=x.useState(!1),[g,m]=x.useState(!1),[z,b]=x.useState(!1),[y,P]=x.useState(null),[R,k]=x.useState(null),[W,N]=x.useState(0),[w]=x.useState(()=>({iframe:null,source:null,queue:Promise.resolve(),saveTimer:null,selfMarkers:new Set})),K=i||z||g,B=()=>{n.savePath!==void 0&&(s.invalidateQueries({queryKey:Y.orgFsStat(t.id,St,n.savePath)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)}))},H=S=>{w.iframe?.contentWindow?.postMessage(S,"*")},F=()=>{w.source=null,f(!1),R&&P(R),N(S=>S+1),B()};n.statMarker!==R&&(k(n.statMarker),n.statMarker!==null&&(y===null?P(n.statMarker):w.selfMarkers.has(n.statMarker)||n.statMarker!==y&&(K?f(!0):(w.source=null,P(n.statMarker)))));const D=async()=>{w.saveTimer=null;const S=w.source;if(S===null){b(!1);return}m(!0);try{const M=await r.mutateAsync({path:n.savePath,body:S});w.selfMarkers.add(Yt(M)),B()}catch(M){console.error("[deck-editor] save failed",M),Re.error("Couldn't save deck edits — reloading the preview."),U.current.reload()}finally{m(!1),b(!1)}},X=S=>{b(!0),w.saveTimer&&clearTimeout(w.saveTimer),w.saveTimer=setTimeout(()=>{U.current.flushSave()},S)},_=(S,M,h)=>{H({v:je,type:"ack",opId:S,ok:M,error:h})},L=async S=>{if(!e){_(S.opId,!1,"read-only preview");return}try{if(w.source===null){const h=await fetch(n.readUrl,{credentials:"include"});if(!h.ok)throw new Error(`HTTP ${h.status}`);w.source=await h.text()}const M=Ds(w.source);if(M===null||M!==S.witness.childCount)throw new he(`slide count drifted (source ${M}, iframe ${S.witness.childCount})`,"stale-index");w.source=Ls(w.source,S.op),_(S.opId,!0),X(S.op.kind==="replace"?As:_s)}catch(M){console.error("[deck-editor] op failed",S.op,M),_(S.opId,!1,M instanceof Error?M.message:String(M)),Re.error("That edit couldn't be saved — reloading the preview."),U.current.reload()}},T=S=>{if(!w.iframe||S.source!==w.iframe.contentWindow)return;const M=Ms(S.data);if(M){if(M.type==="ready"){a(!0),U.current.editMode?H({v:je,type:"set-edit-mode",enabled:!0}):U.current.railOpen&&H({v:je,type:"set-rail",open:!0});return}M.type==="op"&&(w.queue=w.queue.then(()=>U.current.handleOp(M)).catch(()=>{}))}},U=x.useRef({onMessage:T,handleOp:L,flushSave:D,reload:F,editMode:i,railOpen:u});U.current={onMessage:T,handleOp:L,flushSave:D,reload:F,editMode:i,railOpen:u};const[J]=x.useState(()=>{let S=null;return M=>{if(M){w.iframe=M;const h=j=>U.current.onMessage(j);window.addEventListener("message",h),S=()=>window.removeEventListener("message",h)}else S?.(),S=null,w.iframe=null}}),se=S=>{p(S),H({v:je,type:"set-rail",open:S})},q=S=>{o(S),H({v:je,type:"set-edit-mode",enabled:S}),S&&p(!0),!S&&d&&!z&&!g&&F()};return{iframeRef:J,deckDetected:l,writable:e,displayedMarker:y===null?null:`${y}.${W}`,editMode:i,setEditMode:q,railOpen:u,setRailOpen:se,saving:g,agentUpdated:d,reload:F,postToIframe:H}}const Ts=300;function Us({readUrl:n,marker:e,title:t,savePath:s,trailing:r}){const i=Fs({readUrl:n,statMarker:e,savePath:s}),[o,l]=x.useState(null);if(i.displayedMarker===null)return null;const a=n.includes("?")?"&":"?",u=`${n}${a}v=${encodeURIComponent(i.displayedMarker)}`,p=o===u;return c.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[c.jsx(Rs,{readUrl:n,editor:i,downloadName:t.split("/").pop()??t,trailing:r}),c.jsx("div",{className:"relative flex-1",children:c.jsx("iframe",{ref:i.iframeRef,src:u,onLoad:()=>l(u),sandbox:"allow-scripts",className:ve("absolute inset-0 block h-full w-full bg-white","transition-opacity ease-out",p?"opacity-100":"opacity-0"),style:{transitionDuration:`${Ts}ms`},title:t},u)})]})}const Hs=[{mode:"private",label:"Org only",Icon:pn},{mode:"public",label:"Public",Icon:Et},{mode:"password",label:"Password",Icon:Fn}];function rn(n){const e=A.c(38),{volume:t,path:s,kind:r,shareMode:i,effectivePublic:o,url:l}=n,a=gs(t),{data:u}=Zt(t,s),p=u?.shareMode??i,f=(u?.effectivePublic??o)&&p==="private",g=r==="dir",m=g?"folder":"file",[z,b]=x.useState(!1),[y,P]=x.useState(""),[R,k]=x.useState(!1);let W;e[0]!==s||e[1]!==a||e[2]!==m?(W=(q,S)=>{a.mutate({path:s,mode:q,password:S},{onSuccess:()=>{b(!1),P(""),Re.success(q==="private"?`This ${m} is now org-only`:q==="public"?`Anyone with the link can now view this ${m}`:`This ${m} is now password-protected`)},onError:Os})},e[0]=s,e[1]=a,e[2]=m,e[3]=W):W=e[3];const N=W;let w;e[4]!==N?(w=q=>{if(q==="password"){b(!0);return}b(!1),N(q)},e[4]=N,e[5]=w):w=e[5];const K=w,B=z?"password":p;let H;e[6]!==l?(H=async()=>{l&&(await navigator.clipboard.writeText(l),k(!0),Re.success("Link copied to clipboard"),setTimeout(()=>k(!1),2e3))},e[6]=l,e[7]=H):H=e[7];const F=H;let D;e[8]!==R||e[9]!==F||e[10]!==l?(D=l?c.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-muted/50 px-2 py-1.5",children:[c.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l}),c.jsx(ee,{variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:F,"aria-label":"Copy link",children:R?c.jsx(_n,{size:12,className:"text-green-600"}):c.jsx(An,{size:12})})]}):null,e[8]=R,e[9]=F,e[10]=l,e[11]=D):D=e[11];const X=D;if(f){let q;e[12]===Symbol.for("react.memo_cache_sentinel")?(q=c.jsx("div",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:c.jsx(Et,{size:16})}),e[12]=q):q=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx("span",{className:"text-sm font-medium text-foreground",children:"Shared via a parent folder"}),e[13]=S):S=e[13];const M=g?"files in this folder":"this file";let h;e[14]!==M?(h=c.jsxs("div",{className:"flex items-start gap-3",children:[q,c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[S,c.jsxs("span",{className:"text-xs text-muted-foreground",children:["Anyone with the link can view"," ",M,". Manage sharing on the parent folder."]})]})]}),e[14]=M,e[15]=h):h=e[15];let j;return e[16]!==X||e[17]!==h?(j=c.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[h,X]}),e[16]=X,e[17]=h,e[18]=j):j=e[18],j}let _;e[19]!==B||e[20]!==K||e[21]!==a.isPending?(_=Hs.map(q=>{const{mode:S,label:M,Icon:h}=q;return c.jsxs("button",{type:"button",disabled:a.isPending,onClick:()=>K(S),className:ve("flex flex-col items-center gap-1 rounded-md px-2 py-2 text-xs font-medium transition-colors disabled:opacity-60",B===S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[c.jsx(h,{size:15}),M]},S)}),e[19]=B,e[20]=K,e[21]=a.isPending,e[22]=_):_=e[22];let L;e[23]!==_?(L=c.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-muted p-1",children:_}),e[23]=_,e[24]=L):L=e[24];const T=B==="private"?`Only members of your organization can open ${g?"these files":"this link"}.`:B==="public"?g?"Anyone on the internet can view files in this folder via their link.":"Anyone on the internet with the link can view this file.":`Anyone with the link AND the password can view ${g?"files in this folder":"this file"}.`;let U;e[25]!==T?(U=c.jsx("p",{className:"text-xs text-muted-foreground",children:T}),e[25]=T,e[26]=U):U=e[26];let J;e[27]!==B||e[28]!==N||e[29]!==p||e[30]!==y||e[31]!==a.isPending?(J=B==="password"&&c.jsxs("form",{className:"flex items-center gap-2",onSubmit:q=>{q.preventDefault(),y&&N("password",y)},children:[c.jsx(Rn,{type:"password",value:y,onChange:q=>P(q.target.value),placeholder:p==="password"?"New password":"Password",autoComplete:"new-password",className:"h-8 text-xs"}),c.jsx(ee,{type:"submit",size:"sm",className:"shrink-0",disabled:!y||a.isPending,children:p==="password"?"Update":"Set"})]}),e[27]=B,e[28]=N,e[29]=p,e[30]=y,e[31]=a.isPending,e[32]=J):J=e[32];let se;return e[33]!==X||e[34]!==L||e[35]!==U||e[36]!==J?(se=c.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[L,U,J,X]}),e[33]=X,e[34]=L,e[35]=U,e[36]=J,e[37]=se):se=e[37],se}function Os(n){return Re.error(n instanceof Error?n.message:"Failed to update sharing")}function zt(n){const e=A.c(7),{volume:t,path:s,shareMode:r,effectivePublic:i,url:o}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(Mn,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Share",children:c.jsx(bn,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Share"})]}),e[0]=l):l=e[0];let a;return e[1]!==i||e[2]!==s||e[3]!==r||e[4]!==o||e[5]!==t?(a=c.jsxs(Dn,{children:[l,c.jsx(Ln,{align:"end",className:"w-80 p-3",children:c.jsx(rn,{volume:t,path:s,kind:"file",shareMode:r,effectivePublic:i,url:o})})]}),e[1]=i,e[2]=s,e[3]=r,e[4]=o,e[5]=t,e[6]=a):a=e[6],a}function Lr(n){const e=A.c(11),{target:t,onOpenChange:s}=n,r=!!t,i=t?.kind==="dir"?"folder":"file";let o;e[0]!==i?(o=c.jsx(zn,{children:c.jsxs(Ze,{children:["Share ",i]})}),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t?(l=t&&c.jsx(rn,{...t}),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==l?(a=c.jsxs(Ct,{className:"sm:max-w-md",children:[o,l]}),e[4]=o,e[5]=l,e[6]=a):a=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==a?(u=c.jsx($t,{open:r,onOpenChange:s,children:a}),e[7]=s,e[8]=r,e[9]=a,e[10]=u):u=e[10],u}function Ws(n){const e=n?n.split("/").filter(Boolean):[],t=e[0]==="public",s=t?e[1]??null:null,r=t?s?`public-${s}`:null:e[0]??null,i=(t?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:r,dirPath:i,isPublic:t,publicSet:s,readOnly:t}}function _r(n,e){return n.isPublic&&n.publicSet?`public/${n.publicSet}/${e}`:n.volume?`${n.volume}/${e}`:e}const jt="public-";function Bs(n){return n.startsWith(jt)?n.slice(jt.length):null}function Ar(n,e){const t=Bs(n);return t?`public/${t}/${e}`:`${n}/${e}`}function qs(n){const e=n.lastIndexOf("/");return e===-1?n:n.slice(e+1)}function Ks(n){const e=A.c(11),{org:t,previewPath:s}=n;let r;e[0]!==s?(r=s.split("/").slice(0,-1).join("/"),e[0]=s,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o={org:t},e[2]=t,e[3]=o):o=e[3];let l;e[4]!==i||e[5]!==s?(l={path:i,preview:s},e[4]=i,e[5]=s,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(vn,{size:14}),e[7]=a):a=e[7];let u;return e[8]!==o||e[9]!==l?(u=c.jsx(ee,{variant:"ghost",size:"sm",asChild:!0,className:"shrink-0 gap-1.5 text-xs text-muted-foreground",children:c.jsxs(hn,{to:"/$org/files",params:o,search:l,children:[a,"See in library"]})}),e[8]=o,e[9]=l,e[10]=u):u=e[10],u}const Gs=n=>/\.html?$/i.test(n);function kt(n){const e=A.c(6),{onClose:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(jn,{size:14}),e[0]=s):s=e[0];let r;e[1]!==t?(r=c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",onClick:t,children:s})}),e[1]=t,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(fe,{side:"bottom",children:"Close"}),e[3]=i):i=e[3];let o;return e[4]!==r?(o=c.jsxs(ue,{children:[r,i]}),e[4]=r,e[5]=o):o=e[5],o}function on(n){const e=A.c(37),{previewPath:t,onClose:s,showSeeInLibrary:r,variant:i}=n,o=r===void 0?!1:r;let l;e[0]!==t?(l=Ws(t),e[0]=t,e[1]=l):l=e[1];const a=l,{volume:u,dirPath:p}=a,{data:d,isPending:f}=Zt(u,p),g=hs(u??""),m=qs(p);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={strict:!1},e[2]=z):z=e[2];const{org:b}=mn(z),y=i==="dialog";let P;e[3]!==b||e[4]!==t||e[5]!==o?(P=o&&b?c.jsx(Ks,{org:b,previewPath:t}):null,e[3]=b,e[4]=t,e[5]=o,e[6]=P):P=e[6];const R=P,k=d&&d.kind==="file"?{key:t,filename:m,size:d.size,downloadUrl:g(d.path)}:null;if(k&&d&&Gs(m)){const H=k.downloadUrl;let F;e[7]!==d?(F=Yt(d),e[7]=d,e[8]=F):F=e[8];const D=u??"",X=d.shareMode??"private",_=d.effectivePublic??!1,L=window.location.origin+k.downloadUrl;let T;e[9]!==p||e[10]!==L||e[11]!==D||e[12]!==X||e[13]!==_?(T=c.jsx(zt,{volume:D,path:p,shareMode:X,effectivePublic:_,url:L}),e[9]=p,e[10]=L,e[11]=D,e[12]=X,e[13]=_,e[14]=T):T=e[14];let U;e[15]!==y||e[16]!==s?(U=y?c.jsx("div",{className:"w-8 shrink-0"}):c.jsx(kt,{onClose:s}),e[15]=y,e[16]=s,e[17]=U):U=e[17];let J;return e[18]!==R||e[19]!==T||e[20]!==U?(J=c.jsxs(c.Fragment,{children:[T,R,U]}),e[18]=R,e[19]=T,e[20]=U,e[21]=J):J=e[21],c.jsxs(c.Fragment,{children:[y&&c.jsx(Ze,{className:"sr-only",children:m}),c.jsx(Us,{readUrl:H,marker:F,title:m,savePath:u==="home"?p:void 0,trailing:J},t)]})}const W=y?"h-11 py-1 pr-12 pl-2":"h-9 px-2";let N;e[22]!==W?(N=ve("flex shrink-0 items-center gap-1 border-b border-border/60",W),e[22]=W,e[23]=N):N=e[23];let w;e[24]!==d?.effectivePublic||e[25]!==d?.shareMode||e[26]!==k||e[27]!==p||e[28]!==u?(w=k&&c.jsxs(c.Fragment,{children:[c.jsx(zt,{volume:u??"",path:p,shareMode:d?.shareMode??"private",effectivePublic:d?.effectivePublic??!1,url:window.location.origin+k.downloadUrl}),c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",asChild:!0,children:c.jsx("a",{href:k.downloadUrl,download:k.filename,children:c.jsx(Te,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Download"})]}),c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>window.open(k.downloadUrl,"_blank","noopener"),children:c.jsx(Nt,{size:14})})}),c.jsx(fe,{side:"bottom",children:"Open in new tab"})]})]}),e[24]=d?.effectivePublic,e[25]=d?.shareMode,e[26]=k,e[27]=p,e[28]=u,e[29]=w):w=e[29];let K;e[30]!==y||e[31]!==s?(K=!y&&c.jsx(kt,{onClose:s}),e[30]=y,e[31]=s,e[32]=K):K=e[32];let B;return e[33]!==k||e[34]!==m||e[35]!==f?(B=c.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:k?c.jsx(Is,{file:k}):f?c.jsx(tn,{}):c.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[c.jsx(et,{filename:m,className:"h-7.5 w-6"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[33]=k,e[34]=m,e[35]=f,e[36]=B):B=e[36],c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:N,children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[c.jsx(et,{filename:m,className:"h-4.5 w-3.5 shrink-0"}),y?c.jsx(Ze,{className:"truncate text-xs font-medium text-foreground",children:m}):c.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:m}),k&&c.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:en(k.size)})]}),R,w,K]}),B]})}function Fr(n){const e=A.c(4),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let o;return e[0]!==s||e[1]!==t||e[2]!==i?(o=c.jsx("div",{className:"flex h-full w-full flex-col bg-background",children:c.jsx(on,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"panel"})}),e[0]=s,e[1]=t,e[2]=i,e[3]=o):o=e[3],o}function Vs(n){const e=A.c(5),{icon:t}=n;if(t.kind==="component"){const{Component:r}=t;let i;return e[0]!==r?(i=c.jsx(r,{className:"size-4"}),e[0]=r,e[1]=i):i=e[1],i}if(t.kind==="url"){let r;return e[2]!==t.src?(r=c.jsx("img",{src:t.src,alt:"",className:"size-4 rounded-sm object-cover"}),e[2]=t.src,e[3]=r):r=e[3],r}let s;return e[4]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(Sn,{className:"size-4"}),e[4]=s):s=e[4],s}function Tr(n){const e=A.c(13),{title:t,icon:s,active:r,onClick:i}=n,o=r?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let l;e[0]!==o?(l=ve("shrink-0 flex items-center gap-1.5 h-8 rounded-md px-2","[transition:background-color_180ms_ease,color_180ms_ease]",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==s?(a=c.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:c.jsx(Vs,{icon:s})}),e[2]=s,e[3]=a):a=e[3];let u;e[4]!==t?(u=c.jsx("span",{className:"whitespace-nowrap text-sm font-medium leading-none",children:t}),e[4]=t,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==i||e[8]!==l||e[9]!==a||e[10]!==u||e[11]!==t?(p=c.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,"aria-label":t,className:l,children:[a,u]}),e[6]=r,e[7]=i,e[8]=l,e[9]=a,e[10]=u,e[11]=t,e[12]=p):p=e[12],p}function Ur(n){const e=A.c(9),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let o;e[0]!==s?(o=u=>{u||s()},e[0]=s,e[1]=o):o=e[1];let l;e[2]!==s||e[3]!==t||e[4]!==i?(l=c.jsx(Ct,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:c.jsx(on,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i,e[5]=l):l=e[5];let a;return e[6]!==o||e[7]!==l?(a=c.jsx($t,{open:!0,onOpenChange:o,children:l}),e[6]=o,e[7]=l,e[8]=a):a=e[8],a}export{gr as A,Ar as B,jr as C,Rr as D,Ss as E,tn as F,Mr as G,Us as H,Ps as I,Pr as J,at as K,Fr as L,Oe as M,Er as N,Dr as O,Cr as P,zs as Q,pr as R,Lr as S,Vs as T,kr as U,Nr as V,Ir as W,$r as X,vr as a,xr as b,wr as c,vs as d,zr as e,ys as f,ks as g,Is as h,en as i,Zt as j,hs as k,Yt as l,zt as m,hr as n,fr as o,Tr as p,Ur as q,Ws as r,qs as s,ms as t,Sr as u,mr as v,yr as w,br as x,_r as y,Bs as z};
@@ -1 +1 @@
1
- import{c as h,r as y,l as j,j as f}from"./index-tHbNbVHJ.js";import{a0 as A}from"./agent-icon-BbjKuSxW.js";import{s as N}from"./Plus-rHk0VScG.js";import{s as _}from"./Trash01-BrvLbqQk.js";const S=700;function R(r,e,o){const t=h.c(7),s=S,[n,c]=y.useState(r),[l,u]=y.useState(r),[x,p]=y.useState(!1),i=y.useRef(null);r!==l&&(u(r),x||c(r));let a;t[0]!==s||t[1]!==e?(a=g=>{c(g),p(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p(!1),e(g)},s)},t[0]=s,t[1]=e,t[2]=a):a=t[2];const d=a;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>{c(g),i.current&&clearTimeout(i.current),i.current=null,p(!1)},t[3]=m):m=t[3];const v=m;let b;return t[4]!==n||t[5]!==d?(b=[n,d,v],t[4]=n,t[5]=d,t[6]=b):b=t[6],b}function T(r){const e=h.c(14),{value:o,onChange:t,placeholder:s,className:n,onFocus:c,onBlur:l,onKeyDown:u,spellCheck:x,inputRef:p}=r,i=x===void 0?!0:x;let a;e[0]!==t?(a=v=>t(v.target.value),e[0]=t,e[1]=a):a=e[1];let d;e[2]!==n?(d=j("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",n),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==p||e[5]!==l||e[6]!==c||e[7]!==u||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==d||e[12]!==o?(m=f.jsx("textarea",{ref:p,value:o,onChange:a,onInput:w,onFocus:c,onBlur:l,onKeyDown:u,placeholder:s,spellCheck:i,rows:1,className:d}),e[4]=p,e[5]=l,e[6]=c,e[7]=u,e[8]=s,e[9]=i,e[10]=a,e[11]=d,e[12]=o,e[13]=m):m=e[13],m}function w(r){const e=r.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function D(r){return typeof r=="string"?r:""}function B(r){const e=h.c(11);let o,t;e[0]!==r?({className:o,...t}=r,e[0]=r,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let s;e[3]!==o?(s=j(o,"pr-9"),e[3]=o,e[4]=s):s=e[4];let n;e[5]!==t||e[6]!==s?(n=f.jsx(T,{...t,className:s}),e[5]=t,e[6]=s,e[7]=n):n=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=f.jsx(A,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=c):c=e[8];let l;return e[9]!==n?(l=f.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[n,c]}),e[9]=n,e[10]=l):l=e[10],l}function F(r){const e=h.c(5),{label:o,onClick:t,disabled:s}=r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=f.jsx(N,{size:13}),e[0]=n):n=e[0];let c;return e[1]!==s||e[2]!==o||e[3]!==t?(c=f.jsxs("button",{type:"button",onClick:t,disabled:s,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[n,o]}),e[1]=s,e[2]=o,e[3]=t,e[4]=c):c=e[4],c}function I(r){const e=h.c(4),{label:o,onClick:t}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=f.jsx(_,{size:13}),e[0]=s):s=e[0];let n;return e[1]!==o||e[2]!==t?(n=f.jsx("button",{type:"button","aria-label":o,onClick:t,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:s}),e[1]=o,e[2]=t,e[3]=n):n=e[3],n}function J(r){const e=h.c(2),{children:o}=r;let t;return e[0]!==o?(t=f.jsx("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}),e[0]=o,e[1]=t):t=e[1],t}function O(r){const e=h.c(8),{active:o,label:t,onClick:s,children:n}=r,c=o?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==c?(l=j("flex h-7 min-w-7 items-center justify-center rounded px-1.5 text-sm transition-colors cursor-pointer",c),e[0]=c,e[1]=l):l=e[1];let u;return e[2]!==o||e[3]!==n||e[4]!==t||e[5]!==s||e[6]!==l?(u=f.jsx("button",{type:"button","aria-label":t,"aria-pressed":o,onMouseDown:$,onClick:s,className:l,children:n}),e[2]=o,e[3]=n,e[4]=t,e[5]=s,e[6]=l,e[7]=u):u=e[7],u}function $(r){return r.preventDefault()}function H(r){if(Array.isArray(r))return r;if(typeof r!="string"||r.trim()==="")return[];try{const e=JSON.parse(r);return Array.isArray(e)?e:[]}catch{return[]}}export{F as A,B as E,J as F,T as I,I as R,O as T,H as p,D as s,R as u};
1
+ import{c as h,r as y,l as j,j as f}from"./index-DJ-0yJzO.js";import{a4 as A}from"./agent-icon-DQ2UQuHh.js";import{s as N}from"./Plus-CSb3V8S8.js";import{s as _}from"./Trash01-DEQkTUig.js";const S=700;function R(r,e,o){const t=h.c(7),s=S,[n,c]=y.useState(r),[l,u]=y.useState(r),[x,p]=y.useState(!1),i=y.useRef(null);r!==l&&(u(r),x||c(r));let a;t[0]!==s||t[1]!==e?(a=g=>{c(g),p(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p(!1),e(g)},s)},t[0]=s,t[1]=e,t[2]=a):a=t[2];const d=a;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>{c(g),i.current&&clearTimeout(i.current),i.current=null,p(!1)},t[3]=m):m=t[3];const v=m;let b;return t[4]!==n||t[5]!==d?(b=[n,d,v],t[4]=n,t[5]=d,t[6]=b):b=t[6],b}function T(r){const e=h.c(14),{value:o,onChange:t,placeholder:s,className:n,onFocus:c,onBlur:l,onKeyDown:u,spellCheck:x,inputRef:p}=r,i=x===void 0?!0:x;let a;e[0]!==t?(a=v=>t(v.target.value),e[0]=t,e[1]=a):a=e[1];let d;e[2]!==n?(d=j("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",n),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==p||e[5]!==l||e[6]!==c||e[7]!==u||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==d||e[12]!==o?(m=f.jsx("textarea",{ref:p,value:o,onChange:a,onInput:w,onFocus:c,onBlur:l,onKeyDown:u,placeholder:s,spellCheck:i,rows:1,className:d}),e[4]=p,e[5]=l,e[6]=c,e[7]=u,e[8]=s,e[9]=i,e[10]=a,e[11]=d,e[12]=o,e[13]=m):m=e[13],m}function w(r){const e=r.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function D(r){return typeof r=="string"?r:""}function B(r){const e=h.c(11);let o,t;e[0]!==r?({className:o,...t}=r,e[0]=r,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let s;e[3]!==o?(s=j(o,"pr-9"),e[3]=o,e[4]=s):s=e[4];let n;e[5]!==t||e[6]!==s?(n=f.jsx(T,{...t,className:s}),e[5]=t,e[6]=s,e[7]=n):n=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=f.jsx(A,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=c):c=e[8];let l;return e[9]!==n?(l=f.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[n,c]}),e[9]=n,e[10]=l):l=e[10],l}function F(r){const e=h.c(5),{label:o,onClick:t,disabled:s}=r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=f.jsx(N,{size:13}),e[0]=n):n=e[0];let c;return e[1]!==s||e[2]!==o||e[3]!==t?(c=f.jsxs("button",{type:"button",onClick:t,disabled:s,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[n,o]}),e[1]=s,e[2]=o,e[3]=t,e[4]=c):c=e[4],c}function I(r){const e=h.c(4),{label:o,onClick:t}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=f.jsx(_,{size:13}),e[0]=s):s=e[0];let n;return e[1]!==o||e[2]!==t?(n=f.jsx("button",{type:"button","aria-label":o,onClick:t,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:s}),e[1]=o,e[2]=t,e[3]=n):n=e[3],n}function J(r){const e=h.c(2),{children:o}=r;let t;return e[0]!==o?(t=f.jsx("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}),e[0]=o,e[1]=t):t=e[1],t}function O(r){const e=h.c(8),{active:o,label:t,onClick:s,children:n}=r,c=o?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==c?(l=j("flex h-7 min-w-7 items-center justify-center rounded px-1.5 text-sm transition-colors cursor-pointer",c),e[0]=c,e[1]=l):l=e[1];let u;return e[2]!==o||e[3]!==n||e[4]!==t||e[5]!==s||e[6]!==l?(u=f.jsx("button",{type:"button","aria-label":t,"aria-pressed":o,onMouseDown:$,onClick:s,className:l,children:n}),e[2]=o,e[3]=n,e[4]=t,e[5]=s,e[6]=l,e[7]=u):u=e[7],u}function $(r){return r.preventDefault()}function H(r){if(Array.isArray(r))return r;if(typeof r!="string"||r.trim()==="")return[];try{const e=JSON.parse(r);return Array.isArray(e)?e:[]}catch{return[]}}export{F as A,B as E,J as F,T as I,I as R,O as T,H as p,D as s,R as u};
@@ -1 +1 @@
1
- import{c as V,j as t,a as D,p as R,af as q,J as B,w as N,t as T}from"./index-tHbNbVHJ.js";import{P as L}from"./index-87hVDe9f.js";import{A as U}from"./avatar-DosbYSVo.js";import{S as I}from"./switch-CuKs1fR0.js";import{d as G,b as Y,a as $,S as J}from"./select-Ufh1328y.js";import{T as K,a as z}from"./toggle-group-DFSFo_vP.js";import{I as O}from"./input-C1uF2dQ1.js";import{i as H}from"./Monitor01-CaJkUXyc.js";import{n as M,a as Q}from"./Sun-BvgQbAIe.js";import{i as W}from"./Play-DSjj50Z1.js";import{u as X}from"./use-debounced-autosave-Hw4VW15I.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-DZqx_Cnp.js";import{c as te,b as A,S as E,a as F}from"./settings-section-B4a4SAqB.js";import"./sidebar-Cy5GVw74.js";import"./LayoutLeft-DQOl0C9j.js";import"./use-mobile-BD2-gXK-.js";import"./sheet-DW12PvFQ.js";import"./X-BZf8Ua-f.js";import"./tooltip-DW1HpudV.js";import"./User01-BPjc8LiD.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronDown-CpzTl0cf.js";import"./card-ChgC15JC.js";import"./ArrowUpRight-7XR-z7Ge.js";function se(){const e=V.c(19),{data:s,isPending:o}=D.useSession(),v=s?.user,p=v?.image,h=v?.name??"";let S;e[0]!==h?(S={values:{name:h}},e[0]=h,e[1]=S):S=e[1];const n=R(S);let _;e[2]!==n?(_={save:async()=>{const g=n.control._formState.dirtyFields;if(Object.keys(g).length===0)return;const a=n.getValues(),f=n.control._defaultValues;n.reset(a,{keepValues:!0});try{await D.updateUser({name:a.name}),N("profile_updated",{fields:["name"]}),T.success("Profile updated successfully")}catch{n.reset(f,{keepValues:!0}),T.error("Failed to update profile")}}},e[2]=n,e[3]=_):_=e[3];const{schedule:x,flush:m}=X(_);if(o)return null;const j=v?.name??"U";let i;e[4]!==j||e[5]!==p?(i=t.jsx(A,{title:"Avatar",action:t.jsx(U,{url:p,fallback:j,shape:"circle",size:"base"})}),e[4]=j,e[5]=p,e[6]=i):i=e[6];let l;e[7]!==m||e[8]!==x?(l=g=>{const{field:a}=g;return t.jsx(O,{id:"display-name",...a,onChange:f=>{a.onChange(f),x()},onBlur:()=>{a.onBlur(),m()},onKeyDown:f=>{f.key==="Enter"&&m()},placeholder:"Your name",className:"w-[280px]"})},e[7]=m,e[8]=x,e[9]=l):l=e[9];let d;e[10]!==n.control||e[11]!==l?(d=t.jsx(A,{title:"Display name",action:t.jsx(q,{control:n.control,name:"name",render:l})}),e[10]=n.control,e[11]=l,e[12]=d):d=e[12];const b=v?.email;let r;e[13]!==b?(r=t.jsx(A,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:b})}),e[13]=b,e[14]=r):r=e[14];let u;return e[15]!==i||e[16]!==d||e[17]!==r?(u=t.jsx(E,{children:t.jsxs(F,{children:[i,d,r]})}),e[15]=i,e[16]=d,e[17]=r,e[18]=u):u=e[18],u}function oe(){const e=V.c(48),[s,o]=B();let v;e[0]!==o?(v=async c=>{if(c&&await Notification.requestPermission()!=="granted"){N("preferences_notifications_permission_denied"),T.error("Notifications denied. Please enable them in your browser settings."),o(re);return}N("preferences_notifications_toggled",{enabled:c}),o(y=>({...y,enableNotifications:c}))},e[0]=o,e[1]=v):v=e[1];const p=v;let h;e[2]!==o?(h=c=>{c&&(N("preferences_theme_changed",{to_value:c}),o(y=>({...y,theme:c})))},e[2]=o,e[3]=h):h=e[3];let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(z,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=S):S=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(z,{value:"dark","aria-label":"Dark theme",children:t.jsx(Q,{size:14})}),e[5]=n):n=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(z,{value:"system","aria-label":"System theme",children:t.jsx(H,{size:14})}),e[6]=_):_=e[6];let x;e[7]!==s.theme||e[8]!==h?(x=t.jsx(A,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:s.theme,onValueChange:h,children:[S,n,_]})}),e[7]=s.theme,e[8]=h,e[9]=x):x=e[9];let m;e[10]!==p||e[11]!==s.enableNotifications?(m=typeof Notification<"u"?()=>p(!s.enableNotifications):void 0,e[10]=p,e[11]=s.enableNotifications,e[12]=m):m=e[12];let j;e[13]!==p||e[14]!==s.enableNotifications?(j=t.jsx(I,{disabled:typeof Notification>"u",checked:s.enableNotifications,onCheckedChange:p}),e[13]=p,e[14]=s.enableNotifications,e[15]=j):j=e[15];let i;e[16]!==m||e[17]!==j?(i=t.jsx(A,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:m,action:j}),e[16]=m,e[17]=j,e[18]=i):i=e[18];let l;e[19]!==s.enableSounds||e[20]!==o?(l=()=>{N("preferences_sounds_toggled",{enabled:!s.enableSounds}),o(le)},e[19]=s.enableSounds,e[20]=o,e[21]=l):l=e[21];let d;e[22]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:ne,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=d):d=e[22];let b;e[23]!==o?(b=c=>{N("preferences_sounds_toggled",{enabled:c}),o(y=>({...y,enableSounds:c}))},e[23]=o,e[24]=b):b=e[24];let r;e[25]!==s.enableSounds||e[26]!==b?(r=t.jsxs("div",{className:"flex items-center gap-2",children:[d,t.jsx(I,{checked:s.enableSounds,onCheckedChange:b})]}),e[25]=s.enableSounds,e[26]=b,e[27]=r):r=e[27];let u;e[28]!==r||e[29]!==l?(u=t.jsx(A,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:l,action:r}),e[28]=r,e[29]=l,e[30]=u):u=e[30];let g;e[31]!==o?(g=c=>{N("preferences_tool_approval_changed",{to_value:c}),o(y=>({...y,toolApprovalLevel:c}))},e[31]=o,e[32]=g):g=e[32];let a;e[33]!==s.toolApprovalLevel?(a={readonly:"Ask before edit",auto:"Auto approve"}[s.toolApprovalLevel]??"Ask before edit",e[33]=s.toolApprovalLevel,e[34]=a):a=e[34];let f;e[35]!==a?(f=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:a})}),e[35]=a,e[36]=f):f=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx($,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=C):C=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(J,{children:[C,t.jsx($,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let P;e[39]!==s.toolApprovalLevel||e[40]!==g||e[41]!==f?(P=t.jsx(A,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(G,{value:s.toolApprovalLevel,onValueChange:g,children:[f,k]})}),e[39]=s.toolApprovalLevel,e[40]=g,e[41]=f,e[42]=P):P=e[42];let w;return e[43]!==u||e[44]!==P||e[45]!==x||e[46]!==i?(w=t.jsx(E,{title:"Preferences",children:t.jsxs(F,{children:[x,i,u,P]})}),e[43]=u,e[44]=P,e[45]=x,e[46]=i,e[47]=w):w=e[47],w}function ne(){N("preferences_sounds_previewed"),Z(ee.dataUri).catch(ie)}function ie(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function re(e){return{...e,enableNotifications:!1}}function ae(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Body,{children:t.jsxs(te,{children:[t.jsx(L.Title,{children:"Profile & Preferences"}),t.jsx(se,{}),t.jsx(oe,{})]})})})}),e[0]=s):s=e[0],s}function De(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(ae,{}),e[0]=s):s=e[0],s}export{De as default};
1
+ import{c as V,j as t,a as D,p as R,af as q,J as B,w as N,t as T}from"./index-DJ-0yJzO.js";import{P as L}from"./index-hIyA29hR.js";import{A as U}from"./avatar-CCs3cbGI.js";import{S as I}from"./switch-COQDKJ_b.js";import{d as G,b as Y,a as $,S as J}from"./select-P94u0CJo.js";import{T as K,a as z}from"./toggle-group-BO6v5tfG.js";import{I as O}from"./input-C2eR67CX.js";import{i as H}from"./Monitor01-JBmV730I.js";import{n as M,a as Q}from"./Sun-BHlOvrTC.js";import{i as W}from"./Play-DUpdkISP.js";import{u as X}from"./use-debounced-autosave-CtylY127.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-BsT-8SKh.js";import{c as te,b as A,S as E,a as F}from"./settings-section-BOi1IsyE.js";import"./sidebar-V0fgYf5d.js";import"./LayoutLeft-CB8DIaei.js";import"./use-mobile-LV4GsbgX.js";import"./sheet-DBbd3xZ9.js";import"./X-BXn2_vYM.js";import"./tooltip-4wDbnU57.js";import"./User01-y8ntusMn.js";import"./ChevronUp-CSnIUHk6.js";import"./ChevronDown-BJhXIK-P.js";import"./card-KfNIoaPf.js";import"./ArrowUpRight-CGiD8vy5.js";function se(){const e=V.c(19),{data:s,isPending:o}=D.useSession(),v=s?.user,p=v?.image,h=v?.name??"";let S;e[0]!==h?(S={values:{name:h}},e[0]=h,e[1]=S):S=e[1];const n=R(S);let _;e[2]!==n?(_={save:async()=>{const g=n.control._formState.dirtyFields;if(Object.keys(g).length===0)return;const a=n.getValues(),f=n.control._defaultValues;n.reset(a,{keepValues:!0});try{await D.updateUser({name:a.name}),N("profile_updated",{fields:["name"]}),T.success("Profile updated successfully")}catch{n.reset(f,{keepValues:!0}),T.error("Failed to update profile")}}},e[2]=n,e[3]=_):_=e[3];const{schedule:x,flush:m}=X(_);if(o)return null;const j=v?.name??"U";let i;e[4]!==j||e[5]!==p?(i=t.jsx(A,{title:"Avatar",action:t.jsx(U,{url:p,fallback:j,shape:"circle",size:"base"})}),e[4]=j,e[5]=p,e[6]=i):i=e[6];let l;e[7]!==m||e[8]!==x?(l=g=>{const{field:a}=g;return t.jsx(O,{id:"display-name",...a,onChange:f=>{a.onChange(f),x()},onBlur:()=>{a.onBlur(),m()},onKeyDown:f=>{f.key==="Enter"&&m()},placeholder:"Your name",className:"w-[280px]"})},e[7]=m,e[8]=x,e[9]=l):l=e[9];let d;e[10]!==n.control||e[11]!==l?(d=t.jsx(A,{title:"Display name",action:t.jsx(q,{control:n.control,name:"name",render:l})}),e[10]=n.control,e[11]=l,e[12]=d):d=e[12];const b=v?.email;let r;e[13]!==b?(r=t.jsx(A,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:b})}),e[13]=b,e[14]=r):r=e[14];let u;return e[15]!==i||e[16]!==d||e[17]!==r?(u=t.jsx(E,{children:t.jsxs(F,{children:[i,d,r]})}),e[15]=i,e[16]=d,e[17]=r,e[18]=u):u=e[18],u}function oe(){const e=V.c(48),[s,o]=B();let v;e[0]!==o?(v=async c=>{if(c&&await Notification.requestPermission()!=="granted"){N("preferences_notifications_permission_denied"),T.error("Notifications denied. Please enable them in your browser settings."),o(re);return}N("preferences_notifications_toggled",{enabled:c}),o(y=>({...y,enableNotifications:c}))},e[0]=o,e[1]=v):v=e[1];const p=v;let h;e[2]!==o?(h=c=>{c&&(N("preferences_theme_changed",{to_value:c}),o(y=>({...y,theme:c})))},e[2]=o,e[3]=h):h=e[3];let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(z,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=S):S=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(z,{value:"dark","aria-label":"Dark theme",children:t.jsx(Q,{size:14})}),e[5]=n):n=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(z,{value:"system","aria-label":"System theme",children:t.jsx(H,{size:14})}),e[6]=_):_=e[6];let x;e[7]!==s.theme||e[8]!==h?(x=t.jsx(A,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:s.theme,onValueChange:h,children:[S,n,_]})}),e[7]=s.theme,e[8]=h,e[9]=x):x=e[9];let m;e[10]!==p||e[11]!==s.enableNotifications?(m=typeof Notification<"u"?()=>p(!s.enableNotifications):void 0,e[10]=p,e[11]=s.enableNotifications,e[12]=m):m=e[12];let j;e[13]!==p||e[14]!==s.enableNotifications?(j=t.jsx(I,{disabled:typeof Notification>"u",checked:s.enableNotifications,onCheckedChange:p}),e[13]=p,e[14]=s.enableNotifications,e[15]=j):j=e[15];let i;e[16]!==m||e[17]!==j?(i=t.jsx(A,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:m,action:j}),e[16]=m,e[17]=j,e[18]=i):i=e[18];let l;e[19]!==s.enableSounds||e[20]!==o?(l=()=>{N("preferences_sounds_toggled",{enabled:!s.enableSounds}),o(le)},e[19]=s.enableSounds,e[20]=o,e[21]=l):l=e[21];let d;e[22]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:ne,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=d):d=e[22];let b;e[23]!==o?(b=c=>{N("preferences_sounds_toggled",{enabled:c}),o(y=>({...y,enableSounds:c}))},e[23]=o,e[24]=b):b=e[24];let r;e[25]!==s.enableSounds||e[26]!==b?(r=t.jsxs("div",{className:"flex items-center gap-2",children:[d,t.jsx(I,{checked:s.enableSounds,onCheckedChange:b})]}),e[25]=s.enableSounds,e[26]=b,e[27]=r):r=e[27];let u;e[28]!==r||e[29]!==l?(u=t.jsx(A,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:l,action:r}),e[28]=r,e[29]=l,e[30]=u):u=e[30];let g;e[31]!==o?(g=c=>{N("preferences_tool_approval_changed",{to_value:c}),o(y=>({...y,toolApprovalLevel:c}))},e[31]=o,e[32]=g):g=e[32];let a;e[33]!==s.toolApprovalLevel?(a={readonly:"Ask before edit",auto:"Auto approve"}[s.toolApprovalLevel]??"Ask before edit",e[33]=s.toolApprovalLevel,e[34]=a):a=e[34];let f;e[35]!==a?(f=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:a})}),e[35]=a,e[36]=f):f=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx($,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=C):C=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(J,{children:[C,t.jsx($,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let P;e[39]!==s.toolApprovalLevel||e[40]!==g||e[41]!==f?(P=t.jsx(A,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(G,{value:s.toolApprovalLevel,onValueChange:g,children:[f,k]})}),e[39]=s.toolApprovalLevel,e[40]=g,e[41]=f,e[42]=P):P=e[42];let w;return e[43]!==u||e[44]!==P||e[45]!==x||e[46]!==i?(w=t.jsx(E,{title:"Preferences",children:t.jsxs(F,{children:[x,i,u,P]})}),e[43]=u,e[44]=P,e[45]=x,e[46]=i,e[47]=w):w=e[47],w}function ne(){N("preferences_sounds_previewed"),Z(ee.dataUri).catch(ie)}function ie(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function re(e){return{...e,enableNotifications:!1}}function ae(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Body,{children:t.jsxs(te,{children:[t.jsx(L.Title,{children:"Profile & Preferences"}),t.jsx(se,{}),t.jsx(oe,{})]})})})}),e[0]=s):s=e[0],s}function De(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(ae,{}),e[0]=s):s=e[0],s}export{De as default};