decocms 4.331.0 → 4.331.1

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 (246) hide show
  1. package/dist/client/assets/{AlertCircle-CeJGX1aj.js → AlertCircle-CTUkQXgs.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BImYnimz.js → AreaChart-C7DTOZ-b.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CzjscPeK.js → ArrowLeft-DEDPbgLG.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CbXZzgIn.js → ArrowUp-BC1eUTqQ.js} +1 -1
  5. package/dist/client/assets/{Check-DwC3z1rx.js → Check-DhyLPiiJ.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DDxCuD7T.js → CheckCircle-CtgjJb3s.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BYetryHl.js → ChevronRight-erhjObhH.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-BnCU9Xw2.js → ChevronSelectorVertical-L5QYEswb.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DjeW3rf8.js → ChevronUp-B7eB07ok.js} +1 -1
  10. package/dist/client/assets/{Copy01-DQMea6lD.js → Copy01-xF3K8KuJ.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CuAgtIoq.js → CreditCard01-DasQHOnb.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DHzsSfS0.js → DotsVertical-alsvv1gj.js} +1 -1
  13. package/dist/client/assets/{Download01-CCUcARk8.js → Download01-Carxvlo9.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-iSj6O4tu.js → ErrorBarContext-D1fW4DqU.js} +1 -1
  15. package/dist/client/assets/{Eye-DCY4B_Aq.js → Eye-T_5uiyBH.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-DavFtT7J.js → GitBranch01-F7oOBAG6.js} +1 -1
  17. package/dist/client/assets/{Globe01-CWxN73Or.js → Globe01-Cip-2Ps4.js} +1 -1
  18. package/dist/client/assets/{HardDrive-C1RU_F8K.js → HardDrive-5keoMCkV.js} +1 -1
  19. package/dist/client/assets/{Image01-CZUSsIWJ.js → Image01-B2vrhds6.js} +1 -1
  20. package/dist/client/assets/{Key01-UmvGAYHQ.js → Key01-BDWlMcfg.js} +1 -1
  21. package/dist/client/assets/{Link01-Nzb5ZvLF.js → Link01-C08e0rPS.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dsnt5EOL.js → LinkExternal01-DVFUVB9h.js} +1 -1
  23. package/dist/client/assets/{Monitor01-pKli1vHT.js → Monitor01-BIBipmDF.js} +1 -1
  24. package/dist/client/assets/{Package-BP_9s2JL.js → Package-ZNK4UmQ4.js} +1 -1
  25. package/dist/client/assets/{Palette-BPE_MOvx.js → Palette-BZNwl0Y4.js} +1 -1
  26. package/dist/client/assets/{Play-DhGSA0iw.js → Play-Bdez5_h5.js} +1 -1
  27. package/dist/client/assets/{Plus-BANbQu0C.js → Plus-DpDZOmhb.js} +1 -1
  28. package/dist/client/assets/{SearchMd-b1VauOXm.js → SearchMd-TZRK7Jjy.js} +1 -1
  29. package/dist/client/assets/{Sector-DDM-UAiA.js → Sector-fCAN3APE.js} +1 -1
  30. package/dist/client/assets/{Settings02-DL4qHKPe.js → Settings02-BvEJJ01O.js} +1 -1
  31. package/dist/client/assets/{Share07-Cgan-Cfi.js → Share07-BbKQaSoa.js} +1 -1
  32. package/dist/client/assets/{Shield01-Bbt414S-.js → Shield01-C7gp23VU.js} +1 -1
  33. package/dist/client/assets/{Stars01-D8jFx6hR.js → Stars01-DzR1pkba.js} +1 -1
  34. package/dist/client/assets/{Sun-4ohzmuR2.js → Sun-CRSDN_xr.js} +1 -1
  35. package/dist/client/assets/{Tool01-C18ZpNfv.js → Tool01-BI2Udquq.js} +1 -1
  36. package/dist/client/assets/{Tool02-DrjGknwf.js → Tool02-D8KfndCv.js} +1 -1
  37. package/dist/client/assets/{Trash01-qI-MNO3W.js → Trash01-DMTMR2Ld.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-D8_aoFuw.js → TrendUp01-DBzB_6-8.js} +1 -1
  39. package/dist/client/assets/{Upload01-h9msh4RF.js → Upload01-BaU8BJAh.js} +1 -1
  40. package/dist/client/assets/{User01-W-TGtA_0.js → User01-EYes367B.js} +1 -1
  41. package/dist/client/assets/{UserSquare-Crs1iNVm.js → UserSquare-B0qUe-aI.js} +1 -1
  42. package/dist/client/assets/{Users01-CJas_o50.js → Users01-DKepKoSC.js} +1 -1
  43. package/dist/client/assets/{Users03-iZkxvRLt.js → Users03-Dwp9VmWX.js} +1 -1
  44. package/dist/client/assets/{XCircle-B12Azu0Q.js → XCircle-BsDfD2mO.js} +1 -1
  45. package/dist/client/assets/{XClose-U5JL72PX.js → XClose-B53vZH_B.js} +1 -1
  46. package/dist/client/assets/{Zap-D7GDOY-h.js → Zap-DoRxOrrO.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-CjRBAjBN.js → ZoomOut-DwUiWK8W.js} +1 -1
  48. package/dist/client/assets/{access-gate-Dw4vqU6J.js → access-gate-Bg5o0dFT.js} +1 -1
  49. package/dist/client/assets/{agent-icon-B48zizgx.js → agent-icon-Dp7ilfSA.js} +1 -1
  50. package/dist/client/assets/{agents-list-B92n23Ou.js → agents-list-FPxN9IOf.js} +1 -1
  51. package/dist/client/assets/{ai-providers-CrL7749i.js → ai-providers-D7PLItv9.js} +1 -1
  52. package/dist/client/assets/{alert-uSRYjM9c.js → alert-CnJoV69d.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-C9B_UVL_.js → alert-dialog-CFvtxInl.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-D2rbH2QN.js → analytics-tab-CMEI20XU.js} +1 -1
  55. package/dist/client/assets/{api-keys-sNY1Rre8.js → api-keys-C9nPFDfD.js} +1 -1
  56. package/dist/client/assets/api-keys-D2YehNxd.js +1 -0
  57. package/dist/client/assets/{app-editor-DW3zJhgQ.js → app-editor-CWnLKzg3.js} +1 -1
  58. package/dist/client/assets/{auth-BRsOzYq2.js → auth-CPKG1PMF.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-B5pNriiM.js → auth-catchall-CakNmAFy.js} +1 -1
  60. package/dist/client/assets/{auth-entry-5XM8llWP.js → auth-entry-RnBUxeeA.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-0T7TkoQQ.js → auth-split-layout-kNG-EnWA.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-DmW5k2KW.js → authenticate-and-persist-oauth-DHpekAO-.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DbQbxIBH.js → automation-list-row-C09iz2n2.js} +1 -1
  64. package/dist/client/assets/{automation-runs-BTUw3uBv.js → automation-runs-CAkFynJ2.js} +1 -1
  65. package/dist/client/assets/{automations-su9ERGi_.js → automations-BqJaQO-O.js} +1 -1
  66. package/dist/client/assets/{avatar-CNX9dPWO.js → avatar-CYvGTxVT.js} +1 -1
  67. package/dist/client/assets/{badge-DFCpQXcf.js → badge-jE0YdZz3.js} +1 -1
  68. package/dist/client/assets/{block-document-CY7wphTC.js → block-document-B9qbgFtn.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-BLaxQkWE.js → breadcrumb-DKP8gBQX.js} +1 -1
  70. package/dist/client/assets/{buckets-aXIjaMHW.js → buckets-D5dyQWsL.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-Bsi16ls-.js → bulk-category-panel-B87XiH9C.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DNDy9nsX.js → capability-load-error-CAVNGlum.js} +1 -1
  73. package/dist/client/assets/{cards--0c2HVU8.js → cards-BqL2dW3x.js} +1 -1
  74. package/dist/client/assets/{category-editor-BZCHHQVe.js → category-editor-YbrcictE.js} +1 -1
  75. package/dist/client/assets/{cdn-tab-C2KgOzv3.js → cdn-tab-BCSDeMOv.js} +1 -1
  76. package/dist/client/assets/{chart-C4lX7RVi.js → chart-CZch6DZp.js} +1 -1
  77. package/dist/client/assets/{chat-context-C97ngXtn.js → chat-context-BEHg6aEi.js} +1 -1
  78. package/dist/client/assets/{checkbox-C2aLrWKH.js → checkbox-DMdSKryI.js} +1 -1
  79. package/dist/client/assets/{choose-editor-CIm9FomR.js → choose-editor-B4jBLX09.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-DsYRoAC-.js → cli-auth-success-CAD1lTgl.js} +1 -1
  81. package/dist/client/assets/{client-icons-DcgI21MG.js → client-icons-jyguvoVn.js} +1 -1
  82. package/dist/client/assets/{collection-detail-C7Lua4LN.js → collection-detail-1jWQu8QJ.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-DLNI5DR9.js → collection-display-button-DI-nsDCn.js} +1 -1
  84. package/dist/client/assets/{collection-search-B0Ems0e3.js → collection-search-CoaljN3t.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-yKl-NYAt.js → collection-table-wrapper-Cjvx4Wv2.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-DWuBMe93.js → collection-tabs-DV5Bk6yE.js} +1 -1
  87. package/dist/client/assets/{command-44bpz2f7.js → command-DHa5RJaq.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-9urcWgyE.js → commerce-onboarding-B0oP2xjO.js} +1 -1
  89. package/dist/client/assets/{connect-BZ6z9xkv.js → connect-CHfvFOxu.js} +1 -1
  90. package/dist/client/assets/{connect-layout-D1-Yv6Nt.js → connect-layout-MA2Awb7r.js} +1 -1
  91. package/dist/client/assets/{connection-aFTZVtta.js → connection-BBdo3uke.js} +1 -1
  92. package/dist/client/assets/{connection-card-BLXD5mcy.js → connection-card-B3IJPiNj.js} +1 -1
  93. package/dist/client/assets/{connection-detail-CZq3EAy_.js → connection-detail-Lxtie76t.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-C0_ULCSn.js → connection-form-helpers-Do9xG8iy.js} +1 -1
  95. package/dist/client/assets/{connections-CakdZreO.js → connections-Cme4XVUa.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-B-H-rzfh.js → create-organization-dialog-CDLw0Z3U.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-BUcLYmbe.js → decopilot-sse-pool-DuxzrK6E.js} +1 -1
  98. package/dist/client/assets/{dialog-RbA7IheM.js → dialog--s8x0s1I.js} +1 -1
  99. package/dist/client/assets/{domain-settings-Bwlm7ElE.js → domain-settings-D_b5aj2K.js} +1 -1
  100. package/dist/client/assets/{drawer-BrDS1G0V.js → drawer-BhTJZiCl.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-o3ET1Hdn.js → dropdown-menu-B1CAYfZn.js} +1 -1
  102. package/dist/client/assets/{e2e-tab-D9MBFymX.js → e2e-tab-BfF-aLBq.js} +1 -1
  103. package/dist/client/assets/{editor-DRD3n37q.js → editor-C2YJx_fu.js} +1 -1
  104. package/dist/client/assets/{empty-state-C8riWqwz.js → empty-state-BeZZ6aWm.js} +1 -1
  105. package/dist/client/assets/{empty-state-CF09AK7Y.js → empty-state-co5TrSoZ.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-BwNCLN99.js → extract-connection-data-ovzHbL2Q.js} +1 -1
  107. package/dist/client/assets/{file-explorer-DUZbQ7ED.js → file-explorer-BMq9QxXt.js} +1 -1
  108. package/dist/client/assets/{file-type-icon-BjTldwkh.js → file-type-icon-CCcQ6AAf.js} +1 -1
  109. package/dist/client/assets/{folder-icon-CYpCXucT.js → folder-icon-B0WjuCw8.js} +1 -1
  110. package/dist/client/assets/{form-7-guzABw.js → form-Bz464I8y.js} +1 -1
  111. package/dist/client/assets/{general-BrSVrq_U.js → general-CTShTVqj.js} +1 -1
  112. package/dist/client/assets/{github-repo-picker-vPoyODrr.js → github-repo-picker-CardHb2H.js} +1 -1
  113. package/dist/client/assets/{hooks-D74-rHgb.js → hooks-BVfnO0Aw.js} +1 -1
  114. package/dist/client/assets/{hosting-tab-BEUO6vdv.js → hosting-tab-eRzJDwNq.js} +1 -1
  115. package/dist/client/assets/{index-DWKe_Q7c.js → index-BbswpEHj.js} +1 -1
  116. package/dist/client/assets/{index-LU2AC7M4.js → index-Bddb2TOb.js} +1 -1
  117. package/dist/client/assets/{index-Dok2Onq9.js → index-CMU-J5F2.js} +1 -1
  118. package/dist/client/assets/{index-DtObLnN2.js → index-CNdagDd8.js} +1 -1
  119. package/dist/client/assets/{index-dcLtXjb9.js → index-CXAF3w4w.js} +1 -1
  120. package/dist/client/assets/{index-B0xJaq-R.js → index-CX_Uh4IL.js} +1 -1
  121. package/dist/client/assets/{index-Cy-Ifi83.js → index-DDup5Pv4.js} +6 -6
  122. package/dist/client/assets/{index-BwV1-h20.js → index-DEh6Md0L.js} +1 -1
  123. package/dist/client/assets/{index-1nlVNgxn.js → index-Db96eOyL.js} +2 -2
  124. package/dist/client/assets/{index-wcC_uVXg.js → index-q60P7Zs8.js} +1 -1
  125. package/dist/client/assets/{index-redirect-DI_a-Brr.js → index-redirect-KOgwebWE.js} +1 -1
  126. package/dist/client/assets/{infra-billing-Bl6JKrbN.js → infra-billing-BVgEtduf.js} +1 -1
  127. package/dist/client/assets/{input-Bh_UVYjo.js → input-Cwwyr7Rh.js} +1 -1
  128. package/dist/client/assets/{integration-icon-C9yUDokb.js → integration-icon-B5SelfUS.js} +1 -1
  129. package/dist/client/assets/{invite-member-dialog-DjQvCxT2.js → invite-member-dialog-C1bUVNWi.js} +1 -1
  130. package/dist/client/assets/{label-CPshF2pU.js → label-D_vdFESC.js} +1 -1
  131. package/dist/client/assets/{layout-IKXh8SmL.js → layout-CgD5MMGX.js} +1 -1
  132. package/dist/client/assets/{login-Dhs_LgNz.js → login-BKtn9Zk-.js} +1 -1
  133. package/dist/client/assets/{markdown-BUVdPg3H.js → markdown-BTQo5HHG.js} +1 -1
  134. package/dist/client/assets/{mcp-oauth-DBHQjyoD.js → mcp-oauth-BPMpNuFO.js} +1 -1
  135. package/dist/client/assets/{members-CDrg_x6h.js → members-CJF6NKF4.js} +1 -1
  136. package/dist/client/assets/{monaco-editor-B8Fm73Ld.js → monaco-editor-CqhlT806.js} +1 -1
  137. package/dist/client/assets/{monitoring-stats-row-DANohFMf.js → monitoring-stats-row-CZhvYRwq.js} +1 -1
  138. package/dist/client/assets/{multi-select-Dz5hSv6H.js → multi-select-CjXByEMA.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-XpDejOwo.js → oauth-callback-DlWi0e5v.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-ED4SOqW-.js → oauth-callback-ai-provider-CeDxg54Z.js} +1 -1
  141. package/dist/client/assets/{onboarding-BwlKj9DR.js → onboarding-CppmVf6x.js} +1 -1
  142. package/dist/client/assets/{org-layout-CtfHpZVe.js → org-layout-39ZF5JVf.js} +1 -1
  143. package/dist/client/assets/{organization-choice-D2BDC1IL.js → organization-choice-D3M0mKax.js} +1 -1
  144. package/dist/client/assets/{orgs-BjftqeVg.js → orgs-CGyMtTjb.js} +1 -1
  145. package/dist/client/assets/{page-seo-form-kX4FCj4v.js → page-seo-form-CvkcVW5N.js} +1 -1
  146. package/dist/client/assets/{popover-CHu9OoAU.js → popover-BJRufN5E.js} +1 -1
  147. package/dist/client/assets/{post-calendar-CZvePpWi.js → post-calendar-DECkti-b.js} +1 -1
  148. package/dist/client/assets/{post-editor-B9--qYPG.js → post-editor-CUpCPNXF.js} +1 -1
  149. package/dist/client/assets/{primitives-AiNdPl89.js → primitives-tNTHzhGL.js} +1 -1
  150. package/dist/client/assets/{profile-XOvnwp8G.js → profile-CD4pVSnx.js} +1 -1
  151. package/dist/client/assets/{project-app-view-Cwd_PO9C.js → project-app-view-mek55VZ7.js} +1 -1
  152. package/dist/client/assets/{project-icon-B09v6EvP.js → project-icon-DW2b1tpw.js} +1 -1
  153. package/dist/client/assets/{prompts-BlywLHYY.js → prompts-ylc2vOB7.js} +1 -1
  154. package/dist/client/assets/record-editor-C_Y7e52y.js +1 -0
  155. package/dist/client/assets/redirect-editor-COuJvUl5.js +1 -0
  156. package/dist/client/assets/registry-Up5B6LrP.js +2 -0
  157. package/dist/client/assets/{registry-layout-DhGQCgPe.js → registry-layout-DDAVBECZ.js} +1 -1
  158. package/dist/client/assets/{reports-AZqE3FZg.js → reports-Ce4vS7W7.js} +1 -1
  159. package/dist/client/assets/{require-capability-sqTle2Fa.js → require-capability-sWsoOFc2.js} +1 -1
  160. package/dist/client/assets/{required-auth-layout-BPvtlMuF.js → required-auth-layout-CokOUEgr.js} +1 -1
  161. package/dist/client/assets/{reset-password-CSV5VUVH.js → reset-password-ZJVFaRMm.js} +1 -1
  162. package/dist/client/assets/{review-settings-DqhU3Tk0.js → review-settings-BVtqlS7Y.js} +1 -1
  163. package/dist/client/assets/roles-DDTREEXS.js +1 -0
  164. package/dist/client/assets/{schema-DYE3f2lq.js → schema-D3Zdtr4A.js} +1 -1
  165. package/dist/client/assets/{scroll-area-DOQU287w.js → scroll-area-CeOD07Hw.js} +1 -1
  166. package/dist/client/assets/{search-input-CvsG48c7.js → search-input-D5IwxOW_.js} +1 -1
  167. package/dist/client/assets/{secrets-B4Yh-DKc.js → secrets-DQbg3yxG.js} +1 -1
  168. package/dist/client/assets/{sections-editor-BnQciha7.js → sections-editor-BG-tuDpJ.js} +1 -1
  169. package/dist/client/assets/{select-HaMFNCEI.js → select-CaIqJLnH.js} +1 -1
  170. package/dist/client/assets/{select-model-DWMhwNPs.js → select-model-BaaM-99e.js} +1 -1
  171. package/dist/client/assets/{self-tool-result-ClyhUtjJ.js → self-tool-result-EE9JsxOL.js} +1 -1
  172. package/dist/client/assets/{seo-editor-DXov33O1.js → seo-editor-BUI6GRns.js} +1 -1
  173. package/dist/client/assets/settings-layout-gBQs_ZGW.js +1 -0
  174. package/dist/client/assets/{settings-sidebar-Bja2pzq0.js → settings-sidebar-DGHR5cgg.js} +1 -1
  175. package/dist/client/assets/{shell-controls-DQbjapvr.js → shell-controls-1hzI1GBL.js} +1 -1
  176. package/dist/client/assets/{shell-layout-pJ3SWts0.js → shell-layout--n0X6oT8.js} +1 -1
  177. package/dist/client/assets/{skill-preview-Bkt9-1nT.js → skill-preview-C5-e77Iq.js} +1 -1
  178. package/dist/client/assets/{skills-BJoFOee1.js → skills-DnPgPbsQ.js} +1 -1
  179. package/dist/client/assets/{sso-v1ShUMRn.js → sso-2iOnxIqW.js} +1 -1
  180. package/dist/client/assets/{store-8kZqr41n.js → store-4cjHStMO.js} +1 -1
  181. package/dist/client/assets/store-registry-CiA81JKH.js +2 -0
  182. package/dist/client/assets/{switch-BtR8WZ52.js → switch-H6mW7TWR.js} +1 -1
  183. package/dist/client/assets/{synced-repos-BLS9thb0.js → synced-repos-Bg__UD_R.js} +1 -1
  184. package/dist/client/assets/{table-3iU2ypXW.js → table-D4EsPh8H.js} +1 -1
  185. package/dist/client/assets/{tabs-BLXnhEIS.js → tabs-DI7MVoHq.js} +1 -1
  186. package/dist/client/assets/{task-board-DD60a6Wz.js → task-board-CPnu2vHn.js} +1 -1
  187. package/dist/client/assets/{task-route-CIm49PI2.js → task-route-BTZYbUm0.js} +1 -1
  188. package/dist/client/assets/{tasks-D8auuWY1.js → tasks-DNY41pOF.js} +1 -1
  189. package/dist/client/assets/{textarea-Bgm417OP.js → textarea-fFyq39OK.js} +1 -1
  190. package/dist/client/assets/{thread-intent-5WHIjvYR.js → thread-intent-BpQob6u5.js} +1 -1
  191. package/dist/client/assets/{thread-route-DjJKU-k5.js → thread-route-DnMeCT5b.js} +1 -1
  192. package/dist/client/assets/{toggle-group-Cljr_L-y.js → toggle-group-5X5OVxvO.js} +1 -1
  193. package/dist/client/assets/{toolbar-ZyieXU9W.js → toolbar-CygYAeNY.js} +1 -1
  194. package/dist/client/assets/{toolbar-icon-button-B1L3M1az.js → toolbar-icon-button-BjsE6ye3.js} +1 -1
  195. package/dist/client/assets/{track-BcGj_lMs.js → track-YMOI2TKV.js} +1 -1
  196. package/dist/client/assets/{types-CKOZt2hR.js → types-D618nSWF.js} +1 -1
  197. package/dist/client/assets/{use-ai-providers-DmrtFZ3b.js → use-ai-providers-9OMyWZ-c.js} +1 -1
  198. package/dist/client/assets/{use-automations-DYhybc22.js → use-automations-B7rq5y89.js} +1 -1
  199. package/dist/client/assets/{use-autosave-DSVdvb0E.js → use-autosave-B1LwduED.js} +1 -1
  200. package/dist/client/assets/{use-connection-BFZIwSmK.js → use-connection-Dy0Z_WuU.js} +1 -1
  201. package/dist/client/assets/{use-copy-BM2RAZ1Q.js → use-copy-BtAcYms1.js} +1 -1
  202. package/dist/client/assets/{use-create-virtual-mcp-C-Ogs2Q-.js → use-create-virtual-mcp-wM5JPyhO.js} +1 -1
  203. package/dist/client/assets/{use-debounced-autosave-60cBP7wJ.js → use-debounced-autosave-C9ED2M-K.js} +1 -1
  204. package/dist/client/assets/{use-debounced-value-Dr0xObbz.js → use-debounced-value-CNLUOYR4.js} +1 -1
  205. package/dist/client/assets/{use-decopilot-events-DaVkBR_8.js → use-decopilot-events-CXqAHm8B.js} +1 -1
  206. package/dist/client/assets/{use-delete-connection-BsLduKUe.js → use-delete-connection-Cd3jvMUJ.js} +1 -1
  207. package/dist/client/assets/{use-deployment-admin-BsLn-GEH.js → use-deployment-admin-DlTRBf6Y.js} +1 -1
  208. package/dist/client/assets/{use-destination-route-iMqy_40D.js → use-destination-route-BlaUDv1t.js} +1 -1
  209. package/dist/client/assets/{use-file-configs-BLRF4b-d.js → use-file-configs-DDYv5LKG.js} +1 -1
  210. package/dist/client/assets/{use-infinite-scroll-BaRAvP_7.js → use-infinite-scroll-DO_cvi6-.js} +1 -1
  211. package/dist/client/assets/{use-join-requests-DzICLdFR.js → use-join-requests-CcTLOzEb.js} +1 -1
  212. package/dist/client/assets/{use-mcp-auth-status-CzPd86bJ.js → use-mcp-auth-status-Dj8UnSed.js} +1 -1
  213. package/dist/client/assets/{use-mcp-client-DkhuXiKH.js → use-mcp-client-CrXQAzxs.js} +1 -1
  214. package/dist/client/assets/{use-mcp-prompts-CsXBZ61_.js → use-mcp-prompts-DVBCzZJ3.js} +1 -1
  215. package/dist/client/assets/{use-members-CAFVp1hA.js → use-members-C8Hqv8-u.js} +1 -1
  216. package/dist/client/assets/{use-navigate-to-agent-CEI8-w2f.js → use-navigate-to-agent-VH5AAfU9.js} +1 -1
  217. package/dist/client/assets/{use-org-auth-client-DBxDKgZ2.js → use-org-auth-client-FRXGLizb.js} +1 -1
  218. package/dist/client/assets/{use-org-sso-YF1jLuNo.js → use-org-sso-DqIp7ddK.js} +1 -1
  219. package/dist/client/assets/{use-organization-roles-CkDRzg03.js → use-organization-roles-DL-rDg8L.js} +1 -1
  220. package/dist/client/assets/{use-organization-settings-BiuiGhzw.js → use-organization-settings-CEqsZkOR.js} +1 -1
  221. package/dist/client/assets/{use-panel-navigate-DnWk3vmb.js → use-panel-navigate-Bh-F8soa.js} +1 -1
  222. package/dist/client/assets/{use-registry-connections-CuQgnoP3.js → use-registry-connections-B4qaPIZH.js} +1 -1
  223. package/dist/client/assets/{use-secrets-BTvuuF7f.js → use-secrets-BJkbp2he.js} +1 -1
  224. package/dist/client/assets/{use-section-preview-base-udD-RNT7.js → use-section-preview-base-BTYgiL8q.js} +1 -1
  225. package/dist/client/assets/{use-status-sounds-B7IK59pi.js → use-status-sounds-Buxe5MUi.js} +1 -1
  226. package/dist/client/assets/{use-tags-BsQ8VONn.js → use-tags-DrEQnufT.js} +1 -1
  227. package/dist/client/assets/{use-view-mode-BthYYl5V.js → use-view-mode-gLSPt8Er.js} +1 -1
  228. package/dist/client/assets/{use-virtual-mcp-CikmlP55.js → use-virtual-mcp-TDdC23NB.js} +1 -1
  229. package/dist/client/assets/useInfiniteQuery-qy981KB_.js +1 -0
  230. package/dist/client/assets/useSuspenseInfiniteQuery-BeaYkvve.js +1 -0
  231. package/dist/client/assets/{users-tF-soVEt.js → users-CzhwlFsm.js} +1 -1
  232. package/dist/client/assets/{variant-calendar-CUzI_Hea.js → variant-calendar-DGlZ6rr7.js} +1 -1
  233. package/dist/client/assets/{view-mode-toggle-BTgIouk8.js → view-mode-toggle-BSAUX2AE.js} +1 -1
  234. package/dist/client/index.html +1 -1
  235. package/dist/server/cli.js +583 -581
  236. package/dist/server/server.js +370 -368
  237. package/package.json +1 -1
  238. package/dist/client/assets/api-keys-C7lkp7R_.js +0 -1
  239. package/dist/client/assets/record-editor-D_Qh2jY6.js +0 -1
  240. package/dist/client/assets/redirect-editor-ZQwzY_s2.js +0 -1
  241. package/dist/client/assets/registry-Bjy1jnUl.js +0 -2
  242. package/dist/client/assets/roles-5ocMzQSi.js +0 -1
  243. package/dist/client/assets/settings-layout-BEQC50_J.js +0 -1
  244. package/dist/client/assets/store-registry-BApi5Y5i.js +0 -2
  245. package/dist/client/assets/useInfiniteQuery-DOlgdhKt.js +0 -1
  246. package/dist/client/assets/useSuspenseInfiniteQuery-DLZjjZgA.js +0 -1
