@abtnode/blocklet-services 1.17.7-beta-20251225-073259-cb6ecf68 → 1.17.7-beta-20251227-001958-ea2ba3f5

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 (215) hide show
  1. package/api/index.js +11 -4
  2. package/api/libs/auth/adapters/apple.js +1 -1
  3. package/api/libs/auth/adapters/auth0.js +1 -1
  4. package/api/libs/auth/adapters/github.js +1 -1
  5. package/api/libs/auth/adapters/google.js +1 -1
  6. package/api/routes/oauth/client.js +7 -5
  7. package/dist/assets/{AdapterDayjs-BUbxoXbD.js → AdapterDayjs-D3q7r7VE.js} +1 -1
  8. package/dist/assets/{Google-Cwpw9PRe.js → Google-DPANLEPw.js} +1 -1
  9. package/dist/assets/{access-control-DwlD3_cw.js → access-control-DcZTha6L.js} +1 -1
  10. package/dist/assets/{add-component-core-BITgGwN0.js → add-component-core-DB6FFHib.js} +31 -31
  11. package/dist/assets/add-resource-C4N8BQ-X.js +1 -0
  12. package/dist/assets/{addon-C2qdiHVb.js → addon-eWPw19hG.js} +1 -1
  13. package/dist/assets/{advanced-BosetBVE.js → advanced-CLImONQQ.js} +1 -1
  14. package/dist/assets/{aigne-DbMeOdg9.js → aigne-CgZvweo2.js} +1 -1
  15. package/dist/assets/api-FQQlzPOP.js +1 -0
  16. package/dist/assets/{appearance-DhUAX-xn.js → appearance-CINIZkeA.js} +1 -1
  17. package/dist/assets/ar-B4BSOV5G.js +7 -0
  18. package/dist/assets/{audit-logs-BHPPGieH.js → audit-logs-C2v20KVT.js} +3 -3
  19. package/dist/assets/{authorize-Dfo70g1t.js → authorize-CXXh0DJa.js} +1 -1
  20. package/dist/assets/{base-chart-Cs8rd9f2.js → base-chart-ChBZtUEG.js} +1 -1
  21. package/dist/assets/{base32-CXgP3JJ5.js → base32-D1hrOfad.js} +1 -1
  22. package/dist/assets/{bind-account-Drs3IDFN.js → bind-account-wbTCO99T.js} +1 -1
  23. package/dist/assets/{branding-ByK6n-fM.js → branding-BRnchueB.js} +1 -1
  24. package/dist/assets/branding-CxsPzoRR.js +1 -0
  25. package/dist/assets/{branding-BhvacExo.js → branding-DwUe7Tp9.js} +1 -1
  26. package/dist/assets/{bundle-avatar-DVOaAXid.js → bundle-avatar-BcFO2tQG.js} +1 -1
  27. package/dist/assets/{button-D6RwAFss.js → button-DOFHdsTg.js} +1 -1
  28. package/dist/assets/{click-to-copy-B2HIKJMV.js → click-to-copy-Y_g1bzK1.js} +1 -1
  29. package/dist/assets/cloneDeep-C2rlAYcK.js +1 -0
  30. package/dist/assets/{complete-Djtuko3J.js → complete-BcxUAd9u.js} +2 -2
  31. package/dist/assets/{component-UsgyDUkb.js → component-Da5wpxLf.js} +2 -2
  32. package/dist/assets/{config-Co1ZhGgP.js → config-6Zu9T00w.js} +1 -1
  33. package/dist/assets/{config-DuS3gx_m.js → config-ZxMxtwH7.js} +2 -2
  34. package/dist/assets/{config-navigation-DjF2jJY9.js → config-navigation-DguNbGxu.js} +7 -7
  35. package/dist/assets/{config-space-zEV0JkDF.js → config-space-LrsWMRQl.js} +1 -1
  36. package/dist/assets/{config-CUYR0yDP.js → config-uq3j8VEP.js} +2 -2
  37. package/dist/assets/{confirm-DTx9f3Ke.js → confirm-CkoSEAQA.js} +1 -1
  38. package/dist/assets/{connect-nknm0LHt.js → connect-BdHrAN1y.js} +1 -1
  39. package/dist/assets/connect-Ycl_SRGH.js +5 -0
  40. package/dist/assets/{connect-to-eBtGI4_9.js → connect-to-Bimfzs2e.js} +1 -1
  41. package/dist/assets/{create-passport-svg-BQhmIwWD.js → create-passport-svg-DXpLsb6S.js} +1 -1
  42. package/dist/assets/{createClass-dudiLlP7.js → createClass-gaMAMqR5.js} +1 -1
  43. package/dist/assets/dashboard-ibhYAC79.js +103 -0
  44. package/dist/assets/de-CCwoF0w2.js +7 -0
  45. package/dist/assets/{delete-confirm-HiRqbh9-.js → delete-confirm-CRZxojEX.js} +1 -1
  46. package/dist/assets/{did-address-DqhneWXa.js → did-address-CQO2MAbB.js} +1 -1
  47. package/dist/assets/{domain-Xaa2OTQZ.js → domain-BLbfzvQo.js} +1 -1
  48. package/dist/assets/{domain-action-card-BzceZepB.js → domain-action-card-CI8HeDAo.js} +2 -2
  49. package/dist/assets/domains-Cys-hPxm.js +1 -0
  50. package/dist/assets/edit-rounded-CnMn6J-D.js +1 -0
  51. package/dist/assets/{email-CaObtYNf.js → email-DR9ulnxn.js} +2 -2
  52. package/dist/assets/engine-D3NlocNz.js +1 -0
  53. package/dist/assets/es-BqFCfGn2.js +9 -0
  54. package/dist/assets/{exchange-passport-BA6t_lld.js → exchange-passport-f77I2WSo.js} +1 -1
  55. package/dist/assets/{form-DNo4HCRt.js → form-BaeH4FDj.js} +1 -1
  56. package/dist/assets/{form-text-input-BjQKx89L.js → form-text-input-DlypNadC.js} +1 -1
  57. package/dist/assets/fr-CksqMtzK.js +7 -0
  58. package/dist/assets/{fuel-Cr5W3cGy.js → fuel-oYvuY39p.js} +1 -1
  59. package/dist/assets/{gen-access-key-Bw62ox39.js → gen-access-key-CAPft5rM.js} +1 -1
  60. package/dist/assets/{gen-simple-access-key-QTWh5kxW.js → gen-simple-access-key-BLp5Xl3s.js} +1 -1
  61. package/dist/assets/get-safe-url-D4mirsKD.js +1 -0
  62. package/dist/assets/hi-Bztwk-sg.js +5 -0
  63. package/dist/assets/{hi-DNSN9klG.js → hi-Cra5bbq9.js} +1 -1
  64. package/dist/assets/{home-iaPbLBtv.js → home-Bk6IzsSO.js} +1 -1
  65. package/dist/assets/id-C5p-l7lp.js +7 -0
  66. package/dist/assets/{iframe-C8myLb4U.js → iframe-Bje7e1bW.js} +1 -1
  67. package/dist/assets/{index-CaQnmN3Y.js → index-3CTfzyey.js} +1 -1
  68. package/dist/assets/{index-BleAAm7x.js → index-B6l2pkPi.js} +1 -1
  69. package/dist/assets/index-BZxsCCR_.js +1039 -0
  70. package/dist/assets/{index-YLno1Cst.js → index-BbN6pA05.js} +3 -3
  71. package/dist/assets/index-Bpw2kPB0.js +1 -0
  72. package/dist/assets/{index-CHuKoofS.js → index-BqdvWprH.js} +1 -1
  73. package/dist/assets/{index-1azOxnKy.js → index-C3WB0h56.js} +1 -1
  74. package/dist/assets/{index-B8sa2W5r.js → index-CFLdsuFL.js} +6 -6
  75. package/dist/assets/{index-CnWFrsC2.js → index-CMxIK3x4.js} +4 -4
  76. package/dist/assets/index-CNEbBLep.js +281 -0
  77. package/dist/assets/{index-DURonUPJ.js → index-CNIPEY43.js} +1 -1
  78. package/dist/assets/index-CQ7mQ4Da.js +81 -0
  79. package/dist/assets/{index-DeG3Ee92.js → index-CS6lhRSS.js} +1 -1
  80. package/dist/assets/{index-DHvO7Oyu.js → index-CZLUW18F.js} +1 -1
  81. package/dist/assets/{index-BzU09Azd.js → index-CnCY99ka.js} +2 -2
  82. package/dist/assets/{index-Dnd0o2ng.js → index-CrBdQJWr.js} +3 -3
  83. package/dist/assets/{index-B7jV3her.js → index-CrRA4U7x.js} +1 -1
  84. package/dist/assets/{index-9h1okNKA.js → index-Cx3b_F1g.js} +6 -6
  85. package/dist/assets/{index-B5vc0eG5.js → index-D1SIrheh.js} +1 -1
  86. package/dist/assets/{index-seQ_ufVM.js → index-D5sBpp1t.js} +1 -1
  87. package/dist/assets/index-DDp16vgt.js +1 -0
  88. package/dist/assets/{index-SACCniHf.js → index-DO00WL8R.js} +4 -4
  89. package/dist/assets/{index-C2HNVEZ0.js → index-DSiSlyHN.js} +1 -1
  90. package/dist/assets/{index-SCaAOhtj.js → index-D_Nnn_Mn.js} +2 -2
  91. package/dist/assets/{index-D3g5TOJl.js → index-DpNE-CDv.js} +2 -2
  92. package/dist/assets/{index-C4nyPKIr.js → index-DufnOkPH.js} +1 -1
  93. package/dist/assets/{index-Bxd7kK_i.js → index-VFqVu6RK.js} +1 -1
  94. package/dist/assets/{index-Dk6ZABgc.js → index-faKDHmeo.js} +1 -1
  95. package/dist/assets/{index-CtJhxyJT.js → index-fpjO7dzv.js} +18 -18
  96. package/dist/assets/{index-BP_Fl0Mu.js → index-icvBZv9S.js} +1 -1
  97. package/dist/assets/{index-CzvNhDIJ.js → index-n0T59Exz.js} +2 -2
  98. package/dist/assets/{invitation-DwMnPB2W.js → invitation-1uvZN7Wz.js} +2 -2
  99. package/dist/assets/{invitations-mhxsPoWR.js → invitations-CVBjh7Sp.js} +1 -1
  100. package/dist/assets/{invite-DpZe41tL.js → invite-72ju6Nfe.js} +1 -1
  101. package/dist/assets/{isURL-CASPeQFe.js → isURL-4Bkt0jKV.js} +1 -1
  102. package/dist/assets/{issue-passport-ClIYXZHr.js → issue-passport-BXUkhSQf.js} +1 -1
  103. package/dist/assets/{item-B3LlwO_A.js → item-Sc9nk8VE.js} +1 -1
  104. package/dist/assets/ja-2cGMwCig.js +9 -0
  105. package/dist/assets/ko-DDVloIXx.js +9 -0
  106. package/dist/assets/{landing-page-Cv6belCa.js → landing-page-CNLD6T-R.js} +1 -1
  107. package/dist/assets/{layout-DkW-u1GX.js → layout-Rdrg1NRp.js} +1 -1
  108. package/dist/assets/{list-Dqz9X41o.js → list-Duwgi0aT.js} +1 -1
  109. package/dist/assets/{list-CBP3Lj7-.js → list-kBEbDlAy.js} +1 -1
  110. package/dist/assets/localization-5dQbij9B.js +1 -0
  111. package/dist/assets/{log-Ch1_gOOt.js → log-D0VXoWik.js} +1 -1
  112. package/dist/assets/logger-DwfAFTvh.js +1 -0
  113. package/dist/assets/{login-_zzURN5A.js → login-Bk3NsX2t.js} +1 -1
  114. package/dist/assets/{login-oauth-callback-BiIj9E0o.js → login-oauth-callback-B5t0W6BK.js} +1 -1
  115. package/dist/assets/{logo-uploader-BmnoHisE.js → logo-uploader-BksS6OGe.js} +1 -1
  116. package/dist/assets/{lost-passport-DYnJRD_t.js → lost-passport-N6CO05pB.js} +2 -2
  117. package/dist/assets/{cloneDeep-BbaR0xRl.js → omit-spWLSLbo.js} +1 -1
  118. package/dist/assets/{open-window-Btzsgc7g.js → open-window-BIeXBkgL.js} +1 -1
  119. package/dist/assets/{over-due-invoice-payment-BFDFMUwK.js → over-due-invoice-payment-UdTfL4Kl.js} +1 -1
  120. package/dist/assets/overview-C8MrvmEl.js +116 -0
  121. package/dist/assets/passport-VW2_vBcn.js +1 -0
  122. package/dist/assets/{passport-item-Dx140DTL.js → passport-item-DT01s3TO.js} +1 -1
  123. package/dist/assets/{permission-HtrJm1h2.js → permission-B2PLdaCS.js} +1 -1
  124. package/dist/assets/{preferences-Dri2a4fE.js → preferences-Bc7rQImd.js} +1 -1
  125. package/dist/assets/profile-embed-BcR4EOH0.js +1 -0
  126. package/dist/assets/{pt-BPAfyek8.js → pt-BB0AKqMq.js} +1 -1
  127. package/dist/assets/pt-FIIPCfqU.js +5 -0
  128. package/dist/assets/{publish-resource-CruXcF2L.js → publish-resource-0N_Yl_Te.js} +1 -1
  129. package/dist/assets/{react-beautiful-dnd.esm-89LKdt03.js → react-beautiful-dnd.esm-BS_uB_lS.js} +1 -1
  130. package/dist/assets/ru-BjRgz8OF.js +5 -0
  131. package/dist/assets/{ru-CVlekA3F.js → ru-CnPeybtU.js} +1 -1
  132. package/dist/assets/{runtime-Ck_rDqm2.js → runtime-CC4RYhOB.js} +1 -1
  133. package/dist/assets/{sanitize-DyRfEGVu.js → sanitize-yVk8VEIO.js} +1 -1
  134. package/dist/assets/sdk-ChA0AoUQ.js +1 -0
  135. package/dist/assets/security-BGS9ZBga.js +22 -0
  136. package/dist/assets/{session-Cm8j8XeZ.js → session-DwQKgNVz.js} +1 -1
  137. package/dist/assets/{setup-COruOAew.js → setup-CGmQpOuI.js} +1 -1
  138. package/dist/assets/simple-select-BCM4gn4x.js +1 -0
  139. package/dist/assets/{spaces-BuZf3GoQ.js → spaces-DBCz6tUn.js} +1 -1
  140. package/dist/assets/{start-D_yHRXzR.js → start-i9gTQsll.js} +1 -1
  141. package/dist/assets/{starting-progress-DahUM5Xo.js → starting-progress-DyH57pR8.js} +1 -1
  142. package/dist/assets/{status-DVjLoqLm.js → status-CXqGL2Pf.js} +1 -1
  143. package/dist/assets/{step-actions-DkehnzsP.js → step-actions-Bejkv1Kq.js} +1 -1
  144. package/dist/assets/{studio-D4hiQNwZ.js → studio-D4gvK_Pm.js} +1 -1
  145. package/dist/assets/{switch-CO2el_yA.js → switch-C6tfghh9.js} +1 -1
  146. package/dist/assets/{switch-control-Bw0oiZZh.js → switch-control-BHBY0I2i.js} +1 -1
  147. package/dist/assets/{table-tips-C-6Sm2ed.js → table-tips-NRTE9Y9o.js} +1 -1
  148. package/dist/assets/{team-DNuHMrzV.js → team-DJUogroZ.js} +1 -1
  149. package/dist/assets/th-DKiwQ6t6.js +5 -0
  150. package/dist/assets/{traffic-B0WH67Yr.js → traffic-BkhPaqCl.js} +1 -1
  151. package/dist/assets/{transfer-BpjPR3S_.js → transfer-BphBkT_z.js} +1 -1
  152. package/dist/assets/{unsubscribe-CzgQXfYP.js → unsubscribe-BZMHEcjj.js} +1 -1
  153. package/dist/assets/{use-app-logo-CZWb8lrs.js → use-app-logo-DbYok-1h.js} +1 -1
  154. package/dist/assets/{use-window-close-DDL8fcOm.js → use-window-close-GjpWo-Lk.js} +1 -1
  155. package/dist/assets/{useAsync-VEqKX7rF.js → useAsync-DVl73fmG.js} +1 -1
  156. package/dist/assets/{useAsync-xXSiXzwr.js → useAsync-Dotoxibi.js} +1 -1
  157. package/dist/assets/{useAsyncRetry--1T7wYe2.js → useAsyncRetry-r8dEPb-x.js} +1 -1
  158. package/dist/assets/{useLocalStorage-BV1BIwfo.js → useLocalStorage-DzhcQ3lj.js} +1 -1
  159. package/dist/assets/{user-center-DndqALOV.js → user-center-DRowS1VB.js} +1 -1
  160. package/dist/assets/{user-follower-Bzb2ZR_9.js → user-follower-DNh4vPB0.js} +1 -1
  161. package/dist/assets/{util-DIVJQVg1.js → util-BYnhSg2W.js} +1 -1
  162. package/dist/assets/{util-CVjlaHo_.js → util-DWbXfz_X.js} +1 -1
  163. package/dist/assets/{vendor-arcblock-CPCSE54a.js → vendor-arcblock-CIBaEWEy.js} +1 -1
  164. package/dist/assets/{vendor-hooks-cYMUGE4V.js → vendor-hooks-qxhUUbW5.js} +1 -1
  165. package/dist/assets/vendor-utils-CxWN1dT3.js +213 -0
  166. package/dist/assets/{vendor-ux-DfSgTRg5.js → vendor-ux-DTEmWsko.js} +19 -19
  167. package/dist/assets/vi-C4aNShnq.js +5 -0
  168. package/dist/assets/{wait-connect-Be1Dmt0P.js → wait-connect-CBmpE7OF.js} +1 -1
  169. package/dist/assets/{wizard-components-D3PqSMGt.js → wizard-components-Brz3KBMW.js} +2 -2
  170. package/dist/assets/{wizard-BhUdbQos.js → wizard-yWYIVNGQ.js} +1 -1
  171. package/dist/assets/wrap-locale-BUa8dcqX.js +1 -0
  172. package/dist/assets/zh-Cb0McG4r.js +10 -0
  173. package/dist/assets/{zh-B_cpka88.js → zh-sNz1KN0x.js} +1 -1
  174. package/dist/assets/zh-tw-PfYv9beR.js +9 -0
  175. package/dist/index.html +1 -1
  176. package/package.json +49 -49
  177. package/dist/assets/add-resource-ENVSA34x.js +0 -1
  178. package/dist/assets/api-C_w0YD2j.js +0 -1
  179. package/dist/assets/ar-BBr9bsOg.js +0 -7
  180. package/dist/assets/branding-B-5oLD-k.js +0 -1
  181. package/dist/assets/connect-BX2QwOaU.js +0 -5
  182. package/dist/assets/dashboard-DbjH3qe4.js +0 -103
  183. package/dist/assets/de-CDBOH3k5.js +0 -7
  184. package/dist/assets/domains-D_GcYdME.js +0 -1
  185. package/dist/assets/engine-BzngvK61.js +0 -1
  186. package/dist/assets/es-BJ8CsIZi.js +0 -9
  187. package/dist/assets/fr-DSXQFpNy.js +0 -7
  188. package/dist/assets/get-safe-url-CqAaHb9L.js +0 -1
  189. package/dist/assets/hi-DLsQ4VdX.js +0 -5
  190. package/dist/assets/id-AzAQyOHL.js +0 -7
  191. package/dist/assets/index-BHa1_Bjz.js +0 -1039
  192. package/dist/assets/index-BNeXCm1B.js +0 -1
  193. package/dist/assets/index-Df4GSKx6.js +0 -1
  194. package/dist/assets/index-DoVbUHDU.js +0 -55
  195. package/dist/assets/index-pAjb_WaG.js +0 -281
  196. package/dist/assets/ja-C3ccbBe-.js +0 -9
  197. package/dist/assets/keyboard-arrow-down-rounded-8U0_i9QO.js +0 -1
  198. package/dist/assets/ko-9Vbo8tR2.js +0 -9
  199. package/dist/assets/localization-gLf4FT3Q.js +0 -1
  200. package/dist/assets/logger-CWnnO-wn.js +0 -1
  201. package/dist/assets/omit-BgmLPtMY.js +0 -1
  202. package/dist/assets/overview-Bf86Sw9l.js +0 -116
  203. package/dist/assets/passport-D6ZhqZ1F.js +0 -1
  204. package/dist/assets/profile-embed-BpG6-Rqz.js +0 -1
  205. package/dist/assets/pt-iqygmSLa.js +0 -5
  206. package/dist/assets/ru-BkfMvpq6.js +0 -5
  207. package/dist/assets/sdk-C3wBexZ2.js +0 -1
  208. package/dist/assets/security-Duf_ZEVi.js +0 -22
  209. package/dist/assets/simple-select-DbXWLzPn.js +0 -1
  210. package/dist/assets/th-D-pgFsDa.js +0 -5
  211. package/dist/assets/vendor-utils-drLlzTVq.js +0 -213
  212. package/dist/assets/vi-BuffIn3I.js +0 -5
  213. package/dist/assets/wrap-locale-DtcRIeKF.js +0 -1
  214. package/dist/assets/zh-CSl2KD_S.js +0 -10
  215. package/dist/assets/zh-tw-BiloxWNq.js +0 -9
