decocms 3.21.1 → 3.21.2

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 (230) hide show
  1. package/dist/client/assets/{AlertCircle-Di-V3umI.js → AlertCircle-GyiOEtAj.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-C-T2gJLi.js → ArrowUpRight-DlUPHWCe.js} +1 -1
  3. package/dist/client/assets/{Check-BNom5dOo.js → Check-COv5M0lh.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-DrDyiPu_.js → CheckCircle-ChsHFiFQ.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-B21_IsL3.js → ChevronDown-BdEaOOXp.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-Ctye75GL.js → ChevronLeft-B8kAn6JD.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-GBMV5yJO.js → ChevronRight-o4nZK4mj.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CGGIgndb.js → ChevronUp-y4zusQsp.js} +1 -1
  9. package/dist/client/assets/{Container-BowdgJ62.js → Container-CqLkbSjr.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-C1UpLbMK.js → DotsVertical-W4F6Fa4e.js} +1 -1
  11. package/dist/client/assets/{Eye-CCL1jvke.js → Eye-f801Ko_Z.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CLU1cvnm.js → FilterLines-CdYz7NJH.js} +1 -1
  13. package/dist/client/assets/{Globe01-Ca2CDUqL.js → Globe01-BfG_Acce.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BRJbxTgf.js → HardDrive-D9UXv7dX.js} +1 -1
  15. package/dist/client/assets/{Key01-B0KHYY9A.js → Key01-B5dV9ECL.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DQjoJnlv.js → LayoutLeft-B60p8Um4.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BmWxPEFc.js → LinkExternal01-6cFTncDa.js} +1 -1
  18. package/dist/client/assets/{Monitor01-CCpw9YsU.js → Monitor01-Cc4WDpkR.js} +1 -1
  19. package/dist/client/assets/{Palette-DljqRkOL.js → Palette--vnxJff4.js} +1 -1
  20. package/dist/client/assets/{Play-BWZ7aOd4.js → Play-C7HtzLaD.js} +1 -1
  21. package/dist/client/assets/{Plus-BW-TIinL.js → Plus-LwySGDxB.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DoQ2Q5nQ.js → RefreshCcw01-CqQ0_ss_.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BrE4Lp2d.js → SearchMd-MshnFe0l.js} +1 -1
  24. package/dist/client/assets/{Settings02-CnuG-oH5.js → Settings02-StPTnFMx.js} +1 -1
  25. package/dist/client/assets/{Shield01-BAt9OJkk.js → Shield01-T0cQG3gR.js} +1 -1
  26. package/dist/client/assets/{Star01-f8rMlJ5U.js → Star01-DBs_rPC7.js} +1 -1
  27. package/dist/client/assets/{Stars01-GUKoSsGN.js → Stars01-DHlDpyBS.js} +1 -1
  28. package/dist/client/assets/{Stars02-DApbfWB6.js → Stars02-B2A2nE0X.js} +1 -1
  29. package/dist/client/assets/{Sun-BupjfBtR.js → Sun-Deye0C8A.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CBvA0yYX.js → SwitchHorizontal01-CXh2-ORd.js} +1 -1
  31. package/dist/client/assets/{Tool01-BGucVzDk.js → Tool01-nSGgZsVX.js} +1 -1
  32. package/dist/client/assets/{Trash01-DOwZGPnm.js → Trash01-DZfkybKU.js} +1 -1
  33. package/dist/client/assets/{Upload01-ypYRbiXm.js → Upload01-rVUdt3iJ.js} +1 -1
  34. package/dist/client/assets/{User01-iRKM2KTq.js → User01-NlAzTddi.js} +1 -1
  35. package/dist/client/assets/{Users01-CQjxMYXj.js → Users01-DaydqXQC.js} +1 -1
  36. package/dist/client/assets/{Users03-Gpc8Fhl9.js → Users03-BRSJ5vR7.js} +1 -1
  37. package/dist/client/assets/{X-D2-T6h59.js → X-BN3arG6T.js} +1 -1
  38. package/dist/client/assets/{XCircle-BD7UyEOF.js → XCircle-xmKSYZKr.js} +1 -1
  39. package/dist/client/assets/{XClose-qC7X4hjJ.js → XClose-1qd9ainB.js} +1 -1
  40. package/dist/client/assets/{Zap-BxPmO3d7.js → Zap-CYUIBMS-.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DMyX_8RQ.js → ZapSquare-DsZrIKGl.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CrNlxKNu.js → ZoomOut-CVKSaoni.js} +1 -1
  43. package/dist/client/assets/{access-gate-BxaFZysE.js → access-gate-CweS51cI.js} +1 -1
  44. package/dist/client/assets/{accordion-DBdAn4Yd.js → accordion-Bl7Yi6C4.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-Cp9ANpKI.js → add-section-modal-uFfZJI5Z.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-DZnx6uxN.js → agent-capabilities-D2XTyDA4.js} +1 -1
  47. package/dist/client/assets/{agent-icon-DwlI421o.js → agent-icon-K7-2Vanq.js} +1 -1
  48. package/dist/client/assets/{agent-icons-BpY_PoEJ.js → agent-icons-CeKYocvB.js} +1 -1
  49. package/dist/client/assets/{agents-list-7MDTRjEP.js → agents-list-SW53IbcR.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DCVu5rlW.js → ai-providers-CRMVj1sW.js} +1 -1
  51. package/dist/client/assets/{alert-9Uyq7_Yx.js → alert-CyRuR44t.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-Di87pvaw.js → alert-dialog-CJQaL6p3.js} +1 -1
  53. package/dist/client/assets/app-editor-DrKlBV5m.js +1 -0
  54. package/dist/client/assets/{auth-catchall-6sVJF5kF.js → auth-catchall-C0LPYH9l.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BB9gPhYr.js → auth-split-layout-B0BicaKX.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-CeYc1MAT.js → automation-list-row-DO-WP7Ai.js} +1 -1
  57. package/dist/client/assets/{automation-runs-bcYQjbYn.js → automation-runs-eraj829k.js} +1 -1
  58. package/dist/client/assets/{automations-OmisaDZA.js → automations-BVY79yPk.js} +1 -1
  59. package/dist/client/assets/{avatar-DpEGkmVF.js → avatar-BdxyYnNK.js} +1 -1
  60. package/dist/client/assets/{badge-CRBv_-v0.js → badge-CS2sZUxN.js} +1 -1
  61. package/dist/client/assets/{brand-context-BHMKdNZS.js → brand-context-CjWlWxwt.js} +1 -1
  62. package/dist/client/assets/{buckets-DdExZ8vz.js → buckets-BGHRc7Um.js} +1 -1
  63. package/dist/client/assets/{calendar-04oidYi0.js → calendar-DczL_N_A.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DQKXVSLb.js → capability-load-error-DNJuBq-F.js} +1 -1
  65. package/dist/client/assets/{card-DjCUI9mK.js → card-Br94nOKg.js} +1 -1
  66. package/dist/client/assets/{chat-context-DCjkCe-V.js → chat-context-DA35HLXS.js} +1 -1
  67. package/dist/client/assets/{checkbox-C0J6d59Z.js → checkbox-CqOCOG6Q.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-GR8P7inl.js → cli-auth-success-BVqxZix5.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BLTHo14O.js → collection-detail-CynKMc1R.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-vdVt1x-Y.js → collection-display-button-Cv9SNAbw.js} +1 -1
  71. package/dist/client/assets/{collection-search-C9e8ytlm.js → collection-search-ChKSSxmH.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-Ci3rF5jl.js → collection-table-wrapper-DGk9I-x6.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-DcsnhXJW.js → collection-tabs-C5s6I9ON.js} +1 -1
  74. package/dist/client/assets/{collections-CFguVIuY.js → collections-Dk6dLEYA.js} +1 -1
  75. package/dist/client/assets/{command-CHlhuzJ_.js → command-BS0mokMv.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-BSK9XSHH.js → connect-desktop-dialog-DpF_sI6h.js} +1 -1
  77. package/dist/client/assets/{connection-card-DO9d3YRC.js → connection-card-CFu6MAht.js} +1 -1
  78. package/dist/client/assets/{connection-detail-SHOkB3xQ.js → connection-detail-Bavv4Ydp.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-C3edNmoP.js → connection-form-helpers-C3EFMKqC.js} +1 -1
  80. package/dist/client/assets/{connections-qKkqyM04.js → connections-BTIddADu.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-BN3Fz4g5.js → decopilot-sse-pool-CZFgZ3nE.js} +1 -1
  82. package/dist/client/assets/{dialog-fdhgLhBf.js → dialog-CL1BseA9.js} +1 -1
  83. package/dist/client/assets/{domain-settings-DGN8lQXh.js → domain-settings-BnveJoGD.js} +1 -1
  84. package/dist/client/assets/{drawer-nppIIpnE.js → drawer-C9J2FQkF.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-X3z-hQ2M.js → dropdown-menu-DVje-EoW.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-DIHhoFb_.js → dynamic-plugin-layout-WHfaSv1Y.js} +1 -1
  87. package/dist/client/assets/{empty-state-Bq6HhNrq.js → empty-state-Bv1Z9MXv.js} +1 -1
  88. package/dist/client/assets/{empty-state-CQXcLTIH.js → empty-state-DpAFEVjw.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-D6z7oijb.js → extract-connection-data-CrV9u96Z.js} +1 -1
  90. package/dist/client/assets/{features-G1sVG-es.js → features-BEAGHXsv.js} +1 -1
  91. package/dist/client/assets/{file-explorer-DXIRGCbx.js → file-explorer-BwsVi5Sn.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-B0iXSarG.js → file-type-icon-DVYPih9c.js} +1 -1
  93. package/dist/client/assets/{files-BBuiWUw0.js → files-10ME_3JG.js} +1 -1
  94. package/dist/client/assets/{form-l2US6lAY.js → form-4UXcNbUg.js} +1 -1
  95. package/dist/client/assets/{general-Che5cJxu.js → general-CWwyMwhB.js} +1 -1
  96. package/dist/client/assets/{generate-id-RYRfDJEO.js → generate-id-CVdT0fIQ.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-Bt39LytD.js → github-repo-picker-DD8wItvg.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-D5FVHg7C.js → header-tab-button-DgECRSSy.js} +1 -1
  99. package/dist/client/assets/{hover-card-CrD42WSD.js → hover-card-BA4UtY_2.js} +1 -1
  100. package/dist/client/assets/{image-field-DmZve0TW.js → image-field-U7AFL_og.js} +1 -1
  101. package/dist/client/assets/{index-BmZqEyVY.js → index-4cfzvyaB.js} +1 -1
  102. package/dist/client/assets/{index-DwykyBcY.js → index-BBFvsGUO.js} +1 -1
  103. package/dist/client/assets/{index-Cm05rD4S.js → index-BK7hwLt0.js} +1 -1
  104. package/dist/client/assets/{index-DeDtw-b1.js → index-BKKTxT9B.js} +1 -1
  105. package/dist/client/assets/{index-BOMHJPUn.js → index-BQ89iNpK.js} +1 -1
  106. package/dist/client/assets/{index-D-CqRT4O.js → index-BQoodOft.js} +1 -1
  107. package/dist/client/assets/{index-BUe0rEg1.js → index-CAfQQdyv.js} +1 -1
  108. package/dist/client/assets/{index-BYXBOiLY.js → index-COXkGBKF.js} +1 -1
  109. package/dist/client/assets/{index-Bu_CNCUZ.js → index-CuZbHxuM.js} +1 -1
  110. package/dist/client/assets/{index-D6idVW2n.js → index-DC5ykVbq.js} +3 -3
  111. package/dist/client/assets/{index-DWvdSxPM.js → index-DD8pNQTz.js} +1 -1
  112. package/dist/client/assets/{index-Doc3AWor.js → index-DYMkejmQ.js} +1 -1
  113. package/dist/client/assets/{index-CwDq8vs6.js → index-DinTmsRi.js} +4 -4
  114. package/dist/client/assets/{index-Cw0f814h.js → index-DsK69xEH.js} +1 -1
  115. package/dist/client/assets/{index-C5tgiUEv.js → index-_z9AfqD0.js} +1 -1
  116. package/dist/client/assets/{index-redirect-BqoA6RVo.js → index-redirect-BYXba1LQ.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-VyVFnsqY.js → infiniteQueryObserver-BFBhoWbn.js} +1 -1
  118. package/dist/client/assets/{input-ChQ639sE.js → input-CmdQXS7m.js} +1 -1
  119. package/dist/client/assets/{integration-icon-b2Rlb-Sb.js → integration-icon-DubrPseB.js} +1 -1
  120. package/dist/client/assets/{label-rvaNBf1n.js → label-BeKFq4Z_.js} +1 -1
  121. package/dist/client/assets/{layout-DmZgycrJ.js → layout-8ZlqaeBv.js} +1 -1
  122. package/dist/client/assets/{login-DFkji89I.js → login-Xkc831VM.js} +1 -1
  123. package/dist/client/assets/{members-Bm9cIL-1.js → members-8soouHex.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-B2W8v7r6.js → monaco-editor-B-nbM8Ue.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-DdYAhJ5V.js → monitoring-stats-row-pLl4ltj8.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-CKDYX_RF.js → oauth-callback-ai-provider-DgTV983m.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-C9xoFbd7.js → oauth-callback-m-HDC-da.js} +1 -1
  128. package/dist/client/assets/{onboarding-CzS2cVPB.js → onboarding-CJD62kRn.js} +1 -1
  129. package/dist/client/assets/{org-install-BaqJ9XwL.js → org-install-rd8eLbo7.js} +1 -1
  130. package/dist/client/assets/{org-layout-S59SENMd.js → org-layout-DeIWaN_p.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-CqsI9Bed.js → org-plugin-layout-LtGGGoMB.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-EuEyknEc.js → page-seo-form-BkwbUlnR.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-j1sLOOHG.js +1 -0
  134. package/dist/client/assets/{pair-Bt2SA9Qp.js → pair-DE0D0Wie.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-DSQFLxwe.js → plugin-empty-state-CyD0C1Bf.js} +1 -1
  136. package/dist/client/assets/{plugin-header-DMRgUsQl.js → plugin-header-W1I2_V_j.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-TXD29kdN.js → plugin-layout-B4yAz-3-.js} +1 -1
  138. package/dist/client/assets/{popover-Rt3fpbO3.js → popover-Dp3QS8N6.js} +1 -1
  139. package/dist/client/assets/{post-editor-Divs3dwJ.js → post-editor-DR83fZSH.js} +1 -1
  140. package/dist/client/assets/{primitives-XpLpFjB8.js → primitives-iMjdQad6.js} +1 -1
  141. package/dist/client/assets/{profile-CHjI4ygW.js → profile-eau3k4Po.js} +1 -1
  142. package/dist/client/assets/{project-app-view-DHaXTs5T.js → project-app-view-CRvOiu2b.js} +1 -1
  143. package/dist/client/assets/record-editor-B-ZWb752.js +1 -0
  144. package/dist/client/assets/registry-B8CD131L.js +2 -0
  145. package/dist/client/assets/{registry-layout-C7DwnK5e.js → registry-layout-BmSXJxoZ.js} +1 -1
  146. package/dist/client/assets/{require-capability-B4l3wBea.js → require-capability-bCqnmJfy.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-CfzfhqYN.js → required-auth-layout-D7jgv78c.js} +1 -1
  148. package/dist/client/assets/{reset-password-BZ5l6irC.js → reset-password-D28fxRQV.js} +1 -1
  149. package/dist/client/assets/{resizable-CA7mW65R.js → resizable-Cd48I16F.js} +1 -1
  150. package/dist/client/assets/{roles-6C_YTupk.js → roles-gGKNgLrN.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-BX18LfXg.js +1 -0
  152. package/dist/client/assets/{save-status-KIo_EK3u.js → save-status-B5l1r2yt.js} +1 -1
  153. package/dist/client/assets/{schema-form-0q7FWymW.js → schema-form-DoBelrVG.js} +1 -1
  154. package/dist/client/assets/{scroll-area-S5xU4-3T.js → scroll-area-P07qVNiz.js} +1 -1
  155. package/dist/client/assets/{search-input-bjsIuW3e.js → search-input-BC00SFbU.js} +1 -1
  156. package/dist/client/assets/{secrets-oJC26E57.js → secrets-C14kJLTf.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BJkalQrn.js → sections-editor-BXkiyOGf.js} +1 -1
  158. package/dist/client/assets/{select-model-BfrrA0rU.js → select-model-D5qi4yVr.js} +1 -1
  159. package/dist/client/assets/{select-D-XBS65u.js → select-n15H_mpn.js} +1 -1
  160. package/dist/client/assets/{seo-editor-DQqMio2v.js → seo-editor-D-F0mviD.js} +1 -1
  161. package/dist/client/assets/{settings-layout-mMyfgzSB.js → settings-layout-pqyPhxP-.js} +1 -1
  162. package/dist/client/assets/{settings-section-DOJ8w47S.js → settings-section-Tanq8jyR.js} +1 -1
  163. package/dist/client/assets/{sheet-BdF_K2dB.js → sheet-D4rfwRUO.js} +1 -1
  164. package/dist/client/assets/{shell-controls-BDGVwZm0.js → shell-controls-mDSWSVmf.js} +1 -1
  165. package/dist/client/assets/{shell-layout-652GQgyj.js → shell-layout-BwqpmibN.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-DWdfT9on.js → shell-route-loading-BcS4ogVM.js} +1 -1
  167. package/dist/client/assets/{sidebar-faIWOpU7.js → sidebar-BROkYxtG.js} +1 -1
  168. package/dist/client/assets/{skeleton-CrWdoD9s.js → skeleton-DWOWMile.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-DaLbqREa.js → sortable.esm-QhdKIQMp.js} +1 -1
  170. package/dist/client/assets/{spinner-Ba6MQmcV.js → spinner-CtVtBijD.js} +1 -1
  171. package/dist/client/assets/{sso-BtgDVu5D.js → sso-iKeLtq8V.js} +1 -1
  172. package/dist/client/assets/{store-De54zr2A.js → store-D_M-OYO8.js} +1 -1
  173. package/dist/client/assets/store-registry-DrWHKBnR.js +2 -0
  174. package/dist/client/assets/{switch-Djy20jDK.js → switch-QoxQ4Dp8.js} +1 -1
  175. package/dist/client/assets/{tab-id-DKNFO22m.js → tab-id-CNkO3hVN.js} +1 -1
  176. package/dist/client/assets/{table-Cy6WVAuu.js → table-BsrEIQdy.js} +1 -1
  177. package/dist/client/assets/{tabs-DI8qnoXf.js → tabs-kJyWL6V1.js} +1 -1
  178. package/dist/client/assets/{task-status-qWqGiUC6.js → task-status-j0388nBE.js} +1 -1
  179. package/dist/client/assets/{textarea-FwxJbyLj.js → textarea-IFOxZRFP.js} +1 -1
  180. package/dist/client/assets/{toggle-group-DLxiboB7.js → toggle-group--w1kOZWe.js} +1 -1
  181. package/dist/client/assets/{toolbar-CMgp-9VS.js → toolbar-BBxreRsk.js} +1 -1
  182. package/dist/client/assets/{tools-list-C_1FwcZ2.js → tools-list-DJXjW2l9.js} +1 -1
  183. package/dist/client/assets/{tooltip-BwAS3LmD.js → tooltip-D7cmoHaE.js} +1 -1
  184. package/dist/client/assets/{types-DpLGHfBV.js → types-BmGja53h.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-D_70D2KF.js → use-ai-providers--CmHEwAc.js} +1 -1
  186. package/dist/client/assets/{use-automations-Bm_GDiS0.js → use-automations-BuOkYpgz.js} +1 -1
  187. package/dist/client/assets/{use-capability-BTcvzwTt.js → use-capability-CxysHd_P.js} +1 -1
  188. package/dist/client/assets/{use-collections-B1ftgmsC.js → use-collections-BOfrARHt.js} +1 -1
  189. package/dist/client/assets/{use-connection-f6XTkb53.js → use-connection-n0123jPK.js} +1 -1
  190. package/dist/client/assets/{use-copy-N9ijygLT.js → use-copy-B0vwFN4z.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-DmpPKskK.js → use-create-virtual-mcp-D-CNGeek.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-ChNaRP5S.js → use-debounced-autosave-D2Tk122B.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-BwrylBgL.js → use-delete-connection-C4A0wxBY.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-Iu1ZGjUX.js → use-file-configs-CyyHbhaI.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-D4clS4iX.js → use-infinite-scroll-CdSYgiPG.js} +1 -1
  196. package/dist/client/assets/{use-list-state-BDMoY8GZ.js → use-list-state-eagOZcTM.js} +1 -1
  197. package/dist/client/assets/{use-mcp-client-Dutz6IKN.js → use-mcp-client-DyuH8eE6.js} +1 -1
  198. package/dist/client/assets/{use-mcp-prompts-DkrNbGZU.js → use-mcp-prompts-Bwn_S6iL.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-Dk5wX_Q8.js → use-mcp-tools-DC6ktQK8.js} +1 -1
  200. package/dist/client/assets/{use-members-73l6yAni.js → use-members-BzP8QLPf.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-QL4LtHJV.js → use-navigate-to-agent-B09CyGqp.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-CAvzSle5.js → use-org-auth-client-DHC5iDX4.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-C7T4CeXS.js → use-org-sso-qSbMZg_F.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-CzFjc3MW.js → use-organization-roles-SRzyOUnT.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-t-yCPHX9.js → use-organization-settings-B4dvDS7R.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-CZ4ax3LX.js → use-registry-connections-Bds9Ypgx.js} +1 -1
  207. package/dist/client/assets/{use-secrets-Dor672jC.js → use-secrets-CnpydoP_.js} +1 -1
  208. package/dist/client/assets/{use-status-sounds-J2lGW499.js → use-status-sounds-CK6N7rMv.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-EyZ_szat.js → use-view-mode-RCfU_Ov_.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-BW5609Gn.js → use-virtual-mcp-Dey3T-Qn.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-DMrx4YUI.js +1 -0
  212. package/dist/client/assets/{useRouterState-vIbEdlN4.js → useRouterState-Suijaaey.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-BEThz4gg.js +1 -0
  214. package/dist/client/assets/{user-CkUI6Rtf.js → user-CZuNKuKE.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-B0zSaOcF.js → view-mode-toggle-DB4LJ27d.js} +1 -1
  216. package/dist/client/assets/{workflow-CRNBsay_.js → workflow-DdHZO7TR.js} +1 -1
  217. package/dist/client/assets/workflow-detail-DelfG9w7.js +1 -0
  218. package/dist/client/index.html +1 -1
  219. package/dist/server/cli.js +15 -8
  220. package/dist/server/server.js +4 -4
  221. package/package.json +1 -1
  222. package/dist/client/assets/app-editor-BTJdqNFO.js +0 -1
  223. package/dist/client/assets/page-seo-sheet-IswGsmwS.js +0 -1
  224. package/dist/client/assets/record-editor-BVLo6guS.js +0 -1
  225. package/dist/client/assets/registry-BYK9j9rQ.js +0 -2
  226. package/dist/client/assets/save-referenced-block-DgXF7K9R.js +0 -1
  227. package/dist/client/assets/store-registry-BBl5JK8R.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-C4mxsTCl.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-B8vt_oPd.js +0 -1
  230. package/dist/client/assets/workflow-detail-DSkokxeb.js +0 -1
@@ -1 +1 @@
1
- import{e as K,j as t,b as me,l as Q,a as ne,r as F,n as he,K as pe,B as oe,c as H,o as de}from"./index-D6idVW2n.js";import{R as xe}from"./required-auth-layout-CfzfhqYN.js";import{A as Y}from"./auth-split-layout-BB9gPhYr.js";import{A as ee}from"./avatar-DpEGkmVF.js";import{I as be}from"./input-ChQ639sE.js";import{L as je}from"./label-rvaNBf1n.js";import{S as ye}from"./switch-Djy20jDK.js";import{t as Ne,a as ve}from"./Users03-Gpc8Fhl9.js";import{i as we}from"./CheckCircle-DrDyiPu_.js";import{t as Se,a as ke}from"./Palette-DljqRkOL.js";import{i as ze}from"./Upload01-ypYRbiXm.js";import"./useRouterState-vIbEdlN4.js";import"./User01-iRKM2KTq.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 le(r){return r.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function He(){const r=K.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(_e,{})}),r[0]=e):e=r[0],e}function te(r){const e=K.c(13),{title:g,description:l,logoUrl:f,logoFallback:s}=r;let a;e[0]!==s||e[1]!==f?(a=t.jsx("div",{children:f?t.jsx(ee,{url:f,fallback:s??"?",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]=s,e[1]=f,e[2]=a):a=e[2];let i;e[3]!==g?(i=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=i):i=e[4];let o;e[5]!==l?(o=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:l}),e[5]=l,e[6]=o):o=e[6];let h;e[7]!==i||e[8]!==o?(h=t.jsxs("div",{className:"space-y-2",children:[i,o]}),e[7]=i,e[8]=o,e[9]=h):h=e[9];let n;return e[10]!==a||e[11]!==h?(n=t.jsxs("div",{className:"grid gap-10",children:[a,h]}),e[10]=a,e[11]=h,e[12]=n):n=e[12],n}function _e(){const r=K.c(4),{data:e,isPending:g}=me.useSession();if(g){let a;return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Y,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"})})}),r[0]=a):a=r[0],a}const l=e?.user?.email??"",f=e?.user?.name;let s;return r[1]!==f||r[2]!==l?(s=t.jsx(Oe,{email:l,userName:f}),r[1]=f,r[2]=l,r[3]=s):s=r[3],s}function Oe(r){const e=K.c(70),{email:g,userName:l}=r;let f,s,a,i,o,h;if(e[0]!==g||e[1]!==l){a=g.split("@")[1]?.toLowerCase()??"",i=!!a&&!Ce.has(a);const m=a.split(".")[0]??"";s=m.charAt(0).toUpperCase()+m.slice(1);let x;e[8]!==s||e[9]!==i||e[10]!==l?(x=i?s:l?.split(" ")[0]??"",e[8]=s,e[9]=i,e[10]=l,e[11]=x):x=e[11],f=x,h=he,o=pe.domainLookup(a),e[0]=g,e[1]=l,e[2]=f,e[3]=s,e[4]=a,e[5]=i,e[6]=o,e[7]=h}else f=e[2],s=e[3],a=e[4],i=e[5],o=e[6],h=e[7];let n;e[12]!==i||e[13]!==o?(n={queryKey:o,queryFn:Ae,enabled:i},e[12]=i,e[13]=o,e[14]=n):n=e[14];const{data:v,isLoading:d}=h(n);let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k={mutationFn:Pe},e[15]=k):k=e[15];const c=ne(k),[D,P]=F.useState(!1);if(d){let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=m):m=e[16];let x;return e[17]!==a?(x=t.jsx(Y,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[m,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=x):x=e[18],x}let E,y,z;if(e[19]!==D||e[20]!==s||e[21]!==v?.organizations||e[22]!==a||e[23]!==i||e[24]!==c||e[25]!==l){z=Symbol.for("react.early_return_sentinel");e:{y=v?.organizations??[];const m=y.filter(Ee);E=y.length>0;const x=m.length>0,N=c.variables??null;if(D){let u;e[29]!==l?(u=l?.split(" ")[0]??"",e[29]=l,e[30]=u):u=e[30];let b;e[31]===Symbol.for("react.memo_cache_sentinel")?(b=()=>P(!1),e[31]=b):b=e[31];let p;e[32]!==s||e[33]!==a||e[34]!==i||e[35]!==u?(p=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:u,allowDomainClaim:!1,onBack:b}),e[32]=s,e[33]=a,e[34]=i,e[35]=u,e[36]=p):p=e[36],z=p;break e}if(x){const u=m.length===1?"You have access to an organization":"You have access to multiple organizations",b=m.length===1?"Your email domain matches an existing organization.":"Your email domain matches more than one. Pick one to join.";let p;e[37]!==u||e[38]!==b?(p=t.jsx(te,{title:u,description:b}),e[37]=u,e[38]=b,e[39]=p):p=e[39];let w;e[40]!==a||e[41]!==c||e[42]!==N?(w=O=>{const G=c.isPending&&N===O.slug;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(ee,{url:O.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:O.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:O.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx(oe,{size:"default",onClick:()=>c.mutate(O.slug),disabled:c.isPending,children:G?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," ","Joining..."]}):"Join"})]},O.id)},e[40]=a,e[41]=c,e[42]=N,e[43]=w):w=e[43];const _=t.jsx("div",{className:"grid gap-2",children:m.map(w)});let S;e[44]!==c.error?(S=c.error&&t.jsx("p",{className:"text-xs text-destructive",children:c.error instanceof Error?c.error.message:"Failed to join organization"}),e[44]=c.error,e[45]=S):S=e[45];let $;e[46]===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:()=>P(!0),children:"Create a new organization instead"}),e[46]=$):$=e[46];let L;e[47]!==_||e[48]!==S||e[49]!==p?(L=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[p,_,S,$]})}),e[47]=_,e[48]=S,e[49]=p,e[50]=L):L=e[50],z=L;break e}}e[19]=D,e[20]=s,e[21]=v?.organizations,e[22]=a,e[23]=i,e[24]=c,e[25]=l,e[26]=E,e[27]=y,e[28]=z}else E=e[26],y=e[27],z=e[28];if(z!==Symbol.for("react.early_return_sentinel"))return z;if(E){const m=y.length===1?`${y[0].name} is already set up`:`${y.length} organizations use @${a}`,x=y.length===1?"This organization doesn't have auto-join enabled.":"None of them have auto-join enabled — ask an admin for an invitation, or create your own.";let N;e[51]!==m||e[52]!==x?(N=t.jsx(te,{title:m,description:x}),e[51]=m,e[52]=x,e[53]=N):N=e[53];let u;if(e[54]!==a||e[55]!==y){let _;e[57]!==a?(_=S=>t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:S.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,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}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Ask admin for invitation"})]},S.id),e[57]=a,e[58]=_):_=e[58],u=y.map(_),e[54]=a,e[55]=y,e[56]=u}else u=e[56];let b;e[59]!==u?(b=t.jsx("div",{className:"grid gap-2",children:u}),e[59]=u,e[60]=b):b=e[60];let p;e[61]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(oe,{size:"xl",className:"w-full",onClick:()=>P(!0),children:"Create a new organization"}),e[61]=p):p=e[61];let w;return e[62]!==b||e[63]!==N?(w=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[N,b,p]})}),e[62]=b,e[63]=N,e[64]=w):w=e[64],w}let A;return e[65]!==f||e[66]!==s||e[67]!==a||e[68]!==i?(A=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:f}),e[65]=f,e[66]=s,e[67]=a,e[68]=i,e[69]=A):A=e[69],A}function Ee(r){return r.autoJoinEnabled}async function Pe(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),g=await e.json();if(!e.ok||!g.success)throw new Error(g.error||"Failed to join organization");window.location.href=`/${g.slug}`}async function Ae(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function re(r){const e=K.c(70),{isCorporateEmail:g,emailDomain:l,domainLabel:f,defaultName:s,allowDomainClaim:a,onBack:i}=r,o=a===void 0?!0:a,h=g&&o?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null,[n,v]=F.useState(s),[d,k]=F.useState(h),[c,D]=F.useState(!0),[P,E]=F.useState(null);let y;e[0]!==c||e[1]!==d||e[2]!==n?(y=async()=>{const j=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n.trim()||void 0,logo:d??void 0,claimDomain:c})}),C=await j.json();if(!j.ok||!C.success)throw new Error(C.error||"Failed to set up organization");return C},e[0]=c,e[1]=d,e[2]=n,e[3]=y):y=e[3];let z;e[4]!==c?(z=j=>{if(!j.slug)return;const C=ue.filter(ge=>c||!ge.claimOnly).length,W=fe*(C-1)+800;E(j.slug),setTimeout(()=>{window.location.href=`/${j.slug}`},W)},e[4]=c,e[5]=z):z=e[5];let A;e[6]!==y||e[7]!==z?(A={mutationFn:y,onSuccess:z},e[6]=y,e[7]=z,e[8]=A):A=e[8];const m=ne(A);let x;e[9]!==d||e[10]!==n?(x={mutationFn:async()=>{const j=n.trim(),C=le(j);if(!C)throw new Error("Invalid organization name");const W=await me.organization.create({name:j,slug:C,...d?{logo:d}:{}});if(W?.error)throw new Error(W.error.message||"Failed to create organization");window.location.href=`/${W?.data?.slug??C}`}},e[9]=d,e[10]=n,e[11]=x):x=e[11];const N=ne(x);if(m.isPending||P){let j;e[12]!==f||e[13]!==n?(j=n.trim()||f,e[12]=f,e[13]=n,e[14]=j):j=e[14];let C;return e[15]!==c||e[16]!==l||e[17]!==d||e[18]!==j?(C=t.jsx(Y,{children:t.jsx(Fe,{orgName:j,domain:l,claimDomain:c,logoUrl:d})}),e[15]=c,e[16]=l,e[17]=d,e[18]=j,e[19]=C):C=e[19],C}const u=N.isPending;let b;e[20]!==n?(b=le(n.trim()),e[20]=n,e[21]=b):b=e[21];const p=!!b,w=m.error||N.error||null;let _;e[22]!==o||e[23]!==p||e[24]!==N||e[25]!==m||e[26]!==g?(_=j=>{j.preventDefault(),p&&(g&&o?m.mutate():N.mutate())},e[22]=o,e[23]=p,e[24]=N,e[25]=m,e[26]=g,e[27]=_):_=e[27];const S=_;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(te,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=$):$=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=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]=L):L=e[29];let O;e[30]!==s||e[31]!==n?(O=(n.trim()||s||"?").charAt(0).toUpperCase(),e[30]=s,e[31]=n,e[32]=O):O=e[32];const G=u||m.isPending;let R;e[33]!==d||e[34]!==O||e[35]!==G?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[L,t.jsx($e,{value:d,fallback:O,onChange:k,disabled:G})]}),e[33]=d,e[34]=O,e[35]=G,e[36]=R):R=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(je,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=V):V=e[37];let X;e[38]===Symbol.for("react.memo_cache_sentinel")?(X=j=>v(j.target.value),e[38]=X):X=e[38];const ae=s||"My Organization",se=u||m.isPending;let T;e[39]!==n||e[40]!==ae||e[41]!==se?(T=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[V,t.jsx(be,{id:"org-name",value:n,onChange:X,placeholder:ae,disabled:se,className:"h-10 max-w-[220px]"})]}),e[39]=n,e[40]=ae,e[41]=se,e[42]=T):T=e[42];let U;e[43]!==o||e[44]!==c||e[45]!==m.isPending||e[46]!==l||e[47]!==g||e[48]!==u?(U=g&&o&&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 @",l," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",l," email can join this org"]})]}),t.jsx(ye,{checked:c,onCheckedChange:D,disabled:u||m.isPending})]}),e[43]=o,e[44]=c,e[45]=m.isPending,e[46]=l,e[47]=g,e[48]=u,e[49]=U):U=e[49];let M;e[50]!==R||e[51]!==T||e[52]!==U?(M=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,T,U]}),e[50]=R,e[51]=T,e[52]=U,e[53]=M):M=e[53];let I;e[54]!==w?(I=w&&t.jsx("p",{className:"text-xs text-destructive",children:w instanceof Error?w.message:"Failed to create organization"}),e[54]=w,e[55]=I):I=e[55];const ie=!p||u||m.isPending;let J;e[56]!==m.isPending||e[57]!==u?(J=u||m.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=m.isPending,e[57]=u,e[58]=J):J=e[58];let q;e[59]!==ie||e[60]!==J?(q=t.jsx(oe,{type:"submit",size:"xl",className:"w-full",disabled:ie,children:J}),e[59]=ie,e[60]=J,e[61]=q):q=e[61];let B;e[62]!==i?(B=i&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:i,children:"See available organizations"}),e[62]=i,e[63]=B):B=e[63];let Z;return e[64]!==S||e[65]!==M||e[66]!==I||e[67]!==q||e[68]!==B?(Z=t.jsx(Y,{children:t.jsxs("form",{onSubmit:S,className:"grid gap-10",children:[$,M,I,q,B]})}),e[64]=S,e[65]=M,e[66]=I,e[67]=q,e[68]=B,e[69]=Z):Z=e[69],Z}function $e(r){const e=K.c(14),{value:g,fallback:l,onChange:f,disabled:s}=r,a=F.useRef(null);let i;e[0]!==f?(i=D=>{const P=D.target.files?.[0];if(!P)return;if(P.size>2097152){de.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const E=new FileReader;E.onerror=Le,E.onloadend=()=>{E.result&&f(E.result),a.current&&(a.current.value="")},E.readAsDataURL(P)},e[0]=f,e[1]=i):i=e[1];const o=i;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a.current?.click(),e[2]=h):h=e[2];let n;e[3]!==s||e[4]!==o?(n=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[3]=s,e[4]=o,e[5]=n):n=e[5];const v=g??void 0;let d;e[6]!==l||e[7]!==v?(d=t.jsx(ee,{url:v,fallback:l,shape:"square",size:"base"}),e[6]=l,e[7]=v,e[8]=d):d=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=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(ze,{size:14,className:"text-white"})}),e[9]=k):k=e[9];let c;return e[10]!==s||e[11]!==n||e[12]!==d?(c=t.jsxs("button",{type:"button",onClick:h,disabled:s,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:[n,d,k]}),e[10]=s,e[11]=n,e[12]=d,e[13]=c):c=e[13],c}function Le(){return de.error("Failed to read image")}const ue=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:Se,label:"Claiming email domain",claimOnly:!0},{icon:ve,label:"Enabling auto-join for your team",claimOnly:!0},{icon:ke,label:"Extracting brand context",claimOnly:!1}],fe=1500,ce=[{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:r,domain:e,claimDomain:g,logoUrl:l}){const f=ue.filter(o=>g||!o.claimOnly),[s,a]=F.useState(0),i=F.useRef(!1);if(!i.current){i.current=!0;for(let o=1;o<f.length;o++)setTimeout(()=>a(o),fe*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(te,{title:`Setting up ${r}`,description:`Getting everything ready from ${e}`,logoUrl:l??null,logoFallback:r.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:f.map((o,h)=>{const n=o.icon,v=h===s,d=h<s,k=ce[h%ce.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:d||v?1:.4},children:[t.jsxs("span",{className:H("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!d&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:d?{backgroundColor:k.bg,color:k.fg}:void 0,children:[t.jsx(we,{size:16,className:H("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",d?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(Q,{size:16,className:H("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(n,{size:16,className:H("absolute motion-safe:transition-opacity motion-safe:duration-200",!d&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:H("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||d?"text-foreground":"text-muted-foreground"),children:o.label})]},o.label)})})]})}export{He as default};
1
+ import{e as K,j as t,b as me,l as Q,a as ne,r as F,n as he,K as pe,B as oe,c as H,o as de}from"./index-DC5ykVbq.js";import{R as xe}from"./required-auth-layout-D7jgv78c.js";import{A as Y}from"./auth-split-layout-B0BicaKX.js";import{A as ee}from"./avatar-BdxyYnNK.js";import{I as be}from"./input-CmdQXS7m.js";import{L as je}from"./label-BeKFq4Z_.js";import{S as ye}from"./switch-QoxQ4Dp8.js";import{t as Ne,a as ve}from"./Users03-BRSJ5vR7.js";import{i as we}from"./CheckCircle-ChsHFiFQ.js";import{t as Se,a as ke}from"./Palette--vnxJff4.js";import{i as ze}from"./Upload01-rVUdt3iJ.js";import"./useRouterState-Suijaaey.js";import"./User01-NlAzTddi.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 le(r){return r.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function He(){const r=K.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(_e,{})}),r[0]=e):e=r[0],e}function te(r){const e=K.c(13),{title:g,description:l,logoUrl:f,logoFallback:s}=r;let a;e[0]!==s||e[1]!==f?(a=t.jsx("div",{children:f?t.jsx(ee,{url:f,fallback:s??"?",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]=s,e[1]=f,e[2]=a):a=e[2];let i;e[3]!==g?(i=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:g}),e[3]=g,e[4]=i):i=e[4];let o;e[5]!==l?(o=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:l}),e[5]=l,e[6]=o):o=e[6];let h;e[7]!==i||e[8]!==o?(h=t.jsxs("div",{className:"space-y-2",children:[i,o]}),e[7]=i,e[8]=o,e[9]=h):h=e[9];let n;return e[10]!==a||e[11]!==h?(n=t.jsxs("div",{className:"grid gap-10",children:[a,h]}),e[10]=a,e[11]=h,e[12]=n):n=e[12],n}function _e(){const r=K.c(4),{data:e,isPending:g}=me.useSession();if(g){let a;return r[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Y,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"})})}),r[0]=a):a=r[0],a}const l=e?.user?.email??"",f=e?.user?.name;let s;return r[1]!==f||r[2]!==l?(s=t.jsx(Oe,{email:l,userName:f}),r[1]=f,r[2]=l,r[3]=s):s=r[3],s}function Oe(r){const e=K.c(70),{email:g,userName:l}=r;let f,s,a,i,o,h;if(e[0]!==g||e[1]!==l){a=g.split("@")[1]?.toLowerCase()??"",i=!!a&&!Ce.has(a);const m=a.split(".")[0]??"";s=m.charAt(0).toUpperCase()+m.slice(1);let x;e[8]!==s||e[9]!==i||e[10]!==l?(x=i?s:l?.split(" ")[0]??"",e[8]=s,e[9]=i,e[10]=l,e[11]=x):x=e[11],f=x,h=he,o=pe.domainLookup(a),e[0]=g,e[1]=l,e[2]=f,e[3]=s,e[4]=a,e[5]=i,e[6]=o,e[7]=h}else f=e[2],s=e[3],a=e[4],i=e[5],o=e[6],h=e[7];let n;e[12]!==i||e[13]!==o?(n={queryKey:o,queryFn:Ae,enabled:i},e[12]=i,e[13]=o,e[14]=n):n=e[14];const{data:v,isLoading:d}=h(n);let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k={mutationFn:Pe},e[15]=k):k=e[15];const c=ne(k),[D,P]=F.useState(!1);if(d){let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Q,{size:14,className:"animate-spin text-muted-foreground"}),e[16]=m):m=e[16];let x;return e[17]!==a?(x=t.jsx(Y,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[m,t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Checking ",a,"..."]})]})}),e[17]=a,e[18]=x):x=e[18],x}let E,y,z;if(e[19]!==D||e[20]!==s||e[21]!==v?.organizations||e[22]!==a||e[23]!==i||e[24]!==c||e[25]!==l){z=Symbol.for("react.early_return_sentinel");e:{y=v?.organizations??[];const m=y.filter(Ee);E=y.length>0;const x=m.length>0,N=c.variables??null;if(D){let u;e[29]!==l?(u=l?.split(" ")[0]??"",e[29]=l,e[30]=u):u=e[30];let b;e[31]===Symbol.for("react.memo_cache_sentinel")?(b=()=>P(!1),e[31]=b):b=e[31];let p;e[32]!==s||e[33]!==a||e[34]!==i||e[35]!==u?(p=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:u,allowDomainClaim:!1,onBack:b}),e[32]=s,e[33]=a,e[34]=i,e[35]=u,e[36]=p):p=e[36],z=p;break e}if(x){const u=m.length===1?"You have access to an organization":"You have access to multiple organizations",b=m.length===1?"Your email domain matches an existing organization.":"Your email domain matches more than one. Pick one to join.";let p;e[37]!==u||e[38]!==b?(p=t.jsx(te,{title:u,description:b}),e[37]=u,e[38]=b,e[39]=p):p=e[39];let w;e[40]!==a||e[41]!==c||e[42]!==N?(w=O=>{const G=c.isPending&&N===O.slug;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(ee,{url:O.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,fallback:O.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:O.name}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx(oe,{size:"default",onClick:()=>c.mutate(O.slug),disabled:c.isPending,children:G?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," ","Joining..."]}):"Join"})]},O.id)},e[40]=a,e[41]=c,e[42]=N,e[43]=w):w=e[43];const _=t.jsx("div",{className:"grid gap-2",children:m.map(w)});let S;e[44]!==c.error?(S=c.error&&t.jsx("p",{className:"text-xs text-destructive",children:c.error instanceof Error?c.error.message:"Failed to join organization"}),e[44]=c.error,e[45]=S):S=e[45];let $;e[46]===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:()=>P(!0),children:"Create a new organization instead"}),e[46]=$):$=e[46];let L;e[47]!==_||e[48]!==S||e[49]!==p?(L=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[p,_,S,$]})}),e[47]=_,e[48]=S,e[49]=p,e[50]=L):L=e[50],z=L;break e}}e[19]=D,e[20]=s,e[21]=v?.organizations,e[22]=a,e[23]=i,e[24]=c,e[25]=l,e[26]=E,e[27]=y,e[28]=z}else E=e[26],y=e[27],z=e[28];if(z!==Symbol.for("react.early_return_sentinel"))return z;if(E){const m=y.length===1?`${y[0].name} is already set up`:`${y.length} organizations use @${a}`,x=y.length===1?"This organization doesn't have auto-join enabled.":"None of them have auto-join enabled — ask an admin for an invitation, or create your own.";let N;e[51]!==m||e[52]!==x?(N=t.jsx(te,{title:m,description:x}),e[51]=m,e[52]=x,e[53]=N):N=e[53];let u;if(e[54]!==a||e[55]!==y){let _;e[57]!==a?(_=S=>t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[t.jsx(ee,{url:S.logo??`https://www.google.com/s2/favicons?domain=${a}&sz=128`,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}),t.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",a]})]}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Ask admin for invitation"})]},S.id),e[57]=a,e[58]=_):_=e[58],u=y.map(_),e[54]=a,e[55]=y,e[56]=u}else u=e[56];let b;e[59]!==u?(b=t.jsx("div",{className:"grid gap-2",children:u}),e[59]=u,e[60]=b):b=e[60];let p;e[61]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(oe,{size:"xl",className:"w-full",onClick:()=>P(!0),children:"Create a new organization"}),e[61]=p):p=e[61];let w;return e[62]!==b||e[63]!==N?(w=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[N,b,p]})}),e[62]=b,e[63]=N,e[64]=w):w=e[64],w}let A;return e[65]!==f||e[66]!==s||e[67]!==a||e[68]!==i?(A=t.jsx(re,{isCorporateEmail:i,emailDomain:a,domainLabel:s,defaultName:f}),e[65]=f,e[66]=s,e[67]=a,e[68]=i,e[69]=A):A=e[69],A}function Ee(r){return r.autoJoinEnabled}async function Pe(r){const e=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),g=await e.json();if(!e.ok||!g.success)throw new Error(g.error||"Failed to join organization");window.location.href=`/${g.slug}`}async function Ae(){return(await fetch("/api/auth/custom/domain-lookup",{credentials:"include"})).json()}function re(r){const e=K.c(70),{isCorporateEmail:g,emailDomain:l,domainLabel:f,defaultName:s,allowDomainClaim:a,onBack:i}=r,o=a===void 0?!0:a,h=g&&o?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null,[n,v]=F.useState(s),[d,k]=F.useState(h),[c,D]=F.useState(!0),[P,E]=F.useState(null);let y;e[0]!==c||e[1]!==d||e[2]!==n?(y=async()=>{const j=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n.trim()||void 0,logo:d??void 0,claimDomain:c})}),C=await j.json();if(!j.ok||!C.success)throw new Error(C.error||"Failed to set up organization");return C},e[0]=c,e[1]=d,e[2]=n,e[3]=y):y=e[3];let z;e[4]!==c?(z=j=>{if(!j.slug)return;const C=ue.filter(ge=>c||!ge.claimOnly).length,W=fe*(C-1)+800;E(j.slug),setTimeout(()=>{window.location.href=`/${j.slug}`},W)},e[4]=c,e[5]=z):z=e[5];let A;e[6]!==y||e[7]!==z?(A={mutationFn:y,onSuccess:z},e[6]=y,e[7]=z,e[8]=A):A=e[8];const m=ne(A);let x;e[9]!==d||e[10]!==n?(x={mutationFn:async()=>{const j=n.trim(),C=le(j);if(!C)throw new Error("Invalid organization name");const W=await me.organization.create({name:j,slug:C,...d?{logo:d}:{}});if(W?.error)throw new Error(W.error.message||"Failed to create organization");window.location.href=`/${W?.data?.slug??C}`}},e[9]=d,e[10]=n,e[11]=x):x=e[11];const N=ne(x);if(m.isPending||P){let j;e[12]!==f||e[13]!==n?(j=n.trim()||f,e[12]=f,e[13]=n,e[14]=j):j=e[14];let C;return e[15]!==c||e[16]!==l||e[17]!==d||e[18]!==j?(C=t.jsx(Y,{children:t.jsx(Fe,{orgName:j,domain:l,claimDomain:c,logoUrl:d})}),e[15]=c,e[16]=l,e[17]=d,e[18]=j,e[19]=C):C=e[19],C}const u=N.isPending;let b;e[20]!==n?(b=le(n.trim()),e[20]=n,e[21]=b):b=e[21];const p=!!b,w=m.error||N.error||null;let _;e[22]!==o||e[23]!==p||e[24]!==N||e[25]!==m||e[26]!==g?(_=j=>{j.preventDefault(),p&&(g&&o?m.mutate():N.mutate())},e[22]=o,e[23]=p,e[24]=N,e[25]=m,e[26]=g,e[27]=_):_=e[27];const S=_;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(te,{title:"Welcome to deco",description:"Set up your organization to get started"}),e[28]=$):$=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=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]=L):L=e[29];let O;e[30]!==s||e[31]!==n?(O=(n.trim()||s||"?").charAt(0).toUpperCase(),e[30]=s,e[31]=n,e[32]=O):O=e[32];const G=u||m.isPending;let R;e[33]!==d||e[34]!==O||e[35]!==G?(R=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[L,t.jsx($e,{value:d,fallback:O,onChange:k,disabled:G})]}),e[33]=d,e[34]=O,e[35]=G,e[36]=R):R=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(je,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:"Organization name"}),e[37]=V):V=e[37];let X;e[38]===Symbol.for("react.memo_cache_sentinel")?(X=j=>v(j.target.value),e[38]=X):X=e[38];const ae=s||"My Organization",se=u||m.isPending;let T;e[39]!==n||e[40]!==ae||e[41]!==se?(T=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[V,t.jsx(be,{id:"org-name",value:n,onChange:X,placeholder:ae,disabled:se,className:"h-10 max-w-[220px]"})]}),e[39]=n,e[40]=ae,e[41]=se,e[42]=T):T=e[42];let U;e[43]!==o||e[44]!==c||e[45]!==m.isPending||e[46]!==l||e[47]!==g||e[48]!==u?(U=g&&o&&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 @",l," sign-ups"]}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Anyone with a verified @",l," email can join this org"]})]}),t.jsx(ye,{checked:c,onCheckedChange:D,disabled:u||m.isPending})]}),e[43]=o,e[44]=c,e[45]=m.isPending,e[46]=l,e[47]=g,e[48]=u,e[49]=U):U=e[49];let M;e[50]!==R||e[51]!==T||e[52]!==U?(M=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[R,T,U]}),e[50]=R,e[51]=T,e[52]=U,e[53]=M):M=e[53];let I;e[54]!==w?(I=w&&t.jsx("p",{className:"text-xs text-destructive",children:w instanceof Error?w.message:"Failed to create organization"}),e[54]=w,e[55]=I):I=e[55];const ie=!p||u||m.isPending;let J;e[56]!==m.isPending||e[57]!==u?(J=u||m.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Q,{size:14,className:"animate-spin"})," Creating..."]}):"Continue",e[56]=m.isPending,e[57]=u,e[58]=J):J=e[58];let q;e[59]!==ie||e[60]!==J?(q=t.jsx(oe,{type:"submit",size:"xl",className:"w-full",disabled:ie,children:J}),e[59]=ie,e[60]=J,e[61]=q):q=e[61];let B;e[62]!==i?(B=i&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:i,children:"See available organizations"}),e[62]=i,e[63]=B):B=e[63];let Z;return e[64]!==S||e[65]!==M||e[66]!==I||e[67]!==q||e[68]!==B?(Z=t.jsx(Y,{children:t.jsxs("form",{onSubmit:S,className:"grid gap-10",children:[$,M,I,q,B]})}),e[64]=S,e[65]=M,e[66]=I,e[67]=q,e[68]=B,e[69]=Z):Z=e[69],Z}function $e(r){const e=K.c(14),{value:g,fallback:l,onChange:f,disabled:s}=r,a=F.useRef(null);let i;e[0]!==f?(i=D=>{const P=D.target.files?.[0];if(!P)return;if(P.size>2097152){de.error("Image must be smaller than 2MB"),a.current&&(a.current.value="");return}const E=new FileReader;E.onerror=Le,E.onloadend=()=>{E.result&&f(E.result),a.current&&(a.current.value="")},E.readAsDataURL(P)},e[0]=f,e[1]=i):i=e[1];const o=i;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a.current?.click(),e[2]=h):h=e[2];let n;e[3]!==s||e[4]!==o?(n=t.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[3]=s,e[4]=o,e[5]=n):n=e[5];const v=g??void 0;let d;e[6]!==l||e[7]!==v?(d=t.jsx(ee,{url:v,fallback:l,shape:"square",size:"base"}),e[6]=l,e[7]=v,e[8]=d):d=e[8];let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=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(ze,{size:14,className:"text-white"})}),e[9]=k):k=e[9];let c;return e[10]!==s||e[11]!==n||e[12]!==d?(c=t.jsxs("button",{type:"button",onClick:h,disabled:s,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:[n,d,k]}),e[10]=s,e[11]=n,e[12]=d,e[13]=c):c=e[13],c}function Le(){return de.error("Failed to read image")}const ue=[{icon:Ne,label:"Creating organization",claimOnly:!1},{icon:Se,label:"Claiming email domain",claimOnly:!0},{icon:ve,label:"Enabling auto-join for your team",claimOnly:!0},{icon:ke,label:"Extracting brand context",claimOnly:!1}],fe=1500,ce=[{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:r,domain:e,claimDomain:g,logoUrl:l}){const f=ue.filter(o=>g||!o.claimOnly),[s,a]=F.useState(0),i=F.useRef(!1);if(!i.current){i.current=!0;for(let o=1;o<f.length;o++)setTimeout(()=>a(o),fe*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(te,{title:`Setting up ${r}`,description:`Getting everything ready from ${e}`,logoUrl:l??null,logoFallback:r.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:f.map((o,h)=>{const n=o.icon,v=h===s,d=h<s,k=ce[h%ce.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:d||v?1:.4},children:[t.jsxs("span",{className:H("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!d&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:d?{backgroundColor:k.bg,color:k.fg}:void 0,children:[t.jsx(we,{size:16,className:H("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",d?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(Q,{size:16,className:H("absolute animate-spin","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0"),"aria-hidden":"true"}),t.jsx(n,{size:16,className:H("absolute motion-safe:transition-opacity motion-safe:duration-200",!d&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:H("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||d?"text-foreground":"text-muted-foreground"),children:o.label})]},o.label)})})]})}export{He as default};
@@ -1 +1 @@
1
- import{e as k,r as z,b8 as S,g as _,a3 as E,b9 as T,j as o,P as $}from"./index-D6idVW2n.js";const P="#f6f4ed",L="#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:L,theme_color:P,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 g;e[14]!==d||e[15]!==A||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(g=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]=g):g=e[20];const v=t??"";let x;e[21]!==v?(x={org:v},e[21]=v,e[22]=x):x=e[22];let h;e[23]!==s||e[24]!==x?(h=o.jsxs($,{to:"/$org",params:x,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=x,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==g?(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,g,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=g,e[30]=j):j=e[30],j}export{q as default};
1
+ import{e as k,r as z,b8 as S,g as _,a3 as E,b9 as T,j as o,P as $}from"./index-DC5ykVbq.js";const P="#f6f4ed",L="#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:L,theme_color:P,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 g;e[14]!==d||e[15]!==A||e[16]!==m||e[17]!==u||e[18]!==s||e[19]!==y?(g=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]=g):g=e[20];const v=t??"";let x;e[21]!==v?(x={org:v},e[21]=v,e[22]=x):x=e[22];let h;e[23]!==s||e[24]!==x?(h=o.jsxs($,{to:"/$org",params:x,className:"text-sm text-primary hover:underline",replace:!0,children:["Back to ",s]}),e[23]=s,e[24]=x,e[25]=h):h=e[25];let j;return e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==g?(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,g,h]})}),e[26]=h,e[27]=p,e[28]=f,e[29]=g,e[30]=j):j=e[30],j}export{q as default};
@@ -1 +1 @@
1
- import{e as o,j as r,O as s}from"./index-D6idVW2n.js";function m(){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{m as default};
1
+ import{e as o,j as r,O as s}from"./index-DC5ykVbq.js";function m(){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{m as default};
@@ -1 +1 @@
1
- import{e as f,g as p,ck as x,j as r,r as c,l as u}from"./index-D6idVW2n.js";import{P as g}from"./plugin-layout-TXD29kdN.js";import"./use-connection-f6XTkb53.js";import"./use-collections-B1ftgmsC.js";import"./use-mcp-client-Dutz6IKN.js";import"./Settings02-CnuG-oH5.js";import"./index-D-CqRT4O.js";import"./sidebar-faIWOpU7.js";import"./LayoutLeft-DQjoJnlv.js";import"./tooltip-BwAS3LmD.js";import"./sheet-BdF_K2dB.js";import"./X-D2-T6h59.js";function v(){const e=f.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=p(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const a=t?.LayoutComponent;if(!a){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=m):m=e[10];let o;return e[11]!==a?(o=r.jsx(c.Suspense,{fallback:m,children:r.jsx(a,{})}),e[11]=a,e[12]=o):o=e[12],o}export{v as default};
1
+ import{e as f,g as p,ck as x,j as r,r as c,l as u}from"./index-DC5ykVbq.js";import{P as g}from"./plugin-layout-B4yAz-3-.js";import"./use-connection-n0123jPK.js";import"./use-collections-BOfrARHt.js";import"./use-mcp-client-DyuH8eE6.js";import"./Settings02-StPTnFMx.js";import"./index-BQoodOft.js";import"./sidebar-BROkYxtG.js";import"./LayoutLeft-B60p8Um4.js";import"./tooltip-D7cmoHaE.js";import"./sheet-D4rfwRUO.js";import"./X-BN3arG6T.js";function v(){const e=f.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=p(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const a=t?.LayoutComponent;if(!a){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=m):m=e[10];let o;return e[11]!==a?(o=r.jsx(c.Suspense,{fallback:m,children:r.jsx(a,{})}),e[11]=a,e[12]=o):o=e[12],o}export{v as default};
@@ -1 +1 @@
1
- import{e as L,G as te,K as B,j as a,r as G,c as ne}from"./index-D6idVW2n.js";import{i as oe,k as M,a0 as se,a1 as re,U as ie,d as le}from"./index-CwDq8vs6.js";import{L as Y}from"./label-rvaNBf1n.js";import{S as $}from"./switch-Djy20jDK.js";import{a as ce,S as ae}from"./schema-form-0q7FWymW.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-D-XBS65u.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 z(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=M(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=M(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 Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(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(Ee(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 qe(t,e,n){if(e.kind==="site"){const l=je(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:z(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:z(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(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=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(B.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},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=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(B.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}: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 U=["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 U;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 U.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]=G.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=G.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 j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=U.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&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})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(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(Be).map(Ue),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 Ue(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Be(t){return t.resolveType.length>0}function Xe(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 j=me(s);p(j),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 j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==h||e[9]!==f?(E=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=E):E=e[10];const P=E;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{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
1
+ import{e as L,G as te,K as B,j as a,r as G,c as ne}from"./index-DC5ykVbq.js";import{i as oe,k as M,a0 as se,a1 as re,U as ie,d as le}from"./index-DinTmsRi.js";import{L as Y}from"./label-BeKFq4Z_.js";import{S as $}from"./switch-QoxQ4Dp8.js";import{a as ce,S as ae}from"./schema-form-DoBelrVG.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-n15H_mpn.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 z(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=M(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=M(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 Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(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(Ee(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 qe(t,e,n){if(e.kind==="site"){const l=je(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:z(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:z(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(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=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(B.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},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=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(B.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}: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 U=["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 U;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 U.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]=G.useState(i);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];const[m,g]=G.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 j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=U.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&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})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(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(Be).map(Ue),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 Ue(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Be(t){return t.resolveType.length>0}function Xe(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 j=me(s);p(j),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 j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==h||e[9]!==f?(E=T=>{f({__resolveType:T}),h()},e[8]=h,e[9]=f,e[10]=E):E=e[10];const P=E;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{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
@@ -0,0 +1 @@
1
+ import{e as it,r as E,j as e,l as rt}from"./index-DC5ykVbq.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-D4rfwRUO.js";import{S as nt}from"./scroll-area-P07qVNiz.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-BkwbUlnR.js";import{k as xt}from"./index-DinTmsRi.js";import"./X-BN3arG6T.js";import"./select-n15H_mpn.js";import"./tooltip-D7cmoHaE.js";import"./Check-COv5M0lh.js";import"./ChevronDown-BdEaOOXp.js";import"./ChevronUp-y4zusQsp.js";import"./label-BeKFq4Z_.js";import"./switch-QoxQ4Dp8.js";import"./schema-form-DoBelrVG.js";import"./agent-icon-K7-2Vanq.js";import"./AlertCircle-GyiOEtAj.js";import"./Tool01-nSGgZsVX.js";import"./SwitchHorizontal01-CXh2-ORd.js";import"./RefreshCcw01-CqQ0_ss_.js";import"./XCircle-xmKSYZKr.js";import"./ArrowUpRight-DlUPHWCe.js";import"./ZapSquare-DsZrIKGl.js";import"./Users03-BRSJ5vR7.js";import"./CheckCircle-ChsHFiFQ.js";import"./ChevronLeft-B8kAn6JD.js";import"./ChevronRight-o4nZK4mj.js";import"./DotsVertical-W4F6Fa4e.js";import"./Container-CqLkbSjr.js";import"./Eye-f801Ko_Z.js";import"./ZoomOut-CVKSaoni.js";import"./Globe01-BfG_Acce.js";import"./FilterLines-CdYz7NJH.js";import"./Star01-DBs_rPC7.js";import"./Palette--vnxJff4.js";import"./HardDrive-D9UXv7dX.js";import"./Stars02-B2A2nE0X.js";import"./Key01-B5dV9ECL.js";import"./LayoutLeft-B60p8Um4.js";import"./LinkExternal01-6cFTncDa.js";import"./Monitor01-Cc4WDpkR.js";import"./Sun-Deye0C8A.js";import"./Play-C7HtzLaD.js";import"./Plus-LwySGDxB.js";import"./SearchMd-MshnFe0l.js";import"./Settings02-StPTnFMx.js";import"./Shield01-T0cQG3gR.js";import"./Stars01-DHlDpyBS.js";import"./Trash01-DZfkybKU.js";import"./Upload01-rVUdt3iJ.js";import"./User01-NlAzTddi.js";import"./Users01-DaydqXQC.js";import"./XClose-1qd9ainB.js";import"./Zap-CYUIBMS-.js";import"./calendar-DczL_N_A.js";import"./input-CmdQXS7m.js";import"./popover-Dp3QS8N6.js";import"./textarea-IFOxZRFP.js";import"./dropdown-menu-DVje-EoW.js";import"./image-field-U7AFL_og.js";import"./dialog-CL1BseA9.js";import"./skeleton-DWOWMile.js";import"./tabs-kJyWL6V1.js";import"./use-file-configs-CyyHbhaI.js";import"./use-mcp-client-DyuH8eE6.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-DMrx4YUI.js";import"./infiniteQueryObserver-BFBhoWbn.js";import"./agent-capabilities-D2XTyDA4.js";import"./chat-context-DA35HLXS.js";import"./tab-id-CNkO3hVN.js";import"./decopilot-sse-pool-CZFgZ3nE.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-Dey3T-Qn.js";import"./use-collections-BOfrARHt.js";import"./use-ai-providers--CmHEwAc.js";import"./use-organization-settings-B4dvDS7R.js";import"./pair-DE0D0Wie.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B0vwFN4z.js";import"./file-type-icon-DVYPih9c.js";import"./content-blocks-o63cs2vh.js";import"./types-BmGja53h.js";import"./shell-layout-BwqpmibN.js";import"./avatar-BdxyYnNK.js";import"./required-auth-layout-D7jgv78c.js";import"./useRouterState-Suijaaey.js";import"./use-org-sso-qSbMZg_F.js";import"./integration-icon-DubrPseB.js";import"./use-navigate-to-agent-B09CyGqp.js";import"./use-connection-n0123jPK.js";import"./use-mcp-prompts-Bwn_S6iL.js";import"./form-4UXcNbUg.js";import"./spinner-CtVtBijD.js";import"./drawer-C9J2FQkF.js";import"./collection-search-ChKSSxmH.js";import"./toggle-group--w1kOZWe.js";import"./connect-desktop-dialog-DpF_sI6h.js";import"./agent-icons-CeKYocvB.js";import"./checkbox-CqOCOG6Q.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Tanq8jyR.js";import"./card-Br94nOKg.js";import"./command-BS0mokMv.js";import"./index-CAfQQdyv.js";import"./sortable.esm-QhdKIQMp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CFu6MAht.js";import"./use-registry-connections-Bds9Ypgx.js";import"./extract-connection-data-CrV9u96Z.js";import"./generate-id-CVdT0fIQ.js";import"./collections-Dk6dLEYA.js";import"./collection-tabs-C5s6I9ON.js";import"./badge-CS2sZUxN.js";import"./connection-form-helpers-C3EFMKqC.js";import"./use-infinite-scroll-CdSYgiPG.js";import"./useSuspenseInfiniteQuery-BEThz4gg.js";import"./index-BKKTxT9B.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BcS4ogVM.js";import"./sidebar-BROkYxtG.js";import"./toolbar-BBxreRsk.js";import"./use-create-virtual-mcp-D-CNGeek.js";import"./github-repo-picker-DD8wItvg.js";import"./use-mcp-tools-DC6ktQK8.js";import"./alert-dialog-CJQaL6p3.js";import"./index-BK7hwLt0.js";import"./use-org-auth-client-DHC5iDX4.js";import"./hover-card-BA4UtY_2.js";import"./task-status-j0388nBE.js";import"./use-status-sounds-CK6N7rMv.js";import"./empty-state-Bv1Z9MXv.js";import"./resizable-Cd48I16F.js";import"./use-capability-CxysHd_P.js";import"./header-tab-button-DgECRSSy.js";import"./index-DYMkejmQ.js";import"./user-CZuNKuKE.js";import"./tools-list-DJXjW2l9.js";import"./use-debounced-autosave-D2Tk122B.js";import"./index-BQoodOft.js";import"./search-input-BC00SFbU.js";import"./use-secrets-CnpydoP_.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Bl7Yi6C4.js";import"./view-mode-toggle-DB4LJ27d.js";import"./select-model-D5qi4yVr.js";import"./use-automations-BuOkYpgz.js";import"./monaco-editor-B-nbM8Ue.js";import"./automation-runs-eraj829k.js";import"./table-BsrEIQdy.js";import"./use-members-BzP8QLPf.js";import"./automation-list-row-DO-WP7Ai.js";function Si(u){const t=it.c(46),{open:k,onOpenChange:N,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),P=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(P),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==P&&(Z(P),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]!==N?(F=r=>{r||K(),N(r)},t[6]=K,t[7]=N,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]!==k||t[44]!==f?(b=e.jsx(at,{open:k,onOpenChange:z,children:f}),t[42]=z,t[43]=k,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{Si as SeoSheet};
@@ -1,4 +1,4 @@
1
- import{e as $,r as H,T as at,I as Ht,H as Bt,j as n,B as ke,W as Xe,c as V,t as Wt,q as he,G as Ut,a as qt,K as me,o as ze,n as Oe,f as je,E as Vt,C as Gt,bB as De}from"./index-D6idVW2n.js";import{_ as Kt,F as Jt,z as Xt,ab as Qt,N as Yt,M as Zt,L as es,a7 as rt,ac as ts,ad as ss,A as it,ae as ie,af as ns,ag as ls,ah as os,b as as}from"./agent-icon-DwlI421o.js";import{t as He}from"./Stars01-GUKoSsGN.js";import{a as ct,t as rs,b as we,d as is}from"./XCircle-BD7UyEOF.js";import{i as Be}from"./Check-BNom5dOo.js";import{i as Qe}from"./ChevronRight-GBMV5yJO.js";import{a as ut,s as cs}from"./Eye-CCL1jvke.js";import{a as de,c as Ye,t as us}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as ds,f as fs,g as ms,u as ps,i as xs,d as gs}from"./scroll-area-S5xU4-3T.js";import{u as pt}from"./use-copy-N9ijygLT.js";import{T as pe,a as xe,b as ge}from"./tooltip-BwAS3LmD.js";import{M as xt,I as gt,F as hs}from"./file-type-icon-B0iXSarG.js";import{c as bs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as ys}from"./types-DpLGHfBV.js";import{f as $e,i as js,d as We,a as vs}from"./chat-context-DCjkCe-V.js";import{S as Ns,u as Ue,c as ks,b as Ss}from"./use-mcp-client-Dutz6IKN.js";import{n as _s,f as ws,o as Ts,q as Cs}from"./tab-id-DKNFO22m.js";import{i as bt}from"./AlertCircle-Di-V3umI.js";import{s as Ce,t as yt}from"./Star01-f8rMlJ5U.js";import{s as $s}from"./XClose-qC7X4hjJ.js";import{n as jt}from"./ZapSquare-DMyX_8RQ.js";import{n as vt,i as Is}from"./Globe01-Ca2CDUqL.js";import{b as Ms,i as Ls,a as Le}from"./Tool01-BGucVzDk.js";import{i as Ze,a as Rs}from"./ZoomOut-CrNlxKNu.js";import{i as Ne}from"./Monitor01-CCpw9YsU.js";import{i as As}from"./SearchMd-BrE4Lp2d.js";import{i as zs}from"./Upload01-ypYRbiXm.js";import{u as Ps,c as Es}from"./shell-layout-652GQgyj.js";import{n as Nt}from"./LinkExternal01-BmWxPEFc.js";import{I as Ie}from"./integration-icon-b2Rlb-Sb.js";import{u as Fs}from"./use-virtual-mcp-BW5609Gn.js";import{a as kt}from"./Users03-Gpc8Fhl9.js";import{a as ce}from"./Palette-DljqRkOL.js";import{k as St}from"./use-navigate-to-agent-QL4LtHJV.js";import{a as Os}from"./use-connection-f6XTkb53.js";import{s as Ds}from"./Stars02-DApbfWB6.js";import{g as Hs}from"./use-mcp-prompts-DkrNbGZU.js";import{c as Bs,b as Ws,d as Us,a as qs,D as Vs}from"./dialog-fdhgLhBf.js";import{a as Gs,F as Ks,b as Js,c as Xs,d as Qs,f as Ys}from"./form-l2US6lAY.js";import{I as Zs}from"./input-ChQ639sE.js";import{S as en}from"./spinner-Ba6MQmcV.js";import{t as tn}from"./ChevronDown-B21_IsL3.js";const sn={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function _t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(sn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+_t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function ma(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function nn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function qe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ve(s,e){if(!e)return s;const t=`${nn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function ln(s,e){return Ve(s,e).replace(/[_-]/g," ").toLowerCase()}function on(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Xe().min(1,"Required"):Xe();return at(e)}function an(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function rn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=H.useId();let u;if(e[0]!==t){const A=t?on(t):at({});u=Ht(A),e[0]=t,e[1]=u}else u=e[1];const c=u;let m;e[2]!==a||e[3]!==t?(m=t?an(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const i=Bt(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==i||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),i.reset()},e[10]=i,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==i||e[15]!==l?(h=A=>{A||(i.reset(),l(null))},e[14]=i,e[15]=l,e[16]=h):h=e[16];const N=h;if(!t)return null;let j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||ln(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let k;e[21]!==j?(k=n.jsx(Bs,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=k):k=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==k?(v=n.jsxs(Ws,{children:[k,y]}),e[25]=y,e[26]=k,e[27]=v):v=e[27];let S;e[28]!==i||e[29]!==b?(S=A=>{A.stopPropagation(),i.handleSubmit(b)(A)},e[28]=i,e[29]=b,e[30]=S):S=e[30];let _;if(e[31]!==x||e[32]!==i.control||e[33]!==i.formState.isSubmitting){let A;e[35]!==i.control||e[36]!==i.formState.isSubmitting?(A=P=>n.jsx(Ks,{control:i.control,name:P.name,render:O=>{const{field:W}=O;return n.jsxs(Js,{children:[n.jsxs(Xs,{className:"text-xs",children:[P.name,P.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Qs,{children:n.jsx(Zs,{...W,value:W.value??"",required:P.required,placeholder:P.description??"",className:"h-9",disabled:i.formState.isSubmitting})}),n.jsx(Ys,{})]})}},P.name),e[35]=i.control,e[36]=i.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=i.control,e[33]=i.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==N?(w=()=>N(!1),e[38]=N,e[39]=w):w=e[39];let T;e[40]!==i.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:i.formState.isSubmitting,children:"Cancel"}),e[40]=i.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==i.formState.isSubmitting?(I=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(en,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=i.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==i.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:i.formState.isSubmitting,children:I}),e[45]=i.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Us,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==S||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[_,C]}),e[52]=o,e[53]=S,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==i||e[58]!==L?(R=n.jsx(Gs,{...i,children:L}),e[57]=i,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==v||e[61]!==R?(F=n.jsxs(qs,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,R]}),e[60]=v,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==N||e[64]!==F?(z=n.jsx(Vs,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=z):z=e[65],z}function Ct(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function cn(s){return s.storage.mention}function pa(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function un(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:c,id:m,args:p}=t.attrs,i=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=cn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",N=d?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",j=i&&"outline-2 outline-blue-300 outline-offset-0",k=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==k?(y=V("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,k,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=k,e[11]=y):y=e[11];let v;e[12]!==u?(v=u?Ct(u):"",e[12]=u,e[13]=v):v=e[13];let S;return e[14]!==f||e[15]!==b||e[16]!==y||e[17]!==v?(S=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,e[17]=v,e[18]=S):S=e[18],S}const dn=dt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ft(un)}}),fn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(fn,"")}function Ge(s){const e=$.c(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:c}=pt(),[m,p]=H.useState(!1);let i;e[0]!==c||e[1]!==t||e[2]!==l.text?(i=async()=>{Wt("chat_message_copied",{message_id:t,chars:l.text.length}),await c(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=c,e[1]=t,e[2]=l.text,e[3]=i):i=e[3];const d=i,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:V("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function xa(s,e,t){s.chain().focus().insertContentAt(e,[mn(t),{type:"text",text:" "}]).run()}function mn(s){return{type:"file",attrs:s}}function pn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=f&&"outline-2 outline-blue-300 outline-offset-0";let i;e[2]!==p?(i=V("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=i):i=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==i||e[15]!==g?(b=n.jsx(mt,{className:i,children:g}),e[14]=i,e[15]=g,e[16]=b):b=e[16],b}const xn=dt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ft(pn)}}),fe=16,Pe=2.5,Ee=(fe-Pe)/2,Re=2*Math.PI*Ee;function gn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let c;e[4]!==f?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let i;e[8]!==r?(i=r.toLocaleString(),e[8]=r,e[9]=i):i=e[9];let d;e[10]!==i?(d=n.jsx("span",{className:"text-right tabular-nums",children:i}),e[10]=i,e[11]=d):d=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=a-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let N;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(N=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=N):N=e[20];let j;e[21]!==o?(j=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=j):j=e[22];let k;e[23]!==h||e[24]!==N||e[25]!==j||e[26]!==d?(k=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,d,x,h,N,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=k):k=e[27];let y;return e[28]!==k||e[29]!==c?(y=n.jsxs(ge,{children:[c,k]}),e[28]=k,e[29]=c,e[30]=y):y=e[30],y}function hn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let c;e[3]!==l||e[4]!==f||e[5]!==t?(c=f&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:f})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=f,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:a?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let i;return e[15]!==c||e[16]!==m||e[17]!==p?(i=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=i):i=e[18],i}function ga(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let i;e[2]!==f?(i=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=i):i=e[3];const d=`Context usage: ${p}%${i}`,x=a?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=V("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let N;e[7]!==h?(N=V(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:N})]}),e[9]=u,e[10]=N,e[11]=j):j=e[11];let k;e[12]!==o?(k=o.toFixed(0),e[12]=o,e[13]=k):k=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==k||e[17]!==y?(v=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[k,"%",y]}),e[16]=k,e[17]=y,e[18]=v):v=e[18];let S;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,e[24]=S):S=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==r?(T=r.toLocaleString(),e[28]=r,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==f||e[37]!==c||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=c,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==S||e[49]!==R?(F=n.jsxs(ge,{children:[S,R]}),e[48]=S,e[49]=R,e[50]=F):F=e[50],F}function bn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ms,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ds,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function jn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(fs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Mt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=H.useState(null),[u,f]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const i=window.getComputedStyle(p);if(i.overflowY==="auto"||i.overflowY==="scroll"||i.overflow==="auto"||i.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(i=>{const d=i[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,c]),H.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),H.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:c,variant:m,trailing:p,iconDestructive:i,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[N,j]=H.useState(x??!1),{handleCopy:k,copied:y}=pt(),v=o==="loading",S=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||N,C=H.useRef(null),L=v&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:z}=Mt(F),A=c?void 0:j,P=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=v&&"shimmer";let B;e[7]!==W||e[8]!==U||e[9]!==O?(B=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,W,U),e[7]=W,e[8]=U,e[9]=O,e[10]=B):B=e[10];const Y=!T;let K;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==i||e[15]!==S||e[16]!==T?(K=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Qe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",i?"[&>svg]:text-destructive/70":S?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Qe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=i,e[15]=S,e[16]=T,e[17]=K):K=e[17];const Q=S?"text-warning/80":"text-foreground";let X;e[18]!==Q?(X=V("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=X):X=e[19];let Z;e[20]!==X||e[21]!==l?(Z=n.jsx("span",{className:X,children:l}),e[20]=X,e[21]=l,e[22]=Z):Z=e[22];let E;e[23]!==a?(E=a?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=E):E=e[24];let q;e[25]!==p?(q=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=q):q=e[26];let G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let J;e[29]!==B||e[30]!==Y||e[31]!==K||e[32]!==Z||e[33]!==E||e[34]!==q||e[35]!==G||e[36]!==P?(J=n.jsxs(yn,{disabled:P,className:B,"aria-disabled":Y,children:[K,Z,E,q,G]}),e[29]=B,e[30]=Y,e[31]=K,e[32]=Z,e[33]=E,e[34]=q,e[35]=G,e[36]=P,e[37]=J):J=e[37];let ee;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==k||e[43]!==T||e[44]!==z?(ee=T&&n.jsx(jn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:u}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u})}),n.jsx("button",{type:"button",onClick:()=>k(u),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=k,e[43]=T,e[44]=z,e[45]=ee):ee=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==ee||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[J,ee]}),e[46]=M,e[47]=J,e[48]=ee,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function te(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Lt=4;function Rt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ct,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function vn(s){const e=$.c(27),{org:t}=he(),l=Ut(),r=_s();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Ns,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=Ue(a);let u;e[3]!==o||e[4]!==s?(u=async b=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=await o.callTool({name:"COLLECTION_THREADS_GET",arguments:{id:s}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(S=>S.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},e[3]=o,e[4]=s,e[5]=u):u=e[5];let f,c,m;e[6]!==t.id||e[7]!==l||e[8]!==s?(f=async b=>{const h=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:h});const N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(y=>y.toolName!==b.toolName);return k.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:k}}),{previous:N}},c=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,N.previous),ze.error(b instanceof Error?b.message:"Failed to expand tool")},e[6]=t.id,e[7]=l,e[8]=s,e[9]=f,e[10]=c,e[11]=m):(f=e[9],c=e[10],m=e[11]);let p;e[12]!==u||e[13]!==f||e[14]!==c||e[15]!==m?(p={mutationFn:u,onMutate:f,onSuccess:c,onError:m},e[12]=u,e[13]=f,e[14]=c,e[15]=m,e[16]=p):p=e[16];const i=qt(p);let d;e[17]!==r||e[18]!==i||e[19]!==t.id||e[20]!==l||e[21]!==s?(d=b=>{if(!s||!r)return;const h=me.ensureTask(t.id,s),N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==b.toolName);k.push({...b,expandedAt:new Date().toISOString()});const y={...N?.metadata??{},expanded_tools:k};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),i.mutate(b)},e[17]=r,e[18]=i,e[19]=t.id,e[20]=l,e[21]=s,e[22]=d):d=e[22];const x=d;let g;return e[23]!==x||e[24]!==i.isPending||e[25]!==i.mutate?(g={addOrReplace:i.mutate,addOrReplaceEager:x,isPending:i.isPending},e[23]=x,e[24]=i.isPending,e[25]=i.mutate,e[26]=g):g=e[26],g}function Nn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await ks({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(c=>c.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const kn={read:{icon:Ze,label:"Read File"},write:{icon:Ls,label:"Write File"},edit:{icon:es,label:"Edit File"},grep:{icon:As,label:"Search Content"},glob:{icon:Rs,label:"Find Files"},bash:{icon:Zt,label:"Run Command"},read_tool_output:{icon:Ze,label:"Read Tool Output"},read_resource:{icon:Yt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Ms,label:"Enable Tool"},open_in_agent:{icon:Qt,label:"Open in Agent"},sandbox:{icon:Xt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:zs,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Jt,label:"Inspect Page"}};function Ke(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function _n(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
1
+ import{e as $,r as H,T as at,I as Ht,H as Bt,j as n,B as ke,W as Xe,c as V,t as Wt,q as he,G as Ut,a as qt,K as me,o as ze,n as Oe,f as je,E as Vt,C as Gt,bB as De}from"./index-DC5ykVbq.js";import{_ as Kt,F as Jt,z as Xt,ab as Qt,N as Yt,M as Zt,L as es,a7 as rt,ac as ts,ad as ss,A as it,ae as ie,af as ns,ag as ls,ah as os,b as as}from"./agent-icon-K7-2Vanq.js";import{t as He}from"./Stars01-DHlDpyBS.js";import{a as ct,t as rs,b as we,d as is}from"./XCircle-xmKSYZKr.js";import{i as Be}from"./Check-COv5M0lh.js";import{i as Qe}from"./ChevronRight-o4nZK4mj.js";import{a as ut,s as cs}from"./Eye-f801Ko_Z.js";import{a as de,c as Ye,t as us}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as ds,f as fs,g as ms,u as ps,i as xs,d as gs}from"./scroll-area-P07qVNiz.js";import{u as pt}from"./use-copy-B0vwFN4z.js";import{T as pe,a as xe,b as ge}from"./tooltip-D7cmoHaE.js";import{M as xt,I as gt,F as hs}from"./file-type-icon-DVYPih9c.js";import{c as bs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as ys}from"./types-BmGja53h.js";import{f as $e,i as js,d as We,a as vs}from"./chat-context-DA35HLXS.js";import{S as Ns,u as Ue,c as ks,b as Ss}from"./use-mcp-client-DyuH8eE6.js";import{n as _s,f as ws,o as Ts,q as Cs}from"./tab-id-CNkO3hVN.js";import{i as bt}from"./AlertCircle-GyiOEtAj.js";import{s as Ce,t as yt}from"./Star01-DBs_rPC7.js";import{s as $s}from"./XClose-1qd9ainB.js";import{n as jt}from"./ZapSquare-DsZrIKGl.js";import{n as vt,i as Is}from"./Globe01-BfG_Acce.js";import{b as Ms,i as Ls,a as Le}from"./Tool01-nSGgZsVX.js";import{i as Ze,a as Rs}from"./ZoomOut-CVKSaoni.js";import{i as Ne}from"./Monitor01-Cc4WDpkR.js";import{i as As}from"./SearchMd-MshnFe0l.js";import{i as zs}from"./Upload01-rVUdt3iJ.js";import{u as Ps,c as Es}from"./shell-layout-BwqpmibN.js";import{n as Nt}from"./LinkExternal01-6cFTncDa.js";import{I as Ie}from"./integration-icon-DubrPseB.js";import{u as Fs}from"./use-virtual-mcp-Dey3T-Qn.js";import{a as kt}from"./Users03-BRSJ5vR7.js";import{a as ce}from"./Palette--vnxJff4.js";import{k as St}from"./use-navigate-to-agent-B09CyGqp.js";import{a as Os}from"./use-connection-n0123jPK.js";import{s as Ds}from"./Stars02-B2A2nE0X.js";import{g as Hs}from"./use-mcp-prompts-Bwn_S6iL.js";import{c as Bs,b as Ws,d as Us,a as qs,D as Vs}from"./dialog-CL1BseA9.js";import{a as Gs,F as Ks,b as Js,c as Xs,d as Qs,f as Ys}from"./form-4UXcNbUg.js";import{I as Zs}from"./input-CmdQXS7m.js";import{S as en}from"./spinner-CtVtBijD.js";import{t as tn}from"./ChevronDown-BdEaOOXp.js";const sn={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function _t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(sn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+_t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function ma(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function nn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function qe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ve(s,e){if(!e)return s;const t=`${nn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function ln(s,e){return Ve(s,e).replace(/[_-]/g," ").toLowerCase()}function on(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Xe().min(1,"Required"):Xe();return at(e)}function an(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function rn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=H.useId();let u;if(e[0]!==t){const A=t?on(t):at({});u=Ht(A),e[0]=t,e[1]=u}else u=e[1];const c=u;let m;e[2]!==a||e[3]!==t?(m=t?an(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const i=Bt(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==i||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),i.reset()},e[10]=i,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==i||e[15]!==l?(h=A=>{A||(i.reset(),l(null))},e[14]=i,e[15]=l,e[16]=h):h=e[16];const N=h;if(!t)return null;let j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||ln(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let k;e[21]!==j?(k=n.jsx(Bs,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=k):k=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==k?(v=n.jsxs(Ws,{children:[k,y]}),e[25]=y,e[26]=k,e[27]=v):v=e[27];let S;e[28]!==i||e[29]!==b?(S=A=>{A.stopPropagation(),i.handleSubmit(b)(A)},e[28]=i,e[29]=b,e[30]=S):S=e[30];let _;if(e[31]!==x||e[32]!==i.control||e[33]!==i.formState.isSubmitting){let A;e[35]!==i.control||e[36]!==i.formState.isSubmitting?(A=P=>n.jsx(Ks,{control:i.control,name:P.name,render:O=>{const{field:W}=O;return n.jsxs(Js,{children:[n.jsxs(Xs,{className:"text-xs",children:[P.name,P.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Qs,{children:n.jsx(Zs,{...W,value:W.value??"",required:P.required,placeholder:P.description??"",className:"h-9",disabled:i.formState.isSubmitting})}),n.jsx(Ys,{})]})}},P.name),e[35]=i.control,e[36]=i.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=i.control,e[33]=i.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==N?(w=()=>N(!1),e[38]=N,e[39]=w):w=e[39];let T;e[40]!==i.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:i.formState.isSubmitting,children:"Cancel"}),e[40]=i.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==i.formState.isSubmitting?(I=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(en,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=i.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==i.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:i.formState.isSubmitting,children:I}),e[45]=i.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Us,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==S||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[_,C]}),e[52]=o,e[53]=S,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==i||e[58]!==L?(R=n.jsx(Gs,{...i,children:L}),e[57]=i,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==v||e[61]!==R?(F=n.jsxs(qs,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,R]}),e[60]=v,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==N||e[64]!==F?(z=n.jsx(Vs,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=z):z=e[65],z}function Ct(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function cn(s){return s.storage.mention}function pa(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function un(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:c,id:m,args:p}=t.attrs,i=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=cn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",N=d?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",j=i&&"outline-2 outline-blue-300 outline-offset-0",k=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==k?(y=V("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,k,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=k,e[11]=y):y=e[11];let v;e[12]!==u?(v=u?Ct(u):"",e[12]=u,e[13]=v):v=e[13];let S;return e[14]!==f||e[15]!==b||e[16]!==y||e[17]!==v?(S=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,e[17]=v,e[18]=S):S=e[18],S}const dn=dt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return ft(un)}}),fn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(fn,"")}function Ge(s){const e=$.c(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:c}=pt(),[m,p]=H.useState(!1);let i;e[0]!==c||e[1]!==t||e[2]!==l.text?(i=async()=>{Wt("chat_message_copied",{message_id:t,chars:l.text.length}),await c(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=c,e[1]=t,e[2]=l.text,e[3]=i):i=e[3];const d=i,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:V("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function xa(s,e,t){s.chain().focus().insertContentAt(e,[mn(t),{type:"text",text:" "}]).run()}function mn(s){return{type:"file",attrs:s}}function pn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=f&&"outline-2 outline-blue-300 outline-offset-0";let i;e[2]!==p?(i=V("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=i):i=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==i||e[15]!==g?(b=n.jsx(mt,{className:i,children:g}),e[14]=i,e[15]=g,e[16]=b):b=e[16],b}const xn=dt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return ft(pn)}}),fe=16,Pe=2.5,Ee=(fe-Pe)/2,Re=2*Math.PI*Ee;function gn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let c;e[4]!==f?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let i;e[8]!==r?(i=r.toLocaleString(),e[8]=r,e[9]=i):i=e[9];let d;e[10]!==i?(d=n.jsx("span",{className:"text-right tabular-nums",children:i}),e[10]=i,e[11]=d):d=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=a-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let N;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(N=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=N):N=e[20];let j;e[21]!==o?(j=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=j):j=e[22];let k;e[23]!==h||e[24]!==N||e[25]!==j||e[26]!==d?(k=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,d,x,h,N,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=k):k=e[27];let y;return e[28]!==k||e[29]!==c?(y=n.jsxs(ge,{children:[c,k]}),e[28]=k,e[29]=c,e[30]=y):y=e[30],y}function hn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let c;e[3]!==l||e[4]!==f||e[5]!==t?(c=f&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:f})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=f,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:a?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let i;return e[15]!==c||e[16]!==m||e[17]!==p?(i=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=i):i=e[18],i}function ga(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let i;e[2]!==f?(i=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=i):i=e[3];const d=`Context usage: ${p}%${i}`,x=a?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=V("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let N;e[7]!==h?(N=V(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:N})]}),e[9]=u,e[10]=N,e[11]=j):j=e[11];let k;e[12]!==o?(k=o.toFixed(0),e[12]=o,e[13]=k):k=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==k||e[17]!==y?(v=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[k,"%",y]}),e[16]=k,e[17]=y,e[18]=v):v=e[18];let S;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,e[24]=S):S=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==r?(T=r.toLocaleString(),e[28]=r,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==f||e[37]!==c||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=c,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==S||e[49]!==R?(F=n.jsxs(ge,{children:[S,R]}),e[48]=S,e[49]=R,e[50]=F):F=e[50],F}function bn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ms,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(ds,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function jn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(fs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Mt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=H.useState(null),[u,f]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const i=window.getComputedStyle(p);if(i.overflowY==="auto"||i.overflowY==="scroll"||i.overflow==="auto"||i.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(i=>{const d=i[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,c]),H.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),H.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:c,variant:m,trailing:p,iconDestructive:i,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[N,j]=H.useState(x??!1),{handleCopy:k,copied:y}=pt(),v=o==="loading",S=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||N,C=H.useRef(null),L=v&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:z}=Mt(F),A=c?void 0:j,P=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=v&&"shimmer";let B;e[7]!==W||e[8]!==U||e[9]!==O?(B=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,W,U),e[7]=W,e[8]=U,e[9]=O,e[10]=B):B=e[10];const Y=!T;let K;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==i||e[15]!==S||e[16]!==T?(K=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Qe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",i?"[&>svg]:text-destructive/70":S?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Qe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=i,e[15]=S,e[16]=T,e[17]=K):K=e[17];const Q=S?"text-warning/80":"text-foreground";let X;e[18]!==Q?(X=V("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=X):X=e[19];let Z;e[20]!==X||e[21]!==l?(Z=n.jsx("span",{className:X,children:l}),e[20]=X,e[21]=l,e[22]=Z):Z=e[22];let E;e[23]!==a?(E=a?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=E):E=e[24];let q;e[25]!==p?(q=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=q):q=e[26];let G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let J;e[29]!==B||e[30]!==Y||e[31]!==K||e[32]!==Z||e[33]!==E||e[34]!==q||e[35]!==G||e[36]!==P?(J=n.jsxs(yn,{disabled:P,className:B,"aria-disabled":Y,children:[K,Z,E,q,G]}),e[29]=B,e[30]=Y,e[31]=K,e[32]=Z,e[33]=E,e[34]=q,e[35]=G,e[36]=P,e[37]=J):J=e[37];let ee;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==k||e[43]!==T||e[44]!==z?(ee=T&&n.jsx(jn,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:u}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u})}),n.jsx("button",{type:"button",onClick:()=>k(u),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=k,e[43]=T,e[44]=z,e[45]=ee):ee=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==ee||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[J,ee]}),e[46]=M,e[47]=J,e[48]=ee,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function te(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Lt=4;function Rt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ct,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function vn(s){const e=$.c(27),{org:t}=he(),l=Ut(),r=_s();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Ns,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=Ue(a);let u;e[3]!==o||e[4]!==s?(u=async b=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=await o.callTool({name:"COLLECTION_THREADS_GET",arguments:{id:s}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(S=>S.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},e[3]=o,e[4]=s,e[5]=u):u=e[5];let f,c,m;e[6]!==t.id||e[7]!==l||e[8]!==s?(f=async b=>{const h=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:h});const N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(y=>y.toolName!==b.toolName);return k.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:k}}),{previous:N}},c=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,N.previous),ze.error(b instanceof Error?b.message:"Failed to expand tool")},e[6]=t.id,e[7]=l,e[8]=s,e[9]=f,e[10]=c,e[11]=m):(f=e[9],c=e[10],m=e[11]);let p;e[12]!==u||e[13]!==f||e[14]!==c||e[15]!==m?(p={mutationFn:u,onMutate:f,onSuccess:c,onError:m},e[12]=u,e[13]=f,e[14]=c,e[15]=m,e[16]=p):p=e[16];const i=qt(p);let d;e[17]!==r||e[18]!==i||e[19]!==t.id||e[20]!==l||e[21]!==s?(d=b=>{if(!s||!r)return;const h=me.ensureTask(t.id,s),N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==b.toolName);k.push({...b,expandedAt:new Date().toISOString()});const y={...N?.metadata??{},expanded_tools:k};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),i.mutate(b)},e[17]=r,e[18]=i,e[19]=t.id,e[20]=l,e[21]=s,e[22]=d):d=e[22];const x=d;let g;return e[23]!==x||e[24]!==i.isPending||e[25]!==i.mutate?(g={addOrReplace:i.mutate,addOrReplaceEager:x,isPending:i.isPending},e[23]=x,e[24]=i.isPending,e[25]=i.mutate,e[26]=g):g=e[26],g}function Nn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await ks({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(c=>c.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const kn={read:{icon:Ze,label:"Read File"},write:{icon:Ls,label:"Write File"},edit:{icon:es,label:"Edit File"},grep:{icon:As,label:"Search Content"},glob:{icon:Rs,label:"Find Files"},bash:{icon:Zt,label:"Run Command"},read_tool_output:{icon:Ze,label:"Read Tool Output"},read_resource:{icon:Yt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Ms,label:"Enable Tool"},open_in_agent:{icon:Qt,label:"Open in Agent"},sandbox:{icon:Xt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:zs,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Jt,label:"Inspect Page"}};function Ke(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function _n(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
2
2
  ${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
3
3
  ${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
4
4
  ${l.title}`);else if(l.type==="file")t.push(`## File
@@ -1 +1 @@
1
- import{e as o,j as t,dx as n}from"./index-D6idVW2n.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
1
+ import{e as o,j as t,dx as n}from"./index-DC5ykVbq.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
@@ -1 +1 @@
1
- import{e as S,j as s,r as w,dx as y}from"./index-D6idVW2n.js";import{i as R}from"./Check-BNom5dOo.js";import{t as _}from"./ChevronDown-B21_IsL3.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
1
+ import{e as S,j as s,r as w,dx as y}from"./index-DC5ykVbq.js";import{i as R}from"./Check-COv5M0lh.js";import{t as _}from"./ChevronDown-BdEaOOXp.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
@@ -1 +1 @@
1
- import{r as B,e as D,j as s,q as X,f as Z,g as ee,d as te,b as ne,K as se,n as ie,O as le,l as oe,B as re}from"./index-D6idVW2n.js";import{u as ae}from"./use-connection-f6XTkb53.js";import{S as ce,u as ue,j as de}from"./use-mcp-client-Dutz6IKN.js";import{a as me}from"./Settings02-CnuG-oH5.js";import{P as z}from"./index-D-CqRT4O.js";const ge=B.createContext(null);function F(i){const e=D.c(3),{value:h,children:m}=i,t=h;let l;return e[0]!==m||e[1]!==t?(l=s.jsx(ge.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=l):l=e[2],l}B.createContext(null);function fe(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function _e(i){const e=D.c(60),{bindingName:h,renderEmptyState:m}=i,{org:t,project:l}=X(),T=Z();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:k,taskId:w,pluginId:g}=ee(j);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I={strict:!1},e[1]=I):I=e[1];const G=te(I).virtualmcpid;let P;e[2]!==h?(P={binding:h},e[2]=h,e[3]=P):P=e[3];const K=ae(P),{data:f}=ne.useSession();let _;e[4]!==t.id||e[5]!==t.slug?(_={connectionId:ce,orgId:t.id,orgSlug:t.slug},e[4]=t.id,e[5]=t.slug,e[6]=_):_=e[6];const O=ue(_);let x;e[7]!==g||e[8]!==l.id?(x=se.projectPluginConfig(l.id??"",g),e[7]=g,e[8]=l.id,e[9]=x):x=e[9];let p;e[10]!==g||e[11]!==l.id||e[12]!==O?(p=async()=>{const n=await O.callTool({name:"VIRTUAL_MCP_PLUGIN_CONFIG_GET",arguments:{virtualMcpId:l.id,pluginId:g}});return n.structuredContent??n},e[10]=g,e[11]=l.id,e[12]=O,e[13]=p):p=e[13];const q=!!l.id&&!!g;let v;e[14]!==x||e[15]!==p||e[16]!==q?(v={queryKey:x,queryFn:p,enabled:q},e[14]=x,e[15]=p,e[16]=q,e[17]=v):v=e[17];const{data:V,isLoading:Q}=ie(v),R=V?.config?.connectionId,C=R?K.find(n=>n.id===R):null,y=de({connectionId:C?.id,orgId:t.id,orgSlug:t.slug});let S;e[18]!==f?(S=f?.user?{user:{id:f.user.id,name:f.user.name,email:f.user.email,image:f.user.image}}:null,e[18]=f,e[19]=S):S=e[19];const a=S;let b;e[20]!==t.id||e[21]!==t.name||e[22]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[20]=t.id,e[21]=t.name,e[22]=t.slug,e[23]=b):b=e[23];const c=b;if(Q){let n;return e[24]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[24]=n):n=e[24],n}if(K.length===0){let n;e[25]!==c||e[26]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[25]=c,e[26]=a,e[27]=n):n=e[27];const u=n;let r;e[28]!==m?(r=m(),e[28]=m,e[29]=r):r=e[29];let o;e[30]!==r?(o=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[30]=r,e[31]=o):o=e[31];let d;return e[32]!==u||e[33]!==o?(d=s.jsx(F,{value:u,children:o}),e[32]=u,e[33]=o,e[34]=d):d=e[34],d}if(!C){let n;e[35]!==c||e[36]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[35]=c,e[36]=a,e[37]=n):n=e[37];const u=n;let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(me,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[38]=r):r=e[38];let o;e[39]!==T||e[40]!==t.slug||e[41]!==k||e[42]!==l.id||e[43]!==w||e[44]!==G?(o=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(re,{onClick:()=>{const H=k??t.slug,J=G??l.id??"",W=w??crypto.randomUUID();T({to:"/$org/$taskId",params:{org:H,taskId:W},search:{virtualmcpid:J,main:"settings"}})},children:"Go to Project Settings"})]}),e[39]=T,e[40]=t.slug,e[41]=k,e[42]=l.id,e[43]=w,e[44]=G,e[45]=o):o=e[45];let d;return e[46]!==u||e[47]!==o?(d=s.jsx(F,{value:u,children:o}),e[46]=u,e[47]=o,e[48]=d):d=e[48],d}const Y=C.id,U=fe(C);let N;e[49]!==y?(N=(n,u)=>y?y.callTool({name:n,arguments:u}).then(xe):Promise.reject(new Error("MCP client is not available")),e[49]=y,e[50]=N):N=e[50];const $=N;let E;e[51]!==C||e[52]!==c||e[53]!==a||e[54]!==U||e[55]!==$?(E={connectionId:Y,connection:U,toolCaller:$,org:c,session:a},e[51]=C,e[52]=c,e[53]=a,e[54]=U,e[55]=$,e[56]=E):E=e[56];const A=E;let L;e[57]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(z,{children:s.jsx(z.Content,{children:s.jsx(le,{})})}),e[57]=L):L=e[57];let M;return e[58]!==A?(M=s.jsx(F,{value:A,children:L}),e[58]=A,e[59]=M):M=e[59],M}function xe(i){return i.structuredContent??i}export{_e as P};
1
+ import{r as B,e as D,j as s,q as X,f as Z,g as ee,d as te,b as ne,K as se,n as ie,O as le,l as oe,B as re}from"./index-DC5ykVbq.js";import{u as ae}from"./use-connection-n0123jPK.js";import{S as ce,u as ue,j as de}from"./use-mcp-client-DyuH8eE6.js";import{a as me}from"./Settings02-StPTnFMx.js";import{P as z}from"./index-BQoodOft.js";const ge=B.createContext(null);function F(i){const e=D.c(3),{value:h,children:m}=i,t=h;let l;return e[0]!==m||e[1]!==t?(l=s.jsx(ge.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=l):l=e[2],l}B.createContext(null);function fe(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function _e(i){const e=D.c(60),{bindingName:h,renderEmptyState:m}=i,{org:t,project:l}=X(),T=Z();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:k,taskId:w,pluginId:g}=ee(j);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I={strict:!1},e[1]=I):I=e[1];const G=te(I).virtualmcpid;let P;e[2]!==h?(P={binding:h},e[2]=h,e[3]=P):P=e[3];const K=ae(P),{data:f}=ne.useSession();let _;e[4]!==t.id||e[5]!==t.slug?(_={connectionId:ce,orgId:t.id,orgSlug:t.slug},e[4]=t.id,e[5]=t.slug,e[6]=_):_=e[6];const O=ue(_);let x;e[7]!==g||e[8]!==l.id?(x=se.projectPluginConfig(l.id??"",g),e[7]=g,e[8]=l.id,e[9]=x):x=e[9];let p;e[10]!==g||e[11]!==l.id||e[12]!==O?(p=async()=>{const n=await O.callTool({name:"VIRTUAL_MCP_PLUGIN_CONFIG_GET",arguments:{virtualMcpId:l.id,pluginId:g}});return n.structuredContent??n},e[10]=g,e[11]=l.id,e[12]=O,e[13]=p):p=e[13];const q=!!l.id&&!!g;let v;e[14]!==x||e[15]!==p||e[16]!==q?(v={queryKey:x,queryFn:p,enabled:q},e[14]=x,e[15]=p,e[16]=q,e[17]=v):v=e[17];const{data:V,isLoading:Q}=ie(v),R=V?.config?.connectionId,C=R?K.find(n=>n.id===R):null,y=de({connectionId:C?.id,orgId:t.id,orgSlug:t.slug});let S;e[18]!==f?(S=f?.user?{user:{id:f.user.id,name:f.user.name,email:f.user.email,image:f.user.image}}:null,e[18]=f,e[19]=S):S=e[19];const a=S;let b;e[20]!==t.id||e[21]!==t.name||e[22]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[20]=t.id,e[21]=t.name,e[22]=t.slug,e[23]=b):b=e[23];const c=b;if(Q){let n;return e[24]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[24]=n):n=e[24],n}if(K.length===0){let n;e[25]!==c||e[26]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[25]=c,e[26]=a,e[27]=n):n=e[27];const u=n;let r;e[28]!==m?(r=m(),e[28]=m,e[29]=r):r=e[29];let o;e[30]!==r?(o=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[30]=r,e[31]=o):o=e[31];let d;return e[32]!==u||e[33]!==o?(d=s.jsx(F,{value:u,children:o}),e[32]=u,e[33]=o,e[34]=d):d=e[34],d}if(!C){let n;e[35]!==c||e[36]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[35]=c,e[36]=a,e[37]=n):n=e[37];const u=n;let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(me,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[38]=r):r=e[38];let o;e[39]!==T||e[40]!==t.slug||e[41]!==k||e[42]!==l.id||e[43]!==w||e[44]!==G?(o=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(re,{onClick:()=>{const H=k??t.slug,J=G??l.id??"",W=w??crypto.randomUUID();T({to:"/$org/$taskId",params:{org:H,taskId:W},search:{virtualmcpid:J,main:"settings"}})},children:"Go to Project Settings"})]}),e[39]=T,e[40]=t.slug,e[41]=k,e[42]=l.id,e[43]=w,e[44]=G,e[45]=o):o=e[45];let d;return e[46]!==u||e[47]!==o?(d=s.jsx(F,{value:u,children:o}),e[46]=u,e[47]=o,e[48]=d):d=e[48],d}const Y=C.id,U=fe(C);let N;e[49]!==y?(N=(n,u)=>y?y.callTool({name:n,arguments:u}).then(xe):Promise.reject(new Error("MCP client is not available")),e[49]=y,e[50]=N):N=e[50];const $=N;let E;e[51]!==C||e[52]!==c||e[53]!==a||e[54]!==U||e[55]!==$?(E={connectionId:Y,connection:U,toolCaller:$,org:c,session:a},e[51]=C,e[52]=c,e[53]=a,e[54]=U,e[55]=$,e[56]=E):E=e[56];const A=E;let L;e[57]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(z,{children:s.jsx(z.Content,{children:s.jsx(le,{})})}),e[57]=L):L=e[57];let M;return e[58]!==A?(M=s.jsx(F,{value:A,children:L}),e[58]=A,e[59]=M):M=e[59],M}function xe(i){return i.structuredContent??i}export{_e as P};
@@ -1 +1 @@
1
- import{r as i,bh as $,j as c,dj as L,bi as z,bx as A,a7 as _,a8 as g,dk as b,bk as j,dl as G,dm as w,ds as H,dt as K,ag as U,du as V,dv as W,dw as Z,dn as q,dp as B,dr as J,e as R,c as Q}from"./index-D6idVW2n.js";var m="Popover",[E]=U(m,[w]),P=w(),[X,u]=E(m),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:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=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(b,{...s,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=A(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(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),k=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};k.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(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(M,{...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(M,{...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()}})}),M=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),C=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(q,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...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(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=k,de=D;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,bh as $,j as c,dj as L,bi as z,bx as A,a7 as _,a8 as g,dk as b,bk as j,dl as G,dm as w,ds as H,dt as K,ag as U,du as V,dv as W,dw as Z,dn as q,dp as B,dr as J,e as R,c as Q}from"./index-DC5ykVbq.js";var m="Popover",[E]=U(m,[w]),P=w(),[X,u]=E(m),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:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=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(b,{...s,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=A(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(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),k=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};k.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(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(M,{...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(M,{...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()}})}),M=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),C=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(q,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...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(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=k,de=D;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};