@abtnode/blocklet-services 1.16.44-beta-20250529-223630-10e16ac8 → 1.16.44-beta-20250603-231026-30a9d27f

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 (252) hide show
  1. package/api/index.js +14 -14
  2. package/api/libs/connect/session.js +1 -1
  3. package/api/libs/email.js +3 -1
  4. package/api/routes/blocklet.js +3 -1
  5. package/api/routes/openapi.js +1 -1
  6. package/api/routes/opencomponent.js +1 -1
  7. package/api/routes/openembed.js +1 -1
  8. package/api/services/dashboard/index.js +8 -0
  9. package/api/services/static.js +39 -7
  10. package/api/util/attach-shared-utils.js +5 -4
  11. package/dist/assets/AdapterDayjs-eMGLd9qK.js +3 -0
  12. package/dist/assets/{ArrowDropDown-DPqiF9Rw.js → ArrowDropDown-QAD1r6CI.js} +1 -1
  13. package/dist/assets/{CheckCircle-Caqp5gKY.js → CheckCircle-DKl6wFCW.js} +1 -1
  14. package/dist/assets/{ChevronLeft-DONyUbIg.js → ChevronLeft-BTvoFtZ-.js} +1 -1
  15. package/dist/assets/{ChevronRight-DgAwWLdY.js → ChevronRight-CB-tzzK0.js} +1 -1
  16. package/dist/assets/{Community-BnAsVqMr.js → Community-vE_QnoqV.js} +1 -1
  17. package/dist/assets/{DeleteOutline-DpNyWtNL.js → DeleteOutline-D--wbiEJ.js} +1 -1
  18. package/dist/assets/{Done-BTd13H2U.js → Done-D5w4g3Ux.js} +1 -1
  19. package/dist/assets/{Download-Bm8sKXA2.js → Download-CSPVh6pQ.js} +1 -1
  20. package/dist/assets/{Edit-CUl1Rt8i.js → Edit-Dp6PSucO.js} +1 -1
  21. package/dist/assets/{EditIcon-8BXW1OHp.js → EditIcon-DiM9RB8U.js} +1 -1
  22. package/dist/assets/{Error-DEKvwVoF.js → Error-7F2F0yXi.js} +1 -1
  23. package/dist/assets/{ExpandLess-t1cH-Bc4.js → ExpandLess-BiXZAaWu.js} +1 -1
  24. package/dist/assets/{Google-Bn3zPWiu.js → Google-B-pSveIB.js} +1 -1
  25. package/dist/assets/{Holiday-C4KRd5t6.js → Holiday-BnL2IwX3.js} +1 -1
  26. package/dist/assets/{Home-C3ax1tQ7.js → Home-BxZHmRym.js} +1 -1
  27. package/dist/assets/{InfoOutlined-D3XnF0Vg.js → InfoOutlined-Bpx0eOkP.js} +1 -1
  28. package/dist/assets/{Launch-Dz9mQnYC.js → Launch-akp2B3sE.js} +1 -1
  29. package/dist/assets/{LaunchOutlined-E7HcQu_6.js → LaunchOutlined-BorUV5ev.js} +1 -1
  30. package/dist/assets/{LockIcon-DFb6sSpT.js → LockIcon-QnxDGvZv.js} +1 -1
  31. package/dist/assets/{Meeting-DCL_ygud.js → Meeting-BkjjPbp7.js} +1 -1
  32. package/dist/assets/{MoreHoriz-DpKn_fkc.js → MoreHoriz-B0f55Tf5.js} +1 -1
  33. package/dist/assets/{OffSick-DvgkmCUP.js → OffSick-D2B01pyN.js} +1 -1
  34. package/dist/assets/{PlayArrow-CDOOUxMp.js → PlayArrow-RuC30CX1.js} +1 -1
  35. package/dist/assets/{QuestionMarkCircle-DTGyWFVS.js → QuestionMarkCircle-BMcwgPWr.js} +1 -1
  36. package/dist/assets/{TuneOutlined-D0gGDoIJ.js → TuneOutlined-D5FWo3d6.js} +1 -1
  37. package/dist/assets/{ViewList-C8G9e3ft.js → ViewList-BqZC98em.js} +1 -1
  38. package/dist/assets/{WorkingRemotely-CpchWcXV.js → WorkingRemotely-CxoGYC4d.js} +1 -1
  39. package/dist/assets/{access-control-BhxOcGdx.js → access-control-D16cYs44.js} +1 -1
  40. package/dist/assets/{actions-DP7pj6xB.js → actions-DBL5WgL-.js} +1 -1
  41. package/dist/assets/{add-component-core-XUReAzat.js → add-component-core-Ci6stWWm.js} +1 -1
  42. package/dist/assets/{add-resource-C3kDcfBw.js → add-resource-T-ck3bbX.js} +1 -1
  43. package/dist/assets/{addon-CRj4Enw7.js → addon-DPZv8EDi.js} +1 -1
  44. package/dist/assets/advanced-JntBMn9H.js +14 -0
  45. package/dist/assets/api-DB7tZ-Xo.js +1 -0
  46. package/dist/assets/{appearance-ChvtVBNv.js → appearance-CE1vlHo8.js} +1 -1
  47. package/dist/assets/{ar-CSZJf27k.js → ar-0ZkmCCuq.js} +1 -1
  48. package/dist/assets/{ar-CHiV3Onz.js → ar-4JMeO2Q-.js} +1 -1
  49. package/dist/assets/{audit-logs-DXoc97BV.js → audit-logs-CBPfzCJa.js} +2 -2
  50. package/dist/assets/authorize-tlwy4qUl.js +1 -0
  51. package/dist/assets/{base-chart-D6qRW4Yg.js → base-chart-C6ehpmPk.js} +1 -1
  52. package/dist/assets/{base32-WurN0cIW.js → base32-BwYE-4Kz.js} +1 -1
  53. package/dist/assets/{branding-DuPWVNlC.js → branding-DJ40U0Xm.js} +6 -6
  54. package/dist/assets/{branding-DpkSF6dd.js → branding-XgAIR_gl.js} +2 -2
  55. package/dist/assets/bundle-avatar-BmucN4PA.js +1 -0
  56. package/dist/assets/button-BJsVm63u.js +1 -0
  57. package/dist/assets/{click-to-copy-R7MF4AwY.js → click-to-copy-BBibsDSl.js} +1 -1
  58. package/dist/assets/{cloneDeep-UpFQ2VNg.js → cloneDeep-IATUBtZS.js} +1 -1
  59. package/dist/assets/{collapse-l9wHY9gJ.js → collapse-C0MB7y7w.js} +1 -1
  60. package/dist/assets/complete-B4wczVx2.js +39 -0
  61. package/dist/assets/{component-CURpjZJ2.js → component-CV3lHAEe.js} +61 -61
  62. package/dist/assets/{config-e36Xplpo.js → config-B54rVJFV.js} +2 -2
  63. package/dist/assets/{config-Cd14MJHa.js → config-kZ6x7NWW.js} +1 -1
  64. package/dist/assets/{config-navigation-BvjYZI_j.js → config-navigation-BmHbVpEP.js} +6 -6
  65. package/dist/assets/{config-space-EoSm62Er.js → config-space-Jb7A7Enz.js} +1 -1
  66. package/dist/assets/{confirm-Vzr2I9eM.js → confirm-C4WQNFCO.js} +1 -1
  67. package/dist/assets/{connect-B5Xr7MId.js → connect-DkKsuEKO.js} +1 -1
  68. package/dist/assets/connect-hIPRwQcf.js +1 -0
  69. package/dist/assets/{connect-to-Bz9wYM04.js → connect-to-DIyD6mug.js} +1 -1
  70. package/dist/assets/{content-layout-fV4nyVb5.js → content-layout-DuPlKBe3.js} +1 -1
  71. package/dist/assets/{dashboard-xUr1SbPS.js → dashboard-RaW3OPWY.js} +15 -15
  72. package/dist/assets/{de-CA1MfHz7.js → de-DXX_rGJR.js} +1 -1
  73. package/dist/assets/{de-C-F2uwju.js → de-Dv_ApqsF.js} +1 -1
  74. package/dist/assets/{delete-confirm-DNn4Os6R.js → delete-confirm-DF3sJ0OM.js} +1 -1
  75. package/dist/assets/did-address-C3GRjuMv.js +1 -0
  76. package/dist/assets/domain-EvKu7UZx.js +9 -0
  77. package/dist/assets/domain-action-card-Cw0Id2oz.js +28 -0
  78. package/dist/assets/domains-VgmaJPuO.js +1 -0
  79. package/dist/assets/{dot-itVN8XTt.js → dot-DGdAPqTT.js} +1 -1
  80. package/dist/assets/{email-BIVfXnpk.js → email-CNAqXy-z.js} +2 -2
  81. package/dist/assets/{empty-spinner-BdaCO6xq.js → empty-spinner-DSwpCqdd.js} +1 -1
  82. package/dist/assets/{es-B2TJqtV4.js → es-D_uF0siv.js} +1 -1
  83. package/dist/assets/{es-CXgvF2gS.js → es-KnJQ_CSv.js} +1 -1
  84. package/dist/assets/exchange-passport-B7hlYcaO.js +1 -0
  85. package/dist/assets/{fr-DN38boH3.js → fr-DVFSQfDp.js} +1 -1
  86. package/dist/assets/{fr-CzO5Th4h.js → fr-k9jwmXxf.js} +1 -1
  87. package/dist/assets/{fuel-Cs--pEYt.js → fuel-DZSZuXQ1.js} +1 -1
  88. package/dist/assets/gen-access-key-CbRadpV7.js +2 -0
  89. package/dist/assets/{get-safe-url-Q70tRxL7.js → get-safe-url-CISc2x16.js} +1 -1
  90. package/dist/assets/{get-safe-url-c4iAcpvA.js → get-safe-url-DvHrYSqa.js} +1 -1
  91. package/dist/assets/{hi-5tixPGqk.js → hi-Dqbq8i5Y.js} +1 -1
  92. package/dist/assets/{hi-lZ18vyMl.js → hi-yiTjSXz3.js} +1 -1
  93. package/dist/assets/{home-BZ8WpcWZ.js → home-frxjPVWF.js} +1 -1
  94. package/dist/assets/{id-CIDM1ypY.js → id-Bxr8o3Uo.js} +1 -1
  95. package/dist/assets/{id-QM66qYoI.js → id-Cd3xoDST.js} +1 -1
  96. package/dist/assets/{iframe-Dl8NEFc5.js → iframe-BiCAYvW4.js} +1 -1
  97. package/dist/assets/index-B1FE0ctv.js +1 -0
  98. package/dist/assets/index-BG0sHfGj.js +7 -0
  99. package/dist/assets/{index-BKKwhjBs.js → index-BPMh7nrj.js} +1 -1
  100. package/dist/assets/{index-CsXmgylH.js → index-BQrNzvEP.js} +42 -17
  101. package/dist/assets/{index-RsjqbOR7.js → index-BXjOxZPH.js} +1 -1
  102. package/dist/assets/{index-iB7JyXwh.js → index-BoQJXOtZ.js} +1 -1
  103. package/dist/assets/index-BqpTOoPb.js +701 -0
  104. package/dist/assets/{index-Dsd9SXVN.js → index-CM1gvdHf.js} +1 -1
  105. package/dist/assets/index-CM7AUwHU.js +6 -0
  106. package/dist/assets/{index-Drd9jydY.js → index-DFS_0wPj.js} +9 -9
  107. package/dist/assets/index-DG4t_95k.js +113 -0
  108. package/dist/assets/{index-D2uDBC1o.js → index-DU8cx_m6.js} +1 -1
  109. package/dist/assets/index-DU_MoKoU.js +99 -0
  110. package/dist/assets/{index-BmXcRfZR.js → index-DWgnwzKO.js} +1 -1
  111. package/dist/assets/index-DXHP7obk.js +55 -0
  112. package/dist/assets/{index-Bs1kxR8_.js → index-DZ-_hefE.js} +1 -1
  113. package/dist/assets/{index-BU2FTGFr.js → index-Da3DjtRv.js} +1 -1
  114. package/dist/assets/{index-BUHyq-oP.js → index-Dsf-Dx7V.js} +1 -1
  115. package/dist/assets/{index-J3Tqz9ZT.js → index-KHBjePpP.js} +1 -1
  116. package/dist/assets/index-NqsjhbFu.js +1 -0
  117. package/dist/assets/index-Q6Li9wvf.js +284 -0
  118. package/dist/assets/{index-BCJADuMw.js → index-RkKVgwr6.js} +9 -9
  119. package/dist/assets/{index-wLX5GW2c.js → index-ZxVQWz3M.js} +2 -2
  120. package/dist/assets/{index-B7IOoVDF.js → index-omqdu-uQ.js} +1 -1
  121. package/dist/assets/{index-U3mAyHwS.js → index-xC6Gp6MC.js} +4 -4
  122. package/dist/assets/{invitation-Dsnc8lab.js → invitation-DGUk8KYF.js} +5 -5
  123. package/dist/assets/invite-BfNfISvG.js +1 -0
  124. package/dist/assets/issue-passport-8wukrxMl.js +1 -0
  125. package/dist/assets/{item-rXnALS3b.js → item-DPz661BP.js} +2 -2
  126. package/dist/assets/{ja-pJLB4V2E.js → ja-CJfcqkdo.js} +1 -1
  127. package/dist/assets/{ja-C8AmHPMo.js → ja-Cn7b_8vh.js} +1 -1
  128. package/dist/assets/{ko-xDWtmcv7.js → ko-BuxX0Qtk.js} +1 -1
  129. package/dist/assets/{ko-D2NP5Ixe.js → ko-BxAazRix.js} +1 -1
  130. package/dist/assets/{launch-result-message-FuvJDCvp.js → launch-result-message-DNgJY11G.js} +1 -1
  131. package/dist/assets/{layout-DYG0Wl7R.js → layout-BmWP3Qk8.js} +1 -1
  132. package/dist/assets/list-04YITCFc.js +2 -0
  133. package/dist/assets/{list-DLMy1vVs.js → list-CVmWDI3k.js} +10 -10
  134. package/dist/assets/{list-header-xt282ZMS.js → list-header-D976e09p.js} +1 -1
  135. package/dist/assets/localization-BpRT0W0W.js +1 -0
  136. package/dist/assets/{log-Bwqh69bM.js → log-BRLMtVId.js} +1 -1
  137. package/dist/assets/{logger-BAVOmOw2.js → logger-DAjuoBTQ.js} +1 -1
  138. package/dist/assets/login-FlwzktJ1.js +1 -0
  139. package/dist/assets/{login-oauth-callback-BrnNJIOK.js → login-oauth-callback-HckguQey.js} +1 -1
  140. package/dist/assets/{logo-uploader-CLwbDhA_.js → logo-uploader-C0nXePFF.js} +3 -3
  141. package/dist/assets/{lost-passport-CqzPSoLw.js → lost-passport-CxiuaqjL.js} +2 -2
  142. package/dist/assets/{omit-D2k92RIF.js → omit-CsI4VeYr.js} +1 -1
  143. package/dist/assets/{open-window-Bl24RBAD.js → open-window-Ct0k45Ir.js} +1 -1
  144. package/dist/assets/{overview-DqabCKYi.js → overview-DqzTgTpr.js} +2 -2
  145. package/dist/assets/{page-header-BWqvvXOk.js → page-header-CVBmdH9B.js} +1 -1
  146. package/dist/assets/passport-item-EL16joTA.js +1 -0
  147. package/dist/assets/{permission-DSHe73ba.js → permission-CMjo9z-z.js} +1 -1
  148. package/dist/assets/preferences-Dtk7H5V2.js +1 -0
  149. package/dist/assets/profile-embed-yHOg7opg.js +1 -0
  150. package/dist/assets/{pt-DSj10b9i.js → pt-B3PPKZk-.js} +1 -1
  151. package/dist/assets/{pt-D1apbJwE.js → pt-FpFCyI6v.js} +1 -1
  152. package/dist/assets/publish-resource-dRqof08I.js +1 -0
  153. package/dist/assets/{react-beautiful-dnd.esm-Ck4xzwyU.js → react-beautiful-dnd.esm-CaWQHB2l.js} +1 -1
  154. package/dist/assets/{ru-BNuzbw_f.js → ru-8o6MGLMc.js} +1 -1
  155. package/dist/assets/{ru-D2AG9Iea.js → ru-BuGIFp9h.js} +1 -1
  156. package/dist/assets/runtime-D5-pdz5h.js +1 -0
  157. package/dist/assets/sanitize-qIr4ImjO.js +2 -0
  158. package/dist/assets/sdk-b4mKK9kW.js +1 -0
  159. package/dist/assets/{section-Ccxg0x_Y.js → section-Bb547IGJ.js} +1 -1
  160. package/dist/assets/{security-DCArL_za.js → security-BTapYcba.js} +4 -4
  161. package/dist/assets/session-N9ogZkBO.js +1 -0
  162. package/dist/assets/{setup-CX2pUl2y.js → setup-B5MRDSHj.js} +5 -5
  163. package/dist/assets/{shorten-label-DPIZ5X7v.js → shorten-label-CTSJhlwO.js} +1 -1
  164. package/dist/assets/{simple-select-CN3fsa56.js → simple-select-cKQxVH3U.js} +1 -1
  165. package/dist/assets/{slicedToArray-DmqXMnHT.js → slicedToArray-CRrLoxQ4.js} +2 -2
  166. package/dist/assets/{spaces-DApg1wzn.js → spaces-ClWdZraZ.js} +1 -1
  167. package/dist/assets/start-CGeLNOhk.js +187 -0
  168. package/dist/assets/{starting-progress-BHUTOY2b.js → starting-progress-COPiu29g.js} +1 -1
  169. package/dist/assets/status-C88kWBZ6.js +1 -0
  170. package/dist/assets/{step-actions-CISMVGx2.js → step-actions-BmJstMo-.js} +1 -1
  171. package/dist/assets/{studio-1mTu0Fgs.js → studio-LXKuDXYf.js} +1 -1
  172. package/dist/assets/{switch-control-CpCSorUo.js → switch-control-ByXecLFy.js} +1 -1
  173. package/dist/assets/{table-tips-BfSSGl9N.js → table-tips-CbVGFubR.js} +1 -1
  174. package/dist/assets/{th-CRGgyPc5.js → th-BafLD2wR.js} +1 -1
  175. package/dist/assets/{th-CsJSfFsn.js → th-ei5CkkZm.js} +1 -1
  176. package/dist/assets/{traffic-BqHyn9L9.js → traffic-CI_XKEvK.js} +1 -1
  177. package/dist/assets/transfer-DTyw3pJQ.js +16 -0
  178. package/dist/assets/{unsubscribe-B3OLQIVA.js → unsubscribe-T4w7NZUF.js} +1 -1
  179. package/dist/assets/use-blocklet-logo-BXak7BDs.js +2 -0
  180. package/dist/assets/{use-mobile-BAa0wi8o.js → use-mobile-CXU9YBvX.js} +1 -1
  181. package/dist/assets/{use-mobile-C21X4TYN.js → use-mobile-CiFFAdJf.js} +1 -1
  182. package/dist/assets/{use-server-logo-CxuMvwKh.js → use-server-logo-BbYHFDuK.js} +1 -1
  183. package/dist/assets/{useAsync-510ntT1B.js → useAsync-QkUcWOv0.js} +1 -1
  184. package/dist/assets/{useLocalStorage-D6gvgmEW.js → useLocalStorage-COrhSWV-.js} +1 -1
  185. package/dist/assets/user-center-B27c6mFg.js +77 -0
  186. package/dist/assets/{util-DMfPwzVN.js → util-Ayf5_DBX.js} +1 -1
  187. package/dist/assets/{util-Dnkhck-D.js → util-CHnqURNW.js} +1 -1
  188. package/dist/assets/{vendor-arcblock-BlrkGjK9.js → vendor-arcblock-CATQui2x.js} +87 -87
  189. package/dist/assets/{vendor-hooks-BgUTpb6X.js → vendor-hooks-TMGmpw5W.js} +2 -2
  190. package/dist/assets/{vendor-mui-core-BV2FUxWJ.js → vendor-mui-core-wlbruq2I.js} +22 -22
  191. package/dist/assets/{vendor-mui-x-Bo-XOtzq.js → vendor-mui-x-BKgL6hAa.js} +1 -1
  192. package/dist/assets/vendor-utils-CxrPpJZS.js +208 -0
  193. package/dist/assets/vendor-ux-did-connect-Bh011lgb.js +2305 -0
  194. package/dist/assets/{vi-Ce8JEW56.js → vi-B1ypAqOQ.js} +1 -1
  195. package/dist/assets/{vi-IIi6v-et.js → vi-BMZxxaJ2.js} +1 -1
  196. package/dist/assets/wrap-locale-BBPjudJQ.js +1 -0
  197. package/dist/assets/{zh-DQX0RFjY.js → zh-DusA4qAT.js} +1 -1
  198. package/dist/assets/{zh-tw-C-FYOTmO.js → zh-tw-BMxcCLBp.js} +1 -1
  199. package/dist/assets/{zh-tw-6n1CYpHc.js → zh-tw-BO-QhSNP.js} +1 -1
  200. package/dist/assets/{zh-S-Nv5zr-.js → zh-vhAJ5xBV.js} +1 -1
  201. package/dist/index.html +6 -6
  202. package/dist/service-worker.js +2 -2
  203. package/package.json +46 -46
  204. package/dist/assets/AdapterDayjs-CDDcwz3P.js +0 -3
  205. package/dist/assets/Email-BirbvqZ3.js +0 -1
  206. package/dist/assets/Location-DxPzfR_p.js +0 -1
  207. package/dist/assets/Phone-BkOMNOMO.js +0 -1
  208. package/dist/assets/Timezone-D91Of94T.js +0 -1
  209. package/dist/assets/advanced-hz-KSWn2.js +0 -14
  210. package/dist/assets/api-BjteVZFg.js +0 -1
  211. package/dist/assets/authorize-_fbQ19S4.js +0 -1
  212. package/dist/assets/bundle-avatar-D4fwror8.js +0 -1
  213. package/dist/assets/button-_1HExv7r.js +0 -1
  214. package/dist/assets/complete-C5D4D-fJ.js +0 -39
  215. package/dist/assets/connect-DXOsnqkO.js +0 -1
  216. package/dist/assets/did-address-Dq-4__HB.js +0 -1
  217. package/dist/assets/domain-XXgOrJDa.js +0 -9
  218. package/dist/assets/domain-action-card-Cf1AoKOi.js +0 -28
  219. package/dist/assets/domains-DeFj6Ipl.js +0 -1
  220. package/dist/assets/exchange-passport-C9Pvr9Da.js +0 -1
  221. package/dist/assets/gen-access-key-CIzULsBE.js +0 -2
  222. package/dist/assets/index-BoTgqYtV.js +0 -55
  223. package/dist/assets/index-C64IgZKt.js +0 -1
  224. package/dist/assets/index-D-Lxloq5.js +0 -284
  225. package/dist/assets/index-D1kTR2xk.js +0 -10
  226. package/dist/assets/index-DBqLPDUh.js +0 -113
  227. package/dist/assets/index-DDXNOodN.js +0 -99
  228. package/dist/assets/index-DDoVX3je.js +0 -701
  229. package/dist/assets/index-DvBh35bh.js +0 -1
  230. package/dist/assets/index-I6_gMaPh.js +0 -1
  231. package/dist/assets/index-W_fQ-nuf.js +0 -6
  232. package/dist/assets/invite-CvAru4rZ.js +0 -1
  233. package/dist/assets/issue-passport-CDE6vHUE.js +0 -1
  234. package/dist/assets/landing-page-DrVLCVAm.js +0 -1
  235. package/dist/assets/list-b96sX5Y6.js +0 -2
  236. package/dist/assets/localization-Bb0kc8SQ.js +0 -1
  237. package/dist/assets/login-Ygmj8_J7.js +0 -1
  238. package/dist/assets/passport-item-C5-ZuTPM.js +0 -1
  239. package/dist/assets/preferences-BzGNV3pM.js +0 -1
  240. package/dist/assets/profile-embed-iA-d50c3.js +0 -1
  241. package/dist/assets/publish-resource-ebKgw7OW.js +0 -1
  242. package/dist/assets/runtime-B454s6Gb.js +0 -1
  243. package/dist/assets/sdk-DeS3iq37.js +0 -1
  244. package/dist/assets/session-C_8V_o-O.js +0 -1
  245. package/dist/assets/start-Dhbx5j_D.js +0 -187
  246. package/dist/assets/status-D4K-kiXO.js +0 -1
  247. package/dist/assets/transfer-Bqv1gMqL.js +0 -16
  248. package/dist/assets/use-blocklet-logo-Bhkp-Zm7.js +0 -2
  249. package/dist/assets/user-center-vIx28YXm.js +0 -77
  250. package/dist/assets/vendor-utils-rHXShPKm.js +0 -208
  251. package/dist/assets/vendor-ux-did-connect-2jRoUb28.js +0 -2296
  252. package/dist/assets/wrap-locale-C_UOH97U.js +0 -1
