decocms 4.374.1 → 4.375.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/client/assets/{AlertCircle-CvB24fpQ.js → AlertCircle-CqW1GFxy.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CC-VldiG.js → AreaChart-DYNRbtHa.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CuPXwhY9.js → ArrowLeft-BGvcqKye.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DaeNVQjU.js → ArrowRight-CfSh04kd.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CMB2_B55.js → ArrowUp-DIK810PT.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-fcGDW8tl.js → CartesianChart-CsHrela1.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-L9rxLy8_.js → CheckCircle-eFuhjKFT.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Dy-cXbOz.js → ChevronUp-QcSQ5rVq.js} +1 -1
  9. package/dist/client/assets/{Copy01-KomJ49aq.js → Copy01-BsZDIS3z.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-DNXTqT2E.js → CreditCard01-yw_JaYDH.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CycZdUV6.js → DotsVertical-DCTIN1zx.js} +1 -1
  12. package/dist/client/assets/{Download01-CK_3UsO1.js → Download01-B4Q5hpED.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-C_8xGdFw.js → ErrorBarContext-CTDVFTli.js} +1 -1
  14. package/dist/client/assets/{Eye-KAte8whD.js → Eye-C46dzrHd.js} +1 -1
  15. package/dist/client/assets/{Globe01-BmMm30Hp.js → Globe01-DlhUCcjG.js} +1 -1
  16. package/dist/client/assets/{Globe04-D2pxwWDa.js → Globe04-ClHubtty.js} +1 -1
  17. package/dist/client/assets/{Image01-BHoZzJSj.js → Image01-DVR_EyJG.js} +1 -1
  18. package/dist/client/assets/{Key01-BiLmhCHZ.js → Key01-muV6twoN.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-Dk8cMo-H.js → LayoutLeft-xdqdW3pr.js} +1 -1
  20. package/dist/client/assets/{Line-QF9kobp-.js → Line-hpj-dLud.js} +1 -1
  21. package/dist/client/assets/{Link01-BSX_7wIu.js → Link01-BbJKwlY6.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-COMF34Up.js → LinkExternal01-FZW_JKrN.js} +1 -1
  23. package/dist/client/assets/{Monitor01-C25vfwGa.js → Monitor01-CN-5WdRa.js} +1 -1
  24. package/dist/client/assets/{Package-BCflABQ6.js → Package-CkvAk6JQ.js} +1 -1
  25. package/dist/client/assets/{Palette-By8W7B7e.js → Palette-D8vRagJV.js} +1 -1
  26. package/dist/client/assets/{Play-C6orNG1z.js → Play-P0YcNy8v.js} +1 -1
  27. package/dist/client/assets/{Plus-BuCQnPNG.js → Plus-DcpbfgdJ.js} +1 -1
  28. package/dist/client/assets/{SearchLg-VMEsA-e7.js → SearchLg-7L27EznQ.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DnahVlUn.js → SearchMd-XFzJrarE.js} +1 -1
  30. package/dist/client/assets/{Sector-CzI1MlO5.js → Sector-CLGxXMU7.js} +1 -1
  31. package/dist/client/assets/{Settings02-BZd-qcWS.js → Settings02-CncEwCCz.js} +1 -1
  32. package/dist/client/assets/{Share07-tpVfUX9-.js → Share07-CxrO44KP.js} +1 -1
  33. package/dist/client/assets/{Stars01-BcbLgM7d.js → Stars01-DyW-G6OS.js} +1 -1
  34. package/dist/client/assets/{Sun-C6ausIaw.js → Sun-xECmqRY7.js} +1 -1
  35. package/dist/client/assets/{Tool01-BlcXvpRH.js → Tool01-dwGgKodr.js} +1 -1
  36. package/dist/client/assets/{Tool02-BcSzj1eN.js → Tool02-CbeJXNE6.js} +1 -1
  37. package/dist/client/assets/{Trash01-Bt7knSgw.js → Trash01-Cs1900Vx.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-kAJZHj1O.js → TrendUp01-BfIYShuZ.js} +1 -1
  39. package/dist/client/assets/{Upload01-CgS71RUS.js → Upload01-odxUyqlC.js} +1 -1
  40. package/dist/client/assets/{User01-DKY_ILGI.js → User01-C-kfOI2V.js} +1 -1
  41. package/dist/client/assets/{UserSquare-DU12tvTU.js → UserSquare-CBd8Lm1t.js} +1 -1
  42. package/dist/client/assets/{Users01-COWDl5zV.js → Users01-DW5XXBNa.js} +1 -1
  43. package/dist/client/assets/{X-DcceC-EQ.js → X-DgI4yqfX.js} +1 -1
  44. package/dist/client/assets/{XCircle-BirmII4v.js → XCircle-ChzUwnd9.js} +1 -1
  45. package/dist/client/assets/{XClose-CZo1KF0t.js → XClose-Cu0FBQhr.js} +1 -1
  46. package/dist/client/assets/{Zap-CIXkomUE.js → Zap-BkWm3G14.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-CvMfmw42.js → ZoomOut-BYNmIOoy.js} +1 -1
  48. package/dist/client/assets/{access-gate-BkpH0rYV.js → access-gate-DrhvBokN.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-DDFaH4NS.js → add-connection-dialog-BNKRqesq.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-DI585OA2.js → agent-analytics-DhJQZGBL.js} +1 -1
  51. package/dist/client/assets/agent-app-CwhHpeQZ.js +1 -0
  52. package/dist/client/assets/agent-assets-BG71p0Uk.js +1 -0
  53. package/dist/client/assets/{agent-automation-CoXN7oT_.js → agent-automation-CDChcSyV.js} +1 -1
  54. package/dist/client/assets/{agent-automations-Dh2ldvlj.js → agent-automations-Ds_gyptW.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-p5uTnj09.js → agent-connect-sources-BQVAyJ4p.js} +1 -1
  56. package/dist/client/assets/agent-deck-w5dW0RRF.js +1 -0
  57. package/dist/client/assets/{agent-e2e-CgjMtxKa.js → agent-e2e-Waa8S4qH.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-Z90gGdDa.js → agent-experiments-DocmKFCq.js} +1 -1
  59. package/dist/client/assets/agent-file-BNrxE2XH.js +1 -0
  60. package/dist/client/assets/{agent-git-8ujBeOTw.js → agent-git-CcB_AU8a.js} +2 -2
  61. package/dist/client/assets/{agent-hosting-Bzvqx7RN.js → agent-hosting-DqC3jsqS.js} +1 -1
  62. package/dist/client/assets/{agent-icon-Bbnm30MH.js → agent-icon-DZmc5CaF.js} +1 -1
  63. package/dist/client/assets/agent-library-file-CcAfTvZD.js +1 -0
  64. package/dist/client/assets/{agent-monitor-pcRQgKqs.js → agent-monitor-j0thXn_z.js} +1 -1
  65. package/dist/client/assets/{agent-overview-wBMo3ArI.js → agent-overview-Se96_nVw.js} +1 -1
  66. package/dist/client/assets/agent-settings-BUJ9WCtJ.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-B_7293-6.js → agent-site-editor-BUv5taoc.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-UGzk7VE6.js +2 -0
  69. package/dist/client/assets/agent-site-editor-content-BT2waE8I.js +2 -0
  70. package/dist/client/assets/{agent-site-editor-preview-BoUgjuFc.js → agent-site-editor-preview-BYZPX7tr.js} +3 -3
  71. package/dist/client/assets/agent-view-CljCxEEY.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-CE-w87FC.js → agent-view-guard-B-yMTUz4.js} +1 -1
  73. package/dist/client/assets/{agents-list-DYu2megT.js → agents-list--UPC2z-V.js} +1 -1
  74. package/dist/client/assets/{ai-providers-C4xd0vpP.js → ai-providers-DoD-WkyR.js} +2 -2
  75. package/dist/client/assets/{alert-JJIsthFC.js → alert-BiRypa2I.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-DQ7VA4it.js → alert-dialog-BYQAyeOC.js} +1 -1
  77. package/dist/client/assets/{api-keys-Da7XeDcP.js → api-keys-CFH8WzHp.js} +1 -1
  78. package/dist/client/assets/api-keys-Vr2mIxG4.js +1 -0
  79. package/dist/client/assets/app-editor-D_IiCvgl.js +1 -0
  80. package/dist/client/assets/{asset-utils-Ckrgql68.js → asset-utils-Db2ZBQHY.js} +1 -1
  81. package/dist/client/assets/{auth-BAIe_T8g.js → auth-BCpLT4L2.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-C3HcGo7O.js → auth-catchall-CSzayJNY.js} +1 -1
  83. package/dist/client/assets/{auth-entry-CXeBQuWy.js → auth-entry-Bf9MzjUn.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-BLHoHl9d.js → auth-split-layout-B1xn3sDE.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-B_2a5Vfr.js → authenticate-and-persist-oauth-DVNhuSYI.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-zcGZ57kC.js → automation-list-row-CfW-tzTh.js} +1 -1
  87. package/dist/client/assets/{automation-runs-CO5cfbAL.js → automation-runs-CI1zLVwE.js} +1 -1
  88. package/dist/client/assets/automations-DRLDJWNL.js +1 -0
  89. package/dist/client/assets/{autosend-DrbiZ7KD.js → autosend-U0G_KEv2.js} +1 -1
  90. package/dist/client/assets/{avatar-DAAVe66-.js → avatar-DxbODU4C.js} +1 -1
  91. package/dist/client/assets/{badge-Cxdo9MSD.js → badge-D6ygNqO6.js} +1 -1
  92. package/dist/client/assets/{block-document-BmtOSR_U.js → block-document-BezbnyKl.js} +3 -3
  93. package/dist/client/assets/{blocks-preview-workspace-context-B9WGUHQW.js → blocks-preview-workspace-context-CTo5jpQ8.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-Cl92-rSB.js → breadcrumb-DWcfFz9-.js} +1 -1
  95. package/dist/client/assets/{buckets-IfbnGi1h.js → buckets-CYMWAXId.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-BjB8yBFt.js → build-improve-prompt-doc-C7lr6nl8.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-BCXzorgr.js → bulk-category-panel-Bj1SJBXK.js} +1 -1
  98. package/dist/client/assets/{calendar-D29VArmq.js → calendar-PQ1Ftg13.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BML32Rgk.js → capability-load-error-CvIv1gsN.js} +1 -1
  100. package/dist/client/assets/category-editor-DliRWtls.js +1 -0
  101. package/dist/client/assets/{chart-DPH16IOZ.js → chart-Dr36_7b5.js} +1 -1
  102. package/dist/client/assets/{chat-context-BSf3NsZt.js → chat-context-BkliO4re.js} +5 -5
  103. package/dist/client/assets/{chat-draft-CYnWSaLo.js → chat-draft-CiN5fXJU.js} +1 -1
  104. package/dist/client/assets/{checkbox-Dabg6CvC.js → checkbox-Cklt31AJ.js} +1 -1
  105. package/dist/client/assets/{choose-editor-Cp-nak_V.js → choose-editor-DGrCIRT5.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-Cn8-SffB.js → cli-auth-success-BHmPrydv.js} +1 -1
  107. package/dist/client/assets/{client-icons-I35gtKUf.js → client-icons-CS1fp_mb.js} +1 -1
  108. package/dist/client/assets/{collapsible-Cc5z9cdY.js → collapsible-DnZ_wlS4.js} +1 -1
  109. package/dist/client/assets/{collection-detail-DjBn5zYW.js → collection-detail-DwkABCiq.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-BMj7QQEq.js → collection-display-button-CODidBR9.js} +1 -1
  111. package/dist/client/assets/{collection-search-ACimtR3t.js → collection-search-2f8pAB4Y.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-D6uxp16B.js → collection-table-wrapper-D2XJ_BvC.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-wZHzLlos.js → collection-tabs-CYx5-BiK.js} +1 -1
  114. package/dist/client/assets/{combobox-CFiHpYi-.js → combobox-BxJAO8U7.js} +1 -1
  115. package/dist/client/assets/{command-uelHA4Qc.js → command-s8BJjz1Z.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-CElJkf6T.js → companion-mcps-section-idD3Wjuq.js} +1 -1
  117. package/dist/client/assets/{connect-C1wR3kQS.js → connect-YaAoKXfV.js} +2 -2
  118. package/dist/client/assets/{connect-layout-CEjyLlsQ.js → connect-layout-B5NqOhZR.js} +1 -1
  119. package/dist/client/assets/{connection-card-z-DTL8a8.js → connection-card-CyoPC3yi.js} +1 -1
  120. package/dist/client/assets/{connection-detail-DTW_zDz8.js → connection-detail-DUSw9X3H.js} +1 -1
  121. package/dist/client/assets/{connection-form-helpers-w89tRjJb.js → connection-form-helpers-BKito2Bz.js} +1 -1
  122. package/dist/client/assets/{connection-CCOtyiTz.js → connection-ju8s9npF.js} +1 -1
  123. package/dist/client/assets/{connections-BCg7O22V.js → connections-B9YPH6e_.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-DgZgs9aG.js → create-organization-dialog-Bd1vOpVb.js} +1 -1
  125. package/dist/client/assets/{decofile-api-BCvZWky6.js → decofile-api-tER_PaB4.js} +1 -1
  126. package/dist/client/assets/{decopilot-JzsJWa1H.js → decopilot-f7DFX3Qm.js} +2 -2
  127. package/dist/client/assets/{dialog-BVRmgEZZ.js → dialog-CfR9zhfQ.js} +1 -1
  128. package/dist/client/assets/{discover-CPUegLX9.js → discover-BuXt2vx3.js} +1 -1
  129. package/dist/client/assets/{domain-settings-BL6MiMeP.js → domain-settings-CqFWBtGR.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-BSQlf9Pn.js → download-app-dialog-BP-_J1f-.js} +1 -1
  131. package/dist/client/assets/{drawer-BwM5wPz_.js → drawer-BiF0PtML.js} +1 -1
  132. package/dist/client/assets/{editor-B9nqdqUb.js → editor-DUpmzLo7.js} +1 -1
  133. package/dist/client/assets/{empty-state-CUy_IWGW.js → empty-state-9hlMmNlC.js} +1 -1
  134. package/dist/client/assets/{empty-state-CyI2CaLY.js → empty-state-D6UqEEY-.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-BYtH8M2u.js → extract-connection-data-DgcpMlth.js} +1 -1
  136. package/dist/client/assets/{feature-gate-Cf4hZv0B.js → feature-gate-D5GuzQQe.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-BSg5h6Wb.js → feature-paywall-BikFTLog.js} +1 -1
  138. package/dist/client/assets/{file-explorer-BaQZtdi0.js → file-explorer-CQocIpVZ.js} +1 -1
  139. package/dist/client/assets/{file-preview-C3-dWXmK.js → file-preview-DNlbJHv7.js} +1 -1
  140. package/dist/client/assets/{file-share-button-BuCRyD4f.js → file-share-button-CO47V7vg.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-Dg8sADAf.js → file-type-icon-Dv-tVjqp.js} +1 -1
  142. package/dist/client/assets/{folder-icon-DA4ZaB45.js → folder-icon-186o_xBL.js} +1 -1
  143. package/dist/client/assets/{form-DwCt2SR2.js → form-DHJlhF9m.js} +1 -1
  144. package/dist/client/assets/{gateway-client-D0oBW_qu.js → gateway-client-4Nr9Lszn.js} +1 -1
  145. package/dist/client/assets/{general-B9q-xe3O.js → general-BCtaDRKE.js} +1 -1
  146. package/dist/client/assets/{github-icon-C0b5ErP6.js → github-icon-B7rNxQCT.js} +1 -1
  147. package/dist/client/assets/{home-Dd28TK1r.js → home-Dskdg6sU.js} +1 -1
  148. package/dist/client/assets/{hooks-D0h9yhqP.js → hooks-BB3WxPkJ.js} +2 -2
  149. package/dist/client/assets/{hooks-DZN1ZKP-.js → hooks-Vq5fn_Sg.js} +1 -1
  150. package/dist/client/assets/{icon-button-DU-Ln0Ge.js → icon-button-C0MdJ7W1.js} +1 -1
  151. package/dist/client/assets/{index-BfTKB7dV.js → index-BCtojorK.js} +1 -1
  152. package/dist/client/assets/{index-CB_d_Ww9.js → index-BDzkh4SF.js} +1 -1
  153. package/dist/client/assets/{index-BK4gf4on.js → index-BNnRrN_z.js} +1 -1
  154. package/dist/client/assets/{index--5vhPfMl.js → index-BNtnQdj2.js} +1 -1
  155. package/dist/client/assets/{index-B4Sw3hof.js → index-BxPwUex4.js} +1 -1
  156. package/dist/client/assets/index-C-9eP1YM.js +1 -0
  157. package/dist/client/assets/{index-BNah-P_g.css → index-CCCwF5vG.css} +1 -1
  158. package/dist/client/assets/{index-CjolVbvM.js → index-CMgSStc4.js} +1 -1
  159. package/dist/client/assets/{index-0kHkZucW.js → index-Ci8I2ZAh.js} +1 -1
  160. package/dist/client/assets/{index-ChGB7Srd.js → index-CnX1wVk0.js} +1 -1
  161. package/dist/client/assets/{index-B4_5ne-m.js → index-DQZBt6Fl.js} +54 -54
  162. package/dist/client/assets/{index-IS0010-i.js → index-Dxn1KDpE.js} +1 -1
  163. package/dist/client/assets/{index-AOu8Y3dB.js → index-X9VHKMKa.js} +1 -1
  164. package/dist/client/assets/{index-BfbICK5t.js → index-aeXfMtPI.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BeZh12s-.js → index-redirect-2ysrmYvb.js} +1 -1
  166. package/dist/client/assets/{index-D_t5RQk4.js → index-waKafOzk.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-CzIaF1BV.js → infiniteQueryObserver-DGwzP6OU.js} +1 -1
  168. package/dist/client/assets/{infra-billing-DMsr0Q0z.js → infra-billing-8H9IQAku.js} +1 -1
  169. package/dist/client/assets/{input-DmFaWWaQ.js → input-Clcfr53P.js} +1 -1
  170. package/dist/client/assets/{input-D7rTqiZA.js → input-Tjg4Yj6g.js} +2 -2
  171. package/dist/client/assets/{input-DhQYTu0H.js → input-rh1Mv0Wr.js} +1 -1
  172. package/dist/client/assets/{integration-icon-CT7gtNMF.js → integration-icon-Dz7H1-MQ.js} +1 -1
  173. package/dist/client/assets/{label-C5dVgFkO.js → label-BNGvxM6S.js} +1 -1
  174. package/dist/client/assets/{last-preview-page-BbdRTqMd.js → last-preview-page-AQeXjWi9.js} +1 -1
  175. package/dist/client/assets/{layout-CXaobmoR.js → layout-X2JiO2W9.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-B2dKvF3G.js → legacy-agents-deep-vurFyg9D.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-psdr3_pB.js → legacy-main-redirect-Bbkf2fqL.js} +1 -1
  178. package/dist/client/assets/library-BGrUeG8I.js +161 -0
  179. package/dist/client/assets/{login-D0perYnq.js → login-Ks2wHpj_.js} +1 -1
  180. package/dist/client/assets/{markdown-CdMnKnHM.js → markdown-j472BGQe.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-kud7EQ1E.js → mcp-app-renderer-CSEPd7DC.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-Bqx9uZfn.js → mcp-oauth-8WwU56fl.js} +1 -1
  183. package/dist/client/assets/{members-BWNEw7IY.js → members-DXX-_l1x.js} +1 -1
  184. package/dist/client/assets/{message-templates-CwYx_hD_.js → message-templates-BszS8o8W.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-i9lqZoyF.js → mini-report-page-IeosqtjA.js} +1 -1
  186. package/dist/client/assets/{mock-board-DDxAYcbL.js → mock-board-DrA4dW9Q.js} +7 -7
  187. package/dist/client/assets/{monaco-editor-BM2SBH_J.js → monaco-editor-B4FcjfHJ.js} +1 -1
  188. package/dist/client/assets/{monitoring-stats-row-BAfuoPc4.js → monitoring-stats-row-ClsmEIaD.js} +1 -1
  189. package/dist/client/assets/{multi-select-Cma9DT-0.js → multi-select-DjG7jWJv.js} +1 -1
  190. package/dist/client/assets/{mustache-DCrtQrVG.js → mustache-B7tW8rKl.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-Bjj2LnDu.js → oauth-callback-CuG-N4Ag.js} +1 -1
  192. package/dist/client/assets/{oauth-callback-ai-provider-iJcxShkv.js → oauth-callback-ai-provider-BQiU_dV5.js} +1 -1
  193. package/dist/client/assets/{onboarding-DdPHiaTb.js → onboarding-oOptdWYC.js} +1 -1
  194. package/dist/client/assets/{optimistic-project-sidebar-views-DbUoja1k.js → optimistic-project-sidebar-views-0eAIAyQZ.js} +1 -1
  195. package/dist/client/assets/org-file-open-context-CV0BvKfM.js +1 -0
  196. package/dist/client/assets/{organization-choice-DSZdyMNl.js → organization-choice-DzIjaq6z.js} +1 -1
  197. package/dist/client/assets/{orgs-EQ3dRKq1.js → orgs-Uh-4y791.js} +1 -1
  198. package/dist/client/assets/{page-seo-form-BgfALyeP.js → page-seo-form-0XF8k2QH.js} +1 -1
  199. package/dist/client/assets/{pair-mgqlVrg4.js → pair-oDAsulNf.js} +7 -7
  200. package/dist/client/assets/{plan-ladder-DFDsraie.js → plan-ladder-DWqjM2H6.js} +1 -1
  201. package/dist/client/assets/{popover-BREpugAm.js → popover-hNLbYWT0.js} +1 -1
  202. package/dist/client/assets/{post-calendar-CnbsL0eo.js → post-calendar-DzuJkfRI.js} +1 -1
  203. package/dist/client/assets/{post-editor-9KdgWdvu.js → post-editor-C1Tx2rOv.js} +1 -1
  204. package/dist/client/assets/{preview-content-BZq0WigR.js → preview-content-DMGh32pv.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-h7LoP6ZX.js → preview-dialog-BGQQrh8x.js} +1 -1
  206. package/dist/client/assets/{primitives-zMFwX0Jx.js → primitives-BFH7BLqO.js} +1 -1
  207. package/dist/client/assets/{profile-CstkdBJB.js → profile-Buekam-F.js} +1 -1
  208. package/dist/client/assets/{project-app-view-BUXGEIxz.js → project-app-view-vdLc6iv3.js} +1 -1
  209. package/dist/client/assets/{project-feed-B2rjMsm6.js → project-feed-DoakvNjk.js} +1 -1
  210. package/dist/client/assets/{project-icon-BuXyfXr6.js → project-icon-DCwjX34f.js} +1 -1
  211. package/dist/client/assets/project-reports-ClF5O16Z.js +1 -0
  212. package/dist/client/assets/project-tasks-6eulHBR4.js +1 -0
  213. package/dist/client/assets/{prompts-C8Tw6ift.js → prompts-CPY17-ZY.js} +1 -1
  214. package/dist/client/assets/record-editor-CRgsUtua.js +1 -0
  215. package/dist/client/assets/{redirect-editor-fDaBjJbA.js → redirect-editor-eNlr_Mfk.js} +1 -1
  216. package/dist/client/assets/registry-AgS1bUyh.js +2 -0
  217. package/dist/client/assets/{registry-layout-CBmayW3a.js → registry-layout-DryRe-Z-.js} +1 -1
  218. package/dist/client/assets/reports-C6IYfeap.js +1 -0
  219. package/dist/client/assets/{reports-D3ZxTpvh.js → reports-D1FePU5c.js} +1 -1
  220. package/dist/client/assets/{reports-onboarding-C-jYNNpv.js → reports-onboarding-_i1HBu7w.js} +1 -1
  221. package/dist/client/assets/{reports-tab-ClSQGtJf.js → reports-tab-Dl6Dk6u1.js} +2 -2
  222. package/dist/client/assets/{repositories-VKk9R6NV.js → repositories-CIXZv6vt.js} +1 -1
  223. package/dist/client/assets/{repository-import-picker-Bxit3rwH.js → repository-import-picker-Cm_I6qX6.js} +1 -1
  224. package/dist/client/assets/{repository-picker-Dtn2F8yh.js → repository-picker-BE31MYd2.js} +1 -1
  225. package/dist/client/assets/{require-capability-DNPqpx0A.js → require-capability-DpBsO_NN.js} +1 -1
  226. package/dist/client/assets/{required-auth-layout-DbcZh8KB.js → required-auth-layout-CLogPoNu.js} +1 -1
  227. package/dist/client/assets/{reset-password-H5cLuWq1.js → reset-password-BtrZlUmp.js} +1 -1
  228. package/dist/client/assets/{resizable-Dw8LR1j8.js → resizable-DW-7DjHg.js} +1 -1
  229. package/dist/client/assets/{review-settings-CQBykdsR.js → review-settings-CvxnEwkr.js} +1 -1
  230. package/dist/client/assets/{rich-text-link-control-XbfHUQMq.js → rich-text-link-control-C4o-c0sL.js} +1 -1
  231. package/dist/client/assets/{roles-CoipftcE.js → roles-DfAkE-T7.js} +1 -1
  232. package/dist/client/assets/route-BUOzO2CZ.js +1 -0
  233. package/dist/client/assets/{route-COHKdv7H.js → route-DkpbXtY4.js} +1 -1
  234. package/dist/client/assets/route-page-header-ddubqYbl.js +1 -0
  235. package/dist/client/assets/{route-BKi-EnKl.js → route-x1w0_XOS.js} +1 -1
  236. package/dist/client/assets/runnable-block-editor-D7DBqRPo.js +16 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-HIhyPh-5.js → sandbox-lifecycle-context-H5kbI9ib.js} +1 -1
  238. package/dist/client/assets/{schema-iizf-P2g.js → schema-D9hq6-Ko.js} +1 -1
  239. package/dist/client/assets/{scroll-area-BcoH4ReJ.js → scroll-area-COAhNkSc.js} +1 -1
  240. package/dist/client/assets/{search-input-CmWlEMU8.js → search-input-eDRvpCEQ.js} +1 -1
  241. package/dist/client/assets/{search-toggle-4qgH_UjE.js → search-toggle-ukQDdkrg.js} +1 -1
  242. package/dist/client/assets/{secrets-Bi8Smqwe.js → secrets-DzQr3bGF.js} +1 -1
  243. package/dist/client/assets/sections-editor-H_6KGCpg.js +2 -0
  244. package/dist/client/assets/{select--0Nrx9pz.js → select-DKZw7VY5.js} +1 -1
  245. package/dist/client/assets/{select-model-BKF1kjR-.js → select-model-kV4UP8Pg.js} +1 -1
  246. package/dist/client/assets/seo-editor-B16rwVRf.js +1 -0
  247. package/dist/client/assets/{separator-CMAG9KMM.js → separator-BVE7Budu.js} +1 -1
  248. package/dist/client/assets/{settings-tab-BrwOMHxn.js → settings-tab-BtAzz40R.js} +1 -1
  249. package/dist/client/assets/{sheet-KfyT4iJh.js → sheet-DuM7cckc.js} +1 -1
  250. package/dist/client/assets/{shell-layout-C7iq_ybu.js → shell-layout-D6lfQGd1.js} +1 -1
  251. package/dist/client/assets/{sidebar-Ce0KwGyJ.js → sidebar-scwXsjFh.js} +1 -1
  252. package/dist/client/assets/{skill-preview-DaiAGQ8W.js → skill-preview-DN9PhO9W.js} +1 -1
  253. package/dist/client/assets/{skills-BfYJXdvY.js → skills-7D59_aEr.js} +1 -1
  254. package/dist/client/assets/{sso-j34bPfk7.js → sso-DXKGvN7S.js} +1 -1
  255. package/dist/client/assets/{store-DjXldX1F.js → store-2S5Y_Sm_.js} +1 -1
  256. package/dist/client/assets/store-registry-BkpvGjQw.js +2 -0
  257. package/dist/client/assets/{switch-uCmnTmA3.js → switch-UqleIRW2.js} +1 -1
  258. package/dist/client/assets/{synced-repos-C07oiVeE.js → synced-repos-I3mzZrDI.js} +1 -1
  259. package/dist/client/assets/{table-Cx5xJBa9.js → table-DY3yh4UN.js} +1 -1
  260. package/dist/client/assets/{tabs-CMPX7aLH.js → tabs-CWunSDaT.js} +1 -1
  261. package/dist/client/assets/{task-board-CwfOEd0p.js → task-board-CU3xz_UX.js} +1 -1
  262. package/dist/client/assets/{task-route-C0NB5FI3.js → task-route-5uvHoI6U.js} +1 -1
  263. package/dist/client/assets/{task-status-CunX_b1I.js → task-status-CbgGINwj.js} +1 -1
  264. package/dist/client/assets/{taskboard-analytics-BVZIpmtK.js → taskboard-analytics-BWpTxoly.js} +1 -1
  265. package/dist/client/assets/{tasks-CKy3IGSO.js → tasks-DEJodw4w.js} +2 -2
  266. package/dist/client/assets/tasks-cQIvs8Qh.js +1 -0
  267. package/dist/client/assets/{textarea-CNloF_6k.js → textarea-D07XC_67.js} +1 -1
  268. package/dist/client/assets/{thread-button-0wpTVhK0.js → thread-button-BQ25_n_A.js} +1 -1
  269. package/dist/client/assets/{thread-intent-BcdlSG8J.js → thread-intent-CPB41f6a.js} +1 -1
  270. package/dist/client/assets/{thread-route-D5lCt0bb.js → thread-route-CDYfrzkB.js} +1 -1
  271. package/dist/client/assets/{thread-route-Bq7TohAn.js → thread-route-DJwg4XWL.js} +1 -1
  272. package/dist/client/assets/{thread-sheet-body-CZ7U6WOP.js → thread-sheet-body-PhMLKGpO.js} +1 -1
  273. package/dist/client/assets/{toggle-group-BPpZ90Kk.js → toggle-group-CRsJ0kJ-.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-Da8s1pOb.js → toolbar-icon-button-CLaEn_t2.js} +1 -1
  275. package/dist/client/assets/{tooltip-Ch_anXXw.js → tooltip-BdIw7qeF.js} +1 -1
  276. package/dist/client/assets/{track-B2ai-lhp.js → track-D7Zl0Ub2.js} +1 -1
  277. package/dist/client/assets/{types-DAtj8pL_.js → types-BFditkVL.js} +1 -1
  278. package/dist/client/assets/{usage-stats-DECzmKdw.js → usage-stats-CydE9W4n.js} +1 -1
  279. package/dist/client/assets/{use-ai-providers-BLQu9X4b.js → use-ai-providers-Jte2cXEd.js} +1 -1
  280. package/dist/client/assets/{use-automations-DGQLDHfM.js → use-automations-DMglF-Hp.js} +1 -1
  281. package/dist/client/assets/{use-autosave-D2GJMvju.js → use-autosave-BK4aenoc.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-TpX59d2A.js → use-connect-companion-CWVubK_K.js} +1 -1
  283. package/dist/client/assets/{use-connection-DEkZ7Z3y.js → use-connection-CLDZmFlP.js} +1 -1
  284. package/dist/client/assets/{use-copy-BdX2_tpS.js → use-copy-BwelGe7h.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-B22agNFs.js → use-create-virtual-mcp-C0nekJmJ.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-DdFVZp6l.js → use-date-fns-locale-9ht16XX5.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-g0CT53cz.js → use-debounced-autosave-CxvwYE3R.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-CPADjlu8.js → use-debounced-value-DTrA4F64.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-0LI1tSh2.js → use-deco-credits-toD66YNU.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-CztvGxbe.js → use-decopilot-events-Cr8-gyRq.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-BrxuwVV0.js → use-delete-connection-pojdnt_G.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-BW07NJZx.js → use-deployment-admin-BtzBlxtt.js} +1 -1
  293. package/dist/client/assets/{use-entitlements-Cpg4O4cU.js → use-entitlements-Dd8GRYfR.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-BS4vDkY8.js → use-fast-preview-draft-url-6t7oVPGL.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-T83FDKTN.js → use-file-configs-DEt6cPMd.js} +1 -1
  296. package/dist/client/assets/{use-in-settings-CCWZ9EQU.js → use-in-settings-CpoJAiS9.js} +1 -1
  297. package/dist/client/assets/{use-infinite-scroll-CQVHxZ2X.js → use-infinite-scroll-BxfFw7w5.js} +1 -1
  298. package/dist/client/assets/{use-join-requests-BM1WOs-R.js → use-join-requests-CIDw0OFM.js} +1 -1
  299. package/dist/client/assets/{use-main-panel-tabs-BGkjNCY6.js → use-main-panel-tabs-D1QVss-2.js} +1 -1
  300. package/dist/client/assets/{use-mcp-auth-status-DPrXZk0m.js → use-mcp-auth-status-Cg-aCR2N.js} +1 -1
  301. package/dist/client/assets/{use-mcp-client-Di29uH1Z.js → use-mcp-client-CuZ_CH4K.js} +1 -1
  302. package/dist/client/assets/{use-mcp-prompts-pRQvLesG.js → use-mcp-prompts-SnT9jAGG.js} +1 -1
  303. package/dist/client/assets/{use-mcp-tools-BTMKYjmq.js → use-mcp-tools-DjSYGU3r.js} +1 -1
  304. package/dist/client/assets/{use-members-2-cC5S8b.js → use-members-DTIbBdqQ.js} +1 -1
  305. package/dist/client/assets/{use-mobile-Br1FbuT5.js → use-mobile-BwXePCI-.js} +1 -1
  306. package/dist/client/assets/{use-navigate-to-agent-BIB5Nkxx.js → use-navigate-to-agent-DIxyyobE.js} +1 -1
  307. package/dist/client/assets/{use-open-billing-url-DwCvmaT1.js → use-open-billing-url-CnWEYZe0.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-BQN7hmW6.js → use-org-auth-client-D-YRClZm.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-up6Ae3F-.js → use-org-fs-6rzJUZWB.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-B1-u1Sww.js → use-org-repo-syncs-BPvYovov.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-CSb7uzWR.js → use-org-sso-EA4En7Bf.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-DP4t5Npf.js → use-organization-roles-DjL7Q_JO.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-B7QbhgeU.js → use-organization-settings-rcECAo5J.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-7owLLl5-.js → use-panel-navigate-CCrHg3rQ.js} +1 -1
  315. package/dist/client/assets/{use-project-native-view-presence-C6Z-dNAC.js → use-project-native-view-presence-D_C9jbvc.js} +1 -1
  316. package/dist/client/assets/{use-project-scope-D7MgPnbk.js → use-project-scope-ChdEK9JU.js} +1 -1
  317. package/dist/client/assets/{use-registry-connections-CvrvQHoJ.js → use-registry-connections-C8ZRYmvy.js} +1 -1
  318. package/dist/client/assets/{use-releases-DYrm3R-D.js → use-releases-B2PktYSE.js} +1 -1
  319. package/dist/client/assets/{use-reports-diagnostic-B0GD9uDf.js → use-reports-diagnostic-Ffc8G8Yb.js} +1 -1
  320. package/dist/client/assets/{use-route-default-main--vHXCkHM.js → use-route-default-main-DTBEGWiB.js} +1 -1
  321. package/dist/client/assets/{use-secrets-DwITZFB8.js → use-secrets-C2UFcx4t.js} +1 -1
  322. package/dist/client/assets/use-section-preview-base-D8AdMeK_.js +1 -0
  323. package/dist/client/assets/{use-session-runtime-B1xdg1Mc.js → use-session-runtime-Kk87TZ4U.js} +1 -1
  324. package/dist/client/assets/{use-tags-DXxTmE03.js → use-tags-BZaCfmft.js} +1 -1
  325. package/dist/client/assets/{use-task-board-analytics-5o37lq8z.js → use-task-board-analytics-Dbi3TI9y.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-xMti_d98.js → use-task-metadata-DptBPkcd.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-BwzUBEaq.js → use-thread-outputs-DE9doz4g.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-DB3Sv4EV.js → use-view-mode-CavAJ0r0.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-CdMkF3Nz.js → use-virtual-mcp-4T8Uqtz2.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-Ds6mCrD2.js +1 -0
  331. package/dist/client/assets/{useQueries-B3o1rvWe.js → useQueries-D3RKoZYz.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-M0UgyPh7.js +1 -0
  333. package/dist/client/assets/{users-DBFRWsia.js → users-WBHQMz8R.js} +1 -1
  334. package/dist/client/assets/{utils-gTOau_mh.js → utils-CyaFhLFV.js} +1 -1
  335. package/dist/client/assets/{variant-calendar-DOxG9iwM.js → variant-calendar-DAIHFkeQ.js} +1 -1
  336. package/dist/client/assets/{variant-matcher-override-DPq8EH6t.js → variant-matcher-override-Dyv3s-dG.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-DYECPSMs.js → view-mode-toggle-DEbfOadi.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-AqKeX5w8.js → virtual-mcp-DXgT3asw.js} +1 -1
  339. package/dist/client/index.html +2 -2
  340. package/dist/server/cli.js +1 -1
  341. package/dist/server/server.js +1 -1
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-Dd4FMRFP.js +0 -1
  344. package/dist/client/assets/agent-assets-ihYul22E.js +0 -1
  345. package/dist/client/assets/agent-deck-BWPlKksS.js +0 -1
  346. package/dist/client/assets/agent-file-BKO35b36.js +0 -1
  347. package/dist/client/assets/agent-library-file-B3_-CXIA.js +0 -1
  348. package/dist/client/assets/agent-settings-BxZaeWUx.js +0 -1
  349. package/dist/client/assets/agent-site-editor-code-B-pWeSRV.js +0 -2
  350. package/dist/client/assets/agent-site-editor-content-BGJ14_Az.js +0 -2
  351. package/dist/client/assets/agent-view-DDrzopEk.js +0 -1
  352. package/dist/client/assets/api-keys-DEkuX1eT.js +0 -1
  353. package/dist/client/assets/app-editor-ChfXMKUs.js +0 -1
  354. package/dist/client/assets/automations-BQHaweWF.js +0 -1
  355. package/dist/client/assets/category-editor-BTonT0GY.js +0 -1
  356. package/dist/client/assets/index-DbfxHNth.js +0 -1
  357. package/dist/client/assets/library-CHpieazL.js +0 -161
  358. package/dist/client/assets/org-file-open-context-DNcgI0Uf.js +0 -1
  359. package/dist/client/assets/project-reports-BCqm5aO0.js +0 -1
  360. package/dist/client/assets/project-tasks-Bka5utN5.js +0 -1
  361. package/dist/client/assets/record-editor-BpAD-e4x.js +0 -1
  362. package/dist/client/assets/registry-CtLO9kjB.js +0 -2
  363. package/dist/client/assets/reports-D2RKwYmT.js +0 -1
  364. package/dist/client/assets/route-C9H7VfVw.js +0 -1
  365. package/dist/client/assets/route-page-header-KctxVQ_e.js +0 -1
  366. package/dist/client/assets/runnable-block-editor-BzVWSPHL.js +0 -16
  367. package/dist/client/assets/sections-editor-Bo5eUKAB.js +0 -2
  368. package/dist/client/assets/seo-editor-D9L3VA5c.js +0 -1
  369. package/dist/client/assets/store-registry-RTogK1X0.js +0 -2
  370. package/dist/client/assets/tasks-DF_oVYA4.js +0 -1
  371. package/dist/client/assets/use-section-preview-base-BFHyMpzJ.js +0 -1
  372. package/dist/client/assets/useInfiniteQuery-DvCOEAKG.js +0 -1
  373. package/dist/client/assets/useSuspenseInfiniteQuery-DMqlAGdI.js +0 -1
@@ -1 +1 @@
1
- import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-B4_5ne-m.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function X(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Q(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function b(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=b(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=b(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
1
+ import{aY as $,aZ as v,a_ as W,a$ as H,b0 as D,b1 as y,b2 as V,b3 as x,b4 as L,b5 as q,b6 as j,b7 as N,b8 as B,b9 as Z,ba as F}from"./index-DQZBt6Fl.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await b(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function b(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await b(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function P(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=P(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=P(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,b as a,_e as b,Ue as c,T as d,me as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-B4_5ne-m.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-DQZBt6Fl.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
@@ -1 +1 @@
1
- import{a as V,Y as _e,r as v,e as me,q as z,j as t,l as N,B as xe,o as Be,m as Ve,K as ue,c as oe,b as be,h as Fe}from"./index-B4_5ne-m.js";import{I as ee}from"./input-DhQYTu0H.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-i8LvYSZg.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}=_e(),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,_=C.enabled&&(g||!y.enabled&&!h),[b,F]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=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=q==="signUp",U=q==="forgotPassword",T=q==="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})},qe=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===F&&j&&H("")},ae=s=>{W(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(),We=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:We(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 compact:rounded-lg",P?"h-11":"h-12"),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&&(_||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:qe,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(F),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&&_&&!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(F),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&&_&&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(F),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&&_?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&_?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(Fe,{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(Fe,{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}=_e(),h=Xe(),_=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const F=b,L=h?.actions;let Q;e[2]!==F||e[3]!==L?(Q={...Le,...F,...L},e[2]=F,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]!==_?(a=t.jsx(tt,{redirectTo:_,onAuthEvent:w}),e[15]=w,e[16]=_,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==_||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:_,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=_,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]!==F||e[28]!==L?(x={...F,...L},e[27]=F,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 q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,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,Y as _e,r as v,e as me,q as z,j as t,l as N,B as xe,o as Be,m as Ve,K as ue,c as oe,b as be,h as Fe}from"./index-DQZBt6Fl.js";import{I as ee}from"./input-rh1Mv0Wr.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-i8LvYSZg.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}=_e(),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,_=C.enabled&&(g||!y.enabled&&!h),[b,F]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=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=q==="signUp",U=q==="forgotPassword",T=q==="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})},qe=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===F&&j&&H("")},ae=s=>{W(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(),We=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:We(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 compact:rounded-lg",P?"h-11":"h-12"),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&&(_||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:qe,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(F),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&&_&&!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(F),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&&_&&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(F),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&&_?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&_?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(Fe,{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(Fe,{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}=_e(),h=Xe(),_=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const F=b,L=h?.actions;let Q;e[2]!==F||e[3]!==L?(Q={...Le,...F,...L},e[2]=F,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]!==_?(a=t.jsx(tt,{redirectTo:_,onAuthEvent:w}),e[15]=w,e[16]=_,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==_||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:_,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=_,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]!==F||e[28]!==L?(x={...F,...L},e[27]=F,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 q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,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-B4_5ne-m.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-DQZBt6Fl.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-B4_5ne-m.js";import{i as u,a as p}from"./mcp-oauth-Bqx9uZfn.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-DQZBt6Fl.js";import{i as u,a as p}from"./mcp-oauth-8WwU56fl.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 q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-B4_5ne-m.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-DQ7VA4it.js";import{A as me,ac as ue}from"./agent-icon-Bbnm30MH.js";import{i as de}from"./DotsVertical-CycZdUV6.js";import{s as fe}from"./Trash01-Bt7knSgw.js";import{i as ge}from"./Zap-CIXkomUE.js";import{a as xe}from"./use-virtual-mcp-CdMkF3Nz.js";import{a as pe}from"./use-automations-DGQLDHfM.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,K]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),K(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const O=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,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 E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{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]=E):E=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),K(!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(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=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]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,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(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{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(oe,{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]!==O||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:O,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=O,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{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(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:K,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let I;return e[77]!==A||e[78]!==F?(I=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=I):I=e[79],I}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.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{Ce as A};
1
+ import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-DQZBt6Fl.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-BYQAyeOC.js";import{A as me,ac as ue}from"./agent-icon-DZmc5CaF.js";import{i as de}from"./DotsVertical-DCTIN1zx.js";import{s as fe}from"./Trash01-Cs1900Vx.js";import{i as ge}from"./Zap-BkWm3G14.js";import{a as xe}from"./use-virtual-mcp-4T8Uqtz2.js";import{a as pe}from"./use-automations-DMglF-Hp.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,K]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),K(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const O=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,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 E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{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]=E):E=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),K(!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(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=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]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,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(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{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(oe,{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]!==O||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:O,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=O,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{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(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:K,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let I;return e[77]!==A||e[78]!==F?(I=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=I):I=e[79],I}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.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{Ce as A};
@@ -1 +1 @@
1
- import{c as z,r as lt,b as X,a0 as it,z as rt,a6 as ct,K as tt,j as s,l as ut,m as dt,eL as mt}from"./index-B4_5ne-m.js";import{u as ft}from"./useInfiniteQuery-DvCOEAKG.js";import{u as xt}from"./use-connection-DEkZ7Z3y.js";import{u as pt}from"./use-mcp-client-Di29uH1Z.js";import{b as gt}from"./use-virtual-mcp-CdMkF3Nz.js";import{b as ht,a as Rt}from"./sheet-KfyT4iJh.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-Cx5xJBa9.js";import{E as et}from"./empty-state-CUy_IWGW.js";import{u as Tt}from"./use-infinite-scroll-CQVHxZ2X.js";import{a as St}from"./use-members-2-cC5S8b.js";import{g as vt}from"./task-status-CunX_b1I.js";import{e as wt}from"./use-automations-DGQLDHfM.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-CZ7U6WOP.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const W=50;function Y(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(Y,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(Y,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(Y,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=X();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?($=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=$):$=t[56],$}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=$):$=t[30];const P=$;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Z||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map((M,J)=>s.jsx(yt,{run:M,usage:P.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===d.length-1?Z:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Z,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Bt as A,It as u};
1
+ import{c as z,r as lt,b as X,a0 as it,z as rt,a6 as ct,K as tt,j as s,l as ut,m as dt,eM as mt}from"./index-DQZBt6Fl.js";import{u as ft}from"./useInfiniteQuery-Ds6mCrD2.js";import{u as xt}from"./use-connection-CLDZmFlP.js";import{u as pt}from"./use-mcp-client-CuZ_CH4K.js";import{b as gt}from"./use-virtual-mcp-4T8Uqtz2.js";import{b as ht,a as Rt}from"./sheet-DuM7cckc.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-DY3yh4UN.js";import{E as et}from"./empty-state-9hlMmNlC.js";import{u as Tt}from"./use-infinite-scroll-BxfFw7w5.js";import{a as St}from"./use-members-DTIbBdqQ.js";import{g as vt}from"./task-status-CbgGINwj.js";import{e as wt}from"./use-automations-DMglF-Hp.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-PhMLKGpO.js";function It(c){const t=z.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const W=50;function Y(c){const t=z.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=z.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(Y,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(Y,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(Y,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=z.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=X();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let M;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?(M=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=M):M=t[56],M}function Bt(c){const t=z.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async $=>{const{pageParam:J}=$,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let M;t[29]!==E?.items?(M=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=M):M=t[30];const P=M;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=Tt(U,S??!1,p),b=It(d),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Z||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map(($,J)=>s.jsx(yt,{run:$,usage:P.get($.id),onClick:()=>b.select($.id),lastRowRef:J===d.length-1?Z:void 0},$.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Z,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=$=>{$||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(Ct,{thread:B,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let Q;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(Q=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=Q):Q=t[72],Q}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Bt as A,It as u};
@@ -0,0 +1 @@
1
+ import{c as k,j as e,b as $,a0 as D,d as M,r as q,n as d,B as V,fz as F,q as R}from"./index-DQZBt6Fl.js";import{s as G}from"./Plus-DcpbfgdJ.js";import{i as S}from"./Zap-BkWm3G14.js";import{S as H}from"./search-input-eDRvpCEQ.js";import{E as T}from"./empty-state-9hlMmNlC.js";import{u as J}from"./use-automations-DMglF-Hp.js";import{u as K}from"./use-navigate-to-agent-DIxyyobE.js";import{A as O}from"./automation-list-row-CfW-tzTh.js";import{b as Q}from"./use-virtual-mcp-4T8Uqtz2.js";import{R as U}from"./require-capability-DpBsO_NN.js";import"./SearchMd-XFzJrarE.js";import"./use-mcp-client-CuZ_CH4K.js";import"./auth-BCpLT4L2.js";import"./hooks-Vq5fn_Sg.js";import"./backoff-8mStPHYB.js";import"./task-board-CU3xz_UX.js";import"./schema-D9hq6-Ko.js";import"./thread-intent-CPB41f6a.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./alert-dialog-BYQAyeOC.js";import"./agent-icon-DZmc5CaF.js";import"./AlertCircle-CqW1GFxy.js";import"./Tool01-dwGgKodr.js";import"./ArrowUp-DIK810PT.js";import"./ArrowLeft-BGvcqKye.js";import"./Tool02-CbeJXNE6.js";import"./ArrowRight-CfSh04kd.js";import"./TrendUp01-BfIYShuZ.js";import"./ZoomOut-BYNmIOoy.js";import"./Globe04-ClHubtty.js";import"./CheckCircle-eFuhjKFT.js";import"./ChevronUp-QcSQ5rVq.js";import"./UserSquare-CBd8Lm1t.js";import"./Copy01-BsZDIS3z.js";import"./CreditCard01-yw_JaYDH.js";import"./DotsVertical-DCTIN1zx.js";import"./Download01-B4Q5hpED.js";import"./Settings02-CncEwCCz.js";import"./Eye-C46dzrHd.js";import"./Share07-CxrO44KP.js";import"./Globe01-DlhUCcjG.js";import"./XClose-Cu0FBQhr.js";import"./Image01-DVR_EyJG.js";import"./Key01-muV6twoN.js";import"./LayoutLeft-xdqdW3pr.js";import"./Link01-BbJKwlY6.js";import"./LinkExternal01-FZW_JKrN.js";import"./Monitor01-CN-5WdRa.js";import"./Sun-xECmqRY7.js";import"./Package-CkvAk6JQ.js";import"./Palette-D8vRagJV.js";import"./Play-P0YcNy8v.js";import"./SearchLg-7L27EznQ.js";import"./Stars01-DyW-G6OS.js";import"./Trash01-Cs1900Vx.js";import"./Upload01-odxUyqlC.js";import"./User01-C-kfOI2V.js";import"./Users01-DW5XXBNa.js";import"./XCircle-ChzUwnd9.js";import"./X-DgI4yqfX.js";import"./access-gate-DrhvBokN.js";import"./capability-load-error-CvIv1gsN.js";function W(){const t=k.c(20),o=$(),{org:l}=D(),{data:y}=J(void 0),g=y===void 0?[]:y,z=Q(),E=K(),f=M(),[x,P]=q.useState(""),h=x.toLowerCase(),b=new Map(z.map(X)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=b.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),B=(i,p)=>{const N=p&&b.has(p)?p:F(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),E(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,C=d,v=d;let s;t[3]!==o?(s=o("settings.automations.pageTitle"),t[3]=o,t[4]=s):s=t[4];let r;t[5]!==s?(r=e.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&e.jsx(H,{value:x,onChange:P,placeholder:o("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let n;t[7]!==r||t[8]!==w?(n=e.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=n):n=t[9];const _=g.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.emptyTitle"),description:o("settings.automations.emptyDescription"),actions:e.jsxs(V,{size:"sm",onClick:L,children:[e.jsx(G,{size:14}),o("settings.automations.browseAgentsButton")]})})}):A.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.noResultsTitle"),description:o("settings.automations.noResultsDescription",{search:x})})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:A.map(i=>e.jsx(O,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let a;t[10]!==v.Container||t[11]!==n||t[12]!==_?(a=e.jsxs(v.Container,{children:[n,_]}),t[10]=v.Container,t[11]=n,t[12]=_,t[13]=a):a=t[13];let m;t[14]!==C.Content||t[15]!==a?(m=e.jsx(C.Content,{children:a}),t[14]=C.Content,t[15]=a,t[16]=m):m=t[16];let u;return t[17]!==j||t[18]!==m?(u=e.jsx(j,{children:m}),t[17]=j,t[18]=m,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function ne(){const t=k.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(U,{capability:"automations:manage",area:"automations",children:e.jsx(W,{})}),t[0]=o):o=t[0],o}export{ne as default};
@@ -1 +1 @@
1
- import{$ as d}from"./index-B4_5ne-m.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
1
+ import{$ as d}from"./index-DQZBt6Fl.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
@@ -1 +1 @@
1
- import{c as k,j as i,l as f,aF as R,ba as V,bb as I,bc as $}from"./index-B4_5ne-m.js";import{s as O}from"./User01-DKY_ILGI.js";function U(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=f("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($,{"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=f("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(V,{"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=f("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"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(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 S=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 m=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 b=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(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]!==m||e[20]!==h?(w=f(S({shape:m,size:h}),s),e[18]=s,e[19]=m,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==b||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:b})]}),e[22]=z,e[23]=b,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(U,{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 m=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 b;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==m||e[15]!==x||e[16]!==l?(b=i.jsx(W,{shape:m,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]=m,e[15]=x,e[16]=l,e[17]=b):b=e[17],b}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
1
+ import{c as k,j as i,l as f,aF as R,bb as V,bc as I,bd as $}from"./index-DQZBt6Fl.js";import{s as O}from"./User01-C-kfOI2V.js";function U(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=f("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($,{"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=f("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(V,{"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=f("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"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(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 S=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 m=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 b=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(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]!==m||e[20]!==h?(w=f(S({shape:m,size:h}),s),e[18]=s,e[19]=m,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==b||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:b})]}),e[22]=z,e[23]=b,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(U,{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 m=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 b;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==m||e[15]!==x||e[16]!==l?(b=i.jsx(W,{shape:m,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]=m,e[15]=x,e[16]=l,e[17]=b):b=e[17],b}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
@@ -1 +1 @@
1
- import{c as g,l,j as u,bd as v,aF as b}from"./index-B4_5ne-m.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",segmented:"h-7 gap-0 rounded-lg border-transparent bg-card p-0 card-shadow"}},defaultVariants:{variant:"default",size:"default"}});function h(d){const e=g.c(14);let r,s,a,n,t;e[0]!==d?({className:r,variant:t,size:a,asChild:n,...s}=d,e[0]=d,e[1]=r,e[2]=s,e[3]=a,e[4]=n,e[5]=t):(r=e[1],s=e[2],a=e[3],n=e[4],t=e[5]);const c=(n===void 0?!1:n)?v:"span";let i;e[6]!==r||e[7]!==a||e[8]!==t?(i=l(f({variant:t,size:a}),r),e[6]=r,e[7]=a,e[8]=t,e[9]=i):i=e[9];let o;return e[10]!==c||e[11]!==s||e[12]!==i?(o=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[10]=c,e[11]=s,e[12]=i,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as g,l,j as u,be as v,aF as b}from"./index-DQZBt6Fl.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",segmented:"h-7 gap-0 rounded-lg border-transparent bg-card p-0 card-shadow"}},defaultVariants:{variant:"default",size:"default"}});function h(d){const e=g.c(14);let r,s,a,n,t;e[0]!==d?({className:r,variant:t,size:a,asChild:n,...s}=d,e[0]=d,e[1]=r,e[2]=s,e[3]=a,e[4]=n,e[5]=t):(r=e[1],s=e[2],a=e[3],n=e[4],t=e[5]);const c=(n===void 0?!1:n)?v:"span";let i;e[6]!==r||e[7]!==a||e[8]!==t?(i=l(f({variant:t,size:a}),r),e[6]=r,e[7]=a,e[8]=t,e[9]=i):i=e[9];let o;return e[10]!==c||e[11]!==s||e[12]!==i?(o=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[10]=c,e[11]=s,e[12]=i,e[13]=o):o=e[13],o}export{h as B};