@abtnode/blocklet-services 1.16.54-beta-20251016-050817-2fc632b8 → 1.16.54-beta-20251017-133309-7d40faa6

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 (222) hide show
  1. package/api/emails/_components/asset.js +7 -2
  2. package/api/emails/_components/attachments.js +1 -1
  3. package/dist/assets/{AdapterDayjs-DyE9ImrK.js → AdapterDayjs-T-a0V_gA.js} +1 -1
  4. package/dist/assets/{Google-ZJmTt04Y.js → Google-BXi1gq6W.js} +1 -1
  5. package/dist/assets/{access-control-C5AwSG3T.js → access-control-m0S6yUo8.js} +1 -1
  6. package/dist/assets/{actions-C4-lIUPY.js → actions-C0hEY5iN.js} +1 -1
  7. package/dist/assets/{add-component-core-CrZWbFmf.js → add-component-core-BksM6C--.js} +17 -17
  8. package/dist/assets/{add-resource-Brh4F6D2.js → add-resource-CTnW2X8N.js} +1 -1
  9. package/dist/assets/{addon-DMW6BcQH.js → addon-CPEWVDQ1.js} +1 -1
  10. package/dist/assets/{advanced-ykwSXzlQ.js → advanced-BQT157yk.js} +2 -2
  11. package/dist/assets/{aigne-DmDL-WLj.js → aigne-CfRlP6kv.js} +1 -1
  12. package/dist/assets/api-C7Kyuutl.js +1 -0
  13. package/dist/assets/{appearance-CwaUUdyp.js → appearance-BddR68-e.js} +1 -1
  14. package/dist/assets/{ar-Ge3t6oI2.js → ar-BQm9lQ4M.js} +1 -1
  15. package/dist/assets/{arrow-down.svg-D3B8bxxx.js → arrow-down.svg-UHWRwrOh.js} +1 -1
  16. package/dist/assets/audit-logs-BzqpNyz0.js +35 -0
  17. package/dist/assets/{authorize-CmneXxos.js → authorize-D9fC-nXh.js} +1 -1
  18. package/dist/assets/{base-chart-C_jLgGFD.js → base-chart-CSJD1faI.js} +1 -1
  19. package/dist/assets/{base32-Cg02gOuu.js → base32-iOXf3Dyk.js} +1 -1
  20. package/dist/assets/{bind-account-B_UMGXib.js → bind-account-DhXOE_rG.js} +1 -1
  21. package/dist/assets/branding-BQslHJ3k.js +1 -0
  22. package/dist/assets/{branding-DETOdgiW.js → branding-B_hljukd.js} +1 -1
  23. package/dist/assets/{branding-B_eCdYJK.js → branding-PrRXFhYD.js} +3 -3
  24. package/dist/assets/{bundle-avatar-BFaxogKz.js → bundle-avatar-B6pd4JA-.js} +1 -1
  25. package/dist/assets/button-2y9b8ibp.js +1 -0
  26. package/dist/assets/{click-to-copy-CK42VmRr.js → click-to-copy-PW3ieO34.js} +1 -1
  27. package/dist/assets/{cloneDeep-gpb_g13N.js → cloneDeep-D3tVGEyF.js} +1 -1
  28. package/dist/assets/{collapse-D7GlSZQp.js → collapse-Cc8IqFzl.js} +1 -1
  29. package/dist/assets/{complete-Bqi3d0V1.js → complete-BpTFnpTf.js} +2 -2
  30. package/dist/assets/{component-CSPqPsOF.js → component-abZy96kt.js} +2 -2
  31. package/dist/assets/{config-CPdtVTio.js → config-B-efbAjK.js} +1 -1
  32. package/dist/assets/{config-BWSyA18z.js → config-CBb_1lBq.js} +5 -5
  33. package/dist/assets/{config-BHZS65kz.js → config-CRxkGlLw.js} +1 -1
  34. package/dist/assets/{config-navigation-BFsrGucq.js → config-navigation-V-jkhCe0.js} +3 -3
  35. package/dist/assets/{config-space-CSl6D7xo.js → config-space-uoEgpVj0.js} +1 -1
  36. package/dist/assets/{confirm-CEAKWDZJ.js → confirm-2zLPRflS.js} +1 -1
  37. package/dist/assets/{connect-FvriLilq.js → connect-Bg2fkKdJ.js} +1 -1
  38. package/dist/assets/{connect-BVXqic92.js → connect-CR6YXL6l.js} +1 -1
  39. package/dist/assets/{connect-to-dZwJX0bt.js → connect-to-DVzVPrNg.js} +1 -1
  40. package/dist/assets/{content-layout-W7JDm8iO.js → content-layout-DJL10aJT.js} +1 -1
  41. package/dist/assets/{create-passport-svg-BsR3hKFq.js → create-passport-svg-G2i9OoEB.js} +1 -1
  42. package/dist/assets/{createClass-B4I2IV47.js → createClass-Bf8maCzZ.js} +1 -1
  43. package/dist/assets/{dashboard-DyYLnek8.js → dashboard-DvbW_coF.js} +2 -2
  44. package/dist/assets/{de-CbARTvf4.js → de-D0uPENSq.js} +1 -1
  45. package/dist/assets/{delete-confirm-DpKJ9gtf.js → delete-confirm-tJr-kQGY.js} +1 -1
  46. package/dist/assets/{did-address-BQL5Zxlr.js → did-address-yNLicvuz.js} +1 -1
  47. package/dist/assets/{domain-action-card-CRdL2PFv.js → domain-action-card-oKAg2vcg.js} +2 -2
  48. package/dist/assets/{domain-Bq75ZuOm.js → domain-orOrS-66.js} +1 -1
  49. package/dist/assets/domains-CIKaHlMa.js +1 -0
  50. package/dist/assets/{email-OlQWpbtF.js → email-Bw5lhga1.js} +1 -1
  51. package/dist/assets/{empty-spinner-sNq-0DF5.js → empty-spinner-Dqkt-AHg.js} +1 -1
  52. package/dist/assets/engine-DrB5N6Vq.js +1 -0
  53. package/dist/assets/{es-CaCbzATO.js → es-Dh4_UfCu.js} +1 -1
  54. package/dist/assets/{exchange-passport-DK4-g9my.js → exchange-passport-D5N7TuyP.js} +1 -1
  55. package/dist/assets/{form-C5dLovtO.js → form-D9ZwMxUQ.js} +1 -1
  56. package/dist/assets/{form-text-input-AIMlcRaM.js → form-text-input-BdGN_cNn.js} +1 -1
  57. package/dist/assets/{form-wrapper-DINLdpTN.js → form-wrapper-SZH1FnTd.js} +1 -1
  58. package/dist/assets/{fr-B3yjKUFH.js → fr-CzZWQkiT.js} +1 -1
  59. package/dist/assets/{fuel-DkqmEB8D.js → fuel-DRu4UcZ3.js} +1 -1
  60. package/dist/assets/{gen-access-key-BnCg2Wu1.js → gen-access-key-Cg1WeFbg.js} +1 -1
  61. package/dist/assets/{gen-simple-access-key-zOQbFtZ8.js → gen-simple-access-key-DPQLOBVf.js} +1 -1
  62. package/dist/assets/get-safe-url-BEmXir96.js +1 -0
  63. package/dist/assets/{hi-q4mhHiIl.js → hi-Do9VCuRi.js} +1 -1
  64. package/dist/assets/{home-DTXdAvXT.js → home-drsp3cTN.js} +1 -1
  65. package/dist/assets/{id-DTf7aVH8.js → id-Dhhrveu9.js} +1 -1
  66. package/dist/assets/{iframe-DAoobOBi.js → iframe-D7RMzvnk.js} +1 -1
  67. package/dist/assets/{index-DHQkab_n.js → index--FkaQ0Dk.js} +1 -1
  68. package/dist/assets/index--OvsXAyb.js +1 -0
  69. package/dist/assets/{index-DNGdj2R4.js → index-4_vQ0fa1.js} +4 -4
  70. package/dist/assets/{index-IGBGBXd_.js → index-B31Z5yXU.js} +1 -1
  71. package/dist/assets/index-B486VukG.js +1 -0
  72. package/dist/assets/{index-DeVDiUjo.js → index-B80ObPIt.js} +1 -1
  73. package/dist/assets/index-BJkTWRHF.js +281 -0
  74. package/dist/assets/{index-D_vhPpT2.js → index-BMkkWtK-.js} +1 -1
  75. package/dist/assets/index-BPz1W1F5.js +7 -0
  76. package/dist/assets/{index-D6Y3sCzN.js → index-BTb5QwNU.js} +2 -2
  77. package/dist/assets/{index-BJrVQ6ch.js → index-B_9ypeKS.js} +1 -1
  78. package/dist/assets/{index-3yzleS_1.js → index-BnPTSmJZ.js} +87 -87
  79. package/dist/assets/index-Bv1DYw0_.js +55 -0
  80. package/dist/assets/{index-D1thq8eN.js → index-BwxEDC7M.js} +6 -6
  81. package/dist/assets/{index-VySXxf4w.js → index-CAMegfIe.js} +1 -1
  82. package/dist/assets/{index-ve-p7nSZ.js → index-CMOR5eza.js} +5 -5
  83. package/dist/assets/index-CR7OYm8K.js +120 -0
  84. package/dist/assets/{index-KpZGUssm.js → index-CXs5RZ6g.js} +1 -1
  85. package/dist/assets/{index-Bgt2qHLn.js → index-CcoIHAI8.js} +4 -4
  86. package/dist/assets/{index-Cd_Gml9C.js → index-CjUY4wYp.js} +1 -1
  87. package/dist/assets/{index-DJj8GmQS.js → index-Cs8-XzFL.js} +1 -1
  88. package/dist/assets/{index-BcGECSaf.js → index-D0c5zNE-.js} +1 -1
  89. package/dist/assets/{index-C80JxCSn.js → index-D5jPhzpV.js} +1 -1
  90. package/dist/assets/{index-Cs_I9KFa.js → index-DC4JoVqO.js} +1 -1
  91. package/dist/assets/{index-DlRa8Zeh.js → index-DD8Xcc3x.js} +1 -1
  92. package/dist/assets/index-DJgF8q_o.js +124 -0
  93. package/dist/assets/{index-B6a6aopU.js → index-DJhcYi8s.js} +11 -11
  94. package/dist/assets/{index-DX3L95vz.js → index-DKuLdlGi.js} +1 -1
  95. package/dist/assets/{index-rQAVknkX.js → index-DVsdJqbi.js} +1 -1
  96. package/dist/assets/{index-Cr5RxnHu.js → index-DacQww-t.js} +1 -1
  97. package/dist/assets/{index-iOD1kOar.js → index-DdeHXxqD.js} +4 -4
  98. package/dist/assets/{index-BdHbrnpK.js → index-Dj7hvho1.js} +1 -1
  99. package/dist/assets/{index-D_HqsEfj.js → index-Dz7IF3dR.js} +1 -1
  100. package/dist/assets/{index-DFceGCP0.js → index-Z2OlxmBy.js} +1 -1
  101. package/dist/assets/{invitation-P1aXUnIO.js → invitation-dxOWwXhI.js} +1 -1
  102. package/dist/assets/{invitations-dPkgiFPr.js → invitations-fxhgBZ7v.js} +1 -1
  103. package/dist/assets/{invite-Bz99qCDF.js → invite-BUfTFpm3.js} +1 -1
  104. package/dist/assets/{isURL-DYsELTMk.js → isURL-BWdci4BV.js} +2 -2
  105. package/dist/assets/{issue-passport-DPyxNFLD.js → issue-passport-CGjo4nFE.js} +1 -1
  106. package/dist/assets/{item-B1UaStjk.js → item-CpRxSfFl.js} +1 -1
  107. package/dist/assets/{ja-Csh_XwzF.js → ja-B70UYq5X.js} +1 -1
  108. package/dist/assets/{ko-xiNTwgO9.js → ko-C7TZwmXC.js} +1 -1
  109. package/dist/assets/{landing-page-CkVnGimh.js → landing-page-BeMOLJet.js} +1 -1
  110. package/dist/assets/{launch-result-message-Dt-T7zmz.js → launch-result-message-DZJ76kCs.js} +1 -1
  111. package/dist/assets/{layout-fFNOz6Xe.js → layout-DSuoHJe3.js} +1 -1
  112. package/dist/assets/list-DA_a9DhC.js +103 -0
  113. package/dist/assets/list-gCQikTBu.js +2 -0
  114. package/dist/assets/{list-header-CjohGZ9B.js → list-header-BNFs7V0b.js} +1 -1
  115. package/dist/assets/localization-NenbMmXN.js +1 -0
  116. package/dist/assets/{log-lPrpnnPZ.js → log-BRV1BCFu.js} +1 -1
  117. package/dist/assets/logger-CHXN98LU.js +1 -0
  118. package/dist/assets/{login-63olb_gZ.js → login-DP97VuHR.js} +1 -1
  119. package/dist/assets/{login-oauth-callback-DebmT1Db.js → login-oauth-callback-C2DR5bOf.js} +1 -1
  120. package/dist/assets/{logo-uploader-3OpHGD1n.js → logo-uploader-BNfVMS9b.js} +1 -1
  121. package/dist/assets/{lost-passport-xCmWuuxC.js → lost-passport-BdOj7Qyw.js} +3 -3
  122. package/dist/assets/{observability-B458LeIE.js → observability-BjKI3tFt.js} +1 -1
  123. package/dist/assets/{omit-DdfLLBNW.js → omit-CxhCIYKY.js} +1 -1
  124. package/dist/assets/{open-window-CzYfI7l7.js → open-window-Dm9n80Az.js} +1 -1
  125. package/dist/assets/{over-due-invoice-payment-C5fynimj.js → over-due-invoice-payment-Cg-G2W1o.js} +1 -1
  126. package/dist/assets/{overview-BFzvEbcq.js → overview-BFV7mugn.js} +2 -2
  127. package/dist/assets/{page-header-gosgJ3fX.js → page-header-xpG0yfsa.js} +1 -1
  128. package/dist/assets/passport-CQWKOko9.js +1 -0
  129. package/dist/assets/passport-item-ZjtfZLBd.js +1 -0
  130. package/dist/assets/{permission-UeJPGiMm.js → permission-BZsLoL-d.js} +1 -1
  131. package/dist/assets/{playground-_1Dj8J_h.js → playground-DKMlueFr.js} +1 -1
  132. package/dist/assets/preferences-C5BaFHlg.js +1 -0
  133. package/dist/assets/profile-embed-HIW9YGAc.js +1 -0
  134. package/dist/assets/{pt-BvcG4R7B.js → pt-DObJ_ADK.js} +1 -1
  135. package/dist/assets/publish-resource-CG--uFPX.js +1 -0
  136. package/dist/assets/{react-beautiful-dnd.esm-CIwtis6a.js → react-beautiful-dnd.esm-DG8qQeEC.js} +1 -1
  137. package/dist/assets/{react-stripe.esm-omsK4b05.js → react-stripe.esm-BV6kfV2w.js} +1 -1
  138. package/dist/assets/{required-BPzIdi1N.js → required-C9DLcn9T.js} +1 -1
  139. package/dist/assets/revoke.svg-CmffMlcP.js +1 -0
  140. package/dist/assets/{ru-DzUPRLmr.js → ru-nYDmEUmY.js} +1 -1
  141. package/dist/assets/{runtime-iwxdTEke.js → runtime-tvucPK2o.js} +1 -1
  142. package/dist/assets/{sanitize-CEXE1rEu.js → sanitize-m8Fu6XGD.js} +1 -1
  143. package/dist/assets/sdk-BGPH_Nn6.js +1 -0
  144. package/dist/assets/{section-DOw43pby.js → section-MSasF4Cx.js} +1 -1
  145. package/dist/assets/{security-D4Sx6wQO.js → security-DTZHnwsj.js} +6 -6
  146. package/dist/assets/{session-Dnp_ufkx.js → session-ByI8mrad.js} +1 -1
  147. package/dist/assets/{setup-DpBiTcjv.js → setup-BUodqoBL.js} +1 -1
  148. package/dist/assets/{shorten-label-C-X_7vr2.js → shorten-label-dRmYvYJ7.js} +1 -1
  149. package/dist/assets/simple-select-C-ApYkD4.js +1 -0
  150. package/dist/assets/{spaces-Bu7-7u79.js → spaces-Bqe6pnFj.js} +1 -1
  151. package/dist/assets/{start-B1qawsPb.js → start-DCOjCV4F.js} +1 -1
  152. package/dist/assets/{starting-progress-BfM3wNuj.js → starting-progress-_tZGZM6B.js} +1 -1
  153. package/dist/assets/{status-LEG00uGL.js → status-DAIZaCUT.js} +1 -1
  154. package/dist/assets/{step-actions-BzwezgI2.js → step-actions-D_gKO0Cw.js} +1 -1
  155. package/dist/assets/{studio-Bk9PCaeS.js → studio-DCdXmXUq.js} +1 -1
  156. package/dist/assets/{switch-control-CRxlGq2g.js → switch-control-Ddqhf44I.js} +1 -1
  157. package/dist/assets/{table-tips-BMq3WO_p.js → table-tips-BUZ1mtAq.js} +1 -1
  158. package/dist/assets/{team-DmYSbFMF.js → team-CeANUXFV.js} +7 -7
  159. package/dist/assets/{th-BmW1qKpZ.js → th-DMcUw_9_.js} +1 -1
  160. package/dist/assets/{traffic-CzxoP9Vj.js → traffic-CVF4T2v4.js} +1 -1
  161. package/dist/assets/{transfer-CUe_bnhh.js → transfer-B4X6jlUA.js} +1 -1
  162. package/dist/assets/ua-parser-DP5omx3I.js +1 -0
  163. package/dist/assets/{unsubscribe-5Z1xcJ3T.js → unsubscribe-xvziXmXe.js} +1 -1
  164. package/dist/assets/{use-app-logo-0uziDh86.js → use-app-logo-Cp60-jm5.js} +1 -1
  165. package/dist/assets/{use-mobile-DLnLSQQq.js → use-mobile-Bjbo_Gou.js} +1 -1
  166. package/dist/assets/{use-mobile-Db5FIl07.js → use-mobile-CjZIGfWP.js} +1 -1
  167. package/dist/assets/{use-server-logo-CFlVReBS.js → use-server-logo-uMEEt675.js} +1 -1
  168. package/dist/assets/{use-window-close-CrHmRyVV.js → use-window-close-Coe8kRfa.js} +1 -1
  169. package/dist/assets/{useAsync-1_z8P8M4.js → useAsync-B9mMAdx5.js} +1 -1
  170. package/dist/assets/{useAsync-BKYfrNw7.js → useAsync-tu8lmT7w.js} +1 -1
  171. package/dist/assets/{useAsyncRetry-Dyo5t1bq.js → useAsyncRetry-n96jNDlD.js} +1 -1
  172. package/dist/assets/{useLocalStorage-Be_1V0gr.js → useLocalStorage-CPNhajTc.js} +1 -1
  173. package/dist/assets/user-center-CdyILvwP.js +126 -0
  174. package/dist/assets/user-follower-Brdja1Pl.js +32 -0
  175. package/dist/assets/{util-DXaZWduO.js → util-cUwto1hL.js} +1 -1
  176. package/dist/assets/{util-CQfGbjyT.js → util-d0fh6S9R.js} +1 -1
  177. package/dist/assets/{vendor-arcblock-DGOH9a3F.js → vendor-arcblock-BzYItNIN.js} +1 -1
  178. package/dist/assets/{vendor-hooks-DmThWyyG.js → vendor-hooks-tpeT8a0P.js} +2 -2
  179. package/dist/assets/{vendor-mui-core-BFPsXaTR.js → vendor-mui-core-BPcN1m8_.js} +1 -1
  180. package/dist/assets/{vendor-mui-x-C6iZOJbV.js → vendor-mui-x-DEgOZXst.js} +1 -1
  181. package/dist/assets/{vendor-utils-OrZFrHBP.js → vendor-utils-COYaMdo5.js} +1 -1
  182. package/dist/assets/{vendor-ux-CE4sOH7O.js → vendor-ux-D_B1Y7iC.js} +126 -133
  183. package/dist/assets/{vi-BPU54RQW.js → vi-B73oWQBC.js} +1 -1
  184. package/dist/assets/{wait-connect-Rle27g9O.js → wait-connect-B4jNvmkx.js} +1 -1
  185. package/dist/assets/{wizard-CewJTR0V.js → wizard-BZNmVb4z.js} +1 -1
  186. package/dist/assets/{wizard-components-B4yvBYZF.js → wizard-components-C5WSLWm-.js} +1 -1
  187. package/dist/assets/wrap-locale-CsR2MOap.js +1 -0
  188. package/dist/assets/{zh-Bg-a-bz5.js → zh-BsfsxdYb.js} +1 -1
  189. package/dist/assets/{zh-WrFfMVyM.js → zh-DCABA61W.js} +1 -1
  190. package/dist/assets/{zh-tw-DjWFpq-W.js → zh-tw-M_0Y4wmR.js} +1 -1
  191. package/dist/index.html +1 -1
  192. package/dist/service-worker.js +1 -1
  193. package/package.json +34 -34
  194. package/dist/assets/api-txzyyizM.js +0 -1
  195. package/dist/assets/audit-logs-eJR1v94e.js +0 -35
  196. package/dist/assets/branding-CHRz3wuZ.js +0 -1
  197. package/dist/assets/button-CaqBEwnu.js +0 -1
  198. package/dist/assets/domains-BiIZZN7p.js +0 -1
  199. package/dist/assets/engine-B1U2TY7M.js +0 -1
  200. package/dist/assets/get-safe-url-3Xj-tgXY.js +0 -1
  201. package/dist/assets/index-CDCcuLh3.js +0 -7
  202. package/dist/assets/index-CZp06HHE.js +0 -281
  203. package/dist/assets/index-D9QTZSnh.js +0 -1
  204. package/dist/assets/index-D_s4QOu7.js +0 -1
  205. package/dist/assets/index-Dfmjh5-5.js +0 -124
  206. package/dist/assets/index-LeqLm9hN.js +0 -55
  207. package/dist/assets/index-RD-gFG7U.js +0 -113
  208. package/dist/assets/list-C-9EwvIL.js +0 -2
  209. package/dist/assets/list-CX2Q1hbc.js +0 -103
  210. package/dist/assets/localization-DQioZq4I.js +0 -1
  211. package/dist/assets/logger-DkBs7Soy.js +0 -1
  212. package/dist/assets/passport-BLmrTDdo.js +0 -1
  213. package/dist/assets/passport-item-CBB6usyJ.js +0 -1
  214. package/dist/assets/preferences-Da8NATLw.js +0 -1
  215. package/dist/assets/profile-embed-9LLnCulK.js +0 -1
  216. package/dist/assets/publish-resource-Chyv1Trw.js +0 -1
  217. package/dist/assets/sdk-D4xzRwM9.js +0 -1
  218. package/dist/assets/simple-select-Bg4XC1E_.js +0 -1
  219. package/dist/assets/user-center-u6FpYGow.js +0 -126
  220. package/dist/assets/user-follower-CyGK-1so.js +0 -32
  221. package/dist/assets/user-sessions-4qrRIOb8.js +0 -1
  222. package/dist/assets/wrap-locale-qW2Nj5Kt.js +0 -1