@@ -1 +0,0 @@
1
- import{a as B,a0 as q,bT as _,I as ge,bU as fe,a2 as je,a9 as ye,bA as we}from"./vendor-ux-did-connect-2jRoUb28.js";import{t as ke,l as de,j as Ee}from"./vendor-hooks-BgUTpb6X.js";import{r as S,b as Q}from"./vendor-react-DEoibe3W.js";import{d as X}from"./InfoOutlined-D3XnF0Vg.js";import{j as ve,B as Ce}from"./vendor-arcblock-BlrkGjK9.js";import{U as Te,C as Se,I as Ie}from"./index-D1kTR2xk.js";import{D as F,aB as Re,aC as K,G as pe,y as De}from"./index-DDoVX3je.js";import{u as U}from"./dashboard-xUr1SbPS.js";import{u as ze}from"./use-mobile-BAa0wi8o.js";import{H as t,j as e,D as Pe,aj as Ae,t as We,aa as m,O as re,T as I,ab as M,ak as Z,z as Oe,y as H,bs as le,bR as Y,ad as $,L as J,A as G,bc as qe,E as L,I as ee,C as $e,bq as Le,al as z,cg as Be,X as Me,bb as V,bp as He,b4 as Ne,ch as Fe,ci as Ue,b5 as _e,an as Ke,c0 as Ye,s as ue,v as Ve,cj as Je,ck as Ge,cl as Qe,cm as Xe}from"./vendor-mui-core-BV2FUxWJ.js";import{d as Ze}from"./ExpandLess-t1cH-Bc4.js";import{b as he,z as et,A as tt}from"./vendor-utils-rHXShPKm.js";import{C as ot}from"./confirm-Vzr2I9eM.js";import{A as st}from"./actions-DP7pj6xB.js";import{T as ae}from"./table-tips-BfSSGl9N.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./useLocalStorage-D6gvgmEW.js";import"./index-8eXqqyHQ.js";import"./PlayArrow-CDOOUxMp.js";import"./get-safe-url-c4iAcpvA.js";import"./session-C_8V_o-O.js";import"./use-blocklet-logo-Bhkp-Zm7.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C21X4TYN.js";import"./MoreHoriz-DpKn_fkc.js";const nt=o=>{var f,w;const[p,u]=S.useState(null),[E,s]=S.useState(!o),[R,c]=S.useState(null),{blocklet:a}=pe(),d=(w=(f=a==null?void 0:a.site)==null?void 0:f.domainAliases[0])==null?void 0:w.value,j=S.useMemo(()=>{const b={};return p&&(p.sources.forEach(l=>{b[l.did]={source:l,events:[],count:0}}),p.events.forEach(l=>{b[l.source]&&(b[l.source].events.push(l),b[l.source].count+=1)})),b},[p]),y=async()=>{try{if(s(!0),!d)return;const l=await(await fetch(`https://${d}/.well-known/service/openevent.json`)).json();u(l),c(null)}catch(b){c(b instanceof Error?b:new Error(String(b)))}finally{s(!1)}};return S.useEffect(()=>{y()},[d]),{openEvent:p,setOpenEvent:u,eventsBySource:j,loading:E,error:R,loadData:y}};function te({eventsBySource:o,selectedEvents:p,setSelectedEvents:u,error:E}){const{t:s}=B(),[R,c]=S.useState({}),a=S.useMemo(()=>{const l={};return Object.entries(o).forEach(([g,{events:h}])=>{const T=h.filter(x=>p[`${x.type}-${x.source}`]).length;l[g]=T}),l},[o,p]),d=S.useMemo(()=>Object.values(a).reduce((l,g)=>l+g,0),[a]),j=S.useMemo(()=>Object.values(o).reduce((l,{events:g})=>l+g.length,0),[o]),y=(l,g)=>{g.stopPropagation(),c({...R,[l]:!R[l]})},f=l=>{const g=`${l.type}-${l.source}`;u(h=>({...h,[g]:!h[g]}))},w=(l,g)=>{const h={};l.forEach(T=>{const x=`${T.type}-${T.source}`;h[x]=!g}),u(T=>({...T,...h}))},b=l=>{const g={};Object.values(o).forEach(({events:h})=>{h.forEach(T=>{const x=`${T.type}-${T.source}`;g[x]=l.target.checked})}),u(g)};return e.jsxs(m,{sx:{width:"100%"},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(Y,{onChange:b,checked:d>0&&d===j}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[s("webhookEndpoint.selectAllEvents"),e.jsx(m,{sx:{display:"flex",alignItems:"center"},children:e.jsx($,{title:s("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(X,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),d>0&&e.jsx(I,{variant:"body2",color:"primary",sx:{ml:"auto"},children:s("webhookEndpoint.selectedEventsCount",{count:d})})]}),e.jsx(m,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(J,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(o).map(([l,{source:g,events:h,count:T}],x)=>{const D=a[l]>0,k=a[l]===h.length&&h.length>0,A=R[l];return e.jsxs(Q.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:n})=>x<Object.keys(o).length-1?`1px solid ${n.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(m,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:n=>{n.target.closest(".MuiFormControlLabel-root")||y(l,n)},children:[e.jsx(m,{sx:{display:"flex",alignItems:"center"},children:h.length>0&&e.jsx(le,{control:e.jsx(Y,{checked:k,indeterminate:D&&!k,onChange:n=>{n.stopPropagation(),w(h,k)}}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[g.logo&&e.jsx(qe,{src:g.logo,sx:{width:24,height:24}}),e.jsx(m,{children:g.title||l}),D&&e.jsx(L,{label:s("webhookEndpoint.selectedCount",{count:a[l]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:n=>`${n.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(m,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(I,{variant:"body2",color:"text.secondary",sx:{mr:1},children:s("webhookEndpoint.eventsCount",{count:T})}),h.length>0&&e.jsx(ee,{size:"small",edge:"end",children:A?e.jsx(Ze,{}):e.jsx(ve,{})})]})]})}),h.length>0&&e.jsx($e,{in:A,timeout:"auto",unmountOnExit:!0,children:e.jsx(J,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:h.map(n=>{const r=`${n.type}-${n.source}`,i=!!p[r];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>f(n),children:e.jsxs(m,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Y,{checked:i,sx:{mr:1}}),e.jsxs(m,{children:[e.jsx(I,{variant:"body1",sx:{cursor:"pointer"},children:n.type}),e.jsx(I,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:n.description})]})]})},r)})})})]},l)})})}),E&&e.jsx(Le,{error:!0,sx:{mt:1},children:E})]})}te.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};te.defaultProps={error:null};function oe({id:o,url:p,description:u,enabledEvents:E,onSubmit:s,onClose:R}){var n;const{t:c}=B(),[a,d]=S.useState({}),{teamDid:j}=U(),{api:y}=F(),{loading:f,error:w,eventsBySource:b}=nt(),{control:l,handleSubmit:g,formState:{errors:h},reset:T,setValue:x,trigger:D}=Re({defaultValues:{url:"",description:""}});S.useEffect(()=>{const r=Object.values(a).some(i=>i);x("selectedEvents",r?"valid":""),D("selectedEvents")},[a,x,D]);const k=()=>{d({}),T(),R()},A=async r=>{const i=Object.keys(a).filter(v=>a[v]),C={url:r.url,description:r.description,enabledEvents:i.map(v=>{const[P,O]=v.split("-");return!P||!O?null:{type:P,source:O}}).filter(Boolean)};try{if(o){const v=await y.updateWebhookEndpoint({input:{teamDid:j,id:o,data:C}});q.success(`${c("webhookEndpoint.updateWebhook")} ${c("webhookEndpoint.success")}`),s(v)}else{const v=await y.createWebhookEndpoint({input:{teamDid:j,input:C}});q.success(`${c("webhookEndpoint.createWebhook")} ${c("webhookEndpoint.success")}`),s(v)}}catch(v){q.error(v==null?void 0:v.message)}k()};return S.useEffect(()=>{T({url:p,description:u}),d(E.reduce((r,i)=>(r[`${i.type}-${i.source}`]=!0,r),{}))},[T,d,p,u,E]),e.jsx(Pe,{open:!0,onClose:k,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:g(A),children:[e.jsx(Ae,{children:c(o?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(We,{children:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(K,{name:"url",control:l,rules:{required:c("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:c("webhookEndpoint.validation.urlInvalid")}},render:({field:r})=>{var i;return e.jsx(re,{...r,label:c("webhookEndpoint.url.label"),fullWidth:!0,error:!!h.url,helperText:(i=h.url)==null?void 0:i.message})}}),e.jsx(K,{name:"description",control:l,rules:{required:c("webhookEndpoint.validation.descriptionRequired")},render:({field:r})=>{var i;return e.jsx(re,{...r,label:c("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!h.description,helperText:(i=h.description)==null?void 0:i.message})}}),e.jsx(K,{name:"selectedEvents",control:l,rules:{required:c("webhookEndpoint.validation.eventRequired")},render:({field:r})=>e.jsx("input",{type:"hidden",...r})}),!f&&b&&Object.keys(b).length>0&&e.jsx(te,{eventsBySource:b,selectedEvents:a,setSelectedEvents:d,error:(n=h.selectedEvents)==null?void 0:n.message}),!f&&(!b||Object.keys(b).length===0)&&e.jsx(I,{color:"text.secondary",children:c("webhookEndpoint.noAvailableEvents")}),f&&e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(M,{size:20})}),w&&e.jsx(Z,{severity:"error",children:c("webhookEndpoint.loadingError",{message:w==null?void 0:w.message})})]})}),e.jsxs(Oe,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:k,children:c("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:c(o?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function xe(o){switch(o){case"enabled":return"success";case"disabled":default:return"default"}}const it=(o="en")=>o==="tw"?"zh":o;function N(o,p="YYYY-MM-DD HH:mm:ss",u="en"){return o?De(o).locale(it(u)).format(p):"-"}function rt(o){return typeof o=="number"?!1:he(o)}function lt(o){return o>=200&&o<300}function W(o){const p=rt(o.value);return e.jsxs(e.Fragment,{children:[e.jsxs(z,{direction:"column",alignItems:"flex-start",children:[e.jsxs(I,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[o.label,!!o.tip&&e.jsx($,{title:o.tip,children:e.jsx(Be,{fontSize:"small"})})]}),e.jsx(I,{component:"div",variant:"body1",color:p?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:p?"-":o.value})]}),o.divider&&e.jsx(Me,{orientation:"vertical",flexItem:!0})]})}W.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};W.defaultProps={tip:"",divider:!1};function se(o){return e.jsxs(z,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:o.mb,mt:o.mt,pb:1},children:[e.jsx(I,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:o.title}),o.children]})}se.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};se.defaultProps={children:null,mb:1.5,mt:1.5};const at=o=>{const p={};return o.forEach(u=>{var s;const E=new Date(u.createdAt).toLocaleDateString();p[E]||(p[E]=[]),(s=p[E])==null||s.push(u)}),p};function ne({eventId:o,webhookEndpointId:p,event:u}){const{api:E}=F(),{t:s}=B(),{teamDid:R}=U(),{blocklet:c}=pe(),{data:a,loadMore:d,loadingMore:j,loading:y}=ke(x=>{const k=x?Math.ceil(x.list.length/15)+1:1;return E.getWebhookAttempts({input:{teamDid:R,input:{eventId:o,webhookId:p},paging:{page:k,pageSize:15}}})},{reloadDeps:[o,p]}),f=(a==null?void 0:a.list)||[],[w,b]=S.useState(null),l=at(f);S.useEffect(()=>{!w&&(a!=null&&a.list.length)&&b(a.list[0])},[a==null?void 0:a.list.length,w]);const g=x=>{b(x)};if(y)return e.jsx(M,{});const h=a&&a.list.length<a.paging.total,T=x=>{var D,k,A,n,r;if(x.responseBody&&((D=x.responseBody)!=null&&D.sessionId)&&((k=x.responseBody)!=null&&k.projectId)&&((A=x.responseBody)!=null&&A.agentId)){const i=(r=(n=c==null?void 0:c.site)==null?void 0:n.domainAliases[0])==null?void 0:r.value,C=(c.children||[]).find(P=>{var O;return((O=P==null?void 0:P.meta)==null?void 0:O.name)==="ai-studio"}),v=et(tt(`https://${i}`,(C==null?void 0:C.mountPoint)||"","projects",x.responseBody.projectId,"logs/main"),{sessionId:x.responseBody.sessionId,agentId:x.responseBody.agentId});return e.jsx(ee,{sx:{fontSize:20},onClick:()=>window.open(v,"_blank"),children:e.jsx(m,{component:ge,icon:fe})})}return null};return e.jsxs(V,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(V,{item:!0,xs:12,md:4,height:1,children:he(Object.keys(l))?e.jsx(I,{color:"text.secondary",children:s("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(J,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(l).map(([x,D])=>e.jsxs(Q.Fragment,{children:[e.jsx(He,{children:x}),D.map(k=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>g(k),selected:w===k,secondaryAction:e.jsx(I,{color:"text.secondary",children:N(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Ne,{sx:{minWidth:0,mr:1.5},children:lt(k.responseStatus)===!1?e.jsx(Fe,{color:"error"}):e.jsx(Ue,{color:"success"})}),e.jsx(_e,{primary:e.jsx(I,{color:"text.primary",children:k.event.type})})]},k.id))]},x))}),h&&e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:d,disabled:j,sx:{color:x=>x.palette.text.disabled},children:s(j?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(V,{item:!0,xs:12,md:8,height:1,children:[w&&e.jsxs(z,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(I,{variant:"h6",children:o?w.endpoint.url:w.event.type}),e.jsx(m,{children:T(w)})]}),e.jsxs(m,{children:[e.jsxs(I,{variant:"h6",children:[s("webhookEndpoint.response")," (",w.responseStatus,")"]}),e.jsx(_,{language:"json",children:JSON.stringify(w.responseBody,null,2)})]}),e.jsxs(m,{children:[e.jsx(z,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(I,{variant:"h6",children:s("webhookEndpoint.request")})}),e.jsx(_,{language:"json",sx:{margin:0},children:JSON.stringify(w.event,null,2)})]})]}),(a==null?void 0:a.list.length)===0&&u&&e.jsxs(m,{children:[e.jsx(z,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(I,{variant:"h6",children:s("webhookEndpoint.eventData")})}),e.jsx(_,{language:"json",sx:{margin:0},children:JSON.stringify(u.data,null,2)})]})]})]})}ne.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};ne.defaultProps={eventId:"",webhookEndpointId:"",event:null};function me({id:o,onClose:p}){var j,y,f,w;const{t:u}=B(),{api:E}=F(),{teamDid:s}=U(),{loading:R,error:c,data:a}=de(()=>E.getWebhookEndpoint({input:{teamDid:s,id:o}})),d=a==null?void 0:a.data;return c?e.jsx(Z,{severity:"error",children:c.message}):R||!d?e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(M,{})}):e.jsxs(ct,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(m,{children:[e.jsxs(z,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(z,{flex:1,width:0,children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(I,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:d.description}),e.jsx($,{title:d.url,children:e.jsx(X,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(z,{direction:"row",alignItems:"center",children:e.jsx(ee,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ye,{})})})]}),e.jsx(m,{mt:2,children:e.jsxs(z,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx(W,{label:u("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:d.status,color:xe(d.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx(W,{label:u("webhookEndpoint.listen"),value:e.jsx($,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:d.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b==null?void 0:b.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:u("webhookEndpoint.eventsCount",{count:d.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:u("webhookEndpoint.version"),value:d.apiVersion,divider:!0}),e.jsx(W,{label:u("common.createdAt"),value:N(d.createdAt),divider:!0}),e.jsx(W,{label:u("common.updatedAt"),value:N(d.updatedAt),divider:!0}),e.jsx(W,{label:u("common.createdBy"),value:e.jsx($,{arrow:!0,title:(j=d.createUser)==null?void 0:j.did,children:e.jsx(L,{size:"small",variant:"filled",label:(y=d.createUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx(W,{label:u("common.updatedBy"),value:e.jsx($,{arrow:!0,title:(f=d.updateUser)==null?void 0:f.did,children:e.jsx(L,{size:"small",variant:"filled",label:(w=d.updateUser)==null?void 0:w.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(z,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(se,{title:u("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(z,{height:0,flex:1,overflow:"hidden",children:e.jsx(ne,{webhookEndpointId:d.id})})]})]})}me.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const ct=ue(z)``;function be({open:o,onClose:p,id:u}){return e.jsx(Ke,{anchor:"right",open:o,onClose:p,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(m,{sx:{height:"100vh",p:3},children:e.jsx(me,{id:u,onClose:p})})})}be.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function ce(){return null}const ie=Q.memo(({options:o,columns:p,toolbar:u=!0,footer:E=!0,hasRowLink:s=!1,emptyNodeText:R="",...c})=>{const{locale:a}=B(),d=Ve(f=>f.breakpoints.down("md")),j={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:d?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},y={};return u||(y.TableToolbar=ce),E||(y.TableFooter=ce),e.jsx(dt,{locale:a,options:{...j,...o},columns:(p||[]).map(f=>(f.options=f.options||{},f.options.filter=f.options.filter||!1,f.options.sort=f.options.sort||!1,f)),emptyNode:e.jsx(je,{children:R}),...c,components:y,hasRowLink:s,isMobile:d})});ie.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};ie.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const dt=ue(ye)``,pt=ie;function Ft(){const{teamDid:o}=U(),p=ze(),u=`webhook-endpoints-${o}`,E=we(u),{t:s,locale:R}=B(),{api:c}=F(),[a,d]=S.useState(""),[j,y]=S.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[f,w]=Ee(u,{defaultValue:{pageSize:E.rowsPerPage||20,page:E.page?E.page+1:1}}),{loading:b,error:l,data:g,refresh:h}=de(()=>c.getWebhookEndpoints({input:{teamDid:o,paging:{page:f.page,pageSize:f.pageSize}}}));S.useEffect(()=>{h()},[f,h]);const T=S.useCallback(async(n,r)=>{try{await c.updateWebhookEndpoint({input:{teamDid:o,id:n.id,data:{status:r?"disabled":"enabled"}}}),h(),q.success(`${s(r?"webhookEndpoint.disable":"webhookEndpoint.enable")}${s("webhookEndpoint.success")}`)}catch(i){q.error(i==null?void 0:i.message)}},[c,o,h,s]),x=S.useCallback(async n=>{try{await c.deleteWebhookEndpoint({input:{teamDid:o,id:n}}),h(),y(r=>({...r,deleteConfirm:null})),q.success(`${s("common.delete")}${s("webhookEndpoint.success")}`)}catch(r){q.error(r==null?void 0:r.message)}},[c,o,h,s]),D=(n,r)=>{let i=n.page+1;const C=n.searchText||"";if(C!==a){d(C);return}if(r==="changePage"||r==="changeRowsPerPage"){r!=="changePage"&&(i=1);const v={page:i,pageSize:n.rowsPerPage};d(""),w(v)}};if(l)return e.jsx(Z,{severity:"error",children:l.message});if(b||!g)return e.jsx(m,{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500,children:e.jsx(M,{})});const k=((g==null?void 0:g.list)||[]).filter(n=>{if(!a)return!0;const r=a.toLowerCase();return n.description.toLowerCase().includes(r)||n.url.toLowerCase().includes(r)}),A=[{label:"URL",name:"url",options:{customBodyRenderLite:(n,r)=>{const i=k[r];return e.jsxs(m,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(I,{variant:"body2",children:i.description}),e.jsx(m,{sx:{display:"flex"},onClick:C=>{C.stopPropagation()},children:e.jsx($,{title:i.url,children:e.jsx(X,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(n,r)=>{const i=k[r];return e.jsx(m,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:i.enabledEvents.map(C=>e.jsx(L,{size:"small",variant:"filled",label:C.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${i.source}-${C.type}`))})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:(n,r)=>{const i=k[r];return e.jsx(L,{size:"small",variant:"filled",label:s(`webhookEndpoint.${i==null?void 0:i.status}`),color:xe(i==null?void 0:i.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${i.status}`)}}},{label:s("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:n=>N(n)}},{label:s("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:n=>n?e.jsx(Te,{showDid:!0,did:n==null?void 0:n.did,cardType:Se.Detailed,infoType:Ie.Minimal,sx:{border:0,padding:0}}):"-"}},{label:s("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(n,r)=>{const i=k[r],C=(i==null?void 0:i.status)==="enabled";return e.jsx(st,{actions:[{icon:C?e.jsx(Je,{}):e.jsx(Ge,{}),text:s(C?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:v=>{v.stopPropagation(),T(i,C)}},{icon:e.jsx(Qe,{}),text:s("common.edit"),onClick:v=>{v.stopPropagation(),y(P=>({...P,createEdit:{open:!0,id:i.id,url:i.url,description:i.description,enabledEvents:i.enabledEvents}}))}},{icon:e.jsx(Xe,{}),text:s("common.delete"),onClick:v=>{v.stopPropagation(),y(P=>({...P,deleteConfirm:{title:s("webhookEndpoint.deleteWebhook.title"),description:s("webhookEndpoint.deleteWebhook.description"),confirm:s("common.confirm"),cancel:s("common.cancel"),onConfirm:()=>x(i.id),onCancel:()=>y(O=>({...O,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(m,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(ae,{title:s("webhookEndpoint.listTitle"),tooltipTitle:s("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${R}/webhook`}):null,e.jsx(pt,{durable:u,durableKeys:["page","rowsPerPage"],data:k,columns:A,options:{count:g.count,page:f.page-1,rowsPerPage:f.pageSize,viewColumns:!1,onRowClick:(n,{dataIndex:r})=>{const i=g.list[r];y(C=>({...C,webhookDetail:{open:!0,id:i.id}}))}},loading:b,onChange:D,emptyNodeText:e.jsx(z,{gap:1,children:s("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(ae,{title:s("webhookEndpoint.listTitle"),tooltipTitle:s("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${R}/webhook`}),customButtons:[e.jsxs(H,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary",onClick:()=>y(n=>({...n,createEdit:{...n.createEdit,open:!0}})),className:"rule-action",children:[b?e.jsx(M,{size:16}):e.jsx(Ce,{style:{fontSize:16}}),s("common.create")]},"add")]}),j.webhookDetail.open&&e.jsx(be,{open:!0,onClose:()=>y(n=>({...n,webhookDetail:{open:!1,id:null}})),id:j.webhookDetail.id}),j.createEdit.open&&e.jsx(oe,{onSubmit:h,...j.createEdit,onClose:()=>y(n=>({...n,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),j.deleteConfirm&&e.jsx(ot,{title:j.deleteConfirm.title,description:j.deleteConfirm.description,confirm:j.deleteConfirm.confirm,cancel:j.deleteConfirm.cancel,params:j.deleteConfirm.params,onConfirm:j.deleteConfirm.onConfirm,onCancel:j.deleteConfirm.onCancel})]})}export{Ft as default};
@@ -1 +0,0 @@
1
- import{j as t,ah as r}from"./vendor-mui-core-BV2FUxWJ.js";import{r as s}from"./vendor-react-DEoibe3W.js";import{b4 as a}from"./vendor-ux-did-connect-2jRoUb28.js";import{R as e}from"./vendor-arcblock-BlrkGjK9.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
@@ -1,6 +0,0 @@
1
- import{j as e,H as h,ah as Je,T as C,ab as A,e as Ze,cF as Z,ae as G,cG as Ge,aa as j,al as W,s as ge,ad as Se,be as et,cH as ze,a9 as ye,q,b4 as Y,b5 as H,y as tt,ap as st,bb as Ae}from"./vendor-mui-core-BV2FUxWJ.js";import{l as nt,i as Pe,f as fe}from"./vendor-hooks-BgUTpb6X.js";import{r as y,h as ot}from"./vendor-react-DEoibe3W.js";import{c as _,J as rt,a0 as at,V as it,a1 as ct,n as lt,G as dt,a2 as ue,I as ut}from"./vendor-arcblock-BlrkGjK9.js";import{a0 as D,a as T,b4 as pt,j as R,b9 as V,a9 as mt,r as je,bx as ft,B as pe,aq as ht,C as _e,au as xt}from"./vendor-ux-did-connect-2jRoUb28.js";import{G as O,D as M,y as w,a3 as gt,af as St,aE as yt}from"./index-DDoVX3je.js";import{u as jt}from"./use-mobile-BAa0wi8o.js";import{b as Q,d as Me,a7 as bt,I as Ct,E as Ue,A as he}from"./vendor-utils-rHXShPKm.js";import"./api-BjteVZFg.js";import{u as Ne,C as kt,D as Bt,a as Dt}from"./connect-to-Bz9wYM04.js";import{b as Et,c as wt,d as Tt,i as It,e as xe,f as Rt,h as vt,j as At}from"./spaces-DApg1wzn.js";import{f as X}from"./index-8eXqqyHQ.js";import{I as Ot}from"./index-BUHyq-oP.js";import{R as Lt}from"./index-J3Tqz9ZT.js";import{d as zt}from"./MoreHoriz-DpKn_fkc.js";import{c as Pt}from"./dashboard-xUr1SbPS.js";import{d as _t}from"./DeleteOutline-DpNyWtNL.js";import{g as Oe}from"./get-safe-url-c4iAcpvA.js";import{S as Mt}from"./switch-control-CpCSorUo.js";import{C as Ut,u as Nt}from"./config-space-EoSm62Er.js";import{L as Le}from"./list-header-xt282ZMS.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-D6gvgmEW.js";import"./confirm-Vzr2I9eM.js";import"./PlayArrow-CDOOUxMp.js";import"./session-C_8V_o-O.js";import"./use-blocklet-logo-Bhkp-Zm7.js";import"./InfoOutlined-D3XnF0Vg.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C21X4TYN.js";async function Wt({blockletDid:t,nodeApi:r,spaceGateways:o}){let s=!1;const i=await Promise.all(o.map(async n=>{let{name:a}=n;const d=await Et(n.endpoint);return!Q(d)&&d!==a&&(a=d,s=!0),{...n,name:a}}));return s&&await Promise.all(i.filter(n=>n.did).map(n=>r.updateBlockletSpaceGateway({input:{did:t,where:{did:n.did},spaceGateway:{...n}}}))),i}function Ft({refresh:t}={}){var i;const{blocklet:r}=O(),o=(i=r==null?void 0:r.meta)==null?void 0:i.did,{api:s}=M();return nt(async()=>{if(!o)return[];const{spaceGateways:n}=await s.getBlockletSpaceGateways({input:{did:o}});return await Wt({blockletDid:o,nodeApi:s,spaceGateways:n})??[]},{refreshDeps:[o,t],onError(n){var a;(a=n==null?void 0:n.message)!=null&&a.includes("not logged")?console.warn(n):(console.error(n),D.error(X(n)))}})}function We({deps:t,setLoading:r,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){var x;const{blocklet:s}=O(),[i,n]=y.useState([]),{api:a}=M(),[d,u]=y.useMemo(()=>o?[w(o).startOf("day").toISOString(),w(o).endOf("day").toISOString()]:[w().startOf("year").toISOString(),w().endOf("day").toISOString()],[o]),c=Me(async()=>{try{if(r(!0),!s){n([]);return}const{backups:p}=await a.getBlockletBackups({input:{did:s.meta.did,startTime:d,endTime:u}});n(p??[])}catch(p){console.error(p),D.error(X(p))}finally{r(!1)}},1e3);return Pe(async()=>{c()},[(x=s==null?void 0:s.meta)==null?void 0:x.did].concat(t)),{backups:i}}function Kt({appDid:t}){const{backups:r}=We(),[o,s]=y.useState({message:"",progress:0,completed:!1}),i=M(),{ws:{useSubscription:n}}=i;return n(_.BlockletEvents.backupProgress,a=>{t===(a==null?void 0:a.appDid)&&s(()=>({...a}))},[t]),y.useEffect(()=>{var a;if(r!=null&&r.length&&bt((a=r[0])==null?void 0:a.status)){const[d]=r;s(()=>({message:d.message,progress:d.progress,completed:d.progress>=100}))}},[r]),o}function $t({deps:t=[],setLoading:r=()=>{}}={}){var d;const{blocklet:o}=O(),[s,i]=y.useState([]),{api:n}=M(),a=y.useCallback(Me(async()=>{var u;if(!n||!((u=o==null?void 0:o.meta)!=null&&u.did)){i([]);return}try{r(!0);const c=w(),x=c.subtract(1,"year"),{summary:p}=await n.getBlockletBackupSummary({input:{did:o.meta.did,startTime:x.toISOString(),endTime:c.toISOString()}});i(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),D.error(X(c)),i([])}finally{r(!1)}},1e3),[]);return Pe(async()=>(await a(),()=>{a.cancel()}),[(d=o==null?void 0:o.meta)==null?void 0:d.did].concat(t)),{backupSummary:s}}const Fe=y.createContext({}),{Provider:qt,Consumer:Ws}=Fe;function be({children:t}){var K;const{t:r}=T(),{api:o}=M(),{blocklet:s}=O(),[i,n]=y.useState(null),[a,d]=y.useState(!1),{data:u,loading:c,mutate:x}=Ft({refresh:a}),p=Ct(u),g=Kt({appDid:s==null?void 0:s.appDid}),f=y.useMemo(()=>wt(s==null?void 0:s.environments),[s==null?void 0:s.environments]),[b,B]=y.useState(!1),[S,l]=y.useState(!1),{backups:te}=We({deps:[S,i],setLoading:B,backupDate:i}),[se,ne]=y.useState(!1),{backupSummary:oe}=$t({deps:[se]}),[U,z]=y.useState(u==null?void 0:u.find(m=>m.endpoint===f)),I=(K=s==null?void 0:s.settings)==null?void 0:K.autoBackup,v=()=>{d(m=>!m)},re=()=>{ne(m=>!m)},ae=()=>{l(m=>!m)},F=async m=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:m}})},J=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ie=async(m,N)=>{try{x(E=>{const P=[...E];return P.push({...m,loading:!0}),P}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:m}}),f!==N&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),z(m),v(),D.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(E){throw console.error(E),x(P=>[...P].filter(de=>de.did!==m.did)),E}},ce=async m=>{m&&(m.endpoint===f&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await F({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),x(N=>{const E=[...N];return E.splice(E.indexOf(m),1),E}),z(m),v())},le=async m=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:m.did},spaceGateway:m}}),f!==m.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),D.success(r("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===f;return e.jsx(qt,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:F,abortBlockletBackup:J,backupEndpoint:f,backupProgress:g,backups:te,backupSummary:oe,refreshBackupSummary:re,refreshBackups:ae,setBackupDate:n,backupsLoading:b,autoBackup:I},children:t})}be.propTypes={children:h.any.isRequired};be.defaultProps={};function L(){return y.useContext(Fe)}function ee({...t}){const{blocklet:r}=O(),{info:o}=M(),{t:s}=T(),i=Ne({blocklet:r}),n=gt(o),{spaceGateways:a,addSpaceGateway:d}=L(),u={checkFn:Ue.create({baseURL:he(window.location.origin,St())}).get,webWalletUrl:n,extraParams:{appPid:r.appPid,appDid:i.appDid,appName:i.appName,appDescription:i.appDescription,appUrl:i.appUrl,referrer:i.referrer,scopes:i.scopes,nodeDid:o.did}},c=async({endpoint:p,name:g,did:f})=>{const b=await Tt(p);if(!await It(b)){D.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(a.some(l=>l.endpoint===p)){D.error(s("storage.spaces.gateway.add.duplicate",{name:g}));return}await d({name:g,did:f,url:b,endpoint:p},p)},x=async({spaceGateway:p})=>{try{await c(p)}catch(g){console.error(g),D.error(X(g))}};return e.jsx(rt,{...t,options:u,onSuccess:x})}ee.propTypes={};ee.defaultProps={};function Ke({...t}){const{t:r}=y.useContext(pt),{blocklet:o,loadingDiskInfo:s,actions:i}=O();if(y.useEffect(()=>{i==null||i.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),o.diskInfo){const n=(u,c,x)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?yt(c):"empty"})]}),a=o.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),d=[{key:"appDir",name:r("blocklet.diskInfo.appDir"),value:n(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:r("blocklet.diskInfo.dataDir"),value:n(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:r("blocklet.diskInfo.logDir"),value:n(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:r("blocklet.diskInfo.cacheDir"),value:n(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Yt,{component:"div",...t,children:d.map(u=>e.jsx(Ot,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return s?e.jsx(A,{}):e.jsx(C,{children:r("blocklet.diskInfo.empty")})}const Yt=Je(C)``;function Ce(){const{t}=T(),{setBackupDate:r,backupSummary:o}=L(),s=at({key:"lg"}),i=y.useRef(null),n=Ze(),a=y.useCallback(c=>{r(c)},[r]),d=y.useMemo(()=>{const c=w().add(1,"day"),x=w().subtract(11,"month").startOf("month"),p=new Map(o.map(f=>[f.date,{date:f.date,successCount:f.successCount,errorCount:f.errorCount}])),g=[];for(let f=x.clone();w(f).isBefore(c);f=f.add(1,"day")){const b=f.format("YYYY-MM-DD");g.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return g},[o]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:B,successCount:S,errorCount:l}=d[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${B}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${l}</div>`].join(`
2
- `)},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:Z[600]},{min:-9,max:-6,color:Z[500]},{min:-6,max:-3,color:Z[400]},{min:-3,max:-1,color:Z[300]},{min:0,max:0,color:n.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:n.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,color:n.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:n.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:n.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[w().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),w().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:d.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[d,t,n]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:i,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Lt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&a(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2,children:e.jsxs(W,{direction:s?"column":"row",spacing:s?2:1,width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}Ce.propTypes={};const Ht=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ke({status:t,message:r,createdAt:o}){const{t:s}=T(),i=t===R.BACKUPS.STATUS.PROGRESS&&w().diff(o,"hours")>=R.BACKUPS.TIMEOUT_HOURS,n=i&&s("common.timeoutError"),a=t===R.BACKUPS.STATUS.PROGRESS&&!i,d=t===R.BACKUPS.STATUS.SUCCEEDED&&!i;return a?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):d?e.jsx(V,{type:"success",children:s("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"error",children:s("common.failed")}),"  ",e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:r||n,children:e.jsx(ze,{children:e.jsx(it,{style:{width:"24px",height:"24px"},color:"error"})})})]})}ke.propTypes={status:h.string.isRequired,message:h.string,createdAt:h.string.isRequired};ke.defaultProps={message:""};function Be({metadata:t}){const{t:r}=T();if(Q(t))return e.jsx(V,{type:"success",children:r("common.succeeded")});const o=t.count||0,s=t.size||0,i=ct(s,{iec:!0}),n=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[r("common.fileCount"),": ",o]}),e.jsxs(C,{variant:"body2",children:[r("common.fileSize"),": ",i]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"success",children:r("common.succeeded")})," ",e.jsx(Ht,{title:n,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ze,{children:e.jsx(lt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Be.propTypes={metadata:h.object};Be.defaultProps={metadata:{}};function De(){const{t,locale:r}=T(),{spaceGateways:o,backups:s,backupsLoading:i}=L(),n=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:d=>{var B;const{targetUrl:u,targetName:c,status:x,createdAt:p}=s[d],g=x===R.BACKUPS.STATUS.PROGRESS&&w().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,f=x===R.BACKUPS.STATUS.SUCCEEDED&&!g,b=c||((B=o.find(S=>u==null?void 0:u.includes(xe(S==null?void 0:S.endpoint))))==null?void 0:B.name)||"Unknown DID Space";return f?e.jsx(et,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:d=>{const u=t(d===0?"common.auto":"common.manual");return e.jsx(V,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:d=>w(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:d=>Q(d)?"":w(d).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:d=>{const u=(s==null?void 0:s[d])??{},{status:c,message:x,createdAt:p,metadata:g}=u,f=c===R.BACKUPS.STATUS.PROGRESS&&w().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!f,B=c===R.BACKUPS.STATUS.SUCCEEDED&&!f;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(A,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):B?e.jsx(Be,{metadata:g}):e.jsx(ke,{status:c,message:x,createdAt:p})}}}],[s,o,t]),a=y.useMemo(()=>!(s!=null&&s.length),[s]);return e.jsx(e.Fragment,{children:a?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(mt,{title:"",loading:i,data:s,columns:n,emptyNode:t("storage.spaces.record.emptyData",r),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}De.propTypes={};function $e(){const{t}=T();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(dt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ee,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(Ce,{})]})]}),e.jsx(De,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}$e.propTypes={};var Ee={},Vt=ye;Object.defineProperty(Ee,"__esModule",{value:!0});var qe=Ee.default=void 0,Qt=Vt(je()),Xt=e;qe=Ee.default=(0,Qt.default)((0,Xt.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var we={},Jt=ye;Object.defineProperty(we,"__esModule",{value:!0});var Ye=we.default=void 0,Zt=Jt(je()),Gt=e;Ye=we.default=(0,Zt.default)((0,Gt.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Te={},es=ye;Object.defineProperty(Te,"__esModule",{value:!0});var He=Te.default=void 0,ts=es(je()),ss=e;He=Te.default=(0,ts.default)((0,ss.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function Ie({spaceGateway:t,onConfirm:r,onCancel:o}){const{t:s}=T(),[i,n]=y.useState(!1),[a,d]=y.useState(!1),u=(p,g)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),n(g)},c=async p=>{try{p==null||p.stopPropagation(),d(!0),await(r==null?void 0:r(t)),n(!1)}catch(g){console.error(g),D.error(`${s("storage.space.gateway.delete.failed")}: ${X(g)}`)}finally{n(!1),d(!1)}},x=p=>{u(p,!1),o==null||o(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(q,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(_t,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:s("common.delete")})]}),e.jsx(ft,{title:s("storage.spaces.gateway.delete.title"),open:i,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:a}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:a}},onConfirm:c,onCancel:x,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}Ie.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool}).isRequired,onConfirm:h.func,onCancel:h.func};Ie.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function Re({spaceGateway:t,selected:r,onDelete:o,onConnect:s,enableSwitchToSpace:i,backupInProgress:n,...a}){const{abortBlockletBackup:d}=L(),[u,c]=y.useState(null),{t:x}=T(),[p,g]=y.useState(!1),f=(S,l)=>{S.stopPropagation(),S.preventDefault(),c(l&&S.currentTarget)},b=async S=>{try{g(!0),f(S,!1),await s(t)}catch(l){console.error(l),D.error(l.message)}finally{g(!1)}},B=async S=>{try{g(!0),f(S,!1),await d()}catch(l){console.error(l),D.error(l.message)}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(A,{sx:{ml:1},size:"24px"}):e.jsx(tt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>f(S,!0),...a,children:e.jsx(zt,{})}),e.jsxs(st,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>f(S,!1),children:[e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(t.endpoint?Rt(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(qe,{fontSize:"small"})}),e.jsx(H,{children:x("common.open")})]}),e.jsxs(q,{onClick:S=>{f(S,!1),window.open(Oe(vt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!r&&i&&e.jsxs(q,{onClick:b,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.switchToSpace")})]}),n&&e.jsxs(q,{onClick:B,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Pt,{fontSize:"small"})}),e.jsx(H,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!n&&e.jsx(Ie,{spaceGateway:t,onConfirm:async()=>{c(null),await(o==null?void 0:o(t))},onCancel:()=>c(null)})]})]})}Re.propTypes={spaceGateway:h.shape({name:h.string.isRequired,url:h.string.isRequired,protected:h.bool,endpoint:h.string.isRequired,loading:h.bool}).isRequired,selected:h.bool.isRequired,enableSwitchToSpace:h.bool,onDelete:h.func,onConnect:h.func,backupInProgress:h.bool};Re.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const ns=ge(({className:t,...r})=>e.jsx(Se,{...r,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function ve({spaceGateway:t,spaceStatus:r,selected:o,onConnected:s,onDeleted:i,onBackedUp:n}){const{t:a,locale:d}=T(),{blocklet:u}=O(),{api:c,info:{did:x}}=M(),{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:B,referrer:S}=Ne({blocklet:u}),{backupProgress:l,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:ne,refreshBackups:oe}=L(),[U,z]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:a("storage.spaces.authorize.title",{appName:g},d),scan:a("storage.spaces.authorize.scan",{appName:g},d),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:a("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),re=o&&!U&&r===ue.DISCONNECTED,ae=o&&!U&&!t.loading&&r===ue.CONNECTED,F=o&&U&&r===ue.CONNECTED&&(l==null?void 0:l.progress)>=0,J=async()=>{try{if(await At(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),D.success(a("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s==null||s(null,t);return}}catch(k){console.error(k),s==null||s(k,t);return}v(k=>({...k,open:!0,prefix:he(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ue.create({baseURL:he(t.url,"space")}).get,extraParams:{appDid:p,appName:g,appDescription:f,scopes:b,appUrl:B,referrer:S,nodeDid:x,spaceDid:t.did}}))},ie=async(k,K)=>{const m=K(k.endpoint),N=xe(m),E=k.space?K(k.space):{};if(t.did&&N!==t.did){v(de=>({...de,open:!1}));const $=a("storage.spaces.gateway.switch.failedForMismatchSpace",{name:E!=null&&E.name?E.name:""});D.error($),s==null||s(new Error($),t);return}const P={...t,name:E.name??"DID Space",did:E.did??xe(m),endpoint:m};await te(P),v($=>({...$,open:!1})),s==null||s(null,P)},ce=async()=>{try{if(U)return;z(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),D.error(k.message),n==null||n(k,t)}finally{z(!0)}},le=async()=>{try{await se(t),D.success(a("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),i==null||i(null,t)}catch(k){console.error(k),i==null||i(k,t)}};return y.useEffect(()=>{l!=null&&l.completed?(o&&((l==null?void 0:l.progress)===100?(D.success(a("storage.spaces.backupSuccessfully")),n==null||n(null,t)):l.message&&(n==null||n(new Error(l==null?void 0:l.message),t)),l.progress=0,l.message=""),z(!1),setTimeout(()=>{ne(),oe()},1e3)):l.progress&&z(!0)},[l]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:a("storage.spaces.strategy.backupNow")}),re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:J,children:a("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(ns,{title:(l==null?void 0:l.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:l.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(A,{variant:"determinate",value:l==null?void 0:l.progress,size:14,sx:{mr:1}}),l==null?void 0:l.progress,"%"]})}),e.jsx(ht,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:d},"get-endpoint")]}),e.jsx(Re,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:le,onConnect:J,enableSwitchToSpace:(l==null?void 0:l.completed)||Q(l==null?void 0:l.message),backupInProgress:F})]})}ve.propTypes={spaceGateway:h.shape({did:h.string.isRequired,name:h.string.isRequired,url:h.string.isRequired,endpoint:h.string.isRequired,protected:h.bool,loading:h.bool}).isRequired,spaceStatus:h.string.isRequired,selected:h.bool.isRequired,onConnected:h.func,onDeleted:h.func,onBackedUp:h.func};ve.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Ve({...t}){const{t:r}=T();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:r("storage.spaces.backup.records")})}),e.jsx(Ce,{}),e.jsx(De,{})]})}Ve.propTypes={};function Qe({...t}){const{t:r}=T(),{autoBackup:o,updateAutoBackup:s}=L(),i=async()=>{try{const n=!(o!=null&&o.enabled);await s({enabled:n}),D.success(r(n?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(n){D.error(n.message)}};return e.jsx(Mt,{checked:!!(o!=null&&o.enabled),onChange:i,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:r("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Qe.propTypes={};function os(){const{t}=T(),{spaceGateways:r,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=L(),i=o&&!(r!=null&&r.length),n=({spaceGateway:a,spaceStatus:d,selected:u,refresh:c})=>e.jsx(ve,{spaceGateway:a,spaceStatus:d,selected:u,onConnected:()=>c(),onBackedUp:x=>x&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Qe,{}),e.jsx(ee,{})]}),e.jsx(j,{mt:2,children:i?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(A,{})}):e.jsx(Ae,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:r.map(a=>e.jsx(Ae,{item:!0,xs:12,md:6,children:e.jsx(ut,{endpoint:a.endpoint,selected:s(a),action:n},a.endpoint)}))})})}),e.jsx(Ve,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(Ke,{})]})}function rs(){const{spaceGatewaysFirstLoading:t,spaceGateways:r}=L();return t?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):Q(r)?e.jsx($e,{}):e.jsx(os,{})}function as(){return e.jsx(be,{children:e.jsx(rs,{})})}function is(){const{spaceGateway:t,settingStorageEndpoint:r,updateSpaceGateway:o,hasStorageEndpoint:s,loading:i,storageEndpoint:n}=Nt(),a=fe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return i?e.jsx(_e,{relative:"parent",children:e.jsx(A,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(kt,{spaceGateway:t,settingStorageEndpoint:r}):e.jsx(Bt,{}),e.jsx(j,{sx:a,children:e.jsx(Dt,{onConnect:o,storageEndpoint:n})})]})}function cs(){const{t}=T();return e.jsxs(Ut,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(is,{})]})}function Xe({navOrientation:t,...r}){const{t:o,locale:s}=T(),{blocklet:i}=O(),n=jt({key:"md"}),[a,d]=ot(),u=a.get("tab")||"backup",c=n?"horizontal":t,x=fe(()=>{var l;const B=[{label:o("common.backup"),value:"backup"}],S=(l=i==null?void 0:i.capabilities)==null?void 0:l.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&B.push({label:o("common.storage"),value:"storage"}),B},[s,c]),g=fe(()=>({backup:e.jsx(as,{}),storage:e.jsx(cs,{})}))[u],f=B=>{d(S=>(B==="backup"?S.delete("tab"):S.set("tab",B),S))};if(x.length<=1)return e.jsx(me,{children:g});const b=e.jsx(xt,{tabs:x,current:u,orientation:c,onChange:f,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...r,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(Le,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:g})})]})});if(c==="horizontal")return e.jsxs(j,{...r,children:[e.jsx(Le,{left:b}),e.jsx(me,{sx:{mt:2},children:g})]})}Xe.propTypes={navOrientation:h.oneOf(["vertical","horizontal"])};Xe.defaultProps={navOrientation:"vertical"};const me=ge(j)`
3
- position: relative;
4
- min-height: 66vh;
5
- overflow: hidden;
6
- `;export{Xe as default};
@@ -1 +0,0 @@
1
- import{j as i,aa as g}from"./vendor-mui-core-BV2FUxWJ.js";import{f as x,r as v}from"./vendor-react-DEoibe3W.js";import{u}from"./vendor-hooks-BgUTpb6X.js";import{I as w}from"./invitation-Dsnc8lab.js";import{L as I}from"./landing-page-DrVLCVAm.js";import{a as S,aV as j,j as P}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as T}from"./vendor-arcblock-BlrkGjK9.js";import{g as k}from"./get-safe-url-Q70tRxL7.js";import{u as E,d as L,c as R,s as W,a as C}from"./index-DDoVX3je.js";import"./vendor-utils-rHXShPKm.js";import"./use-passport-id-B-b-_oYF.js";import"./session-C_8V_o-O.js";import"./sdk-DeS3iq37.js";import"./CheckCircle-Caqp5gKY.js";import"./wrap-locale-C_UOH97U.js";import"./lottie-web-jYmAQWuC.js";function y(c){var r;const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:d}=E(),{t:f}=S(),a=s.get("inviteId"),n=s.get("redirect"),h=v.useCallback(async()=>{const{data:t}=await L.get("invitation",{params:{inviteId:a}});return t},[a]),l=u(async(t,o=e=>e)=>{t&&(W(o(t.sessionToken)),C(o(t.refreshToken)),t.visitorId&&j(o(t.visitorId))),await d.refresh(),setTimeout(()=>{if(n){const e=decodeURIComponent(n);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=k(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(I,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(T,{children:i.jsx("title",{children:f("pageTitle.invite")})}),i.jsx(g,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(w,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:l,inService:!0})})]})}export{y as default};
@@ -1 +0,0 @@
1
- import{j as e,ab as w,aa as v}from"./vendor-mui-core-BV2FUxWJ.js";import{a as I,l as P,u as p}from"./vendor-hooks-BgUTpb6X.js";import{I as T}from"./invitation-Dsnc8lab.js";import{L as j}from"./landing-page-DrVLCVAm.js";import{a as k,aV as R,j as S}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as L}from"./vendor-arcblock-BlrkGjK9.js";import{g as E}from"./get-safe-url-Q70tRxL7.js";import{u as C,c as W,s as F,a as N}from"./index-DDoVX3je.js";import{f as H}from"./vendor-react-DEoibe3W.js";import"./vendor-utils-rHXShPKm.js";import"./use-passport-id-B-b-_oYF.js";import"./session-C_8V_o-O.js";import"./sdk-DeS3iq37.js";import"./CheckCircle-Caqp5gKY.js";import"./wrap-locale-C_UOH97U.js";import"./lottie-web-jYmAQWuC.js";function Q(f){var m;const{searchParams:a}=new URL(window.location.href),{api:r,session:d}=C(),u=H(),{t:h}=k(),n=a.get("id"),c=a.get("redirect"),l=I({state:""}),s=P(async()=>{if(!n)return null;const{data:t}=await r.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),g=p(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),x=p(async(t,i=o=>o)=>{t&&(t.sessionToken&&F(i(t.sessionToken)),t.refreshToken&&N(i(t.refreshToken)),t.visitorId&&R(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.href=E(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return s.loading?e.jsx(w,{}):e.jsxs(j,{did:(m=window.blocklet)==null?void 0:m.appPid,children:[e.jsx(L,{children:e.jsx("title",{children:h("pageTitle.issuePassport")})}),e.jsx(v,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(T,{...f,action:"issue-passport",getDataFn:g,checkFn:r.get,createPassportSvg:W,onLoginSuccess:x,inService:!0,status:l.state})})]})}export{Q as default};
@@ -1 +0,0 @@
1
- import{j as e,T as w,be as y,e as P,v as z,aa as n,H as t}from"./vendor-mui-core-BV2FUxWJ.js";import{h as A,bl as C,bm as E,$ as j,bn as L}from"./vendor-ux-did-connect-2jRoUb28.js";import{l as M}from"./vendor-arcblock-BlrkGjK9.js";import{f as R}from"./vendor-hooks-BgUTpb6X.js";function $({linkProps:r,showExtra:o,...a}){return e.jsxs(w,{...a,children:["Powered by"," ",e.jsx(y,{href:"https://www.arcblock.io",target:"_blank",...r,children:"ArcBlock"}),"'s"," ",e.jsx(y,{href:"https://www.blocklet.io",target:"_blank",...r,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function k({did:r,children:o,title:a,description:d,actions:u,logo:i,logoSize:c,poweredBy:x,termsOfUse:m,standalone:v}){const s=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{},{palette:g}=P(),f=z(l=>l.breakpoints.down("lg")),I=M({meta:s}),T=R(()=>{const l=s.appPid,b=A.isEthereumDid(l),D=b?void 0:C(l);return b?E(l):D.color},[s==null?void 0:s.appPid]);if(!r)return o;a===void 0&&(a=s.appName),d===void 0&&(d=s.appDescription),i===void 0&&(i=I||""),typeof i=="string"&&(i?i=e.jsx(n,{sx:{height:c,maxHeight:c,objectFit:"contain"},component:"img",src:i,alt:`${s.appName}'s logo`}):i=e.jsx(j,{size:c,did:r,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx($,{linkProps:{color:g.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!f,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!f&&(p=e.jsx(n,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:r,variant:"rounded"})}));const B=!!o;let h=!v;return f&&(h=!B),e.jsxs(n,{sx:{width:"100vw",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",px:{xs:2,sm:4,md:8},pt:{xs:2,sm:4,md:6},pb:{xs:5,md:8},background:`radial-gradient(circle at bottom right, ${L(T,.3)} 10%, ${g.background.default} 50%)`,position:"relative"},children:[e.jsxs(n,{sx:{maxWidth:1200,display:"flex",alignItems:"center",justifyContent:[h,p].filter(Boolean).length>1?"space-between":"center",width:"100%",margin:"auto"},children:[h?e.jsxs(n,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(n,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(w,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:a}),d?e.jsx(n,{variant:"h5",sx:{mb:2,color:"text.secondary"},children:d}):null,u?e.jsx(n,{sx:{mt:8},children:u}):null,m?e.jsx(n,{sx:{mt:-1,color:"grey"},children:m}):null]}):null,p]}),e.jsx(n,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}k.propTypes={did:t.string.isRequired,children:t.any.isRequired,title:t.any,description:t.any,logo:t.any,logoSize:t.number,actions:t.any,poweredBy:t.any,termsOfUse:t.any,standalone:t.bool};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:50,standalone:!1};export{k as L};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CsXmgylH.js","assets/vendor-ux-did-connect-2jRoUb28.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-hooks-BgUTpb6X.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-BlrkGjK9.js","assets/index-Bs1kxR8_.js","assets/index-DDoVX3je.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as U,b as be}from"./vendor-react-DEoibe3W.js";import{a as B,d as H,j as K,a0 as M,_ as ve,$ as ne,Y as $,b6 as ye,a9 as Ce,a2 as Te}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as o,j as e,D as G,aj as Q,I as X,t as Y,al as E,T as I,aa as p,O as w,bq as y,bK as we,bQ as oe,bs as se,bR as ae,X as J,ak as ce,z as de,y as L,ab as Z,ad as Se}from"./vendor-mui-core-BV2FUxWJ.js";import{B as ue}from"./vendor-arcblock-BlrkGjK9.js";import{d as ke}from"./Edit-CUl1Rt8i.js";import{U as Ie,C as Re,I as Ae}from"./index-D1kTR2xk.js";import{_ as qe}from"./dot-itVN8XTt.js";import{l as pe}from"./index-BKKwhjBs.js";import{D as F,aB as he,aC as S,G as Oe}from"./index-DDoVX3je.js";import{u as _}from"./dashboard-xUr1SbPS.js";import{o as Pe,c as Ne,A as re}from"./vendor-utils-rHXShPKm.js";import{T as De}from"./index-BU2FTGFr.js";import{E as Ee}from"./empty-spinner-BdaCO6xq.js";import{C as v}from"./click-to-copy-R7MF4AwY.js";import{D as We}from"./delete-confirm-DNn4Os6R.js";import{b as ze}from"./passport-item-C5-ZuTPM.js";import{A as Le}from"./actions-DP7pj6xB.js";import{T as le}from"./table-tips-BfSSGl9N.js";import{u as Be}from"./use-mobile-BAa0wi8o.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./useAsync-510ntT1B.js";import"./useLocalStorage-D6gvgmEW.js";import"./index-8eXqqyHQ.js";import"./confirm-Vzr2I9eM.js";import"./PlayArrow-CDOOUxMp.js";import"./get-safe-url-c4iAcpvA.js";import"./session-C_8V_o-O.js";import"./use-blocklet-logo-Bhkp-Zm7.js";import"./InfoOutlined-D3XnF0Vg.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C21X4TYN.js";import"./vendor-mui-x-Bo-XOtzq.js";import"./AdapterDayjs-CDDcwz3P.js";import"./did-address-Dq-4__HB.js";import"./util-DMfPwzVN.js";import"./base32-WurN0cIW.js";import"./MoreHoriz-DpKn_fkc.js";const Fe={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function me({onCreated:r,onClose:u}){const[i,m]=U.useState(!1),{t:n,locale:s}=B(),{api:g}=F(),{teamDid:h}=_(),{control:f,handleSubmit:q,formState:{errors:a},watch:k,setValue:x}=he({defaultValues:Fe,mode:"onChange"}),T=k("scope"),R=c=>{c!=="profile:read"&&x("scope",T.includes(c)?T.filter(d=>d!==c):[...T,c])},N=async c=>{m(!0);try{const d={...c,redirectUris:c.redirectUris,contacts:c.contacts?c.contacts.split(",").map(O=>O.trim()):[],scope:c.scope.join(" ")};await g.createOAuthClient({input:{teamDid:h,input:Pe(d,Ne)}}),r(d)}catch(d){M.error(d.message||"Failed to create OAuth App")}finally{m(!1)}};return e.jsxs(G,{open:!0,onClose:u,maxWidth:"md",fullWidth:!0,children:[e.jsxs(Q,{children:[n("oauth.client.register")," ",e.jsx(X,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(E,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:n("oauth.client.requiredInformation")}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:f,rules:{required:n("oauth.client.validate.clientName"),minLength:{value:3,message:n("oauth.client.validate.clientNameMinLength")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.name"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientNamePlaceholder"),error:!!a.clientName,helperText:(d=a.clientName)==null?void 0:d.message}),e.jsx(y,{children:n("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:f,rules:{required:n("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.clientUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientUriPlaceholder"),error:!!a.clientUri,helperText:(d=a.clientUri)==null?void 0:d.message}),e.jsx(y,{children:n("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:f,rules:{required:n("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.redirectUrisInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.redirectUrisPlaceholder"),error:!!a.redirectUris,helperText:(d=a.redirectUris)==null?void 0:d.message}),e.jsxs(p,{sx:{display:"flex",gap:"2px"},children:[e.jsx(y,{children:n("oauth.client.helperText.redirectUris")}),e.jsx(y,{children:n("oauth.client.helperText.read")}),e.jsx(y,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:n("oauth.client.helperText.document")}),e.jsx(y,{children:n("oauth.client.helperText.more")})]})]})}})}),e.jsxs(we,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:n("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([c,d])=>e.jsx(se,{control:e.jsx(ae,{checked:T.includes(c),onChange:()=>R(c),disabled:c==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:d})})},c))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:n("oauth.client.optionalInformation")}),e.jsx(E,{children:e.jsx(S,{name:"contacts",control:f,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:n("oauth.client.validate.contacts")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.contacts"),fullWidth:!0,placeholder:n("oauth.client.input.contactsPlaceholder"),error:!!a.contacts,helperText:(d=a.contacts)==null?void 0:d.message}),e.jsx(y,{children:n("oauth.client.helperText.contacts")})]})}})}),e.jsxs(E,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.tosUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.tosUri"),fullWidth:!0,placeholder:n("oauth.client.input.tosUriPlaceholder"),error:!!a.tosUri,helperText:(d=a.tosUri)==null?void 0:d.message}),e.jsx(y,{children:n("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.policyUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.policyUri"),fullWidth:!0,placeholder:n("oauth.client.input.policyUriPlaceholder"),error:!!a.policyUri,helperText:(d=a.policyUri)==null?void 0:d.message}),e.jsx(y,{children:n("oauth.client.helperText.policyUri")})]})}})]}),a.error&&e.jsx(ce,{severity:"error",children:a.error.message})]})}),e.jsxs(de,{children:[e.jsx(L,{onClick:u,children:n("common.cancel")}),e.jsxs(L,{onClick:q(N),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Z,{size:20,sx:{mr:1}}):null,n("oauth.client.registerButton")]})]})]})}me.propTypes={onCreated:o.func.isRequired,onClose:o.func.isRequired};function V({scope:r,...u}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(E,{direction:"row",flexWrap:"wrap",gap:1,...u,children:i.map(m=>e.jsx(be.Fragment,{children:e.jsx(Se,{title:K.OAUTH_SCOPES[m],children:e.jsx(v,{children:m})})},m))})}V.propTypes={scope:o.string};V.defaultProps={scope:""};const ee=r=>{const{prefix:u}=F(),{blocklet:i}=Oe(),m=re(u,"/api/media/upload",i.appPid),n=U.useCallback(g=>g?g.startsWith("http")?g:`${re(u,"/api/media/upload",i.appPid)}/${g}`:"",[u,i.appPid]);return{clientLogoUrl:U.useMemo(()=>n(r),[r,n]),apiPath:m,getClientLogoUrl:n}},_e=U.lazy(()=>ve(()=>import("./index-CsXmgylH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function xe({client:r,onUpdate:u,onClose:i}){const[m,n]=U.useState(!1),{t:s,locale:g}=B(),h=U.useRef(null),{api:f}=F(),{teamDid:q}=_(),{control:a,handleSubmit:k,formState:{errors:x},watch:T,setValue:R,getValues:N}=he({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),c=T("scope"),d=T("logoUri"),{clientLogoUrl:O,apiPath:D}=ee(d),A=l=>{l!=="profile:read"&&R("scope",c.includes(l)?c.filter(t=>t!==l):[...c,l])},W=async l=>{const t={clientId:r.clientId,clientName:l.clientName.trim(),clientUri:l.clientUri,redirectUris:l.redirectUris.split(",").map(C=>C.trim()).filter(Boolean),contacts:l.contacts?l.contacts.split(",").map(C=>C.trim()):[],scope:l.scope.join(" "),tosUri:l.tosUri,policyUri:l.policyUri,logoUri:l.logoUri,clientSecretExpiresAt:l.clientSecretExpiresAt?parseInt(l.clientSecretExpiresAt/1e3,10):null};await f.updateOAuthClient({input:{teamDid:q,input:t}})},z=async l=>{n(!0);try{await W(l),u(),i()}catch(t){M.error(t.message||s("oauth.client.updateFailed"))}finally{n(!1)}};return e.jsxs(G,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(Q,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsxs(E,{spacing:3,sx:{mt:2},children:[e.jsxs(p,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(p,{children:[e.jsx(p,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:O?e.jsx(p,{children:e.jsx("img",{src:O,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(p,{onClick:()=>{var l;(l=h.current)==null||l.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ue,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(L,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var l;(l=h.current)==null||l.open()},children:s(O?"common.change":"common.upload")})]}),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(U.Suspense,{fallback:e.jsx(Ee,{}),children:e.jsx(_e,{ref:h,locale:g,popup:!0,onUploadFinish:l=>{R("logoUri",l.data.filename),W(N()).then(()=>{u()}).catch(t=>{M.error(t.message||s("oauth.client.updateFailed"))}).finally(()=>{var t;(t=h.current)==null||t.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:D,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:a,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!x.clientName,helperText:(t=x.clientName)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:a,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!x.clientUri,helperText:(t=x.clientUri)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:a,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!x.redirectUris,helperText:(t=x.redirectUris)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsx(S,{name:"clientSecretExpiresAt",control:a,render:({field:l})=>e.jsx(De,{placeholder:s("oauth.client.input.expireTime"),value:l.value*1e3,onChange:t=>{l.onChange(t)}})}),e.jsxs(p,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(K.OAUTH_SCOPES).map(([l,t])=>e.jsx(se,{control:e.jsx(ae,{checked:c.includes(l),onChange:()=>A(l),disabled:l==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:t})})},l))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(p,{children:e.jsx(S,{name:"contacts",control:a,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!x.contacts,helperText:(t=x.contacts)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(E,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!x.tosUri,helperText:(t=x.tosUri)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!x.policyUri,helperText:(t=x.policyUri)==null?void 0:t.message}),e.jsx(y,{children:s("oauth.client.helperText.policyUri")})]})}})]}),x.error&&e.jsx(ce,{severity:"error",children:x.error.message})]})}),e.jsxs(de,{children:[e.jsx(L,{onClick:i,children:s("common.cancel")}),e.jsx(L,{onClick:k(z),disabled:m,variant:"contained",color:"primary",children:m?e.jsx(Z,{size:16}):s("common.update")})]})]})}xe.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function je({client:r,onUpdate:u,onClose:i}){return e.jsx(xe,{client:r,onUpdate:m=>u(m),onClose:i})}je.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function te(r){const{t:u}=B(),{api:i}=F(),{teamDid:m}=_(),{clientId:n,clientName:s,onDelete:g=()=>{},onClose:h=()=>{}}=r,f=()=>{h()},q=async()=>{try{await i.deleteOAuthClient({input:{teamDid:m,clientId:n}}),g()}catch(k){M.error(k==null?void 0:k.message)}finally{f()}},a={keyName:s,title:u("oauth.client.delete.title"),description:u("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:u("oauth.client.delete.description",{name:s}),confirm:u("common.delConfirm"),cancel:u("common.cancel"),onConfirm:q,onCancel:f};return e.jsx(We,{keyName:a.keyName,title:a.title,description:a.description,confirmPlaceholder:a.confirmPlaceholder,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})}te.propTypes={clientId:o.string.isRequired,clientName:o.string.isRequired,onDelete:o.func,onClose:o.func};te.defaultProps={onDelete:()=>{},onClose:()=>{}};function ge({title:r,items:u}){return e.jsxs(p,{mb:3,children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(E,{spacing:1.5,children:u.map(({label:i,value:m})=>e.jsxs(p,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:m||"-"})]},i))})]})}ge.propTypes={title:o.string.isRequired,items:o.arrayOf(o.shape({label:o.string.isRequired,value:o.any})).isRequired};function fe({client:r,onClose:u}){const{t:i,locale:m}=B(),{teamDid:n}=_(),{clientName:s,clientId:g,clientSecret:h,redirectUris:f,scope:q,clientUri:a,logoUri:k,contacts:x,tosUri:T,policyUri:R,jwksUri:N,jwks:c,softwareId:d,softwareVersion:O,clientIdIssuedAt:D,clientSecretExpiresAt:A,updatedAt:W,createUser:z}=r,{clientLogoUrl:l}=ee(k),t=j=>{try{const P=new URL(window.blocklet.appUrl);return P.pathname=j,P.toString()}catch{return"-"}},C=pe.fromAppDid(g,n),b=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(ne,{variant:"rounded",shape:"square",src:l,did:C.address,size:64})},{label:i("oauth.client.clientUri"),value:a?e.jsx(v,{children:a}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:g})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:h})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(f||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(V,{scope:q})},{label:i("oauth.client.createUser"),value:z?ze(z,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:t("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/authorize")})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/token")})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/userinfo")})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:t("/.well-known/service/oauth/jwks")})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/register")})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/logout")})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:x.length?e.jsx(v,{children:(x||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:N},{label:i("oauth.client.jwks"),value:c},{label:i("oauth.client.softwareId"),value:d},{label:i("oauth.client.softwareVersion"),value:O}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:D?e.jsx($,{value:D*1e3,type:"all",locale:m}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:A?e.jsx($,{value:A*1e3,type:"all",locale:m}):"-"},{label:i("common.updatedAt"),value:W?e.jsx($,{value:W,type:"all",locale:m}):"-"}]}].filter(Boolean);return e.jsxs(G,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(Q,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(H,{})})]}),e.jsx(Y,{children:e.jsx(p,{mt:1,children:b.map((j,P)=>e.jsxs(p,{children:[e.jsx(ge,{title:j.title,items:j.items}),P!==b.length-1&&e.jsx(J,{sx:{my:2}})]},j.title))})})]})}fe.propTypes={client:o.object.isRequired,onClose:o.func.isRequired};function $e(r){return e.jsx($,{value:r*1e3})}function ie({selected:r,onClose:u}){return r?e.jsx(fe,{client:r,onClose:u}):null}ie.propTypes={selected:o.object,onClose:o.func.isRequired};ie.defaultProps={selected:null};function Ue({open:r,onCreated:u,onClose:i}){return r?e.jsx(me,{onCreated:u,onClose:i}):null}Ue.propTypes={open:o.bool.isRequired,onCreated:o.func.isRequired,onClose:o.func.isRequired};function Ot(){var l;const[r,u]=U.useState({searchText:"",pageSize:10,page:1}),[i,m]=U.useState(null),[n,s]=U.useState(!1),g=U.useRef(null),{t:h,locale:f}=B(),{api:q}=F(),{teamDid:a}=_(),[k,x]=U.useState(null),[T,R]=U.useState(null),N=Be(),{getClientLogoUrl:c}=ee(),d=qe(async()=>await q.getOAuthClients({input:{teamDid:a,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:O}=d,D=U.useMemo(()=>{var t;return((t=d.value)==null?void 0:t.list)||[]},[(l=d.value)==null?void 0:l.list]),A=U.useMemo(()=>r.searchText?D.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):D,[r.searchText,D]),W=U.useMemo(()=>[{label:h("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:C})=>{const b=A[C],j=c(b.logoUri),P=pe.fromAppDid(b.clientId,a);return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(p,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},children:[e.jsx(ne,{variant:"rounded",shape:"square",did:P.address,src:j,size:48}),e.jsxs(E,{gap:.5,children:[e.jsx(p,{sx:{color:"text.primary"},children:b.clientName}),e.jsx(p,{sx:{color:"text.secondary"},children:b.clientUri})]})]})})}}},{label:h("oauth.client.clientId"),name:"clientId"},{label:h("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(V,{scope:t})}},{label:h("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:$e}},{label:h("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Ie,{showDid:!0,did:t,cardType:Re.Detailed,infoType:Ae.Minimal,sx:{border:0,padding:0}}):h("oauth.client.openRegistration")}},{label:h("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:C})=>{const b=A[C];return e.jsx(Le,{actions:[{icon:e.jsx(ke,{}),text:h("common.edit"),onClick:j=>{j.stopPropagation(),x(b)}},{icon:e.jsx(ye,{}),text:h("common.delete"),onClick:j=>{j.stopPropagation(),R(b)}}]})}}}],[A,h,c,a,x,R]),z=({page:t,rowsPerPage:C,searchText:b})=>{r.pageSize!==C?u(j=>({...j,searchText:"",pageSize:C,page:1})):r.page!==t+1?u(j=>({...j,searchText:"",page:t+1})):r.searchText!==b&&u(j=>({...j,searchText:b,page:1}))};return e.jsxs(p,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[N?e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}):null,e.jsx(Ce,{data:A,columns:W,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:A.length,searchDebounceTime:400,onRowClick(t,{dataIndex:C},b){var j;if((j=g.current)!=null&&j.contains(b.target)){const P=A[C];m(P)}}},onChange:z,title:N?null:e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}),customButtons:[e.jsxs(L,{variant:"contained",size:"small",onClick:()=>s(!0),children:[O?e.jsx(Z,{size:16}):e.jsx(ue,{style:{fontSize:16}}),h("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Te,{children:h("oauth.client.empty")})}),e.jsx(ie,{selected:i,onClose:()=>m(null)}),e.jsx(Ue,{open:n,onCreated:()=>{s(!1),d.retry()},onClose:()=>s(!1)}),k&&e.jsx(je,{client:k,onUpdate:d.retry,onClose:()=>x(null)}),T&&e.jsx(te,{...T,onDelete:d.retry,onClose:()=>R(null)})]})}export{Ot as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-BV2FUxWJ.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-1mTu0Fgs.js";import"./vendor-ux-did-connect-2jRoUb28.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BlrkGjK9.js";import"./TuneOutlined-D0gGDoIJ.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};
@@ -1 +0,0 @@
1
- import{H as a,j as e,aa as p,T as b,ad as V,y as z,ab as de}from"./vendor-mui-core-BV2FUxWJ.js";import{d as pe,f as ue,u as fe,m as ge}from"./vendor-hooks-BgUTpb6X.js";import{r as ee,f as me}from"./vendor-react-DEoibe3W.js";import{H as X}from"./vendor-arcblock-BlrkGjK9.js";import{A as E,c as R,z as he,I as we}from"./vendor-utils-rHXShPKm.js";import{$ as xe,Z as ye,a as ne,a7 as $,o as Pe,aS as ve,C as Ie,aT as je,j as W,ah as ke,ag as Ce,aU as be,a0 as J,aV as Te,aW as _e,aX as Le,p as G}from"./vendor-ux-did-connect-2jRoUb28.js";import{u as Re}from"./use-passport-id-B-b-_oYF.js";import{g as Z}from"./get-safe-url-Q70tRxL7.js";import{u as We,s as Ae,a as Ee,b as Y}from"./index-DDoVX3je.js";import{d as A}from"./logger-BAVOmOw2.js";import{d as Se}from"./LaunchOutlined-E7HcQu_6.js";import"./lottie-web-jYmAQWuC.js";function S({blocklet:s}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(xe,{variant:"rounded",shape:"square",did:s.appPid,src:s.appLogo,size:80}),e.jsx(b,{component:"h2",variant:"h6",children:s.appName}),e.jsx(ye,{did:s.appPid})]})}const Ue=ee.memo(S);S.propTypes={blocklet:a.shape({appName:a.string,appLogo:a.string,appPid:a.string})};S.defaultProps={blocklet:window.blocklet};const Ne=()=>{var r,i;const s=(i=(r=window.blocklet)==null?void 0:r.componentMountPoints)==null?void 0:i.find(m=>m.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk");return s==null?void 0:s.mountPoint};function U({children:s,cta:r,...i}){return e.jsxs(p,{...i,children:[s?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:s}):null,r?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:r}):null]})}U.propTypes={children:a.node,cta:a.node};U.defaultProps={children:null,cta:null};function N({passports:s,onConnect:r,onClose:i,redirect:m,...T}){const{t:u}=ne(),x=Ne(),v=c=>{const g=c==null?void 0:c.payable;return x&&g?E(x,`/api/redirect/checkout/${g}?redirect=${m}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(Ue,{}),e.jsx(U,{...T,cta:e.jsxs(e.Fragment,{children:[e.jsx(b,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:u("login.accessLimit.title")}),e.jsx(b,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:u("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:s==null?void 0:s.map(c=>{const g=v(c);return g?e.jsx(V,{title:u("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(z,{color:"primary",variant:"contained",endIcon:e.jsx(Se,{}),href:g,target:"_blank",children:c.title||c.name})},c.name):e.jsx(V,{title:u("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(z,{color:"inherit",variant:"contained",onClick:r,children:c.title||c.name})},c.name)})}),e.jsxs(b,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:u("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:r,children:u("common.connect")})]})]})})]})}N.propTypes={passports:a.arrayOf(a.shape({name:a.string.isRequired,title:a.string,payable:a.string})),onConnect:a.func,onClose:a.func,redirect:a.string.isRequired};N.defaultProps={passports:[],onConnect:()=>{},onClose:()=>{}};function $e(){const s=ee.useRef(null),{session:r}=We(),{t:i,locale:m}=ne(),{getPassportId:T}=Re(),u=me(),x=$(),v=Pe(),{encryptKey:c,decrypt:g}=ve(),I=pe(r),{searchParams:t}=new URL(window.location.href),h={passportId:T()},D=t.get("componentId"),q=t.get("authenticated"),te=t.get("sessionToken"),oe=t.get("refreshToken"),ie=t.get("requiredRoles"),f=t.get("redirect"),d=t.get("forceConnected"),j=t.get("sourceAppPid"),_=t.get("origin"),H=t.get("autoConnectWebview"),F=t.get("popup"),K=t.get("showQuickConnect");let w=t.get("inviter");if(!w&&f)try{w=(f.startsWith("http")?new URL(f):new URL(f,window.location.origin)).searchParams.get("inviter")}catch{}w=w||localStorage.getItem("inviter"),D&&(h.componentId=D),x&&(h.visitorId=x),w&&(h.inviter=w),we(j)||(j==="null"?h.sourceAppPid=null:j!==null&&(h.sourceAppPid=j));let B=[];try{B=JSON.parse(ie)}catch{}const se=async n=>{const o=t.get("fromWallet");A("login page notifyWallet",{data:n,fromWallet:o,"browser.wallet":v.wallet}),n&&String(o)==="1"&&v.wallet&&await Promise.any([G.asyncCall("arcSetToken",n),Y(3e3)])},L=n=>t.get("encrypted")?g(n):n,M=async n=>{n&&await se(n),setTimeout(()=>{if(f){const o=decodeURIComponent(f);o.startsWith(W.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.replace(Z(o))}else window.location.replace(window.env.pathPrefix||"/")},50)},re=n=>{const o={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:$(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};A("bridge callArc: onLogin",o),G.callArc("onLogin",o)},O=async(n,o)=>{const y=o(n.sessionToken),k=o(n.refreshToken),P=o(n.visitorId);A("login page onLogin",{result:n,decodeSessionToken:y,decodeRefreshToken:k,decodeVisitorId:P}),Ae(y),Ee(k),n.visitorId&&Te(P),await r.refresh(),await Y(100),re(I.current);const l={};t.get("saveConnect")?(l.connected_did=I.current.user.did,l.connected_pk=I.current.user.pk,l.connected_wallet_os=I.current.walletOS,l.connected_app=_e()):(l.connected_did=t.get("connected_did"),l.connected_pk=t.get("connected_pk"),l.connected_app=t.get("connected_app"),l.connected_wallet_os=t.get("connected_wallet_os")),Le(l,!0),M({sessionToken:y,refreshToken:k,visitorId:P})},ae=ue(()=>_==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,_,i]),Q=fe(()=>{const n=window==null?void 0:window.blocklet,o={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:O,onError:ce,locale:m,messages:ae,extraParams:h,baseUrl:window.location.origin,prefix:E(window.location.origin,W.WELLKNOWN_SERVICE_PATH_PREFIX,je)};d&&(o.forceConnected=d,o.extraParams.enableSwitchApp=!1,o.extraParams.forceConnected=d),o.options||(o.options={}),_==="switch-did"?o.options.showQuickConnect=!0:R(K)||([!1,"false"].includes(K)?o.options.showQuickConnect=!1:o.options.showQuickConnect=!0);const y=ke(),P=Ce()?y.appUrl:window.location.origin,l=E(P,W.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),C={params:be(encodeURIComponent(JSON.stringify(o))),appPid:n==null?void 0:n.appPid,appName:n==null?void 0:n.appName,locale:m,redirect:window.location.href,_ek_:c};R(H)||(C.autoConnectWebview=H),R(F)||(C.popup=F),C.disableClose=!0,window.location.href=Z(he(l,C),{allowDomains:null})});ge(()=>{if(t.get("sessionToken")){const n=t.get("visitorId");if(!n){J.error("Unexpected login response from server: visitorId is required");return}O({sessionToken:L(te),refreshToken:L(oe),visitorId:L(n)},o=>o)}else!r.user||d&&r.user.did!==d?Q():!q&&!t.get("sessionToken")&&M()});const ce=n=>{J.error(n.message)},le=t.has("popup");if(r.loading||r.user){if(!q||t.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx(X,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(Ie,{children:le?null:e.jsx(de,{})})]});const n=f?new URL(f,window.location.origin).href:window.location.href;return e.jsx(N,{onConnect:Q,passports:B,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx(X,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:s})]})}export{$e as default};
@@ -1 +0,0 @@
1
- import{a9 as $,j as w,H as h,al as He,bc as ri,T as pe,ad as Pi,s as yi,E as ki,aa as Ue}from"./vendor-mui-core-BV2FUxWJ.js";import{r as q,a as Ne,Y as Li,b as oi}from"./vendor-ux-did-connect-2jRoUb28.js";import{U as $i,C as qi,I as Ni}from"./index-D1kTR2xk.js";import{r as Bi,b as ke}from"./vendor-react-DEoibe3W.js";import{f as Fi}from"./vendor-hooks-BgUTpb6X.js";import{W as ze}from"./did-address-Dq-4__HB.js";import{p as Vi}from"./util-DMfPwzVN.js";import{u as Wi}from"./dashboard-xUr1SbPS.js";var Be={},Gi=$;Object.defineProperty(Be,"__esModule",{value:!0});var De=Be.default=void 0;Ki(Bi);var Xi=Gi(q()),Yi=w;function _i(e){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(_i=function(u){return u?s:i})(e)}function Ki(e,i){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var s=_i(i);if(s&&s.has(e))return s.get(e);var u={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in e)if(b!=="default"&&Object.prototype.hasOwnProperty.call(e,b)){var d=l?Object.getOwnPropertyDescriptor(e,b):null;d&&(d.get||d.set)?Object.defineProperty(u,b,d):u[b]=e[b]}return u.default=e,s&&s.set(e,u),u}De=Be.default=(0,Xi.default)((0,Yi.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"}),"Apple");var Fe={},Zi=$;Object.defineProperty(Fe,"__esModule",{value:!0});var Ri=Fe.default=void 0,Ji=Zi(q()),Qi=w;Ri=Fe.default=(0,Ji.default)((0,Qi.jsx)("path",{d:"M20 18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Laptop");var Ve={},et=$;Object.defineProperty(Ve,"__esModule",{value:!0});var fe=Ve.default=void 0,it=et(q()),tt=w;fe=Ve.default=(0,it.default)((0,tt.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"}),"Web");var We={},rt=$;Object.defineProperty(We,"__esModule",{value:!0});var Si=We.default=void 0,ot=rt(q()),at=w;Si=We.default=(0,ot.default)((0,at.jsx)("path",{d:"m17.6 9.48 1.84-3.18c.16-.31.04-.69-.26-.85-.29-.15-.65-.06-.83.22l-1.88 3.24c-2.86-1.21-6.08-1.21-8.94 0L5.65 5.67c-.19-.29-.58-.38-.87-.2-.28.18-.37.54-.22.83L6.4 9.48C3.3 11.25 1.28 14.44 1 18h22c-.28-3.56-2.3-6.75-5.4-8.52M7 15.25c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25m10 0c-.69 0-1.25-.56-1.25-1.25s.56-1.25 1.25-1.25 1.25.56 1.25 1.25-.56 1.25-1.25 1.25"}),"Android");var Ge={},nt=$;Object.defineProperty(Ge,"__esModule",{value:!0});var Oi=Ge.default=void 0,st=nt(q()),lt=w;Oi=Ge.default=(0,st.default)((0,lt.jsx)("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphone");var Xe={},dt=$;Object.defineProperty(Xe,"__esModule",{value:!0});var Ei=Xe.default=void 0,ct=dt(q()),ut=w;Ei=Xe.default=(0,ct.default)((0,ut.jsx)("path",{d:"M21 4H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 1.99-.9 1.99-2L23 6c0-1.1-.9-2-2-2m-2 14H5V6h14z"}),"Tablet");var Ye={},wt=$;Object.defineProperty(Ye,"__esModule",{value:!0});var be=Ye.default=void 0,ft=wt(q()),bt=w;be=Ye.default=(0,ft.default)((0,bt.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"DesktopWindows");var pt="2.0.3",Pe=500,ai="user-agent",W="",ni="?",me="function",z="undefined",G="object",Le="string",x="browser",A="cpu",O="device",R="engine",_="os",F="result",a="name",t="type",o="vendor",n="version",y="architecture",se="major",r="model",ae="console",f="mobile",v="tablet",g="smarttv",S="wearable",_e="xr",ne="embedded",J="inapp",Ke="brands",L="formFactors",Ze="fullVersionList",V="platform",Je="platformVersion",ve="bitness",D="sec-ch-ua",mt=D+"-full-version-list",ht=D+"-arch",vt=D+"-"+ve,gt=D+"-form-factors",xt=D+"-"+f,yt=D+"-"+r,Ai=D+"-"+V,kt=Ai+"-version",Ci=[Ke,Ze,f,r,V,Je,y,L,ve],ce="Amazon",N="Apple",si="ASUS",li="BlackBerry",P="Google",di="Huawei",ci="Lenovo",ui="Honor",ue="LG",Re="Microsoft",Se="Motorola",Oe="Nvidia",wi="OnePlus",Ee="OPPO",Q="Samsung",fi="Sharp",ee="Sony",Ae="Xiaomi",Ce="Zebra",bi="Chrome",pi="Chromium",I="Chromecast",_t="Edge",ie="Firefox",te="Opera",je="Facebook",mi="Sogou",B="Mobile ",re=" Browser",$e="Windows",Rt=typeof window!==z,k=Rt&&window.navigator?window.navigator:void 0,H=k&&k.userAgentData?k.userAgentData:void 0,St=function(e,i){var s={},u=i;if(!he(i)){u={};for(var l in i)for(var b in i[l])u[b]=i[l][b].concat(u[b]?u[b]:[])}for(var d in e)s[d]=u[d]&&u[d].length%2===0?u[d].concat(e[d]):e[d];return s},ge=function(e){for(var i={},s=0;s<e.length;s++)i[e[s].toUpperCase()]=e[s];return i},qe=function(e,i){if(typeof e===G&&e.length>0){for(var s in e)if(C(e[s])==C(i))return!0;return!1}return Y(e)?C(i).indexOf(C(e))!==-1:!1},he=function(e,i){for(var s in e)return/^(browser|cpu|device|engine|os)$/.test(s)||(i?he(e[s]):!1)},Y=function(e){return typeof e===Le},Te=function(e){if(e){for(var i=[],s=X(/\\?\"/g,e).split(","),u=0;u<s.length;u++)if(s[u].indexOf(";")>-1){var l=le(s[u]).split(";v=");i[u]={brand:l[0],version:l[1]}}else i[u]=le(s[u]);return i}},C=function(e){return Y(e)?e.toLowerCase():e},Me=function(e){return Y(e)?X(/[^\d\.]/g,e).split(".")[0]:void 0},j=function(e){for(var i in e){var s=e[i];typeof s==G&&s.length==2?this[s[0]]=s[1]:this[s]=void 0}return this},X=function(e,i){return Y(i)?i.replace(e,W):i},oe=function(e){return X(/\\?\"/g,e)},le=function(e,i){if(Y(e))return e=X(/^\s\s*/,e),typeof i===z?e:e.substring(0,Pe)},Ie=function(e,i){if(!(!e||!i))for(var s=0,u,l,b,d,p,c;s<i.length&&!p;){var m=i[s],E=i[s+1];for(u=l=0;u<m.length&&!p&&m[u];)if(p=m[u++].exec(e),p)for(b=0;b<E.length;b++)c=p[++l],d=E[b],typeof d===G&&d.length>0?d.length===2?typeof d[1]==me?this[d[0]]=d[1].call(this,c):this[d[0]]=d[1]:d.length===3?typeof d[1]===me&&!(d[1].exec&&d[1].test)?this[d[0]]=c?d[1].call(this,c,d[2]):void 0:this[d[0]]=c?c.replace(d[1],d[2]):void 0:d.length===4&&(this[d[0]]=c?d[3].call(this,c.replace(d[1],d[2])):void 0):this[d]=c||void 0;s+=2}},U=function(e,i){for(var s in i)if(typeof i[s]===G&&i[s].length>0){for(var u=0;u<i[s].length;u++)if(qe(i[s][u],e))return s===ni?void 0:s}else if(qe(i[s],e))return s===ni?void 0:s;return i.hasOwnProperty("*")?i["*"]:e},hi={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},vi={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},gi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[n,[a,B+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[n,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,n],[/opios[\/ ]+([\w\.]+)/i],[n,[a,te+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[n,[a,te+" GX"]],[/\bopr\/([\w\.]+)/i],[n,[a,te]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[n,[a,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[n,[a,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[a,n],[/quark(?:pc)?\/([-\w\.]+)/i],[n,[a,"Quark"]],[/\bddg\/([\w\.]+)/i],[n,[a,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[n,[a,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[n,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[n,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[n,[a,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[n,[a,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[n,[a,"Smart "+ci+re]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure"+re],n],[/\bfocus\/([\w\.]+)/i],[n,[a,ie+" Focus"]],[/\bopt\/([\w\.]+)/i],[n,[a,te+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[n,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[n,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[n,[a,te+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[n,[a,"MIUI"+re]],[/fxios\/([\w\.-]+)/i],[n,[a,B+ie]],[/\bqihoobrowser\/?([\w\.]*)/i],[n,[a,"360"]],[/\b(qq)\/([\w\.]+)/i],[[a,/(.+)/,"$1Browser"],n],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1"+re],n],[/samsungbrowser\/([\w\.]+)/i],[n,[a,Q+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[n,[a,mi+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[a,mi+" Mobile"],n],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[a,n],[/(lbbrowser|rekonq)/i],[a],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[n,a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,je],n,[t,J]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[a,n,[t,J]],[/\bgsa\/([\w\.]+) .*safari\//i],[n,[a,"GSA"],[t,J]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[n,[a,"TikTok"],[t,J]],[/\[(linkedin)app\]/i],[a,[t,J]],[/(chromium)[\/ ]([-\w\.]+)/i],[a,n],[/headlesschrome(?:\/([\w\.]+)| )/i],[n,[a,bi+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,bi+" WebView"],n],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[n,[a,"Android"+re]],[/chrome\/([\w\.]+) mobile/i],[n,[a,B+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,n],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[n,[a,B+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[a,B+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[n,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[n,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[a,n],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[a,B+ie],n],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],n],[/(wolvic|librewolf)\/([\w\.]+)/i],[a,n],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[n,[a,ie+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[a,[n,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[a,[n,/[^\d\.]+./,W]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[y,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[y,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[y,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[y,/ower/,W,C]],[/ sun4\w[;\)]/i],[[y,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[y,C]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[r,[o,Q],[t,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[r,[o,Q],[t,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[r,[o,N],[t,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[r,[o,N],[t,v]],[/(macintosh);/i],[r,[o,N]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[r,[o,fi],[t,f]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[r,[o,ui],[t,v]],[/honor([-\w ]+)[;\)]/i],[r,[o,ui],[t,f]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[r,[o,di],[t,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[r,[o,di],[t,f]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[r,/_/g," "],[o,Ae],[t,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[r,/_/g," "],[o,Ae],[t,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[r,[o,Ee],[t,f]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[r,[o,U,{OnePlus:["304","403","203"],"*":Ee}],[t,v]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[r,[o,"BLU"],[t,f]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[r,[o,"Vivo"],[t,f]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[r,[o,"Realme"],[t,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[r,[o,Se],[t,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[r,[o,Se],[t,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[r,[o,ue],[t,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i,/\blg-?([\d\w]+) bui/i],[r,[o,ue],[t,f]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[r,[o,ci],[t,v]],[/(nokia) (t[12][01])/i],[o,r,[t,v]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[r,/_/g," "],[t,f],[o,"Nokia"]],[/(pixel (c|tablet))\b/i],[r,[o,P],[t,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[r,[o,P],[t,f]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[r,[o,ee],[t,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[r,"Xperia Tablet"],[o,ee],[t,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[r,[o,wi],[t,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[r,[o,ce],[t,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[r,/(.+)/g,"Fire Phone $1"],[o,ce],[t,f]],[/(playbook);[-\w\),; ]+(rim)/i],[r,o,[t,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[r,[o,li],[t,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[r,[o,si],[t,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[r,[o,si],[t,f]],[/(nexus 9)/i],[r,[o,"HTC"],[t,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[o,[r,/_/g," "],[t,f]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[r,[o,"TCL"],[t,v]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[r,[o,"TCL"],[t,f]],[/(itel) ((\w+))/i],[[o,C],r,[t,U,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[r,[o,"Acer"],[t,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[r,[o,"Meizu"],[t,f]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[r,[o,"Ulefone"],[t,f]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[r,[o,"Energizer"],[t,f]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[r,[o,"Cat"],[t,f]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[r,[o,"Smartfren"],[t,f]],[/droid.+; (a(?:015|06[35]|142p?))/i],[r,[o,"Nothing"],[t,f]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[r,[o,"Archos"],[t,v]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[r,[o,"Archos"],[t,f]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[o,r,[t,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[o,r,[t,f]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[o,r,[t,v]],[/(surface duo)/i],[r,[o,Re],[t,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[r,[o,"Fairphone"],[t,f]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[r,[o,Oe],[t,v]],[/(sprint) (\w+)/i],[o,r,[t,f]],[/(kin\.[onetw]{3})/i],[[r,/\./g," "],[o,Re],[t,f]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[r,[o,Ce],[t,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[r,[o,Ce],[t,f]],[/smart-tv.+(samsung)/i],[o,[t,g]],[/hbbtv.+maple;(\d+)/i],[[r,/^/,"SmartTV"],[o,Q],[t,g]],[/tcast.+(lg)e?. ([-\w]+)/i],[o,r,[t,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[o,ue],[t,g]],[/(apple) ?tv/i],[o,[r,N+" TV"],[t,g]],[/crkey.*devicetype\/chromecast/i],[[r,I+" Third Generation"],[o,P],[t,g]],[/crkey.*devicetype\/([^/]*)/i],[[r,/^/,"Chromecast "],[o,P],[t,g]],[/fuchsia.*crkey/i],[[r,I+" Nest Hub"],[o,P],[t,g]],[/crkey/i],[[r,I],[o,P],[t,g]],[/(portaltv)/i],[r,[o,je],[t,g]],[/droid.+aft(\w+)( bui|\))/i],[r,[o,ce],[t,g]],[/(shield \w+ tv)/i],[r,[o,Oe],[t,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[r,[o,fi],[t,g]],[/(bravia[\w ]+)( bui|\))/i],[r,[o,ee],[t,g]],[/(mi(tv|box)-?\w+) bui/i],[r,[o,Ae],[t,g]],[/Hbbtv.*(technisat) (.*);/i],[o,r,[t,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[o,le],[r,le],[t,g]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[r,[t,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[t,g]],[/(ouya)/i,/(nintendo) (\w+)/i],[o,r,[t,ae]],[/droid.+; (shield)( bui|\))/i],[r,[o,Oe],[t,ae]],[/(playstation \w+)/i],[r,[o,ee],[t,ae]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[r,[o,Re],[t,ae]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[r,[o,Q],[t,S]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[o,r,[t,S]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[r,[o,Ee],[t,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[r,[o,N],[t,S]],[/(opwwe\d{3})/i],[r,[o,wi],[t,S]],[/(moto 360)/i],[r,[o,Se],[t,S]],[/(smartwatch 3)/i],[r,[o,ee],[t,S]],[/(g watch r)/i],[r,[o,ue],[t,S]],[/droid.+; (wt63?0{2,3})\)/i],[r,[o,Ce],[t,S]],[/droid.+; (glass) \d/i],[r,[o,P],[t,_e]],[/(pico) (4|neo3(?: link|pro)?)/i],[o,r,[t,_e]],[/(quest( \d| pro)?s?).+vr/i],[r,[o,je],[t,_e]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[o,[t,ne]],[/(aeobc)\b/i],[r,[o,ce],[t,ne]],[/(homepod).+mac os/i],[r,[o,N],[t,ne]],[/windows iot/i],[[t,ne]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[r,[t,U,{mobile:"Mobile",xr:"VR","*":v}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[t,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[t,f]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[r,[o,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[n,[a,_t+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[a,n],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[n,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[a,n],[/ladybird\//i],[[a,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[n,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,n],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[a,[n,U,hi]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[n,U,hi],[a,$e]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[n,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,"macOS"],[n,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[n,[a,I+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[n,[a,I+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[n,[a,I+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[n,[a,I+" Linux"]],[/crkey\/([\d\.]+)/i],[n,[a,I]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[n,a],[/(ubuntu) ([\w\.]+) like android/i],[[a,/(.+)/,"$1 Touch"],n],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i],[a,n],[/\(bb(10);/i],[n,[a,li]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[n,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[n,[a,ie+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[n,[a,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[n,[a,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[a,"Chrome OS"],n],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[a,n],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],n],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[a,n]]},we=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return j.call(e.init,[[x,[a,n,se,t]],[A,[y]],[O,[t,r,o]],[R,[a,n]],[_,[a,n]]]),j.call(e.isIgnore,[[x,[n,se]],[R,[n]],[_,[n]]]),j.call(e.isIgnoreRgx,[[x,/ ?browser$/i],[_,/ ?os$/i]]),j.call(e.toString,[[x,[a,n]],[A,[y]],[O,[o,r]],[R,[a,n]],[_,[a,n]]]),e}(),Ot=function(e,i){var s=we.init[i],u=we.isIgnore[i]||0,l=we.isIgnoreRgx[i]||0,b=we.toString[i]||0;function d(){j.call(this,s)}return d.prototype.getItem=function(){return e},d.prototype.withClientHints=function(){return H?H.getHighEntropyValues(Ci).then(function(p){return e.setCH(new ji(p,!1)).parseCH().get()}):e.parseCH().get()},d.prototype.withFeatureCheck=function(){return e.detectFeature().get()},i!=F&&(d.prototype.is=function(p){var c=!1;for(var m in this)if(this.hasOwnProperty(m)&&!qe(u,m)&&C(l?X(l,this[m]):this[m])==C(l?X(l,p):p)){if(c=!0,p!=z)break}else if(p==z&&c){c=!c;break}return c},d.prototype.toString=function(){var p=W;for(var c in b)typeof this[b[c]]!==z&&(p+=(p?" ":W)+this[b[c]]);return p||z}),H||(d.prototype.then=function(p){var c=this,m=function(){for(var M in c)c.hasOwnProperty(M)&&(this[M]=c[M])};m.prototype={is:d.prototype.is,toString:d.prototype.toString};var E=new m;return p(E),E}),new d};function ji(e,i){if(e=e||{},j.call(this,Ci),i)j.call(this,[[Ke,Te(e[D])],[Ze,Te(e[mt])],[f,/\?1/.test(e[xt])],[r,oe(e[yt])],[V,oe(e[Ai])],[Je,oe(e[kt])],[y,oe(e[ht])],[L,Te(e[gt])],[ve,oe(e[vt])]]);else for(var s in e)this.hasOwnProperty(s)&&typeof e[s]!==z&&(this[s]=e[s])}function xi(e,i,s,u){return this.get=function(l){return l?this.data.hasOwnProperty(l)?this.data[l]:void 0:this.data},this.set=function(l,b){return this.data[l]=b,this},this.setCH=function(l){return this.uaCH=l,this},this.detectFeature=function(){if(k&&k.userAgent==this.ua)switch(this.itemType){case x:k.brave&&typeof k.brave.isBrave==me&&this.set(a,"Brave");break;case O:!this.get(t)&&H&&H[f]&&this.set(t,f),this.get(r)=="Macintosh"&&k&&typeof k.standalone!==z&&k.maxTouchPoints&&k.maxTouchPoints>2&&this.set(r,"iPad").set(t,v);break;case _:!this.get(a)&&H&&H[V]&&this.set(a,H[V]);break;case F:var l=this.data,b=function(d){return l[d].getItem().detectFeature().get()};this.set(x,b(x)).set(A,b(A)).set(O,b(O)).set(R,b(R)).set(_,b(_))}return this},this.parseUA=function(){return this.itemType!=F&&Ie.call(this.data,this.ua,this.rgxMap),this.itemType==x&&this.set(se,Me(this.get(n))),this},this.parseCH=function(){var l=this.uaCH,b=this.rgxMap;switch(this.itemType){case x:case R:var d=l[Ze]||l[Ke],p;if(d)for(var c in d){var m=d[c].brand||d[c],E=d[c].version;this.itemType==x&&!/not.a.brand/i.test(m)&&(!p||/chrom/i.test(p)&&m!=pi)&&(m=U(m,{Chrome:"Google Chrome",Edge:"Microsoft Edge","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"}),this.set(a,m).set(n,E).set(se,Me(E)),p=m),this.itemType==R&&m==pi&&this.set(n,E)}break;case A:var M=l[y];M&&(M&&l[ve]=="64"&&(M+="64"),Ie.call(this.data,M+";",b));break;case O:if(l[f]&&this.set(t,f),l[r]&&(this.set(r,l[r]),!this.get(t)||!this.get(o))){var K={};Ie.call(K,"droid 9; "+l[r]+")",b),!this.get(t)&&K.type&&this.set(t,K.type),!this.get(o)&&K.vendor&&this.set(o,K.vendor)}if(l[L]){var de;if(typeof l[L]!="string")for(var ti=0;!de&&ti<l[L].length;)de=U(l[L][ti++],vi);else de=U(l[L],vi);this.set(t,de)}break;case _:var xe=l[V];if(xe){var ye=l[Je];xe==$e&&(ye=parseInt(Me(ye),10)>=13?"11":"10"),this.set(a,xe).set(n,ye)}this.get(a)==$e&&l[r]=="Xbox"&&this.set(a,"Xbox").set(n,void 0);break;case F:var zi=this.data,Z=function(Di){return zi[Di].getItem().setCH(l).parseCH().get()};this.set(x,Z(x)).set(A,Z(A)).set(O,Z(O)).set(R,Z(R)).set(_,Z(_))}return this},j.call(this,[["itemType",e],["ua",i],["uaCH",u],["rgxMap",s],["data",Ot(this,e)]]),this}function T(e,i,s){if(typeof e===G?(he(e,!0)?(typeof i===G&&(s=i),i=e):(s=e,i=void 0),e=void 0):typeof e===Le&&!he(i,!0)&&(s=i,i=void 0),s&&typeof s.append===me){var u={};s.forEach(function(c,m){u[m]=c}),s=u}if(!(this instanceof T))return new T(e,i,s).getResult();var l=typeof e===Le?e:s&&s[ai]?s[ai]:k&&k.userAgent?k.userAgent:W,b=new ji(s,!0),d=i?St(gi,i):gi,p=function(c){return c==F?function(){return new xi(c,l,d,b).set("ua",l).set(x,this.getBrowser()).set(A,this.getCPU()).set(O,this.getDevice()).set(R,this.getEngine()).set(_,this.getOS()).get()}:function(){return new xi(c,l,d[c],b).parseUA().get()}};return j.call(this,[["getBrowser",p(x)],["getCPU",p(A)],["getDevice",p(O)],["getEngine",p(R)],["getOS",p(_)],["getResult",p(F)],["getUA",function(){return l}],["setUA",function(c){return Y(c)&&(l=c.length>Pe?le(c,Pe):c),this}]]).setUA(l),this}T.VERSION=pt;T.BROWSER=ge([a,n,se,t]);T.CPU=ge([y]);T.DEVICE=ge([r,o,t,ae,f,g,v,S,ne]);T.ENGINE=T.OS=ge([a,n]);function Et(e){return!e||typeof e!="string"?"break-all":e.includes(" ")?"break-word":"break-all"}function Qe(e){const i={width:e.size,height:e.size,...e.sx},s=typeof e.name=="string"?e.name:e.logo,u=w.jsxs(He,{direction:"row",alignItems:"center",spacing:1,className:`info-card-wrapper ${e.className}`,sx:{cursor:e.tooltip?"pointer":"default"},children:[e.logo?w.jsx(ri,{src:e.logo,alt:e.logoName??s,variant:e.variant,sx:i}):w.jsx(ri,{variant:e.variant,sx:i,children:s==null?void 0:s.slice(0,1)}),w.jsxs(He,{direction:"column",alignItems:"flex-start",justifyContent:"space-around",sx:{wordBreak:Et(e.name),minWidth:{xs:100,sm:140}},children:[w.jsx(pe,{variant:"body1",color:"text.primary",component:"div",children:e.name}),e.description&&w.jsx(pe,{variant:"subtitle1",color:"text.secondary",children:e.description})]})]});return e.tooltip?w.jsx(Pi,{title:e.tooltip,placement:"top-start",componentsProps:{tooltip:{sx:{bgcolor:l=>l.palette.mode==="dark"?"#2a2e37":"#ffffff",color:l=>l.palette.mode==="dark"?"#ffffff":l.palette.text.primary,boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",borderRadius:2,padding:"10px 16px",fontSize:14,maxWidth:400,minWidth:240,wordBreak:"break-word",border:l=>l.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0","& .MuiTooltip-arrow":{color:l=>l.palette.mode==="dark"?"#2a2e37":"#ffffff","&::before":{border:l=>l.palette.mode==="dark"?"1px solid #3a3f48":"1px solid #e0e0e0",backgroundColor:l=>l.palette.mode==="dark"?"#2a2e37":"#ffffff"}}}}},children:u}):u}Qe.propTypes={logo:h.string,name:h.oneOfType([h.string,h.node]).isRequired,description:h.oneOfType([h.string,h.node]),size:h.oneOfType([h.number,h.string]),variant:h.oneOf(["square","rounded","circular"]),sx:h.object,className:h.string,logoName:h.string,tooltip:h.oneOfType([h.string,h.node])};Qe.defaultProps={description:"",logo:"",size:40,variant:"rounded",sx:{},className:"",logoName:"",tooltip:null};function At(e){try{if(!e.trim())return{device:{icon:w.jsx(be,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:w.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}};const s=new T(e).getResult();let u="";const l=e.split(/\s+/).find(c=>c.startsWith("arcwallet"));if(l){const c=l.split("/");c.length>1&&oi.coerce(c[1])&&(u=oi.coerce(c[1]).version)}const b=(()=>{const{type:c="",model:m=""}=s.device;return c==="mobile"?{icon:w.jsx(Oi,{fontSize:"small"}),text:m||"Mobile Device"}:c==="tablet"?{icon:w.jsx(Ei,{fontSize:"small"}),text:m||"Tablet"}:{icon:w.jsx(Ri,{fontSize:"small"}),text:m||"Desktop"}})(),d=(()=>{const{name:c="",version:m=""}=s.os;return c.toLowerCase().includes("mac")?{icon:w.jsx(De,{fontSize:"small"}),text:`${c} ${m}`}:c.toLowerCase().includes("ios")?{icon:w.jsx(De,{fontSize:"small"}),text:`${c} ${m}`}:c.toLowerCase().includes("android")?{icon:w.jsx(Si,{fontSize:"small"}),text:`${c} ${m}`}:c.toLowerCase().includes("windows")?{icon:w.jsx(be,{fontSize:"small"}),text:`${c} ${m}`}:{icon:null,text:c?`${c} ${m}`:"Unknown OS"}})(),p=(()=>{const{name:c="",version:m=""}=s.browser;return{icon:w.jsx(fe,{fontSize:"small"}),text:c?`${c} ${m}`:"Unknown Browser"}})();return{device:b,os:d,browser:p,...u?{walletVersion:{icon:null,text:u}}:{}}}catch(i){return console.error("Error parsing user agent:",i),{device:{icon:w.jsx(be,{fontSize:"small"}),text:"Unknown Device"},os:{icon:null,text:"Unknown OS"},browser:{icon:w.jsx(fe,{fontSize:"small"}),text:"Unknown Browser"}}}}function Ti({ua:e}){const i=At(e);return w.jsx(He,{spacing:1,children:Object.entries(i).map(([s,{icon:u,text:l}])=>w.jsxs(Ue,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.jsx(Ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:u}),w.jsx(pe,{variant:"body2",sx:{display:"flex"},children:l})]},s))})}Ti.propTypes={ua:h.string.isRequired};const Ct=()=>{const{t:e}=Ne(),i={$all:e("common.all"),owner:"Owner",admin:"Admin",member:"Member",guest:"Guest"};return{SYSTEM_ROLES:i,formatRoleName:u=>{const l=(u||"").toLowerCase();return l.startsWith("$")?i[l]||l.slice(1):i[l]||l}}},jt=(e,i=!1)=>{const s=i?1:.6;switch(e){case"owner":return`rgba(232, 222, 255, ${s})`;case"admin":return`rgba(227, 242, 253, ${s})`;case"member":return`rgba(232, 245, 233, ${s})`;case"guest":return`rgba(245, 245, 245, ${s})`;default:return`rgba(245, 245, 245, ${s})`}},Tt=yi(ki)(({role:e})=>({backgroundColor:jt(e.toLowerCase()),color:"#000000"})),Mt=e=>{switch(e){case"valid":return i=>i.palette.success.light;case"expired":return i=>i.palette.text.disabled;case"revoked":return i=>i.palette.error.light;default:return i=>i.palette.warning.light}},It=yi(ki)(({theme:e,status:i})=>({backgroundColor:Mt(i)(e),color:"#FFFFFF"}));function Mi({did:e}){return w.jsx(ze,{size:14,responsive:!1,compact:!0,copyable:!1,did:e})}Mi.propTypes={did:h.string.isRequired};function Ii({timestamp:e,locale:i}){return w.jsx(Ue,{sx:{minWidth:"100px"},children:w.jsx(Li,{value:e,locale:i})})}Ii.propTypes={timestamp:h.number.isRequired,locale:h.string.isRequired};function ei({name:e,role:i}){const{formatRoleName:s}=Ct();return w.jsx(Tt,{label:s(e||i),size:"small",role:e||i,sx:{borderRadius:1}})}ei.propTypes={role:h.string.isRequired,name:h.string};ei.defaultProps={name:""};function Hi({status:e}){const{t:i}=Ne();return w.jsx(It,{label:i(`team.passport.statusMap.${e}`),size:"small",status:e,sx:{borderRadius:1}})}Hi.propTypes={status:h.string.isRequired};function Ui({source:e}){const{t:i}=Ne();return e?i(`team.passport.sourceMaps.${e}`):"-"}Ui.propTypes={source:h.string.isRequired};const ii=ke.memo(function({user:i,size:s="default",tooltip:u=!1,inService:l}){const{teamDid:b}=Wi(),d=ke.useMemo(()=>Vi(i.avatar,b,l),[i.avatar,b,l]),p=ke.useMemo(()=>w.jsx(ze,{did:i==null?void 0:i.did,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"},size:12}),[i==null?void 0:i.did]),c=Fi(()=>({...i,avatar:d}),[i,d]);return s==="small"?w.jsx(Qe,{variant:"circular",logo:d,name:w.jsx(pe,{sx:{maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"customer-link-name",children:i.fullName||i.email}),...s==="small"?{tooltip:u?w.jsx(ze,{did:i==null?void 0:i.did}):!1,size:24}:{description:p,size:36}}):w.jsx($i,{user:c,avatarSize:s==="small"?24:36,cardType:qi.Detailed,infoType:Ni.Minimal,sx:{padding:0,border:"none"},showDid:!0,didProps:{compact:!0,responsive:!1},showHoverCard:!1})});ii.propTypes={user:h.object.isRequired,size:h.string,tooltip:h.bool,inService:h.bool};ii.defaultProps={size:"default",tooltip:!1,inService:!1};const Nt=e=>w.jsx(Mi,{did:e}),Bt=(e,i)=>w.jsx(ei,{name:e,role:i}),Ft=e=>w.jsx(Hi,{status:e}),Vt=(e,i)=>w.jsx(Ii,{timestamp:e,locale:i}),Wt=e=>w.jsx(Ui,{source:e}),Gt=(e,i=!1)=>w.jsx(ii,{user:e,inService:i}),Xt=e=>w.jsx(Ti,{ua:e});export{Ft as a,Gt as b,Wt as c,Xt as d,Vt as e,Nt as f,Bt as r,Ct as u};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-BV2FUxWJ.js";import{A as t}from"./vendor-utils-rHXShPKm.js";import{I as s}from"./iframe-Dl8NEFc5.js";import{j as e}from"./vendor-ux-did-connect-2jRoUb28.js";import{S as m}from"./studio-1mTu0Fgs.js";import"./vendor-react-DEoibe3W.js";import"./vendor-arcblock-BlrkGjK9.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./TuneOutlined-D0gGDoIJ.js";function P(){const r=new URLSearchParams;r.set("title","Preference Builder"),r.set("schemaKey",t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/studio/preferences"));const i=`${t(window.location.origin,e.WELLKNOWN_SERVICE_PATH_PREFIX,"/hosted/form-builder/")}?${r.toString()}`;return o.jsx(m,{children:o.jsx(s,{url:i,width:"100%",height:"100%",frameBorder:0,styles:{border:0}})})}export{P as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-mui-core-BV2FUxWJ.js";import{H as t,U as o}from"./vendor-arcblock-BlrkGjK9.js";import"./vendor-react-DEoibe3W.js";import{a as s}from"./vendor-ux-did-connect-2jRoUb28.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:r}=s();return e.jsxs(e.Fragment,{children:[e.jsx(t,{children:e.jsx("title",{children:r("pageTitle.userCenter")})}),e.jsx(o,{onlyProfile:!0,currentTab:"",disableAutoRedirect:!0})]})}export{x as default};
@@ -1 +0,0 @@
1
- import{v as n,j as i,aa as l}from"./vendor-mui-core-BV2FUxWJ.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{a as u,ao as h}from"./vendor-ux-did-connect-2jRoUb28.js";import g from"./index-BCJADuMw.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./index-DDoVX3je.js";import"./vendor-arcblock-BlrkGjK9.js";import"./Error-DEKvwVoF.js";import"./confirm-Vzr2I9eM.js";import"./index-8eXqqyHQ.js";import"./session-C_8V_o-O.js";import"./did-address-Dq-4__HB.js";import"./empty-spinner-BdaCO6xq.js";import"./bundle-avatar-D4fwror8.js";import"./shorten-label-DPIZ5X7v.js";import"./list-header-xt282ZMS.js";import"./Download-Bm8sKXA2.js";import"./click-to-copy-R7MF4AwY.js";import"./QuestionMarkCircle-DTGyWFVS.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./Launch-Dz9mQnYC.js";import"./index-D2uDBC1o.js";import"./api-BjteVZFg.js";import"./ChevronRight-DgAwWLdY.js";import"./vendor-mui-x-Bo-XOtzq.js";import"./DeleteOutline-DpNyWtNL.js";import"./react-beautiful-dnd.esm-Ck4xzwyU.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-rXnALS3b.js";import"./Done-BTd13H2U.js";import"./delete-confirm-DNn4Os6R.js";import"./get-safe-url-c4iAcpvA.js";import"./ArrowDropDown-DPqiF9Rw.js";import"./index-RsjqbOR7.js";import"./index-BmXcRfZR.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
@@ -1 +0,0 @@
1
- import{r as I}from"./vendor-react-DEoibe3W.js";import{e as C,m as B,j as n,H as s,aa as x,T as g,bb as k,ah as P,ad as T,cn as O,co as q}from"./vendor-mui-core-BV2FUxWJ.js";import{B as _,p as J}from"./dashboard-xUr1SbPS.js";import{a as R,a2 as K,I as Q,a9 as V}from"./vendor-ux-did-connect-2jRoUb28.js";import{aw as S,aE as E,D as X,G as U,f as $,aM as Y}from"./index-DDoVX3je.js";import{aM as Z}from"./vendor-utils-rHXShPKm.js";import{a1 as F}from"./vendor-arcblock-BlrkGjK9.js";import{B as N}from"./base-chart-D6qRW4Yg.js";import{B as ee}from"./bundle-avatar-D4fwror8.js";import"./useLocalStorage-D6gvgmEW.js";import"./index-8eXqqyHQ.js";import"./confirm-Vzr2I9eM.js";import"./PlayArrow-CDOOUxMp.js";import"./get-safe-url-c4iAcpvA.js";import"./session-C_8V_o-O.js";import"./vendor-hooks-BgUTpb6X.js";import"./use-blocklet-logo-Bhkp-Zm7.js";import"./InfoOutlined-D3XnF0Vg.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-C21X4TYN.js";import"./lottie-web-jYmAQWuC.js";import"./index-J3Tqz9ZT.js";function D({title:o,cpus:c,currentLoad:a,history:u,empty:i,onHover:h,hoverIndex:l}){const{t:y,locale:p}=R(),t=C(),e=`${o||y("common.cpu")} (${Math.floor(a||0)}%)`,r=100,m=80,d=M=>`${M}%`,b=[{max:m,color:B(t.palette.primary.main,t.palette.mode==="dark"?.15:.08)},{min:m,max:100,color:B(t.palette.warning.main,t.palette.mode==="dark"?.18:.12)},{min:100,color:B(t.palette.error.main,t.palette.mode==="dark"?.25:.18)}],j={silent:!0,symbol:["none","none"],data:[{yAxis:100,lineStyle:{color:t.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${d(100)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:m,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${d(m)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}}]},v=n.jsx("span",{children:`${y("system.cores")}: ${(c==null?void 0:c.length)||0}`}),L=M=>S(M,"HH:mm",p);return n.jsx(N,{title:e,total:r,history:u,valueFn:d,xAxisFormat:L,visualMapPieces:b,markLineData:j,extraInfo:v,empty:i,onHover:h,hoverIndex:l})}D.propTypes={title:s.string,cpus:s.array,currentLoad:s.number,history:s.array,empty:s.node,onHover:s.func,hoverIndex:s.number};D.defaultProps={title:"",cpus:[],currentLoad:0,history:[],empty:null,onHover:()=>{},hoverIndex:null};function w({instanceCount:o,title:c,total:a,used:u,history:i,empty:h,onHover:l,hoverIndex:y}){const{t:p,locale:t}=R(),e=C(),r=!!a,m=a-u,d=r?`(${E(u)}, ${Math.floor(u/a*100)}%)`:"",b=`${c||p("common.memory")} ${d}`,j=Math.ceil(a*.8),v=f=>F(f,{short:!0,iec:!0}),L=[];o&&L.push({title:p("system.instances"),metric:o}),r&&L.push({title:p("system.free"),metric:v(m)});const M=[{max:j,color:B(e.palette.primary.main,e.palette.mode==="dark"?.15:.08)},{min:j,max:a,color:B(e.palette.warning.main,e.palette.mode==="dark"?.18:.12)},{min:a,color:B(e.palette.error.main,e.palette.mode==="dark"?.25:.18)}],A={silent:!0,symbol:["none","none"],data:[{yAxis:a,lineStyle:{color:e.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${v(a)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:j,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${v(j)}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}}]},z=n.jsx(n.Fragment,{children:L.map((f,W)=>n.jsxs(x,{sx:{marginLeft:W===0?0:1,display:"inline-flex"},children:[f.title,": ",f.metric]},f.title))}),G=f=>S(f,"HH:mm",t);return n.jsx(N,{title:b,total:a,history:i,valueFn:v,xAxisFormat:G,visualMapPieces:M,markLineData:A,extraInfo:z,empty:h,onHover:l,hoverIndex:y})}w.propTypes={title:s.string,instanceCount:s.number,total:s.number,used:s.number,history:s.array,empty:s.node,onHover:s.func,hoverIndex:s.number};w.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[],empty:null,onHover:()=>{},hoverIndex:null};function H({blocklet:o,...c}){const{t:a}=R(),{info:u}=X(),{runtimeHistory:i}=U(),[h,l]=I.useState(null),y=I.useCallback(t=>o.status!=="running"?n.jsx(g,{children:a("blocklet.runtimeInfo.noRunning")}):t.length?null:n.jsx(K,{children:a("common.empty")}),[o.status,a]),p=I.useCallback(t=>{l(t)},[]);return i.length===0?n.jsx(g,{children:a("blocklet.runtimeInfo.noRunning")}):n.jsxs(te,{component:"div",...c,children:[n.jsxs(k,{className:"page-metrics",container:!0,spacing:5,children:[n.jsx(k,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(g,{fontSize:"16px",fontWeight:"bold",children:"CPU"})}),i==null?void 0:i.map(t=>{var e,r;return n.jsx(k,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(D,{title:`${t.name} CPU`,empty:y(t.cpu),currentLoad:((e=t.appRuntimeInfo)==null?void 0:e.cpuUsage)||0,cpus:((r=t.appRuntimeInfo)==null?void 0:r.cpus)||[],history:t.cpu,onHover:p,hoverIndex:h,style:{height:150}})},`${t.key}-cpu`)})]}),n.jsxs(k,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[n.jsx(k,{item:!0,xs:12,sx:{pt:"16px !important"},children:n.jsx(g,{fontSize:"16px",fontWeight:"bold",children:"Memory"})}),i==null?void 0:i.map(t=>{var e,r,m;return n.jsx(k,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:n.jsx(w,{title:`${t.name} Memory`,empty:y(t.memory),total:(e=u.runtimeConfig)!=null&&e.blockletMaxMemoryLimit?F.parseSize(`${u.runtimeConfig.blockletMaxMemoryLimit*(t.key===((r=o==null?void 0:o.meta)==null?void 0:r.did)?i.length-1:1)}MiB`):0,used:((m=t.appRuntimeInfo)==null?void 0:m.memoryUsage)||0,history:t.memory,onHover:p,hoverIndex:h,style:{height:150}})},`${t.key}-memory`)})]})]})}H.propTypes={blocklet:s.object.isRequired,cpuHistory:s.arrayOf(s.shape({date:s.number,value:s.number})),memoryHistory:s.arrayOf(s.shape({date:s.number,value:s.number}))};H.defaultProps={cpuHistory:[],memoryHistory:[]};const te=P(g)``;function re(){const{t:o,locale:c}=R(),[a,u]=I.useState(6),{blocklet:i,actions:{refreshBlocklet:h}}=U(),l=I.useMemo(()=>{const t=[];return $.forEachBlockletSync(i,(e,{ancestors:r,id:m,level:d})=>{var b;(b=e==null?void 0:e.meta)!=null&&b.did&&e.meta.did!==i.meta.did&&t.push({type:"blocklet",groupId:i.meta.did,groupName:$.getDisplayName(i),id:m,name:$.getDisplayName(e,!0),blocklet:i,component:e,level:d-1>=0?d-1:0,runtimeInfo:e.runtimeInfo,ancestors:r})}),t},[i]);I.useEffect(()=>{h({hours:a});const t=setInterval(()=>{h({hours:a})},1e3*10);return()=>{clearInterval(t)}},[a]);const y=t=>J(Number(t||0),{locale:Y(c)}),p=[{label:o("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:e,component:r,level:m,ancestors:d}=l[t];return n.jsxs(x,{display:"flex",alignItems:"center",pl:m*2,children:[n.jsx(ee,{size:20,blocklet:r,ancestors:d}),n.jsx(x,{ml:1,children:e}),n.jsx(_,{variant:"pin",style:{marginLeft:8},status:r.status,source:r.source,progress:r.progress})]})}}},{label:o("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:r}=l[t];return!(r!=null&&r.status)||r.status!=="running"?n.jsx(T,{title:o("common.noData"),children:"--"}):y(e==null?void 0:e.uptime)}}},{label:o("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:r}=l[t];return!(r!=null&&r.status)||r.status!=="running"?n.jsx(T,{title:o("common.noData"),children:"--"}):E((e==null?void 0:e.memoryUsage)||0)}}},{label:o("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:r}=l[t];return!(r!=null&&r.status)||r.status!=="running"?n.jsx(T,{title:o("common.noData"),children:"--"}):`${((e==null?void 0:e.cpuUsage)||0).toFixed(1)}%`}}},{label:o("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(t){const{runtimeInfo:e}=l[t];return e!=null&&e.uptime?n.jsxs(x,{display:"flex",alignItems:"center",children:[n.jsx(Q,{icon:e!=null&&e.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),n.jsx(x,{ml:1,children:e!=null&&e.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:o("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:r}=l[t];return!(r!=null&&r.status)||r.status!=="running"?n.jsx(T,{title:o("common.noData"),children:"--"}):e==null?void 0:e.pid}}},{label:o("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:r}=l[t];return!(r!=null&&r.status)||r.status!=="running"?n.jsx(T,{title:o("common.noData"),children:"--"}):e==null?void 0:e.port}}}];return n.jsxs(ne,{component:"div",children:[n.jsxs(x,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[n.jsx(g,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:o("analytics.trend")}),n.jsx(O,{size:"small",exclusive:!0,value:a,onChange:(t,e)=>{Z(e)&&u(e)},children:[1,3,6,12,24].map(t=>n.jsxs(q,{value:t,children:[t,"H"]},t))})]}),n.jsx(x,{children:n.jsx(H,{blocklet:i})}),n.jsx(x,{mt:3,children:n.jsx(V,{title:o("analytics.detail"),className:"monitor-table",locale:c,data:l,columns:p,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}re.propTypes={};const ne=P(g)``;export{re as default};
@@ -1 +0,0 @@
1
- import{aZ as o}from"./vendor-ux-did-connect-2jRoUb28.js";const e=o();export{e as b};
@@ -1 +0,0 @@
1
- import{r as o}from"./vendor-react-DEoibe3W.js";import{e as t}from"./vendor-ux-did-connect-2jRoUb28.js";function r(){return o.useContext(t)}export{r as u};