@@ -1,4 +1,4 @@
1
- import{H as U,V as _,b1 as H,b9 as F,bp as Z,aN as G,aU as K}from"./vendor-ux-DfSgTRg5.js";import{Z as N,c as A}from"./index-BHa1_Bjz.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as W,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-DnR6WYuU.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-CVjlaHo_.js";import{u as ce}from"./useLocalStorage-BV1BIwfo.js";import{M as T}from"./index-B0Q9wWG1.js";import{d as de,e as M}from"./vendor-utils-drLlzTVq.js";import{S as V}from"./shorten-label-C4py9TLA.js";import{r as O}from"./index-CRAuhYSg.js";import{b as ue}from"./team-DNuHMrzV.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./base32-CXgP3JJ5.js";import"./session-Cm8j8XeZ.js";import"./isURL-CASPeQFe.js";import"./use-app-logo-CZWb8lrs.js";const B=i.createContext({}),{Provider:pe,Consumer:We}=B;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=N(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(B);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
1
+ import{H as U,V as _,b1 as H,b9 as F,bp as Z,at as G,aU as K}from"./vendor-ux-DTEmWsko.js";import{Z as W,c as A}from"./index-BZxsCCR_.js";import{j as e,D as I,ak as g,b2 as X,T as $,am as B,bl as J,I as D,cj as Q,dP as q,J as Y,a6 as ee,y as te,x as ne,bZ as oe,M as se,b_ as re,at as ae}from"./vendor-mui-core-DnR6WYuU.js";import{r as i,L as ie}from"./vendor-react-CTtPmzVP.js";import{p as le}from"./util-DWbXfz_X.js";import{u as ce}from"./useLocalStorage-DzhcQ3lj.js";import{M as T}from"./index-B0Q9wWG1.js";import{d as de,e as M}from"./vendor-utils-CxWN1dT3.js";import{S as V}from"./shorten-label-C4py9TLA.js";import{r as O}from"./index-CRAuhYSg.js";import{b as ue}from"./team-DJUogroZ.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./base32-D1hrOfad.js";import"./session-DwQKgNVz.js";import"./isURL-4Bkt0jKV.js";import"./use-app-logo-DbYok-1h.js";const N=i.createContext({}),{Provider:pe,Consumer:Be}=N;function fe(){return localStorage.getItem("audit-log-page-size")&&Number(localStorage.getItem("audit-log-page-size"))||10}function me({children:t,scope:c="",categories:o=[],showScope:l,scopeFormatter:p,blocklets:x}){const{api:h,info:v}=W(),[C,f]=i.useState([]),[m,y]=i.useState({total:0,pageSize:fe(),pageCount:0,page:1}),[L,s]=i.useState(!1),[w,a]=i.useState(""),[d,n]=ce(`audit-log-category-${c}`,"all"),j=[{value:"all",label:"All",description:""},{value:"blocklet",label:"Blocklet Management",description:""},{value:"server",label:"Server Management",description:""},{value:"team",label:"Team Management",description:""},{value:"security",label:"Security",description:""},{value:"certificates",label:"Certificate Management",description:""},{value:"integrations",label:"Integration Management",description:""},{value:"gateway",label:"Gateway",description:""}].filter(P=>o.length?P.value==="all"||o.includes(P.value):!0),b=async({page:P=1,pageSize:r=20,silent:z=!0}={})=>{if(!L){z||s(!0);try{const S=await h.getAuditLogs({input:{paging:{page:P,pageSize:r},category:d==="all"?"":d,scope:c,actionOrContent:w}});l&&(S.list||[]).forEach(E=>{E.scope!==v.did&&(E.link=`/blocklets/${E.scope}/components`)}),f(S.list),y(S.paging),s(!1)}catch(S){U.error(S.message),s(!1)}}};i.useEffect(()=>{localStorage.setItem("audit-log-page-size",m.pageSize)},[m.pageSize]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[]),i.useEffect(()=>{b({page:1,pageSize:m.pageSize,silent:!1})},[d,w]);const k={loading:L,fetch:b,filter:{category:d,scope:c},categories:j,blocklets:x,setCategory:n,data:C,paging:m,setPaging:y,showScope:l,scopeFormatter:p,actionOrContent:w,setActionOrContent:a};return e.jsx(pe,{value:{auditLogs:k},children:t})}function R(){const{auditLogs:t}=i.useContext(N);return t}function ge(t){if(!t)return[];const c=/\[([^\]]+)\]\(([^)]+)\)/g,o=[];let l;for(;(l=c.exec(t))!==null;)o.push({text:l[1],url:l[2]});return o}const xe=`
2
2
  <svg style="width:38px;height:38px;" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path fill-rule="evenodd" clip-rule="evenodd" d="M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z" fill="url(#paint0_linear_606_96)"/>
4
4
  <path fill-rule="evenodd" clip-rule="evenodd" d="M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z" fill="url(#paint1_linear_606_96)"/>
@@ -15,7 +15,7 @@ import{H as U,V as _,b1 as H,b9 as F,bp as Z,aN as G,aU as K}from"./vendor-ux-Df
15
15
  </linearGradient>
16
16
  </defs>
17
17
  </svg>
18
- `;function he({title:t,subTitle:c,titleInfo:o,action:l,createdAt:p,content:x,isLast:h,titleLink:v,avatarUrl:C,inService:f,renderTag:m}){const{locale:y}=_(),{palette:L}=I(),[s,w]=i.useState(!1),[a,d]=i.useState(!1),[n,u]=i.useState(window.innerWidth),j=i.useRef(null),b=()=>{const r=j.current?.mdp?.current;r&&d(r.scrollHeight>r.offsetHeight)};i.useEffect(()=>{const r=de(()=>{u(window.innerWidth)},100);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),i.useEffect(()=>{b()},[n,x]);const k=i.useMemo(()=>Object.entries(o).map(([r,z])=>({key:r,value:z})).filter(r=>!!r.value),[o]),P=i.useMemo(()=>{let r=x;return f&&ge(x).forEach(S=>{/^(?:\/[^/]+)*\/blocklets\/[^/]+\/members$/.test(S.url)&&(r=r.replace(S.url,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/did-connect/members`))}),r},[x,f]);return e.jsx(g,{"data-cy":"log-entry",sx:{borderBottom:h?"none":`1px solid ${L.divider}`,padding:2},children:e.jsxs(g,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(g,{sx:{mt:.5},className:"log-author",children:C?e.jsx(X,{src:C,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:xe}})}),e.jsxs(g,{sx:{width:240},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx($,{color:"textSecondary",component:"p",sx:{display:"flex"},children:v?e.jsx(ie,{to:v,target:"_blank",children:e.jsx(V,{maxLength:26,children:t})}):e.jsx(V,{maxLength:26,children:t})}),typeof m=="function"&&m()]}),e.jsx(W,{"aria-label":"Audit device info",title:e.jsx(g,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:k?.map(r=>e.jsx($,{sx:{fontSize:12,color:"#fff"},children:`${r.key}: ${r.value}`},r.key))}),children:e.jsxs($,{component:"span",color:"textSecondary",sx:{fontSize:13},children:[c,e.jsx(J,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(g,{sx:{width:200},children:[e.jsx($,{sx:{fontSize:"16px",color:L.text.primary,backgroundColor:L.background.default,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:l}),e.jsx($,{component:"span",color:"textSecondary",children:e.jsx(H,{value:p,locale:y,type:"all",disableTimezone:!0,sx:{fontSize:12}})})]}),e.jsx(g,{sx:{flex:1,".wmde-markdown":{bgcolor:"background.default",color:"text.primary",".code-highlight":{"white-space":"pre-wrap;","word-break":"break-all"}}},children:a&&s?e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg"},children:e.jsx(T,{source:P,rehypePlugins:[[O,{target:"_blank"}]]})}):e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg",display:s?"block":"-webkit-box",WebkitLineClamp:s?"none":2,WebkitBoxOrient:"vertical",overflow:s?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(T,{ref:j,source:P,rehypePlugins:[[O,{target:"_blank"}]]})})}),e.jsxs(g,{children:[a&&e.jsx(D,{size:"small",onClick:()=>w(!s),children:s?e.jsx(Q,{sx:{fontSize:22}}):e.jsx(q,{sx:{fontSize:22}})}),e.jsx(D,{size:"small",children:e.jsx(F,{sx:{fontSize:22},content:x})})]})]})})}const Le=({log:t,info:c,inService:o})=>o?`${A.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===c.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function be({log:t,isLast:c}){const{inService:o,info:l}=N(),{t:p}=_(),{teamDid:x}=ue(),{showScope:h,scopeFormatter:v=a=>a,blocklets:C}=R(),f=i.useMemo(()=>{const a=t?.componentDid,d=t?.scope;if(!a)return null;if(o)return(window.blocklet?.componentMountPoints??[]).find(({did:k})=>k===a)||null;const n=C.find(({appPid:b,appDid:k})=>[b,k].includes(d));return n&&(n.children??[]).find(({meta:b})=>b?.did===a)?.meta||null},[C,o,t?.componentDid,t?.scope]);if(!t.actor.did)return null;const m=!["blocklet",""].includes(t.actor.role),y=()=>{if(f){const n=f.title??f.name??"",u=h?` - ${v(t.scope)}`:"";return`${n}${u}`}const a=t.actor.fullName??"",d=h?v(t.scope):"";return a?h?`${a} - ${d}`:a:d},L=h?t.link:Le({log:t,inService:o,info:l}),s=()=>{if(f)return`${o?`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo-bundle/${t.componentDid}`:`/blocklet/logo-bundle/${t.scope}/${t.componentDid}`}?v=${f?.version}`;const{avatar:a,source:d}=t.actor||{};return a?le(a,x,o,d==="server"):""},w=()=>f?e.jsx(W,{title:t.componentDid,children:e.jsx(K,{type:"success",children:"SDK"},"source")}):"";return e.jsx(he,{isLast:c,isUser:m,avatarDid:t.actor.did,avatarUrl:s(),title:y()||p("common.unrecordedUser"),renderTag:w,titleLink:L,subTitle:t.actor.role?t.actor.role:"guest",content:t.content,action:t.action,inService:o,titleInfo:{IP:t.ip,OS:`${M(t,"env.os.name","")}${M(t,"env.os.version","")}`,Client:`${M(t,"env.browser.name","")}${M(t,"env.browser.Version","")}`},createdAt:t.createdAt})}function ve(){const{t}=_(),{palette:c}=I(),{data:o,loading:l,paging:p,setPaging:x,filter:h,categories:v,setCategory:C,fetch:f,actionOrContent:m,setActionOrContent:y}=R(),L=I(),s=Y(L.breakpoints.down("sm")),w=i.useMemo(()=>({flexDirection:s?"column":"row",alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between","& > div":s?{width:"100%",flex:1,".toolbar-search-area":{width:"100% !important",flex:"1 !important"}}:{}}),[s]),a=n=>{const u=Number(n.target.value);x({...p,pageSize:u}),f({page:1,pageSize:u,silent:!1})},d=n=>{x({...p,page:n+1}),f({page:n+1,pageSize:p.pageSize,silent:!1})};return l&&o.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(ee,{})}):e.jsxs(Ce,{"data-cy":"audit-logs",children:[e.jsxs(g,{className:"audit-logs-toolbar",sx:{display:"flex",flexDirection:s?"column":"row",gap:2,alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between",...w},children:[e.jsxs(te,{sx:s?{width:"100%",flex:1}:{width:240,flexShrink:0},variant:"outlined",children:[e.jsx(ne,{children:t("common.filter")}),e.jsx(oe,{size:"small","data-cy":"filter-by-category-trigger",value:h.category,onChange:n=>C(n.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:l,children:v.map(n=>e.jsx(se,{value:n.value,"data-cy":`filter-by-category-${n.value}`,children:e.jsx(g,{children:e.jsx("span",{children:n.label})})},n.label))})]}),e.jsx(Z,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:m,searchText:m,searchTextUpdate:y,searchClose:()=>y(""),onSearchOpen:()=>{}})]}),o.length===0&&e.jsx(G,{children:t("common.empty")}),e.jsx(g,{sx:{mt:2,border:o?.length>0?`1px solid ${c.divider}`:"none",borderRadius:1},children:o.length>0&&o.map((n,u)=>e.jsx(be,{log:n,isLast:u===o.length-1},n.id))}),e.jsx(g,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(re,{disabled:l,page:p.page-1,count:p.total,rowsPerPage:p.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:n,to:u,count:j})=>`${n}–${u} / ${j!==-1?j:`${t()}more than ${u}`}`,onPageChange:(n,u)=>d(u),onRowsPerPageChange:a})})]})}function Be({scope:t,categories:c,showScope:o,scopeFormatter:l,blocklets:p}){return e.jsx(me,{scope:t,categories:c,showScope:o,scopeFormatter:l,blocklets:p,children:e.jsx(ve,{})})}const Ce=ae.div`
18
+ `;function he({title:t,subTitle:c,titleInfo:o,action:l,createdAt:p,content:x,isLast:h,titleLink:v,avatarUrl:C,inService:f,renderTag:m}){const{locale:y}=_(),{palette:L}=I(),[s,w]=i.useState(!1),[a,d]=i.useState(!1),[n,u]=i.useState(window.innerWidth),j=i.useRef(null),b=()=>{const r=j.current?.mdp?.current;r&&d(r.scrollHeight>r.offsetHeight)};i.useEffect(()=>{const r=de(()=>{u(window.innerWidth)},100);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),i.useEffect(()=>{b()},[n,x]);const k=i.useMemo(()=>Object.entries(o).map(([r,z])=>({key:r,value:z})).filter(r=>!!r.value),[o]),P=i.useMemo(()=>{let r=x;return f&&ge(x).forEach(S=>{/^(?:\/[^/]+)*\/blocklets\/[^/]+\/members$/.test(S.url)&&(r=r.replace(S.url,`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/did-connect/members`))}),r},[x,f]);return e.jsx(g,{"data-cy":"log-entry",sx:{borderBottom:h?"none":`1px solid ${L.divider}`,padding:2},children:e.jsxs(g,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,width:"100%"},children:[e.jsx(g,{sx:{mt:.5},className:"log-author",children:C?e.jsx(X,{src:C,size:36,shape:"circle"}):e.jsx("div",{dangerouslySetInnerHTML:{__html:xe}})}),e.jsxs(g,{sx:{width:240},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx($,{color:"textSecondary",component:"p",sx:{display:"flex"},children:v?e.jsx(ie,{to:v,target:"_blank",children:e.jsx(V,{maxLength:26,children:t})}):e.jsx(V,{maxLength:26,children:t})}),typeof m=="function"&&m()]}),e.jsx(B,{"aria-label":"Audit device info",title:e.jsx(g,{sx:{color:"#fff",display:"flex",flexDirection:"column",fontSize:12},children:k?.map(r=>e.jsx($,{sx:{fontSize:12,color:"#fff"},children:`${r.key}: ${r.value}`},r.key))}),children:e.jsxs($,{component:"span",color:"textSecondary",sx:{fontSize:13},children:[c,e.jsx(J,{sx:{ml:.5,fontSize:12,verticalAlign:"middle"}})]})})]}),e.jsxs(g,{sx:{width:200},children:[e.jsx($,{sx:{fontSize:"16px",color:L.text.primary,backgroundColor:L.background.default,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'"},children:l}),e.jsx($,{component:"span",color:"textSecondary",children:e.jsx(H,{value:p,locale:y,type:"all",disableTimezone:!0,sx:{fontSize:12}})})]}),e.jsx(g,{sx:{flex:1,".wmde-markdown":{bgcolor:"background.default",color:"text.primary",".code-highlight":{"white-space":"pre-wrap;","word-break":"break-all"}}},children:a&&s?e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg"},children:e.jsx(T,{source:P,rehypePlugins:[[O,{target:"_blank"}]]})}):e.jsx($,{className:"log-content",color:"textPrimary",component:"div","data-color-mode":"light",gutterBottom:!0,sx:{maxWidth:"lg",display:s?"block":"-webkit-box",WebkitLineClamp:s?"none":2,WebkitBoxOrient:"vertical",overflow:s?"visible":"hidden",wordBreak:"break-word"},children:e.jsx(T,{ref:j,source:P,rehypePlugins:[[O,{target:"_blank"}]]})})}),e.jsxs(g,{children:[a&&e.jsx(D,{size:"small",onClick:()=>w(!s),children:s?e.jsx(Q,{sx:{fontSize:22}}):e.jsx(q,{sx:{fontSize:22}})}),e.jsx(D,{size:"small",children:e.jsx(F,{sx:{fontSize:22},content:x})})]})]})})}const Le=({log:t,info:c,inService:o})=>o?`${A.WELLKNOWN_BLOCKLET_ADMIN_PATH}/members?did=${t.actor.did}`:t.scope===c.did?`/team/members?did=${t.actor.did}`:`/blocklets/${t.scope}/members?did=${t.actor.did}`;function be({log:t,isLast:c}){const{inService:o,info:l}=W(),{t:p}=_(),{teamDid:x}=ue(),{showScope:h,scopeFormatter:v=a=>a,blocklets:C}=R(),f=i.useMemo(()=>{const a=t?.componentDid,d=t?.scope;if(!a)return null;if(o)return(window.blocklet?.componentMountPoints??[]).find(({did:k})=>k===a)||null;const n=C.find(({appPid:b,appDid:k})=>[b,k].includes(d));return n&&(n.children??[]).find(({meta:b})=>b?.did===a)?.meta||null},[C,o,t?.componentDid,t?.scope]);if(!t.actor.did)return null;const m=!["blocklet",""].includes(t.actor.role),y=()=>{if(f){const n=f.title??f.name??"",u=h?` - ${v(t.scope)}`:"";return`${n}${u}`}const a=t.actor.fullName??"",d=h?v(t.scope):"";return a?h?`${a} - ${d}`:a:d},L=h?t.link:Le({log:t,inService:o,info:l}),s=()=>{if(f)return`${o?`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo-bundle/${t.componentDid}`:`/blocklet/logo-bundle/${t.scope}/${t.componentDid}`}?v=${f?.version}`;const{avatar:a,source:d}=t.actor||{};return a?le(a,x,o,d==="server"):""},w=()=>f?e.jsx(B,{title:t.componentDid,children:e.jsx(K,{type:"success",children:"SDK"},"source")}):"";return e.jsx(he,{isLast:c,isUser:m,avatarDid:t.actor.did,avatarUrl:s(),title:y()||p("common.unrecordedUser"),renderTag:w,titleLink:L,subTitle:t.actor.role?t.actor.role:"guest",content:t.content,action:t.action,inService:o,titleInfo:{IP:t.ip,OS:`${M(t,"env.os.name","")}${M(t,"env.os.version","")}`,Client:`${M(t,"env.browser.name","")}${M(t,"env.browser.Version","")}`},createdAt:t.createdAt})}function ve(){const{t}=_(),{palette:c}=I(),{data:o,loading:l,paging:p,setPaging:x,filter:h,categories:v,setCategory:C,fetch:f,actionOrContent:m,setActionOrContent:y}=R(),L=I(),s=Y(L.breakpoints.down("sm")),w=i.useMemo(()=>({flexDirection:s?"column":"row",alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between","& > div":s?{width:"100%",flex:1,".toolbar-search-area":{width:"100% !important",flex:"1 !important"}}:{}}),[s]),a=n=>{const u=Number(n.target.value);x({...p,pageSize:u}),f({page:1,pageSize:u,silent:!1})},d=n=>{x({...p,page:n+1}),f({page:n+1,pageSize:p.pageSize,silent:!1})};return l&&o.length===0?e.jsx("div",{style:{textAlign:"center",marginTop:"50px"},children:e.jsx(ee,{})}):e.jsxs(Ce,{"data-cy":"audit-logs",children:[e.jsxs(g,{className:"audit-logs-toolbar",sx:{display:"flex",flexDirection:s?"column":"row",gap:2,alignItems:s?"flex-start":"center",justifyContent:s?"flex-start":"space-between",...w},children:[e.jsxs(te,{sx:s?{width:"100%",flex:1}:{width:240,flexShrink:0},variant:"outlined",children:[e.jsx(ne,{children:t("common.filter")}),e.jsx(oe,{size:"small","data-cy":"filter-by-category-trigger",value:h.category,onChange:n=>C(n.target.value),fullWidth:!0,sx:{borderRadius:1},label:t("common.category"),disabled:l,children:v.map(n=>e.jsx(se,{value:n.value,"data-cy":`filter-by-category-${n.value}`,children:e.jsx(g,{children:e.jsx("span",{children:n.label})})},n.label))})]}),e.jsx(Z,{options:{searchPlaceholder:t("common.auditLogsSearch"),searchDebounceTime:600},search:m,searchText:m,searchTextUpdate:y,searchClose:()=>y(""),onSearchOpen:()=>{}})]}),o.length===0&&e.jsx(G,{children:t("common.empty")}),e.jsx(g,{sx:{mt:2,border:o?.length>0?`1px solid ${c.divider}`:"none",borderRadius:1},children:o.length>0&&o.map((n,u)=>e.jsx(be,{log:n,isLast:u===o.length-1},n.id))}),e.jsx(g,{sx:{display:"flex",justifyContent:"flex-end",mt:2},children:e.jsx(re,{disabled:l,page:p.page-1,count:p.total,rowsPerPage:p.pageSize,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:n,to:u,count:j})=>`${n}–${u} / ${j!==-1?j:`${t()}more than ${u}`}`,onPageChange:(n,u)=>d(u),onRowsPerPageChange:a})})]})}function Ne({scope:t,categories:c,showScope:o,scopeFormatter:l,blocklets:p}){return e.jsx(me,{scope:t,categories:c,showScope:o,scopeFormatter:l,blocklets:p,children:e.jsx(ve,{})})}const Ce=ae.div`
19
19
  .log-content {
20
20
  p {
21
21
  margin-bottom: 4px;
@@ -32,4 +32,4 @@ import{H as U,V as _,b1 as H,b9 as F,bp as Z,aN as G,aU as K}from"./vendor-ux-Df
32
32
  overflow: auto;
33
33
  }
34
34
  }
35
- `;export{Be as default};
35
+ `;export{Ne as default};
@@ -1 +1 @@
1
- import{J as A,j as e,ak as t,a6 as E,Q as l,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-DnR6WYuU.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{x as D}from"./vendor-hooks-cYMUGE4V.js";import{C as b}from"./vendor-utils-drLlzTVq.js";import{u as B,c as u,V as H,H as U,b6 as M,o as V}from"./index-BHa1_Bjz.js";import{K as p}from"./landing-page-Cv6belCa.js";import{V as K,M as y}from"./vendor-ux-DfSgTRg5.js";import{W as Q}from"./did-address-DqhneWXa.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=K(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await V.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Q,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
1
+ import{J as A,j as e,ak as t,a6 as E,Q as l,cm as W,T as o,b2 as z,am as I,b$ as R,bX as L,a5 as O,a3 as T,bb as f,b6 as F}from"./vendor-mui-core-DnR6WYuU.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{x as D}from"./vendor-hooks-qxhUUbW5.js";import{C as b}from"./vendor-utils-CxWN1dT3.js";import{u as B,c as u,V as H,H as U,b6 as M,o as V}from"./index-BZxsCCR_.js";import{K as p}from"./landing-page-CNLD6T-R.js";import{V as K,M as y}from"./vendor-ux-DTEmWsko.js";import{W as Q}from"./did-address-CQO2MAbB.js";import"./vendor-arcblock-CIBaEWEy.js";import"./lottie-web-4koyQiv_.js";function re(){const{searchParams:r}=new URL(window.location.href),{session:d}=B(),{t:c}=K(),m=r.get("client_id"),_=r.get("scope")||"profile:read",[g,w]=x.useState(_.split(" ").filter(Boolean)),v=A("(max-width: 600px)"),k=b(window.location.origin,u.WELLKNOWN_SERVICE_PATH_PREFIX,"/oauth/authorize"),C=x.useCallback(i=>i?i.startsWith("http")?i:`${b(u.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/media/upload",window.blocklet.appPid)}/${i}`:"",[]),[h,j]=D({client:null,loading:!0});x.useEffect(()=>{(async()=>{const{data:n}=await V.get("/oauth/client",{params:{clientId:m}});j({client:n,loading:!1})})()},[m,j]);const S=i=>{i!=="profile:read"&&w(n=>n.includes(i)?n.filter(P=>P!==i):[...n,i])};if(h.loading||!d?.user)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(E,{})})});if(!h.client)return e.jsx(p,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(t,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:e.jsx(H,{style:{backgroundColor:"transparent"},status:"error",title:c("notFoundOauthClient"),extra:e.jsx(l,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(W,{}),href:"/",style:{borderRadius:4},children:c("connectCli.home")})})})});const{client:s}=h,{user:a}=d,N=(s.scope||"").split(" ");return e.jsxs(p,{did:window.blocklet?.appPid,standalone:!0,children:[e.jsx(U,{children:e.jsxs("title",{children:[c("oauth.authorize")," | ",window.blocklet?.appName]})}),e.jsx(M,{hideCloseButton:!0,children:e.jsxs(t,{sx:{display:"flex",flexDirection:"column",p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},className:"page-authorize",children:[e.jsxs(t,{sx:{textAlign:"center",mb:2},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"center",mb:2},children:[e.jsx(y,{src:window.blocklet?.appLogo,alt:"Server",width:48,height:48}),e.jsxs(t,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"}),e.jsx(t,{className:"dot"})]}),e.jsx(y,{src:C(s.logo_uri),alt:s.client_name,width:48,height:48})]}),e.jsxs(o,{sx:{mb:1,fontSize:"1.2rem","& .app-name":{color:"primary.main"}},children:["Authorize ",e.jsx("span",{className:"app-name",children:s.client_name})]})]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",width:"100%",overflow:"hidden",mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},className:"info",children:[e.jsx(z,{src:a.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),e.jsxs(t,{sx:{flex:1,overflow:"hidden"},children:[e.jsx(I,{title:a.fullName,children:e.jsx(t,{className:"name",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:a.fullName})}),e.jsx(t,{className:"did",children:e.jsx(Q,{compact:!0,responsive:!1,did:a.did,showQrcode:!v})})]})]}),e.jsxs(o,{variant:"subtitle1",sx:{mb:2,fontWeight:500},children:["Allow ",s.client_name," to do the following on your behalf:"]}),e.jsxs(t,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden"},children:[e.jsx(t,{sx:{p:2},children:e.jsx(R,{children:Object.entries(u.OAUTH_SCOPES).filter(([i])=>N.includes(i)).map(([i,n])=>e.jsx(L,{control:e.jsx(O,{checked:g.includes(i),onChange:()=>S(i),disabled:i==="profile:read"||["blocklet:read","blocklet:write"].includes(i)&&!["owner","admin","member"].includes(a.role),color:"primary",sx:{"&.Mui-checked":{color:"success.main"}}}),label:e.jsx(t,{children:e.jsx(o,{variant:"body1",sx:{fontWeight:500},children:n})}),sx:{mb:0}},i))})}),(s.tos_uri||s.policy_uri)&&e.jsxs(e.Fragment,{children:[e.jsx(T,{}),e.jsx(t,{sx:{height:1,bgcolor:"divider"}}),e.jsx(t,{sx:{p:2,color:"text.secondary"},children:e.jsxs(o,{variant:"body2",children:["By authorize the access, you also agree with the"," ",!!s.tos_uri&&e.jsx(f,{href:s.tos_uri,target:"_blank",children:"Terms of Use"}),!!s.tos_uri&&!!s.policy_uri&&" and ",!!s.policy_uri&&e.jsx(f,{href:s.policy_uri,target:"_blank",children:"Privacy Policy"})]})})]})]}),e.jsxs("form",{method:"POST",action:k,children:[r.get("client_id")&&e.jsx("input",{type:"hidden",name:"client_id",value:r.get("client_id")}),r.get("response_type")&&e.jsx("input",{type:"hidden",name:"response_type",value:r.get("response_type")}),r.get("redirect_uri")&&e.jsx("input",{type:"hidden",name:"redirect_uri",value:r.get("redirect_uri")}),r.get("code_challenge")&&e.jsx("input",{type:"hidden",name:"code_challenge",value:r.get("code_challenge")}),r.get("code_challenge_method")&&e.jsx("input",{type:"hidden",name:"code_challenge_method",value:r.get("code_challenge_method")}),r.get("state")&&e.jsx("input",{type:"hidden",name:"state",value:r.get("state")}),e.jsx("input",{type:"hidden",name:"scope",value:g.join(" ")}),e.jsx(t,{sx:{mt:"auto",pt:3},children:e.jsxs(F,{direction:"row",spacing:2,children:[e.jsx(l,{variant:"outlined",size:"large",fullWidth:!0,type:"submit",name:"action",value:"deny",children:"Cancel"}),e.jsx(l,{variant:"contained",size:"large",fullWidth:!0,type:"submit",name:"action",value:"allow",children:"Authorize"})]})}),r.get("redirect_uri")&&e.jsxs(t,{sx:{mt:3,textAlign:"center"},children:[e.jsx(o,{variant:"body2",sx:{color:"text.secondary"},children:"You will be redirected to"}),e.jsx(o,{variant:"body2",sx:{color:"text.secondary",wordBreak:"break-all"},children:r.get("redirect_uri")})]}),e.jsx(t,{sx:{mt:2,textAlign:"center"},children:e.jsxs(o,{variant:"body2",children:["Not you?"," ",e.jsx(l,{variant:"text",color:"primary",onClick:()=>d.switchDid(),sx:{p:0,minWidth:"auto",textTransform:"none",verticalAlign:"baseline",fontWeight:"inherit",fontSize:"inherit","&:hover":{background:"none",textDecoration:"underline"}},children:"Use another account"})]})})]})]})})]})}export{re as default};
@@ -1 +1 @@
1
- import{r as p}from"./vendor-react-CTtPmzVP.js";import{D as L,j as f,c5 as T,T as j,ak as k,W as t}from"./vendor-mui-core-DnR6WYuU.js";import{E as C}from"./index-B5vc0eG5.js";import{a as D}from"./vendor-utils-drLlzTVq.js";const A=a=>{const h=new Date(Math.min(...a)),r=(new Date(Math.max(...a))-h)/(1e3*60);return u=>{if(r<=10){const c=(a.length-a.length%r)/r;return u%c===0}const d=(a.length-a.length%6)/6;return u%d===0}};function S({title:a="",total:h=0,history:s=[],valueFn:y=n=>n,xAxisFormat:r=n=>n,visualMapPieces:u=[],markLineData:v={},extraInfo:d=null,empty:w=null,onHover:c=()=>{},hoverIndex:i=null}){const n=L(),o=p.useRef(null),b=p.useMemo(()=>D(s)?[]:s.map(e=>r(e.date)),[s,r]);p.useEffect(()=>{if(!o.current||i?.ref===o)return;const e=o.current.getEchartsInstance(),l=i?.seriesIndex,x=b.findIndex(g=>g===i?.dataValue);i&&x!==-1?e.dispatchAction({type:"showTip",seriesIndex:l,dataIndex:x}):(e.dispatchAction({type:"hideTip"}),e.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[i?.dataIndex]);const m=p.useCallback(()=>{c?.(null)},[c]);if(p.useEffect(()=>{if(o.current){const e=o.current.getEchartsInstance(),l=e.getDom();return l.addEventListener("mouseleave",m),()=>{l.removeEventListener("mouseleave",m),e.dispose()}}},[m]),D(s))return w||null;const E=Math.max(...s.map(e=>e.value),h||0,0),M={tooltip:{trigger:"axis",formatter(e){const l=e[0].data,x=y(l),{seriesIndex:g,dataIndex:I}=e[0];return c?.({seriesIndex:g,dataIndex:I,dataValue:b[I],ref:i?.ref||o}),`${e[0].name}: <b>${x}</b>`},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:b,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:A(s.map(e=>new Date(e.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:E,interval:Math.ceil(E/2),axisLabel:{formatter:y,padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:u},series:[{name:`${a} Usage`,type:"line",smooth:!0,symbol:"none",lineStyle:{color:n.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:s.map(e=>e.value),markLine:v}]};return f.jsxs(T,{sx:{p:1,position:"relative"},children:[f.jsx(j,{sx:{fontSize:"16px",fontWeight:"bold",color:"text.secondary",position:"absolute",top:8,left:16,zIndex:10},children:a}),f.jsx(C,{ref:o,option:M,style:{width:"100%",height:"200px"},onEvents:{globalout:m}}),d&&f.jsx(k,{sx:{color:"text.secondary",ml:2,mt:1,fontSize:12},children:d})]})}S.propTypes={title:t.string,total:t.number,history:t.array,valueFn:t.func,xAxisFormat:t.func,visualMapPieces:t.array,markLineData:t.object,extraInfo:t.node,empty:t.node,onHover:t.func,hoverIndex:t.object};export{S as B};
1
+ import{r as p}from"./vendor-react-CTtPmzVP.js";import{D as L,j as f,c5 as T,T as j,ak as k,W as t}from"./vendor-mui-core-DnR6WYuU.js";import{E as C}from"./index-D1SIrheh.js";import{a as D}from"./vendor-utils-CxWN1dT3.js";const A=a=>{const h=new Date(Math.min(...a)),r=(new Date(Math.max(...a))-h)/(1e3*60);return u=>{if(r<=10){const c=(a.length-a.length%r)/r;return u%c===0}const d=(a.length-a.length%6)/6;return u%d===0}};function S({title:a="",total:h=0,history:s=[],valueFn:y=n=>n,xAxisFormat:r=n=>n,visualMapPieces:u=[],markLineData:v={},extraInfo:d=null,empty:w=null,onHover:c=()=>{},hoverIndex:i=null}){const n=L(),o=p.useRef(null),b=p.useMemo(()=>D(s)?[]:s.map(e=>r(e.date)),[s,r]);p.useEffect(()=>{if(!o.current||i?.ref===o)return;const e=o.current.getEchartsInstance(),l=i?.seriesIndex,x=b.findIndex(g=>g===i?.dataValue);i&&x!==-1?e.dispatchAction({type:"showTip",seriesIndex:l,dataIndex:x}):(e.dispatchAction({type:"hideTip"}),e.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[i?.dataIndex]);const m=p.useCallback(()=>{c?.(null)},[c]);if(p.useEffect(()=>{if(o.current){const e=o.current.getEchartsInstance(),l=e.getDom();return l.addEventListener("mouseleave",m),()=>{l.removeEventListener("mouseleave",m),e.dispose()}}},[m]),D(s))return w||null;const E=Math.max(...s.map(e=>e.value),h||0,0),M={tooltip:{trigger:"axis",formatter(e){const l=e[0].data,x=y(l),{seriesIndex:g,dataIndex:I}=e[0];return c?.({seriesIndex:g,dataIndex:I,dataValue:b[I],ref:i?.ref||o}),`${e[0].name}: <b>${x}</b>`},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:b,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:A(s.map(e=>new Date(e.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:E,interval:Math.ceil(E/2),axisLabel:{formatter:y,padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:u},series:[{name:`${a} Usage`,type:"line",smooth:!0,symbol:"none",lineStyle:{color:n.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:s.map(e=>e.value),markLine:v}]};return f.jsxs(T,{sx:{p:1,position:"relative"},children:[f.jsx(j,{sx:{fontSize:"16px",fontWeight:"bold",color:"text.secondary",position:"absolute",top:8,left:16,zIndex:10},children:a}),f.jsx(C,{ref:o,option:M,style:{width:"100%",height:"200px"},onEvents:{globalout:m}}),d&&f.jsx(k,{sx:{color:"text.secondary",ml:2,mt:1,fontSize:12},children:d})]})}S.propTypes={title:t.string,total:t.number,history:t.array,valueFn:t.func,xAxisFormat:t.func,visualMapPieces:t.array,markLineData:t.object,extraInfo:t.node,empty:t.node,onHover:t.func,hoverIndex:t.object};export{S as B};
@@ -1 +1 @@
1
- import{r as x}from"./vendor-ux-DfSgTRg5.js";import{e as m}from"./vendor-react-CTtPmzVP.js";class w{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return l(this,e)}}class y{constructor(e){this.decoders=e}or(e){return l(this,e)}decode(e){const r=e[0],o=this.decoders[r];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const l=(t,e)=>new y({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class E{constructor(e,r,o,s){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=s,this.encoder=new w(e,r,o),this.decoder=new g(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const A=({name:t,prefix:e,encode:r,decode:o})=>new E(t,e,r,o),C=(t,e,r,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let i=t.length;for(;t[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let n=0,c=0,h=0;for(let p=0;p<i;++p){const u=s[t[p]];if(u===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|u,n+=r,n>=8&&(n-=8,a[h++]=255&c>>n)}if(n>=r||255&c<<8-n)throw new SyntaxError("Unexpected end of data");return a},P=(t,e,r)=>{const o=e[e.length-1]==="=",s=(1<<r)-1;let i="",a=0,n=0;for(let c=0;c<t.length;++c)for(n=n<<8|t[c],a+=8;a>r;)a-=r,i+=e[s&n>>a];if(a&&(i+=e[s&n<<r-a]),o)for(;i.length*r&7;)i+="=";return i},d=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>A({prefix:e,name:t,encode(s){return P(s,o,r)},decode(s){return C(s,o,r,t)}}),$=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),v=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),D=Object.freeze(Object.defineProperty({__proto__:null,base32:$,base32hex:q,base32hexpad:O,base32hexpadupper:j,base32hexupper:B,base32pad:S,base32padupper:U,base32upper:v,base32z:k},Symbol.toStringTag,{value:"Module"})),N=m(D);var f,b;function R(){if(b)return f;b=1;const{toBuffer:t,toAddress:e,toBase58:r,toHex:o}=x(),{base32:s}=N;return f={encode:n=>{if(!n)return n;const c=t(e(n));return s.encode(c)},decode:n=>{if(!n)return n;const c=s.decode(n),h=r(c);return h.length>30?h:o(c)}},f}export{R as r};
1
+ import{r as x}from"./vendor-ux-DTEmWsko.js";import{e as m}from"./vendor-react-CTtPmzVP.js";class w{constructor(e,r,o){this.name=e,this.prefix=r,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g{constructor(e,r,o){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=o}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return l(this,e)}}class y{constructor(e){this.decoders=e}or(e){return l(this,e)}decode(e){const r=e[0],o=this.decoders[r];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const l=(t,e)=>new y({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class E{constructor(e,r,o,s){this.name=e,this.prefix=r,this.baseEncode=o,this.baseDecode=s,this.encoder=new w(e,r,o),this.decoder=new g(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const A=({name:t,prefix:e,encode:r,decode:o})=>new E(t,e,r,o),C=(t,e,r,o)=>{const s={};for(let p=0;p<e.length;++p)s[e[p]]=p;let i=t.length;for(;t[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let n=0,c=0,h=0;for(let p=0;p<i;++p){const u=s[t[p]];if(u===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<r|u,n+=r,n>=8&&(n-=8,a[h++]=255&c>>n)}if(n>=r||255&c<<8-n)throw new SyntaxError("Unexpected end of data");return a},P=(t,e,r)=>{const o=e[e.length-1]==="=",s=(1<<r)-1;let i="",a=0,n=0;for(let c=0;c<t.length;++c)for(n=n<<8|t[c],a+=8;a>r;)a-=r,i+=e[s&n>>a];if(a&&(i+=e[s&n<<r-a]),o)for(;i.length*r&7;)i+="=";return i},d=({name:t,prefix:e,bitsPerChar:r,alphabet:o})=>A({prefix:e,name:t,encode(s){return P(s,o,r)},decode(s){return C(s,o,r,t)}}),$=d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),v=d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),S=d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),q=d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B=d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),O=d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),j=d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k=d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),D=Object.freeze(Object.defineProperty({__proto__:null,base32:$,base32hex:q,base32hexpad:O,base32hexpadupper:j,base32hexupper:B,base32pad:S,base32padupper:U,base32upper:v,base32z:k},Symbol.toStringTag,{value:"Module"})),N=m(D);var f,b;function R(){if(b)return f;b=1;const{toBuffer:t,toAddress:e,toBase58:r,toHex:o}=x(),{base32:s}=N;return f={encode:n=>{if(!n)return n;const c=t(e(n));return s.encode(c)},decode:n=>{if(!n)return n;const c=s.decode(n),h=r(c);return h.length>30?h:o(c)}},f}export{R as r};
@@ -1 +1 @@
1
- import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{Y as O,u as F,aF as I,l as P,c1 as U}from"./index-BHa1_Bjz.js";import{V as D,z as k,ar as Q,J as Y}from"./vendor-ux-DfSgTRg5.js";import{a as J}from"./page-header-CHAwrgX-.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-D6RwAFss.js";import{S as _}from"./layout-DkW-u1GX.js";import{S as G}from"./step-actions-DkehnzsP.js";import"./vendor-arcblock-CPCSE54a.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";const K={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(k,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(Y,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(k,{icon:U,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=F(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},w=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(J,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{w()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(k,{icon:K}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Q(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{w()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
1
+ import{j as e,ak as l,aZ as B,T as f,D as H,n as Z,am as $,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{Y as O,u as F,aF as I,j as P,c1 as U}from"./index-BZxsCCR_.js";import{V as D,z as k,as as Q,J as Y}from"./vendor-ux-DTEmWsko.js";import{a as J}from"./page-header-CHAwrgX-.js";import{r as x}from"./vendor-react-CTtPmzVP.js";import{S as W}from"./button-DOFHdsTg.js";import{S as _}from"./layout-Rdrg1NRp.js";import{S as G}from"./step-actions-Bejkv1Kq.js";import"./vendor-arcblock-CIBaEWEy.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";const K={width:24,height:24,body:'<path fill="currentColor" d="M17 17q.625 0 1.063-.438T18.5 15.5q0-.625-.438-1.063T17 14q-.625 0-1.063.438T15.5 15.5q0 .625.438 1.063T17 17Zm0 3q.775 0 1.425-.363t1.05-.962q-.55-.325-1.175-.5T17 18q-.675 0-1.3.175t-1.175.5q.4.6 1.05.963T17 20Zm0 2q-2.075 0-3.538-1.463T12 17q0-2.075 1.463-3.538T17 12q2.075 0 3.538 1.463T22 17q0 2.075-1.463 3.538T17 22Zm-5 0q-3.475-.875-5.738-3.988T4 11.1V5l8-3l8 3v5.675q-.65-.325-1.463-.5T17 10q-2.9 0-4.95 2.05T10 17q0 1.55.588 2.8t1.487 2.175q-.025 0-.037.013T12 22Z"/>'},X={width:24,height:24,body:'<path fill="currentColor" d="M7 15q1.25 0 2.125-.875T10 12q0-1.25-.875-2.125T7 9q-1.25 0-2.125.875T4 12q0 1.25.875 2.125T7 15Zm0 3q-2.5 0-4.25-1.75T1 12q0-2.5 1.75-4.25T7 6q2.025 0 3.538 1.15T12.65 10h8.375L23 11.975l-3.5 4L17 14l-2 2l-2-2h-.35q-.625 1.8-2.175 2.9T7 18Z"/>'},ee={width:24,height:24,body:'<path fill="currentColor" d="M4 20q-.825 0-1.413-.588T2 18V6q0-.825.588-1.413T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.588 1.413T20 20H4Zm8-7L4 8v10h16V8l-8 5Zm0-2l8-5H4l8 5ZM4 8V6v12V8Z"/>'},te={width:24,height:24,body:'<path fill="currentColor" d="M6 20q-1.65 0-2.825-1.175T2 16V8q0-1.65 1.175-2.825T6 4h12q1.65 0 2.825 1.175T22 8v8q0 1.65-1.175 2.825T18 20H6ZM6 8h12q.55 0 1.05.125t.95.4V8q0-.825-.588-1.413T18 6H6q-.825 0-1.413.588T4 8v.525q.45-.275.95-.4T6 8Zm-1.85 3.25l11.125 2.7q.225.05.45 0t.425-.2l3.475-2.9q-.275-.375-.7-.613T18 10H6q-.65 0-1.137.338t-.713.912Z"/>'},z=n=>({wallet:{icon:te,label:n("setup.connectAccount.wallet"),description:n("setup.connectAccount.walletDesc"),isDefault:!1,priority:1},passkey:{icon:X,label:n("setup.connectAccount.passkey"),description:n("setup.connectAccount.passkeyDesc"),isDefault:!1,priority:2},email:{icon:ee,label:n("setup.connectAccount.email"),description:n("setup.connectAccount.emailDesc"),isDefault:!0,priority:3}});function M({type:n,account:b=null,onBind:s,bindButton:g=null,loading:q=!1,recommended:o=!1}){const{t:m}=D(),a=z(m)[n],h=!!b,i=H();return e.jsx(l,{sx:{mb:2,p:{xs:1.5,sm:2},border:1,borderColor:o?Z(i.palette.primary.main,.2):"divider",borderRadius:1,bgcolor:o?Z(i.palette.primary.main,.08):"background.paper"},children:e.jsxs(l,{sx:{display:"flex",alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",sm:"row"},gap:{xs:1.5,sm:2}},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1.5,width:{xs:"100%",sm:"auto"}},children:[e.jsx(k,{icon:a.icon,style:{fontSize:"20px"}}),e.jsxs(l,{sx:{flex:1,minWidth:0},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[e.jsx(f,{variant:"subtitle2",sx:{fontWeight:500,fontSize:{xs:"0.875rem",sm:"1rem"}},children:a.label}),h&&c("mobile"),o&&e.jsx(f,{variant:"caption",sx:{color:"warning.main",fontWeight:500,fontSize:"0.7rem"},children:m("setup.connectAccount.recommended")})]}),e.jsx(l,{sx:{mt:.5},children:C(b)})]})]}),a.isDefault?c():e.jsx(l,{sx:{width:{xs:"100%",sm:"auto"},display:"flex",justifyContent:"center"},children:h?c():g||e.jsx(W,{variant:"outlined",size:"small",onClick:()=>s(n),disabled:q,fullWidth:{xs:!0,sm:!1},sx:{borderColor:"primary.main",height:"32px !important",minWidth:{xs:"100%",sm:"60px"},fontSize:{xs:"0.875rem",sm:"0.8125rem"}},children:m("setup.connectAccount.connect")})})]})});function C(d){return h?d.displayName===d.did?e.jsx(Y,{did:d.did,showQrcode:!0}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{fontFamily:"monospace",mt:.5},children:d.displayName}):e.jsx(f,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a.description})}function c(d){const p=d==="mobile";return e.jsx(l,{sx:{minWidth:p?"auto":{xs:"100%",sm:"60px"},display:p?{xs:"flex",md:"none"}:{xs:"none",md:"flex"},alignItems:"center",justifyContent:"center"},children:e.jsx($,{title:m("setup.connectAccount.connected"),placement:"top",children:e.jsx(k,{icon:U,style:{color:i.palette.success.main,fontSize:p?"18px":"24px"}})})})}}M.propTypes={type:u.string.isRequired,account:u.object,onBind:u.func.isRequired,bindButton:u.node,loading:u.bool,recommended:u.bool};function se({onNext:n=()=>{},onPrevious:b=()=>{}}){const{t:s}=D(),{blocklet:g}=O(),[q,o]=x.useState(!1),[m,a]=x.useState(!1),[h,i]=x.useState(null),{api:C,session:c}=F(),d=x.useRef(null),p=()=>{const t=c.user?.connectedAccounts||[],r={};return t.forEach(j=>{const{provider:S,userInfo:E,did:T,id:L}=j;S==="email"?r.email={did:T,displayName:L?.replace("email|","")||c.user?.email,...j}:S==="wallet"?r.wallet={did:T,displayName:T,...j}:S==="passkey"&&(r.passkey={did:T,displayName:E?.name||T,...j})}),r},[y,N]=x.useState(p());x.useEffect(()=>{N(p())},[c]);const R=t=>{i(t),o(!0),t==="wallet"?a(!0):t==="passkey"&&d.current.click()},w=()=>{c.refresh(),o(!1),a(!1),i(null)},v=z(s),V=Object.keys(v).filter(r=>!y[r]&&!v[r].isDefault).slice(0,2),A=Object.values(y).filter(Boolean).length;return e.jsxs(_,{children:[e.jsx("div",{className:"header",children:e.jsx(J,{title:s("setup.connectAccount.title"),onClickBack:b})}),e.jsxs(l,{className:"form-container",sx:{maxWidth:"700px",px:{xs:1,sm:0},width:"100%"},children:[Object.entries(v).filter(([t])=>y[t]||t!=="email").sort(([,t],[,r])=>t.priority-r.priority).map(([t])=>e.jsx(M,{type:t,account:y[t],onBind:R,bindButton:t==="passkey"?e.jsx(I,{behavior:"only-new",action:"connect",sx:{height:"32px",minWidth:{xs:"100%",sm:"60px"},border:"1px solid",borderColor:"primary.main","& .MuiTypography-root":{color:"primary.main",textAlign:"center",fontSize:{xs:"0.875rem",sm:"0.8125rem"}},"& > div:first-child":{display:"none"},"& > svg":{display:"none !important"}},createButtonText:s("setup.connectAccount.connect"),createMode:"connect",onConnect:()=>{o(!0),i("passkey")},onSuccess:()=>{w()},onError:()=>{o(!1),i(null)},dense:!0},"passkey"):null,loading:q&&h===t,recommended:V.includes(t)},t)),A===1?!!y.email&&e.jsx(B,{severity:"warning",sx:{mt:-1},children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.securityTip")})}):e.jsx(B,{severity:"success",sx:{mb:{xs:2,sm:3}},icon:e.jsx(k,{icon:K}),children:e.jsx(f,{variant:"body2",sx:{fontSize:{xs:"0.8rem",sm:"0.875rem"}},children:s("setup.connectAccount.statusSuccess",{count:A})})}),e.jsx(P,{popup:!0,open:m,action:"bind-wallet",checkFn:C.get,checkTimeout:10*60*1e3,webWalletUrl:Q(),onClose:()=>{a(!1),o(!1),i(null)},onSuccess:()=>{w()},locale:"zh",messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{previousUserDid:c.user?.did,skipMigrateAccount:!0,isService:!0}})]}),e.jsx(G,{blocklet:g,children:e.jsx(W,{variant:"contained",onClick:()=>n(),disabled:q,sx:{minWidth:{xs:100,sm:120}},children:A>0?s("setup.continue"):s("setup.connectAccount.skipBinding")})})]})}se.propTypes={onNext:u.func,onPrevious:u.func};export{se as default};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{V as fe,_ as be}from"./vendor-ux-DfSgTRg5.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-DnR6WYuU.js";import{c as D}from"./index-BHa1_Bjz.js";import{E as N}from"./empty-spinner-BYDonf35.js";import{q as Pe,u as Re}from"./vendor-hooks-cYMUGE4V.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-89LKdt03.js";import{S as F}from"./studio-D4hiQNwZ.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-C2HNVEZ0.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-CtJhxyJT.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!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(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
2
+ import{V as fe,_ as be}from"./vendor-ux-DTEmWsko.js";import{j as e,b6 as U,T as E,ak as x,b2 as je,am as Y,I as A,bO as J,Y as se,at as ve,b5 as ye,$ as we,ca as Ce,A as Z,aJ as Se,cb as Ie,R as ke,Q as W,W as k}from"./vendor-mui-core-DnR6WYuU.js";import{c as D}from"./index-BZxsCCR_.js";import{E as N}from"./empty-spinner-BYDonf35.js";import{q as Pe,u as Re}from"./vendor-hooks-qxhUUbW5.js";import{r as m}from"./vendor-react-CTtPmzVP.js";import{D as Q,C as G,P as ee}from"./react-beautiful-dnd.esm-BS_uB_lS.js";import{S as F}from"./studio-D4gvK_Pm.js";import"./vendor-utils-CxWN1dT3.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./raf-schd.esm-XXBRsnmf.js";import"./index-DSiSlyHN.js";var I={},te;function Ee(){if(te)return I;te=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getVideoId=b,I.getEmbedUrl=c,I.getVideoCoverUrl=P,I.getVideoCheckUrl=y,I.getYoutubeId=r,I.getVimeoId=a,I.isVideoUrl=w;function r(s){const t=s.trim();return t.includes("youtu.be/")?t.split("youtu.be/")[1]?.split("?")[0]:t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("youtube.com/watch")?new URL(t).searchParams.get("v"):t.includes("youtube.com/shorts/")?t.split("/shorts/")[1]?.split("?")[0]:""}function a(s){const t=s.trim();return t.includes("/embed/")?t.split("/embed/")[1]?.split("?")[0]:t.includes("vimeo.com/video/")?t.split("/video/")[1]?.split("?")[0]:t.includes("vimeo.com/channels/")?t.split("/channels/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/groups/")?t.split("/groups/")[1]?.split("/")[1]?.split("?")[0]:t.includes("vimeo.com/")?t.split("vimeo.com/")[1]?.split("?")[0]:""}const p={};function b(s){const t=s.trim();return!t||!/^https?:\/\/.+\..+/.test(t)?[]:(p[t]||(p[t]=(()=>{const u=new URL(t);return u.host.includes("youtube.com")||u.host.includes("youtu.be")?[r(t),"youtube"]:u.host.includes("vimeo.com")?[a(t),"vimeo"]:[]})()),p[t])}const n={};function c(s,{modestbranding:t=1,controls:u=0,autoplay:g=0}={}){const j=s.trim();if(!j)return"";if(n[j]!==void 0)return n[j];const[O,l]=b(j);return l==="youtube"?n[j]=`https://www.youtube.com/embed/${O}?modestbranding=${t}&controls=${u}&autoplay=${g}`:l==="vimeo"?n[j]=`https://player.vimeo.com/video/${O}?autoplay=${g}`:n[j]="",n[j]}const d={};function P(s){const t=s.trim();if(!t)return"";if(d[t]!==void 0)return d[t];const[u,g]=b(t);return g==="youtube"?d[t]=`https://img.youtube.com/vi/${u}/mqdefault.jpg`:g==="vimeo"?d[t]=`https://i.vimeocdn.com/${u}/1000x563`:d[t]="",d[t]}function y(s){const t=s.trim();if(!t)return"";const[u,g]=b(t);return g==="youtube"?`https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${u}&format=json`:g==="vimeo"?`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${u}`:""}function w(s){const t=s.trim();return b(t).length>0}return I}var q=Ee();const re=m.lazy(()=>be(()=>import("./index-fpjO7dzv.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader}))),Oe=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo/upload`,Ve=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots/upload`,Le=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/logo`,_=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/screenshots`,De=`${D.WELLKNOWN_SERVICE_PATH_PREFIX}/api/studio/videos`,oe=5,ie=3;function Xe(){const{t:r,locale:a}=fe(),[p,b]=m.useState(!1),[n,c]=m.useState(!1),[d,P]=m.useState([]),[y,w]=m.useState([]),[s,t]=m.useState(""),[u,g]=m.useState(""),[j,O]=m.useState(Date.now()),l=Pe(async()=>{const i=await(await fetch(_)).json();return P(i.screenshots||[]),w(i.videos?.filter(h=>!!h)||[]),i}),f=m.useRef(null),C=m.useRef(null);if(l.loading&&!l.data)return e.jsx(F,{children:e.jsx(N,{size:40})});if(l.error)return e.jsx(F,{children:e.jsx(U,{direction:"column",spacing:1,sx:{mb:3},children:e.jsx(E,{sx:{color:"error.main",fontWeight:"bold"},children:l.error.message})})});const T=async o=>{const i=o.filter(h=>!!h);w(i),await fetch(De,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videos:i})})},le=async o=>{const i=Array.from(y),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),await T(i)},ce=async o=>{const i=Array.from(d),[h]=i.splice(o.source.index,1);i.splice(o.destination.index,0,h),P(i),await fetch(`${_}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({screenshots:i})})},H=async o=>{o.destination&&(o.source.droppableId==="screenshots"?await ce(o):o.source.droppableId==="videos"&&await le(o),l.runAsync())},B=o=>{g(o.trim()),c(!0)},K=async(o,i="")=>{let h=[];i?h=o?y.map(v=>v===i?o.trim():v):y.filter(v=>v!==i):o&&(h=[...y,o.trim()]),g(""),c(!1),(o||i)&&await T(h),l.runAsync()},de=o=>{b(!0),t(o)},M=()=>{b(!1),t("")};function ue(){const o=[{label:r("studio.type"),value:"png, jpg, webp, svg"},{label:r("studio.ratio"),value:"256x256"},{label:r("studio.size"),value:"<500KB"}],i=[{label:r("studio.tip"),value:r("studio.change")}];return e.jsx($,{title:r("common.logo"),rules:o,tips:i,children:e.jsx(x,{sx:{flex:1,cursor:"pointer"},children:e.jsx(je,{variant:"square",sx:{width:128,height:128},alt:"Blocklet Logo",src:`${Le}?t=${j}`,onClick:()=>f.current?.open()})})})}function pe(){const o=[{label:r("studio.ratio"),value:"16 / 9"},{label:r("studio.count"),value:`1~${oe}`},{label:r("studio.size"),value:"<5MB"}],i=[{label:r("studio.tip"),value:r("studio.orderTipLong")}];return e.jsx($,{title:r("common.screenshot"),tips:i,rules:o,children:e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"screenshots",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[d.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>{const X=`${_}/${S}`;return e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X,onClick:()=>de(S),style:{cursor:"pointer"}}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:async()=>{await fetch(X,{method:"DELETE"}),l.runAsync()},children:e.jsx(J,{})})})]})}},S)),v.placeholder,d.length<oe&&h()]})})})});function h(){return e.jsx(x,{onClick:()=>C.current?.open(),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function he(){const o=[{label:r("studio.count"),value:`1~${ie}`},{label:r("studio.videoType"),value:e.jsxs(e.Fragment,{children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})}],i=[{label:`${r("studio.tip")}`,value:r("studio.videoTipLong")}];return e.jsxs($,{title:r("studio.video"),tips:i,rules:o,children:[e.jsx(Q,{onDragEnd:H,children:e.jsx(G,{droppableId:"videos",direction:"horizontal",children:(v,V)=>e.jsxs(x,{ref:v.innerRef,...v.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,mt:1,flexWrap:"wrap",minHeight:225,background:V.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:V.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[y.map((S,z)=>e.jsx(ee,{draggableId:S,index:z,children:(R,L)=>e.jsxs(x,{ref:R.innerRef,...R.draggableProps,...R.dragHandleProps,className:"image-wrapper",sx:{transform:L.isDragging?"scale(1.05)":"none",boxShadow:L.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"videos",src:q.getVideoCoverUrl(S),onClick:()=>B(S),style:{cursor:"pointer"}}),e.jsx(x,{sx:{position:"absolute",cursor:"pointer",fontSize:"3rem"},onClick:()=>B(S),children:e.jsx(ae,{})}),e.jsx(Y,{title:r("studio.deleteTooltip"),children:e.jsx(A,{className:"action",style:{top:10,color:"white",background:"red"},onClick:()=>K(null,S),children:e.jsx(J,{})})})]})},S)),v.placeholder,y.length<ie&&h()]})})}),n&&e.jsx(ne,{t:r,handleOperateVideo:K,defaultUrl:u,videos:y})]});function h(){return e.jsx(x,{onClick:()=>c(!0),sx:{display:"flex",justifyContent:"center",alignItems:"center",mb:2,width:400,height:225,fontSize:40,background:"#eee",cursor:"pointer",color:"#999"},children:"+"})}}function me(){return e.jsx(se,{open:p,onClose:M,maxWidth:"xl",slotProps:{paper:{style:{backgroundColor:"transparent",boxShadow:"none"}}},children:e.jsx("img",{src:`${_}/${s}`,alt:"Screenshot Full",style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain"},onClick:M})})}function xe(){return e.jsxs(m.Suspense,{fallback:e.jsx(N,{size:40}),children:[e.jsx(re,{ref:f,locale:a,popup:!0,onUploadFinish:()=>{f.current?.close(),O(Date.now()),l.runAsync()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:Oe,disableMediaKitPrefix:!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(re,{ref:C,locale:a,popup:!0,onUploadFinish:()=>{C.current?.close(),l.runAsync()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:Ve,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-d.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})}const ge=`https://www.arcblock.io/docs/blocklet-store/${a}/supplying-images`;return e.jsx(F,{children:e.jsxs(Te,{children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:3},children:[e.jsx(E,{variant:"h5",sx:{fontWeight:"bold"},children:r("studio.title",{title:l.data?.title})}),e.jsxs(E,{variant:"body2",sx:{color:"text.secondary"},children:[r("studio.description")," ",e.jsx("a",{href:ge,target:"_blank",rel:"noreferrer",children:r("studio.documentation")})]})]}),ue(),pe(),he(),me(),xe()]})})}function $({title:r,rules:a,tips:p,children:b}){return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",mb:4},children:[e.jsxs(U,{direction:"column",spacing:1,sx:{mb:2},children:[e.jsx(E,{variant:"h6",sx:{fontWeight:"bold"},children:r}),e.jsx(U,{direction:"row",spacing:2,sx:{fontSize:"13px",opacity:.8},children:a.map(c=>n(c.label,c.value))}),p.map(c=>e.jsx(x,{sx:{fontSize:"13px",opacity:.8},children:n(c.label,c.value)}))]}),b]});function n(c,d){return e.jsxs(x,{component:"span",children:[e.jsxs(x,{component:"span",sx:{color:"#555",mr:.5},children:[c,":"]}),e.jsx(x,{component:"span",sx:{color:"#007ec6"},children:d})]})}}$.propTypes={title:k.string.isRequired,rules:k.array.isRequired,tips:k.array.isRequired,children:k.node.isRequired};function ne({handleOperateVideo:r,t:a,defaultUrl:p="",videos:b}){const[n,c]=m.useState(p),[d,P]=m.useState(!1),[y,w]=m.useState(!1),s=m.useRef(n),t=n!==p&&b.includes(n),u=!n&&p,g=!t&&(n&&n!==s.current||d),j=!!navigator.clipboard?.readText,{run:O}=Re(l,{wait:500,leading:!0});return e.jsxs(se,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(ye,{children:a(p?"studio.videoDialogEditTitle":"studio.videoDialogTitle")}),e.jsxs(we,{children:[e.jsx(Ce,{fullWidth:!0,value:n,onChange:f=>{const C=f.target.value.trim();c(C),C?O(C):w(!1)},placeholder:a("studio.videoInputLabel"),endAdornment:n?e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:()=>{c(""),l("")},children:e.jsx(Se,{})})}):j&&e.jsx(Z,{position:"end",children:e.jsx(A,{onClick:async()=>{try{const f=(await navigator.clipboard.readText()||"").trim();c(f),l(f)}catch(f){console.error(f)}},children:e.jsx(Ie,{})})})}),e.jsxs(x,{sx:{mb:2,mt:.5},children:[t&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.duplicateVideo")}),!t&&y&&e.jsx(E,{variant:"body2",color:"error",children:a("studio.videoDialogNoSrc")})]}),s.current?e.jsx("iframe",{width:"100%",height:"315",title:`video-${s.current}`,src:q.getEmbedUrl(s.current),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,border:"1px solid #eee"}):e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:315,width:"100%",border:"1px solid #eee"},children:d?e.jsx(N,{size:40}):e.jsx(E,{variant:"h5",sx:{color:"text.secondary"},children:e.jsx(ae,{})})})]}),e.jsxs(ke,{children:[e.jsx(W,{onClick:()=>r(),children:a("studio.cancel")}),u&&e.jsx(W,{variant:"contained",color:"error",onClick:()=>r(null,p),children:a("studio.delete")}),g&&e.jsx(W,{variant:"contained",onClick:()=>l(n),disabled:!n||d,children:a("studio.preview")}),!u&&!g&&e.jsx(W,{variant:"contained",onClick:()=>r(s.current),disabled:!s.current||p===s.current||t,children:a("studio.confirm")})]})]});function l(f){s.current="";const C=q.getVideoCheckUrl(f);w(f?!C:!1),C&&(P(!0),fetch(C).then(T=>{T.ok?(s.current=f,w(!1)):w(!0)}).catch(()=>{w(!0)}).finally(()=>P(!1)))}}ne.propTypes={handleOperateVideo:k.func.isRequired,t:k.func.isRequired,defaultUrl:k.string,videos:k.array.isRequired};function ae(){return e.jsxs("svg",{viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",height:48,width:48,children:[e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28C0 43.464 12.536 56 28 56Z",fill:"black","fill-opacity":"0.54"}),e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M39.6667 28L21 17.5V38.5L39.6667 28Z",fill:"white"})]})}const Te=ve.div`
3
3
  margin-top: 24px;
4
4
  .image-wrapper {
5
5
  margin-bottom: 16px;
@@ -0,0 +1 @@
1
+ import{j as t,ak as r,W as p}from"./vendor-mui-core-DnR6WYuU.js";import m from"./branding-DwUe7Tp9.js";import{J as o}from"./index-BZxsCCR_.js";import"./vendor-react-CTtPmzVP.js";import"./vendor-ux-DTEmWsko.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./sanitize-yVk8VEIO.js";import"./omit-spWLSLbo.js";import"./index-_tncRnTu.js";import"./form-text-input-DlypNadC.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./edit.svg-RRSklUg-.js";import"./permission-B2PLdaCS.js";import"./session-DwQKgNVz.js";import"./use-app-logo-DbYok-1h.js";import"./logo-uploader-BksS6OGe.js";import"./section-jXB9AxBb.js";import"./vendor-arcblock-CIBaEWEy.js";function s({blocklet:i}){return t.jsx(r,{sx:{width:"100%","& .section-left":{width:340},"& .section":{gap:3}},children:t.jsx(m,{blocklet:i,showFields:[o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO]})})}s.propTypes={blocklet:p.object.isRequired};export{s as default};
@@ -1,4 +1,4 @@
1
- import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-DnR6WYuU.js";import{k as j1,M as y1,J as Z1,aT as L1,H as w1}from"./vendor-ux-DfSgTRg5.js";import{x as E1}from"./vendor-hooks-cYMUGE4V.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-BHa1_Bjz.js";import{s as k1}from"./sanitize-DyRfEGVu.js";import{F as O1}from"./form-text-input-BjQKx89L.js";import{R as M1}from"./required-BQln5OcV.js";import{F as B1}from"./form-wrapper-PT5ZzMQy.js";import{w as J}from"./permission-HtrJm1h2.js";import{u as R1}from"./use-app-logo-CZWb8lrs.js";import{L as j}from"./logo-uploader-BmnoHisE.js";import{S as E}from"./section-jXB9AxBb.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./edit.svg-RRSklUg-.js";import"./session-Cm8j8XeZ.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
1
+ import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,cy as o1,at as G,ak as c,aj as W,z as h1,U as n1,I as Y,a6 as d1,by as p1,F as f1,O as x1,dg as $,W as r,c5 as v1,b2 as m1,ar as g1,T as v,a3 as u,Q as V,b6 as u1}from"./vendor-mui-core-DnR6WYuU.js";import{k as j1,M as y1,J as Z1,aT as L1,H as w1}from"./vendor-ux-DTEmWsko.js";import{x as E1}from"./vendor-hooks-qxhUUbW5.js";import{Z as q,G as _1,ak as b1,J as d}from"./index-BZxsCCR_.js";import{s as k1}from"./sanitize-yVk8VEIO.js";import{F as O1}from"./form-text-input-DlypNadC.js";import{R as M1}from"./required-BQln5OcV.js";import{F as B1}from"./form-wrapper-PT5ZzMQy.js";import{w as J}from"./permission-B2PLdaCS.js";import{u as R1}from"./use-app-logo-DbYok-1h.js";import{L as j}from"./logo-uploader-BksS6OGe.js";import{S as E}from"./section-jXB9AxBb.js";import"./vendor-utils-CxWN1dT3.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./omit-spWLSLbo.js";import"./index-_tncRnTu.js";import"./edit.svg-RRSklUg-.js";import"./session-DwQKgNVz.js";function Q({label:i="",disabled:h=!1,required:p=!1,initialValue:s="",onChange:M=()=>{},style:z={},onSubmit:f=()=>{},triggers:m=[],options:a=[],formatterBeforeSubmit:_=Z=>Z.join(","),helperText:B="",placeholder:T="",renderImage:I=()=>null,renderLabel:N=()=>"",filterKeys:y=["name"],noEmpty:b=!1,...R}){const[Z,C]=g.useState(!1),[P,A]=g.useState(!1),[k,U]=g.useState(""),O=g.useRef(null),[L,S]=g.useState(s),[l,n]=g.useState(L),w=g.useMemo(()=>{if(!a)return{};const o={};return a.forEach(t=>{o[t.code]=t}),o},[a]),H=()=>{if(!a)return[];if(!k)return a.map(t=>t.code);const o=new RegExp(k.toLowerCase());return a.filter(t=>{for(let x=0;x<y.length;x++){const K=y[x];if(o.test(t[K]?.toLowerCase()))return!0}return!1}).map(t=>t.code)},c1=async()=>{A(!0);try{await f(typeof _=="function"?_(l):l)===!1?n(L):b&&!l.length?(n(s),S(s)):(n(l),S(l))}catch{n(L)}finally{A(!1),C(!1)}},t1=(o,t)=>{if(!Array.isArray(t)){n([]),M([]);return}const x=t.filter(K=>w[K]);if(!x.length){n([]),M([]);return}n(x),M(x)},s1=o=>{o.stopPropagation(),C(!0),setTimeout(()=>{if(O.current){const t=O.current.querySelector("input");t&&t.focus()}},500)},r1=Z?e.jsx(o1,{ref:O,options:a,value:l,onChange:t1,inputValue:k,onInputChange:(o,t)=>{U(t)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:H,getOptionLabel:o=>w[o]?.name,renderInput:o=>e.jsx(h1,{...o,label:"",placeholder:T}),renderOption:(o,t)=>{const x=l.indexOf(t)!==-1;return g.createElement(C1,{component:"li",...o,key:t},I(w[t]||{}),e.jsx(c,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:x?"700":"normal"},children:N(t,w[t])||w[t]?.name}),e.jsx(c,{component:W,sx:{opacity:.5,width:18,height:18},style:{visibility:x?"visible":"hidden"}}))},...R,slots:{popper:P1}}):e.jsx(c,{className:"form-item-input slot",onClick:s1,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:l.filter(o=>a.some(t=>t.code===o)).map(o=>e.jsx(n1,{label:a.find(t=>t.code===o).name,style:{marginRight:8},size:"small"},o))});return e.jsx(B1,{className:"form",style:z,children:e.jsxs(c,{className:"form-item",children:[e.jsxs(c,{className:"form-item-label",children:[i,p&&e.jsx(M1,{})]}),e.jsxs(c,{className:"form-item-body",children:[e.jsx(c,{className:"form-item-input",children:r1}),Z?e.jsx(c,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(Y,{"data-cy":"schema-form-item-confirm",onClick:c1,disabled:h||P,size:"large",children:P?e.jsx(d1,{size:24}):e.jsx(p1,{})}),e.jsx(Y,{"data-cy":"schema-form-item-cancel",onClick:()=>{n(L),C(!1)},disabled:h||P,size:"large",children:e.jsx(W,{})})]})}):null]}),Z&&B&&e.jsx(f1,{children:B})]})})}Q.propTypes={style:r.object,onSubmit:r.func,onChange:r.func,label:r.string,initialValue:r.string,required:r.bool,disabled:r.bool,triggers:r.array,options:r.array,helperText:r.string,formatterBeforeSubmit:r.func,placeholder:r.string,renderImage:r.func,filterKeys:r.arrayOf(r.string),noEmpty:r.bool,renderLabel:r.func};const C1=G.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{j as u,b2 as x,W as e}from"./vendor-mui-core-DnR6WYuU.js";import{$}from"./vendor-ux-DfSgTRg5.js";import{C as c}from"./vendor-utils-drLlzTVq.js";import{Z as l,ai as v,bs as j,c as y,bt as E,bu as P}from"./index-BHa1_Bjz.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
1
+ import{j as u,b2 as x,W as e}from"./vendor-mui-core-DnR6WYuU.js";import{$}from"./vendor-ux-DTEmWsko.js";import{C as c}from"./vendor-utils-CxWN1dT3.js";import{Z as l,ai as v,bs as j,c as y,bt as E,bu as P}from"./index-BZxsCCR_.js";function R({blocklet:o,ancestors:d=[]}){const t=l(),{inService:s}=t,a=v(o?.status)||j(o?.status),r=`?v=${o?.meta?.version}${a?"~":""}`;let n=s?`${c(E,y.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle")}${r}`:c(t.imgPrefix,"blocklet.png");if(o.source==="registry"&&o.deployedFrom&&o.meta.logo)n=`${c(o.deployedFrom,P(o.meta.bundleDid,o.meta.logo))}${r}`;else{const g=window.env?.apiPrefix||"/",i=d.concat(o),p=s?i.slice(1):i;n=`${c(g,`/blocklet/logo-bundle${p.map(m=>`/${m.meta.did}`).join("")}`)}${r}`}return{logoUrl:n,inService:s}}function h({blocklet:o,style:d={},size:t=40,ancestors:s=[],...a}){const r=l(),{logoUrl:n,inService:g}=R({blocklet:o,ancestors:s}),{variant:i}=a,p=g?()=>{}:f=>{f.target.src=`${r.imgPrefix}/blocklet.png`};let m=u.jsx("img",{src:n,onError:p,alt:o.meta.name,style:{width:t}});return o.meta.logo||(m=u.jsx($,{did:o.meta.did||"",responsive:!0})),u.jsx(x,{variant:i||"square",style:Object.assign({backgroundColor:"transparent",width:t,height:t,borderRadius:10},d),...a,children:m})}h.propTypes={blocklet:e.object.isRequired,style:e.object,size:e.oneOfType([e.number,e.string]),ancestors:e.array};export{h as B};
@@ -1 +1 @@
1
- import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import{w as r}from"./vendor-ux-DfSgTRg5.js";function m({...t}){return o.jsx(r,{className:"bottom-button",variant:"contained",color:"primary",...t})}export{m as S};
1
+ import{j as o}from"./vendor-mui-core-DnR6WYuU.js";import{w as r}from"./vendor-ux-DTEmWsko.js";function m({...t}){return o.jsx(r,{className:"bottom-button",variant:"contained",color:"primary",...t})}export{m as S};
@@ -1 +1 @@
1
- import{r as i}from"./vendor-react-CTtPmzVP.js";import{j as t,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{aT as e,bb as c}from"./vendor-ux-DfSgTRg5.js";function m({children:p,...r}){const{t:o}=i.useContext(e);return t.jsx(c,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...r,children:p})}m.propTypes={children:s.any.isRequired};export{m as C};
1
+ import{r as i}from"./vendor-react-CTtPmzVP.js";import{j as t,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{aT as e,bb as c}from"./vendor-ux-DTEmWsko.js";function m({children:p,...r}){const{t:o}=i.useContext(e);return t.jsx(c,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...r,children:p})}m.propTypes={children:s.any.isRequired};export{m as C};
@@ -0,0 +1 @@
1
+ import{e}from"./vendor-react-CTtPmzVP.js";import{ap as r}from"./vendor-utils-CxWN1dT3.js";const m=e(r);export{m as r};
@@ -1,11 +1,11 @@
1
- import{at as E,j as e,ak as m,W}from"./vendor-mui-core-DnR6WYuU.js";import{aA as Q,y as ne,K as H,cb as oe,q as ae,h as ie,cc as O,c as ce,o as le,r as ue,cd as de,O as me}from"./index-BHa1_Bjz.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{aa as he,a2 as pe,B as fe,J as ge,C as K}from"./vendor-utils-drLlzTVq.js";import{b as we,a as j}from"./vendor-hooks-cYMUGE4V.js";import{u as xe}from"./launch-result-message-MNpx7ysR.js";import{V as be,K as ke,H as q}from"./vendor-ux-DfSgTRg5.js";import{g as Ue}from"./get-safe-url-CqAaHb9L.js";import{S as J}from"./button-D6RwAFss.js";import{S as ye}from"./layout-DkW-u1GX.js";import{p as Re,P as Se,S as Le}from"./starting-progress-DahUM5Xo.js";import"./vendor-arcblock-CPCSE54a.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";const ve=E(xe)`
1
+ import{at as E,j as e,ak as m,W}from"./vendor-mui-core-DnR6WYuU.js";import{aB as Q,y as ne,K as H,cb as oe,q as ae,h as ie,cc as O,c as ce,o as le,r as ue,cd as de,O as me}from"./index-BZxsCCR_.js";import{r as d}from"./vendor-react-CTtPmzVP.js";import{a9 as he,a1 as pe,B as fe,J as ge,C as K}from"./vendor-utils-CxWN1dT3.js";import{b as we,a as j}from"./vendor-hooks-qxhUUbW5.js";import{u as xe}from"./launch-result-message-MNpx7ysR.js";import{V as be,K as ke,H as q}from"./vendor-ux-DTEmWsko.js";import{g as Ue}from"./get-safe-url-D4mirsKD.js";import{S as J}from"./button-DOFHdsTg.js";import{S as ye}from"./layout-Rdrg1NRp.js";import{p as Re,P as Se,S as Le}from"./starting-progress-DyH57pR8.js";import"./vendor-arcblock-CIBaEWEy.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DmSBGGVm.js";const ve=E(xe)`
2
2
  && .result-footer {
3
3
  height: 120px;
4
4
  > div {
5
5
  flex-wrap: wrap;
6
6
  }
7
7
  }
8
- `,je="https://launcher.arcblock.io",Ee=t=>{if(!t)return je;const{protocol:c,host:s}=he(pe(t));return`${c}//${s}`},$e=t=>t?{"__did-connect__":fe.from(JSON.stringify({switchBehavior:"auto",forceConnected:t,showClose:!1}),"utf8").toString("base64")}:{},Be=(t=0)=>new Promise(c=>setTimeout(c,t));async function Ce(t,c=5){if(!t)throw new Error("domain is required");if(typeof c!="number")throw new Error("timeout must be a number");if(c<=1)throw new Error("time must be greater than 1s");async function s(n){try{const l=`${n}://${t}`,a=await Q.evaluateURL(l,{preferAccessible:!0});return a.accessible?a.url:!1}catch{return!1}}async function R(){let n=await s("https");if(n)return n;let l=c;for(;l-- >0;)if(await Be(1e3),n=await s("https"),n)return n;return n||null}const h=await R();return h?{accessible:!0,url:h}:{accessible:!1}}function Pe({onPrevious:t=()=>{},launcherSession:c={}}){const{t:s}=be(),[R,h]=d.useState(!1),[n,l]=d.useState("starting"),[a,$]=d.useState(),[g,B]=d.useState(null),{blocklet:o}=ne(),[C,P]=d.useState(!1),[p,X]=d.useState(""),S=H("fromLauncher"),G=H("launcherUrl"),Y=Ee(G),Z=$e(c?.userDid),w=!["starting","running"].includes(n),_=n==="starting",I={stopped:s("blocklet.start"),starting:s("blocklet.starting"),running:s("blocklet.open")},T=we(async()=>{const r=o?.controller?.launcherSessionId||o?.meta?.did,i=r?`/apps/${r}/overview`:"apps",u=await oe(Y);return ge(K(u,"/u/",i),Z)});d.useEffect(()=>{T().then(r=>{B(r)}).catch(()=>{B(null)})},[T]);const ee=async()=>{try{const i=new URL(window.location.href).searchParams.get("redirect");if(!i)return null;const u=await Ce(i,6);return u.accessible?u.url:null}catch(r){return console.error("checkRedirectUrl error",r),null}},A=async()=>{if(S&&g){window.location.href=g;return}P(!0);const r=await ee(),u=new URL(window.location.href).searchParams.get("redirect"),M=u&&r;if(!p||!ie(p)){q.error(s("blocklet.gotoVisitError"));return}let U=p,v=[];if(M)try{const y=new URL(r);U=y.href,v=[y.hostname]}catch(y){console.error("Invalid redirect URL:",u,y)}const z=O.get("login_token"),V=O.get("vid"),f=new URL(U);f.host!==window.location.host&&z&&(f.pathname=K(ce.WELLKNOWN_SERVICE_PATH_PREFIX,"redirect-with-login"),f.searchParams.set("setupToken",z),V&&f.searchParams.set("visitorId",V),U=f.href),window.location.href=Ue(U,v.length?{allowDomains:v}:{}),P(!1)},L=async()=>{h(!0),l("starting");try{await le.post("/blocklet/start?fromSetup=1");const{blocklet:{status:r}={}}=await ue.getBlocklet({input:{did:o.meta.did}});h(!1),l(r),$(r==="running"?null:s("setup.complete.notRunning"))}catch(r){const i=r?.response?.data||r.message;q.error(i),h(!1),l("stopped"),$(i)}};d.useEffect(()=>{l(o.status),["starting","running"].includes(o.status)||L()},[]),d.useEffect(()=>{p||(async()=>{const i=await Q.evaluateURLs(o.site.domainAliases.map(u=>de(u.value,me)),{preferAccessible:!0});i.length>0&&X(i[0].url)})()},[o,p]);const x=j(()=>o?.children?.length,[o]),b=j(()=>o?.children?.filter(r=>ae.isBlockletRunning(r))?.length||0,[o]),k=j(()=>x?b?Math.round(Math.max(b/x,.15)*100):5:0,[b,x]),D=localStorage.getItem("blocklet-server-url"),N=_||!p;S&&!N&&(w?L():A());const te=ke(Re,w?{ml:3}:{},_?{width:`${k}%`,"&::after":{width:`${k}%`},"&::before":{width:`${k}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${k}%`}}}}:{}),re={starting:s("setup.complete.readyToStart"),running:s("setup.complete.title")},se=()=>C?s("setup.complete.opening"):n==="starting"&&!a?`(${b}/${x}) ${s("blocklet.starting")}`:I[n]||I.stopped,F=e.jsx(Se,{blocklets:o.children??[],status:n,debounce:!1,children:e.jsx(J,{sx:te,onClick:()=>w?L():A(),loading:N||C,children:e.jsx("span",{style:{position:"relative",zIndex:2},children:se()})})});return e.jsx(_e,{children:e.jsx(ve,{variant:a?"error":"success",title:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[e.jsx(m,{sx:{fontSize:24,fontWeight:600},children:a?s("setup.complete.failedTitle"):re[n]||""}),n==="starting"&&!a?e.jsx(Le,{blocklets:o.children??[]}):null]}),footer:e.jsxs(Ie,{children:[w&&e.jsx(J,{variant:"outlined",disabled:R,onClick:()=>t(),children:s("setup.previous")}),S?e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:F}),a&&g?e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("launchBlocklet.nav.viewMyApps")})}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:F}),(n==="running"||a)&&!!D&&e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:D,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("setup.complete.backToServer")})}),a&&e.jsx(m,{className:"error-message",sx:{fontSize:14,color:"#888",mt:1},children:a})]})]})})})}const _e=E(ye)`
8
+ `,je="https://launcher.arcblock.io",Ee=t=>{if(!t)return je;const{protocol:c,host:s}=he(pe(t));return`${c}//${s}`},Be=t=>t?{"__did-connect__":fe.from(JSON.stringify({switchBehavior:"auto",forceConnected:t,showClose:!1}),"utf8").toString("base64")}:{},$e=(t=0)=>new Promise(c=>setTimeout(c,t));async function Ce(t,c=5){if(!t)throw new Error("domain is required");if(typeof c!="number")throw new Error("timeout must be a number");if(c<=1)throw new Error("time must be greater than 1s");async function s(n){try{const l=`${n}://${t}`,a=await Q.evaluateURL(l,{preferAccessible:!0});return a.accessible?a.url:!1}catch{return!1}}async function R(){let n=await s("https");if(n)return n;let l=c;for(;l-- >0;)if(await $e(1e3),n=await s("https"),n)return n;return n||null}const h=await R();return h?{accessible:!0,url:h}:{accessible:!1}}function Pe({onPrevious:t=()=>{},launcherSession:c={}}){const{t:s}=be(),[R,h]=d.useState(!1),[n,l]=d.useState("starting"),[a,B]=d.useState(),[g,$]=d.useState(null),{blocklet:o}=ne(),[C,P]=d.useState(!1),[p,X]=d.useState(""),S=H("fromLauncher"),G=H("launcherUrl"),Y=Ee(G),Z=Be(c?.userDid),w=!["starting","running"].includes(n),_=n==="starting",I={stopped:s("blocklet.start"),starting:s("blocklet.starting"),running:s("blocklet.open")},T=we(async()=>{const r=o?.controller?.launcherSessionId||o?.meta?.did,i=r?`/apps/${r}/overview`:"apps",u=await oe(Y);return ge(K(u,"/u/",i),Z)});d.useEffect(()=>{T().then(r=>{$(r)}).catch(()=>{$(null)})},[T]);const ee=async()=>{try{const i=new URL(window.location.href).searchParams.get("redirect");if(!i)return null;const u=await Ce(i,6);return u.accessible?u.url:null}catch(r){return console.error("checkRedirectUrl error",r),null}},A=async()=>{if(S&&g){window.location.href=g;return}P(!0);const r=await ee(),u=new URL(window.location.href).searchParams.get("redirect"),M=u&&r;if(!p||!ie(p)){q.error(s("blocklet.gotoVisitError"));return}let U=p,v=[];if(M)try{const y=new URL(r);U=y.href,v=[y.hostname]}catch(y){console.error("Invalid redirect URL:",u,y)}const z=O.get("login_token"),V=O.get("vid"),f=new URL(U);f.host!==window.location.host&&z&&(f.pathname=K(ce.WELLKNOWN_SERVICE_PATH_PREFIX,"redirect-with-login"),f.searchParams.set("setupToken",z),V&&f.searchParams.set("visitorId",V),U=f.href),window.location.href=Ue(U,v.length?{allowDomains:v}:{}),P(!1)},L=async()=>{h(!0),l("starting");try{await le.post("/blocklet/start?fromSetup=1");const{blocklet:{status:r}={}}=await ue.getBlocklet({input:{did:o.meta.did}});h(!1),l(r),B(r==="running"?null:s("setup.complete.notRunning"))}catch(r){const i=r?.response?.data||r.message;q.error(i),h(!1),l("stopped"),B(i)}};d.useEffect(()=>{l(o.status),["starting","running"].includes(o.status)||L()},[]),d.useEffect(()=>{p||(async()=>{const i=await Q.evaluateURLs(o.site.domainAliases.map(u=>de(u.value,me)),{preferAccessible:!0});i.length>0&&X(i[0].url)})()},[o,p]);const x=j(()=>o?.children?.length,[o]),b=j(()=>o?.children?.filter(r=>ae.isBlockletRunning(r))?.length||0,[o]),k=j(()=>x?b?Math.round(Math.max(b/x,.15)*100):5:0,[b,x]),D=localStorage.getItem("blocklet-server-url"),N=_||!p;S&&!N&&(w?L():A());const te=ke(Re,w?{ml:3}:{},_?{width:`${k}%`,"&::after":{width:`${k}%`},"&::before":{width:`${k}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${k}%`}}}}:{}),re={starting:s("setup.complete.readyToStart"),running:s("setup.complete.title")},se=()=>C?s("setup.complete.opening"):n==="starting"&&!a?`(${b}/${x}) ${s("blocklet.starting")}`:I[n]||I.stopped,F=e.jsx(Se,{blocklets:o.children??[],status:n,debounce:!1,children:e.jsx(J,{sx:te,onClick:()=>w?L():A(),loading:N||C,children:e.jsx("span",{style:{position:"relative",zIndex:2},children:se()})})});return e.jsx(_e,{children:e.jsx(ve,{variant:a?"error":"success",title:e.jsxs(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[e.jsx(m,{sx:{fontSize:24,fontWeight:600},children:a?s("setup.complete.failedTitle"):re[n]||""}),n==="starting"&&!a?e.jsx(Le,{blocklets:o.children??[]}):null]}),footer:e.jsxs(Ie,{children:[w&&e.jsx(J,{variant:"outlined",disabled:R,onClick:()=>t(),children:s("setup.previous")}),S?e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:F}),a&&g?e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("launchBlocklet.nav.viewMyApps")})}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:F}),(n==="running"||a)&&!!D&&e.jsx(m,{sx:{width:"100%",mt:2},children:e.jsx("a",{href:D,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:s("setup.complete.backToServer")})}),a&&e.jsx(m,{className:"error-message",sx:{fontSize:14,color:"#888",mt:1},children:a})]})]})})})}const _e=E(ye)`
9
9
  justify-content: center;
10
10
  .icon-success {
11
11
  width: 64px;
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{j as D,ak as ie,am as Tt,W as K,ax as ze,aD as dt,dx as ae,b as Ve,g as Ue,a as Te,m as Qh,s as oe,_ as U,h as We,T as rt,n as va,u as $e,dy as Xh,i as hl,k as Oa,E as Pf,G as Tf,l as Tn,B as Zh,H as Jh,D as In,c as Yt,I as tt,t as eg,q as Sf,ar as tg,b4 as fr,Q as Dn,R as kf,K as ng,L as rg,N as lo,O as ag,P as og,A as ig,Y as Gi,Z as As,$ as Hi,J as _a,a0 as js,a1 as lg,a2 as sg,aH as Ls,at as st,aL as ug,c8 as cg,dz as dg,cG as fg,aJ as Bs,aI as pg,cS as mg,cR as Ns,dA as hg,dB as gg,dC as bg,cv as gl,cu as Mr,an as vg,bi as Rf,aZ as Fs,z as mt,b6 as Ef,cT as Mf,dD as yg,M as Vt,a6 as an,cC as Of,bT as Cg,b2 as xg,bb as Ia,dE as wg,bW as Dg,bX as Yi,bY as $s,dF as _f,bB as Pg,dG as Tg,be as If,cd as Af,bl as Sg,dH as kg,bI as Rg,dI as Eg,b5 as qs,a5 as zs,b1 as Mg,bn as Og}from"./vendor-mui-core-DnR6WYuU.js";import{au as Vs,n as Us,C as on,M as _g,av as Ig,J as Ws}from"./vendor-utils-drLlzTVq.js";import{d as Pe,a as Me,e as sn,g as jf,r as M,c as bl,b as Ag,u as vl}from"./vendor-react-CTtPmzVP.js";import{V as ut,H as je,br as re,bs as Lf,bt as un,bu as Kt,bv as St,bw as Or,bx as Aa,by as Ye,bz as ja,bA as La,bB as yl,bC as Ba,bD as Bf,bE as Na,bF as Fa,bG as jg,bH as Lg,bI as Bg,bJ as Ng,bK as Fg,bL as $g,bM as qg,bN as zg,bO as Vg,bP as Ug,bQ as Wg,bR as jt,bS as It,bT as ne,bU as Gg,bV as $a,bW as cn,bX as Nf,bY as Cl,bZ as Ff,b_ as Hg,b$ as Yg,c0 as Kg,c1 as An,c2 as dn,c3 as Qg,c4 as Xg,c5 as Zg,c6 as Jg,c7 as eb,c8 as tb,c9 as _r,ca as nb,cb as rb,cc as ab,cd as ob,bd as Gs,be as ib,bf as lb,bg as sb,ce as $f,cf as ub,cg as cb,ch as db,ci as fb,cj as pb,ck as mb,cl as hb,cm as gb,cn as bb,co as vb,cp as yb,aT as Qt,aJ as qa,_ as Cb,aU as xb,b1 as so,z as yt,w as uo,aN as wb}from"./vendor-ux-DfSgTRg5.js";import{Z as ft,Y as fn,ak as Sn,J as At,q as Ne,G as Cr,cg as Db,c as be,bP as kn,bO as qf,cd as zf,ch as Vf,h as Pb,e as pr,aD as Tb,ci as Sb}from"./index-BHa1_Bjz.js";import{f as Pt}from"./index-DBs9Ljax.js";import{b as kb,W as Rn,u as xl,B as Ki,m as Rb}from"./dashboard-DbjH3qe4.js";import{S as Eb}from"./switch-control-Bw0oiZZh.js";import{P as Qi,w as za}from"./permission-HtrJm1h2.js";import{u as Uf,r as Mb}from"./vendor-mui-x-CQc01l4r.js";import{r as Se,a as wl,t as pt,b as De,e as Xi,d as Ob,s as ya,g as Zi,m as Wf,c as Gf,f as _b,h as Ib,i as Ji,j as Hf,k as Ab,l as jb,n as Yf,o as Dl,p as Hs,q as Lb,u as Ys,v as Bb,w as Nb,x as $t,y as Fb,z as Ks,A as $b,B as co,C as Qs,D as qb,E as qr,F as hn,G as zb,H as Vb,I as zr,J as fo,K as Vr,L as po,M as mo,N as Ub,O as Wb,P as Gb,Q as Hb,R as Yb,S as Kb,T as Qb,U as Xb,V as Zb,W as Jb}from"./index-DURonUPJ.js";import{_ as ev,a as Xs,b as tv,c as Oe,d as Re,e as Ee}from"./createClass-dudiLlP7.js";import{u as ke,a as ue,r as xr,w as Ca,g as Kf,b as pn,e as Qf,c as nv,d as rv,o as el}from"./raf-schd.esm-XXBRsnmf.js";import{s as av}from"./sanitize-DyRfEGVu.js";import{C as Zs}from"./click-to-copy-B2HIKJMV.js";import{v as ho}from"./index-CHuKoofS.js";import{A as ov,a as iv,b as lv,I as sv,f as uv,B as cv,d as dv}from"./add-component-core-BITgGwN0.js";import{C as jn}from"./confirm-DTx9f3Ke.js";import{a as xa,v as fv}from"./util-DIVJQVg1.js";import{C as pv}from"./lock.svg-BgybwZNe.js";import{D as mv}from"./delete-confirm-HiRqbh9-.js";import{b as Xf}from"./vendor-hooks-cYMUGE4V.js";import{e as hv}from"./engine-BzngvK61.js";import{I as gv}from"./iframe-C8myLb4U.js";import{B as Zf}from"./bundle-avatar-DVOaAXid.js";import{A as Jf}from"./actions-Dfiiwkit.js";import{v as go}from"./index-BP_Fl0Mu.js";import{W as bv}from"./did-address-DqhneWXa.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./session-Cm8j8XeZ.js";import"./team-DNuHMrzV.js";import"./isURL-CASPeQFe.js";import"./use-app-logo-CZWb8lrs.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./useSetState-L-f8mSga.js";import"./index-C2HNVEZ0.js";import"./zh-B_cpka88.js";import"./over-due-invoice-payment-BFDFMUwK.js";import"./useLocalStorage-BV1BIwfo.js";import"./get-safe-url-CqAaHb9L.js";import"./passport-D6ZhqZ1F.js";import"./create-passport-svg-BQhmIwWD.js";import"./spaces-BuZf3GoQ.js";import"./api-C_w0YD2j.js";import"./index-Bxd7kK_i.js";import"./omit-BgmLPtMY.js";import"./index-_tncRnTu.js";import"./item-B3LlwO_A.js";import"./wait-connect-Be1Dmt0P.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./config-space-zEV0JkDF.js";import"./required-BQln5OcV.js";import"./index-seQ_ufVM.js";import"./Google-Cwpw9PRe.js";import"./cloneDeep-BbaR0xRl.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-BmnoHisE.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-DuS3gx_m.js";import"./section-jXB9AxBb.js";import"./form-text-input-BjQKx89L.js";import"./edit.svg-RRSklUg-.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-eBtGI4_9.js";import"./index-BzU09Azd.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./search-4YYphs0l.js";function ep({children:e=null,...t}){const{t:n}=ut(),{api:a}=ft(),{blocklet:r}=fn(),o=r?.settings?.autoCheckUpdate,i=async s=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:s}})},l=async()=>{try{const s=!o?.enabled;await i({enabled:s}),je.success(n(s?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(s){je.error(s.message)}},u=!!o?.enabled;return D.jsxs(ie,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,D.jsx(Tt,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:D.jsx("div",{children:D.jsx(Eb,{checked:u,onChange:l,name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}ep.propTypes={children:K.any};var bo={},vo={exports:{}},Js;function Ge(){return Js||(Js=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)({}).hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(vo)),vo.exports}var Vn={},yo={},Co={},xo={},eu;function vv(){return eu||(eu=1,function(e){var t=re();Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Ge()),a=t(Lf()),r=t(Pe()),o=t(ze()),i=un();function l(s){var f=(0,i.useTheme)();return r.default.createElement("div",{ref:s.forwardedRef,style:{display:"table",width:"100%",height:"100%",backgroundColor:f.palette.background.paper,opacity:.7}},r.default.createElement("div",{style:{display:"table-cell",width:"100%",height:"100%",verticalAlign:"middle",textAlign:"center"}},r.default.createElement(a.default,null)))}l.propTypes={theme:o.default.any};var u=r.default.forwardRef(function(f,d){return r.default.createElement(l,(0,n.default)({},f,{forwardedRef:d}))});e.default=u}(xo)),xo}var wo={},Do={},Dt={},Po={exports:{}},To={exports:{}},So={exports:{}},tu;function yv(){return tu||(tu=1,function(e){var t=Kt().default;function n(a,r){if(t(a)!="object"||!a)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var i=o.call(a,r||"default");if(t(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(So)),So.exports}var nu;function tp(){return nu||(nu=1,function(e){var t=Kt().default,n=yv();function a(r){var o=n(r,"string");return t(o)=="symbol"?o:o+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(To)),To.exports}var ru;function nt(){return ru||(ru=1,function(e){var t=tp();function n(a,r,o){return(r=t(r))in a?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}const Cv={},au=e=>{let t;const n=new Set,a=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const v=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,v))}},r=()=>t,u={setState:a,getState:r,getInitialState:()=>s,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(a,r,u);return u},np=e=>e?au(e):au,{useDebugValue:xv}=Me,{useSyncExternalStoreWithSelector:wv}=Uf,Dv=e=>e;function rp(e,t=Dv,n){const a=wv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xv(a),a}const ou=e=>{const t=typeof e=="function"?np(e):e,n=(a,r)=>rp(t,a,r);return Object.assign(n,t),n},ap=e=>e?ou(e):ou;var Pv=e=>ap(e);const Tv=Object.freeze(Object.defineProperty({__proto__:null,create:ap,createStore:np,default:Pv,useStore:rp},Symbol.toStringTag,{value:"Module"})),Sv=sn(Tv),{useDebugValue:kv}=Me,{useSyncExternalStoreWithSelector:Rv}=Uf,Ev=e=>e;function Mv(e,t=Ev,n){const a=Rv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kv(a),a}const{createElement:Ov,createContext:_v,useContext:iu,useMemo:Iv,useRef:Av}=Me;function jv(){const e=_v(void 0);return{Provider:({createStore:r,children:o})=>{const i=Av();return i.current||(i.current=r()),Ov(e.Provider,{value:i.current},o)},useStore:(r,o)=>{const i=iu(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Mv(i,r,o)},useStoreApi:()=>{const r=iu(e);if(!r)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Iv(()=>({...r}),[r])}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,default:jv},Symbol.toStringTag,{value:"Module"})),Bv=sn(Lv);var Ur={exports:{}},ha={exports:{}},Nv=ha.exports,lu;function Fv(){return lu||(lu=1,function(e,t){(function(n,a){e.exports=a()})(Nv,function(){var n=typeof Promise=="function",a=function(x){if(typeof globalThis=="object")return globalThis;Object.defineProperty(x,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var P=typeDetectGlobalObject;return delete x.typeDetectGlobalObject,P}(Object.prototype),r=typeof Symbol<"u",o=typeof Map<"u",i=typeof Set<"u",l=typeof WeakMap<"u",u=typeof WeakSet<"u",s=typeof DataView<"u",f=r&&typeof Symbol.iterator<"u",d=r&&typeof Symbol.toStringTag<"u",c=i&&typeof Set.prototype.entries=="function",v=o&&typeof Map.prototype.entries=="function",y=c&&Object.getPrototypeOf(new Set().entries()),g=v&&Object.getPrototypeOf(new Map().entries()),C=f&&typeof Array.prototype[Symbol.iterator]=="function",h=C&&Object.getPrototypeOf([][Symbol.iterator]()),p=f&&typeof String.prototype[Symbol.iterator]=="function",m=p&&Object.getPrototypeOf(""[Symbol.iterator]()),b=8,k=-1;function w(x){var P=typeof x;if(P!=="object")return P;if(x===null)return"null";if(x===a)return"global";if(Array.isArray(x)&&(d===!1||!(Symbol.toStringTag in x)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&x===window.location)return"Location";if(typeof window.document=="object"&&x===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&x===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&x===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&x instanceof window.HTMLElement){if(x.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(x.tagName==="TD")return"HTMLTableDataCellElement";if(x.tagName==="TH")return"HTMLTableHeaderCellElement"}}var S=d&&x[Symbol.toStringTag];if(typeof S=="string")return S;var R=Object.getPrototypeOf(x);return R===RegExp.prototype?"RegExp":R===Date.prototype?"Date":n&&R===Promise.prototype?"Promise":i&&R===Set.prototype?"Set":o&&R===Map.prototype?"Map":u&&R===WeakSet.prototype?"WeakSet":l&&R===WeakMap.prototype?"WeakMap":s&&R===DataView.prototype?"DataView":o&&R===g?"Map Iterator":i&&R===y?"Set Iterator":C&&R===h?"Array Iterator":p&&R===m?"String Iterator":R===null?"Object":Object.prototype.toString.call(x).slice(b,k)}return w})}(ha)),ha.exports}var su;function op(){if(su)return Ur.exports;su=1;/*!
2
+ import{j as D,ak as ie,am as Tt,W as K,ax as ze,aD as dt,dx as ae,b as Ve,g as Ue,a as Te,m as Qh,s as oe,_ as U,h as We,T as rt,n as va,u as $e,dy as Xh,i as hl,k as Oa,E as Pf,G as Tf,l as Tn,B as Zh,H as Jh,D as In,c as Yt,I as tt,t as eg,q as Sf,ar as tg,b4 as fr,Q as Dn,R as kf,K as ng,L as rg,N as lo,O as ag,P as og,A as ig,Y as Gi,Z as As,$ as Hi,J as _a,a0 as js,a1 as lg,a2 as sg,aH as Ls,at as st,aL as ug,c8 as cg,dz as dg,cG as fg,aJ as Bs,aI as pg,cS as mg,cR as Ns,dA as hg,dB as gg,dC as bg,cv as gl,cu as Mr,an as vg,bi as Rf,aZ as Fs,z as mt,b6 as Ef,cT as Mf,dD as yg,M as Vt,a6 as an,cC as Of,bT as Cg,b2 as xg,bb as Ia,dE as wg,bW as Dg,bX as Yi,bY as $s,dF as _f,bB as Pg,dG as Tg,be as If,cd as Af,bl as Sg,dH as kg,bI as Rg,dI as Eg,b5 as qs,a5 as zs,b1 as Mg,bn as Og}from"./vendor-mui-core-DnR6WYuU.js";import{at as Vs,n as Us,C as on,M as _g,au as Ig,J as Ws}from"./vendor-utils-CxWN1dT3.js";import{d as Pe,a as Me,e as sn,g as jf,r as M,c as bl,b as Ag,u as vl}from"./vendor-react-CTtPmzVP.js";import{V as ut,H as je,br as re,bs as Lf,bt as un,bu as Kt,bv as St,bw as Or,bx as Aa,by as Ye,bz as ja,bA as La,bB as yl,bC as Ba,bD as Bf,bE as Na,bF as Fa,bG as jg,bH as Lg,bI as Bg,bJ as Ng,bK as Fg,bL as $g,bM as qg,bN as zg,bO as Vg,bP as Ug,bQ as Wg,bR as jt,bS as It,bT as ne,bU as Gg,bV as $a,bW as cn,bX as Nf,bY as Cl,bZ as Ff,b_ as Hg,b$ as Yg,c0 as Kg,c1 as An,c2 as dn,c3 as Qg,c4 as Xg,c5 as Zg,c6 as Jg,c7 as eb,c8 as tb,c9 as _r,ca as nb,cb as rb,cc as ab,cd as ob,bd as Gs,be as ib,bf as lb,bg as sb,ce as $f,cf as ub,cg as cb,ch as db,ci as fb,cj as pb,ck as mb,cl as hb,cm as gb,cn as bb,co as vb,cp as yb,aT as Qt,aK as qa,_ as Cb,aU as xb,b1 as so,z as yt,w as uo,at as wb}from"./vendor-ux-DTEmWsko.js";import{Z as ft,Y as fn,ak as Sn,J as At,q as Ne,G as Cr,cg as Db,c as be,bP as kn,bO as qf,cd as zf,ch as Vf,h as Pb,e as pr,aD as Tb,ci as Sb}from"./index-BZxsCCR_.js";import{f as Pt}from"./index-DBs9Ljax.js";import{b as kb,W as Rn,u as xl,B as Ki,m as Rb}from"./dashboard-ibhYAC79.js";import{S as Eb}from"./switch-control-BHBY0I2i.js";import{P as Qi,w as za}from"./permission-B2PLdaCS.js";import{u as Uf,r as Mb}from"./vendor-mui-x-CQc01l4r.js";import{r as Se,a as wl,t as pt,b as De,e as Xi,d as Ob,s as ya,g as Zi,m as Wf,c as Gf,f as _b,h as Ib,i as Ji,j as Hf,k as Ab,l as jb,n as Yf,o as Dl,p as Hs,q as Lb,u as Ys,v as Bb,w as Nb,x as $t,y as Fb,z as Ks,A as $b,B as co,C as Qs,D as qb,E as qr,F as hn,G as zb,H as Vb,I as zr,J as fo,K as Vr,L as po,M as mo,N as Ub,O as Wb,P as Gb,Q as Hb,R as Yb,S as Kb,T as Qb,U as Xb,V as Zb,W as Jb}from"./index-CNIPEY43.js";import{_ as ev,a as Xs,b as tv,c as Oe,d as Re,e as Ee}from"./createClass-gaMAMqR5.js";import{u as ke,a as ue,r as xr,w as Ca,g as Kf,b as pn,e as Qf,c as nv,d as rv,o as el}from"./raf-schd.esm-XXBRsnmf.js";import{s as av}from"./sanitize-yVk8VEIO.js";import{C as Zs}from"./click-to-copy-Y_g1bzK1.js";import{v as ho}from"./index-BqdvWprH.js";import{A as ov,a as iv,b as lv,I as sv,f as uv,B as cv,d as dv}from"./add-component-core-DB6FFHib.js";import{C as jn}from"./confirm-CkoSEAQA.js";import{a as xa,v as fv}from"./util-BYnhSg2W.js";import{C as pv}from"./lock.svg-BgybwZNe.js";import{D as mv}from"./delete-confirm-CRZxojEX.js";import{b as Xf}from"./vendor-hooks-qxhUUbW5.js";import{e as hv}from"./engine-D3NlocNz.js";import{I as gv}from"./iframe-Bje7e1bW.js";import{B as Zf}from"./bundle-avatar-BcFO2tQG.js";import{A as Jf}from"./actions-Dfiiwkit.js";import{v as go}from"./index-icvBZv9S.js";import{W as bv}from"./did-address-CQO2MAbB.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./session-DwQKgNVz.js";import"./team-DJUogroZ.js";import"./isURL-4Bkt0jKV.js";import"./use-app-logo-DbYok-1h.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./useSetState-L-f8mSga.js";import"./index-DSiSlyHN.js";import"./zh-sNz1KN0x.js";import"./over-due-invoice-payment-UdTfL4Kl.js";import"./useLocalStorage-DzhcQ3lj.js";import"./get-safe-url-D4mirsKD.js";import"./passport-VW2_vBcn.js";import"./create-passport-svg-DXpLsb6S.js";import"./spaces-DBCz6tUn.js";import"./api-FQQlzPOP.js";import"./index-VFqVu6RK.js";import"./omit-spWLSLbo.js";import"./index-_tncRnTu.js";import"./item-Sc9nk8VE.js";import"./wait-connect-CBmpE7OF.js";import"./launch-result-message-MNpx7ysR.js";import"./page-header-CHAwrgX-.js";import"./config-space-LrsWMRQl.js";import"./required-BQln5OcV.js";import"./index-D5sBpp1t.js";import"./Google-DPANLEPw.js";import"./cloneDeep-C2rlAYcK.js";import"./form-wrapper-PT5ZzMQy.js";import"./logo-uploader-BksS6OGe.js";import"./collapse-B7gUzFaX.js";import"./index-B0Q9wWG1.js";import"./config-ZxMxtwH7.js";import"./section-jXB9AxBb.js";import"./form-text-input-DlypNadC.js";import"./edit.svg-RRSklUg-.js";import"./use-mobile-BINJTzMb.js";import"./content-layout-DmSBGGVm.js";import"./connect-to-Bimfzs2e.js";import"./index-CnCY99ka.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./search-4YYphs0l.js";function ep({children:e=null,...t}){const{t:n}=ut(),{api:a}=ft(),{blocklet:r}=fn(),o=r?.settings?.autoCheckUpdate,i=async s=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:s}})},l=async()=>{try{const s=!o?.enabled;await i({enabled:s}),je.success(n(s?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(s){je.error(s.message)}},u=!!o?.enabled;return D.jsxs(ie,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e,D.jsx(Tt,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:D.jsx("div",{children:D.jsx(Eb,{checked:u,onChange:l,name:"enableWelcomePage",style:{...t.style,zoom:.8}})})})]})}ep.propTypes={children:K.any};var bo={},vo={exports:{}},Js;function Ge(){return Js||(Js=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)({}).hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(vo)),vo.exports}var Vn={},yo={},Co={},xo={},eu;function vv(){return eu||(eu=1,function(e){var t=re();Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(Ge()),a=t(Lf()),r=t(Pe()),o=t(ze()),i=un();function l(s){var f=(0,i.useTheme)();return r.default.createElement("div",{ref:s.forwardedRef,style:{display:"table",width:"100%",height:"100%",backgroundColor:f.palette.background.paper,opacity:.7}},r.default.createElement("div",{style:{display:"table-cell",width:"100%",height:"100%",verticalAlign:"middle",textAlign:"center"}},r.default.createElement(a.default,null)))}l.propTypes={theme:o.default.any};var u=r.default.forwardRef(function(f,d){return r.default.createElement(l,(0,n.default)({},f,{forwardedRef:d}))});e.default=u}(xo)),xo}var wo={},Do={},Dt={},Po={exports:{}},To={exports:{}},So={exports:{}},tu;function yv(){return tu||(tu=1,function(e){var t=Kt().default;function n(a,r){if(t(a)!="object"||!a)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var i=o.call(a,r||"default");if(t(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(So)),So.exports}var nu;function tp(){return nu||(nu=1,function(e){var t=Kt().default,n=yv();function a(r){var o=n(r,"string");return t(o)=="symbol"?o:o+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}(To)),To.exports}var ru;function nt(){return ru||(ru=1,function(e){var t=tp();function n(a,r,o){return(r=t(r))in a?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Po)),Po.exports}const Cv={},au=e=>{let t;const n=new Set,a=(f,d)=>{const c=typeof f=="function"?f(t):f;if(!Object.is(c,t)){const v=t;t=d??(typeof c!="object"||c===null)?c:Object.assign({},t,c),n.forEach(y=>y(t,v))}},r=()=>t,u={setState:a,getState:r,getInitialState:()=>s,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},s=t=e(a,r,u);return u},np=e=>e?au(e):au,{useDebugValue:xv}=Me,{useSyncExternalStoreWithSelector:wv}=Uf,Dv=e=>e;function rp(e,t=Dv,n){const a=wv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return xv(a),a}const ou=e=>{const t=typeof e=="function"?np(e):e,n=(a,r)=>rp(t,a,r);return Object.assign(n,t),n},ap=e=>e?ou(e):ou;var Pv=e=>ap(e);const Tv=Object.freeze(Object.defineProperty({__proto__:null,create:ap,createStore:np,default:Pv,useStore:rp},Symbol.toStringTag,{value:"Module"})),Sv=sn(Tv),{useDebugValue:kv}=Me,{useSyncExternalStoreWithSelector:Rv}=Uf,Ev=e=>e;function Mv(e,t=Ev,n){const a=Rv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kv(a),a}const{createElement:Ov,createContext:_v,useContext:iu,useMemo:Iv,useRef:Av}=Me;function jv(){const e=_v(void 0);return{Provider:({createStore:r,children:o})=>{const i=Av();return i.current||(i.current=r()),Ov(e.Provider,{value:i.current},o)},useStore:(r,o)=>{const i=iu(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Mv(i,r,o)},useStoreApi:()=>{const r=iu(e);if(!r)throw new Error("Seems like you have not used zustand provider as an ancestor.");return Iv(()=>({...r}),[r])}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,default:jv},Symbol.toStringTag,{value:"Module"})),Bv=sn(Lv);var Ur={exports:{}},ha={exports:{}},Nv=ha.exports,lu;function Fv(){return lu||(lu=1,function(e,t){(function(n,a){e.exports=a()})(Nv,function(){var n=typeof Promise=="function",a=function(x){if(typeof globalThis=="object")return globalThis;Object.defineProperty(x,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var P=typeDetectGlobalObject;return delete x.typeDetectGlobalObject,P}(Object.prototype),r=typeof Symbol<"u",o=typeof Map<"u",i=typeof Set<"u",l=typeof WeakMap<"u",u=typeof WeakSet<"u",s=typeof DataView<"u",f=r&&typeof Symbol.iterator<"u",d=r&&typeof Symbol.toStringTag<"u",c=i&&typeof Set.prototype.entries=="function",v=o&&typeof Map.prototype.entries=="function",y=c&&Object.getPrototypeOf(new Set().entries()),g=v&&Object.getPrototypeOf(new Map().entries()),C=f&&typeof Array.prototype[Symbol.iterator]=="function",h=C&&Object.getPrototypeOf([][Symbol.iterator]()),p=f&&typeof String.prototype[Symbol.iterator]=="function",m=p&&Object.getPrototypeOf(""[Symbol.iterator]()),b=8,k=-1;function w(x){var P=typeof x;if(P!=="object")return P;if(x===null)return"null";if(x===a)return"global";if(Array.isArray(x)&&(d===!1||!(Symbol.toStringTag in x)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&x===window.location)return"Location";if(typeof window.document=="object"&&x===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&x===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&x===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&x instanceof window.HTMLElement){if(x.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(x.tagName==="TD")return"HTMLTableDataCellElement";if(x.tagName==="TH")return"HTMLTableHeaderCellElement"}}var S=d&&x[Symbol.toStringTag];if(typeof S=="string")return S;var R=Object.getPrototypeOf(x);return R===RegExp.prototype?"RegExp":R===Date.prototype?"Date":n&&R===Promise.prototype?"Promise":i&&R===Set.prototype?"Set":o&&R===Map.prototype?"Map":u&&R===WeakSet.prototype?"WeakSet":l&&R===WeakMap.prototype?"WeakMap":s&&R===DataView.prototype?"DataView":o&&R===g?"Map Iterator":i&&R===y?"Set Iterator":C&&R===h?"Array Iterator":p&&R===m?"String Iterator":R===null?"Object":Object.prototype.toString.call(x).slice(b,k)}return w})}(ha)),ha.exports}var su;function op(){if(su)return Ur.exports;su=1;/*!
3
3
  * deep-eql
4
4
  * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
5
5
  * MIT Licensed
@@ -346,7 +346,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
346
346
  .ux-dialog_closeButton {
347
347
  margin: 0;
348
348
  }
349
- `,iM=M.lazy(()=>Cb(()=>import("./index-CtJhxyJT.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>({default:e.Uploader}))),lM="/blocklet/component/upload",wf=[".html",".htm",".tgz",".zip"],sM=Number(window.env?.maxUploadFileSize)||be.MAX_UPLOAD_FILE_SIZE,uM=sM*1024*1024;function Ah({did:e,prefix:t,headers:n=()=>({}),onUploaded:a=Us,open:r=!1,onClose:o=Us}){const{t:i,locale:l}=ut(),u=M.useRef(null),s=M.useCallback(f=>{const{status:d,data:c}=f;if(d===200){a(c);return}je.error(i("blocklet.component.addComponentTip.uploadFailed"))},[a,i]);return M.useEffect(()=>{r?u.current?.open():u.current?.close()},[r]),D.jsx(cM,{id:`component-uploader-${e}`,children:D.jsx(iM,{ref:u,locale:l,popup:!0,disableXssAttack:!0,onUploadFinish:s,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:on(t,lM,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:wf,maxFileSize:uM,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:i("blocklet.component.addComponentTip.allowedFileTypes",{types:wf.map(f=>f.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Ah.propTypes={did:K.string.isRequired,prefix:K.string.isRequired,open:K.bool,headers:K.func,onUploaded:K.func,onClose:K.func};const cM=oe(ie)`
349
+ `,iM=M.lazy(()=>Cb(()=>import("./index-fpjO7dzv.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>({default:e.Uploader}))),lM="/blocklet/component/upload",wf=[".html",".htm",".tgz",".zip"],sM=Number(window.env?.maxUploadFileSize)||be.MAX_UPLOAD_FILE_SIZE,uM=sM*1024*1024;function Ah({did:e,prefix:t,headers:n=()=>({}),onUploaded:a=Us,open:r=!1,onClose:o=Us}){const{t:i,locale:l}=ut(),u=M.useRef(null),s=M.useCallback(f=>{const{status:d,data:c}=f;if(d===200){a(c);return}je.error(i("blocklet.component.addComponentTip.uploadFailed"))},[a,i]);return M.useEffect(()=>{r?u.current?.open():u.current?.close()},[r]),D.jsx(cM,{id:`component-uploader-${e}`,children:D.jsx(iM,{ref:u,locale:l,popup:!0,disableXssAttack:!0,onUploadFinish:s,plugins:[],onClose:o,installerProps:{disabled:!0},apiPathProps:{uploader:on(t,lM,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:wf,maxFileSize:uM,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:i("blocklet.component.addComponentTip.allowedFileTypes",{types:wf.map(f=>f.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}Ah.propTypes={did:K.string.isRequired,prefix:K.string.isRequired,open:K.bool,headers:K.func,onUploaded:K.func,onClose:K.func};const cM=oe(ie)`
350
350
  .uploader-wrapper {
351
351
  display: inline-flex;
352
352
  position: relative;
@@ -1 +1 @@
1
- import{ds as e,dt as c,du as t,dv as o}from"./vendor-mui-core-DnR6WYuU.js";import{c as n}from"./index-BHa1_Bjz.js";const a=[{value:n.WHO_CAN_ACCESS.ALL,icon:e,title:{zh:"面向所有人",en:"Open to Everyone"},description:{zh:"任何人都可以访问应用而不需要身份验证。",en:"Anyone can access this blocklet without authenticating."}},{value:n.WHO_CAN_ACCESS.INVITED,icon:c,title:{zh:"仅限受邀",en:"Invite-Only Access"},description:{zh:"仅限受邀用户可访问应用。",en:"Only invited members can access."}},{value:n.WHO_CAN_ACCESS.ADMIN,icon:t,title:{zh:"仅限拥有者 & 管理员",en:"Owner & Admin Access."},description:{zh:"仅限拥有者或管理员访问应用。",en:"Only the owner or an admin can access it."}},{value:n.WHO_CAN_ACCESS.OWNER,icon:o,title:{zh:"仅限拥有者",en:"Owner-Only Access"},description:{zh:"仅限拥有者访问应用。",en:"Only the blocklet owner can access it."}}];export{a as A};
1
+ import{ds as e,dt as c,du as t,dv as o}from"./vendor-mui-core-DnR6WYuU.js";import{c as n}from"./index-BZxsCCR_.js";const a=[{value:n.WHO_CAN_ACCESS.ALL,icon:e,title:{zh:"面向所有人",en:"Open to Everyone"},description:{zh:"任何人都可以访问应用而不需要身份验证。",en:"Anyone can access this blocklet without authenticating."}},{value:n.WHO_CAN_ACCESS.INVITED,icon:c,title:{zh:"仅限受邀",en:"Invite-Only Access"},description:{zh:"仅限受邀用户可访问应用。",en:"Only invited members can access."}},{value:n.WHO_CAN_ACCESS.ADMIN,icon:t,title:{zh:"仅限拥有者 & 管理员",en:"Owner & Admin Access."},description:{zh:"仅限拥有者或管理员访问应用。",en:"Only the owner or an admin can access it."}},{value:n.WHO_CAN_ACCESS.OWNER,icon:o,title:{zh:"仅限拥有者",en:"Owner-Only Access"},description:{zh:"仅限拥有者访问应用。",en:"Only the blocklet owner can access it."}}];export{a as A};