@@ -1,124 +0,0 @@
1
- import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Le,P as Be,b6 as Q,a5 as We,z as Qe,A as Je,ci as At,bh as Mt,U as je,d9 as zt,da as Et,at as X,db as Lt,a6 as Z,n as ae,D as Bt,dc as Wt,ar as Oe,b1 as Re,dd as Ot,aX as Dt,am as Ce,bq as Nt,br as ye,a$ as $t,cW as Ft}from"./vendor-mui-core-BFPsXaTR.js";import{r as y,a as Ut,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a6 as Gt,R as De,D as Kt,C as le,n as V,A as Yt}from"./vendor-utils-OrZFrHBP.js";import{a as Vt,F as Zt,bu as Qt,c as Ie,Y as Jt,bv as Xt,aX as Te,W as xe,bg as er,bw as tr,a8 as rr,aZ as nr,a9 as or,bx as sr}from"./index-3yzleS_1.js";import{a as R,h as et,k as ee,g as G,b as L,j as ir}from"./vendor-hooks-DmThWyyG.js";import{l as tt}from"./arrow-down.svg-D3B8bxxx.js";import{s as Ae,a2 as O,V as W,aB as ar,z as rt,aC as lr,H as q,aD as cr,aE as dr,aF as Ne,v as ur,p as nt,u as Me,aG as pr,aH as M,O as xr,K as fr,$ as ot,aI as hr,aJ as gr,J as mr,o as ce,U as $e,x as br,a9 as Fe}from"./vendor-ux-CE4sOH7O.js";import{N as yr}from"./list-CX2Q1hbc.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Ue}from"./bundle-avatar-BFaxogKz.js";import{h as _e,T as wr}from"./team-DmYSbFMF.js";import{b as jr,d as Cr,a as Sr,c as kr,e as Pr,f as Rr,h as Ir,O as Tr}from"./user-center-u6FpYGow.js";import{T as qe,O as Ar}from"./index-DJj8GmQS.js";import{c as Mr}from"./passport-BLmrTDdo.js";import{N as st,U as it}from"./index-ve-p7nSZ.js";import{u as te}from"./use-mobile-Db5FIl07.js";import zr from"./index-D_vhPpT2.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-DlRa8Zeh.js";import{U as ve}from"./user-sessions-4qrRIOb8.js";import Er from"./index-D1thq8eN.js";import{o as Lr}from"./vendor-arcblock-DGOH9a3F.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-Bgt2qHLn.js";import"./index-Cd_Gml9C.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-CyGK-1so.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DeVDiUjo.js";import"./util-CQfGbjyT.js";import"./base32-Cg02gOuu.js";import"./session-Dnp_ufkx.js";import"./isURL-DYsELTMk.js";import"./use-app-logo-0uziDh86.js";import"./index-iOD1kOar.js";import"./use-mobile-DLnLSQQq.js";import"./actions-C4-lIUPY.js";import"./index-IGBGBXd_.js";import"./form-text-input-AIMlcRaM.js";import"./required-BPzIdi1N.js";import"./form-wrapper-DINLdpTN.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-DHQkab_n.js";import"./permission-UeJPGiMm.js";import"./confirm-CEAKWDZJ.js";import"./click-to-copy-CK42VmRr.js";import"./invitations-dPkgiFPr.js";import"./create-passport-svg-BsR3hKFq.js";import"./api-txzyyizM.js";import"./table-tips-BMq3WO_p.js";import"./passport-item-CBB6usyJ.js";import"./did-address-BQL5Zxlr.js";import"./index-C80JxCSn.js";import"./vendor-mui-x-C6iZOJbV.js";import"./AdapterDayjs-DyE9ImrK.js";import"./delete-confirm-DpKJ9gtf.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function o({root:s,rootMargin:n,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:n,threshold:i}),p=a.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:s,rootMargin:n,threshold:i}),entryCallbacks:r},a.set(l,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:o}}var $r="0px",Fr=[0],Ur=Nr();function _r(t){let o=t?.rootMargin??$r,s=t?.threshold??Fr,n=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Ur.getObserver({root:i.current,rootMargin:o,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[o,s]),f=y.useCallback(()=>{let C=a.current,v=n.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),n.current=C,r()},[r,f]),m=y.useCallback(C=>{f(),i.current=C,r()},[r,f]);return[h,{entry:l,rootRef:m}]}var qr=_r;function Hr(t){let[o,s]=qr(t),n=!!s.entry?.isIntersecting,[i,a]=y.useState(n);return n&&!i&&a(!0),[o,{...s,isVisible:n,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:o,onLoadMore:s,rootMargin:n,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:n});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&o;return y.useEffect(()=>{if(h){let m=setTimeout(()=>{l.current()},a);return()=>{clearTimeout(m)}}},[h,a]),[p,{rootRef:r}]}var Vr=Yr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ue.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ue({severity:t,size:o=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:o,height:o,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:o="button",onSelectType:s,extra:n=void 0,currentTab:i="",loading:a=!1,...l}){const{t:p}=y.useContext(Ae),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=g=>{(g!==i||!a)&&s(g)},h=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:o==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return o==="line"?Object.assign(g,{}):g},[o,t]),m=(g,S,T)=>e.jsx(H,{disabled:a,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...l,children:g.label},g.value||T),C=(g,S,T)=>e.jsx(H,{variant:"text",disabled:a,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...l,children:g.label},g.value||T),v=()=>r?.map((g,S)=>{const T=i===g?.value;return o==="line"?e.jsx(y.Fragment,{children:C(g,T,S)},g.value||S):e.jsx(y.Fragment,{children:m(g,T,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return o==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:i||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ie,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ue,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:h,children:[e.jsx(x,{sx:{...o==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:o,onChange:s}){const{t:n}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(o.pageCount<=0||i)return null;const a=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=o.page-1<=0?0:o.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:o.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${n()}more than ${f}`}`,rowsPerPage:o.pageSize,onPageChange:a,onRowsPerPageChange:l})})}const Zr=y.memo(lt),Qr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:o=!1,type:s="service",blockletMap:n={},filterType:i="component",selectedId:a=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:m}=y.useContext(Ae),[C,v]=y.useState(null),c=!!C,[g,S]=y.useState(a),[T,P]=y.useState(l),[b,E]=y.useState(!1),[z,U]=y.useState(""),[N,j]=y.useState([]);y.useEffect(()=>{S(a),P(l)},[a,l]);const k=[{label:m("notification.filterType.all"),value:"all"},{label:m("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==h||!o)&&f(d)},K=[{label:m("notification.severityType.info"),value:"info"},{label:m("notification.severityType.success"),value:"success"},{label:m("notification.severityType.warning"),value:"warning"},{label:m("notification.severityType.error"),value:"error"}],re=d=>{v(d.currentTarget),U(""),E(!1)},he=()=>{v(null)},ne=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:T})},oe=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:g})},ge=d=>{U(d.target.value)},me=()=>{E(!b)},Y=Ut.useMemo(()=>{if(!n.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,i,m]);y.useEffect(()=>{if(z.trim()==="")j(Y);else{const d=z.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[z,Y]);const be=z.trim()!==""||b?N:N.slice(0,He);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:k.map(d=>e.jsxs(H,{disabled:o,onClick:()=>D(d.value),className:`profile-button ${h===d.value?"active":""}`,sx:{...s==="service"&&h===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx($,{size:"small",onClick:re,disabled:o,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:m("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(We,{checked:T.includes(d.value),onChange:()=>oe(d.value),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ue,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:m("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:z,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(We,{checked:g.includes(d.id),onChange:()=>ne(d.id),disabled:o,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(Ue,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),N.length>He&&z.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),g.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ue,{severity:d}),w?w.label:d]}),onDelete:()=>oe(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=Y.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Ue,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>ne(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=X(Lt)`
2
- position: fixed;
3
- bottom: 20px;
4
- right: 20px;
5
- z-index: 1000;
6
- @media (max-width: 600px) {
7
- bottom: 16px;
8
- right: 16px;
9
- transform: scale(0.9);
10
- }
11
- `;function en(){const[t,o]=y.useState(!1);y.useEffect(()=>{const n=Xe(()=>{o(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Xr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const tn=X.div`
12
- display: flex;
13
- flex-direction: column;
14
- gap: ${t=>t.inDialog?0:"24px"};
15
- .MuiContainer-root {
16
- padding-right: 0;
17
- }
18
-
19
- .profile-button.MuiButtonBase-root {
20
- border-radius: 9999px;
21
- margin-right: 2px;
22
- padding: 5px 12px;
23
- line-height: 22px;
24
- font-size: 13px;
25
- border: 1px solid transparent;
26
- background-color: ${({theme:t})=>t.palette.background.default};
27
- color: ${({theme:t})=>t.palette.text.primary};
28
- font-weight: 400;
29
- border: 1px solid ${({theme:t})=>t.palette.divider} !important;
30
- }
31
- .profile-button.active.MuiButtonBase-root,
32
- .profile-button.active.MuiButtonBase-root:hover {
33
- color: ${({theme:t})=>t.palette.primary.main};
34
- font-weight: 600;
35
- background-color: ${({theme:t})=>ae(t.palette.primary.main,.1)};
36
- border: 1px solid ${({theme:t})=>ae(t.palette.primary.main,.24)} !important;
37
- }
38
-
39
- .profile-button.MuiButtonBase-root:hover {
40
- background-color: rgba(0, 0, 0, 0.04);
41
- }
42
-
43
- .profile-line-button.MuiButtonBase-root {
44
- margin-right: 2px;
45
- color: ${({theme:t})=>t.palette.text.secondary};
46
- padding: 5px 12px;
47
- line-height: 22px;
48
- font-size: 13px;
49
- border: none !important;
50
- border-radius: 0;
51
- }
52
-
53
- .profile-line-button.active.MuiButtonBase-root {
54
- color: ${({theme:t})=>t.palette.text.primary};
55
- border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
56
- }
57
-
58
- .profile-button.MuiButtonBase-root:last-of-type,
59
- .profile-line-button.MuiButtonBase-root {
60
- margin-right: 0;
61
- }
62
-
63
- .profile-line-button.MuiButtonBase-root:hover {
64
- color: ${({theme:t})=>t.palette.text.primary};
65
- background-color: unset;
66
- }
67
-
68
- * {
69
- scrollbar-width: none; /* Firefox */
70
- -ms-overflow-style: none; /* IE and Edge */
71
- }
72
-
73
- *::-webkit-scrollbar {
74
- display: none; /* Chrome, Safari and Opera */
75
- }
76
- `;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:o,pagination:s=!0,inDialog:n=!1,filterType:i="component",toViewAll:a=()=>{},type:l="service"}){const{data:p,paging:r,refresh:f,loading:h,params:m,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=o,S=d=>{f({...m,severity:d&&typeof d=="string"?[d]:d||[],paging:{...m.paging,page:1}})},[T]=_t(),P=R(()=>T.get("id"),[T]),b=pe(d=>d.breakpoints.down("md")),[E,z]=y.useState(0),[U,N]=y.useState(!1),j=y.useMemo(()=>m.read===!1?"unread":"all",[m.read]),k=R(()=>Xe(d=>{if(h)return;const w=p.length,A=p.filter(_=>!_e(_)).length;let B={...m,append:!0,paging:{...m.paging,...d,currentPage:(r.currentPage||0)+1}};j==="unread"&&A<w&&d.page>m.paging.page&&(B={...m,append:!0,paging:{...m.paging,...d,page:m.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(B)},500),[p,m,j,r,h,f]);et(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&z(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),N(!0)},100),setTimeout(()=>{N(!1)},3e3)},[P]);const D=R(()=>p?.length>0&&p.length<E,[p,E]),K=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(B=>B)];return v?.includes(d)||A.findIndex(B=>B===d)>-1},[v]),re=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(B=>{d.has(B)||d.set(B,w)})),w?.children?.length>0&&w.children.forEach(B=>{const _=B?.did||B.meta?.did;_&&!d.has(_)&&K(_)&&(B.ancestors=[w],d.set(_,B))})}),d},[t,K]),he=y.useCallback(()=>{h||k({page:r.page+1})},[r.page,h,k]),[ne]=Vr({loading:h,hasNextPage:D,onLoadMore:he}),oe=d=>{!d||_e(d)||C(d.id).then(()=>{n&&a()})},ge=({severity:d,id:w})=>{if(h)return;let A={};i==="component"?A={entityId:[],componentDid:w}:i==="entity"&&(A={componentDid:[],entityId:w}),f({...m,severity:d,...A,paging:{...m.paging,page:1}})},me=d=>{if(h)return;let w={...m,paging:{...m.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Ht(w,"read"),f(w)},Y=R(()=>i==="component"?Array.isArray(m.componentDid)?m.componentDid:[]:i==="entity"?Array.isArray(m.entityId)?m.entityId:[]:[],[m,i]),be=R(()=>(Array.isArray(m.severity)?m.severity:[])[0]||"",[m.severity]);return e.jsxs(tn,{inDialog:!!n,children:[n?e.jsx(at,{currentTab:be,type:"line",theme:"light",onSelectType:S}):e.jsx(ct,{loading:h,blockletMap:re,unReadCount:c,filterType:i,type:l,selectedId:Y,onFilterChange:ge,severity:m.severity,onReadFilterChange:me,currentReadFilter:j}),!b&&h?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):e.jsx(yr,{data:p,blockletMap:re,onReadNotification:oe,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&U,type:l}),s&&!b?e.jsx(Zr,{loading:h,paging:r,onChange:k}):null,s&&b&&(h||D)?e.jsx(x,{ref:ne,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):null,!n&&b?e.jsx(en,{}):null]})}const rn=y.memo(dt),F=new Qt;function fe(t){const{userDid:o=""}={},{session:s}=Vt(),n=R(()=>{if(o)return o;const r=window.location.href,f=Gt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,o]),i=R(()=>s.user,[s]),a=R(()=>i?n===i?.did:!1,[n,i?.did]),l=ee(async()=>{if(await Zt(()=>s?.initialized),a)return s.user;if(n)return F.user.getUserPublicInfo({did:n})},{refreshDeps:[n,a,s?.initialized,i]}),p=R(()=>i.passports?.some(r=>r.role===Ie.ROLES.OWNER),[i]);return{currentDid:n,session:s,isMyself:a,user:i,viewUser:l.data,isOwner:p}}function ut({user:t,...o}){const{t:s}=W(),n=Bt(),i=R(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ar.REVOKED}));return p.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),a=R(()=>i?.find(p=>p.name===t.role),[i,t?.role]),l=n.palette.primary.main;return i.length===0?e.jsx(x,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(x,{...o,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...o.sx},children:i.map(p=>e.jsx(jr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Mr,title:a&&a.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:a&&a.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function nn({visible:t,onClose:o,nft:s}){return!t||!s?null:e.jsx(on,{children:e.jsx(Wt,{open:t,onClose:o,children:e.jsx(sn,{onClick:o,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const on=X.div`
77
- position: relative;
78
- width: 100%;
79
- height: 100%;
80
- cursor: pointer;
81
-
82
- &:hover {
83
- .mask {
84
- opacity: 1;
85
- }
86
- }
87
-
88
- .mask {
89
- position: absolute;
90
- top: 0;
91
- left: 0;
92
- display: flex;
93
- align-items: center;
94
- justify-content: center;
95
- width: 100%;
96
- height: 100%;
97
- background: rgba(0, 0, 0, 0.6);
98
- opacity: 0;
99
- transition: opacity 0.2s;
100
- }
101
- `,sn=X.div`
102
- display: flex;
103
- justify-content: center;
104
- align-items: center;
105
- height: 100vh;
106
- width: 100vw;
107
-
108
- img,
109
- object {
110
- max-width: 90vw;
111
- max-height: 75vh;
112
- }
113
-
114
- .nft-display--inset {
115
- > .MuiBox-root,
116
- .nft-display__loading {
117
- width: 75vmin;
118
- height: 75vmin;
119
- }
120
- }
121
- `,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:ae(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ae(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:o}=W(),s=te(),[n,i]=y.useState({visible:!1,nft:null}),[a,l]=y.useState({anchorEl:null,props:null}),p=P=>{const b=le(Ye,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let E="";typeof b.data?.value=="string"?E=JSON.parse(b.data?.value)?.domain:E=b.data?.value?.domain,l({anchorEl:P,props:{title:E?`Hey, I just won an NFT at the ${E} event!`:"Hey, I just won an NFT!",url:le(Ye,"assets",b.address)}})},f=P=>{i({visible:!0,nft:P})},h=G({page:1,size:20}),m=ee(async(P=h)=>(await Kt.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&h,defaultParams:[h],refreshDeps:[t?.did,h]}),{loading:C,data:v}=m,c=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{h.page=b,m.run(h)},S=L(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:o("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:o("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||h.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:h.page,onChange:g,count:Math.ceil(c.total/h.size),size:"small"}):null,e.jsx(nn,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{i({visible:!1,nft:null})}}),e.jsx(lr,{anchorEl:a.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[C,c,h.page,h.size,g,a,n]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:o,isMyself:s,viewUser:n}=fe();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:o})]}):null,e.jsx(pt,{user:s?o:n})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:o}){const{t:s,changeLocale:n}=W(),i=G({locale:t.locale,loading:!1}),a=L(async l=>{try{const{value:p}=l.target;i.loading=!0,await F.user.saveProfile({locale:p}),await o("profile"),n(p),i.locale=p}catch(p){q.error(J(p))}finally{i.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Pe,{value:i.locale,onChange:a,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ie,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=V,onDelete:o=V,onSave:s=V,onCancel:n=V,type:i="slack",url:a="",edit:l=!1}){const{t:p}=W(),r=G({type:i||"slack",url:a||"",edit:l??!1,error:"",loading:!1}),f=L(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),h=L(()=>{r.edit=!1,r.url=a||"",r.type=i||"slack",r.error="",r.loading=!1,n()}),m=L(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=L(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(m),sx:{mr:-1},children:e.jsx(O,{icon:Cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ie,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ie,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:cr})}),e.jsx($,{color:"error",onClick:h,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:dr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Sr})}),e.jsx($,{color:"error",onClick:()=>{o({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:kr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function se({title:t=void 0,description:o=void 0,value:s,onChange:n,isMobile:i}){const a=L(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:i?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:i?"normal":"nowrap"},children:[t,o]})]})}se.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:o}){const{t:s}=W(),n=G({showAdd:!1}),i=ee(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),a=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...i?.data?.notifications||{}}),[i?.data?.notifications]),l=R(()=>i?.data?.webhooks||[],[i?.data?.webhooks]),p=L(async v=>{try{await F.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),i.run()}catch(c){q.error(J(c))}}),r=L(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await F.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(J(c))}},h=L(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),m=L(async(v,c)=>{await p({webhooks:l.map((g,S)=>S===v?c:g)})}),C=L(async v=>{await p({webhooks:[...l,v]}),n.showAdd=!1});return i.error?e.jsx(Dt,{severity:"error",children:i.error.message}):i.loading||!i.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(se,{value:a.wallet,isMobile:o,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(ur,{did:Ne(t),showQrcode:!1,showAvatar:!o,copyable:!0,compact:!0,responsive:!0,startChars:o?2:6})}),e.jsx(se,{value:a.email,isMobile:o,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(se,{isMobile:o,value:a.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>h(c),onSave:(...g)=>m(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),n.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Pr}),onClick:()=>{n.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function ht({item:t}){const o=Me(),{blocklet:s}=Xt(),{confirmApi:n,confirmHolder:i}=Te(),a=G({loading:!1}),{t:l}=W(),{session:p}=y.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:h,baseUrl:m}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>pr[t?.provider]||"unknown",[t?.provider]),g=L(b=>b?._bind?b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY&&o.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&o.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=L(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,E)=>{n.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(z){C({session:p,connectedAccount:t}).then(b).catch(E),z()},onCancel:b})});return}try{a.loading=!0,await new Promise((b,E)=>{if(t?._bind)n.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(z){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(E),z()},onCancel:b});else if(t.provider===M.WALLET)n.open({title:l("userCenter.thirdPartyLogin.confirmBindWallet",{name:c}),content:l("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:l("common.cancel"),onConfirm:z=>{p.bindWallet({onSuccess:b,onCancel:E}),z()},onCancel:b});else{const z=m,U=window?.blocklet;let N="/";const j=xr(U),k=fr(U);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),h(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(E).finally(()=>{h(z),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{a.loading=!1}}),T=L(b=>b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):b?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=L(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(o.arcSphere||o.wallet)?!0:!!t._mainProvider,[o.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(er,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(qe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:tr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(qe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:b=>{const E=b.palette.error.main,z=b.palette.primary.main;return{color:t?._bind?E:z,borderColor:t?._bind?E:z,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?E:z,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:a.loading?null:e.jsx(O,{icon:Rr}),onClick:S,disabled:P(t),loading:a.loading,children:T(t)})})}),i]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:o}=y.use(xe),[s,n]=y.useState({}),{getOAuthConfigs:i}=o.useOAuth(),a=Me();ir(async()=>{const r=await i({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=hr(t);let f=!1,h="",m=gr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,h=M.GOOGLE,m===M.AUTH0&&(m=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,h=M.APPLE,m===M.AUTH0&&(m=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,h=M.GITHUB,m===M.AUTH0&&(m=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===h?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===m}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===m}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),a.wallet||a.arcSphere?null:e.jsx(rr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:o}){const[s,n]=y.useState(t),{t:i}=W(),a=L(async(l,p)=>{try{const r=await F.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});n(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(i("userCenter.saveSuccess")),o("privacy")}catch(r){q.error(J(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?a(l.key,f?"all":"private"):a(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;a(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:o}){const s=R(()=>(t?.passports||[])?.find(n=>n.name===o.role),[t?.passports,o?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:o.avatar,did:o.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ce,{title:o.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:o.fullName})}),e.jsx(je,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(Ce,{title:o.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ve=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new nr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:o=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:n,locale:i}=W();y.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const a=R(()=>o?{display:"flex",justifyContent:"flex-end"}:{},[o]);return e.jsx(x,{...o&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Fe,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{size:16,className:"ip-address",style:a,locale:i,children:t.lastLoginIp||n("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:u.object.isRequired,isMobile:u.bool};ze.defaultProps={isMobile:!1};function yt({user:t,showAction:o=!0,showUser:s=!0,getUserSessions:n,showOffline:i=!1}){const a=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=mr(),{t:r,locale:f}=W(),h=te({key:"md"}),m=pe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Te(),c=L(async()=>{const j=await n({page:a.page,pageSize:a.pageSize,status:a.status}),k=j?.paging?.total||0;return l[a.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const g=ee(c,{refreshDeps:[a.status,a.page,a.pageSize]}),S=R(()=>g.data?.list||[],[g.data?.list]),T=R(()=>{const{status:j}=a;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>ce({},h?Ze:{}),[h]),b=L(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await F.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=a,{list:D=[]}=g.data||{},K=D.length||0;k>1&&K===1&&(a.page=Math.max(k-1,1)),g.refresh(),C.close()}})}),E=L(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(a.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(a.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await F.user.logout({status:a.status,visitorId:p,includeFederated:!0}),a.page=1,g.refresh(),C.close()}})}),z=[];o&&z.push(e.jsx(Ce,{title:r("userCenter.logoutAllTips",{type:r(a.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:E,disabled:T,children:r("userCenter.logoutAll",{type:r(a.status)})})},"logoutAll"));const U=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:a.page-1,rowsPerPage:a.pageSize,count:g.data?.total||0}),[g.data?.total,a.page,a.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:ce({minWidth:150,maxWidth:250},h?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!i&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(ze,{userSession:k,isMobile:h})}}},o&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>b({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:h?"unset":m?"calc(100vw - 300px)":"100%",...h&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...h&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(br,{count:g.data?.total||0,data:S,columns:N,customButtons:z,options:U,locale:f,loading:g.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{a.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),i?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{a.page=j.page+1,a.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:o}=Te(),{t:s}=W(),{session:n}=y.use(xe),i=L(async()=>{if(!t||typeof t!="function")return;const a=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await a(),n.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:i,children:s("userCenter.dangerZone.delete")})]})}),o]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=te({key:"md"}),o=pe(i=>i.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=R(()=>ce({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":o?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:i=>`${i.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:n})})}function wt({onDestroySelf:t=void 0,userCenterTabs:o=[]}){const{t:s}=W(),{user:n,session:i,isMyself:a,isOwner:l}=fe(),r=Me().arcSphere,f=te({key:"md"}),h=ee(async()=>n&&a?await F.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,a],loadingDelay:300}),m=R(()=>o.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[o]),C=L(async c=>c==="privacy"?(await h.runAsync(),h.data):(c==="profile"&&await i.refresh(),null));y.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:n,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:n,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:n})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:m,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:n,showUser:!1,getUserSessions:c=>F.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,m,f,l,t]);return a?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:ce({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=y.createContext({}),{Provider:fn,Consumer:Ro}=jt;function Ct({children:t}){const[o]=y.useState(!1),{session:s}=y.use(xe),{user:n}=s,[i,a]=y.useState(),l=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{a(n?.didSpace)},[n?.didSpace]);const p=async()=>{a(void 0)},r=m=>{},f=async m=>{a(m),await r(m.endpoint)},h=!!(l&&i);return e.jsx(fn,{value:{loading:o,spaceGateway:i,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:h},children:t})}function Ee(){return y.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const o=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return le(o,"space",n)}function St({session:t,spaceGateway:o,spaceStatus:s,refresh:n}){return e.jsxs(Re,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(de,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:i=>{console.error(i),q.error(J(i))}}),e.jsx($,{size:"small",LinkComponent:$t,href:hn(o.endpoint),target:"_blank",children:e.jsx(Ft,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:o}=W(),{updateSpaceGateway:s,session:n}=Ee(),i=te(),a=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:o("userCenter.storage.spaces.connected.title")}),!i&&e.jsx(de,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:a})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:n,...l})},t.endpoint)}),i&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(de,{connectScope:"user",connectText:o("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:a})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:o,session:s}=Ee(),n=({spaceGateway:i})=>o(i);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(de,{session:s,onSuccess:n})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:o,loading:s}=Ee(),{isMyself:n}=fe();return n?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:o?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=X(x)`
122
- height: 100%;
123
- overflow-y: auto;
124
- `;function vn(){const{user:t,isMyself:o,viewUser:s}=fe(),{followed:n}=Ir();return e.jsx(x,{children:e.jsx(Dr,{teamDid:window?.blocklet?.did||"",user:o?t:s,showInvitees:o,followed:n})})}function wn({tab:t=""}){const{api:o}=or(),s=y.useRef(null),n=qt(),i=t||n.tab,l=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),p=sr(),r=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(h=>({...h,meta:{...h,did:h.did,name:h.name||h.title||"",logo:"logo.png"}}))})),f=async h=>{const{input:m,sessionId:C}=h;try{await o.destroySelf({input:{...m,sessionId:C}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(wr,{mode:"user-center",children:e.jsxs(Tr,{ref:s,embed:l==="1",currentTab:i?le(Ie.WELLKNOWN_SERVICE_PATH_PREFIX,"user",i):"",disableAutoRedirect:i==="settings",children:[i==="notifications"?e.jsx(rn,{blocklets:[r],context:p}):null,i==="nfts"?e.jsx(cn,{}):null,i==="settings"?e.jsx(wt,{onDestroySelf:f}):null,i==="did-spaces"?e.jsx(bn,{}):null,i==="user-followers"?e.jsx(vn,{}):null,i==="orgs"?e.jsx(Ar,{id:n.id||""}):null]})})}wn.propTypes={tab:u.string};export{wn as default};
@@ -1,55 +0,0 @@
1
- import{V as ee,H as O,a2 as X,ad as Ee,ae as Ue,af as We,ag as Ve,s as K,a9 as je,q as ke,B as Me,p as z,ah as _e,x as Ne,z as $e,A as Ie}from"./vendor-ux-CE4sOH7O.js";import{b as u,a as H,g as ae,c as He}from"./vendor-hooks-DmThWyyG.js";import{r as D}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as i,b6 as R,am as ce,y as B,z as F,Q as V,T as Y,I as le,a3 as oe,W as E,b1 as W,bb as qe,cb as Le,cE as Je,at as Fe,D as ye,ah as Be,cF as Oe,a6 as be,cG as Ze,a$ as Ke}from"./vendor-mui-core-BFPsXaTR.js";import{Z as N,ab as M,X as G,bg as se,c as ve,ba as Ge,aX as Ye,Y as Qe}from"./index-3yzleS_1.js";import{A as Z,Q as Xe,b as de,Z as et,n as Q,$ as tt,C as nt,a as st}from"./vendor-utils-OrZFrHBP.js";import{u as te,C as k,a as De}from"./index.esm-JPZAjt0x.js";import{S as ie}from"./switch-control-CRxlGq2g.js";import{S as y}from"./section-DOw43pby.js";import{d as ot}from"./keyboard-arrow-down-rounded-8U0_i9QO.js";import{u as at}from"./index-DlRa8Zeh.js";import{v as it}from"./index-IGBGBXd_.js";import{r as rt}from"./base32-Cg02gOuu.js";import{u as lt}from"./use-mobile-DLnLSQQq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DGOH9a3F.js";import"./required-BPzIdi1N.js";const we={width:24,height:24,body:'<path fill="currentColor" d="M5 4v16V4v5v-5Zm3 10h2.675q.275-.575.638-1.075t.812-.925H8q-.425 0-.713.288T7 13q0 .425.288.713T8 14Zm0 4h2.075Q10 17.5 10 17t.075-1H8q-.425 0-.713.288T7 17q0 .425.288.713T8 18Zm-3 4q-.825 0-1.413-.588T3 20V4q0-.825.588-1.413T5 2h7.175q.4 0 .763.15t.637.425l4.85 4.85q.275.275.425.638t.15.762V10.3q-.475-.15-.975-.225T17 10V9h-4q-.425 0-.713-.288T12 8V4H5v16h5.675q.275.575.638 1.075t.812.925H5Zm12-10q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12Zm0 8q.275 0 .463-.188t.187-.462q0-.275-.187-.463T17 18.7q-.275 0-.463.188t-.187.462q0 .275.188.463T17 20Zm0-6q-.475 0-.875.238t-.65.637q-.1.15-.025.313t.25.237q.15.075.3 0t.275-.2q.125-.175.313-.275t.412-.1q.325 0 .563.213t.237.537q0 .275-.15.463t-.35.387q-.15.15-.313.3t-.287.35q-.075.15-.113.313t-.037.337q0 .225.125.413t.325.187q.2 0 .325-.15t.125-.35q0-.275.15-.488t.35-.412q.3-.275.525-.613t.225-.737q0-.675-.5-1.138T17 14Z"/>'},ue={enabled:!1,domain:"",clientId:"",clientSecret:""};function ct(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...ue},c?.settings?.oauth?.auth0||{}),{handleSubmit:x,control:a,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(ue))}),l=d("enabled"),j=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({auth0:s})}}),L=Object.assign({...ue},I?.settings?.oauth?.auth0||{});f(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),v=u(s=>s?.trim()?!0:t("oauth.auth0.domainDescription")),S=u(s=>s?.trim()?!0:t("oauth.auth0.clientIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.auth0.clientSecretDescription")),w=u(()=>!0),h=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[n]);return e.jsx(i,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.auth0.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(i,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:h,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:a,render:({field:s})=>e.jsx(R,{control:e.jsx(ie,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.auth0.domain"),children:e.jsx(k,{name:"domain",control:a,rules:{validate:l?v:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.domain"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientId"),children:e.jsx(k,{name:"clientId",control:a,rules:{validate:l?S:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.auth0.clientId"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.auth0.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:a,rules:{validate:l?g:w},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.auth0.clientSecret"),error:!!p.errors[s.name],helperText:p.errors[s.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const he={enabled:!1,clientId:"",clientSecret:""};function dt(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...he},c?.settings?.oauth?.github||{}),{handleSubmit:x,control:a,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(he))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({github:h})}}),I=Object.assign({...he},s?.settings?.oauth?.github||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.github.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.github.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[n]);return e.jsx(i,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.github.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(i,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:a,sx:{alignItems:"center"},render:({field:h})=>e.jsx(R,{control:e.jsx(ie,{sx:{ml:1},size:"small",checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.github.clientId"),children:e.jsx(k,{name:"clientId",control:a,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.github.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.github.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:a,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.github.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const me={enabled:!1,clientId:"",clientSecret:""};function ut(){const{api:b}=N(),{blocklet:c}=M(),{t,locale:n}=ee(),o=c?.meta?.did,r=Object.assign({...me},c?.settings?.oauth?.google||{}),{handleSubmit:x,control:a,formState:p,watch:d,reset:f}=te({defaultValues:Z(r,Object.keys(me))}),l=d("enabled"),j=u(async h=>{try{const{blocklet:s}=await b.configOAuth({input:{did:o,oauth:JSON.stringify({google:h})}}),I=Object.assign({...me},s?.settings?.oauth?.google||{});f(I),O.success(t("oauth.saveSuccess"))}catch(s){O.error(s.message||t("oauth.saveFailed"))}}),v=u(h=>h?.trim()?!0:t("oauth.google.clientIdDescription")),S=u(h=>h?.trim()?!0:t("oauth.google.clientSecretDescription")),g=u(()=>!0),w=H(()=>n==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[n]);return e.jsx(i,{children:e.jsxs("form",{onSubmit:x(j),disabled:!0,children:[e.jsx(y,{title:e.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx("span",{children:t("oauth.google.enable")}),e.jsx(ce,{title:t("oauth.viewDocument"),children:e.jsx(i,{component:"a",sx:{display:"inline-block",color:"inherit",fontSize:0,lineHeight:1},href:w,target:"_blank",rel:"noreferrer",children:e.jsx(X,{icon:we,fontSize:20})})})]}),mb:2.5,children:e.jsx(k,{name:"enabled",control:a,render:({field:h})=>e.jsx(R,{control:e.jsx(ie,{sx:{ml:1},checked:h.value,...h})})})}),e.jsx(y,{title:t("oauth.google.clientId"),children:e.jsx(k,{name:"clientId",control:a,rules:{validate:l?v:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",label:t("oauth.google.clientId"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(y,{title:t("oauth.google.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:a,rules:{validate:l?S:g},render:({field:h})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...h,size:"small",type:"password",label:t("oauth.google.clientSecret"),error:!!p.errors[h.name],helperText:p.errors[h.name]?.message||" ",disabled:!l})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:x(j),disabled:!p.isDirty,children:t("oauth.save")})]})})}const pe={enabled:!1,teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function ht(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...pe},c?.settings?.oauth?.apple||{}),{handleSubmit:r,control:x,formState:a,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(pe))}),f=p("enabled"),l=u(async s=>{try{const{blocklet:I}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({apple:s})}}),L=Object.assign({...pe},I?.settings?.oauth?.apple||{});d(L),O.success(t("oauth.saveSuccess"))}catch(I){O.error(I.message||t("oauth.saveFailed"))}}),j=u(s=>s?.trim()?!0:t("oauth.apple.teamIdDescription")),v=u(s=>s?.trim()?!0:t("oauth.apple.serviceIdDescription")),S=u(s=>s?.trim()?!0:t("oauth.apple.keyIdDescription")),g=u(s=>s?.trim()?!0:t("oauth.apple.authKeyDescription")),w=u(s=>s?.trim()?!0:t("oauth.apple.bundleIdDescription")),h=u(()=>!0);return e.jsx(i,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:t("oauth.apple.enable"),mb:2.5,children:e.jsx(k,{name:"enabled",control:x,render:({field:s})=>e.jsx(R,{control:e.jsx(ie,{sx:{ml:1},checked:s.value,...s})})})}),e.jsx(y,{title:t("oauth.apple.teamId"),children:e.jsx(k,{name:"teamId",control:x,rules:{validate:f?j:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.teamId"),error:!!a.errors[s.name],helperText:a.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.bundleId"),children:e.jsx(k,{name:"bundleId",control:x,rules:{validate:f?w:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.bundleId"),error:!!a.errors[s.name],helperText:a.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.serviceId"),children:e.jsx(k,{name:"serviceId",control:x,rules:{validate:f?v:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.serviceId"),error:!!a.errors[s.name],helperText:a.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.keyId"),children:e.jsx(k,{name:"keyId",control:x,rules:{validate:f?S:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",label:t("oauth.apple.keyId"),error:!!a.errors[s.name],helperText:a.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.apple.authKey"),children:e.jsx(k,{name:"authKey",control:x,rules:{validate:f?g:h},render:({field:s})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...s,size:"small",type:"password",label:t("oauth.apple.authKey"),multiline:!0,rows:4,error:!!a.errors[s.name],helperText:a.errors[s.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!a.isDirty,children:t("oauth.save")})]})})}const xe={enabled:!1,clientId:"",clientSecret:""};function mt(){const{api:b}=N(),{blocklet:c}=M(),{t}=ee(),n=c?.meta?.did,o=Object.assign({...xe},c?.settings?.oauth?.twitter||{}),{handleSubmit:r,control:x,formState:a,watch:p,reset:d}=te({defaultValues:Z(o,Object.keys(xe))}),f=p("enabled"),l=u(async g=>{try{const{blocklet:w}=await b.configOAuth({input:{did:n,oauth:JSON.stringify({twitter:g})}}),h=Object.assign({...xe},w?.settings?.oauth?.twitter||{});d(h),O.success(t("oauth.saveSuccess"))}catch(w){O.error(w.message||t("oauth.saveFailed"))}}),j=u(g=>g?.trim()?!0:t("oauth.twitter.clientIdDescription")),v=u(g=>g?.trim()?!0:t("oauth.twitter.clientSecretDescription")),S=u(()=>!0);return e.jsx(i,{children:e.jsxs("form",{onSubmit:r(l),disabled:!0,children:[e.jsx(y,{title:e.jsx(i,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:t("oauth.twitter.enable")})}),mb:2.5,sx:{"& .section-content":{alignItems:"center"}},children:e.jsx(k,{name:"enabled",control:x,sx:{alignItems:"center"},render:({field:g})=>e.jsx(R,{control:e.jsx(ie,{sx:{ml:1},size:"small",checked:g.value,...g})})})}),e.jsx(y,{title:t("oauth.twitter.clientId"),children:e.jsx(k,{name:"clientId",control:x,rules:{validate:f?j:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",label:t("oauth.twitter.clientId"),error:!!a.errors[g.name],helperText:a.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(y,{title:t("oauth.twitter.clientSecret"),children:e.jsx(k,{name:"clientSecret",control:x,rules:{validate:f?v:S},render:({field:g})=>e.jsx(B,{fullWidth:!0,children:e.jsx(F,{...g,size:"small",type:"password",label:t("oauth.twitter.clientSecret"),error:!!a.errors[g.name],helperText:a.errors[g.name]?.message||" ",disabled:!f})})})}),e.jsx(V,{type:"submit",variant:"contained",onSubmit:r(l),disabled:!a.isDirty,children:t("oauth.save")})]})})}const pt={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Re({id:b,title:c,children:t,index:n,onMove:o,defaultExpand:r=!1,onEnd:x,icon:a=null}){const[p,d]=D.useState(r),f=D.useRef(null),l=D.useRef(null),[{handlerId:j},v]=Ee({accept:"dragItem",collect(s){return{handlerId:s.getHandlerId()}},hover(s,I){if(!f.current)return;const L=s.index,m=n;if(L===m)return;const A=f.current?.getBoundingClientRect(),_=l.current?.getBoundingClientRect(),re=(_.bottom-_.top)/2,$=I.getClientOffset().y-A.top;L<m&&$<re||L>m&&$>re||(o(L,m),s.index=m)}}),[{isDragging:S},g]=Ue({item:{index:n,type:"dragItem"},collect:s=>({isDragging:s.isDragging()}),end:x});g(l),v(f);const w=S?.5:1,h=u(s=>{s.preventDefault(),s.stopPropagation(),d(!p)});return e.jsxs(i,{ref:f,children:[e.jsxs(i,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:l,"data-handler-id":j,children:[e.jsxs(i,{sx:{py:2,px:1,opacity:w,display:"flex",alignItems:"center",gap:.5},draggable:!1,onClick:h,children:[e.jsx(i,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(X,{fontSize:20,icon:pt})}),e.jsx(i,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:a}),e.jsx(Y,{sx:{flex:1},children:c}),e.jsx(le,{size:"small",sx:{pointerEvents:"auto",transform:p?"":"rotate(180deg)",transition:"transform 0.3s ease"},children:e.jsx(X,{icon:ot,style:{transform:"scale(1.5)"}})})]}),e.jsx(oe,{})]}),e.jsx(i,{sx:{pl:4,py:2.5,display:p?"block":"none"},children:t})]})}Re.propTypes={title:E.string.isRequired,id:E.string.isRequired,children:E.node.isRequired,index:E.number.isRequired,onMove:E.func.isRequired,onEnd:E.func.isRequired,defaultExpand:E.bool,icon:E.any};const xt=[{name:"github",title:G.PROVIDER_NAME.github,icon:e.jsx(se,{provider:"github",sx:{width:20,height:20}}),component:e.jsx(dt,{})},{name:"google",title:G.PROVIDER_NAME.google,icon:e.jsx(se,{provider:"google",sx:{width:20,height:20}}),component:e.jsx(ut,{})},{name:"apple",title:G.PROVIDER_NAME.apple,icon:e.jsx(se,{provider:"apple",sx:{width:20,height:20}}),component:e.jsx(ht,{})},{name:"twitter",title:G.PROVIDER_NAME.twitter,icon:e.jsx(se,{provider:"twitter",sx:{width:20,height:20}}),component:e.jsx(mt,{})},{name:"auth0",title:G.PROVIDER_NAME.auth0,icon:e.jsx(se,{provider:"auth0",sx:{width:20,height:20}}),component:e.jsx(ct,{})}],ft=["github","google","apple","twitter","auth0"];function gt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=c?.settings?.oauth||{},o=Object.keys(n).sort((l,j)=>n[l]?.order!==void 0&&n[j]?.order!==void 0?n[l].order-n[j].order:n[l]?.order!==void 0?-1:1);for(const l of ft)o.includes(l)||o.push(l);const r=ae(o.reduce((l,j,v)=>Object.assign(l,{[j]:v}),{})),x=H(()=>{const l=[...xt];return l.sort((j,v)=>r[j.name]-r[v.name]),l.map(j=>({...j,enabled:n[j.name]?.enabled??!1}))},[r.auth0,r.github,r.google]),a={};typeof window<"u"&&(a.context=window);const p=u(async l=>{const j={};Object.keys(l).forEach(v=>{j[v]={order:l[v]}}),await b.configOAuth({input:{did:t,oauth:JSON.stringify(j)}})}),d=u((l,j)=>{const v=x[l],S=x[j];r[v.name]=j,r[S.name]=l}),f=u(async()=>{await p(r)});return e.jsx(i,{sx:{".section-left":{width:"180px"}},children:e.jsx(We,{backend:Ve,...a,children:x.map((l,j)=>e.jsx(Re,{index:j,id:l.name,title:l.title,icon:l.icon,onMove:d,onEnd:f,defaultExpand:l.enabled,children:l.component},l.name))})})}const J={ttl:ve.SESSION_TTL,cacheTtl:ve.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function U(b){return e.jsx(at,{...b,sx:{transform:"scale(0.75)"}})}function fe(b,c=!1){const t=c?b.ttl*86400:b.ttl/86400;return{...b,ttl:t}}function jt(){const{api:b}=N(),{blocklet:c}=M(),t=c?.meta?.did,n=Xe({},J,c?.settings?.session||{});de(n.ttl)&&(n.ttl=J.ttl),de(n.cacheTtl)&&(n.cacheTtl=J.cacheTtl),n.phone||(n.phone=J.phone),n.email||(n.email=J.email),de(n.enableBlacklist)&&(n.enableBlacklist=J.enableBlacklist);const{handleSubmit:o,control:r,formState:x,reset:a,watch:p}=te({defaultValues:Z(fe(n),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:d}=ee(),f=p("email.enabled"),l=p("phone.enabled"),j=p("email.enableDomainBlackList"),v=p("email.enableDomainWhiteList"),{fields:S,append:g,remove:w}=De({control:r,name:"email.domainBlackList"}),{fields:h,append:s,remove:I}=De({control:r,name:"email.domainWhiteList"}),L=u(async m=>{try{const{blocklet:A}=await b.updateAppSessionConfig({input:{did:t,config:et(fe(m,!0),["phone"])}}),_=Object.assign({},J,Z(A?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));a(fe(_)),O.success(d("common.configSuccess"))}catch(A){O.error(A.message)}});return e.jsx(bt,{onSubmit:o(L),children:e.jsxs(W,{direction:"column",sx:{gap:6},children:[e.jsxs(i,{children:[e.jsxs(i,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.profile")}),e.jsx(i,{component:oe,sx:{my:3}})]}),e.jsxs(W,{sx:{gap:2},children:[e.jsx(y,{title:d("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(U,{disabled:!0,checked:!0})})}),e.jsx(y,{title:d("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enabled",control:r,render:({field:m})=>e.jsx(U,{...m,checked:m.value})})})}),f&&e.jsxs(W,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(y,{title:d("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.trustOauthProviders",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainBlackList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),j&&e.jsxs(i,{children:[S.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainBlackList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>w(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>g(""),children:d("blocklet.config.session.addDomain")})]}),e.jsx(y,{title:d("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"email.enableDomainWhiteList",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),v&&e.jsxs(i,{children:[h.map((m,A)=>e.jsxs(W,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(k,{name:`email.domainWhiteList.${A}`,control:r,render:_=>e.jsx(F,{..._.field,size:"small",fullWidth:!0})}),e.jsx(le,{onClick:()=>I(A),children:e.jsx(qe,{})})]},m.id)),e.jsx(V,{startIcon:e.jsx(Le,{}),onClick:()=>s(""),children:d("blocklet.config.session.addDomain")})]})]}),e.jsxs(i,{sx:{display:"none"},children:[e.jsx(y,{title:d("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.enabled",control:r,disabled:!0,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),l&&e.jsxs(W,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(y,{title:d("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireVerified",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})}),e.jsx(y,{title:d("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"phone.requireUnique",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})]})]})]})]}),e.jsxs(i,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.period")}),e.jsx(i,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(k,{name:"ttl",control:r,rules:{min:1,max:30},render:({field:m})=>e.jsx(B,{fullWidth:!0,sx:{mb:2},children:e.jsx(y,{title:d("blocklet.config.session.ttl",{day:m.value}),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(Je,{...m,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(i,{children:[e.jsx(Y,{variant:"h6",sx:{fontWeight:600},children:d("blocklet.config.session.experimentalSettings")}),e.jsx(i,{component:oe,sx:{my:3}}),e.jsx(W,{direction:"column",spacing:2,children:e.jsx(y,{title:d("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(i,{sx:{alignSelf:"flex-start"},children:e.jsx(k,{name:"enableBlacklist",control:r,render:({field:m})=>e.jsx(R,{sx:{ml:0},control:e.jsx(U,{...m,checked:m.value})})})})})})]}),e.jsx(i,{children:e.jsx(V,{type:"submit",variant:"contained",disabled:!x.isDirty,children:d("oauth.save")})})]})})}const bt=Fe.form`
2
- max-width: 1536px;
3
-
4
- .advanced-config {
5
- border: 0;
6
- padding: 0;
7
- }
8
-
9
- .config-form {
10
- flex-grow: 1;
11
- overflow-y: auto;
12
- will-change: transform;
13
-
14
- &:first-child {
15
- margin: 0;
16
- }
17
-
18
- ${b=>b.theme.breakpoints.down("md")} {
19
- width: 100%;
20
- flex-shrink: 0;
21
- padding: 0 24px;
22
- transform: translate(0, 0);
23
- }
24
- }
25
-
26
- .config-item {
27
- display: flex;
28
- align-items: center;
29
- justify-content: space-between;
30
- }
31
-
32
- .config-desc {
33
- font-weight: normal;
34
- font-size: 12px;
35
- color: #666;
36
- }
37
-
38
- .form-item {
39
- margin-top: 0;
40
- }
41
- `,vt={width:24,height:24,body:'<path fill="currentColor" d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.713T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.713-.288T4 19q0-.425.288-.713T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.013.75t-.487.575q-1.45.8-2.313 2.213T6 12.05Zm12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.713-.288T14 9V5q0-.425.288-.713T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95Z"/>'};var ge,Ce;function kt(){if(Ce)return ge;Ce=1;const{DEFAULT_IP_DOMAIN_SUFFIX:b,SLOT_FOR_IP_DNS_SITE:c,DEFAULT_DID_DOMAIN:t}=Ge(),{encode:n}=rt();return ge={getIpDnsDomainForBlocklet:x=>`${n(x.meta.did)}-${c}.${b}`,getDidDomainForBlocklet:({did:x,didDomain:a=t})=>`${n(x)}.${a}`},ge}var yt=kt();function Ae({ref:b=null}){const{t:c}=D.useContext(K),{blocklet:t}=M(),{api:n}=N(),o=ae({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:Q}),x=ye()?.transitions?.duration?.leavingScreen||300,a=u(()=>{o.mode="view",o.data={},o.callback=Q}),p=u(()=>{o.show=!1,setTimeout(()=>{a()},x)}),d=u(g=>{o.mode="view",o.show=!0,o.data=g}),f=u((g,w=Q)=>{o.mode="approve",o.show=!0,o.data=g,o.callback=w});D.useImperativeHandle(b,()=>({open:d,close:p,approve:f}),[d,p,f]);const l=H(()=>{if(!o.show)return[];o.data.migratedFrom=[o.data.appId,o.data.appPid];const g=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return o.data.isMaster!==!1&&tt(g,"appliedAt","status"),g.map(w=>{const h=c(`federated.info.${w}`);let s=o.data[w];if(w==="appName"&&o.data.isMaster&&(s=e.jsxs(i,{children:[e.jsx(Be,{component:Oe}),s]})),["appId","appPid","serverId"].includes(w)&&(s=e.jsx(je,{children:s})),["appUrl"].includes(w)&&(s=e.jsx(i,{component:"a",href:s,target:"_blank",children:s})),["appLogo"].includes(w)){const I=nt(`https://${yt.getDidDomainForBlocklet({did:o.data.appPid})}`,ve.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo");try{const L=new URL(I);L.searchParams.set("imageFilter","resize"),L.searchParams.set("w","80"),L.searchParams.set("h","80"),s=e.jsx("img",{src:L.href,width:"60",height:"60",alt:o.data.appName})}catch{s=e.jsx("img",{src:I,width:"60",height:"60",alt:o.data.appName})}}return w==="status"&&(s=s&&c(`federated.status.${s}`)),w==="migratedFrom"&&(s=(o.data.migratedFrom||[]).filter(m=>![o.data.appId,o.data.appPid].includes(m)).map(m=>e.jsx(je,{children:m}))),st(s)&&(s="-"),{name:h,value:s}})},[o.data]),j=o.mode==="approve",v=u(async()=>{try{o.loadingReject=!0,await n.auditFederatedLogin({input:{memberPid:o.data.appPid,did:t.appPid,status:"rejected"}}),p(),o?.callback(!1)}finally{o.loadingReject=!1}}),S=u(async()=>{try{o.loadingApprove=!0,await n.auditFederatedLogin({input:{memberPid:o.data.appPid,did:t.appPid,status:"approved"}}),p(),o?.callback(!0)}finally{o.loadingApprove=!1}});return e.jsx(ke,{open:o.show,title:c(j?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:p,actions:j?e.jsxs(e.Fragment,{children:[e.jsxs(V,{color:"error",variant:"contained",onClick:v,disabled:o.loadingReject,children:[o.loadingReject?e.jsx(be,{size:16,color:"grey"}):null,c("common.reject")]}),e.jsxs(V,{variant:"contained",onClick:S,disabled:o.loadingApprove,children:[o.loadingApprove?e.jsx(be,{size:16,color:"grey"}):null,c("common.approve")]})]}):e.jsx(V,{variant:"outlined",onClick:p,children:c("common.close")}),children:l.map(g=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:g.name,children:g.value},g.name))})}Ae.propTypes={ref:E.any};function Se({ref:b=null}){const t=ye()?.transitions?.duration?.leavingScreen||300,{t:n}=D.useContext(K),o=ae({show:!1,data:{link:""}}),r=u(()=>{o.data.link=""}),x=u(()=>{o.show=!1,setTimeout(()=>{r()},t)}),a=u(({link:d})=>{o.show=!0,o.data.link=d});D.useImperativeHandle(b,()=>({open:a,close:x}),[a,x]);const p=u(()=>{He(o.data.link),x()});return e.jsxs(ke,{open:o.show,title:n("federated.joinFederatedLogin"),onClose:x,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:p,children:n("common.copyAndClose")}),children:[e.jsx(i,{sx:{mb:1},children:n("federated.inviteJoinFederatedLoginDescription")}),e.jsx(i,{sx:{"& .copy-button":{display:"none !important"}},children:e.jsx(Me,{language:"shell",style:{marginBottom:0},children:o.data.link})})]})}Se.propTypes={ref:E.any};function Pe({mode:b="member"}){const c=D.useRef(null),t=D.useRef(null),{t:n,locale:o}=D.useContext(K),{blocklet:r,actions:{refreshBlocklet:x}}=M(),{confirmApi:a,confirmHolder:p}=Ye(),{api:d}=N(),f=r.settings.federated?.sites||[],l=r.settings.federated?.config||{},j=l.isMaster!==!1,v=f.find(T=>T.appPid===r.appPid),S=ae({loadingSync:!1}),g=u(T=>{t.current?.open(T)}),w=u(T=>{t.current?.approve(T,x)}),h=u(T=>{a.open({title:n("federated.removeFederatedLogin"),content:n("federated.removeFederatedLoginDescription"),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(C){await d.quitFederatedLogin({input:{did:r.appPid,targetDid:T.appPid}}),C()}})}),s=u(T=>{a.open({title:n("federated.disableFederatedLogin"),content:n("federated.disableFederatedLoginDescription"),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(C){await d.auditFederatedLogin({input:{memberPid:T.appPid,did:r.appPid,status:"revoked"}}),C()}})}),I=u(T=>{a.open({title:n("federated.enableFederatedLogin"),content:n("federated.enableFederatedLoginDescription"),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),async onConfirm(C){await d.auditFederatedLogin({input:{memberPid:T.appPid,did:r.appPid,status:"approved"}}),C()}})}),L=H(()=>{const T=[{label:n("common.name"),name:"appName",options:{customBodyRenderLite:C=>{const q=f[C],ne=q.isMaster!==!1;return e.jsx(i,{sx:{display:"inline-block"},children:e.jsxs(i,{component:"a",href:q.appUrl,target:"_blank",onClick:P=>{P.stopPropagation()},sx:{display:"flex",alignItems:"center"},children:[ne&&e.jsx(Be,{component:Oe,style:{marginRight:"4px"}}),q.appName]})})}}},{label:n("common.did"),name:"appId",options:{customBodyRenderLite:C=>{const q=f[C];return e.jsx(je,{children:q.appId})}}},{label:n("common.status"),name:"status",options:{customBodyRenderLite:C=>{const q=f[C],ne=q.isMaster!==!1;return e.jsx(i,{children:ne?"-":n(`federated.status.${q.status}`)})}}}];return j&&T.push({label:n("common.actions"),name:"actions",options:{customBodyRenderLite:C=>{const q=f[C],ne=q.isMaster!==!1;return e.jsx(i,{sx:{display:"flex",gap:1},children:ne?e.jsxs(e.Fragment,{children:[q.status==="rejected"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:P=>{P.stopPropagation()},children:n("federated.status.rejected")}),q.status==="revoked"&&e.jsx(z,{variant:"contained",color:"secondary",size:"small",onClick:P=>{P.stopPropagation()},children:n("federated.status.revoked")})]}):e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:P=>{P.stopPropagation(),h(q)},children:n("federated.quitMember")},"quiteSite"),q.status==="pending"&&e.jsx(z,{variant:"contained",color:"primary",size:"small",onClick:P=>{P.stopPropagation(),w(q)},children:n("federated.status.pending")},"auditSite"),q.status==="approved"&&e.jsx(z,{variant:"contained",color:"error",size:"small",onClick:P=>{P.stopPropagation(),s(q)},style:{whiteSpace:"nowrap"},children:n("federated.revoke")},"revokeSite"),q.status==="revoked"&&e.jsx(z,{variant:"contained",color:"warning",size:"small",onClick:P=>{P.stopPropagation(),I(q)},style:{whiteSpace:"nowrap"},children:n("federated.approve")},"approveSite")]})})}}}),T},[l.appId,f,j,n]),m=H(()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(T,{dataIndex:C}){const q=f[C];g(q)}}),[]),A=u(()=>{const T=r.environments.find(C=>C.key===G.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);T?.value?c.current?.open({link:T.value}):O.error(n("federated.failedToGetFederatedLoginLink"))},[r.site?.domainAliases?.[0]?.href]),_=u(()=>{a.open({title:n("federated.quitFederatedLogin"),content:n("federated.quitFederatedLoginDescription"),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(T){await d.quitFederatedLogin({input:{did:r.appPid}}),T()}})}),re=u(()=>{a.open({title:n("federated.disbandFederatedLogin"),content:n("federated.disbandFederatedLoginDescription"),confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(T){await d.disbandFederatedLogin({input:{did:r.appPid}}),T()}})}),Te=u(async()=>{try{S.loadingSync=!0,await Promise.all([await d.syncFederatedConfig({input:{did:r.appPid}}),_e(500)]),O.success(n("common.succeeded"))}finally{S.loadingSync=!1}}),$=[];return v.status!=="pending"&&$.push(e.jsx(ce,{title:n("federated.syncConfig"),children:e.jsx(le,{size:"small",onClick:Te,disabled:S.loadingSync,sx:[{"@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},S.loadingSync?{animation:"spin 1s linear infinite"}:{}],children:e.jsx(X,{icon:vt,style:{fontSize:24}})},"syncConfig")})),b==="master"?($.push(e.jsx(z,{size:"small",variant:"contained",onClick:A,sx:{ml:1},children:n("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),$.push(e.jsx(z,{color:"error",size:"small",variant:"contained",onClick:re,sx:{ml:1},children:n("federated.disbandFederatedLogin")},"disbandFederatedLogin"))):$.push(e.jsx(z,{size:"small",variant:"contained",color:"error",onClick:_,sx:{ml:1},children:n("federated.quitFederatedLogin")},"quitFederatedLogin")),e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"main-table",locale:o,data:f,columns:L,customButtons:$,title:e.jsx(i,{className:"table-toolbar-left",children:n("oauth.federated")}),options:m}),p,e.jsx(Se,{ref:c}),e.jsx(Ae,{ref:t})]})}Pe.propTypes={mode:E.oneOf(["member","master"])};function ze({ref:b=null}){const{t:c}=D.useContext(K),{api:t}=N(),{blocklet:n}=M(),o=n?.appPid,x=ye()?.transitions?.duration?.leavingScreen||300,a=ae({loading:!1,show:!1,appUrl:"",appUrlError:"",callback:Q}),p=u(()=>{a.appUrl="",a.appUrlError="",a.callback=Q}),d=u(()=>{a.show=!1,setTimeout(()=>{p()},x)}),f=u((v=Q)=>{a.show=!0,a.callback=v});D.useImperativeHandle(b,()=>({open:f,close:d}),[f,d]);const l=u(v=>{if(!v)throw new Error(c("federated.federatedJoinAppUrlRequired"));if(!Qe(v))throw new Error(c("federated.federatedJoinAppUrlInvalid"))}),j=u(async()=>{try{l(a.appUrl),a.loading=!0;const v=await t.joinFederatedLogin({input:{did:o,appUrl:a.appUrl}});a.show=!1,d(),a?.callback(v)}catch(v){a.appUrlError=v.message}finally{a.loading=!1}});return e.jsxs(ke,{open:a.show,title:c("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:e.jsxs(z,{color:"primary",autoFocus:!0,variant:"contained",onClick:j,disabled:a.loading,children:[a.loading?e.jsx(be,{size:16,sx:{mr:1},color:"grey"}):null,c("common.confirm")]}),children:[e.jsx(i,{sx:{mb:1},children:c("federated.joinFederatedLoginDescription")}),e.jsx(F,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:c("federated.federatedJoinAppUrl"),label:c("federated.federatedJoinAppUrl"),value:a.appUrl,error:!!a.appUrlError,helperText:a.appUrlError||"eg: https://www.arcblock.io",onChange:v=>{a.appUrl=v.target.value}})]})}ze.propTypes={ref:E.any};function wt(){const{t:b}=D.useContext(K);return e.jsxs(W,{direction:"row",spacing:2,sx:{alignItems:"flex-start",p:2},children:[e.jsx(Ze,{fontSize:"large",color:"primary"}),e.jsxs(i,{children:[e.jsx(Y,{variant:"h6",gutterBottom:!0,children:b("federated.title")}),e.jsx(Y,{variant:"body2",sx:{color:"text.secondary"},children:b("federated.description")}),e.jsx(Ke,{href:"https://www.arcblock.io/blog/zh/did-connect-federated-login-support",underline:"hover",variant:"body2",color:"primary",target:"_blank",sx:{display:"inline-flex",alignItems:"center",mt:1},children:b("federated.link")})]})]})}function St(){const b=D.useRef(null),c=D.useRef(null),{t}=D.useContext(K),{blocklet:n,actions:{refreshBlocklet:o}}=M(),r=u(()=>{const a=n.site?.domainAliases?.[0]?.href;if(a)try{const p=new URL(a);b.current?.open({link:p.origin})}catch{O.error(t("federated.failedToGetFederatedLoginLink"))}},[n.site?.domainAliases?.[0]?.href]),x=u(()=>{c.current?.open(()=>{o()})});if(n.settings.federated?.sites.length>0){const a=n.settings.federated?.config.isMaster!==!1;return e.jsx(Pe,{mode:a?"master":"member"})}return e.jsxs(e.Fragment,{children:[e.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px"},children:e.jsxs(i,{sx:{maxWidth:400,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(wt,{}),e.jsx(oe,{sx:{width:1}}),e.jsxs(W,{sx:{width:1,p:2,gap:1.5},children:[e.jsx(z,{variant:"contained",onClick:r,sx:{width:1},children:t("federated.inviteJoinFederatedLogin")}),e.jsx(z,{variant:"outlined",onClick:x,sx:{width:1},children:t("federated.joinFederatedLogin")})]})]})}),e.jsx(Se,{ref:b}),e.jsx(ze,{ref:c})]})}function Tt({orientation:b="horizontal"}){const{t:c}=D.useContext(K),t=lt({key:"lg"}),n=[{label:e.jsx(i,{sx:{textAlign:"center",width:"100%"},children:c("oauth.commonSettings")}),value:"settings"},{label:e.jsx(i,{sx:{textAlign:"center",width:"100%"},children:c("oauth.federated")}),value:"federated"},{label:e.jsx(i,{sx:{textAlign:"center",width:"100%"},children:c("oauth.oauth")}),value:"oauth"},{label:e.jsx(i,{sx:{textAlign:"center",width:"100%"},children:c("oauth.moreLogin")}),value:"more"}],[o,r]=D.useState(n[0].value),x=H(()=>({oauth:e.jsx(gt,{}),federated:e.jsx(St,{}),more:e.jsx($e,{children:c("oauth.comingSoon")}),settings:e.jsx(jt,{})}),[c]);return b==="vertical"?e.jsx(It,{children:e.jsxs(W,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(i,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(Ie,{tabs:n,current:o,orientation:t?"horizontal":"vertical",onChange:r,sx:{borderRight:t?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(i,{sx:{flexGrow:1,minWidth:0},children:e.jsx(i,{sx:{maxWidth:"1200px"},children:x[o]})})]})}):e.jsxs(i,{children:[e.jsx(Ie,{tabs:n,current:o,onChange:r}),e.jsx(i,{sx:{marginTop:"10px"},children:x[o]})]})}Tt.propTypes={orientation:E.oneOf(["horizontal","vertical"])};const It=Fe.div`
42
- .MuiTab-root {
43
- text-align: left;
44
- align-items: flex-start;
45
- font-weight: normal;
46
-
47
- div {
48
- text-align: left;
49
- }
50
- }
51
-
52
- .Mui-selected {
53
- font-weight: bold;
54
- }
55
- `;export{Tt as default};