@abtnode/blocklet-services 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16

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 (207) hide show
  1. package/dist/assets/{AdapterDayjs-BI3dme25.js → AdapterDayjs-CYW0YvmK.js} +1 -1
  2. package/dist/assets/{Google-BMSeyXdi.js → Google-DKRt92nm.js} +1 -1
  3. package/dist/assets/{access-control-CSfPgD_B.js → access-control-RI6LQbSm.js} +1 -1
  4. package/dist/assets/{actions-Ng-YRTer.js → actions-BlWED76c.js} +2 -2
  5. package/dist/assets/{actions-Dktj9pEF.js → actions-DydkTgA0.js} +1 -1
  6. package/dist/assets/{add-component-core-DOIm-W83.js → add-component-core-nc1ps0ni.js} +32 -32
  7. package/dist/assets/{add-resource-_wuuBiJJ.js → add-resource-BVOdOQSW.js} +1 -1
  8. package/dist/assets/{addon-N_sS-Sx6.js → addon-DfWedLEC.js} +1 -1
  9. package/dist/assets/{advanced-BhbxG-_n.js → advanced-CuKHqbLO.js} +2 -2
  10. package/dist/assets/{aigne-DElJAbjP.js → aigne-6nMSoyeQ.js} +1 -1
  11. package/dist/assets/{appearance-D71HSeGD.js → appearance-C9TkbSjV.js} +1 -1
  12. package/dist/assets/{ar-BHqjWgUQ.js → ar-DOhYGTlW.js} +1 -1
  13. package/dist/assets/{audit-logs-Ci_HlT4m.js → audit-logs-DKGke9hI.js} +2 -2
  14. package/dist/assets/{authorize-DQERA3Vv.js → authorize-DkSqywe8.js} +1 -1
  15. package/dist/assets/{base-chart-DWXZOkNE.js → base-chart-DcZV4ZCI.js} +1 -1
  16. package/dist/assets/{base32-Cpvj2sD4.js → base32-7iZvvdX8.js} +1 -1
  17. package/dist/assets/{bind-account-BIzFrnLk.js → bind-account-DOwM9Nhe.js} +1 -1
  18. package/dist/assets/branding-Cak2s8bn.js +1 -0
  19. package/dist/assets/{branding-BHJqY7Mz.js → branding-CwSyd5WC.js} +1 -1
  20. package/dist/assets/{branding-DAdwbyWZ.js → branding-lcfxmmPp.js} +1 -1
  21. package/dist/assets/{bundle-avatar-sDqev1Fh.js → bundle-avatar-DwiOyeMO.js} +1 -1
  22. package/dist/assets/button-uUU4Wycr.js +1 -0
  23. package/dist/assets/{click-to-copy-RBTqACSW.js → click-to-copy-BgIYUMoo.js} +1 -1
  24. package/dist/assets/{collapse-DWmyzfnW.js → collapse-RMuUWnK3.js} +1 -1
  25. package/dist/assets/{complete-D6XDZtnV.js → complete-Udiv_yFp.js} +1 -1
  26. package/dist/assets/{component-B2qSKMGx.js → component-CuKviNC8.js} +2 -2
  27. package/dist/assets/{config-oF-A1tKe.js → config-6IwEgT3b.js} +1 -1
  28. package/dist/assets/{config-Ca5tnO9j.js → config-CJwxv2uK.js} +1 -1
  29. package/dist/assets/{config-fYkZxdEr.js → config-D1OcHGlN.js} +4 -4
  30. package/dist/assets/{config-navigation-BEYJ5bSz.js → config-navigation-hDihVsjx.js} +2 -2
  31. package/dist/assets/{config-space-HmsYCb6s.js → config-space-DfstlHnF.js} +1 -1
  32. package/dist/assets/{confirm-DQYDHHdS.js → confirm-CdVn5WdC.js} +1 -1
  33. package/dist/assets/{connect-COLwEMSx.js → connect-CT2vMz6l.js} +3 -3
  34. package/dist/assets/{connect-ydb7rKXe.js → connect-DA7RO2yv.js} +1 -1
  35. package/dist/assets/{connect-BeWeBwCA.js → connect-Dy0Y8HRB.js} +1 -1
  36. package/dist/assets/{connect-to-C3ac4B-g.js → connect-to-CQMUbQkH.js} +1 -1
  37. package/dist/assets/{content-layout-CanSZTqf.js → content-layout-Dlmn5DW6.js} +1 -1
  38. package/dist/assets/{create-passport-svg-De1vqcmo.js → create-passport-svg-hldNORaB.js} +1 -1
  39. package/dist/assets/{createClass-CRUn7w67.js → createClass-CgfWUrk8.js} +1 -1
  40. package/dist/assets/{dashboard-BZiea8Z_.js → dashboard-BvI3ii8Z.js} +2 -2
  41. package/dist/assets/{de-QUGQFv2K.js → de-CtKPdGk6.js} +1 -1
  42. package/dist/assets/{delete-confirm-CpaOkuin.js → delete-confirm-CkiUXocp.js} +1 -1
  43. package/dist/assets/{did-address-DRYM96gB.js → did-address-CG36eCOx.js} +1 -1
  44. package/dist/assets/{domain-D9Kc4Rgt.js → domain-CDTeLbkZ.js} +1 -1
  45. package/dist/assets/{domain-action-card-ugKl692S.js → domain-action-card-kMPYS2Nj.js} +1 -1
  46. package/dist/assets/domains-TI6o1CvX.js +1 -0
  47. package/dist/assets/{email-DDyG3qPR.js → email-DHRHueET.js} +2 -2
  48. package/dist/assets/{empty-spinner-ChYvCNCV.js → empty-spinner-DB1GKIOS.js} +1 -1
  49. package/dist/assets/engine-D_fEFx9_.js +1 -0
  50. package/dist/assets/{es-C4w6cL07.js → es-BSYtSZPg.js} +1 -1
  51. package/dist/assets/{exchange-passport-DoiXZo5M.js → exchange-passport-Cc872mjQ.js} +1 -1
  52. package/dist/assets/{fallback-CZRO9TTQ.js → fallback-D-IHOW-7.js} +1 -1
  53. package/dist/assets/{form--iZWaH7Y.js → form-Co-tgocU.js} +1 -1
  54. package/dist/assets/{form-text-input-Cs-LuCu0.js → form-text-input-CPLafaTk.js} +1 -1
  55. package/dist/assets/{form-wrapper-EixE0Jkw.js → form-wrapper-kWYD3nZz.js} +1 -1
  56. package/dist/assets/{fr-Bq3UipEu.js → fr-C35fi7h9.js} +1 -1
  57. package/dist/assets/{fuel-C85y6XSK.js → fuel-BFx1ShM2.js} +1 -1
  58. package/dist/assets/{gen-access-key-DxF-VBeV.js → gen-access-key-DrgLVRbm.js} +1 -1
  59. package/dist/assets/{gen-simple-access-key-Cxq1_uy6.js → gen-simple-access-key-B24d6k7g.js} +1 -1
  60. package/dist/assets/get-safe-url-beob4f2C.js +1 -0
  61. package/dist/assets/{hi-DGZy0DLh.js → hi-5fpYJkiW.js} +1 -1
  62. package/dist/assets/{home-EzPPxjBW.js → home-Dw18IODa.js} +1 -1
  63. package/dist/assets/{id-DOzDilAf.js → id-DoVb0JYr.js} +1 -1
  64. package/dist/assets/{iframe-C5nvJ0m0.js → iframe-DUzp97tk.js} +1 -1
  65. package/dist/assets/{index-B3ArnS-X.js → index--WQuhwJL.js} +1 -1
  66. package/dist/assets/{index-Cw8Yly1u.js → index-2M4w6J9r.js} +1 -1
  67. package/dist/assets/{index-D3fA5iF-.js → index-3H6a5edM.js} +1 -1
  68. package/dist/assets/{index-_uJPC7_n.js → index-8RHrVCC6.js} +1 -1
  69. package/dist/assets/{index-BM9QepzF.js → index-B-8044Gs.js} +22 -11
  70. package/dist/assets/{index-Ba_SJ3UV.js → index-B6l4xGy5.js} +2 -2
  71. package/dist/assets/{index-CbZQvtgh.js → index-B9FojAjj.js} +1 -1
  72. package/dist/assets/{index-BQFgfBFX.js → index-BOPR4Iyc.js} +2 -2
  73. package/dist/assets/{index-VlFqUdI2.js → index-BUhEyicQ.js} +1 -1
  74. package/dist/assets/{index-DGU5RA0-.js → index-BeunkI-Z.js} +3 -3
  75. package/dist/assets/{index-_bvucGkF.js → index-Bo9KtpTY.js} +1 -1
  76. package/dist/assets/{index-r7svI4rK.js → index-Bpic07NM.js} +7 -7
  77. package/dist/assets/{index-BuucS_rQ.js → index-C1fKsLzf.js} +1 -1
  78. package/dist/assets/{index-D_ymA2Th.js → index-C4ZzROeE.js} +5 -5
  79. package/dist/assets/{index-sb6EjUcD.js → index-CEJb82tA.js} +1 -1
  80. package/dist/assets/{index-Ca33rdd_.js → index-CXp5SI_f.js} +82 -82
  81. package/dist/assets/{index-zkaWHEAS.js → index-C_kNXHsF.js} +1 -1
  82. package/dist/assets/{index-DvQIPWQ6.js → index-Cax1AxL9.js} +1 -1
  83. package/dist/assets/{index-Ca5zgzpl.js → index-CfvGuvbD.js} +1 -1
  84. package/dist/assets/{index-BbO4pSmm.js → index-CqCXPf7W.js} +1 -1
  85. package/dist/assets/{index-p0MfrvgW.js → index-Cx0E03Bs.js} +1 -1
  86. package/dist/assets/{index-CL5ZGYlc.js → index-D3BuekEe.js} +3 -3
  87. package/dist/assets/{index-D4_8N2le.js → index-D6pCyJv8.js} +1 -1
  88. package/dist/assets/{index-Ddl9fWMP.js → index-DFUM0Pvk.js} +1 -1
  89. package/dist/assets/{index-B3fG443w.js → index-DH4rC-7M.js} +1 -1
  90. package/dist/assets/{index-B2PeJoug.js → index-DKzBOJCu.js} +2 -2
  91. package/dist/assets/index-DL0wTcgx.js +1 -0
  92. package/dist/assets/{index-C9V4aWeM.js → index-DWHFecw2.js} +4 -4
  93. package/dist/assets/{index-Dxb3MonW.js → index-DcW3jqfL.js} +1 -1
  94. package/dist/assets/{index-CxOxF1pg.js → index-Di2nSesc.js} +1 -1
  95. package/dist/assets/{index-CiCryHDZ.js → index-DqcciDRh.js} +2 -2
  96. package/dist/assets/{index-DCxNOCc2.js → index-VKjWmvRV.js} +1 -1
  97. package/dist/assets/{index-DVOweIMx.js → index-Vf51dp11.js} +1 -1
  98. package/dist/assets/{index-2AyCotIy.js → index-ZzcJ7eKO.js} +1 -1
  99. package/dist/assets/{index-Bwibx9MU.js → index-bEFOmVth.js} +1 -1
  100. package/dist/assets/{info-outline-rounded-DVdLJtdi.js → info-outline-rounded-DlgANjBB.js} +1 -1
  101. package/dist/assets/{invitation-CUluW5mi.js → invitation-BP8hOEFv.js} +1 -1
  102. package/dist/assets/invitations-C8aZLxdl.js +3 -0
  103. package/dist/assets/{invite-zC3nU84H.js → invite-Cd5zEHFb.js} +1 -1
  104. package/dist/assets/{issue-passport-B_pYDft0.js → issue-passport-D7zqv3Al.js} +1 -1
  105. package/dist/assets/{item-DoUn7xhc.js → item-DNj7ORqk.js} +1 -1
  106. package/dist/assets/{ja-DMq-YXDX.js → ja-DZPUwZ9l.js} +1 -1
  107. package/dist/assets/{ko-BrYbXurh.js → ko-q4i4r9g6.js} +1 -1
  108. package/dist/assets/{landing-page-BJAji-kI.js → landing-page-JLA-ZD1t.js} +1 -1
  109. package/dist/assets/{launch-result-message-B2nhmkKt.js → launch-result-message-DJqF-slD.js} +1 -1
  110. package/dist/assets/{layout-CydCBGqn.js → layout-Cwvm7lmD.js} +1 -1
  111. package/dist/assets/{list-BIwaCPhs.js → list-3MUy-8Ol.js} +2 -2
  112. package/dist/assets/{list-CO8Xp7iX.js → list-BSXHuqLM.js} +1 -1
  113. package/dist/assets/{list-header-DQZTNnUc.js → list-header-BEZSwSji.js} +1 -1
  114. package/dist/assets/localization-Dond4H78.js +1 -0
  115. package/dist/assets/{log-JZXyzrRA.js → log-Bq445Z1e.js} +1 -1
  116. package/dist/assets/logger-CCAAJ2Xo.js +1 -0
  117. package/dist/assets/{login-CU5Tw5QB.js → login-dc2t9Qyo.js} +1 -1
  118. package/dist/assets/{login-method-item-KhJ672kA.js → login-method-item-CyTsqz88.js} +1 -1
  119. package/dist/assets/{login-oauth-callback-Bz7N73Sg.js → login-oauth-callback-Bext19kc.js} +1 -1
  120. package/dist/assets/{logo-uploader-DjKJkvts.js → logo-uploader-CyZuvhwV.js} +1 -1
  121. package/dist/assets/{lost-passport-CyJVtH1V.js → lost-passport-BiYg3QQI.js} +1 -1
  122. package/dist/assets/{metadata-CkzdOpl3.js → metadata-B2-Ltdko.js} +1 -1
  123. package/dist/assets/{nav-menu-5M0Q4jYU.js → nav-menu-DSdXRbfg.js} +1 -1
  124. package/dist/assets/{open-window-DphH3aTv.js → open-window-Dyu79ome.js} +1 -1
  125. package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +1 -0
  126. package/dist/assets/{overview-CGIG2I_w.js → overview-0TBmi-_i.js} +1 -1
  127. package/dist/assets/{page-header-B0HpJClf.js → page-header-qdK3sAJh.js} +1 -1
  128. package/dist/assets/{passport-DKYg_d4G.js → passport-BhEaZ-sr.js} +1 -1
  129. package/dist/assets/{passport-item-CjcqN_g-.js → passport-item-DHwif94N.js} +1 -1
  130. package/dist/assets/{permission-DhyiLNfC.js → permission-CvrrGfG6.js} +1 -1
  131. package/dist/assets/preferences-BBSWzZiT.js +1 -0
  132. package/dist/assets/profile-embed-shcOdRUI.js +1 -0
  133. package/dist/assets/{provider-icon-DX-QfJQN.js → provider-icon-DO2PqSth.js} +1 -1
  134. package/dist/assets/{pt-Dl6732JN.js → pt-BFCHl6F1.js} +1 -1
  135. package/dist/assets/{publish-resource-vCC9AfJK.js → publish-resource-CMuHIOUf.js} +1 -1
  136. package/dist/assets/{react-beautiful-dnd.esm-bkXlrjYw.js → react-beautiful-dnd.esm-CWJ5I9Zv.js} +1 -1
  137. package/dist/assets/{react-stripe.esm-BBCEegrE.js → react-stripe.esm-B-FTN8ep.js} +1 -1
  138. package/dist/assets/{required-11pmtzQr.js → required-DnQpCGsD.js} +1 -1
  139. package/dist/assets/{ru-CVUeN9AX.js → ru-CSTl62kK.js} +1 -1
  140. package/dist/assets/{runtime-BjKYEBG_.js → runtime-B_ZLP4FF.js} +1 -1
  141. package/dist/assets/sdk-CktKu_IW.js +1 -0
  142. package/dist/assets/{section-ewv0pNWr.js → section-CZylgxjz.js} +1 -1
  143. package/dist/assets/{security-Xrnc8Gqe.js → security-DHRU8k0u.js} +1 -1
  144. package/dist/assets/{session-lE2gmzzF.js → session-Bp3LV7zJ.js} +1 -1
  145. package/dist/assets/{setup-p5LUFpYK.js → setup-B6-Ei_3X.js} +1 -1
  146. package/dist/assets/{shorten-label-1iJcvGQT.js → shorten-label-CuBHsWUR.js} +1 -1
  147. package/dist/assets/{simple-select-BKXEgxog.js → simple-select-nI-W90c_.js} +1 -1
  148. package/dist/assets/{spaces-Ckljlc4d.js → spaces-ix8u0ZiI.js} +1 -1
  149. package/dist/assets/{start-BE-C9MhV.js → start-oRp78RMQ.js} +1 -1
  150. package/dist/assets/{starting-progress-DC-J-5Os.js → starting-progress-CWp5fTY0.js} +1 -1
  151. package/dist/assets/{status-DR5t3VVx.js → status-Dn_LKaNp.js} +1 -1
  152. package/dist/assets/{step-actions-CArEuzNw.js → step-actions-DIZRcnXf.js} +1 -1
  153. package/dist/assets/{studio-BEzAGvQT.js → studio-CVIa8-XY.js} +1 -1
  154. package/dist/assets/{switch-CmVFEdik.js → switch-BbyTGEOo.js} +1 -1
  155. package/dist/assets/{switch-control-DbLHF-NB.js → switch-control-BRjXGc1d.js} +1 -1
  156. package/dist/assets/{table-tips-DQIh1EQR.js → table-tips-Dvmdodc5.js} +1 -1
  157. package/dist/assets/{team-7-48iuwj.js → team-BTz28XqK.js} +1 -1
  158. package/dist/assets/{th-32eBNQes.js → th-D75Dlluo.js} +1 -1
  159. package/dist/assets/theme-mode-toggle-D3bcd10D.js +1 -0
  160. package/dist/assets/{traffic-Dwd2RNqG.js → traffic-Cea69sMW.js} +1 -1
  161. package/dist/assets/{transfer-BwnSX6wY.js → transfer-BydXCVCg.js} +1 -1
  162. package/dist/assets/unsubscribe-BjAjx-Fl.js +1 -0
  163. package/dist/assets/{use-app-logo-BzsLZwwK.js → use-app-logo-IRizt64R.js} +1 -1
  164. package/dist/assets/{use-blocklet-logo-BWPJOOVd.js → use-blocklet-logo-Cf1j7pQz.js} +1 -1
  165. package/dist/assets/{use-mobile-DgmmfWdl.js → use-mobile-CyUZDIaX.js} +1 -1
  166. package/dist/assets/{use-mobile-BSL5RsRd.js → use-mobile-DFkQ5N0b.js} +1 -1
  167. package/dist/assets/{use-mobile-TAIHvgoJ.js → use-mobile-DwGMuJlg.js} +1 -1
  168. package/dist/assets/{use-server-logo-BLcfNvrR.js → use-server-logo-KZn9RrZd.js} +1 -1
  169. package/dist/assets/{use-window-close-D2_118dJ.js → use-window-close-Dpj5UcYT.js} +1 -1
  170. package/dist/assets/{useAsyncRetry-B-Txlvk6.js → useAsyncRetry-C4R9ufi-.js} +1 -1
  171. package/dist/assets/{useLocalStorage-D6axLnAi.js → useLocalStorage-BQfIniHX.js} +1 -1
  172. package/dist/assets/{user-center-DBscV1le.js → user-center-6K47tx8j.js} +5 -5
  173. package/dist/assets/{user-follower-Di51icra.js → user-follower-BwzTutxU.js} +1 -1
  174. package/dist/assets/{util-DCHBQZpP.js → util-DkTwHdRu.js} +1 -1
  175. package/dist/assets/{util-ad0rjUA1.js → util-DySzCymV.js} +1 -1
  176. package/dist/assets/{vendor-arcblock-ivFYo5vP.js → vendor-arcblock-Dll6qxMT.js} +1 -1
  177. package/dist/assets/{vendor-mui-core-D7t4vMS5.js → vendor-mui-core-CV-FnYH_.js} +1 -1
  178. package/dist/assets/{vendor-mui-x-BpPw6UfF.js → vendor-mui-x-DwN6dcQH.js} +1 -1
  179. package/dist/assets/{vendor-ux-Dl3wVbv_.js → vendor-ux-CLT2i3Pv.js} +2 -2
  180. package/dist/assets/{vi-DF8IinAc.js → vi-D1mKYrmb.js} +1 -1
  181. package/dist/assets/{wait-connect-DOIonmAv.js → wait-connect-q0_7mz_u.js} +1 -1
  182. package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +68 -0
  183. package/dist/assets/{wizard-CrkxQgBY.js → wizard-C5Kl-g70.js} +1 -1
  184. package/dist/assets/{wizard-components-BzPyRFRt.js → wizard-components-DQrlaeeW.js} +1 -1
  185. package/dist/assets/wrap-locale-5DJTJTXP.js +1 -0
  186. package/dist/assets/{zh-DQQBhbva.js → zh-CJ9vCpmv.js} +1 -1
  187. package/dist/assets/{zh-ByJkLAV1.js → zh-G2I44gfs.js} +1 -1
  188. package/dist/assets/{zh-tw-34G9tsUP.js → zh-tw-C4Juvs-i.js} +1 -1
  189. package/dist/index.html +1 -1
  190. package/package.json +31 -31
  191. package/dist/assets/branding-D-ShZ8m2.js +0 -1
  192. package/dist/assets/button-B_Qd9K_t.js +0 -1
  193. package/dist/assets/domains-B9b2gmbn.js +0 -1
  194. package/dist/assets/engine-L1SEogaX.js +0 -1
  195. package/dist/assets/get-safe-url-D4zRnTpF.js +0 -1
  196. package/dist/assets/index-BoJbHOhC.js +0 -1
  197. package/dist/assets/invitations-gJ3uAWGN.js +0 -3
  198. package/dist/assets/localization-BYdi6ljV.js +0 -1
  199. package/dist/assets/logger-BMHd-C1S.js +0 -1
  200. package/dist/assets/over-due-invoice-payment-DD_j5vb4.js +0 -1
  201. package/dist/assets/preferences-DHjRWgwZ.js +0 -1
  202. package/dist/assets/profile-embed-Gc79_Dhj.js +0 -1
  203. package/dist/assets/sdk-CXEy5Pgp.js +0 -1
  204. package/dist/assets/theme-mode-toggle-BltDSXhy.js +0 -1
  205. package/dist/assets/unsubscribe-CP0mTwWi.js +0 -1
  206. package/dist/assets/wallet-hidden-topbar-DKISAPb3.js +0 -68
  207. package/dist/assets/wrap-locale-BJF_SaOe.js +0 -1