@@ -1 +1 @@
1
- import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-1nlVNgxn.js";import{I as ee}from"./input-Bh_UVYjo.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{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"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await Qe(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
1
+ import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-Db96eOyL.js";import{I as ee}from"./input-Cwwyr7Rh.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{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"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await Qe(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
@@ -1 +1 @@
1
- import{c as g,l as p,j as f}from"./index-1nlVNgxn.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
1
+ import{c as g,l as p,j as f}from"./index-Db96eOyL.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
@@ -1 +1 @@
1
- import"./index-1nlVNgxn.js";import{i as u,a as p}from"./mcp-oauth-DBHQjyoD.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
1
+ import"./index-Db96eOyL.js";import{i as u,a as p}from"./mcp-oauth-BPMpNuFO.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -1 +1 @@
1
- import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-1nlVNgxn.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-C9B_UVL_.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-o3ET1Hdn.js";import{A as me,ay as ue}from"./agent-icon-B48zizgx.js";import{i as de}from"./DotsVertical-DHzsSfS0.js";import{s as fe}from"./Trash01-qI-MNO3W.js";import{i as ge}from"./Zap-D7GDOY-h.js";import{u as xe}from"./use-virtual-mcp-CikmlP55.js";import{u as pe}from"./use-automations-DYhybc22.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
1
+ import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-Db96eOyL.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-CFvtxInl.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-B1CAYfZn.js";import{A as me,ay as ue}from"./agent-icon-Dp7ilfSA.js";import{i as de}from"./DotsVertical-alsvv1gj.js";import{s as fe}from"./Trash01-DMTMR2Ld.js";import{i as ge}from"./Zap-DoRxOrrO.js";import{u as xe}from"./use-virtual-mcp-TDdC23NB.js";import{u as pe}from"./use-automations-B7rq5y89.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
@@ -1,4 +1,4 @@
1
- import{r as L,c as _,b as Y,ar as m1,j as p,h as hf,B as Ln,ag as Uc,ae as g1,aq as y1,cD as pf,cE as x1,aB as b1,b9 as $n,cF as v1,l as Q,o as k1,a1 as _n,a2 as Bn,a4 as zn,bp as S1,bm as pl,bt as C1,bs as w1,cG as N1,bq as M1,cH as T1,bo as E1,G as xt,n as mf,a7 as gf,e as D1,K as ht,t as fa,m as ni,E as yf,b7 as xf,a9 as O1,cI as bf,p as A1,bg as vf,bh as kf,bi as Sf,bj as Cf,d as ml,cJ as I1,cK as j1,bw as qc,b2 as R1}from"./index-1nlVNgxn.js";import{aE as P1,aX as L1,aY as $1,C as _1,k as B1,u as ha,am as z1,i as Kc,ax as F1,m as H1,aZ as W1,aV as wf,a_ as V1,s as pa,a$ as Nf,A as Mf,b0 as wt,b1 as U1,aF as q1,j as K1,z as Y1,b2 as J1,b3 as G1}from"./agent-icon-B48zizgx.js";import{i as ma}from"./ChevronRight-BYetryHl.js";import{u as X1}from"./useInfiniteQuery-DOlgdhKt.js";import{a as Tf,u as Q1}from"./use-connection-BFZIwSmK.js";import{c as Z1,u as gl}from"./use-mcp-client-DkhuXiKH.js";import{a as e0}from"./use-virtual-mcp-CikmlP55.js";import{c as t0,e as n0,a as Ef,d as Tr,b as r0,T as Er}from"./table-3iU2ypXW.js";import{E as Yc}from"./empty-state-C8riWqwz.js";import{u as Df}from"./use-infinite-scroll-BaRAvP_7.js";import{a as s0}from"./use-members-CAFVp1hA.js";import{i as yl}from"./AlertCircle-CeJGX1aj.js";import{i as o0}from"./CheckCircle-DDxCuD7T.js";import{a as i0}from"./DotsVertical-DHzsSfS0.js";import{i as Of,a as a0}from"./XCircle-B12Azu0Q.js";import{e as l0}from"./use-automations-DYhybc22.js";import{u as c0}from"./useSuspenseInfiniteQuery-DLZjjZgA.js";import{A as u0}from"./avatar-CNX9dPWO.js";import{t as Af,n as d0}from"./ChevronUp-DjeW3rf8.js";import{t as f0,b as If,n as jf}from"./Tool02-DrjGknwf.js";import{t as ri}from"./Stars01-D8jFx6hR.js";import{i as xl}from"./Check-DwC3z1rx.js";import{a as Rf}from"./Copy01-DQMea6lD.js";import{b as Fn,t as bl,c as Jc}from"./format-time-BnbuEtat.js";import{u as Pf}from"./use-copy-BM2RAZ1Q.js";import{M as vl,I as h0}from"./markdown-BUVdPg3H.js";import{d as p0,a as m0,r as g0,e as y0}from"./hooks-D74-rHgb.js";import{k as wr,q as x0,b as vs,a as b0,D as v0}from"./chat-context-C97ngXtn.js";import{c as k0}from"./monaco-editor-B8Fm73Ld.js";import{g as Lf,M as S0}from"./types-CKOZt2hR.js";import{s as C0}from"./Eye-DCY4B_Aq.js";import{s as w0}from"./XClose-U5JL72PX.js";import{b as N0,a as M0}from"./Tool01-C18ZpNfv.js";import{i as T0}from"./Share07-Cgan-Cfi.js";import{i as E0}from"./SearchMd-b1VauOXm.js";import{b as D0,d as O0}from"./shell-layout-pJ3SWts0.js";import{a as kl}from"./use-panel-navigate-DnWk3vmb.js";import{a as Ps}from"./Image01-CZUSsIWJ.js";import{n as $f}from"./LinkExternal01-Dsnt5EOL.js";import{I as Kn}from"./integration-icon-C9yUDokb.js";import{b as Sl}from"./Users03-iZkxvRLt.js";import{a as Nt}from"./Palette-BPE_MOvx.js";import{u as _f}from"./use-navigate-to-agent-CEI8-w2f.js";import{i as Ls}from"./Link01-Nzb5ZvLF.js";import{e as A0,i as Bf,a as zf,S as I0}from"./constants-DNuUCxmW.js";import{g as j0}from"./use-mcp-prompts-CsXBZ61_.js";import{d as R0,c as P0,e as L0,b as $0,D as _0}from"./dialog-RbA7IheM.js";import{F as B0,d as z0,a as F0,e as H0,b as W0,c as V0}from"./form-7-guzABw.js";import{I as U0}from"./input-Bh_UVYjo.js";import{i as q0}from"./Globe01-CWxN73Or.js";import{i as K0}from"./Monitor01-pKli1vHT.js";import{n as Y0}from"./Download01-CCUcARk8.js";import{F as J0}from"./file-type-icon-BjTldwkh.js";import{u as G0}from"./use-decopilot-events-DaVkBR_8.js";const X0={openrouter:t=>{const e=t?.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 Ff(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(X0)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function Hf(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Wf(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+Ff(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function Cl(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function qO(t){return t.reduce((e,n)=>Wf(e,n.metadata?.usage),Hf())}const Q0={damping:.7,stiffness:.05,mass:1.25},Z0=70,ey=1e3/60,ty=350;let si=!1;globalThis.document?.addEventListener("mousedown",()=>{si=!0});globalThis.document?.addEventListener("mouseup",()=>{si=!1});globalThis.document?.addEventListener("click",()=>{si=!1});const ny=(t={})=>{const[e,n]=L.useState(!1),[r,s]=L.useState(t.initial!==!1),[o,i]=L.useState(!1),a=L.useRef(null);a.current=t;const l=L.useCallback(()=>{if(!si)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),c=L.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=L.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=L.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:k}=getComputedStyle(g.current);k!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,d.ignoreScrollToTop=g.current.scrollTop,k!=="auto"&&(g.current.style.scrollBehavior=k)}},get targetScrollTop(){return!g.current||!x.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!x.current)return 0;const{targetScrollTop:v}=this;if(!t.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(v,{scrollElement:g.current,contentElement:x.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:k},requestAnimationFrame(()=>{b=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Z0}}},[]),f=L.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const v=Date.now()+(Number(b.wait)||0),k=Mi(a.current,b.animation),{ignoreEscapes:N=!1}=b;let C,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{C=Date.now()}):C=v+(b.duration??0);const w=async()=>{const M=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,O=performance.now(),A=(O-(d.lastTick??O))/ey;if(d.animation||(d.animation={behavior:k,promise:M,ignoreEscapes:N}),d.animation.behavior===k&&(d.lastTick=O),l()||v>Date.now())return w();if(T<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return w()}return C>Date.now()?(S=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Mi(a.current,a.current.resize),ignoreEscapes:N,duration:Math.max(0,C-Date.now())||void 0}):d.isAtBottom)});return M.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:w()},[c,l,d]),h=L.useCallback(()=>{u(!0),c(!1)},[u,c]),m=L.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:k}=d;let{lastScrollTop:N=v}=d;d.lastScrollTop=v,d.ignoreScrollToTop=void 0,k&&k>v&&(N=k),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||v===k)return;if(l()){u(!0),c(!1);return}const C=v>N,S=v<N;if(d.animation?.ignoreEscapes){d.scrollTop=N;return}S&&(u(!0),c(!1)),C&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,l,d]),y=L.useCallback(({target:b,deltaY:v})=>{let k=b;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),g=Gc(b=>{g.current?.removeEventListener("scroll",m),g.current?.removeEventListener("wheel",y),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",y,{passive:!0})},[]),x=Gc(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let v;d.resizeObserver=new ResizeObserver(([k])=>{const{height:N}=k.contentRect,C=N-(v??N);if(d.resizeDifference=C,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),C>=0){const S=Mi(a.current,v?a.current.resize:a.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:ty})}else d.isNearBottom&&(u(!1),c(!0));v=N,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===C&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:g,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function Gc(t,e){const n=L.useCallback(r=>(n.current=r,t(r)),e);return n}const Ni=new Map;function Mi(...t){const e={...Q0};let n=!1;for(const s of t){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return Ni.has(r)||Ni.set(r,Object.freeze(e)),n?"instant":Ni.get(r)}function ry(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function wl(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Nl(t,e){if(!e)return t;const n=`${ry(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function sy(t,e){return Nl(t,e).replace(/[_-]/g," ").toLowerCase()}function oy(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?Uc().min(1,e):Uc();return g1(n)}function iy(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function ay(t){const e=_.c(74),{prompt:n,setPrompt:r,onSubmit:s,defaultValues:o}=t,i=L.useId(),a=Y();let l,c;if(e[0]!==n||e[1]!==a){const W=oy(n,a("chat.dialogPromptArguments.required"));c=y1,l=m1(W),e[0]=n,e[1]=a,e[2]=l,e[3]=c}else l=e[2],c=e[3];let u;e[4]!==o||e[5]!==n?(u=n?iy(n,o):{},e[4]=o,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==u?(d={resolver:l,defaultValues:u,mode:"onChange"},e[7]=l,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const m=h;let y;e[12]!==f||e[13]!==s||e[14]!==r?(y=async W=>{await s(W),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=y):y=e[15];const g=y;let x;e[16]!==f||e[17]!==r?(x=W=>{W||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=x):x=e[18];const b=x;if(!n)return null;let v;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(v=n.title||sy(n.name,wl(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=v):v=e[22];let k;e[23]!==v?(k=p.jsx(R0,{children:p.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=k):k=e[24];let N;e[25]!==n.description?(N=n.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=N):N=e[26];let C;e[27]!==N||e[28]!==k?(C=p.jsxs(P0,{children:[k,N]}),e[27]=N,e[28]=k,e[29]=C):C=e[29];let S;e[30]!==f||e[31]!==g?(S=W=>{W.stopPropagation(),f.handleSubmit(g)(W)},e[30]=f,e[31]=g,e[32]=S):S=e[32];let w;if(e[33]!==m||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==a){let W;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==a?(W=q=>p.jsx(z0,{control:f.control,name:q.name,render:G=>{const{field:te}=G;return p.jsxs(F0,{children:[p.jsxs(H0,{className:"text-xs",children:[q.name,q.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",a("chat.dialogPromptArguments.optional")]})]}),p.jsx(W0,{children:p.jsx(U0,{...te,value:te.value??"",required:q.required,placeholder:q.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(V0,{})]})}},q.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=a,e[41]=W):W=e[41],w=m.map(W),e[33]=m,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=a,e[37]=w}else w=e[37];let M;e[42]!==b?(M=()=>b(!1),e[42]=b,e[43]=M):M=e[43];const T=f.formState.isSubmitting;let O;e[44]!==a?(O=a("chat.dialogPromptArguments.cancel"),e[44]=a,e[45]=O):O=e[45];let A;e[46]!==f.formState.isSubmitting||e[47]!==M||e[48]!==O?(A=p.jsx(Ln,{type:"button",variant:"ghost",onClick:M,disabled:T,children:O}),e[46]=f.formState.isSubmitting,e[47]=M,e[48]=O,e[49]=A):A=e[49];let P;e[50]!==f.formState.isSubmitting||e[51]!==a?(P=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(hf,{size:"xs"}),a("chat.dialogPromptArguments.loading")]}):a("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=a,e[52]=P):P=e[52];let D;e[53]!==f.formState.isSubmitting||e[54]!==i||e[55]!==P?(D=p.jsx(Ln,{type:"submit",form:i,disabled:f.formState.isSubmitting,children:P}),e[53]=f.formState.isSubmitting,e[54]=i,e[55]=P,e[56]=D):D=e[56];let E;e[57]!==A||e[58]!==D?(E=p.jsxs(L0,{children:[A,D]}),e[57]=A,e[58]=D,e[59]=E):E=e[59];let j;e[60]!==i||e[61]!==S||e[62]!==w||e[63]!==E?(j=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[w,E]}),e[60]=i,e[61]=S,e[62]=w,e[63]=E,e[64]=j):j=e[64];let I;e[65]!==f||e[66]!==j?(I=p.jsx(B0,{...f,children:j}),e[65]=f,e[66]=j,e[67]=I):I=e[67];let R;e[68]!==C||e[69]!==I?(R=p.jsxs($0,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,I]}),e[68]=C,e[69]=I,e[70]=R):R=e[70];let z;return e[71]!==b||e[72]!==R?(z=p.jsx(_0,{open:!0,onOpenChange:b,children:R}),e[71]=b,e[72]=R,e[73]=z):z=e[73],z}function ga(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function It(t,e){return t==="output-error"||t==="output-denied"?"error":t==="approval-requested"?"approval":t==="input-streaming"||t==="input-available"||t==="output-available"&&e===!0?"loading":"idle"}function Nr(t){if(t==null||typeof t!="object")return;const e=t;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const n=e.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return t}var Xc=Object.defineProperty,ly=(t,e)=>{let n={};for(var r in t)Xc(n,r,{get:t[r],enumerable:!0});return Xc(n,Symbol.toStringTag,{value:"Module"}),n};function Ie(t){this.content=t}Ie.prototype={constructor:Ie,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),o=r.content.slice();return s==-1?o.push(n||t,e):(o[s+1]=e,n&&(o[s]=n)),new Ie(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ie(n)},addToStart:function(t,e){return new Ie([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ie(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),o=r.find(t);return s.splice(o==-1?s.length:o,0,e,n),new Ie(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ie.from(t),t.size?new Ie(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ie.from(t),t.size?new Ie(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ie.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ie.from=function(t){if(t instanceof Ie)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ie(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),o=e.child(r);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let i=s.text,a=o.text,l=0;for(;i[l]==a[l];l++)n++;return l&&l<i.length&&l<a.length&&Kf(i.charCodeAt(l-1))&&qf(i.charCodeAt(l))&&n--,n}if(s.content.size||o.content.size){let i=Vf(s.content,o.content,n+1);if(i!=null)return i}n+=s.nodeSize}}function Uf(t,e,n,r){for(let s=t.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:n,b:r};let i=t.child(--s),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=i.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&Kf(c.charCodeAt(d-1))&&qf(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let c=Uf(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function qf(t){return t>=56320&&t<57344}function Kf(t){return t>=55296&&t<56320}class ${constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,s+a,o||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new $(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),s+=a.nodeSize),i=l}return new $(r,s)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new $(s,o)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Uf(this,e,n,r)}findIndex(e){if(e==0)return $s(0,e);if(e==this.size)return $s(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),o=r+s.nodeSize;if(o>=e)return o==e?$s(n+1,o):$s(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(n||(n=e.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new $(n||e,r)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Ti={index:0,offset:0};function $s(t,e){return Ti.index=t,Ti.offset=e,Ti}function io(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!io(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!io(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let le=class ya{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&io(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ya.none;if(e instanceof ya)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};le.none=[];class ss extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Jf(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Yf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F($.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new F(e,r,s)}}F.empty=new F($.empty,0,0);function Yf(t,e,n){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(s==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Yf(o.content,e-s-1,n-s-1)))}function Jf(t,e,n,r,s,o){let{index:i,offset:a}=t.findIndex(e),l=t.maybeChild(i);if(a==e||l.isText)return o&&r<=0&&s<=0&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Jf(l.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?s-1:0,l);return c&&t.replaceChild(i,l.copy(c))}function cy(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return Gf(t,e,n,0)}function Gf(t,e,n,r){let s=t.index(r),o=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let i=Gf(t,e,n,r+1);return o.copy(o.content.replaceChild(s,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return Dn(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uy(n,t);return Dn(o,Qf(t,i,a,e,r))}else return Dn(o,ao(t,e,r))}function Xf(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function xa(t,e,n){let r=t.node(n);return Xf(r,e.node(n)),r}function En(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wr(t,e,n,r){let s=(e||t).node(n),o=0,i=e?e.index(n):s.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(En(t.nodeAfter,r),o++));for(let a=o;a<i;a++)En(s.child(a),r);e&&e.depth==n&&e.textOffset&&En(e.nodeBefore,r)}function Dn(t,e){if(!t.type.validContent(e))throw new ss("Invalid content for node "+t.type.name);return t.copy(e)}function Qf(t,e,n,r,s){let o=t.depth>s&&xa(t,e,s+1),i=r.depth>s&&xa(n,r,s+1),a=[];return Wr(null,t,s,a),o&&i&&e.index(s)==n.index(s)?(Xf(o,i),En(Dn(o,Qf(t,e,n,r,s+1)),a)):(o&&En(Dn(o,ao(t,e,s+1)),a),Wr(e,n,s,a),i&&En(Dn(i,ao(n,r,s+1)),a)),Wr(r,null,s,a),new $(a)}function ao(t,e,n){let r=[];if(Wr(null,t,n,r),t.depth>n){let s=xa(t,e,n+1);En(Dn(s,ao(t,e,n+1)),r)}return Wr(e,null,n,r),new $(r)}function uy(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)s=e.node(o).copy($.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class is{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new lo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),c=o-l;if(r.push(i,a,s+l),!c||(i=i.child(a),i.isText))break;o=c-1,s+=l+1}return new is(n,r,o)}static resolveCached(e,n){let r=Qc.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==n)return i}else Qc.set(e,r=new dy);let s=r.elts[r.i]=is.resolve(e,n);return r.i=(r.i+1)%fy,s}}class dy{constructor(){this.elts=[],this.i=0}}const fy=12,Qc=new WeakMap;class lo{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const hy=Object.create(null);let On=class ba{constructor(e,n,r,s=le.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&io(this.attrs,n||e.defaultAttrs||hy)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new ba(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ba(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),o=this.resolve(n),i=r?0:s.sharedDepth(n),a=s.start(i),c=s.node(i).content.cut(s.pos-a,o.pos-a);return new F(c,s.depth-i,o.depth-i)}replace(e,n,r){return cy(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return is.resolveCached(this,e)}resolveNoCache(e){return is.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Zf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=$.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=le.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=$.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,s,r);return o.type.checkAttrs(o.attrs),o}};On.prototype.text=void 0;class co extends On{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new co(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new co(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Zf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Hn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new py(e,n);if(r.next==null)return Hn.empty;let s=eh(r);r.next&&r.err("Unexpected trailing text");let o=ky(vy(s));return Sy(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let o=n;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function o(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return $.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,a.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let a=s;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
1
+ import{r as L,c as _,b as Y,ar as m1,j as p,h as hf,B as Ln,ag as Uc,ae as g1,aq as y1,cD as pf,cE as x1,aB as b1,b9 as $n,cF as v1,l as Q,o as k1,a1 as _n,a2 as Bn,a4 as zn,bp as S1,bm as pl,bt as C1,bs as w1,cG as N1,bq as M1,cH as T1,bo as E1,G as xt,n as mf,a7 as gf,e as D1,K as ht,t as fa,m as ni,E as yf,b7 as xf,a9 as O1,cI as bf,p as A1,bg as vf,bh as kf,bi as Sf,bj as Cf,d as ml,cJ as I1,cK as j1,bw as qc,b2 as R1}from"./index-Db96eOyL.js";import{aE as P1,aX as L1,aY as $1,C as _1,k as B1,u as ha,am as z1,i as Kc,ax as F1,m as H1,aZ as W1,aV as wf,a_ as V1,s as pa,a$ as Nf,A as Mf,b0 as wt,b1 as U1,aF as q1,j as K1,z as Y1,b2 as J1,b3 as G1}from"./agent-icon-Dp7ilfSA.js";import{i as ma}from"./ChevronRight-erhjObhH.js";import{u as X1}from"./useInfiniteQuery-qy981KB_.js";import{a as Tf,u as Q1}from"./use-connection-Dy0Z_WuU.js";import{c as Z1,u as gl}from"./use-mcp-client-CrXQAzxs.js";import{a as e0}from"./use-virtual-mcp-TDdC23NB.js";import{c as t0,e as n0,a as Ef,d as Tr,b as r0,T as Er}from"./table-D4EsPh8H.js";import{E as Yc}from"./empty-state-BeZZ6aWm.js";import{u as Df}from"./use-infinite-scroll-DO_cvi6-.js";import{a as s0}from"./use-members-C8Hqv8-u.js";import{i as yl}from"./AlertCircle-CTUkQXgs.js";import{i as o0}from"./CheckCircle-CtgjJb3s.js";import{a as i0}from"./DotsVertical-alsvv1gj.js";import{i as Of,a as a0}from"./XCircle-BsDfD2mO.js";import{e as l0}from"./use-automations-B7rq5y89.js";import{u as c0}from"./useSuspenseInfiniteQuery-BeaYkvve.js";import{A as u0}from"./avatar-CYvGTxVT.js";import{t as Af,n as d0}from"./ChevronUp-B7eB07ok.js";import{t as f0,b as If,n as jf}from"./Tool02-D8KfndCv.js";import{t as ri}from"./Stars01-DzR1pkba.js";import{i as xl}from"./Check-DhyLPiiJ.js";import{a as Rf}from"./Copy01-xF3K8KuJ.js";import{b as Fn,t as bl,c as Jc}from"./format-time-BnbuEtat.js";import{u as Pf}from"./use-copy-BtAcYms1.js";import{M as vl,I as h0}from"./markdown-BTQo5HHG.js";import{d as p0,a as m0,r as g0,e as y0}from"./hooks-BVfnO0Aw.js";import{k as wr,q as x0,b as vs,a as b0,D as v0}from"./chat-context-BEHg6aEi.js";import{c as k0}from"./monaco-editor-CqhlT806.js";import{g as Lf,M as S0}from"./types-D618nSWF.js";import{s as C0}from"./Eye-T_5uiyBH.js";import{s as w0}from"./XClose-B53vZH_B.js";import{b as N0,a as M0}from"./Tool01-BI2Udquq.js";import{i as T0}from"./Share07-BbKQaSoa.js";import{i as E0}from"./SearchMd-TZRK7Jjy.js";import{b as D0,d as O0}from"./shell-layout--n0X6oT8.js";import{a as kl}from"./use-panel-navigate-Bh-F8soa.js";import{a as Ps}from"./Image01-B2vrhds6.js";import{n as $f}from"./LinkExternal01-DVFUVB9h.js";import{I as Kn}from"./integration-icon-B5SelfUS.js";import{b as Sl}from"./Users03-Dwp9VmWX.js";import{a as Nt}from"./Palette-BZNwl0Y4.js";import{u as _f}from"./use-navigate-to-agent-VH5AAfU9.js";import{i as Ls}from"./Link01-C08e0rPS.js";import{e as A0,i as Bf,a as zf,S as I0}from"./constants-DNuUCxmW.js";import{g as j0}from"./use-mcp-prompts-DVBCzZJ3.js";import{d as R0,c as P0,e as L0,b as $0,D as _0}from"./dialog--s8x0s1I.js";import{F as B0,d as z0,a as F0,e as H0,b as W0,c as V0}from"./form-Bz464I8y.js";import{I as U0}from"./input-Cwwyr7Rh.js";import{i as q0}from"./Globe01-Cip-2Ps4.js";import{i as K0}from"./Monitor01-BIBipmDF.js";import{n as Y0}from"./Download01-Carxvlo9.js";import{F as J0}from"./file-type-icon-CCcQ6AAf.js";import{u as G0}from"./use-decopilot-events-CXqAHm8B.js";const X0={openrouter:t=>{const e=t?.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 Ff(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(X0)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function Hf(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Wf(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+Ff(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function Cl(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function qO(t){return t.reduce((e,n)=>Wf(e,n.metadata?.usage),Hf())}const Q0={damping:.7,stiffness:.05,mass:1.25},Z0=70,ey=1e3/60,ty=350;let si=!1;globalThis.document?.addEventListener("mousedown",()=>{si=!0});globalThis.document?.addEventListener("mouseup",()=>{si=!1});globalThis.document?.addEventListener("click",()=>{si=!1});const ny=(t={})=>{const[e,n]=L.useState(!1),[r,s]=L.useState(t.initial!==!1),[o,i]=L.useState(!1),a=L.useRef(null);a.current=t;const l=L.useCallback(()=>{if(!si)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),c=L.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=L.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=L.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:k}=getComputedStyle(g.current);k!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,d.ignoreScrollToTop=g.current.scrollTop,k!=="auto"&&(g.current.style.scrollBehavior=k)}},get targetScrollTop(){return!g.current||!x.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!x.current)return 0;const{targetScrollTop:v}=this;if(!t.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(v,{scrollElement:g.current,contentElement:x.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:k},requestAnimationFrame(()=>{b=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Z0}}},[]),f=L.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const v=Date.now()+(Number(b.wait)||0),k=Mi(a.current,b.animation),{ignoreEscapes:N=!1}=b;let C,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{C=Date.now()}):C=v+(b.duration??0);const w=async()=>{const M=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,O=performance.now(),A=(O-(d.lastTick??O))/ey;if(d.animation||(d.animation={behavior:k,promise:M,ignoreEscapes:N}),d.animation.behavior===k&&(d.lastTick=O),l()||v>Date.now())return w();if(T<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return w()}return C>Date.now()?(S=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Mi(a.current,a.current.resize),ignoreEscapes:N,duration:Math.max(0,C-Date.now())||void 0}):d.isAtBottom)});return M.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:w()},[c,l,d]),h=L.useCallback(()=>{u(!0),c(!1)},[u,c]),m=L.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:k}=d;let{lastScrollTop:N=v}=d;d.lastScrollTop=v,d.ignoreScrollToTop=void 0,k&&k>v&&(N=k),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||v===k)return;if(l()){u(!0),c(!1);return}const C=v>N,S=v<N;if(d.animation?.ignoreEscapes){d.scrollTop=N;return}S&&(u(!0),c(!1)),C&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,l,d]),y=L.useCallback(({target:b,deltaY:v})=>{let k=b;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),g=Gc(b=>{g.current?.removeEventListener("scroll",m),g.current?.removeEventListener("wheel",y),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",y,{passive:!0})},[]),x=Gc(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let v;d.resizeObserver=new ResizeObserver(([k])=>{const{height:N}=k.contentRect,C=N-(v??N);if(d.resizeDifference=C,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),C>=0){const S=Mi(a.current,v?a.current.resize:a.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:ty})}else d.isNearBottom&&(u(!1),c(!0));v=N,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===C&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:g,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function Gc(t,e){const n=L.useCallback(r=>(n.current=r,t(r)),e);return n}const Ni=new Map;function Mi(...t){const e={...Q0};let n=!1;for(const s of t){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return Ni.has(r)||Ni.set(r,Object.freeze(e)),n?"instant":Ni.get(r)}function ry(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function wl(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Nl(t,e){if(!e)return t;const n=`${ry(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function sy(t,e){return Nl(t,e).replace(/[_-]/g," ").toLowerCase()}function oy(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?Uc().min(1,e):Uc();return g1(n)}function iy(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function ay(t){const e=_.c(74),{prompt:n,setPrompt:r,onSubmit:s,defaultValues:o}=t,i=L.useId(),a=Y();let l,c;if(e[0]!==n||e[1]!==a){const W=oy(n,a("chat.dialogPromptArguments.required"));c=y1,l=m1(W),e[0]=n,e[1]=a,e[2]=l,e[3]=c}else l=e[2],c=e[3];let u;e[4]!==o||e[5]!==n?(u=n?iy(n,o):{},e[4]=o,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==u?(d={resolver:l,defaultValues:u,mode:"onChange"},e[7]=l,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const m=h;let y;e[12]!==f||e[13]!==s||e[14]!==r?(y=async W=>{await s(W),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=y):y=e[15];const g=y;let x;e[16]!==f||e[17]!==r?(x=W=>{W||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=x):x=e[18];const b=x;if(!n)return null;let v;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(v=n.title||sy(n.name,wl(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=v):v=e[22];let k;e[23]!==v?(k=p.jsx(R0,{children:p.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=k):k=e[24];let N;e[25]!==n.description?(N=n.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=N):N=e[26];let C;e[27]!==N||e[28]!==k?(C=p.jsxs(P0,{children:[k,N]}),e[27]=N,e[28]=k,e[29]=C):C=e[29];let S;e[30]!==f||e[31]!==g?(S=W=>{W.stopPropagation(),f.handleSubmit(g)(W)},e[30]=f,e[31]=g,e[32]=S):S=e[32];let w;if(e[33]!==m||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==a){let W;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==a?(W=q=>p.jsx(z0,{control:f.control,name:q.name,render:G=>{const{field:te}=G;return p.jsxs(F0,{children:[p.jsxs(H0,{className:"text-xs",children:[q.name,q.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",a("chat.dialogPromptArguments.optional")]})]}),p.jsx(W0,{children:p.jsx(U0,{...te,value:te.value??"",required:q.required,placeholder:q.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(V0,{})]})}},q.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=a,e[41]=W):W=e[41],w=m.map(W),e[33]=m,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=a,e[37]=w}else w=e[37];let M;e[42]!==b?(M=()=>b(!1),e[42]=b,e[43]=M):M=e[43];const T=f.formState.isSubmitting;let O;e[44]!==a?(O=a("chat.dialogPromptArguments.cancel"),e[44]=a,e[45]=O):O=e[45];let A;e[46]!==f.formState.isSubmitting||e[47]!==M||e[48]!==O?(A=p.jsx(Ln,{type:"button",variant:"ghost",onClick:M,disabled:T,children:O}),e[46]=f.formState.isSubmitting,e[47]=M,e[48]=O,e[49]=A):A=e[49];let P;e[50]!==f.formState.isSubmitting||e[51]!==a?(P=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(hf,{size:"xs"}),a("chat.dialogPromptArguments.loading")]}):a("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=a,e[52]=P):P=e[52];let D;e[53]!==f.formState.isSubmitting||e[54]!==i||e[55]!==P?(D=p.jsx(Ln,{type:"submit",form:i,disabled:f.formState.isSubmitting,children:P}),e[53]=f.formState.isSubmitting,e[54]=i,e[55]=P,e[56]=D):D=e[56];let E;e[57]!==A||e[58]!==D?(E=p.jsxs(L0,{children:[A,D]}),e[57]=A,e[58]=D,e[59]=E):E=e[59];let j;e[60]!==i||e[61]!==S||e[62]!==w||e[63]!==E?(j=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[w,E]}),e[60]=i,e[61]=S,e[62]=w,e[63]=E,e[64]=j):j=e[64];let I;e[65]!==f||e[66]!==j?(I=p.jsx(B0,{...f,children:j}),e[65]=f,e[66]=j,e[67]=I):I=e[67];let R;e[68]!==C||e[69]!==I?(R=p.jsxs($0,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,I]}),e[68]=C,e[69]=I,e[70]=R):R=e[70];let z;return e[71]!==b||e[72]!==R?(z=p.jsx(_0,{open:!0,onOpenChange:b,children:R}),e[71]=b,e[72]=R,e[73]=z):z=e[73],z}function ga(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function It(t,e){return t==="output-error"||t==="output-denied"?"error":t==="approval-requested"?"approval":t==="input-streaming"||t==="input-available"||t==="output-available"&&e===!0?"loading":"idle"}function Nr(t){if(t==null||typeof t!="object")return;const e=t;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const n=e.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return t}var Xc=Object.defineProperty,ly=(t,e)=>{let n={};for(var r in t)Xc(n,r,{get:t[r],enumerable:!0});return Xc(n,Symbol.toStringTag,{value:"Module"}),n};function Ie(t){this.content=t}Ie.prototype={constructor:Ie,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),o=r.content.slice();return s==-1?o.push(n||t,e):(o[s+1]=e,n&&(o[s]=n)),new Ie(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ie(n)},addToStart:function(t,e){return new Ie([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ie(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),o=r.find(t);return s.splice(o==-1?s.length:o,0,e,n),new Ie(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ie.from(t),t.size?new Ie(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ie.from(t),t.size?new Ie(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ie.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ie.from=function(t){if(t instanceof Ie)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ie(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),o=e.child(r);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let i=s.text,a=o.text,l=0;for(;i[l]==a[l];l++)n++;return l&&l<i.length&&l<a.length&&Kf(i.charCodeAt(l-1))&&qf(i.charCodeAt(l))&&n--,n}if(s.content.size||o.content.size){let i=Vf(s.content,o.content,n+1);if(i!=null)return i}n+=s.nodeSize}}function Uf(t,e,n,r){for(let s=t.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:n,b:r};let i=t.child(--s),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=i.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&Kf(c.charCodeAt(d-1))&&qf(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let c=Uf(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function qf(t){return t>=56320&&t<57344}function Kf(t){return t>=55296&&t<56320}class ${constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,s+a,o||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new $(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),s+=a.nodeSize),i=l}return new $(r,s)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new $(s,o)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Uf(this,e,n,r)}findIndex(e){if(e==0)return $s(0,e);if(e==this.size)return $s(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),o=r+s.nodeSize;if(o>=e)return o==e?$s(n+1,o):$s(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(n||(n=e.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new $(n||e,r)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Ti={index:0,offset:0};function $s(t,e){return Ti.index=t,Ti.offset=e,Ti}function io(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!io(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!io(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let le=class ya{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&io(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ya.none;if(e instanceof ya)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};le.none=[];class ss extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Jf(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Yf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F($.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new F(e,r,s)}}F.empty=new F($.empty,0,0);function Yf(t,e,n){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(s==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Yf(o.content,e-s-1,n-s-1)))}function Jf(t,e,n,r,s,o){let{index:i,offset:a}=t.findIndex(e),l=t.maybeChild(i);if(a==e||l.isText)return o&&r<=0&&s<=0&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Jf(l.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?s-1:0,l);return c&&t.replaceChild(i,l.copy(c))}function cy(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return Gf(t,e,n,0)}function Gf(t,e,n,r){let s=t.index(r),o=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let i=Gf(t,e,n,r+1);return o.copy(o.content.replaceChild(s,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return Dn(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uy(n,t);return Dn(o,Qf(t,i,a,e,r))}else return Dn(o,ao(t,e,r))}function Xf(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function xa(t,e,n){let r=t.node(n);return Xf(r,e.node(n)),r}function En(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wr(t,e,n,r){let s=(e||t).node(n),o=0,i=e?e.index(n):s.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(En(t.nodeAfter,r),o++));for(let a=o;a<i;a++)En(s.child(a),r);e&&e.depth==n&&e.textOffset&&En(e.nodeBefore,r)}function Dn(t,e){if(!t.type.validContent(e))throw new ss("Invalid content for node "+t.type.name);return t.copy(e)}function Qf(t,e,n,r,s){let o=t.depth>s&&xa(t,e,s+1),i=r.depth>s&&xa(n,r,s+1),a=[];return Wr(null,t,s,a),o&&i&&e.index(s)==n.index(s)?(Xf(o,i),En(Dn(o,Qf(t,e,n,r,s+1)),a)):(o&&En(Dn(o,ao(t,e,s+1)),a),Wr(e,n,s,a),i&&En(Dn(i,ao(n,r,s+1)),a)),Wr(r,null,s,a),new $(a)}function ao(t,e,n){let r=[];if(Wr(null,t,n,r),t.depth>n){let s=xa(t,e,n+1);En(Dn(s,ao(t,e,n+1)),r)}return Wr(e,null,n,r),new $(r)}function uy(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)s=e.node(o).copy($.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class is{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new lo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),c=o-l;if(r.push(i,a,s+l),!c||(i=i.child(a),i.isText))break;o=c-1,s+=l+1}return new is(n,r,o)}static resolveCached(e,n){let r=Qc.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==n)return i}else Qc.set(e,r=new dy);let s=r.elts[r.i]=is.resolve(e,n);return r.i=(r.i+1)%fy,s}}class dy{constructor(){this.elts=[],this.i=0}}const fy=12,Qc=new WeakMap;class lo{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const hy=Object.create(null);let On=class ba{constructor(e,n,r,s=le.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&io(this.attrs,n||e.defaultAttrs||hy)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new ba(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ba(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let s=this.resolve(e),o=this.resolve(n),i=r?0:s.sharedDepth(n),a=s.start(i),c=s.node(i).content.cut(s.pos-a,o.pos-a);return new F(c,s.depth-i,o.depth-i)}replace(e,n,r){return cy(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return is.resolveCached(this,e)}resolveNoCache(e){return is.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Zf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=$.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=le.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=$.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,s,r);return o.type.checkAttrs(o.attrs),o}};On.prototype.text=void 0;class co extends On{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new co(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new co(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Zf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Hn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new py(e,n);if(r.next==null)return Hn.empty;let s=eh(r);r.next&&r.err("Unexpected trailing text");let o=ky(vy(s));return Sy(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let o=n;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function o(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return $.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,a.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let a=s;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
2
2
  `)}}Hn.empty=new Hn(!0);class py{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function eh(t){let e=[];do e.push(my(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function my(t){let e=[];do e.push(gy(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function gy(t){let e=by(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=yy(t,e);else break;return e}function Zc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function yy(t,e){let n=Zc(t),r=n;return t.eat(",")&&(t.next!="}"?r=Zc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function xy(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let o in n){let i=n[o];i.isInGroup(e)&&s.push(i)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function by(t){if(t.eat("(")){let e=eh(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=xy(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function vy(t){let e=[[]];return s(o(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function s(i,a){i.forEach(l=>l.to=a)}function o(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=o(i.exprs[l],a);if(l==i.exprs.length-1)return c;s(c,a=n())}else if(i.type=="star"){let l=n();return r(a,l),s(o(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return s(o(i.expr,a),l),s(o(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(a)].concat(o(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let u=n();s(o(i.expr,l),u),l=u}if(i.max==-1)s(o(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let u=n();r(l,u),s(o(i.expr,l),u),l=u}return[r(l)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function th(t,e){return e-t}function eu(t,e){let n=[];return r(e),n.sort(th);function r(s){let o=t[s];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(s);for(let i=0;i<o.length;i++){let{term:a,to:l}=o[i];!a&&n.indexOf(l)==-1&&r(l)}}}function ky(t){let e=Object.create(null);return n(eu(t,0));function n(r){let s=[];r.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<s.length;u++)s[u][0]==a&&(c=s[u][1]);eu(t,l).forEach(u=>{c||s.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new Hn(r.indexOf(t.length-1)>-1);for(let i=0;i<s.length;i++){let a=s[i][1].sort(th);o.next.push({type:s[i][0],next:e[a.join(",")]||n(a)})}return o}}function Sy(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],o=!s.validEnd,i=[];for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function nh(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function rh(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let o=t[r];if(o.hasDefault)s=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function sh(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${r}`);for(let s in t)t[s].validate&&t[s].validate(e[s])}function oh(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new wy(t,r,e[r]);return n}let tu=class ih{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=oh(e,r.attrs),this.defaultAttrs=nh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Hn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:rh(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),$.from(n),le.setFrom(r))}createChecked(e=null,n,r){return n=$.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,le.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=$.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore($.empty,!0);return o?new On(this,e,n.append(o),le.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){sh(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:le.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,i)=>r[o]=new ih(o,n,i));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Cy(t,e,n){let r=n.split("|");return s=>{let o=s===null?"null":typeof s;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class wy{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Cy(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class oi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=oh(e,s.attrs),this.excluded=null;let o=nh(this.attrs);this.instance=o?new le(this,o):null}create(e=null){return!e&&this.instance?this.instance:new le(this,rh(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((o,i)=>r[o]=new oi(o,s++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){sh(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class ah{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ie.from(e.nodes),n.marks=Ie.from(e.marks||{}),this.nodes=tu.compile(this.spec.nodes,this),this.marks=oi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],i=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[i]||(r[i]=Hn.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?nu(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:nu(this,i.split(" "))}this.nodeFromJSON=s=>On.fromJSON(this,s),this.markFromJSON=s=>le.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof tu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new co(r,r.defaultAttrs,e,le.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function nu(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],o=t.marks[s],i=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Ny(t){return t.tag!=null}function My(t){return t.style!=null}class Et{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Ny(s))this.tags.push(s);else if(My(s)){let o=/[^=]*/.exec(s.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=e.nodes[s.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new su(this,n,!1);return r.addAll(e,le.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new su(this,n,!0);return r.addAll(e,le.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(Dy(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,n,r,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let i=this.styles[o],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function r(s){let o=s.priority==null?50:s.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<o)break}n.splice(i,0,s)}for(let s in e.marks){let o=e.marks[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ou(i)),i.mark||i.ignore||i.clearMark||(i.mark=s)})}for(let s in e.nodes){let o=e.nodes[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ou(i)),i.node||i.ignore||i.mark||(i.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Et(e,Et.schemaRules(e)))}}const lh={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ty={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ch={ol:!0,ul:!0},as=1,va=2,Vr=4;function ru(t,e,n){return e!=null?(e?as:0)|(e==="full"?va:0):t&&t.whitespace=="pre"?as|va:n&~Vr}class _s{constructor(e,n,r,s,o,i){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=i,this.content=[],this.activeMarks=le.none,this.match=o||(i&Vr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&as)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let n=$.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!lh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class su{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,i=ru(null,n.preserveWhitespace,0)|(r?Vr:0);s?o=new _s(s.type,s.attrs,le.none,!0,n.topMatch||s.type.contentMatch,i):r?o=new _s(null,null,le.none,!0,null,i):o=new _s(e.schema.topNodeType,null,le.none,!0,null,i),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,o=s.options&va?"full":this.localPreserveWS||(s.options&as)>0,{schema:i}=this.parser;if(o==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(i.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(i.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;ch.hasOwnProperty(i)&&this.parser.normalizeLists&&Ey(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Ty.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(lh.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],i=r.getPropertyValue(o);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(o,i,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let o,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(i,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,s){let o=r||0;for(let i=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,n);this.findAtPoint(e,o)}findPlace(e,n,r){let s,o;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!s)return null;this.sync(o);for(let i=0;i<s.length;i++)n=this.enterInner(s[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=le.none;for(let a of s.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):iu(a.type,e.type))&&(i=a.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,s){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,s)),o}enterInner(e,n,r,s=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=ru(e,o,i.options);i.options&Vr&&i.content.length==0&&(a|=Vr);let l=le.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):iu(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new _s(e,n,l,s,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=as)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(s?0:1),i=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(i(a-1,l))return!0;return!1}else{let u=l>0||l==0&&s?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Ey(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ch.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Dy(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ou(t){let e={};for(let n in t)e[n]=t[n];return e}function iu(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let o=[],i=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&i(u))return!0}};if(i(s.contentMatch))return!0}}class qt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Bs(n).createDocumentFragment());let s=r,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let a=0,l=0;for(;a<o.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)s=o.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],u=this.serializeMark(c,i.isInline,n);u&&(o.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return Bs(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Zs(Bs(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let o=this.serializeMark(e.marks[s],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Zs(Bs(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Zs(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=au(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return au(e.marks)}}function au(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Bs(t){return t.document||window.document}const lu=new WeakMap;function Oy(t){let e=lu.get(t);return e===void 0&&lu.set(t,e=Ay(t)),e}function Ay(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Zs(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Oy(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=s.indexOf(" ");i>0&&(n=s.slice(0,i),s=s.slice(i+1));let a,l=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:m}=Zs(t,f,n,r);if(l.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const uh=65535,dh=Math.pow(2,16);function Iy(t,e){return t+e*dh}function cu(t){return t&uh}function jy(t){return(t-(t&uh))/dh}const fh=1,hh=2,eo=4,ph=8;class ka{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ph)>0}get deletedBefore(){return(this.delInfo&(fh|eo))>0}get deletedAfter(){return(this.delInfo&(hh|eo))>0}get deletedAcross(){return(this.delInfo&eo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=cu(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+jy(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+i],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+s+(f<0?0:u);if(r)return h;let m=e==(n<0?l:d)?null:Iy(a/3,e-l),y=e==l?hh:e==d?fh:eo;return(n<0?e!=l:e!=d)&&(y|=ph),new ka(h,y,m)}s+=u-c}return r?e+s:new ka(e+s,0,null)}touches(e,n){let r=0,s=cu(n),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==s*3)return!0;r+=this.ranges[a+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),c=this.ranges[s+n],u=this.ranges[s+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class ls{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ls(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new ls;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return r?e:new ka(e,s,null)}}const Ei=Object.create(null);class Fe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ei[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ei)throw new RangeError("Duplicate use of step JSON ID "+e);return Ei[e]=n,n.prototype.jsonID=e,n}}class ke{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ke(e,null)}static fail(e){return new ke(null,e)}static fromReplace(e,n,r,s){try{return ke.ok(e.replace(n,r,s))}catch(o){if(o instanceof ss)return ke.fail(o.message);throw o}}}function Ml(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let o=t.child(s);o.content.size&&(o=o.copy(Ml(o.content,e,o))),o.isInline&&(o=e(o,n,s)),r.push(o)}return $.fromArray(r)}class sn extends Fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),o=new F(Ml(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),s),n.openStart,n.openEnd);return ke.fromReplace(e,this.from,this.to,o)}invert(){return new pt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new sn(n.pos,r.pos,this.mark)}merge(e){return e instanceof sn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new sn(n.from,n.to,e.markFromJSON(n.mark))}}Fe.jsonID("addMark",sn);class pt extends Fe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Ml(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return ke.fromReplace(e,this.from,this.to,r)}invert(){return new sn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new pt(n.pos,r.pos,this.mark)}merge(e){return e instanceof pt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new pt(n.from,n.to,e.markFromJSON(n.mark))}}Fe.jsonID("removeMark",pt);class on extends Fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ke.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ke.fromReplace(e,this.pos,this.pos+1,new F($.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new on(this.pos,n.marks[s]);return new on(this.pos,this.mark)}}return new Wn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new on(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new on(n.pos,e.markFromJSON(n.mark))}}Fe.jsonID("addNodeMark",on);class Wn extends Fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ke.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ke.fromReplace(e,this.pos,this.pos+1,new F($.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new on(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wn(n.pos,e.markFromJSON(n.mark))}}Fe.jsonID("removeNodeMark",Wn);class ve extends Fe{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&Sa(e,this.from,this.to)?ke.fail("Structure replace would overwrite content"):ke.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new ve(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&ve.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new ve(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ve)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ve(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ve(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ve(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}ve.MAP_BIAS=1;Fe.jsonID("replace",ve);class Oe extends Fe{constructor(e,n,r,s,o,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(Sa(e,this.from,this.gapFrom)||Sa(e,this.gapTo,this.to)))return ke.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ke.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ke.fromReplace(e,this.from,this.to,r):ke.fail("Content does not fit in gap")}getMap(){return new et([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Oe(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||o>r.pos?null:new Oe(n.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Oe(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}Fe.jsonID("replaceAround",Oe);function Sa(t,e,n){let r=t.resolve(e),s=n-e,o=r.depth;for(;s>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,s--;if(s>0){let i=r.node(o).maybeChild(r.indexAfter(o));for(;s>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,s--}}return!1}function Ry(t,e,n,r){let s=[],o=[],i,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let y=0;y<d.length;y++)d[y].isInSet(m)||(i&&i.to==f&&i.mark.eq(d[y])?i.to=h:s.push(i=new pt(f,h,d[y])));a&&a.to==f?a.to=h:o.push(a=new sn(f,h,r))}}),s.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function Py(t,e,n,r){let s=[],o=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;o++;let l=null;if(r instanceof oi){let c=i.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==o-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=o):s.push({style:d,from:Math.max(a,e),to:c,step:o})}}}),s.forEach(i=>t.step(new pt(i.from,i.to,i.style)))}function Tl(t,e,n,r=n.contentMatch,s=!0){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new ve(a,u,F.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new pt(a,u,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new F($.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new ve(a+f.index,a+f.index+f[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore($.empty,!0);t.replace(a,a,new F(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function Ly(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Mr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,o=0;;--r){let i=t.$from.node(r),a=t.$from.index(r)+s,l=t.$to.indexAfter(r)-o;if(r<t.depth&&i.canReplace(a,l,n))return r;if(r==0||i.type.spec.isolating||!Ly(i,a,l))break;a&&(s=1),l<i.childCount&&(o=1)}return null}function $y(t,e,n){let{$from:r,$to:s,depth:o}=e,i=r.before(o+1),a=s.after(o+1),l=i,c=a,u=$.empty,d=0;for(let m=o,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=$.from(r.node(m).copy(u)),d++):l--;let f=$.empty,h=0;for(let m=o,y=!1;m>n;m--)y||s.after(m+1)<s.end(m)?(y=!0,f=$.from(s.node(m).copy(f)),h++):c++;t.step(new Oe(l,c,i,a,new F(u.append(f),d,h),u.size-d,!0))}function El(t,e,n=null,r=t){let s=_y(t,e),o=s&&By(r,e);return o?s.map(uu).concat({type:e,attrs:n}).concat(o.map(uu)):null}function uu(t){return{type:t,attrs:null}}function _y(t,e){let{parent:n,startIndex:r,endIndex:s}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return n.canReplaceWith(r,s,i)?o:null}function By(t,e){let{parent:n,startIndex:r,endIndex:s}=t,o=n.child(r),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;l&&c<s;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:i}function zy(t,e,n){let r=$.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=$.from(n[i].type.create(n[i].attrs,r))}let s=e.start,o=e.end;t.step(new Oe(s,o,s,o,new F(r,0,0),n.length,!0))}function Fy(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{let l=typeof s=="function"?s(i):s;if(i.isTextblock&&!i.hasMarkup(r,l)&&Hy(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&gh(t,i,a,o),Tl(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let u=t.mapping.slice(o),d=u.map(a,1),f=u.map(a+i.nodeSize,1);return t.step(new Oe(d,f,d+1,f-1,new F($.from(r.create(l,null,i.marks)),0,0),1,!0)),c===!0&&mh(t,i,a,o),!1}})}function mh(t,e,n,r){e.forEach((s,o)=>{if(s.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(s.text);){let l=t.mapping.slice(r).map(n+1+o+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function gh(t,e,n,r){e.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{c as B,j as o,b as $,G as D,d as M,r as q,P as d,B as G,o as R}from"./index-1nlVNgxn.js";import{s as V}from"./Plus-BANbQu0C.js";import{i as S}from"./Zap-D7GDOY-h.js";import{S as F}from"./search-input-CvsG48c7.js";import{E as T}from"./empty-state-C8riWqwz.js";import{c as H}from"./use-automations-DYhybc22.js";import{u as J}from"./use-navigate-to-agent-CEI8-w2f.js";import{A as K}from"./automation-list-row-DbQbxIBH.js";import{h as O}from"./constants-DNuUCxmW.js";import{a as Q}from"./use-virtual-mcp-CikmlP55.js";import{R as U}from"./require-capability-sqTle2Fa.js";import"./SearchMd-b1VauOXm.js";import"./use-mcp-client-DkhuXiKH.js";import"./auth-BRsOzYq2.js";import"./use-destination-route-iMqy_40D.js";import"./hooks-D74-rHgb.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BUcLYmbe.js";import"./task-board-DD60a6Wz.js";import"./schema-DYE3f2lq.js";import"./thread-intent-5WHIjvYR.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-COLY3wWI.js";import"./alert-dialog-C9B_UVL_.js";import"./dropdown-menu-o3ET1Hdn.js";import"./Check-DwC3z1rx.js";import"./ChevronRight-BYetryHl.js";import"./DotsVertical-DHzsSfS0.js";import"./agent-icon-B48zizgx.js";import"./AlertCircle-CeJGX1aj.js";import"./Tool01-C18ZpNfv.js";import"./ArrowUp-CbXZzgIn.js";import"./ArrowLeft-CzjscPeK.js";import"./Tool02-DrjGknwf.js";import"./XCircle-B12Azu0Q.js";import"./TrendUp01-D8_aoFuw.js";import"./ZoomOut-CjRBAjBN.js";import"./Users03-iZkxvRLt.js";import"./CheckCircle-DDxCuD7T.js";import"./ChevronUp-DjeW3rf8.js";import"./ChevronSelectorVertical-BnCU9Xw2.js";import"./UserSquare-Crs1iNVm.js";import"./Copy01-DQMea6lD.js";import"./CreditCard01-CuAgtIoq.js";import"./Download01-CCUcARk8.js";import"./Settings02-DL4qHKPe.js";import"./Eye-DCY4B_Aq.js";import"./Share07-Cgan-Cfi.js";import"./GitBranch01-DavFtT7J.js";import"./Globe01-CWxN73Or.js";import"./XClose-U5JL72PX.js";import"./HardDrive-C1RU_F8K.js";import"./Image01-CZUSsIWJ.js";import"./Key01-UmvGAYHQ.js";import"./Link01-Nzb5ZvLF.js";import"./LinkExternal01-Dsnt5EOL.js";import"./Monitor01-pKli1vHT.js";import"./Sun-4ohzmuR2.js";import"./Package-BP_9s2JL.js";import"./Palette-BPE_MOvx.js";import"./Play-DhGSA0iw.js";import"./Shield01-Bbt414S-.js";import"./Stars01-D8jFx6hR.js";import"./Trash01-qI-MNO3W.js";import"./Upload01-h9msh4RF.js";import"./User01-W-TGtA_0.js";import"./Users01-CJas_o50.js";import"./access-gate-Dw4vqU6J.js";import"./capability-load-error-DNDy9nsX.js";function W(){const t=B.c(20),e=$(),{org:l}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(G,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
1
+ import{c as B,j as o,b as $,G as D,d as M,r as q,P as d,B as G,o as R}from"./index-Db96eOyL.js";import{s as V}from"./Plus-DpDZOmhb.js";import{i as S}from"./Zap-DoRxOrrO.js";import{S as F}from"./search-input-D5IwxOW_.js";import{E as T}from"./empty-state-BeZZ6aWm.js";import{c as H}from"./use-automations-B7rq5y89.js";import{u as J}from"./use-navigate-to-agent-VH5AAfU9.js";import{A as K}from"./automation-list-row-C09iz2n2.js";import{h as O}from"./constants-DNuUCxmW.js";import{a as Q}from"./use-virtual-mcp-TDdC23NB.js";import{R as U}from"./require-capability-sWsoOFc2.js";import"./SearchMd-TZRK7Jjy.js";import"./use-mcp-client-CrXQAzxs.js";import"./auth-CPKG1PMF.js";import"./use-destination-route-BlaUDv1t.js";import"./hooks-BVfnO0Aw.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DuxzrK6E.js";import"./task-board-CPnu2vHn.js";import"./schema-D3Zdtr4A.js";import"./thread-intent-BpQob6u5.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-COLY3wWI.js";import"./alert-dialog-CFvtxInl.js";import"./dropdown-menu-B1CAYfZn.js";import"./Check-DhyLPiiJ.js";import"./ChevronRight-erhjObhH.js";import"./DotsVertical-alsvv1gj.js";import"./agent-icon-Dp7ilfSA.js";import"./AlertCircle-CTUkQXgs.js";import"./Tool01-BI2Udquq.js";import"./ArrowUp-BC1eUTqQ.js";import"./ArrowLeft-DEDPbgLG.js";import"./Tool02-D8KfndCv.js";import"./XCircle-BsDfD2mO.js";import"./TrendUp01-DBzB_6-8.js";import"./ZoomOut-DwUiWK8W.js";import"./Users03-Dwp9VmWX.js";import"./CheckCircle-CtgjJb3s.js";import"./ChevronUp-B7eB07ok.js";import"./ChevronSelectorVertical-L5QYEswb.js";import"./UserSquare-B0qUe-aI.js";import"./Copy01-xF3K8KuJ.js";import"./CreditCard01-DasQHOnb.js";import"./Download01-Carxvlo9.js";import"./Settings02-BvEJJ01O.js";import"./Eye-T_5uiyBH.js";import"./Share07-BbKQaSoa.js";import"./GitBranch01-F7oOBAG6.js";import"./Globe01-Cip-2Ps4.js";import"./XClose-B53vZH_B.js";import"./HardDrive-5keoMCkV.js";import"./Image01-B2vrhds6.js";import"./Key01-BDWlMcfg.js";import"./Link01-C08e0rPS.js";import"./LinkExternal01-DVFUVB9h.js";import"./Monitor01-BIBipmDF.js";import"./Sun-CRSDN_xr.js";import"./Package-ZNK4UmQ4.js";import"./Palette-BZNwl0Y4.js";import"./Play-Bdez5_h5.js";import"./Shield01-C7gp23VU.js";import"./Stars01-DzR1pkba.js";import"./Trash01-DMTMR2Ld.js";import"./Upload01-BaU8BJAh.js";import"./User01-EYes367B.js";import"./Users01-DKepKoSC.js";import"./access-gate-Bg5o0dFT.js";import"./capability-load-error-CAVNGlum.js";function W(){const t=B.c(20),e=$(),{org:l}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(G,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
@@ -1 +1 @@
1
- import{c as k,j as i,l as m,bC as R,dT as S,dU as I,dV as U}from"./index-1nlVNgxn.js";import{s as $}from"./User01-W-TGtA_0.js";function O(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const V=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(V({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(V({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
1
+ import{c as k,j as i,l as m,bC as R,dT as S,dU as I,dV as U}from"./index-Db96eOyL.js";import{s as $}from"./User01-EYes367B.js";function O(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const V=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(V({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(V({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
@@ -1 +1 @@
1
- import{c as l,l as u,j as g,ca as v,bC as b}from"./index-1nlVNgxn.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as l,l as u,j as g,ca as v,bC as b}from"./index-Db96eOyL.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};