@@ -1,7 +1,7 @@
1
- import{W as M,Q as q,Y as N,bE as Y,aP as Ce,aQ as Se,bC as Te}from"./vendor-ux-Dl3wVbv_.js";import{v as Ie,r as ae,q as Re}from"./vendor-hooks-DAZ1H6Va.js";import{r as v,a as ce}from"./vendor-react-DX7tU9aY.js";import{G as We,L as de,j as e,Z as ze,b1 as De,a0 as Ae,al as d,A as ne,T as C,a7 as _,b4 as te,S as Oe,R as F,bK as ie,an as $,b6 as U,a6 as Q,W as G,U as Z,aY as Pe,V as L,I as B,bQ as $e,bR as qe,a8 as Le,F as Me,X as t,b3 as W,a4 as pe,a_ as ee,dQ as Be,aM as Fe,aN as Ne,dR as He,dS as _e,dT as Ue,s as oe,aV as Ve,ak as Ke,cu as Ye,ct as Qe,c3 as Je}from"./vendor-mui-core-D7t4vMS5.js";import{W as V,c as ue,M as Xe,V as Ge,c4 as J,aI as xe,aJ as he,aK as me}from"./index-Ca33rdd_.js";import{S as Ze}from"./switch-CmVFEdik.js";import{b as K}from"./team-7-48iuwj.js";import{u as et}from"./use-mobile-BSL5RsRd.js";import{u as tt,C as X}from"./index.esm-C4tuRtuv.js";import{z as ge,a as be,F as ot}from"./vendor-utils-BzQg432x.js";import{C as st}from"./confirm-DQYDHHdS.js";import{A as nt}from"./actions-Dktj9pEF.js";import{T as re}from"./table-tips-DQIh1EQR.js";import"./vendor-arcblock-ivFYo5vP.js";import"./session-lE2gmzzF.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-DKISAPb3.js";import"./theme-mode-toggle-BltDSXhy.js";import"./use-mobile-DgmmfWdl.js";import"./index-sb6EjUcD.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-BWPJOOVd.js";import"./use-app-logo-BzsLZwwK.js";import"./index-DBs9Ljax.js";const it=n=>{const[p,c]=v.useState(null),[f,r]=v.useState(!0),[w,u]=v.useState(null),j=window.blocklet?.appUrl,a=v.useMemo(()=>{const g={};return p&&(p.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),p.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[p]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(ge(j,ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),u(null)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return v.useEffect(()=>{b()},[j]),{openEvent:p,setOpenEvent:c,eventsBySource:a,loading:f,error:w,loadData:b}};function fe({eventsBySource:n,selectedEvents:p,setSelectedEvents:c,error:f=null}){const{t:r}=M(),[w,u]=v.useState({}),j=v.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,{events:m}])=>{const k=m.filter(S=>p[`${S.type}-${S.source}`]).length;s[l]=k}),s},[n,p]),a=v.useMemo(()=>Object.values(j).reduce((s,l)=>s+l,0),[j]),b=v.useMemo(()=>Object.values(n).reduce((s,{events:l})=>s+l.length,0),[n]),g=(s,l)=>{l.stopPropagation(),u({...w,[s]:!w[s]})},y=s=>{const l=`${s.type}-${s.source}`;c(m=>({...m,[l]:!m[l]}))},z=(s,l)=>{const m={};s.forEach(k=>{const S=`${k.type}-${k.source}`;m[S]=!l}),c(k=>({...k,...m}))},I=s=>{const l={};Object.values(n).forEach(({events:m})=>{m.forEach(k=>{const S=`${k.type}-${k.source}`;l[S]=s.target.checked})}),c(l)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ie,{control:e.jsx(Q,{onChange:I,checked:a>0&&a===b}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx($,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(U,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(d,{className:"webhook-event-selector",sx:{maxHeight:"50vh",overflowY:"auto",overflowX:"hidden"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:.5},children:Object.entries(n).map(([s,{source:l,events:m,count:k}],S)=>{const D=j[s]>0,R=j[s]===m.length&&m.length>0,A=w[s];return e.jsxs(ce.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:i})=>S<Object.keys(n).length-1?`1px solid ${i.divider}`:"none",px:0,py:1,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:i=>{i.target.closest(".MuiFormControlLabel-root")||g(s,i)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ie,{control:e.jsx(Q,{checked:R,indeterminate:D&&!R,onChange:i=>{i.stopPropagation(),z(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.logo&&e.jsx(Pe,{src:l.logo,sx:{width:24,height:24}}),e.jsx(d,{children:l.title||s}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[s]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:i=>`${i.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:k})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:A?e.jsx($e,{}):e.jsx(qe,{})})]})]})}),m.length>0&&e.jsx(Le,{in:A,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{p:0,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(i=>{const h=`${i.type}-${i.source}`,o=!!p[h];return e.jsx(Z,{dense:!0,sx:{py:.75,px:1},onClick:()=>y(i),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Q,{checked:o,sx:{flexShrink:0}}),e.jsxs(d,{sx:{flex:1,minWidth:0},children:[e.jsx(C,{variant:"body1",className:"webhook-event-type",sx:{cursor:"pointer",color:"text.primary",wordBreak:"break-word",overflowWrap:"break-word"},children:i.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer",wordBreak:"break-word",overflowWrap:"break-word"},children:i.description})]})]})},h)})})})]},s)})})}),f&&e.jsx(Me,{error:!0,sx:{mt:1},children:f})]})}fe.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function je({id:n=null,url:p="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:u}=M(),[j,a]=v.useState({}),{teamDid:b}=K(),{api:g}=V(),{loading:y,error:z,eventsBySource:I}=it(),s=We(),{control:l,handleSubmit:m,formState:{errors:k},reset:S,setValue:D,trigger:R}=tt({defaultValues:{url:"",description:""}}),A=de(s.breakpoints.down("md"));v.useEffect(()=>{const o=Object.values(j).some(x=>x);D("selectedEvents",o?"valid":""),R("selectedEvents")},[j,D,R]);const i=()=>{a({}),S(),w()},h=async o=>{const x=Object.keys(j).filter(T=>j[T]),E={url:o.url,description:o.description,enabledEvents:x.map(T=>{const[O,se]=T.split("-");return!O||!se?null:{type:O,source:se}}).filter(Boolean)};try{if(n){const T=await g.updateWebhookEndpoint({input:{teamDid:b,id:n,data:E}});q.success(`${u("webhookEndpoint.updateWebhook")} ${u("webhookEndpoint.success")}`),r(T)}else{const T=await g.createWebhookEndpoint({input:{teamDid:b,input:E}});q.success(`${u("webhookEndpoint.createWebhook")} ${u("webhookEndpoint.success")}`),r(T)}}catch(T){q.error(T?.message)}i()};return v.useEffect(()=>{S({url:p,description:c}),a(f.reduce((o,x)=>(o[`${x.type}-${x.source}`]=!0,o),{}))},[S,a,p,c,f]),e.jsx(ze,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,fullScreen:A,children:e.jsxs("form",{onSubmit:m(h),children:[e.jsx(De,{children:u(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ae,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:l,rules:{required:u("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:u("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.url.label"),fullWidth:!0,error:!!k.url,helperText:k.url?.message})}),e.jsx(X,{name:"description",control:l,rules:{required:u("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!k.description,helperText:k.description?.message})}),e.jsx(X,{name:"selectedEvents",control:l,rules:{required:u("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&I&&Object.keys(I).length>0&&e.jsx(fe,{eventsBySource:I,selectedEvents:j,setSelectedEvents:a,error:k.selectedEvents?.message}),!y&&(!I||Object.keys(I).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:u("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(_,{size:20})}),z&&e.jsx(te,{severity:"error",children:u("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(Oe,{sx:{p:"8px 24px 24px"},children:[e.jsx(F,{onClick:i,children:u("common.cancel")}),e.jsx(F,{type:"submit",variant:"contained",color:"primary",children:u(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}je.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function rt(n){return n==="enabled"?"success":"default"}const lt=(n="en")=>n==="tw"?"zh":n;function H(n,p="YYYY-MM-DD HH:mm:ss",c="en"){return n?Xe(n).locale(lt(c)).format(p):"-"}function at(n){return typeof n=="number"?!1:be(n)}function ct(n){return n>=200&&n<300}function P({value:n,label:p,tip:c="",divider:f=!1}){const r=at(n);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[p,!!c&&e.jsx($,{title:c,children:e.jsx(U,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":n})]}),f&&e.jsx(pe,{orientation:"vertical",flexItem:!0})]})}P.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function ye({title:n,children:p=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(W,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n}),p]})}ye.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},pt=n=>{const p={};return n.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();p[f]||(p[f]=[]),p[f]?.push(c)}),p};function we({eventId:n="",webhookEndpointId:p="",event:c=null}){const{api:f,ws:{useSubscription:r}}=V(),{t:w}=M(),{teamDid:u}=K(),{blocklet:j}=Ge(),{data:a,loadMore:b,loadingMore:g,loading:y,mutate:z}=Ie(o=>{const E=o?Math.ceil(o.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:u,input:{eventId:n,webhookId:p},paging:{page:E,pageSize:15}}})},{reloadDeps:[n,p]}),I=a?.list||[],[s,l]=v.useState(null),[m,k]=v.useState(!1),S=pt(I);if(v.useEffect(()=>{!s&&a?.list.length&&l(a.list[0])},[a?.list.length,s]),r(ue.EVENTS.WEBHOOK_ATTEMPT,o=>{z(x=>{if(x.list.find(T=>T.id===o.id)){const T=x.list.map(O=>O.id===o.id?{...O,...o}:O);return{...x,list:T}}return o.endpoint=x.list[0]?.endpoint,o.event=x.list[0]?.event,{...x,list:[o,...x.list]}})},[]),y)return e.jsx(_,{});const D=a&&a.list.length<a.paging.total,R=async()=>{s&&(k(!0),await f.retryWebhookAttempt({input:{teamDid:u,eventId:s.event.id,webhookId:p,attemptId:s.id}}).finally(()=>{setTimeout(()=>{k(!1)},1e3)}))},A=o=>{if(o.responseBody&&o.responseBody?.sessionId&&o.responseBody?.projectId&&o.responseBody?.agentId){const x=j?.site?.domainAliases[0]?.value,E=(j.children||[]).find(O=>O?.meta?.name==="ai-studio"),T=ot(ge(`https://${x}`,E?.mountPoint||"","projects",o.responseBody.projectId,"logs/main"),{sessionId:o.responseBody.sessionId,agentId:o.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(T,"_blank"),children:e.jsx(d,{component:N,icon:J})})}return null},i=o=>o.status==="pending"?e.jsx(He,{color:"warning"}):ct(o.responseStatus)?e.jsx(_e,{color:"success"}):e.jsx(Ue,{color:"error"}),h=s?.triggeredFrom&&(a?.list||[]).find(o=>o.id===s.triggeredFrom);return e.jsxs(ut,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:be(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([o,x])=>e.jsxs(ce.Fragment,{children:[e.jsx(Be,{sx:{p:0},children:o}),x.map(E=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>l(E),selected:s&&s?.id===E?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:H(E.createdAt,"HH:mm:ss")}),children:[e.jsx(Fe,{sx:{minWidth:0,mr:1.5},children:i(E)}),e.jsx(Ne,{primary:e.jsx(C,{sx:{color:"text.primary"},children:E.event.type})})]},E.id))]},o))}),D&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(F,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:o=>o.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[s&&e.jsxs(W,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${s.status}`)}),e.jsx(d,{children:A(s)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[h&&e.jsx($,{placement:"left",title:e.jsxs(W,{onClick:()=>l(h),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(xe,{showDid:!0,did:s.triggeredBy,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(pe,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:s.id}),e.jsx(B,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:J,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:J,sx:{fontSize:16}})})}),e.jsxs(F,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:N,icon:dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",s.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(s.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(s.event,null,2)})]})]}),a?.list.length===0&&c&&e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}we.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const ut=oe(ee)`
1
+ import{W as M,Q as q,Y as N,bG as Y,aQ as Ce,aR as Se,bE as Te}from"./vendor-ux-CLT2i3Pv.js";import{v as Ie,r as ae,q as Re}from"./vendor-hooks-DAZ1H6Va.js";import{r as v,a as ce}from"./vendor-react-DX7tU9aY.js";import{G as We,L as de,j as e,Z as ze,b1 as De,a0 as Ae,al as d,A as ne,T as C,a7 as _,b4 as te,S as Oe,R as F,bK as ie,an as P,b6 as U,a6 as Q,W as X,U as Z,aY as $e,V as L,I as B,bQ as Pe,bR as qe,a8 as Le,F as Me,X as t,b3 as W,a4 as pe,a_ as ee,dQ as Be,aM as Fe,aN as Ne,dR as He,dS as _e,dT as Ue,s as oe,aV as Ve,ak as Ke,cu as Ye,cr as Qe,ct as Je}from"./vendor-mui-core-CV-FnYH_.js";import{W as V,c as ue,M as Ge,V as Xe,c4 as J,aI as xe,aJ as he,aK as me}from"./index-CXp5SI_f.js";import{S as Ze}from"./switch-BbyTGEOo.js";import{b as K}from"./team-BTz28XqK.js";import{u as et}from"./use-mobile-DwGMuJlg.js";import{u as tt,C as G}from"./index.esm-C4tuRtuv.js";import{z as ge,a as be,F as ot}from"./vendor-utils-BzQg432x.js";import{C as st}from"./confirm-CdVn5WdC.js";import{A as nt}from"./actions-DydkTgA0.js";import{T as re}from"./table-tips-Dvmdodc5.js";import"./vendor-arcblock-Dll6qxMT.js";import"./session-Bp3LV7zJ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./index-CEJb82tA.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";import"./index-DBs9Ljax.js";const it=n=>{const[p,c]=v.useState(null),[f,r]=v.useState(!0),[w,u]=v.useState(null),j=window.blocklet?.appUrl,a=v.useMemo(()=>{const g={};return p&&(p.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),p.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[p]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(ge(j,ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),u(null)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return v.useEffect(()=>{b()},[j]),{openEvent:p,setOpenEvent:c,eventsBySource:a,loading:f,error:w,loadData:b}};function fe({eventsBySource:n,selectedEvents:p,setSelectedEvents:c,error:f=null}){const{t:r}=M(),[w,u]=v.useState({}),j=v.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,{events:m}])=>{const k=m.filter(S=>p[`${S.type}-${S.source}`]).length;s[l]=k}),s},[n,p]),a=v.useMemo(()=>Object.values(j).reduce((s,l)=>s+l,0),[j]),b=v.useMemo(()=>Object.values(n).reduce((s,{events:l})=>s+l.length,0),[n]),g=(s,l)=>{l.stopPropagation(),u({...w,[s]:!w[s]})},y=s=>{const l=`${s.type}-${s.source}`;c(m=>({...m,[l]:!m[l]}))},z=(s,l)=>{const m={};s.forEach(k=>{const S=`${k.type}-${k.source}`;m[S]=!l}),c(k=>({...k,...m}))},I=s=>{const l={};Object.values(n).forEach(({events:m})=>{m.forEach(k=>{const S=`${k.type}-${k.source}`;l[S]=s.target.checked})}),c(l)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ie,{control:e.jsx(Q,{onChange:I,checked:a>0&&a===b}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(U,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(d,{className:"webhook-event-selector",sx:{maxHeight:"50vh",overflowY:"auto",overflowX:"hidden"},children:e.jsx(X,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:.5},children:Object.entries(n).map(([s,{source:l,events:m,count:k}],S)=>{const D=j[s]>0,R=j[s]===m.length&&m.length>0,A=w[s];return e.jsxs(ce.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:i})=>S<Object.keys(n).length-1?`1px solid ${i.divider}`:"none",px:0,py:1,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:i=>{i.target.closest(".MuiFormControlLabel-root")||g(s,i)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ie,{control:e.jsx(Q,{checked:R,indeterminate:D&&!R,onChange:i=>{i.stopPropagation(),z(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.logo&&e.jsx($e,{src:l.logo,sx:{width:24,height:24}}),e.jsx(d,{children:l.title||s}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[s]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:i=>`${i.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:k})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:A?e.jsx(Pe,{}):e.jsx(qe,{})})]})]})}),m.length>0&&e.jsx(Le,{in:A,timeout:"auto",unmountOnExit:!0,children:e.jsx(X,{disablePadding:!0,sx:{p:0,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(i=>{const h=`${i.type}-${i.source}`,o=!!p[h];return e.jsx(Z,{dense:!0,sx:{py:.75,px:1},onClick:()=>y(i),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Q,{checked:o,sx:{flexShrink:0}}),e.jsxs(d,{sx:{flex:1,minWidth:0},children:[e.jsx(C,{variant:"body1",className:"webhook-event-type",sx:{cursor:"pointer",color:"text.primary",wordBreak:"break-word",overflowWrap:"break-word"},children:i.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer",wordBreak:"break-word",overflowWrap:"break-word"},children:i.description})]})]})},h)})})})]},s)})})}),f&&e.jsx(Me,{error:!0,sx:{mt:1},children:f})]})}fe.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function je({id:n=null,url:p="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:u}=M(),[j,a]=v.useState({}),{teamDid:b}=K(),{api:g}=V(),{loading:y,error:z,eventsBySource:I}=it(),s=We(),{control:l,handleSubmit:m,formState:{errors:k},reset:S,setValue:D,trigger:R}=tt({defaultValues:{url:"",description:""}}),A=de(s.breakpoints.down("md"));v.useEffect(()=>{const o=Object.values(j).some(x=>x);D("selectedEvents",o?"valid":""),R("selectedEvents")},[j,D,R]);const i=()=>{a({}),S(),w()},h=async o=>{const x=Object.keys(j).filter(T=>j[T]),E={url:o.url,description:o.description,enabledEvents:x.map(T=>{const[O,se]=T.split("-");return!O||!se?null:{type:O,source:se}}).filter(Boolean)};try{if(n){const T=await g.updateWebhookEndpoint({input:{teamDid:b,id:n,data:E}});q.success(`${u("webhookEndpoint.updateWebhook")} ${u("webhookEndpoint.success")}`),r(T)}else{const T=await g.createWebhookEndpoint({input:{teamDid:b,input:E}});q.success(`${u("webhookEndpoint.createWebhook")} ${u("webhookEndpoint.success")}`),r(T)}}catch(T){q.error(T?.message)}i()};return v.useEffect(()=>{S({url:p,description:c}),a(f.reduce((o,x)=>(o[`${x.type}-${x.source}`]=!0,o),{}))},[S,a,p,c,f]),e.jsx(ze,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,fullScreen:A,children:e.jsxs("form",{onSubmit:m(h),children:[e.jsx(De,{children:u(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Ae,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(G,{name:"url",control:l,rules:{required:u("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:u("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.url.label"),fullWidth:!0,error:!!k.url,helperText:k.url?.message})}),e.jsx(G,{name:"description",control:l,rules:{required:u("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!k.description,helperText:k.description?.message})}),e.jsx(G,{name:"selectedEvents",control:l,rules:{required:u("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&I&&Object.keys(I).length>0&&e.jsx(fe,{eventsBySource:I,selectedEvents:j,setSelectedEvents:a,error:k.selectedEvents?.message}),!y&&(!I||Object.keys(I).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:u("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(_,{size:20})}),z&&e.jsx(te,{severity:"error",children:u("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(Oe,{sx:{p:"8px 24px 24px"},children:[e.jsx(F,{onClick:i,children:u("common.cancel")}),e.jsx(F,{type:"submit",variant:"contained",color:"primary",children:u(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}je.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function rt(n){return n==="enabled"?"success":"default"}const lt=(n="en")=>n==="tw"?"zh":n;function H(n,p="YYYY-MM-DD HH:mm:ss",c="en"){return n?Ge(n).locale(lt(c)).format(p):"-"}function at(n){return typeof n=="number"?!1:be(n)}function ct(n){return n>=200&&n<300}function $({value:n,label:p,tip:c="",divider:f=!1}){const r=at(n);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[p,!!c&&e.jsx(P,{title:c,children:e.jsx(U,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":n})]}),f&&e.jsx(pe,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function ye({title:n,children:p=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(W,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n}),p]})}ye.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},pt=n=>{const p={};return n.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();p[f]||(p[f]=[]),p[f]?.push(c)}),p};function we({eventId:n="",webhookEndpointId:p="",event:c=null}){const{api:f,ws:{useSubscription:r}}=V(),{t:w}=M(),{teamDid:u}=K(),{blocklet:j}=Xe(),{data:a,loadMore:b,loadingMore:g,loading:y,mutate:z}=Ie(o=>{const E=o?Math.ceil(o.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:u,input:{eventId:n,webhookId:p},paging:{page:E,pageSize:15}}})},{reloadDeps:[n,p]}),I=a?.list||[],[s,l]=v.useState(null),[m,k]=v.useState(!1),S=pt(I);if(v.useEffect(()=>{!s&&a?.list.length&&l(a.list[0])},[a?.list.length,s]),r(ue.EVENTS.WEBHOOK_ATTEMPT,o=>{z(x=>{if(x.list.find(T=>T.id===o.id)){const T=x.list.map(O=>O.id===o.id?{...O,...o}:O);return{...x,list:T}}return o.endpoint=x.list[0]?.endpoint,o.event=x.list[0]?.event,{...x,list:[o,...x.list]}})},[]),y)return e.jsx(_,{});const D=a&&a.list.length<a.paging.total,R=async()=>{s&&(k(!0),await f.retryWebhookAttempt({input:{teamDid:u,eventId:s.event.id,webhookId:p,attemptId:s.id}}).finally(()=>{setTimeout(()=>{k(!1)},1e3)}))},A=o=>{if(o.responseBody&&o.responseBody?.sessionId&&o.responseBody?.projectId&&o.responseBody?.agentId){const x=j?.site?.domainAliases[0]?.value,E=(j.children||[]).find(O=>O?.meta?.name==="ai-studio"),T=ot(ge(`https://${x}`,E?.mountPoint||"","projects",o.responseBody.projectId,"logs/main"),{sessionId:o.responseBody.sessionId,agentId:o.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(T,"_blank"),children:e.jsx(d,{component:N,icon:J})})}return null},i=o=>o.status==="pending"?e.jsx(He,{color:"warning"}):ct(o.responseStatus)?e.jsx(_e,{color:"success"}):e.jsx(Ue,{color:"error"}),h=s?.triggeredFrom&&(a?.list||[]).find(o=>o.id===s.triggeredFrom);return e.jsxs(ut,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:be(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(X,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([o,x])=>e.jsxs(ce.Fragment,{children:[e.jsx(Be,{sx:{p:0},children:o}),x.map(E=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>l(E),selected:s&&s?.id===E?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:H(E.createdAt,"HH:mm:ss")}),children:[e.jsx(Fe,{sx:{minWidth:0,mr:1.5},children:i(E)}),e.jsx(Ne,{primary:e.jsx(C,{sx:{color:"text.primary"},children:E.event.type})})]},E.id))]},o))}),D&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(F,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:o=>o.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[s&&e.jsxs(W,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${s.status}`)}),e.jsx(d,{children:A(s)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[h&&e.jsx(P,{placement:"left",title:e.jsxs(W,{onClick:()=>l(h),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(xe,{showDid:!0,did:s.triggeredBy,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(pe,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:s.id}),e.jsx(B,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:J,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:J,sx:{fontSize:16}})})}),e.jsxs(F,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:N,icon:dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",s.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(s.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(s.event,null,2)})]})]}),a?.list.length===0&&c&&e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}we.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const ut=oe(ee)`
2
2
  @keyframes spin {
3
3
  to {
4
4
  transform: rotate(360deg);
5
5
  }
6
6
  }
7
- `;function ke({id:n,onClose:p}){const{t:c}=M(),{api:f}=V(),{teamDid:r}=K(),{loading:w,error:u,data:j}=ae(()=>f.getWebhookEndpoint({input:{teamDid:r,id:n}})),a=j?.data;return u?e.jsx(te,{severity:"error",children:u.message}):w||!a?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(_,{})}):e.jsxs(xt,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(d,{children:[e.jsxs(W,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(W,{sx:{flex:1,width:0},children:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx($,{title:a.url,children:e.jsx(U,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(W,{direction:"row",sx:{alignItems:"center"},children:e.jsx(B,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ke,{})})})]}),e.jsx(d,{sx:{mt:2},children:e.jsxs(W,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(P,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:a.status,color:rt(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.listen"),value:e.jsx($,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx(P,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx(P,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx(P,{label:c("common.createdBy"),value:e.jsx($,{arrow:!0,title:a.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(P,{label:c("common.updatedBy"),value:e.jsx($,{arrow:!0,title:a.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(W,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(ye,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(W,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(we,{webhookEndpointId:a.id})})]})]})}ke.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const xt=oe(W)``;function Ee({open:n,onClose:p,id:c}){return e.jsx(Ve,{anchor:"right",open:n,onClose:p,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(d,{sx:{height:"100vh",p:3},children:e.jsx(ke,{id:c,onClose:p})})})}Ee.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function le(){return null}function ve({options:n={},columns:p=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:u="",durableKeys:j=[],data:a=[],loading:b=!1,...g}){const{locale:y}=M(),z=de(l=>l.breakpoints.down("md")),I={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},s={};return c||(s.TableToolbar=le),f||(s.TableFooter=le),e.jsx(ht,{locale:y,options:{...I,...n},columns:(p||[]).map(l=>(l.options=l.options||{},l.options.filter=l.options.filter||!1,l.options.sort=l.options.sort||!1,l)),emptyNode:e.jsx(Ce,{children:w}),...g,durable:u,durableKeys:j,data:a,loading:b,components:s,hasRowLink:r,isMobile:z})}ve.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const ht=oe(Se)``,mt=v.memo(ve);function Ft(){const{teamDid:n}=K(),p=et(),c=`webhook-endpoints-${n}`,f=Te(c),{t:r,locale:w}=M(),{api:u}=V(),[j,a]=v.useState(""),[b,g]=v.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Re(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:I,error:s,data:l,refresh:m}=ae(()=>u.getWebhookEndpoints({input:{teamDid:n,paging:{page:y.page,pageSize:y.pageSize}}}));v.useEffect(()=>{m()},[y,m]);const k=v.useCallback(async(i,h)=>{try{await u.updateWebhookEndpoint({input:{teamDid:n,id:i.id,data:{status:h?"disabled":"enabled"}}}),m(),q.success(`${r(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(o){q.error(o?.message)}},[u,n,m,r]),S=v.useCallback(async i=>{try{await u.deleteWebhookEndpoint({input:{teamDid:n,id:i}}),m(),g(h=>({...h,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(h){q.error(h?.message)}},[u,n,m,r]),D=(i,h)=>{let o=i.page+1;const x=i.searchText||"";if(x!==j){a(x);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(o=1);const E={page:o,pageSize:i.rowsPerPage};a(""),z(E)}};if(s)return e.jsx(te,{severity:"error",children:s.message});const R=(l?.list||[]).filter(i=>{if(!j)return!0;const h=j.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),A=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:o.description}),e.jsx(d,{sx:{display:"flex"},onClick:x=>{x.stopPropagation()},children:e.jsx($,{title:o.url,children:e.jsx(U,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(d,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:o.enabledEvents.map(x=>e.jsx(L,{size:"small",variant:"filled",label:x.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${o.source}-${x.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const o=R[h],x=o?.status==="enabled";return e.jsx(d,{onClick:E=>E.stopPropagation(),children:e.jsx(Ze,{checked:x,onChange:()=>k(o,x)},`status-${o.status}`)})}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:i=>i?e.jsx(xe,{showDid:!0,did:i?.did,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(nt,{actions:[{icon:e.jsx(Ye,{}),text:r("common.edit"),onClick:x=>{x.stopPropagation(),g(E=>({...E,createEdit:{open:!0,id:o.id,url:o.url,description:o.description,enabledEvents:o.enabledEvents}}))}},{icon:e.jsx(Qe,{}),text:r("common.delete"),onClick:x=>{x.stopPropagation(),g(E=>({...E,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(o.id),onCancel:()=>g(T=>({...T,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(d,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(mt,{durable:c,durableKeys:["page","rowsPerPage"],data:R,columns:A,options:{count:l?.count||0,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(i,{dataIndex:h})=>{const o=l.list[h];g(x=>({...x,webhookDetail:{open:!0,id:o.id}}))}},loading:I||!l,onChange:D,emptyNodeText:e.jsx(W,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary",onClick:()=>g(i=>({...i,createEdit:{...i.createEdit,open:!0}})),className:"rule-action",children:[I?e.jsx(_,{size:16}):e.jsx(Je,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(Ee,{open:!0,onClose:()=>g(i=>({...i,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(je,{onSubmit:m,...b.createEdit,onClose:()=>g(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(st,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{Ft as default};
7
+ `;function ke({id:n,onClose:p}){const{t:c}=M(),{api:f}=V(),{teamDid:r}=K(),{loading:w,error:u,data:j}=ae(()=>f.getWebhookEndpoint({input:{teamDid:r,id:n}})),a=j?.data;return u?e.jsx(te,{severity:"error",children:u.message}):w||!a?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(_,{})}):e.jsxs(xt,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(d,{children:[e.jsxs(W,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(W,{sx:{flex:1,width:0},children:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(P,{title:a.url,children:e.jsx(U,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(W,{direction:"row",sx:{alignItems:"center"},children:e.jsx(B,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ke,{})})})]}),e.jsx(d,{sx:{mt:2},children:e.jsxs(W,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:a.status,color:rt(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(P,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(P,{arrow:!0,title:a.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(P,{arrow:!0,title:a.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(W,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(ye,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(W,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(we,{webhookEndpointId:a.id})})]})]})}ke.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const xt=oe(W)``;function Ee({open:n,onClose:p,id:c}){return e.jsx(Ve,{anchor:"right",open:n,onClose:p,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(d,{sx:{height:"100vh",p:3},children:e.jsx(ke,{id:c,onClose:p})})})}Ee.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function le(){return null}function ve({options:n={},columns:p=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:u="",durableKeys:j=[],data:a=[],loading:b=!1,...g}){const{locale:y}=M(),z=de(l=>l.breakpoints.down("md")),I={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},s={};return c||(s.TableToolbar=le),f||(s.TableFooter=le),e.jsx(ht,{locale:y,options:{...I,...n},columns:(p||[]).map(l=>(l.options=l.options||{},l.options.filter=l.options.filter||!1,l.options.sort=l.options.sort||!1,l)),emptyNode:e.jsx(Ce,{children:w}),...g,durable:u,durableKeys:j,data:a,loading:b,components:s,hasRowLink:r,isMobile:z})}ve.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const ht=oe(Se)``,mt=v.memo(ve);function Ft(){const{teamDid:n}=K(),p=et(),c=`webhook-endpoints-${n}`,f=Te(c),{t:r,locale:w}=M(),{api:u}=V(),[j,a]=v.useState(""),[b,g]=v.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Re(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:I,error:s,data:l,refresh:m}=ae(()=>u.getWebhookEndpoints({input:{teamDid:n,paging:{page:y.page,pageSize:y.pageSize}}}));v.useEffect(()=>{m()},[y,m]);const k=v.useCallback(async(i,h)=>{try{await u.updateWebhookEndpoint({input:{teamDid:n,id:i.id,data:{status:h?"disabled":"enabled"}}}),m(),q.success(`${r(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(o){q.error(o?.message)}},[u,n,m,r]),S=v.useCallback(async i=>{try{await u.deleteWebhookEndpoint({input:{teamDid:n,id:i}}),m(),g(h=>({...h,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(h){q.error(h?.message)}},[u,n,m,r]),D=(i,h)=>{let o=i.page+1;const x=i.searchText||"";if(x!==j){a(x);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(o=1);const E={page:o,pageSize:i.rowsPerPage};a(""),z(E)}};if(s)return e.jsx(te,{severity:"error",children:s.message});const R=(l?.list||[]).filter(i=>{if(!j)return!0;const h=j.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),A=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:o.description}),e.jsx(d,{sx:{display:"flex"},onClick:x=>{x.stopPropagation()},children:e.jsx(P,{title:o.url,children:e.jsx(U,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(d,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:o.enabledEvents.map(x=>e.jsx(L,{size:"small",variant:"filled",label:x.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${o.source}-${x.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const o=R[h],x=o?.status==="enabled";return e.jsx(d,{onClick:E=>E.stopPropagation(),children:e.jsx(Ze,{checked:x,onChange:()=>k(o,x)},`status-${o.status}`)})}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:i=>i?e.jsx(xe,{showDid:!0,did:i?.did,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(nt,{actions:[{icon:e.jsx(Ye,{}),text:r("common.edit"),onClick:x=>{x.stopPropagation(),g(E=>({...E,createEdit:{open:!0,id:o.id,url:o.url,description:o.description,enabledEvents:o.enabledEvents}}))}},{icon:e.jsx(Qe,{}),text:r("common.delete"),onClick:x=>{x.stopPropagation(),g(E=>({...E,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(o.id),onCancel:()=>g(T=>({...T,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(d,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(mt,{durable:c,durableKeys:["page","rowsPerPage"],data:R,columns:A,options:{count:l?.count||0,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(i,{dataIndex:h})=>{const o=l.list[h];g(x=>({...x,webhookDetail:{open:!0,id:o.id}}))}},loading:I||!l,onChange:D,emptyNodeText:e.jsx(W,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary",onClick:()=>g(i=>({...i,createEdit:{...i.createEdit,open:!0}})),className:"rule-action",children:[I?e.jsx(_,{size:16}):e.jsx(Je,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(Ee,{open:!0,onClose:()=>g(i=>({...i,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(je,{onSubmit:m,...b.createEdit,onClose:()=>g(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(st,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{Ft as default};
@@ -1 +1 @@
1
- import{c as A,v as R,p as w,d as p}from"./index-DvQIPWQ6.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
1
+ import{c as A,v as R,p as w,d as p}from"./index-Cax1AxL9.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
@@ -1,4 +1,4 @@
1
- import{r as j,g as ge}from"./vendor-react-DX7tU9aY.js";import{j as o,T as I,A as $,y as ye,cr as ve,cs as Y,c6 as je,F as Ce,c1 as Te,b4 as Fe,a7 as V,X as C,bK as be,a6 as we,I as Z,aT as G,al as B,R as Se,c3 as Be,L as De,an as Re}from"./vendor-mui-core-D7t4vMS5.js";import{W as E,ap as ae,F as le,c as Ne}from"./index-Ca33rdd_.js";import{W as q,aO as ce,b4 as z,Q as L,b5 as ee,bD as Pe}from"./vendor-ux-Dl3wVbv_.js";import{e as ue}from"./edit.svg-BGhTyO6h.js";import{c as Ie}from"./lock.svg-BOhdQlHW.js";import{C as _e,ad as ze}from"./vendor-utils-BzQg432x.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-7-48iuwj.js";import{w as me,P as Ee}from"./permission-DhyiLNfC.js";import{C as qe}from"./confirm-DQYDHHdS.js";const Me=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188a.19.19 0 0 0 .188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"}));var W={exports:{}},H={exports:{}},te;function ke(){return te||(te=1,(function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};H.exports=m})()),H.exports}var O,re;function ne(){if(re)return O;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return O=u,O}var U,se;function Ae(){if(se)return U;se=1,U=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return U}var ie;function $e(){return ie||(ie=1,(function(){var u=ke(),m=ne().utf8,a=Ae(),c=ne().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,n=1732584193,t=-271733879,r=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,x=l._ii,i=0;i<s.length;i+=16){var F=n,D=t,R=r,w=e;n=v(n,t,r,e,s[i+0],7,-680876936),e=v(e,n,t,r,s[i+1],12,-389564586),r=v(r,e,n,t,s[i+2],17,606105819),t=v(t,r,e,n,s[i+3],22,-1044525330),n=v(n,t,r,e,s[i+4],7,-176418897),e=v(e,n,t,r,s[i+5],12,1200080426),r=v(r,e,n,t,s[i+6],17,-1473231341),t=v(t,r,e,n,s[i+7],22,-45705983),n=v(n,t,r,e,s[i+8],7,1770035416),e=v(e,n,t,r,s[i+9],12,-1958414417),r=v(r,e,n,t,s[i+10],17,-42063),t=v(t,r,e,n,s[i+11],22,-1990404162),n=v(n,t,r,e,s[i+12],7,1804603682),e=v(e,n,t,r,s[i+13],12,-40341101),r=v(r,e,n,t,s[i+14],17,-1502002290),t=v(t,r,e,n,s[i+15],22,1236535329),n=g(n,t,r,e,s[i+1],5,-165796510),e=g(e,n,t,r,s[i+6],9,-1069501632),r=g(r,e,n,t,s[i+11],14,643717713),t=g(t,r,e,n,s[i+0],20,-373897302),n=g(n,t,r,e,s[i+5],5,-701558691),e=g(e,n,t,r,s[i+10],9,38016083),r=g(r,e,n,t,s[i+15],14,-660478335),t=g(t,r,e,n,s[i+4],20,-405537848),n=g(n,t,r,e,s[i+9],5,568446438),e=g(e,n,t,r,s[i+14],9,-1019803690),r=g(r,e,n,t,s[i+3],14,-187363961),t=g(t,r,e,n,s[i+8],20,1163531501),n=g(n,t,r,e,s[i+13],5,-1444681467),e=g(e,n,t,r,s[i+2],9,-51403784),r=g(r,e,n,t,s[i+7],14,1735328473),t=g(t,r,e,n,s[i+12],20,-1926607734),n=y(n,t,r,e,s[i+5],4,-378558),e=y(e,n,t,r,s[i+8],11,-2022574463),r=y(r,e,n,t,s[i+11],16,1839030562),t=y(t,r,e,n,s[i+14],23,-35309556),n=y(n,t,r,e,s[i+1],4,-1530992060),e=y(e,n,t,r,s[i+4],11,1272893353),r=y(r,e,n,t,s[i+7],16,-155497632),t=y(t,r,e,n,s[i+10],23,-1094730640),n=y(n,t,r,e,s[i+13],4,681279174),e=y(e,n,t,r,s[i+0],11,-358537222),r=y(r,e,n,t,s[i+3],16,-722521979),t=y(t,r,e,n,s[i+6],23,76029189),n=y(n,t,r,e,s[i+9],4,-640364487),e=y(e,n,t,r,s[i+12],11,-421815835),r=y(r,e,n,t,s[i+15],16,530742520),t=y(t,r,e,n,s[i+2],23,-995338651),n=x(n,t,r,e,s[i+0],6,-198630844),e=x(e,n,t,r,s[i+7],10,1126891415),r=x(r,e,n,t,s[i+14],15,-1416354905),t=x(t,r,e,n,s[i+5],21,-57434055),n=x(n,t,r,e,s[i+12],6,1700485571),e=x(e,n,t,r,s[i+3],10,-1894986606),r=x(r,e,n,t,s[i+10],15,-1051523),t=x(t,r,e,n,s[i+1],21,-2054922799),n=x(n,t,r,e,s[i+8],6,1873313359),e=x(e,n,t,r,s[i+15],10,-30611744),r=x(r,e,n,t,s[i+6],15,-1560198380),t=x(t,r,e,n,s[i+13],21,1309151649),n=x(n,t,r,e,s[i+4],6,-145523070),e=x(e,n,t,r,s[i+11],10,-1120210379),r=x(r,e,n,t,s[i+2],15,718787259),t=x(t,r,e,n,s[i+9],21,-343485551),n=n+F>>>0,t=t+D>>>0,r=r+R>>>0,e=e+w>>>0}return u.endian([n,t,r,e])};l._ff=function(p,d,s,f,n,t,r){var e=p+(d&s|~d&f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,n,t,r){var e=p+(d&f|s&~f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,n,t,r){var e=p+(d^s^f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,n,t,r){var e=p+(s^(d|~f))+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,W.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}})()),W.exports}var Le=$e();const We=ge(Le);function Q({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=E(),[f,n]=j.useState(!1),[t,r]=j.useState(""),{t:e}=q(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[x,F]=j.useState(p?.extra?.display||"builtin"),[D,R]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const h=i.trim();if(!h){r(e("team.passport.error.titleEmpty"));return}if(h.length>64){r(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){r(e("team.passport.error.descriptionEmpty"));return}const _=l==="create"?We(d?`${d}-${h}`:h):p.name;r(null),n(!0);try{if(l==="create"){const S={teamDid:u,name:_,title:h,description:N,...d?{orgId:d}:{}};x==="custom"&&(S.extra=JSON.stringify({display:"custom",types:D.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:_,title:h,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const k=pe(S);r(k),c(S)}finally{n(!1)}},M=o.jsxs("div",{children:[l==="update"&&o.jsx(I,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(I,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:h=>{r(null),v(h.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(I,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:h=>{r(null),y(h.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:x,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(h,N)=>F(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(I,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(I,{children:e("team.passport.displayCustom")})})]}),x==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:D,disabled:f,onChange:h=>{R(h.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(z,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(z,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(V,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Te,{component:"div",children:M}),!!t&&o.jsx(Fe,{severity:"error",style:{width:"100%",margin:0},children:t})]})}Q.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=E(),{roles:f,permissions:n,teamDid:t,refresh:r,isNodeTeam:e}=de(),{t:i}=q(),[v,g]=j.useState([]),[y,x]=j.useState(!1),[F,D]=j.useState(null),[R,w]=j.useState(!1),M=j.useMemo(()=>l||f,[l,f]),h=_e(M.find(T=>T.name===c)),N=ae(c),_=async T=>{if(!R)try{w(!0),await s.deleteRole({input:{teamDid:t,name:T}}),a()}catch(b){L.error(b.message)}finally{w(!1),D(null)}},S=async(T,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:T,role:{name:b}}})).permissions||[],he=n.map(X=>({...X,bind:fe.some(xe=>xe.name===X.name)}));g(he)},k=async()=>{w(!0);const T=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:h.name,grantNames:T}}),L.success(i("common.saveSuccess")),m()}catch(b){L.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const A=e||!p;let K=null;return e&&(K=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(T=>A?T.bind:!0).map(T=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:A,checked:T.bind,onChange:()=>{g(b=>b.map(P=>(P.name===T.name&&(P.bind=!P.bind),P)))},name:T.name}),label:T.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(Z,{onClick:()=>x(h),"data-cy":`edit-passport-${h.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(Z,{onClick:()=>D({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:h.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{_(h.name)},onCancel:()=>{w(!1),D(null)}}),"data-cy":`delete-passport-${h.name}`,size:"large",children:o.jsx(Me,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!A&&o.jsxs(o.Fragment,{children:[o.jsx(z,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(z,{onClick:k,color:"primary",disabled:R||!h,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[R&&o.jsx(V,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ve,{children:[!h&&o.jsx(Ge,{children:o.jsx(V,{})}),h&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:h.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:h.description})]}),K]})]}),y&&o.jsx(Q,{teamDid:t,onCancel:()=>x(null),onSuccess:()=>{x(null),d?m():r()},mode:"update",roleName:y.name,item:y,orgId:d}),F&&o.jsx(qe,{title:F.title,description:F.description,confirm:F.confirm,cancel:F.cancel,params:F.params,onConfirm:F.onConfirm,onCancel:F.onCancel})]})}const He=me(J,"mutate_team"),Oe=me(J,"",le);function Ue(u){const{inService:m}=E();return m?o.jsx(Oe,{...u}):o.jsx(He,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ve=G.div`
1
+ import{r as j,g as ge}from"./vendor-react-DX7tU9aY.js";import{j as o,T as I,A as $,y as ye,cp as ve,cq as Y,c3 as je,F as Ce,cn as Fe,b4 as Te,a7 as V,X as C,bK as be,a6 as we,I as Z,aT as G,al as B,R as Se,ct as Be,L as Re,an as De}from"./vendor-mui-core-CV-FnYH_.js";import{W as z,ap as ae,F as le,c as Ne}from"./index-CXp5SI_f.js";import{W as E,aO as ce,b5 as q,Q as L,b6 as ee,bF as Pe}from"./vendor-ux-CLT2i3Pv.js";import{e as ue}from"./edit.svg-BGhTyO6h.js";import{c as Ie}from"./lock.svg-BOhdQlHW.js";import{C as _e,ad as qe}from"./vendor-utils-BzQg432x.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-BTz28XqK.js";import{w as me,P as ze}from"./permission-CvrrGfG6.js";import{C as Ee}from"./confirm-CdVn5WdC.js";const Me=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188a.19.19 0 0 0 .188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"}));var W={exports:{}},H={exports:{}},te;function ke(){return te||(te=1,(function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};H.exports=m})()),H.exports}var O,ne;function re(){if(ne)return O;ne=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return O=u,O}var U,se;function Ae(){if(se)return U;se=1,U=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return U}var ie;function $e(){return ie||(ie=1,(function(){var u=ke(),m=re().utf8,a=Ae(),c=re().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,r=1732584193,t=-271733879,n=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,x=l._ii,i=0;i<s.length;i+=16){var T=r,R=t,D=n,w=e;r=v(r,t,n,e,s[i+0],7,-680876936),e=v(e,r,t,n,s[i+1],12,-389564586),n=v(n,e,r,t,s[i+2],17,606105819),t=v(t,n,e,r,s[i+3],22,-1044525330),r=v(r,t,n,e,s[i+4],7,-176418897),e=v(e,r,t,n,s[i+5],12,1200080426),n=v(n,e,r,t,s[i+6],17,-1473231341),t=v(t,n,e,r,s[i+7],22,-45705983),r=v(r,t,n,e,s[i+8],7,1770035416),e=v(e,r,t,n,s[i+9],12,-1958414417),n=v(n,e,r,t,s[i+10],17,-42063),t=v(t,n,e,r,s[i+11],22,-1990404162),r=v(r,t,n,e,s[i+12],7,1804603682),e=v(e,r,t,n,s[i+13],12,-40341101),n=v(n,e,r,t,s[i+14],17,-1502002290),t=v(t,n,e,r,s[i+15],22,1236535329),r=g(r,t,n,e,s[i+1],5,-165796510),e=g(e,r,t,n,s[i+6],9,-1069501632),n=g(n,e,r,t,s[i+11],14,643717713),t=g(t,n,e,r,s[i+0],20,-373897302),r=g(r,t,n,e,s[i+5],5,-701558691),e=g(e,r,t,n,s[i+10],9,38016083),n=g(n,e,r,t,s[i+15],14,-660478335),t=g(t,n,e,r,s[i+4],20,-405537848),r=g(r,t,n,e,s[i+9],5,568446438),e=g(e,r,t,n,s[i+14],9,-1019803690),n=g(n,e,r,t,s[i+3],14,-187363961),t=g(t,n,e,r,s[i+8],20,1163531501),r=g(r,t,n,e,s[i+13],5,-1444681467),e=g(e,r,t,n,s[i+2],9,-51403784),n=g(n,e,r,t,s[i+7],14,1735328473),t=g(t,n,e,r,s[i+12],20,-1926607734),r=y(r,t,n,e,s[i+5],4,-378558),e=y(e,r,t,n,s[i+8],11,-2022574463),n=y(n,e,r,t,s[i+11],16,1839030562),t=y(t,n,e,r,s[i+14],23,-35309556),r=y(r,t,n,e,s[i+1],4,-1530992060),e=y(e,r,t,n,s[i+4],11,1272893353),n=y(n,e,r,t,s[i+7],16,-155497632),t=y(t,n,e,r,s[i+10],23,-1094730640),r=y(r,t,n,e,s[i+13],4,681279174),e=y(e,r,t,n,s[i+0],11,-358537222),n=y(n,e,r,t,s[i+3],16,-722521979),t=y(t,n,e,r,s[i+6],23,76029189),r=y(r,t,n,e,s[i+9],4,-640364487),e=y(e,r,t,n,s[i+12],11,-421815835),n=y(n,e,r,t,s[i+15],16,530742520),t=y(t,n,e,r,s[i+2],23,-995338651),r=x(r,t,n,e,s[i+0],6,-198630844),e=x(e,r,t,n,s[i+7],10,1126891415),n=x(n,e,r,t,s[i+14],15,-1416354905),t=x(t,n,e,r,s[i+5],21,-57434055),r=x(r,t,n,e,s[i+12],6,1700485571),e=x(e,r,t,n,s[i+3],10,-1894986606),n=x(n,e,r,t,s[i+10],15,-1051523),t=x(t,n,e,r,s[i+1],21,-2054922799),r=x(r,t,n,e,s[i+8],6,1873313359),e=x(e,r,t,n,s[i+15],10,-30611744),n=x(n,e,r,t,s[i+6],15,-1560198380),t=x(t,n,e,r,s[i+13],21,1309151649),r=x(r,t,n,e,s[i+4],6,-145523070),e=x(e,r,t,n,s[i+11],10,-1120210379),n=x(n,e,r,t,s[i+2],15,718787259),t=x(t,n,e,r,s[i+9],21,-343485551),r=r+T>>>0,t=t+R>>>0,n=n+D>>>0,e=e+w>>>0}return u.endian([r,t,n,e])};l._ff=function(p,d,s,f,r,t,n){var e=p+(d&s|~d&f)+(r>>>0)+n;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,r,t,n){var e=p+(d&f|s&~f)+(r>>>0)+n;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,r,t,n){var e=p+(d^s^f)+(r>>>0)+n;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,r,t,n){var e=p+(s^(d|~f))+(r>>>0)+n;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,W.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}})()),W.exports}var Le=$e();const We=ge(Le);function Q({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=z(),[f,r]=j.useState(!1),[t,n]=j.useState(""),{t:e}=E(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[x,T]=j.useState(p?.extra?.display||"builtin"),[R,D]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const h=i.trim();if(!h){n(e("team.passport.error.titleEmpty"));return}if(h.length>64){n(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){n(e("team.passport.error.descriptionEmpty"));return}const _=l==="create"?We(d?`${d}-${h}`:h):p.name;n(null),r(!0);try{if(l==="create"){const S={teamDid:u,name:_,title:h,description:N,...d?{orgId:d}:{}};x==="custom"&&(S.extra=JSON.stringify({display:"custom",types:R.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:_,title:h,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const k=pe(S);n(k),c(S)}finally{r(!1)}},M=o.jsxs("div",{children:[l==="update"&&o.jsx(I,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(I,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:h=>{n(null),v(h.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(I,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:h=>{n(null),y(h.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:x,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(h,N)=>T(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(I,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(I,{children:e("team.passport.displayCustom")})})]}),x==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:R,disabled:f,onChange:h=>{D(h.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(q,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(q,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(V,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Fe,{component:"div",children:M}),!!t&&o.jsx(Te,{severity:"error",style:{width:"100%",margin:0},children:t})]})}Q.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=z(),{roles:f,permissions:r,teamDid:t,refresh:n,isNodeTeam:e}=de(),{t:i}=E(),[v,g]=j.useState([]),[y,x]=j.useState(!1),[T,R]=j.useState(null),[D,w]=j.useState(!1),M=j.useMemo(()=>l||f,[l,f]),h=_e(M.find(F=>F.name===c)),N=ae(c),_=async F=>{if(!D)try{w(!0),await s.deleteRole({input:{teamDid:t,name:F}}),a()}catch(b){L.error(b.message)}finally{w(!1),R(null)}},S=async(F,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:F,role:{name:b}}})).permissions||[],he=r.map(X=>({...X,bind:fe.some(xe=>xe.name===X.name)}));g(he)},k=async()=>{w(!0);const F=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:h.name,grantNames:F}}),L.success(i("common.saveSuccess")),m()}catch(b){L.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const A=e||!p;let K=null;return e&&(K=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(F=>A?F.bind:!0).map(F=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:A,checked:F.bind,onChange:()=>{g(b=>b.map(P=>(P.name===F.name&&(P.bind=!P.bind),P)))},name:F.name}),label:F.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(Z,{onClick:()=>x(h),"data-cy":`edit-passport-${h.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(Z,{onClick:()=>R({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:h.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{_(h.name)},onCancel:()=>{w(!1),R(null)}}),"data-cy":`delete-passport-${h.name}`,size:"large",children:o.jsx(Me,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!A&&o.jsxs(o.Fragment,{children:[o.jsx(q,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(q,{onClick:k,color:"primary",disabled:D||!h,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[D&&o.jsx(V,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ve,{children:[!h&&o.jsx(Ge,{children:o.jsx(V,{})}),h&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:h.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:h.description})]}),K]})]}),y&&o.jsx(Q,{teamDid:t,onCancel:()=>x(null),onSuccess:()=>{x(null),d?m():n()},mode:"update",roleName:y.name,item:y,orgId:d}),T&&o.jsx(Ee,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel})]})}const He=me(J,"mutate_team"),Oe=me(J,"",le);function Ue(u){const{inService:m}=z();return m?o.jsx(Oe,{...u}):o.jsx(He,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ve=G.div`
2
2
  .header {
3
3
  .title {
4
4
  font-weight: 400;
@@ -47,7 +47,7 @@ import{r as j,g as ge}from"./vendor-react-DX7tU9aY.js";import{j as o,T as I,A as
47
47
  justify-content: center;
48
48
  align-items: center;
49
49
  height: 200px;
50
- `,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=q();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Re,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:ze(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Qe=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=E(),d=De(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(Ee,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(Ie,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=q(),[n,t]=j.useState(!1),[r,e]=j.useState(!1);return o.jsxs(Ke,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Qe,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),r&&o.jsx(Ue,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:r.name,item:r}),n&&o.jsx(Q,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Ke=G(B)`
50
+ `,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=E();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(De,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:qe(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Qe=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=z(),d=Re(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(ze,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(Ie,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=E(),[r,t]=j.useState(!1),[n,e]=j.useState(!1);return o.jsxs(Ke,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Qe,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),n&&o.jsx(Ue,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:n.name,item:n}),r&&o.jsx(Q,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Ke=G(B)`
51
51
  .list {
52
52
  .item {
53
53
  padding: 12px;
@@ -1,4 +1,4 @@
1
- import{B as xr}from"./vendor-utils-BzQg432x.js";import{p as ae}from"./vendor-react-DX7tU9aY.js";import{bT as Se,d8 as Nr,i as _r,d9 as Kr,h as Xe,aT as Tr,da as Ur,db as Br,dc as Je,dd as Dr,aG as Mr,bR as Lr,de as Cr}from"./vendor-ux-Dl3wVbv_.js";import{c5 as Pr,aA as Vr,aD as Fr}from"./index-Ca33rdd_.js";import{r as $r}from"./index-BbO4pSmm.js";var Pe={exports:{}},Re={},er;function Rr(){if(er)return Re;er=1;function p(u){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},p(u)}function b(u,h,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function f(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function g(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),h&&N(u,h)}function N(u,h){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,_){return B.__proto__=_,B},N(u,h)}function L(u){var h=n();return function(){var B=e(u),_;if(h){var K=e(this).constructor;_=Reflect.construct(B,arguments,K)}else _=B.apply(this,arguments);return v(this,_)}}function v(u,h){if(h&&(p(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(u)}function s(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,h,S){S||(S=Error);function B(K,W,C){return typeof h=="string"?h:h(K,W,C)}var _=(function(K){g(C,K);var W=L(C);function C(H,ee,Z){var J;return f(this,C),J=W.call(this,B(H,ee,Z)),J.code=u,J}return b(C)})(S);r[u]=_}function q(u,h){if(Array.isArray(u)){var S=u.length;return u=u.map(function(B){return String(B)}),S>2?"one of ".concat(h," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(h," ").concat(u[0]," or ").concat(u[1]):"of ".concat(h," ").concat(u[0])}else return"of ".concat(h," ").concat(String(u))}function O(u,h,S){return u.substr(0,h.length)===h}function A(u,h,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-h.length,S)===h}function j(u,h,S){return typeof S!="number"&&(S=0),S+h.length>u.length?!1:u.indexOf(h,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,h,S){d===void 0&&(d=ke()),d(typeof u=="string","'name' must be a string");var B;typeof h=="string"&&O(h,"not ")?(B="must not be",h=h.replace(/^not /,"")):B="must be";var _;if(A(u," argument"))_="The ".concat(u," ").concat(B," ").concat(q(h,"type"));else{var K=j(u,".")?"property":"argument";_='The "'.concat(u,'" ').concat(K," ").concat(B," ").concat(q(h,"type"))}return _+=". Received type ".concat(p(S)),_},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var B=y.inspect(h);return B.length>128&&(B="".concat(B.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(B)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,h,S){var B;return S&&S.constructor&&S.constructor.name?B="instance of ".concat(S.constructor.name):B="type ".concat(p(S)),"Expected ".concat(u,' to be returned from the "').concat(h,'"')+" function but got ".concat(B,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,h=new Array(u),S=0;S<u;S++)h[S]=arguments[S];d===void 0&&(d=ke()),d(h.length>0,"At least one arg needs to be specified");var B="The ",_=h.length;switch(h=h.map(function(K){return'"'.concat(K,'"')}),_){case 1:B+="".concat(h[0]," argument");break;case 2:B+="".concat(h[0]," and ").concat(h[1]," arguments");break;default:B+=h.slice(0,_-1).join(", "),B+=", and ".concat(h[_-1]," arguments");break}return"".concat(B," must be specified")},TypeError),Re.codes=r,Re}var Ie,rr;function Gr(){if(rr)return Ie;rr=1;function p(E,m){var U=Object.keys(E);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(E);m&&(x=x.filter(function(V){return Object.getOwnPropertyDescriptor(E,V).enumerable})),U.push.apply(U,x)}return U}function b(E){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?p(Object(U),!0).forEach(function(x){f(E,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(U)):p(Object(U)).forEach(function(x){Object.defineProperty(E,x,Object.getOwnPropertyDescriptor(U,x))})}return E}function f(E,m,U){return m=v(m),m in E?Object.defineProperty(E,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):E[m]=U,E}function g(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function N(E,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(E,v(x.key),x)}}function L(E,m,U){return m&&N(E.prototype,m),Object.defineProperty(E,"prototype",{writable:!1}),E}function v(E){var m=s(E,"string");return u(m)==="symbol"?m:String(m)}function s(E,m){if(u(E)!=="object"||E===null)return E;var U=E[Symbol.toPrimitive];if(U!==void 0){var x=U.call(E,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}function n(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),m&&A(E,m)}function e(E){var m=q();return function(){var x=j(E),V;if(m){var a=j(this).constructor;V=Reflect.construct(x,arguments,a)}else V=x.apply(this,arguments);return r(this,V)}}function r(E,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(E)}function d(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function y(E){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,V)}function V(){return l(x,arguments,j(this).constructor)}return V.prototype=Object.create(x.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),A(V,x)},y(E)}function l(E,m,U){return q()?l=Reflect.construct.bind():l=function(V,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(V,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(E){return Function.toString.call(E).indexOf("[native code]")!==-1}function A(E,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,V){return x.__proto__=V,x},A(E,m)}function j(E){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(E)}function u(E){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(E)}var h=Se(),S=h.inspect,B=Rr(),_=B.codes.ERR_INVALID_ARG_TYPE;function K(E,m,U){return(U===void 0||U>E.length)&&(U=E.length),E.substring(U-m.length,U)===m}function W(E,m){if(m=Math.floor(m),E.length==0||m==0)return"";var U=E.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)E+=E,m--;return E+=E.substring(0,U-E.length),E}var C="",H="",ee="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(E){var m=Object.keys(E),U=Object.create(Object.getPrototypeOf(E));return m.forEach(function(x){U[x]=E[x]}),Object.defineProperty(U,"message",{value:E.message}),U}function oe(E){return S(E,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(E,m,U){var x="",V="",a=0,i="",c=!1,R=oe(E),w=R.split(`
1
+ import{B as xr}from"./vendor-utils-BzQg432x.js";import{p as ae}from"./vendor-react-DX7tU9aY.js";import{bV as Se,da as Nr,i as _r,db as Kr,h as Xe,aU as Tr,dc as Ur,dd as Br,de as Je,df as Dr,aG as Mr,bT as Lr,dg as Cr}from"./vendor-ux-CLT2i3Pv.js";import{c5 as Pr,aA as Vr,aD as Fr}from"./index-CXp5SI_f.js";import{r as $r}from"./index-CqCXPf7W.js";var Pe={exports:{}},Re={},er;function Rr(){if(er)return Re;er=1;function p(u){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},p(u)}function b(u,h,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function f(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function g(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),h&&N(u,h)}function N(u,h){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,_){return B.__proto__=_,B},N(u,h)}function L(u){var h=n();return function(){var B=e(u),_;if(h){var K=e(this).constructor;_=Reflect.construct(B,arguments,K)}else _=B.apply(this,arguments);return v(this,_)}}function v(u,h){if(h&&(p(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(u)}function s(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,h,S){S||(S=Error);function B(K,W,C){return typeof h=="string"?h:h(K,W,C)}var _=(function(K){g(C,K);var W=L(C);function C(H,ee,Z){var J;return f(this,C),J=W.call(this,B(H,ee,Z)),J.code=u,J}return b(C)})(S);r[u]=_}function q(u,h){if(Array.isArray(u)){var S=u.length;return u=u.map(function(B){return String(B)}),S>2?"one of ".concat(h," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(h," ").concat(u[0]," or ").concat(u[1]):"of ".concat(h," ").concat(u[0])}else return"of ".concat(h," ").concat(String(u))}function O(u,h,S){return u.substr(0,h.length)===h}function A(u,h,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-h.length,S)===h}function j(u,h,S){return typeof S!="number"&&(S=0),S+h.length>u.length?!1:u.indexOf(h,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,h,S){d===void 0&&(d=ke()),d(typeof u=="string","'name' must be a string");var B;typeof h=="string"&&O(h,"not ")?(B="must not be",h=h.replace(/^not /,"")):B="must be";var _;if(A(u," argument"))_="The ".concat(u," ").concat(B," ").concat(q(h,"type"));else{var K=j(u,".")?"property":"argument";_='The "'.concat(u,'" ').concat(K," ").concat(B," ").concat(q(h,"type"))}return _+=". Received type ".concat(p(S)),_},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var B=y.inspect(h);return B.length>128&&(B="".concat(B.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(B)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,h,S){var B;return S&&S.constructor&&S.constructor.name?B="instance of ".concat(S.constructor.name):B="type ".concat(p(S)),"Expected ".concat(u,' to be returned from the "').concat(h,'"')+" function but got ".concat(B,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,h=new Array(u),S=0;S<u;S++)h[S]=arguments[S];d===void 0&&(d=ke()),d(h.length>0,"At least one arg needs to be specified");var B="The ",_=h.length;switch(h=h.map(function(K){return'"'.concat(K,'"')}),_){case 1:B+="".concat(h[0]," argument");break;case 2:B+="".concat(h[0]," and ").concat(h[1]," arguments");break;default:B+=h.slice(0,_-1).join(", "),B+=", and ".concat(h[_-1]," arguments");break}return"".concat(B," must be specified")},TypeError),Re.codes=r,Re}var Ie,rr;function Gr(){if(rr)return Ie;rr=1;function p(E,m){var U=Object.keys(E);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(E);m&&(x=x.filter(function(V){return Object.getOwnPropertyDescriptor(E,V).enumerable})),U.push.apply(U,x)}return U}function b(E){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?p(Object(U),!0).forEach(function(x){f(E,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(U)):p(Object(U)).forEach(function(x){Object.defineProperty(E,x,Object.getOwnPropertyDescriptor(U,x))})}return E}function f(E,m,U){return m=v(m),m in E?Object.defineProperty(E,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):E[m]=U,E}function g(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function N(E,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(E,v(x.key),x)}}function L(E,m,U){return m&&N(E.prototype,m),Object.defineProperty(E,"prototype",{writable:!1}),E}function v(E){var m=s(E,"string");return u(m)==="symbol"?m:String(m)}function s(E,m){if(u(E)!=="object"||E===null)return E;var U=E[Symbol.toPrimitive];if(U!==void 0){var x=U.call(E,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}function n(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),m&&A(E,m)}function e(E){var m=q();return function(){var x=j(E),V;if(m){var a=j(this).constructor;V=Reflect.construct(x,arguments,a)}else V=x.apply(this,arguments);return r(this,V)}}function r(E,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(E)}function d(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function y(E){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,V)}function V(){return l(x,arguments,j(this).constructor)}return V.prototype=Object.create(x.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),A(V,x)},y(E)}function l(E,m,U){return q()?l=Reflect.construct.bind():l=function(V,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(V,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(E){return Function.toString.call(E).indexOf("[native code]")!==-1}function A(E,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,V){return x.__proto__=V,x},A(E,m)}function j(E){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(E)}function u(E){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(E)}var h=Se(),S=h.inspect,B=Rr(),_=B.codes.ERR_INVALID_ARG_TYPE;function K(E,m,U){return(U===void 0||U>E.length)&&(U=E.length),E.substring(U-m.length,U)===m}function W(E,m){if(m=Math.floor(m),E.length==0||m==0)return"";var U=E.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)E+=E,m--;return E+=E.substring(0,U-E.length),E}var C="",H="",ee="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(E){var m=Object.keys(E),U=Object.create(Object.getPrototypeOf(E));return m.forEach(function(x){U[x]=E[x]}),Object.defineProperty(U,"message",{value:E.message}),U}function oe(E){return S(E,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(E,m,U){var x="",V="",a=0,i="",c=!1,R=oe(E),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(E)==="object"&&u(m)==="object"&&E!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(E)!=="object"||E===null)&&(u(m)!=="object"||m===null)&&(E!==0||m!==0))return"".concat(J[U],`
4
4