@abtnode/blocklet-services 1.16.34-beta-20241218-045149-150af879 → 1.16.34-beta-20241219-132811-455be4c4

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 (223) hide show
  1. package/api/routes/oauth.js +2 -1
  2. package/dist/assets/{Add-CR7sEnVa.js → Add-D5zbmaC5.js} +1 -1
  3. package/dist/assets/{Alert-_hy6i2TW.js → Alert-Ca5BIvJG.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-Y4EemKOX.js → ArrowDropDown-Dc5OJFHA.js} +1 -1
  5. package/dist/assets/Autocomplete-Dc6Ckgb4.js +1 -0
  6. package/dist/assets/{Avatar-BGI1LZff.js → Avatar-B41sfbMu.js} +1 -1
  7. package/dist/assets/{ButtonGroup-Z3Ze7Bhq.js → ButtonGroup-C95pZQfV.js} +1 -1
  8. package/dist/assets/{CSSTransition-BCJrke0A.js → CSSTransition-DRnC0hP6.js} +1 -1
  9. package/dist/assets/{CheckCircle-lvBXN98Q.js → CheckCircle-CftBFr7p.js} +1 -1
  10. package/dist/assets/{ChevronLeft-Co-QpbPc.js → ChevronLeft-CbtftJu3.js} +1 -1
  11. package/dist/assets/{ChevronRight-FbnhEa4s.js → ChevronRight-DLdnfW7O.js} +1 -1
  12. package/dist/assets/{Clear-hQNgujce.js → Clear-Cn6HmYQz.js} +1 -1
  13. package/dist/assets/{Delete-B08C-mSs.js → Delete-BEI9Sgjm.js} +1 -1
  14. package/dist/assets/{DeleteOutline-BCCT6DJp.js → DeleteOutline-BcT7g0hk.js} +1 -1
  15. package/dist/assets/DialogContentText-IZR4LQpV.js +1 -0
  16. package/dist/assets/DialogTitle-B1GtBdEX.js +1 -0
  17. package/dist/assets/{Done-CiqJ6IHh.js → Done-J-vanIHZ.js} +1 -1
  18. package/dist/assets/{Download-Bv39RUQq.js → Download-BotKCenR.js} +1 -1
  19. package/dist/assets/{EditIcon-B3dfnlOS.js → EditIcon-AjMrTHbF.js} +1 -1
  20. package/dist/assets/{Error-BKxLwDxL.js → Error-Bp2_azLF.js} +1 -1
  21. package/dist/assets/{ExpandMore-Bqisn1wE.js → ExpandMore-D5Ex5uDB.js} +1 -1
  22. package/dist/assets/FormControl-B_E_ND8l.js +1 -0
  23. package/dist/assets/{FormControlLabel-DrzQSDw5.js → FormControlLabel-4Fi9hZ9w.js} +1 -1
  24. package/dist/assets/FormGroup-wFFM5h4o.js +1 -0
  25. package/dist/assets/{Google-BLOYlfTF.js → Google-CJXz8-MM.js} +1 -1
  26. package/dist/assets/{Grid-SgzMUjEU.js → Grid-CNX9GiAc.js} +1 -1
  27. package/dist/assets/{HelpOutline-DuoroGqb.js → HelpOutline-Dcjk7ulm.js} +1 -1
  28. package/dist/assets/{Hidden-CrmpQdXR.js → Hidden-DX_Kmgml.js} +1 -1
  29. package/dist/assets/{InfoOutlined-RlhtSWs3.js → InfoOutlined-BW-k42mL.js} +1 -1
  30. package/dist/assets/InputAdornment-BgKAM5uL.js +1 -0
  31. package/dist/assets/{LastPage-Snyq0pP3.js → LastPage-CMuWIJmA.js} +1 -1
  32. package/dist/assets/{Launch-BSl6NDxk.js → Launch-CJJrZfJ6.js} +1 -1
  33. package/dist/assets/{LaunchOutlined-B4H6BLfm.js → LaunchOutlined-C-rm1xO-.js} +1 -1
  34. package/dist/assets/Link-do-3aPDc.js +1 -0
  35. package/dist/assets/ListItemButton-B8qxXRHx.js +1 -0
  36. package/dist/assets/{ListSubheader-ShT9Sg18.js → ListSubheader-BbgYQCin.js} +1 -1
  37. package/dist/assets/{LoadingButton-C52xjKpM.js → LoadingButton-nSVrtGvg.js} +1 -1
  38. package/dist/assets/{LockIcon-bI_F9Ild.js → LockIcon-C599BLMv.js} +1 -1
  39. package/dist/assets/{Loop-D9qegsTQ.js → Loop-aBYqXvmT.js} +1 -1
  40. package/dist/assets/{MarkEmailRead-0EB-Mkj_.js → MarkEmailRead-BDLJl1Cp.js} +1 -1
  41. package/dist/assets/{Menu-BYYOSq08.js → Menu-egTGbomH.js} +1 -1
  42. package/dist/assets/{MoreHoriz-jXxdEJP9.js → MoreHoriz-BJE-_6U8.js} +1 -1
  43. package/dist/assets/{MoreVert-BARSVa3q.js → MoreVert-BjFlbgru.js} +1 -1
  44. package/dist/assets/{OpenInNew-CBHKs3sB.js → OpenInNew-BznH-WIN.js} +1 -1
  45. package/dist/assets/{OutlinedInput-ByQv6zcS.js → OutlinedInput-DClaGk47.js} +2 -2
  46. package/dist/assets/{Pagination-C22d4uzo.js → Pagination-po7M52DR.js} +1 -1
  47. package/dist/assets/{PlayArrow-DmC7i7oT.js → PlayArrow-4Ph4Db5p.js} +1 -1
  48. package/dist/assets/{QuestionMarkCircle-DnkR0JCz.js → QuestionMarkCircle-hxFQEIuB.js} +1 -1
  49. package/dist/assets/{RadioGroup-Bnm-cYxm.js → RadioGroup-rsK9d7AH.js} +1 -1
  50. package/dist/assets/{Search-jWVedrNW.js → Search-ClcNwm6y.js} +1 -1
  51. package/dist/assets/{Select-BRIdogF3.js → Select-3zppq3AC.js} +1 -1
  52. package/dist/assets/{ServerLogo-Cwvm7N9d.js → ServerLogo-GPvXYlrb.js} +1 -1
  53. package/dist/assets/{Skeleton-DmlR9RTr.js → Skeleton-RJ909Xb5.js} +5 -5
  54. package/dist/assets/Stack-BSFkBj-z.js +1 -0
  55. package/dist/assets/{Stepper-CGWoR4Cr.js → Stepper-D3tbBsNN.js} +1 -1
  56. package/dist/assets/{TextField-2xBiC_3q.js → TextField-BglN0hgt.js} +1 -1
  57. package/dist/assets/{Toolbar-BmaPDfrf.js → Toolbar-BrM3XdrE.js} +1 -1
  58. package/dist/assets/{ViewColumn-Hi8KxtrP.js → ViewColumn-DUa9FCsV.js} +1 -1
  59. package/dist/assets/{ViewList-DB9T9Ao8.js → ViewList-DInWpp8m.js} +1 -1
  60. package/dist/assets/{_createAggregator-CSKW-QkS.js → _createAggregator-DqrSlbSW.js} +1 -1
  61. package/dist/assets/{access-control-h7TAGH4g.js → access-control-BmhqPovC.js} +1 -1
  62. package/dist/assets/{actions-Cu3UkuLL.js → actions-CXQg_2R4.js} +1 -1
  63. package/dist/assets/{add-component-core-DGSZAdE3.js → add-component-core-BbHRL77Z.js} +1 -1
  64. package/dist/assets/add-resource-CDsY8p_K.js +1 -0
  65. package/dist/assets/{addon-7B9p8dCH.js → addon-D4Z9CoN9.js} +1 -1
  66. package/dist/assets/{analytics-D2HEJiwC.js → analytics-CqGIKX0P.js} +1 -1
  67. package/dist/assets/api-DGjzM9of.js +1 -0
  68. package/dist/assets/{audit-logs-CYltvyS-.js → audit-logs-CrY4npHz.js} +2 -2
  69. package/dist/assets/{base32-C6LgLamw.js → base32-CL5BH6_g.js} +1 -1
  70. package/dist/assets/{branding-Bky7q0TT.js → branding-DldtuYQx.js} +2 -2
  71. package/dist/assets/{bundle-avatar-b1t1VYra.js → bundle-avatar-Dg5UGcHW.js} +1 -1
  72. package/dist/assets/{button-DTjLsugU.js → button-DfhlQnHj.js} +1 -1
  73. package/dist/assets/{click-to-copy-DR1rP4vm.js → click-to-copy-C9J7yUGA.js} +1 -1
  74. package/dist/assets/{complete-CuDl6Ups.js → complete-Ty8pvQDv.js} +2 -2
  75. package/dist/assets/{component-_WZ3EVoO.js → component-C4bgs0fh.js} +9 -9
  76. package/dist/assets/{config-puOoJLLI.js → config-BG6DC8uo.js} +1 -1
  77. package/dist/assets/{config-B7FdwHTv.js → config-CY0BMGTa.js} +2 -2
  78. package/dist/assets/{config-navigation-DCge2YuF.js → config-navigation-Cvrcilcn.js} +4 -4
  79. package/dist/assets/{config-space-B3Ny0aqC.js → config-space-MvdUacCI.js} +1 -1
  80. package/dist/assets/{confirm-B2Vr_bWi.js → confirm-SG-ap-ws.js} +1 -1
  81. package/dist/assets/{connect-frvDBI8-.js → connect-CG8MUQvf.js} +1 -1
  82. package/dist/assets/{connect-Djwth-pv.js → connect-D6BJeLah.js} +1 -1
  83. package/dist/assets/{connect-to-dvHRDt3P.js → connect-to-BahkORiw.js} +1 -1
  84. package/dist/assets/{content-layout-FmzgfnJs.js → content-layout-CsBQOuZw.js} +1 -1
  85. package/dist/assets/dashboard-D330kDJf.js +165 -0
  86. package/dist/assets/{deprecate-B7bDfetg.js → deprecate-B50RgeF-.js} +1 -1
  87. package/dist/assets/{did-address-BT02fs0z.js → did-address-lS5AVM-f.js} +1 -1
  88. package/dist/assets/{domain-D2xeh7gD.js → domain-CHTy22IF.js} +1 -1
  89. package/dist/assets/{domain-list-eL8Ge68T.js → domain-list-Cy9D4xMA.js} +2 -2
  90. package/dist/assets/{email-ABbBMfa9.js → email-BwcfH_bJ.js} +3 -3
  91. package/dist/assets/emotion-cache.browser.esm-aAjwJ1iO.js +1 -0
  92. package/dist/assets/{exchange-passport-D8VL5RW4.js → exchange-passport-CP8-7Dj4.js} +1 -1
  93. package/dist/assets/{fallback-DuTRWfov.js → fallback-CXpMA9jN.js} +1 -1
  94. package/dist/assets/{form-text-input-CMoesbQA.js → form-text-input-BHzdMTv5.js} +2 -2
  95. package/dist/assets/{format-error-Df_KEQEo.js → format-error-GcNyovLo.js} +2 -2
  96. package/dist/assets/{fuel-CMU1kOPY.js → fuel-fIhqZ2Gn.js} +1 -1
  97. package/dist/assets/{fullpage-Bm4nfkdv.js → fullpage-rXGgPgMY.js} +1 -1
  98. package/dist/assets/{get-safe-url-42YB8AJj.js → get-safe-url-BGvd_0xZ.js} +1 -1
  99. package/dist/assets/{get-safe-url-Doxyyx5u.js → get-safe-url-pcN_rKAr.js} +1 -1
  100. package/dist/assets/{home-puhqQ-6y.js → home-CB54IP3X.js} +1 -1
  101. package/dist/assets/{iframe-B8xXZJix.js → iframe-CJ1VXaVD.js} +1 -1
  102. package/dist/assets/{index-D77Q8g58.js → index-8HKVj0K2.js} +13 -13
  103. package/dist/assets/{index-BHUS7T6z.js → index-B4SXignI.js} +4 -4
  104. package/dist/assets/{index-Zo0HBJAk.js → index-BA6hWj_6.js} +1 -1
  105. package/dist/assets/{index-CBV44HKk.js → index-BIby-QBu.js} +4 -4
  106. package/dist/assets/{index-BG_TmIhM.js → index-BQ3Bj6mS.js} +1 -1
  107. package/dist/assets/{index-D6I9kSQE.js → index-BXGkZOts.js} +1 -1
  108. package/dist/assets/{index-CAvd4Asc.js → index-Bf96sJch.js} +2 -2
  109. package/dist/assets/{index-BU9tGUF7.js → index-C-AeaK0z.js} +2 -2
  110. package/dist/assets/{index-Cyj1kF1M.js → index-C14iUZgt.js} +44 -44
  111. package/dist/assets/{index-DRrBV2lp.js → index-CIiAk_XW.js} +7 -7
  112. package/dist/assets/{index-BhOwP4yO.js → index-CQweL2ky.js} +1 -1
  113. package/dist/assets/{index-B_aky66_.js → index-Caw9WiQt.js} +1 -1
  114. package/dist/assets/index-CbgjiFh9.js +1 -0
  115. package/dist/assets/index-CjMHfE7G.js +4 -0
  116. package/dist/assets/{index-CsXCLKF8.js → index-Cq23l55D.js} +1 -1
  117. package/dist/assets/{index-BduXzRUO.js → index-Cy7pwpgc.js} +2 -2
  118. package/dist/assets/{index-CG2kgo5k.js → index-D2KOhYyH.js} +1 -1
  119. package/dist/assets/{index-sCPuxgmg.js → index-D5xT2yvh.js} +1 -1
  120. package/dist/assets/index-D6nkDfMc.js +1 -0
  121. package/dist/assets/{index-Dwt2XPok.js → index-D9GxUK41.js} +3 -3
  122. package/dist/assets/index-D9i2zlFV.js +11 -0
  123. package/dist/assets/{index-DwThH7kF.js → index-DDNG6fLw.js} +1 -1
  124. package/dist/assets/{index-Dz3rM1O5.js → index-DMl7ojqT.js} +1 -1
  125. package/dist/assets/{index-C6paufYZ.js → index-DTQya1Ga.js} +1 -1
  126. package/dist/assets/{index-BMvHCK44.js → index-DTtollfx.js} +1 -1
  127. package/dist/assets/{index-C0AmzVyo.js → index-DwWJLCZo.js} +24 -24
  128. package/dist/assets/{index-B2wNV2JZ.js → index-GFWH_arm.js} +2 -2
  129. package/dist/assets/{index-BVLp3zZE.js → index-QlD_x8dd.js} +161 -161
  130. package/dist/assets/{index-BpB2Q7g0.js → index-SYaHXcgW.js} +7 -7
  131. package/dist/assets/{index-CUHWlYJI.js → index-fJeiLuG7.js} +1 -1
  132. package/dist/assets/index-l43P3Pet.js +1 -0
  133. package/dist/assets/{index-M873CR9J.js → index-qk2ItgUe.js} +3 -3
  134. package/dist/assets/{index-C7BJOVUl.js → index-zdiKVNp6.js} +1 -1
  135. package/dist/assets/{invitation-ZU8RAZiJ.js → invitation-BwKojWaX.js} +1 -1
  136. package/dist/assets/{invite-g5ca6iGK.js → invite-C0S2V-HK.js} +1 -1
  137. package/dist/assets/{isEmail-CrXJuC-D.js → isEmail-CNQ_-Uou.js} +1 -1
  138. package/dist/assets/{issue-passport-D8CSuAAO.js → issue-passport-DsVjF9DC.js} +1 -1
  139. package/dist/assets/{item-aEWhU55x.js → item-PcWa9_Oo.js} +1 -1
  140. package/dist/assets/{jss-plugin-props-sort.esm-CbSCROUY.js → jss-plugin-props-sort.esm-DT8CRQwC.js} +5 -5
  141. package/dist/assets/{launch-result-message-BrT1rr32.js → launch-result-message-pzlcuBAc.js} +1 -1
  142. package/dist/assets/{layout-CyocM6h2.js → layout-D4UiIZik.js} +2 -2
  143. package/dist/assets/{list-header-CWcDooSU.js → list-header-CXLBL8NM.js} +1 -1
  144. package/dist/assets/localization-Di64Tx6f.js +1 -0
  145. package/dist/assets/{log-BrgPzTQ_.js → log-FZ3WbT1K.js} +1 -1
  146. package/dist/assets/{login-BTvlfZOi.js → login-Bvkxo32o.js} +1 -1
  147. package/dist/assets/{login-oauth-callback-BTnm4A7s.js → login-oauth-callback-CbhGDecw.js} +1 -1
  148. package/dist/assets/{logo-uploader-x7kZDmdm.js → logo-uploader-Beq3ukvb.js} +4 -4
  149. package/dist/assets/{lost-passport-DVD5-b9q.js → lost-passport-B-Xo8Xcl.js} +3 -3
  150. package/dist/assets/{lottie-react.esm-DsaiORS5.js → lottie-react.esm--_Ymmw_D.js} +1 -1
  151. package/dist/assets/{notifications-DRFfRJDd.js → notifications-DThaa5Us.js} +2 -2
  152. package/dist/assets/{open-window-D1PWwK_f.js → open-window-Bzjfbxr5.js} +1 -1
  153. package/dist/assets/overview-qvsFtQDz.js +12 -0
  154. package/dist/assets/{page-header-uP5z14d-.js → page-header-BWUJXWNp.js} +1 -1
  155. package/dist/assets/{permission-CqAtXqqv.js → permission-W_8zaBQA.js} +1 -1
  156. package/dist/assets/{preferences-Bbx_83t8.js → preferences-DLgwdQeB.js} +1 -1
  157. package/dist/assets/publish-resource-DFveyHjb.js +1 -0
  158. package/dist/assets/{raf-schd.esm-950Nwcl8.js → raf-schd.esm-aAtyOT8L.js} +1 -1
  159. package/dist/assets/{react-beautiful-dnd.esm-Crc510hI.js → react-beautiful-dnd.esm-SuZ39Hsh.js} +1 -1
  160. package/dist/assets/refType-DdAkYAQu.js +1 -0
  161. package/dist/assets/resource-dialog-V3DribSt.js +271 -0
  162. package/dist/assets/sdk-BJmcT0ZX.js +1 -0
  163. package/dist/assets/{selector-BHETHL9k.js → selector-DaU6MlQV.js} +5 -5
  164. package/dist/assets/session-D-MTuhsH.js +1 -0
  165. package/dist/assets/{setup-BEJuv5zQ.js → setup-DhWE8cic.js} +3 -3
  166. package/dist/assets/{shorten-label-7p5yfIoM.js → shorten-label-hxNbJ_Ks.js} +1 -1
  167. package/dist/assets/{simple-select-BGFU9Stn.js → simple-select-CK4kebbT.js} +1 -1
  168. package/dist/assets/{slicedToArray-CC2Ju9eC.js → slicedToArray-VLKLiDbl.js} +2 -2
  169. package/dist/assets/{start-CF0eMC4t.js → start-Md5PHa4o.js} +1 -1
  170. package/dist/assets/{step-actions-epBkt1C9.js → step-actions-BOANelns.js} +1 -1
  171. package/dist/assets/{studio-CtLqrgIC.js → studio-CW3R2O1x.js} +2 -2
  172. package/dist/assets/{switch-control-HeQnHuHo.js → switch-control-Ev-C2sgo.js} +1 -1
  173. package/dist/assets/{toUpper-C_uhcn9U.js → toUpper-Ck8ZUxRp.js} +1 -1
  174. package/dist/assets/{transfer-pM92H2bb.js → transfer-CFW560tD.js} +1 -1
  175. package/dist/assets/trim-nU6YcUSy.js +1 -0
  176. package/dist/assets/{uniqBy-BSoiQcwq.js → uniqBy-CbJByQ4H.js} +1 -1
  177. package/dist/assets/{unsubscribe-DiPIA9QW.js → unsubscribe-BJliPUZz.js} +1 -1
  178. package/dist/assets/{url-join-CkIlepPX.js → url-join-DmnA0IIr.js} +1 -1
  179. package/dist/assets/{use-mobile-CNI4WLqG.js → use-mobile-3X9WMgwY.js} +1 -1
  180. package/dist/assets/{use-mobile-C__nHKAh.js → use-mobile-Db9_SqMv.js} +1 -1
  181. package/dist/assets/{useAsync-C0LxVA9E.js → useAsync-DcES_cPw.js} +1 -1
  182. package/dist/assets/{useFormControl-5yOkHFmp.js → useFormControl-C7C8L0st.js} +1 -1
  183. package/dist/assets/useLocalStorage-l4J8-UZU.js +1 -0
  184. package/dist/assets/{useSetState-QDNtnZvK.js → useSetState-hsLjpFyi.js} +1 -1
  185. package/dist/assets/useSlot-BAs2gD_d.js +1 -0
  186. package/dist/assets/{useSlotProps-DO-ZupKO.js → useSlotProps-B_GlETZV.js} +1 -1
  187. package/dist/assets/{useThemeProps-MN_zI9lm.js → useThemeProps-BMQ0TxSB.js} +1 -1
  188. package/dist/assets/user-center-B-rHUyD4.js +1 -0
  189. package/dist/assets/{user-sessions-ChfDOZU6.js → user-sessions-mjUKcFPt.js} +1 -1
  190. package/dist/assets/{util-DPoct1K7.js → util-BEOA1BUn.js} +1 -1
  191. package/dist/assets/{wrap-locale-CyPDW3Gl.js → wrap-locale-7OInKuIE.js} +1 -1
  192. package/dist/index.html +1 -1
  193. package/dist/service-worker.js +1 -1
  194. package/package.json +27 -27
  195. package/dist/assets/Autocomplete-DBZ3FH69.js +0 -1
  196. package/dist/assets/DialogContentText-B5A4L1En.js +0 -1
  197. package/dist/assets/DialogTitle-DNU2kRkR.js +0 -1
  198. package/dist/assets/FormControl-DqpecYDI.js +0 -1
  199. package/dist/assets/FormGroup-DdOZJ_4C.js +0 -1
  200. package/dist/assets/InputAdornment-bVDjO8z_.js +0 -1
  201. package/dist/assets/Link-CUqrslkF.js +0 -1
  202. package/dist/assets/ListItemButton-DRXqTtfT.js +0 -1
  203. package/dist/assets/Stack-26B3qUFg.js +0 -1
  204. package/dist/assets/add-resource-D8LrsGLU.js +0 -1
  205. package/dist/assets/api-B1moJ8Q-.js +0 -1
  206. package/dist/assets/dashboard-B6MLhh0C.js +0 -165
  207. package/dist/assets/emotion-cache.browser.esm-BC4S7lNf.js +0 -1
  208. package/dist/assets/index--bEJ2Eh9.js +0 -1
  209. package/dist/assets/index-D38zhHbI.js +0 -1
  210. package/dist/assets/index-D5VxU-ij.js +0 -11
  211. package/dist/assets/index-DNd8fzbU.js +0 -1
  212. package/dist/assets/index-x4WJUF-F.js +0 -4
  213. package/dist/assets/localization-VG2_8PqC.js +0 -1
  214. package/dist/assets/overview-DQMD8UEE.js +0 -12
  215. package/dist/assets/publish-resource-DForst_Z.js +0 -1
  216. package/dist/assets/refType-D4wZk9Eo.js +0 -1
  217. package/dist/assets/resource-dialog-gDoXhWVp.js +0 -271
  218. package/dist/assets/sdk-5yxlFRXZ.js +0 -1
  219. package/dist/assets/session-DWSqwZ_P.js +0 -1
  220. package/dist/assets/trim-S-x1Aalq.js +0 -1
  221. package/dist/assets/useLocalStorage-4Hgdh0LK.js +0 -1
  222. package/dist/assets/useSlot-DpD1z7uw.js +0 -1
  223. package/dist/assets/user-center-04PU0--E.js +0 -1
@@ -1 +1 @@
1
- import{r,j as a}from"./index-BVLp3zZE.js";const p=(e,{name:s,alternative:n})=>function(t){return r.useEffect(()=>{},[]),a.jsx(e,{...t})};export{p as w};
1
+ import{r,j as a}from"./index-QlD_x8dd.js";const p=(e,{name:s,alternative:n})=>function(t){return r.useEffect(()=>{},[]),a.jsx(e,{...t})};export{p as w};
@@ -1 +1 @@
1
- import{j as s,D as p,Q as d,P as r}from"./index-BVLp3zZE.js";import{L as l}from"./Link-CUqrslkF.js";function a({did:o,href:t,external:n,avatarProps:f,...i}){const e=s.jsx(p,{did:o,...i});return t?n?s.jsx(l,{target:"_blank",href:t,underline:"hover",children:e}):s.jsx(d,{to:t,children:e}):e}a.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};a.defaultProps={to:"",href:"",avatarProps:{},external:!1};export{a as W};
1
+ import{j as s,D as p,Q as d,P as r}from"./index-QlD_x8dd.js";import{L as l}from"./Link-do-3aPDc.js";function a({did:o,href:t,external:n,avatarProps:f,...i}){const e=s.jsx(p,{did:o,...i});return t?n?s.jsx(l,{target:"_blank",href:t,underline:"hover",children:e}):s.jsx(d,{to:t,children:e}):e}a.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};a.defaultProps={to:"",href:"",avatarProps:{},external:!1};export{a as W};
@@ -1,4 +1,4 @@
1
- import{a2 as E,a3 as _,j as t,r,a6 as w,bu as A,aq as W,ae as L,fW as R,ab as j,B as i,T as y,aI as H,fI as q,P as S,a4 as z}from"./index-BVLp3zZE.js";import{D as O,a as N,B as $,A as F}from"./domain-list-eL8Ge68T.js";import{P as K}from"./page-header-uP5z14d-.js";import{d as M}from"./ExpandMore-Bqisn1wE.js";import{_ as U}from"./useSetState-QDNtnZvK.js";import{S as l}from"./button-DTjLsugU.js";import{S as Y}from"./layout-CyocM6h2.js";import{S as G}from"./step-actions-epBkt1C9.js";import"./trim-S-x1Aalq.js";import"./Add-CR7sEnVa.js";import"./base32-C6LgLamw.js";import"./LockIcon-bI_F9Ild.js";import"./index-BMvHCK44.js";import"./index-DNd8fzbU.js";import"./CheckCircle-lvBXN98Q.js";import"./util-DPoct1K7.js";import"./Alert-_hy6i2TW.js";import"./useSlot-DpD1z7uw.js";import"./permission-CqAtXqqv.js";import"./useAsync-C0LxVA9E.js";import"./session-DWSqwZ_P.js";import"./confirm-B2Vr_bWi.js";import"./DialogTitle-DNU2kRkR.js";import"./DialogContentText-B5A4L1En.js";import"./format-error-Df_KEQEo.js";import"./use-mobile-CNI4WLqG.js";import"./InfoOutlined-RlhtSWs3.js";import"./index-C7BJOVUl.js";import"./api-B1moJ8Q-.js";import"./index-B2wNV2JZ.js";import"./TextField-2xBiC_3q.js";import"./FormControl-DqpecYDI.js";import"./utils-iop7lDec.js";import"./useFormControl-5yOkHFmp.js";import"./Select-BRIdogF3.js";import"./OutlinedInput-ByQv6zcS.js";import"./LoadingButton-C52xjKpM.js";import"./useThemeProps-MN_zI9lm.js";import"./Delete-B08C-mSs.js";import"./actions-Cu3UkuLL.js";import"./MoreHoriz-jXxdEJP9.js";import"./content-layout-FmzgfnJs.js";var p={},J=_;Object.defineProperty(p,"__esModule",{value:!0});var v=p.default=void 0,Q=J(E()),V=t;v=p.default=(0,Q.default)((0,V.jsx)("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"}),"Recommend");function c({onNext:s,onPrevious:g}){var h,D;const{t:o}=r.useContext(w),{info:k}=A(),[C,u]=r.useState(!1),{blocklet:a}=W(),[x,I]=r.useState(""),[d,P]=r.useState(!1),B=(((a==null?void 0:a.site)||{}).domainAliases||[]).map(e=>L.replaceSlotToIp(e.value,x)),[n,m]=U({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),f=(D=(h=a.environments)==null?void 0:h.find(e=>e.key==="BLOCKLET_APP_PK"))==null?void 0:D.value,T=B.find(e=>R.isDidDomain(e));return r.useEffect(()=>{j.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:e})=>{I(e.address||"")}).catch(e=>{console.error(e.message)})},[]),t.jsxs(X,{children:[t.jsx("div",{className:"header",children:t.jsx(K,{title:o("setup.domain.title"),subTitle:o("setup.domain.subTitle"),onClickBack:g})}),t.jsxs(i,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[t.jsxs(i,{children:[t.jsxs(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:[t.jsx(i,{display:"inline",children:o("setup.domain.skipStart")}),t.jsx(l,{variant:"text",size:"small",disabled:!!n.addDomainState.text,onClick:()=>s(),style:{paddingTop:0},children:t.jsx("span",{style:{textDecoration:"underline"},children:o("setup.domain.skip")})}),t.jsx(i,{display:"inline",children:o("setup.domain.skipEnd")})]}),t.jsx(i,{sx:{marginTop:"12px"},children:t.jsx(N,{listOnly:!0,inSetup:!0})})]}),t.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:2},children:[k.nftDomainUrl&&t.jsxs(t.Fragment,{children:[t.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(v,{color:"primary"}),t.jsx(y,{fontWeight:"fontWeightBold",children:o("setup.domain.buyDIDDomainTitle")})]}),t.jsxs(i,{children:[t.jsx($,{appPk:f,appId:a.appPid,siteId:a.site.id,teamDid:a.meta.did,title:o("common.buy"),inBlockletSetup:!0}),t.jsx(y,{sx:{marginTop:1},children:o("setup.domain.buyDIDDomainTips")})]})]}),t.jsxs(i,{children:[t.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",overflow:"hidden",cursor:"pointer"},onClick:()=>P(!d),children:[t.jsx(i,{fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o("setup.domain.addTitle")}),t.jsx(H,{sx:{transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"},children:t.jsx(M,{})})]}),t.jsx(q,{in:d,timeout:"auto",unmountOnExit:!0,children:t.jsx(F,{autoFocus:!1,appPk:f,appId:a.appPid,siteId:a.site.id,teamDid:a.meta.did,cnameDomain:T,currentIp:x,inBlockletSetup:!0,shouldCheckDomain:!0,resolveDomain:e=>j.get(`/dns-resolve?hostname=${e}`),onInputDomain:e=>{m({domain:e.domain,type:e.type}),u(e.error)},onStateChange:e=>m({addDomainState:e}),onSuccess:e=>{const b={domain:e.domain,type:e.type,nftDid:e.nftDid,chainHost:e.chainHost};m(b),s()},onError:u})})]})]})]}),t.jsx(G,{mt:8,disabled:!!n.addDomainState.text,blocklet:a,onStartNow:()=>s("complete"),children:n.domain?t.jsx(l,{variant:"contained",loading:!!n.addDomainState.text,disabled:C||!!n.addDomainState.text||!n.domain,onClick:()=>s(),children:n.addDomainState.text||o("setup.next")}):t.jsx(l,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>s(),children:o("setup.skip")})})]})}function Ft(s){return t.jsx(O,{children:t.jsx(c,{...s})})}c.propTypes={onNext:S.func,onPrevious:S.func};c.defaultProps={onNext:()=>{},onPrevious:()=>{}};const X=z(Y)`
1
+ import{a2 as E,a3 as _,j as t,r,a6 as w,bs as A,aq as L,ae as W,fX as R,ab as j,B as i,T as y,aI as H,fJ as q,P as S,a4 as z}from"./index-QlD_x8dd.js";import{D as O,a as N,B as $,A as F}from"./domain-list-Cy9D4xMA.js";import{P as K}from"./page-header-BWUJXWNp.js";import{d as M}from"./ExpandMore-D5Ex5uDB.js";import{_ as J}from"./useSetState-hsLjpFyi.js";import{S as l}from"./button-DfhlQnHj.js";import{S as U}from"./layout-D4UiIZik.js";import{S as X}from"./step-actions-BOANelns.js";import"./trim-nU6YcUSy.js";import"./Add-D5zbmaC5.js";import"./base32-CL5BH6_g.js";import"./LockIcon-C599BLMv.js";import"./index-DTtollfx.js";import"./index-CbgjiFh9.js";import"./CheckCircle-CftBFr7p.js";import"./util-BEOA1BUn.js";import"./Alert-Ca5BIvJG.js";import"./useSlot-BAs2gD_d.js";import"./permission-W_8zaBQA.js";import"./useAsync-DcES_cPw.js";import"./session-D-MTuhsH.js";import"./confirm-SG-ap-ws.js";import"./DialogTitle-B1GtBdEX.js";import"./DialogContentText-IZR4LQpV.js";import"./format-error-GcNyovLo.js";import"./use-mobile-3X9WMgwY.js";import"./InfoOutlined-BW-k42mL.js";import"./index-zdiKVNp6.js";import"./api-DGjzM9of.js";import"./index-GFWH_arm.js";import"./TextField-BglN0hgt.js";import"./FormControl-B_E_ND8l.js";import"./utils-iop7lDec.js";import"./useFormControl-C7C8L0st.js";import"./Select-3zppq3AC.js";import"./OutlinedInput-DClaGk47.js";import"./LoadingButton-nSVrtGvg.js";import"./useThemeProps-BMQ0TxSB.js";import"./Delete-BEI9Sgjm.js";import"./actions-CXQg_2R4.js";import"./MoreHoriz-BJE-_6U8.js";import"./content-layout-CsBQOuZw.js";var p={},Y=_;Object.defineProperty(p,"__esModule",{value:!0});var v=p.default=void 0,G=Y(E()),Q=t;v=p.default=(0,G.default)((0,Q.jsx)("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m6 9.8a.9.9 0 0 1-.1.5l-2.1 4.9a1.34 1.34 0 0 1-1.3.8H9a2 2 0 0 1-2-2v-5a1.28 1.28 0 0 1 .4-1L12 5l.69.69a1.08 1.08 0 0 1 .3.7v.2L12.41 10H17a1 1 0 0 1 1 1z"}),"Recommend");function c({onNext:s,onPrevious:g}){var h,D;const{t:o}=r.useContext(w),{info:k}=A(),[C,u]=r.useState(!1),{blocklet:a}=L(),[x,I]=r.useState(""),[d,P]=r.useState(!1),B=(((a==null?void 0:a.site)||{}).domainAliases||[]).map(e=>W.replaceSlotToIp(e.value,x)),[n,m]=J({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),f=(D=(h=a.environments)==null?void 0:h.find(e=>e.key==="BLOCKLET_APP_PK"))==null?void 0:D.value,T=B.find(e=>R.isDidDomain(e));return r.useEffect(()=>{j.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:e})=>{I(e.address||"")}).catch(e=>{console.error(e.message)})},[]),t.jsxs(V,{children:[t.jsx("div",{className:"header",children:t.jsx(K,{title:o("setup.domain.title"),subTitle:o("setup.domain.subTitle"),onClickBack:g})}),t.jsxs(i,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[t.jsxs(i,{children:[t.jsxs(i,{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",children:[t.jsx(i,{display:"inline",children:o("setup.domain.skipStart")}),t.jsx(l,{variant:"text",size:"small",disabled:!!n.addDomainState.text,onClick:()=>s(),style:{paddingTop:0},children:t.jsx("span",{style:{textDecoration:"underline"},children:o("setup.domain.skip")})}),t.jsx(i,{display:"inline",children:o("setup.domain.skipEnd")})]}),t.jsx(i,{sx:{marginTop:"12px"},children:t.jsx(N,{listOnly:!0,inSetup:!0})})]}),t.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:2},children:[k.nftDomainUrl&&t.jsxs(t.Fragment,{children:[t.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(v,{color:"primary"}),t.jsx(y,{fontWeight:"fontWeightBold",children:o("setup.domain.buyDIDDomainTitle")})]}),t.jsxs(i,{children:[t.jsx($,{appPk:f,appId:a.appPid,siteId:a.site.id,teamDid:a.meta.did,title:o("common.buy"),inBlockletSetup:!0}),t.jsx(y,{sx:{marginTop:1},children:o("setup.domain.buyDIDDomainTips")})]})]}),t.jsxs(i,{children:[t.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",overflow:"hidden",cursor:"pointer"},onClick:()=>P(!d),children:[t.jsx(i,{fontWeight:"fontWeightBold",fontSize:"1.125rem",children:o("setup.domain.addTitle")}),t.jsx(H,{sx:{transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"},children:t.jsx(M,{})})]}),t.jsx(q,{in:d,timeout:"auto",unmountOnExit:!0,children:t.jsx(F,{autoFocus:!1,appPk:f,appId:a.appPid,siteId:a.site.id,teamDid:a.meta.did,cnameDomain:T,currentIp:x,inBlockletSetup:!0,shouldCheckDomain:!0,resolveDomain:e=>j.get(`/dns-resolve?hostname=${e}`),onInputDomain:e=>{m({domain:e.domain,type:e.type}),u(e.error)},onStateChange:e=>m({addDomainState:e}),onSuccess:e=>{const b={domain:e.domain,type:e.type,nftDid:e.nftDid,chainHost:e.chainHost};m(b),s()},onError:u})})]})]})]}),t.jsx(X,{mt:8,disabled:!!n.addDomainState.text,blocklet:a,onStartNow:()=>s("complete"),children:n.domain?t.jsx(l,{variant:"contained",loading:!!n.addDomainState.text,disabled:C||!!n.addDomainState.text||!n.domain,onClick:()=>s(),children:n.addDomainState.text||o("setup.next")}):t.jsx(l,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>s(),children:o("setup.skip")})})]})}function Ft(s){return t.jsx(O,{children:t.jsx(c,{...s})})}c.propTypes={onNext:S.func,onPrevious:S.func};c.defaultProps={onNext:()=>{},onPrevious:()=>{}};const V=z(U)`
2
2
  height: 100%;
3
3
  overflow-y: hidden;
4
4
  .form {
@@ -1,4 +1,4 @@
1
- import{a2 as ae,a3 as le,j as e,eL as Me,c as G,fX as mt,w as pt,aE as Be,aG as ft,u as k,r as v,l as V,c9 as ht,Y as xt,a7 as W,aA as gt,B as h,n as z,T as q,cF as Ee,ap as Y,a5 as ce,bn as ze,P as o,fY as Dt,fZ as Ue,bI as yt,aV as F,b1 as Ne,ag as Pe,a as B,v as O,f_ as Oe,f$ as jt,g0 as vt,bc as bt,g1 as We,C as ke,V as Ct,c8 as wt,bE as Te,fW as He,aZ as Ve,G as St,cd as Rt,cf as At,cw as It,bo as Le,g2 as Et,a4 as Pt,bq as kt,bw as Tt,g3 as Lt,g4 as _t,ae as _e,aI as qt}from"./index-BVLp3zZE.js";import{t as de}from"./trim-S-x1Aalq.js";import{d as Ft}from"./Add-CR7sEnVa.js";import{d as $t}from"./ExpandMore-Bqisn1wE.js";import{b as Mt}from"./base32-C6LgLamw.js";import{d as Bt}from"./LockIcon-bI_F9Ild.js";import{E as zt}from"./index-BMvHCK44.js";import{u as Ut}from"./index-DNd8fzbU.js";import{d as Nt}from"./CheckCircle-lvBXN98Q.js";import{d as Ot,p as qe}from"./util-DPoct1K7.js";import{A as ue}from"./Alert-_hy6i2TW.js";import{_ as Z}from"./useSetState-QDNtnZvK.js";import{_ as Wt,D as Fe,w as Ge}from"./permission-CqAtXqqv.js";import{C as K}from"./confirm-B2Vr_bWi.js";import{u as Ht}from"./use-mobile-CNI4WLqG.js";import{d as Vt}from"./InfoOutlined-RlhtSWs3.js";import{r as Gt}from"./index-C7BJOVUl.js";import{_ as Yt}from"./useAsync-C0LxVA9E.js";import"./api-B1moJ8Q-.js";import{I as Zt}from"./index-B2wNV2JZ.js";import{T as Kt}from"./TextField-2xBiC_3q.js";import{L as Qt}from"./LoadingButton-C52xjKpM.js";import{d as Ye,L as Xt,a as Jt}from"./Delete-B08C-mSs.js";import{A as en}from"./actions-Cu3UkuLL.js";var me={},tn=le;Object.defineProperty(me,"__esModule",{value:!0});var Ze=me.default=void 0,nn=tn(ae()),on=e;Ze=me.default=(0,nn.default)((0,on.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const sn=Me({});sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=G("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=mt()),n},n=>Promise.reject(n));const Ke=(...n)=>Me(...n),rn=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,an=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const i=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,l=[`left=${i}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],c=window.open("",r,l.join(","));if(c===null)throw new Error("Failed to open popup");return c.location.href=pt(n,{opener:window.location.origin}),c},ln="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Qe=async n=>{var d;if(!n||!(n!=null&&n.trim()))return null;const t=Ke(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),i=(d=r==null?void 0:r.componentMountPoints)==null?void 0:d.find(f=>f.did===ln),a=new URL(n);a.pathname=i==null?void 0:i.mountPoint;const l=a.toString(),c=G(l,"/api");return{base:l,api:c}},cn=Be({buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),dn=Be({buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),un={zh:dn,en:cn};function Xe({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:i,onSuccess:a,...l}){const{t:c}=k(),[d,f]=Ut({currentState:1}),m=v.useRef(null),D=V(g=>{var p,w,I,C;g.data.type==="didDomain.success"&&(a==null||a({nftDid:(p=g.data)==null?void 0:p.nftDid,domain:(w=g.data)==null?void 0:w.domain,chainHost:(I=g.data)==null?void 0:I.chainHost}),(C=m.current)==null||C.close(),m.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});ht(()=>{var g;try{window.removeEventListener("message",D),(g=m.current)==null||g.close(),m.current=null}catch(p){console.warn("Failed to close popup",p)}});const x=V(()=>{f({currentState:1})}),y=V(()=>{f({currentState:2}),E.run()}),b=V(({sessionId:g,baseURL:p})=>{window.addEventListener("message",D);const w=new URL(p);w.searchParams.set("sessionId",g),w.searchParams.set("locale",r),m.current=an(w.toString());const I=setInterval(()=>{var C;(C=m.current)!=null&&C.closed&&(clearInterval(I),x())},1e3);return()=>clearInterval(I)}),E=xt(async()=>{const g=await Qe(s);if(!g)return null;const p=Ke({baseURL:g.api}),{data:w}=await p.post("/payment/session",{delegatee:n,delegateePk:t});return b({sessionId:w.sessionId,baseURL:g.base})},{manual:!0,debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(g){console.error(g)}});return e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:y,variant:"contained",startIcon:e.jsx(Ot,{}),...l,children:i||c("buy.button.title")}),e.jsxs(gt,{fullWidth:!0,maxWidth:"xs",open:d.currentState>1&&d.currentState<8,onClose:x,children:[!E.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[d.currentState===2&&e.jsx(z,{size:50}),d.currentState===4&&e.jsx(Nt,{sx:{color:"primary.main",fontSize:"5rem"}}),d.currentState===2&&e.jsx(q,{children:c("buy.status.inProgress")}),d.currentState===4&&e.jsx(q,{children:c("buy.status.success")})]}),E.error&&e.jsx(ue,{severity:"error",children:c("buy.error.failedToCreateSession")})]})]})}const Je={onSuccess:()=>{},title:""};Xe.defaultProps=Je;function et(n){return e.jsx(ft,{locale:n.locale,translations:un,children:e.jsx(Xe,{...n})})}et.defaultProps=Je;function mn(){var n=v.useRef(!1),t=v.useCallback(function(){return n.current},[]);return v.useEffect(function(){return n.current=!0,function(){n.current=!1}},[]),t}function pn(n,t,s){t===void 0&&(t=[]),s===void 0&&(s={loading:!1});var r=v.useRef(0),i=mn(),a=v.useState(s),l=a[0],c=a[1],d=v.useCallback(function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];var D=++r.current;return l.loading||c(function(x){return Ee(Ee({},x),{loading:!0})}),n.apply(void 0,f).then(function(x){return i()&&D===r.current&&c({value:x,loading:!1}),x},function(x){return i()&&D===r.current&&c({error:x,loading:!1}),x})},t);return[l,d]}function fn(n,t){t===void 0&&(t=[]);var s=pn(n,t,{loading:!0}),r=s[0],i=s[1];return v.useEffect(function(){i()},[i]),r}function tt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:i}=k(),[a,l]=Z({safeIframeRef:null,popoverAnchorEl:null}),c=v.useRef(null),d=Y(),f=ce(d.breakpoints.down("md")),m=b=>{l({popoverAnchorEl:b.currentTarget})},D=()=>{l({popoverAnchorEl:null})},x=fn(async()=>{const b=await Qe(t);return b?b.base:null});if(!x.value)return null;if(x.loading)return e.jsx(z,{});const y=G(x.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(h,{component:"img",src:G(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:m,sx:rn({cursor:"pointer"},r)}),e.jsx(ze,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:c,title:i("common.subscription"),width:f?"320px":"400px",height:f?"600px":"680px",style:{border:0},src:y})})]})}tt.defaultProps={sx:{}};const hn=n=>["waiting","creating","renewaling"].includes(n);function pe(n){var R,A;const{t}=k(),[s,r]=v.useState(!1),{inService:i}=F(),[a,l]=v.useState(null),{siteId:c,domain:d,onAdd:f,children:m,did:D}=n,[x,y]=v.useState(!1),{api:b,ws:{useSubscription:E}}=F(),{mode:g,actions:{refreshDomainStatus:p}}=Ne(),w=Wt(async()=>{const{cert:S}=await b.findCertificateByDomain({input:{domain:d,did:D}});return S}),I=(S,U)=>{S.domain===d&&(y(!1),r(!1),i&&g!=="setup"&&(U==="success"?O.success(t("setup.domain.genCertSuccess",{domain:S.domain})):U==="error"&&O.error(t("setup.domain.genCertFailed",{domain:S.domain,message:S.message}))))};if(v.useEffect(()=>{var S;w.loading||y(hn((S=w.value)==null?void 0:S.status))},[w.loading,(R=w.value)==null?void 0:R.status]),E(Pe.BlockletEvents.certError,S=>I(S,"error")),E(Pe.BlockletEvents.certIssued,S=>{w.retry(),p(S.domain),I(S,"success")}),w.loading||((A=w.value)==null?void 0:A.status)==="normal")return"";const C=()=>{r(!1),l(null)},T=async()=>{r(!0);try{await b.issueLetsEncryptCert({input:{siteId:c,domain:d,did:D,inBlockletSetup:g==="setup"}}),f(),y(!0)}catch(S){console.error(S),y(!1)}finally{r(!1),l(null)}},u={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ue,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:T,onCancel:C},L=S=>{S.stopPropagation(),l(u)};return e.jsxs(e.Fragment,{children:[x?e.jsx(B,{title:t("router.cert.issuing"),children:e.jsx(z,{size:12})}):m({loading:s,open:L}),a&&e.jsx(K,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}pe.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any};pe.defaultProps={onAdd:()=>{},children:null};function fe(n){const{domain:t,domainStatus:s,...r}=n;return Dt(t)||!Ue(t)||yt(s)||s!=null&&s.isHttps?"":e.jsx(pe,{domain:t,...r})}fe.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any};fe.defaultProps={onAdd:()=>{},children:null};var he={},xn=le;Object.defineProperty(he,"__esModule",{value:!0});var nt=he.default=void 0,gn=xn(ae()),Dn=e;nt=he.default=(0,gn.default)((0,Dn.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5z"}),"CallMerge");const ot=v.createContext({}),{Provider:yn,Consumer:ao}=ot;function jn({children:n}){const[t,s]=Z({domain:"",error:null}),{locale:r}=k(),i={error:t.error,domain:t.domain,setError:a=>{s({error:a})},setDomain:a=>{const l=de(a),c=Oe(l,r);s({domain:l,error:c})}};return e.jsx(yn,{value:{value:i},children:n})}function vn(){const{value:n}=v.useContext(ot);return n}const{joinURL:$e}=jt,bn=vt,st="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Cn=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:s}=await bn.get(t.toString()),r=(c=s==null?void 0:s.componentMountPoints)==null?void 0:c.find(d=>d.did===st),i=new URL(n);i.pathname=r==null?void 0:r.mountPoint;const a=i.toString(),l=$e(a,"/api");return{base:a,api:l,domain:$e(l,"/domains")}};var wn={DID_DOMAIN_SERVICE_DID:st,getDidDomainServiceURL:Cn},Q={exports:{}};const Sn=Gt,Rn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class rt extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const An=(n,t,s)=>{const r=s.retries-(t-1);return n.attemptNumber=t,n.retriesLeft=r,n},In=n=>Rn.includes(n),it=(n,t)=>new Promise((s,r)=>{t={onFailedAttempt:()=>{},retries:10,...t};const i=Sn.operation(t);i.attempt(async a=>{try{s(await n(a))}catch(l){if(!(l instanceof Error)){r(new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`));return}if(l instanceof rt)i.stop(),r(l.originalError);else if(l instanceof TypeError&&!In(l.message))i.stop(),r(l);else{An(l,a,t);try{await t.onFailedAttempt(l)}catch(c){r(c);return}i.retry(l)||r(i.mainError())}}})});Q.exports=it;Q.exports.default=it;Q.exports.AbortError=rt;var En=Q.exports;const Pn=bt(En);function xe({domain:n,resolvedTarget:t,...s}){const{t:r,locale:i}=k();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...s,children:[e.jsxs(h,{display:"flex",children:[r("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),r("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(oe,{label:r("router.domain.setup.recordType"),value:"CNAME",locale:i}),e.jsx(oe,{label:r("router.domain.setup.recordValue"),value:t,locale:i})]})]})}xe.propTypes={domain:o.string,resolvedTarget:o.string.isRequired};xe.defaultProps={domain:""};function oe({locale:n,label:t,value:s}){const r=ce(a=>a.breakpoints.down("md")),i=Y();return e.jsx(Zt,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(q,{component:"span",color:"primary.main",overflow:"auto",sx:r?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:s}),e.jsx(We,{content:s,locale:n,style:{marginLeft:"4px",color:i.palette.text.secondary}})]})})}oe.propTypes={locale:o.string.isRequired,label:o.string.isRequired,value:o.string.isRequired};function ge({siteId:n,teamDid:t,cnameDomain:s,defaultCustomDomain:r,onInputDomain:i,appId:a,appPk:l,onSuccess:c,onError:d,disabled:f,autoFocus:m,inBlockletSetup:D,shouldCheckDomain:x,onStateChange:y,currentIp:b,resolveDomain:E,...g}){const{t:p,locale:w}=k(),{api:I,info:C}=F(),T=vn(),u=Y(),L=Ht({key:"sm"}),[R,A]=Z({submittingDomain:!1,domain:r,error:null,type:C!=null&&C.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),S=Yt(()=>wn.getDidDomainServiceURL(C==null?void 0:C.nftDomainUrl));if(C!=null&&C.nftDomainUrl&&S.loading)return e.jsx(h,{...g,children:e.jsx(ke,{relative:"parent",children:e.jsx(z,{})})});if(S.error)return e.jsx(h,{...g,children:e.jsx(ke,{relative:"parent",children:S.error.message})});const U=S.value,lt=()=>{A({invalidDNSDomain:null})},ee=async j=>{y(p("setup.domain.addingDomain")),await I.addDomainAlias({input:{id:n,domainAlias:j,teamDid:t,inBlockletSetup:!0}}),A({submittingDomain:!1}),c({domain:j,type:"inputDomain"})},Se=async({domain:j,type:P,nftDid:N,chainHost:_})=>{try{if(!x){if(P==="inputDomain"){await ee(j);return}c({domain:j,type:P,nftDid:N,chainHost:_});return}y({text:p("setup.domain.checkingResolvable")});let $=30;const te=3e3,ut=$*1e3/te,Ae=setInterval(()=>{if($<=0){clearInterval(Ae);return}y({text:`${p("setup.domain.checkingResolvable")} (${$--}s)`})},1e3),Ie=await Pn(async()=>{const{data:M}=await E(j);if(!M.address)throw new Error("Cannot resolve domain");return M.address},{retries:ut,minTimeout:te,maxTimeout:te,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Ae),!Ie){const M=p("setup.domain.cannotResolve",{domain:j});if(P==="nftDomain"){O.error(M),c({domain:j,type:"nftDomain"});return}y({text:""}),A({invalidDNSDomain:{domain:j,error:M},domain:j,type:P,submittingDomain:!1});return}if(Ie!==b){const M=p("setup.domain.resolvedAddressError",{domain:j,curDomain:window.location.hostname});if(P==="nftDomain"){O.error(M),c({domain:j,type:"nftDomain"});return}y({text:""}),A({invalidDNSDomain:{domain:j,error:M},domain:j,type:P,submittingDomain:!1});return}if(P==="nftDomain"){c({domain:j,type:"nftDomain"});return}await ee(j)}catch($){O.error($.message),y({text:""}),A({submittingDomain:!1})}},ct=async({domain:j,nftDid:P,chainHost:N})=>{try{const _=qe(j);A({submittingDomain:!0}),await I.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:_,nftDid:P,chainHost:N,teamDid:t,inBlockletSetup:D}});const $="nftDomain";A({showNFTDomainAuth:!1,type:$}),await Se({domain:_,type:$,nftDid:P,chainHost:N})}catch(_){O.error(_.message)}finally{A({showNFTDomainAuth:!1,submittingDomain:!1})}},dt=async()=>{try{A({submittingDomain:!0});const j=qe(R.domain);if(C.nftDomainUrl&&U&&(await I.isDidDomain({input:{domain:j}})).value===!0){A({showNFTDomainAuth:!0});return}await Se({domain:j,type:R.type})}catch(j){A({submittingDomain:!1}),T.setError(j.message)}},Re=T.error||R.error;return e.jsx(h,{...g,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(q,{sx:{color:u.palette.text.primary},children:p("router.domainAlias.add.tips")}),e.jsx(Kt,{sx:{display:"block",marginTop:"8px"},label:p("router.domainAlias.add.domainDescription"),helperText:R.type==="inputDomain"&&Re||p("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:f,value:R.domain,size:"small",variant:"outlined",error:!!Re&&R.type==="inputDomain",onChange:j=>{var _;const P=de((_=j.target)==null?void 0:_.value);T.setDomain(P);const N=Oe(P,w);A({domain:P,error:N,type:"inputDomain"}),i({domain:P,error:N,type:"inputDomain"})},autoFocus:m,onBlur:()=>{T.domain||(A({error:null}),T.setError(null))}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Qt,{"data-cy":"confirm-add-domain",fullWidth:L,variant:"contained",loading:R.submittingDomain,onClick:dt,children:p("common.add")})}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:u.palette.primary.main},onClick:()=>A({showDnsTip:!R.showDnsTip}),children:[e.jsx(Vt,{fontSize:"1em"}),p("router.domainAlias.showTipHint")]}),R.showDnsTip&&e.jsx(xe,{domain:R.domain,resolvedTarget:s,style:{marginTop:"4px"}})]}),R.invalidDNSDomain&&e.jsx(K,{title:p("common.reminder"),description:p("setup.domain.invalidDNSReminder",{error:R.invalidDNSDomain.error}),color:"primary",confirm:p("setup.domain.continueAdd"),onConfirm:()=>ee(R.invalidDNSDomain.domain,R.type),onCancel:lt}),U&&e.jsx(Ct,{open:R.showNFTDomainAuth,popup:!0,useSocket:!1,forceConnected:!1,action:"authorize",baseUrl:U.api,checkFn:wt.create({baseURL:U.api}).get,extraParams:{delegatee:a,delegateePk:l,domain:R.domain},onSuccess:ct,onClose:()=>A({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:p("router.domainAlias.addDomainNFT.connect.title"),scan:p("router.domainAlias.addDomainNFT.connect.scan"),confirm:p("router.domainAlias.addDomainNFT.connect.confirm"),success:p("router.domainAlias.addDomainNFT.connect.success")}})]})})}ge.propTypes={siteId:o.string.isRequired,currentIp:o.string,teamDid:o.string.isRequired,cnameDomain:o.string.isRequired,defaultCustomDomain:o.string,onInputDomain:o.func,onSuccess:o.func,appId:o.string,appPk:o.string,disabled:o.bool,autoFocus:o.bool,inBlockletSetup:o.bool,shouldCheckDomain:o.bool,onStateChange:o.func,resolveDomain:o.func,onError:o.func};ge.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Te,onSuccess:Te,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function De({id:n,children:t,title:s,teamDid:r,systemDomains:i,appId:a,appPk:l}){const{t:c}=k(),[d,f]=Z({loading:!1,confirmSetting:null}),m=i.find(b=>He.isDidDomain(b)),D=()=>{f({loading:!1,confirmSetting:null})},x={title:s||c("router.domainAlias.add.title"),description:function(E,g,p){return e.jsx(ge,{siteId:n,teamDid:r,cnameDomain:m,onSuccess:()=>f({confirmSetting:null}),onInputDomain:({domain:w,type:I,error:C})=>{g({...E,domain:w,type:I,__disableConfirm:!!C}),p(C)},appId:a,appPk:l})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:D},y=b=>{b.stopPropagation(),f({confirmSetting:x})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:d.loading,open:y}):e.jsxs(Ve,{onClick:y,className:"rule-action","data-cy":"action-add-domain-alias",children:[d.loading?e.jsx(z,{size:16}):e.jsx(nt,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),d.confirmSetting&&e.jsx(K,{title:d.confirmSetting.title,description:d.confirmSetting.description,confirm:d.confirmSetting.confirm,cancel:d.confirmSetting.cancel,params:d.confirmSetting.params,onCancel:d.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:d.loading,maxWidth:"sm"})]})}De.propTypes={id:o.string.isRequired,children:o.any,title:o.string,teamDid:o.string,systemDomains:o.arrayOf(o.string).isRequired,appId:o.string,appPk:o.string.isRequired};De.defaultProps={children:null,title:"",teamDid:"",appId:null};function kn(n){return e.jsx(jn,{children:e.jsx(De,{...n})})}function ye({appId:n,appPk:t,siteId:s,inBlockletSetup:r,teamDid:i,sx:a,...l}){const{api:c,info:d}=F(),{locale:f,t:m}=k(),D=async({domain:x,nftDid:y,chainHost:b})=>{await c.addDomainAlias({input:{id:s,type:"nft-domain",domainAlias:x,nftDid:y,chainHost:b,teamDid:i,inBlockletSetup:r}})};return e.jsx(et,{delegatee:n,delegateePk:t,didDomainURL:d.nftDomainUrl,onSuccess:D,locale:f,variant:"outlined",sx:a,title:m("router.domainAlias.addDomainNFT.buy"),...l})}ye.propTypes={appId:o.string.isRequired,appPk:o.string.isRequired,siteId:o.string.isRequired,inBlockletSetup:o.bool.isRequired,teamDid:o.string.isRequired,sx:o.object};ye.defaultProps={sx:{}};function je(n){const{t}=k(),[s,r]=v.useState(!1),[i,a]=v.useState(null),{id:l,domain:c,children:d,teamDid:f}=n,{api:m}=F(),D=()=>{r(!1),a(null)},x=async()=>{r(!0);try{await m.deleteDomainAlias({input:{id:l,domainAlias:c,teamDid:f}}),await St(2e3)}catch(E){O.error(E.message)}finally{a(null),r(!1)}},y={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:x,onCancel:D},b=E=>{E.stopPropagation(),a(y)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:s,open:b}):e.jsxs(W,{edge:"end",onClick:b,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(z,{size:16}):e.jsx(Ye,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),i&&e.jsx(K,{title:i.title,description:i.description,confirm:i.confirm,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}je.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string};je.defaultProps={children:null,teamDid:""};function ve({site:n,domain:t,blocklet:s}){const{t:r}=k(),i=t.value===window.location.hostname;return e.jsx(en,{"data-cy":"domain-actions",size:"large",actions:[({close:a})=>{var l;return e.jsx(je,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,children:({open:c})=>e.jsx(B,{title:i?r("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ve,{disabled:t.isProtected||i,dense:!0,onClick:d=>{a(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Xt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ye,{})}),e.jsx(Jt,{primary:r("common.delete")})]},"remove")})})})}]})}ve.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired};ve.defaultProps={};var be={},Tn=le;Object.defineProperty(be,"__esModule",{value:!0});var Ce=be.default=void 0,Ln=Tn(ae()),_n=e;Ce=be.default=(0,Ln.default)((0,_n.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Https");const X=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function we({certificate:n}){const[t,s]=v.useState(null),r=F(),{t:i,locale:a}=k(),l=f=>{s(f.currentTarget)},c=()=>{s(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(ze,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(Rt,{children:e.jsxs(At,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(q,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(q,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(q,{component:"div",children:`${i("common.issuer")}: ${It(n,"issuer.commonName","")}`}),e.jsx(q,{component:"div",children:`${i("router.cert.issuedOn")}: ${Le(n.validFrom,a)}`}),e.jsx(q,{component:"div",children:`${i("router.cert.expiryOn")}: ${Le(n.validTo,a)}`})]})]})})})]})}we.propTypes={certificate:o.object};we.defaultProps={certificate:{}};function H({domain:n,filters:t}){const{t:s}=k(),{value:r,domainStatus:i}=n;if(!Ue(r))return null;let a=null,l=null;const{isHttps:c,matchedCert:d}=i;if(!Et(r)){const{dns:{resolved:m,ip:D}={}}=i;m||D==="127.0.0.1"?a=e.jsx(B,{title:s("router.domain.verify.ok"),children:e.jsx(Fe,{color:"success"})}):a=e.jsx(B,{title:s("router.domain.verify.notResolved"),children:e.jsx(Fe,{color:"error"})})}c?l=e.jsx(we,{certificate:d}):l=e.jsx(B,{title:s("router.domain.https.bad"),children:e.jsx(Ce,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const f=t.map(m=>m==="domain"?a:m==="http"?l:null);return v.createElement(v.Fragment,null,...f)}H.propTypes={domain:X.isRequired,filters:o.array};H.defaultProps={filters:["domain","http"]};const qn=Ge(J,"mutate_blocklets"),Fn=Ge(J,"",kt);function at(n){const{inService:t}=F(),{blocklet:s,loadingRuntimeInfo:r}=Ne();let i=qn;return t&&(i=Fn),e.jsx(i,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}at.propTypes={listOnly:o.bool};at.defaultProps={listOnly:!1};function J({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,listOnly:i}){var w,I,C,T;const{t:a}=k(),{info:l}=F(),[c,d]=v.useState(!1),f=ce(u=>u.breakpoints.down("md")),m=v.useMemo(()=>{let u=n;return Tt(t)&&(u=u&&r),u},[n,r,t]),{site:D}=t,x=v.useMemo(()=>{var u;return Lt((u=t.site)==null?void 0:u.domainAliases)},[(w=t.site)==null?void 0:w.domainAliases]),y=[],b=[],E=Mt.encode(t.appPid),g=(C=(I=t.environments)==null?void 0:I.find(u=>u.key==="BLOCKLET_APP_PK"))==null?void 0:C.value,p=_t(x);return x.forEach(u=>{const L=u.value||"";He.isDidDomain(L)&&!L.startsWith(E)?b.push(u):y.push(u)}),e.jsxs(e.Fragment,{children:[!i&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:a("common.domain")}),m&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(kn,{id:D.id,title:a("router.domain.add.title"),teamDid:(T=t.meta)==null?void 0:T.did,appId:t.appPid,appPk:g,systemDomains:p==null?void 0:p.map(u=>u.value),children:({open:u})=>e.jsxs(W,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:u,disabled:_e.isInProgress(t.status),children:[e.jsx(Ft,{style:{fontSize:"1.3em",marginRight:4}}),a("common.add")]})}),l.nftDomainUrl&&e.jsx(ye,{variant:"outlined",appId:t.appPid,appPk:g,siteId:D.id,inBlockletSetup:!1,teamDid:t.meta.did})]})]}),_e.isAccessible(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(ue,{severity:"warning",children:a("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(c?x:y).map(u=>{var R,A;const L=u.value;return e.jsxs(v.Fragment,{children:[f&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(se,{domain:u,target:"_blank",children:u.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(H,{domain:u,filters:["domain"]},`${u.value}-domain`),e.jsx(ie,{siteId:(R=t.site)==null?void 0:R.id,domain:u,blocklet:t,hasMutatePermission:m})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:m,site:D,domain:u,blocklet:t})})]})]},L),!f&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(H,{domain:u,filters:["domain"]},`${u.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(se,{domain:u,target:"_blank",children:u.value})}),e.jsx(ie,{siteId:(A=t.site)==null?void 0:A.id,domain:u,blocklet:t,hasMutatePermission:m})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:m,site:D,domain:u,blocklet:t})})]},L)]},L)})}),b.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(W,{endIcon:c?e.jsx(Ze,{}):e.jsx($t,{}),onClick:()=>d(!c),children:a(c?"common.collapseAll":"blocklet.router.showAllDomains")})}),!x.length&&(s?e.jsx(z,{size:16}):e.jsx(zt,{children:a("common.empty")}))]})}J.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,listOnly:o.bool};J.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function se({domain:n,children:t,...s}){const{t:r,locale:i}=k(),{href:a,accessibility:l,value:c}=n,d=v.useCallback(()=>e.jsx(We,{content:de(c),locale:i,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}),[c,i]);return!l||l.loading?e.jsxs(ne,{...s,children:[t,d(),e.jsx(B,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(z,{size:12})})})]}):l.accessible?e.jsxs(ne,{...s,children:[e.jsx(h,{component:"a",href:a,target:"_blank",rel:"noopener noreferrer",children:t}),d()]}):e.jsxs(ne,{...s,children:[e.jsx(B,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})}),d()]})}se.propTypes={domain:X.isRequired,children:o.any.isRequired};const ne=Pt.span`
1
+ import{a2 as ae,a3 as le,j as e,eL as Me,c as G,fY as mt,w as pt,aE as Be,aG as ft,u as k,r as v,l as V,c6 as ht,Y as xt,a7 as W,aA as gt,B as h,n as z,T as q,cD as Pe,ap as Y,a5 as ce,bl as ze,P as o,fZ as Dt,f_ as Ue,bD as yt,aT as F,a$ as Ne,ag as Ee,a as B,v as O,f$ as Oe,g0 as jt,g1 as vt,ba as bt,g2 as We,C as ke,V as Ct,c5 as wt,bC as Te,fX as He,aX as Ve,G as St,ca as Rt,cc as At,cu as It,bm as Le,g3 as Pt,a4 as Et,bo as kt,bu as Tt,g4 as Lt,g5 as _t,ae as _e,aI as qt}from"./index-QlD_x8dd.js";import{t as de}from"./trim-nU6YcUSy.js";import{d as Ft}from"./Add-D5zbmaC5.js";import{d as $t}from"./ExpandMore-D5Ex5uDB.js";import{b as Mt}from"./base32-CL5BH6_g.js";import{d as Bt}from"./LockIcon-C599BLMv.js";import{E as zt}from"./index-DTtollfx.js";import{u as Ut}from"./index-CbgjiFh9.js";import{d as Nt}from"./CheckCircle-CftBFr7p.js";import{d as Ot,p as qe}from"./util-BEOA1BUn.js";import{A as ue}from"./Alert-Ca5BIvJG.js";import{_ as X}from"./useSetState-hsLjpFyi.js";import{_ as Wt,D as Fe,w as Ge}from"./permission-W_8zaBQA.js";import{C as Z}from"./confirm-SG-ap-ws.js";import{u as Ht}from"./use-mobile-3X9WMgwY.js";import{d as Vt}from"./InfoOutlined-BW-k42mL.js";import{r as Gt}from"./index-zdiKVNp6.js";import{_ as Yt}from"./useAsync-DcES_cPw.js";import"./api-DGjzM9of.js";import{I as Xt}from"./index-GFWH_arm.js";import{T as Zt}from"./TextField-BglN0hgt.js";import{L as Kt}from"./LoadingButton-nSVrtGvg.js";import{d as Ye,L as Qt,a as Jt}from"./Delete-BEI9Sgjm.js";import{A as en}from"./actions-CXQg_2R4.js";var me={},tn=le;Object.defineProperty(me,"__esModule",{value:!0});var Xe=me.default=void 0,nn=tn(ae()),on=e;Xe=me.default=(0,nn.default)((0,on.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const sn=Me({});sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=G("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=mt()),n},n=>Promise.reject(n));const Ze=(...n)=>Me(...n),rn=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,an=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const i=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,l=[`left=${i}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],c=window.open("",r,l.join(","));if(c===null)throw new Error("Failed to open popup");return c.location.href=pt(n,{opener:window.location.origin}),c},ln="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Ke=async n=>{var d;if(!n||!(n!=null&&n.trim()))return null;const t=Ze(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),i=(d=r==null?void 0:r.componentMountPoints)==null?void 0:d.find(f=>f.did===ln),a=new URL(n);a.pathname=i==null?void 0:i.mountPoint;const l=a.toString(),c=G(l,"/api");return{base:l,api:c}},cn=Be({buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),dn=Be({buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),un={zh:dn,en:cn};function Qe({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:i,onSuccess:a,...l}){const{t:c}=k(),[d,f]=Ut({currentState:1}),m=v.useRef(null),D=V(g=>{var p,w,I,C;g.data.type==="didDomain.success"&&(a==null||a({nftDid:(p=g.data)==null?void 0:p.nftDid,domain:(w=g.data)==null?void 0:w.domain,chainHost:(I=g.data)==null?void 0:I.chainHost}),(C=m.current)==null||C.close(),m.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});ht(()=>{var g;try{window.removeEventListener("message",D),(g=m.current)==null||g.close(),m.current=null}catch(p){console.warn("Failed to close popup",p)}});const x=V(()=>{f({currentState:1})}),y=V(()=>{f({currentState:2}),P.run()}),b=V(({sessionId:g,baseURL:p})=>{window.addEventListener("message",D);const w=new URL(p);w.searchParams.set("sessionId",g),w.searchParams.set("locale",r),m.current=an(w.toString());const I=setInterval(()=>{var C;(C=m.current)!=null&&C.closed&&(clearInterval(I),x())},1e3);return()=>clearInterval(I)}),P=xt(async()=>{const g=await Ke(s);if(!g)return null;const p=Ze({baseURL:g.api}),{data:w}=await p.post("/payment/session",{delegatee:n,delegateePk:t});return b({sessionId:w.sessionId,baseURL:g.base})},{manual:!0,debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(g){console.error(g)}});return e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:y,variant:"contained",startIcon:e.jsx(Ot,{}),...l,children:i||c("buy.button.title")}),e.jsxs(gt,{fullWidth:!0,maxWidth:"xs",open:d.currentState>1&&d.currentState<8,onClose:x,children:[!P.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[d.currentState===2&&e.jsx(z,{size:50}),d.currentState===4&&e.jsx(Nt,{sx:{color:"primary.main",fontSize:"5rem"}}),d.currentState===2&&e.jsx(q,{children:c("buy.status.inProgress")}),d.currentState===4&&e.jsx(q,{children:c("buy.status.success")})]}),P.error&&e.jsx(ue,{severity:"error",children:c("buy.error.failedToCreateSession")})]})]})}const Je={onSuccess:()=>{},title:""};Qe.defaultProps=Je;function et(n){return e.jsx(ft,{locale:n.locale,translations:un,children:e.jsx(Qe,{...n})})}et.defaultProps=Je;function mn(){var n=v.useRef(!1),t=v.useCallback(function(){return n.current},[]);return v.useEffect(function(){return n.current=!0,function(){n.current=!1}},[]),t}function pn(n,t,s){t===void 0&&(t=[]),s===void 0&&(s={loading:!1});var r=v.useRef(0),i=mn(),a=v.useState(s),l=a[0],c=a[1],d=v.useCallback(function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];var D=++r.current;return l.loading||c(function(x){return Pe(Pe({},x),{loading:!0})}),n.apply(void 0,f).then(function(x){return i()&&D===r.current&&c({value:x,loading:!1}),x},function(x){return i()&&D===r.current&&c({error:x,loading:!1}),x})},t);return[l,d]}function fn(n,t){t===void 0&&(t=[]);var s=pn(n,t,{loading:!0}),r=s[0],i=s[1];return v.useEffect(function(){i()},[i]),r}function tt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:i}=k(),[a,l]=X({safeIframeRef:null,popoverAnchorEl:null}),c=v.useRef(null),d=Y(),f=ce(d.breakpoints.down("md")),m=b=>{l({popoverAnchorEl:b.currentTarget})},D=()=>{l({popoverAnchorEl:null})},x=fn(async()=>{const b=await Ke(t);return b?b.base:null});if(!x.value)return null;if(x.loading)return e.jsx(z,{});const y=G(x.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(h,{component:"img",src:G(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:m,sx:rn({cursor:"pointer"},r)}),e.jsx(ze,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:c,title:i("common.subscription"),width:f?"320px":"400px",height:f?"600px":"680px",style:{border:0},src:y})})]})}tt.defaultProps={sx:{}};const hn=n=>["waiting","creating","renewaling"].includes(n);function pe(n){var R,A;const{t}=k(),[s,r]=v.useState(!1),{inService:i}=F(),[a,l]=v.useState(null),{siteId:c,domain:d,onAdd:f,children:m,did:D}=n,[x,y]=v.useState(!1),{api:b,ws:{useSubscription:P}}=F(),{mode:g,actions:{refreshDomainStatus:p}}=Ne(),w=Wt(async()=>{const{cert:S}=await b.findCertificateByDomain({input:{domain:d,did:D}});return S}),I=(S,U)=>{S.domain===d&&(y(!1),r(!1),i&&g!=="setup"&&(U==="success"?O.success(t("setup.domain.genCertSuccess",{domain:S.domain})):U==="error"&&O.error(t("setup.domain.genCertFailed",{domain:S.domain,message:S.message}))))};if(v.useEffect(()=>{var S;w.loading||y(hn((S=w.value)==null?void 0:S.status))},[w.loading,(R=w.value)==null?void 0:R.status]),P(Ee.BlockletEvents.certError,S=>I(S,"error")),P(Ee.BlockletEvents.certIssued,S=>{w.retry(),p(S.domain),I(S,"success")}),w.loading||((A=w.value)==null?void 0:A.status)==="normal")return"";const C=()=>{r(!1),l(null)},T=async()=>{r(!0);try{await b.issueLetsEncryptCert({input:{siteId:c,domain:d,did:D,inBlockletSetup:g==="setup"}}),f(),y(!0)}catch(S){console.error(S),y(!1)}finally{r(!1),l(null)}},u={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ue,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:T,onCancel:C},L=S=>{S.stopPropagation(),l(u)};return e.jsxs(e.Fragment,{children:[x?e.jsx(B,{title:t("router.cert.issuing"),children:e.jsx(z,{size:12})}):m({loading:s,open:L}),a&&e.jsx(Z,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}pe.propTypes={domain:o.string.isRequired,did:o.string.isRequired,siteId:o.string.isRequired,onAdd:o.func,children:o.any};pe.defaultProps={onAdd:()=>{},children:null};function fe(n){const{domain:t,domainStatus:s,...r}=n;return Dt(t)||!Ue(t)||yt(s)||s!=null&&s.isHttps?"":e.jsx(pe,{domain:t,...r})}fe.propTypes={domain:o.string.isRequired,domainStatus:o.shape({isHttps:o.bool}).isRequired,did:o.string.isRequired,onAdd:o.func,children:o.any};fe.defaultProps={onAdd:()=>{},children:null};var he={},xn=le;Object.defineProperty(he,"__esModule",{value:!0});var nt=he.default=void 0,gn=xn(ae()),Dn=e;nt=he.default=(0,gn.default)((0,Dn.jsx)("path",{d:"M17 20.41 18.41 19 15 15.59 13.59 17zM7.5 8H11v5.59L5.59 19 7 20.41l6-6V8h3.5L12 3.5z"}),"CallMerge");const ot=v.createContext({}),{Provider:yn,Consumer:ao}=ot;function jn({children:n}){const[t,s]=X({domain:"",error:null}),{locale:r}=k(),i={error:t.error,domain:t.domain,setError:a=>{s({error:a})},setDomain:a=>{const l=de(a),c=Oe(l,r);s({domain:l,error:c})}};return e.jsx(yn,{value:{value:i},children:n})}function vn(){const{value:n}=v.useContext(ot);return n}const{joinURL:$e}=jt,bn=vt,st="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Cn=async n=>{var c;if(!n||!(n!=null&&n.trim()))return null;const t=new URL(n);t.pathname="__blocklet__.js",t.searchParams.set("type","json");const{data:s}=await bn.get(t.toString()),r=(c=s==null?void 0:s.componentMountPoints)==null?void 0:c.find(d=>d.did===st),i=new URL(n);i.pathname=r==null?void 0:r.mountPoint;const a=i.toString(),l=$e(a,"/api");return{base:a,api:l,domain:$e(l,"/domains")}};var wn={DID_DOMAIN_SERVICE_DID:st,getDidDomainServiceURL:Cn},K={exports:{}};const Sn=Gt,Rn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class rt extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}const An=(n,t,s)=>{const r=s.retries-(t-1);return n.attemptNumber=t,n.retriesLeft=r,n},In=n=>Rn.includes(n),it=(n,t)=>new Promise((s,r)=>{t={onFailedAttempt:()=>{},retries:10,...t};const i=Sn.operation(t);i.attempt(async a=>{try{s(await n(a))}catch(l){if(!(l instanceof Error)){r(new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`));return}if(l instanceof rt)i.stop(),r(l.originalError);else if(l instanceof TypeError&&!In(l.message))i.stop(),r(l);else{An(l,a,t);try{await t.onFailedAttempt(l)}catch(c){r(c);return}i.retry(l)||r(i.mainError())}}})});K.exports=it;K.exports.default=it;K.exports.AbortError=rt;var Pn=K.exports;const En=bt(Pn);function xe({domain:n,resolvedTarget:t,...s}){const{t:r,locale:i}=k();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...s,children:[e.jsxs(h,{display:"flex",children:[r("router.domain.setup.tipStart"),n&&e.jsx(h,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),r("router.domain.setup.tipEnd"),":"]}),e.jsxs(h,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[e.jsx(oe,{label:r("router.domain.setup.recordType"),value:"CNAME",locale:i}),e.jsx(oe,{label:r("router.domain.setup.recordValue"),value:t,locale:i})]})]})}xe.propTypes={domain:o.string,resolvedTarget:o.string.isRequired};xe.defaultProps={domain:""};function oe({locale:n,label:t,value:s}){const r=ce(a=>a.breakpoints.down("md")),i=Y();return e.jsx(Xt,{name:t,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(q,{component:"span",color:"primary.main",overflow:"auto",sx:r?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"},children:s}),e.jsx(We,{content:s,locale:n,style:{marginLeft:"4px",color:i.palette.text.secondary}})]})})}oe.propTypes={locale:o.string.isRequired,label:o.string.isRequired,value:o.string.isRequired};function ge({siteId:n,teamDid:t,cnameDomain:s,defaultCustomDomain:r,onInputDomain:i,appId:a,appPk:l,onSuccess:c,onError:d,disabled:f,autoFocus:m,inBlockletSetup:D,shouldCheckDomain:x,onStateChange:y,currentIp:b,resolveDomain:P,...g}){const{t:p,locale:w}=k(),{api:I,info:C}=F(),T=vn(),u=Y(),L=Ht({key:"sm"}),[R,A]=X({submittingDomain:!1,domain:r,error:null,type:C!=null&&C.nftDomainUrl?"nftDomain":"inputDomain",showNFTDomainAuth:!1,showDnsTip:!1}),S=Yt(()=>wn.getDidDomainServiceURL(C==null?void 0:C.nftDomainUrl));if(C!=null&&C.nftDomainUrl&&S.loading)return e.jsx(h,{...g,children:e.jsx(ke,{relative:"parent",children:e.jsx(z,{})})});if(S.error)return e.jsx(h,{...g,children:e.jsx(ke,{relative:"parent",children:S.error.message})});const U=S.value,lt=()=>{A({invalidDNSDomain:null})},ee=async j=>{y(p("setup.domain.addingDomain")),await I.addDomainAlias({input:{id:n,domainAlias:j,teamDid:t,inBlockletSetup:!0}}),A({submittingDomain:!1}),c({domain:j,type:"inputDomain"})},Se=async({domain:j,type:E,nftDid:N,chainHost:_})=>{try{if(!x){if(E==="inputDomain"){await ee(j);return}c({domain:j,type:E,nftDid:N,chainHost:_});return}y({text:p("setup.domain.checkingResolvable")});let $=30;const te=3e3,ut=$*1e3/te,Ae=setInterval(()=>{if($<=0){clearInterval(Ae);return}y({text:`${p("setup.domain.checkingResolvable")} (${$--}s)`})},1e3),Ie=await En(async()=>{const{data:M}=await P(j);if(!M.address)throw new Error("Cannot resolve domain");return M.address},{retries:ut,minTimeout:te,maxTimeout:te,onFailedAttempt:console.error}).catch(console.error);if(clearInterval(Ae),!Ie){const M=p("setup.domain.cannotResolve",{domain:j});if(E==="nftDomain"){O.error(M),c({domain:j,type:"nftDomain"});return}y({text:""}),A({invalidDNSDomain:{domain:j,error:M},domain:j,type:E,submittingDomain:!1});return}if(Ie!==b){const M=p("setup.domain.resolvedAddressError",{domain:j,curDomain:window.location.hostname});if(E==="nftDomain"){O.error(M),c({domain:j,type:"nftDomain"});return}y({text:""}),A({invalidDNSDomain:{domain:j,error:M},domain:j,type:E,submittingDomain:!1});return}if(E==="nftDomain"){c({domain:j,type:"nftDomain"});return}await ee(j)}catch($){O.error($.message),y({text:""}),A({submittingDomain:!1})}},ct=async({domain:j,nftDid:E,chainHost:N})=>{try{const _=qe(j);A({submittingDomain:!0}),await I.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:_,nftDid:E,chainHost:N,teamDid:t,inBlockletSetup:D}});const $="nftDomain";A({showNFTDomainAuth:!1,type:$}),await Se({domain:_,type:$,nftDid:E,chainHost:N})}catch(_){O.error(_.message)}finally{A({showNFTDomainAuth:!1,submittingDomain:!1})}},dt=async()=>{try{A({submittingDomain:!0});const j=qe(R.domain);if(C.nftDomainUrl&&U&&(await I.isDidDomain({input:{domain:j}})).value===!0){A({showNFTDomainAuth:!0});return}await Se({domain:j,type:R.type})}catch(j){A({submittingDomain:!1}),T.setError(j.message)}},Re=T.error||R.error;return e.jsx(h,{...g,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(q,{sx:{color:u.palette.text.primary},children:p("router.domainAlias.add.tips")}),e.jsx(Zt,{sx:{display:"block",marginTop:"8px"},label:p("router.domainAlias.add.domainDescription"),helperText:R.type==="inputDomain"&&Re||p("router.domainAlias.add.helperText"),inputProps:{"data-cy":"domain-name-input"},fullWidth:!0,disabled:f,value:R.domain,size:"small",variant:"outlined",error:!!Re&&R.type==="inputDomain",onChange:j=>{var _;const E=de((_=j.target)==null?void 0:_.value);T.setDomain(E);const N=Oe(E,w);A({domain:E,error:N,type:"inputDomain"}),i({domain:E,error:N,type:"inputDomain"})},autoFocus:m,onBlur:()=>{T.domain||(A({error:null}),T.setError(null))}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Kt,{"data-cy":"confirm-add-domain",fullWidth:L,variant:"contained",loading:R.submittingDomain,onClick:dt,children:p("common.add")})}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:u.palette.primary.main},onClick:()=>A({showDnsTip:!R.showDnsTip}),children:[e.jsx(Vt,{fontSize:"1em"}),p("router.domainAlias.showTipHint")]}),R.showDnsTip&&e.jsx(xe,{domain:R.domain,resolvedTarget:s,style:{marginTop:"4px"}})]}),R.invalidDNSDomain&&e.jsx(Z,{title:p("common.reminder"),description:p("setup.domain.invalidDNSReminder",{error:R.invalidDNSDomain.error}),color:"primary",confirm:p("setup.domain.continueAdd"),onConfirm:()=>ee(R.invalidDNSDomain.domain,R.type),onCancel:lt}),U&&e.jsx(Ct,{open:R.showNFTDomainAuth,popup:!0,useSocket:!1,forceConnected:!1,action:"authorize",baseUrl:U.api,checkFn:wt.create({baseURL:U.api}).get,extraParams:{delegatee:a,delegateePk:l,domain:R.domain},onSuccess:ct,onClose:()=>A({showNFTDomainAuth:!1,submittingDomain:!1}),checkTimeout:60*5e3,showDownload:!1,messages:{title:p("router.domainAlias.addDomainNFT.connect.title"),scan:p("router.domainAlias.addDomainNFT.connect.scan"),confirm:p("router.domainAlias.addDomainNFT.connect.confirm"),success:p("router.domainAlias.addDomainNFT.connect.success")}})]})})}ge.propTypes={siteId:o.string.isRequired,currentIp:o.string,teamDid:o.string.isRequired,cnameDomain:o.string.isRequired,defaultCustomDomain:o.string,onInputDomain:o.func,onSuccess:o.func,appId:o.string,appPk:o.string,disabled:o.bool,autoFocus:o.bool,inBlockletSetup:o.bool,shouldCheckDomain:o.bool,onStateChange:o.func,resolveDomain:o.func,onError:o.func};ge.defaultProps={defaultCustomDomain:"",currentIp:"",onInputDomain:Te,onSuccess:Te,appId:"",appPk:"",disabled:!1,autoFocus:!0,inBlockletSetup:!1,shouldCheckDomain:!1,onStateChange:()=>{},resolveDomain:()=>{},onError:()=>{}};function De({id:n,children:t,title:s,teamDid:r,systemDomains:i,appId:a,appPk:l}){const{t:c}=k(),[d,f]=X({loading:!1,confirmSetting:null}),m=i.find(b=>He.isDidDomain(b)),D=()=>{f({loading:!1,confirmSetting:null})},x={title:s||c("router.domainAlias.add.title"),description:function(P,g,p){return e.jsx(ge,{siteId:n,teamDid:r,cnameDomain:m,onSuccess:()=>f({confirmSetting:null}),onInputDomain:({domain:w,type:I,error:C})=>{g({...P,domain:w,type:I,__disableConfirm:!!C}),p(C)},appId:a,appPk:l})},confirm:c("common.confirm"),cancel:c("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:D},y=b=>{b.stopPropagation(),f({confirmSetting:x})};return e.jsxs(e.Fragment,{children:[typeof t=="function"?t({loading:d.loading,open:y}):e.jsxs(Ve,{onClick:y,className:"rule-action","data-cy":"action-add-domain-alias",children:[d.loading?e.jsx(z,{size:16}):e.jsx(nt,{style:{fontSize:18,marginRight:5}}),c("router.domainAlias.add.title")]}),d.confirmSetting&&e.jsx(Z,{title:d.confirmSetting.title,description:d.confirmSetting.description,confirm:d.confirmSetting.confirm,cancel:d.confirmSetting.cancel,params:d.confirmSetting.params,onCancel:d.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:d.loading,maxWidth:"sm"})]})}De.propTypes={id:o.string.isRequired,children:o.any,title:o.string,teamDid:o.string,systemDomains:o.arrayOf(o.string).isRequired,appId:o.string,appPk:o.string.isRequired};De.defaultProps={children:null,title:"",teamDid:"",appId:null};function kn(n){return e.jsx(jn,{children:e.jsx(De,{...n})})}function ye({appId:n,appPk:t,siteId:s,inBlockletSetup:r,teamDid:i,sx:a,...l}){const{api:c,info:d}=F(),{locale:f,t:m}=k(),D=async({domain:x,nftDid:y,chainHost:b})=>{await c.addDomainAlias({input:{id:s,type:"nft-domain",domainAlias:x,nftDid:y,chainHost:b,teamDid:i,inBlockletSetup:r}})};return e.jsx(et,{delegatee:n,delegateePk:t,didDomainURL:d.nftDomainUrl,onSuccess:D,locale:f,variant:"outlined",sx:a,title:m("router.domainAlias.addDomainNFT.buy"),...l})}ye.propTypes={appId:o.string.isRequired,appPk:o.string.isRequired,siteId:o.string.isRequired,inBlockletSetup:o.bool.isRequired,teamDid:o.string.isRequired,sx:o.object};ye.defaultProps={sx:{}};function je(n){const{t}=k(),[s,r]=v.useState(!1),[i,a]=v.useState(null),{id:l,domain:c,children:d,teamDid:f}=n,{api:m}=F(),D=()=>{r(!1),a(null)},x=async()=>{r(!0);try{await m.deleteDomainAlias({input:{id:l,domainAlias:c,teamDid:f}}),await St(2e3)}catch(P){O.error(P.message)}finally{a(null),r(!1)}},y={title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description"),confirm:t("common.confirm"),onConfirm:x,onCancel:D},b=P=>{P.stopPropagation(),a(y)};return e.jsxs(e.Fragment,{children:[typeof d=="function"?d({loading:s,open:b}):e.jsxs(W,{edge:"end",onClick:b,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(z,{size:16}):e.jsx(Ye,{style:{fontSize:16}}),t("router.domainAlias.delete.title")]}),i&&e.jsx(Z,{title:i.title,description:i.description,confirm:i.confirm,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}je.propTypes={id:o.string.isRequired,domain:o.string.isRequired,children:o.any,teamDid:o.string};je.defaultProps={children:null,teamDid:""};function ve({site:n,domain:t,blocklet:s}){const{t:r}=k(),i=t.value===window.location.hostname;return e.jsx(en,{"data-cy":"domain-actions",size:"large",actions:[({close:a})=>{var l;return e.jsx(je,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,children:({open:c})=>e.jsx(B,{title:i?r("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ve,{disabled:t.isProtected||i,dense:!0,onClick:d=>{a(),c(d)},"data-cy":"action-toggle-block",children:[e.jsx(Qt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ye,{})}),e.jsx(Jt,{primary:r("common.delete")})]},"remove")})})})}]})}ve.propTypes={site:o.object.isRequired,domain:o.object.isRequired,blocklet:o.object.isRequired};ve.defaultProps={};var be={},Tn=le;Object.defineProperty(be,"__esModule",{value:!0});var Ce=be.default=void 0,Ln=Tn(ae()),_n=e;Ce=be.default=(0,Ln.default)((0,_n.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Https");const Q=o.shape({href:o.string,accessibility:o.shape({loading:o.bool,accessible:o.bool}),domainStatus:o.shape({isHttps:o.bool,matchedCert:o.object}),dns:o.shape({resolved:o.bool,ip:o.string})});function we({certificate:n}){const[t,s]=v.useState(null),r=F(),{t:i,locale:a}=k(),l=f=>{s(f.currentTarget)},c=()=>{s(null)},d=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{"aria-owns":d?"mouse-over-popover":void 0,onMouseEnter:l,onMouseLeave:c,style:{color:"#44cdc6",fontSize:20,cursor:"pointer"}}),e.jsx(ze,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:d,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:c,disableRestoreFocus:!0,children:e.jsx(Rt,{children:e.jsxs(At,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${r.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(q,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(q,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(q,{component:"div",children:`${i("common.issuer")}: ${It(n,"issuer.commonName","")}`}),e.jsx(q,{component:"div",children:`${i("router.cert.issuedOn")}: ${Le(n.validFrom,a)}`}),e.jsx(q,{component:"div",children:`${i("router.cert.expiryOn")}: ${Le(n.validTo,a)}`})]})]})})})]})}we.propTypes={certificate:o.object};we.defaultProps={certificate:{}};function H({domain:n,filters:t}){const{t:s}=k(),{value:r,domainStatus:i}=n;if(!Ue(r))return null;let a=null,l=null;const{isHttps:c,matchedCert:d}=i;if(!Pt(r)){const{dns:{resolved:m,ip:D}={}}=i;m||D==="127.0.0.1"?a=e.jsx(B,{title:s("router.domain.verify.ok"),children:e.jsx(Fe,{color:"success"})}):a=e.jsx(B,{title:s("router.domain.verify.notResolved"),children:e.jsx(Fe,{color:"error"})})}c?l=e.jsx(we,{certificate:d}):l=e.jsx(B,{title:s("router.domain.https.bad"),children:e.jsx(Ce,{style:{color:"#D0021B",fontSize:20,cursor:"pointer"}})});const f=t.map(m=>m==="domain"?a:m==="http"?l:null);return v.createElement(v.Fragment,null,...f)}H.propTypes={domain:Q.isRequired,filters:o.array};H.defaultProps={filters:["domain","http"]};const qn=Ge(J,"mutate_blocklets"),Fn=Ge(J,"",kt);function at(n){const{inService:t}=F(),{blocklet:s,loadingRuntimeInfo:r}=Ne();let i=qn;return t&&(i=Fn),e.jsx(i,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}at.propTypes={listOnly:o.bool};at.defaultProps={listOnly:!1};function J({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,listOnly:i}){var w,I,C,T;const{t:a}=k(),{info:l}=F(),[c,d]=v.useState(!1),f=ce(u=>u.breakpoints.down("md")),m=v.useMemo(()=>{let u=n;return Tt(t)&&(u=u&&r),u},[n,r,t]),{site:D}=t,x=v.useMemo(()=>{var u;return Lt((u=t.site)==null?void 0:u.domainAliases)},[(w=t.site)==null?void 0:w.domainAliases]),y=[],b=[],P=Mt.encode(t.appPid),g=(C=(I=t.environments)==null?void 0:I.find(u=>u.key==="BLOCKLET_APP_PK"))==null?void 0:C.value,p=_t(x);return x.forEach(u=>{const L=u.value||"";He.isDidDomain(L)&&!L.startsWith(P)?b.push(u):y.push(u)}),e.jsxs(e.Fragment,{children:[!i&&e.jsxs(e.Fragment,{children:[e.jsxs(h,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(h,{children:a("common.domain")}),m&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(kn,{id:D.id,title:a("router.domain.add.title"),teamDid:(T=t.meta)==null?void 0:T.did,appId:t.appPid,appPk:g,systemDomains:p==null?void 0:p.map(u=>u.value),children:({open:u})=>e.jsxs(W,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:u,disabled:_e.isInProgress(t.status),children:[e.jsx(Ft,{style:{fontSize:"1.3em",marginRight:4}}),a("common.add")]})}),l.nftDomainUrl&&e.jsx(ye,{variant:"outlined",appId:t.appPid,appPk:g,siteId:D.id,inBlockletSetup:!1,teamDid:t.meta.did})]})]}),_e.isAccessible(t.status)===!1&&e.jsx(h,{mt:1.5,mb:1.5,children:e.jsx(ue,{severity:"warning",children:a("blocklet.router.noRunning")})})]}),e.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:(c?x:y).map(u=>{var R,A;const L=u.value;return e.jsxs(v.Fragment,{children:[f&&e.jsxs(h,{display:"flex",flexDirection:"column",children:[e.jsx(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:e.jsx(se,{domain:u,target:"_blank",children:u.value})}),e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(H,{domain:u,filters:["domain"]},`${u.value}-domain`),e.jsx(ie,{siteId:(R=t.site)==null?void 0:R.id,domain:u,blocklet:t,hasMutatePermission:m})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:m,site:D,domain:u,blocklet:t})})]})]},L),!f&&e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[e.jsxs(h,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(H,{domain:u,filters:["domain"]},`${u.value}-domain`),e.jsx(h,{sx:{ml:2,mr:.5},children:e.jsx(se,{domain:u,target:"_blank",children:u.value})}),e.jsx(ie,{siteId:(A=t.site)==null?void 0:A.id,domain:u,blocklet:t,hasMutatePermission:m})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(re,{hasMutatePermission:m,site:D,domain:u,blocklet:t})})]},L)]},L)})}),b.length>0&&e.jsx("div",{style:{marginLeft:"20px",marginTop:"12px"},children:e.jsx(W,{endIcon:c?e.jsx(Xe,{}):e.jsx($t,{}),onClick:()=>d(!c),children:a(c?"common.collapseAll":"blocklet.router.showAllDomains")})}),!x.length&&(s?e.jsx(z,{size:16}):e.jsx(zt,{children:a("common.empty")}))]})}J.propTypes={hasPermission:o.bool,blocklet:o.object.isRequired,loadingRuntimeInfo:o.bool,inService:o.bool.isRequired,listOnly:o.bool};J.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,listOnly:!1};function se({domain:n,children:t,...s}){const{t:r,locale:i}=k(),{href:a,accessibility:l,value:c}=n,d=v.useCallback(()=>e.jsx(We,{content:de(c),locale:i,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}),[c,i]);return!l||l.loading?e.jsxs(ne,{...s,children:[t,d(),e.jsx(B,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx("span",{className:"status",children:e.jsx(z,{size:12})})})]}):l.accessible?e.jsxs(ne,{...s,children:[e.jsx(h,{component:"a",href:a,target:"_blank",rel:"noopener noreferrer",children:t}),d()]}):e.jsxs(ne,{...s,children:[e.jsx(B,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx("span",{children:t})}),d()]})}se.propTypes={domain:Q.isRequired,children:o.any.isRequired};const ne=Et.span`
2
2
  &,
3
3
  & > * {
4
4
  color: #222;
@@ -12,4 +12,4 @@ import{a2 as ae,a3 as le,j as e,eL as Me,c as G,fX as mt,w as pt,aE as Be,aG as
12
12
  .status {
13
13
  margin-left: 8px;
14
14
  }
15
- `;function re({hasMutatePermission:n,site:t,domain:s,blocklet:r}){const i=Y(),{t:a}=k();return n&&!s.isProtected?e.jsx(ve,{site:t,domain:s,blocklet:r}):e.jsx(B,{title:a("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(qt,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(Bt,{style:{fill:i.palette.text.disabled}})})})}re.propTypes={hasMutatePermission:o.bool.isRequired,site:o.object.isRequired,domain:X.isRequired,blocklet:o.object.isRequired};function ie({siteId:n,domain:t,blocklet:s,hasMutatePermission:r}){const{info:i}=F(),{t:a,locale:l}=k();return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsx(tt,{locale:l,nftDid:t.nftDid,didDomainURL:i.nftDomainUrl}),e.jsx(H,{domain:t,filters:["http"]},`${t.value}-http`),r&&e.jsx(fe,{siteId:n,domain:t.value,domainStatus:t.domainStatus,did:s.meta.did,children:({open:c})=>e.jsx(W,{sx:{padding:0},size:"small",onClick:d=>c(d),children:a("router.cert.genLetsEncryptCert.title")})})]})}ie.propTypes={siteId:o.string.isRequired,domain:X.isRequired,blocklet:o.object.isRequired,hasMutatePermission:o.bool.isRequired};export{ge as A,ye as B,jn as D,at as a};
15
+ `;function re({hasMutatePermission:n,site:t,domain:s,blocklet:r}){const i=Y(),{t:a}=k();return n&&!s.isProtected?e.jsx(ve,{site:t,domain:s,blocklet:r}):e.jsx(B,{title:a("blocklet.router.domainLockTooltip"),placement:"top",children:e.jsx(qt,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0},children:e.jsx(Bt,{style:{fill:i.palette.text.disabled}})})})}re.propTypes={hasMutatePermission:o.bool.isRequired,site:o.object.isRequired,domain:Q.isRequired,blocklet:o.object.isRequired};function ie({siteId:n,domain:t,blocklet:s,hasMutatePermission:r}){const{info:i}=F(),{t:a,locale:l}=k();return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:1},children:[t.type==="nft-domain"&&e.jsx(tt,{locale:l,nftDid:t.nftDid,didDomainURL:i.nftDomainUrl}),e.jsx(H,{domain:t,filters:["http"]},`${t.value}-http`),r&&e.jsx(fe,{siteId:n,domain:t.value,domainStatus:t.domainStatus,did:s.meta.did,children:({open:c})=>e.jsx(W,{sx:{padding:0},size:"small",onClick:d=>c(d),children:a("router.cert.genLetsEncryptCert.title")})})]})}ie.propTypes={siteId:o.string.isRequired,domain:Q.isRequired,blocklet:o.object.isRequired,hasMutatePermission:o.bool.isRequired};export{ge as A,ye as B,jn as D,at as a};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index--bEJ2Eh9.js","assets/index-BVLp3zZE.js","assets/index-B4oT57Ax.css"])))=>i.map(i=>d[i]);
2
- import{L as p,r as o,d as X,u as Z,f as ee,I as te,a9 as _,ab as $,v as b,j as e,H as se,T as j,b as D,D as ne,aJ as ie,B as F,n as oe,a4 as re,cb as ae}from"./index-BVLp3zZE.js";import{t as g}from"./trim-S-x1Aalq.js";import{i as ce}from"./isEmail-CrXJuC-D.js";import{F as le}from"./fullpage-Bm4nfkdv.js";import{f as S}from"./format-error-Df_KEQEo.js";import{d as ue}from"./CheckCircle-lvBXN98Q.js";import{d as de}from"./MarkEmailRead-0EB-Mkj_.js";import{g as P}from"./get-safe-url-42YB8AJj.js";import{S as h}from"./Stack-26B3qUFg.js";import{L as me}from"./Link-CUqrslkF.js";import{T as N}from"./TextField-2xBiC_3q.js";import"./FormControl-DqpecYDI.js";import"./utils-iop7lDec.js";import"./useFormControl-5yOkHFmp.js";import"./Select-BRIdogF3.js";import"./OutlinedInput-ByQv6zcS.js";var z;(z=window.env)!=null&&z.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:a}=new URL(window.location.href);return a.get("fromWallet")==="1"},fe=re.form`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-l43P3Pet.js","assets/index-QlD_x8dd.js","assets/index-B4oT57Ax.css"])))=>i.map(i=>d[i]);
2
+ import{L as p,r as o,d as X,u as Z,f as ee,I as te,a9 as _,ab as $,v as j,j as e,H as se,T as v,b as D,D as ne,aJ as ie,B as F,n as oe,a4 as re,c8 as ae}from"./index-QlD_x8dd.js";import{t as g}from"./trim-nU6YcUSy.js";import{i as ce}from"./isEmail-CNQ_-Uou.js";import{F as le}from"./fullpage-rXGgPgMY.js";import{f as S}from"./format-error-GcNyovLo.js";import{d as ue}from"./CheckCircle-CftBFr7p.js";import{d as de}from"./MarkEmailRead-BDLJl1Cp.js";import{g as P}from"./get-safe-url-BGvd_0xZ.js";import{S as h}from"./Stack-BSFkBj-z.js";import{L as me}from"./Link-do-3aPDc.js";import{T as N}from"./TextField-BglN0hgt.js";import"./FormControl-B_E_ND8l.js";import"./utils-iop7lDec.js";import"./useFormControl-C7C8L0st.js";import"./Select-3zppq3AC.js";import"./OutlinedInput-DClaGk47.js";var z;(z=window.env)!=null&&z.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:a}=new URL(window.location.href);return a.get("fromWallet")==="1"},fe=re.form`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  align-items: center;
@@ -15,4 +15,4 @@ import{L as p,r as o,d as X,u as Z,f as ee,I as te,a9 as _,ab as $,v as b,j as e
15
15
  div.Mui-focused input {
16
16
  caret-color: ${a=>a.theme.palette.primary.main};
17
17
  }
18
- `,pe=a=>{try{if(!a)return null;const r=ae.fromBase64(a).toString();return ce(r)?r:null}catch{return null}};function De(){var O,V;const a=o.useRef(null),{session:r,connectApi:K}=X(),{t:s,locale:d}=Z(),[x,L]=o.useState(((O=r.user)==null?void 0:O.email)||""),[c,R]=o.useState(""),[E,v]=o.useState(!1),[H,U]=o.useState(!1),[u,G]=o.useState(!1),[Y,I]=o.useState(!1),[w,M]=o.useState(!1),{wallet:m}=ee(),[l]=te(),A=l.get("inviter")||localStorage.getItem("inviter"),f=l.get("updateKyc")==="1";o.useEffect(()=>{const n=l.get("subject"),t=pe(n);t&&L(t)},[]),o.useEffect(()=>{var n;(n=r.user)!=null&&n.emailVerified&&f&&(I(!0),setTimeout(()=>{if(m&&y()){_(()=>import("./index--bEJ2Eh9.js").then(t=>t.i),__vite__mapDeps([0,1,2])).then(t=>{t.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},1e3))},[r.user,f,m,l]);const q=o.useCallback(async n=>{var t;n.preventDefault(),v(!0);try{await $.post(`/kyc/email/send?locale=${d}`,{email:x}),G(!0),b.success(s("login.issueKyc.codeSentSuccess"))}catch(i){b.error(S(i)),(t=document.getElementById("email-input"))==null||t.focus()}finally{v(!1)}},[x,d,s]),T=o.useCallback(async n=>{var t;n&&n.preventDefault(),v(!0);try{await $.post(`/kyc/email/verify?locale=${d}`,{code:c}),I(!0),K.open({locale:d,action:"issue-kyc",extraParams:{code:c,updateKyc:l.get("updateKyc")||"0",inviter:A||""},containerEl:a.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:s("login.issueKyc.claim"),scan:s("login.issueKyc.scan"),confirm:s("login.issueKyc.confirm"),success:s("login.issueKyc.success")},useSocket:!0,onSuccess:()=>{M(!0),K.close(),f?(r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(m&&y()){_(()=>import("./index--bEJ2Eh9.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},1e3)):m&&y()&&_(()=>import("./index--bEJ2Eh9.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")})},onError:i=>{b.error(S(i))}})}catch(i){I(!1),b.error(S(i)),(t=document.getElementById(`code-input-${g(c).length-1}`))==null||t.focus()}finally{v(!1)}},[c,d,l,f,m,A]);o.useEffect(()=>{u&&g(c).length===p.VERIFY_CODE_LENGTH&&T()},[c,T,u]);const J=o.useCallback(()=>{U(!0),K.open({locale:d,action:"update-kyc",containerEl:a.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:s("login.updateKyc.title"),scan:s("login.updateKyc.scan"),confirm:s("login.updateKyc.confirm"),success:s("login.updateKyc.success")},useSocket:!0,onSuccess:()=>{r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(m&&y()){_(()=>import("./index--bEJ2Eh9.js").then(n=>n.i),__vite__mapDeps([0,1,2])).then(n=>{n.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},2e3)},onError:n=>{b.error(S(n))}})},[d,l,m]),k=o.useCallback(n=>{if(!u)return;n.preventDefault();const t=g(n.clipboardData.getData("text/plain").slice(0,p.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;R(t.padEnd(p.VERIFY_CODE_LENGTH," "));const i=document.getElementById(`code-input-${t.length}`);i&&i.focus()},[u]);o.useEffect(()=>(document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}),[k]);const B=y()?s("login.issueKyc.issueTitle"):s("login.issueKyc.verifyTitle"),Q=y()?s("login.issueKyc.issueAction"):s("login.issueKyc.verifyAction");return e.jsxs(le,{did:(V=window.blocklet)==null?void 0:V.appPid,children:[e.jsx(se,{children:e.jsx("title",{children:B})}),e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",px:2,boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(h,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[w?e.jsx(ue,{sx:{fontSize:72},color:"success"}):e.jsx(de,{sx:{fontSize:72},color:"primary"}),e.jsx(j,{variant:"h5",sx:{textAlign:"center"},children:B}),!w&&e.jsx(j,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:s("login.issueKyc.pageDescription")}),w&&e.jsx(j,{variant:"body1",sx:{textAlign:"center"},children:s("login.issueKyc.success")}),w&&e.jsx(D,{variant:"contained",color:"primary",component:me,href:"/",size:"large",children:s("login.issueKyc.backToHome")}),!w&&r.user&&e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(j,{variant:"body2",color:"info.main",sx:{textAlign:"center",mt:1},children:s("login.issueKyc.issueTarget",{action:Q})}),e.jsxs(h,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{width:"100%",maxWidth:360},children:[e.jsx(ne,{did:r.user.did,responsive:!0,copyable:!0,showQrcode:!1}),e.jsx(ie,{locale:d,session:r,showRole:!0,showManageBlocklet:!1})]})]})]}),e.jsx(F,{ref:a,sx:{width:"100%"},children:!Y&&!H&&e.jsxs(fe,{onSubmit:u?T:q,children:[!u&&e.jsx(N,{type:"email",id:"email-input",placeholder:s("login.issueKyc.emailPlaceholder"),sx:{width:"100%",maxWidth:360},value:x,onChange:n=>L(n.target.value),disabled:E,required:!0}),u&&e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(j,{variant:"body2",textAlign:"center",children:s("login.issueKyc.codeSentMessage",{email:x})}),e.jsx(F,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(p.VERIFY_CODE_LENGTH)].map((n,t)=>e.jsx(N,{value:g(c[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:i=>{var W;const C=c.split("");C[t]=i.target.value,R(C.join("")),i.target.value&&t<5&&((W=document.getElementById(`code-input-${t+1}`))==null||W.focus())},onKeyDown:i=>{var C;i.key==="Backspace"&&!g(c[t])&&t>0&&((C=document.getElementById(`code-input-${t-1}`))==null||C.focus())},disabled:E,required:!0,id:`code-input-${t}`,autoComplete:"off"},`code-input-${t}`))})]}),e.jsxs(h,{direction:"row",justifyContent:f?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[f&&e.jsx(D,{variant:"text",disabled:E,onClick:J,size:"large",children:s("login.updateKyc.button")}),e.jsx(D,{type:"submit",size:"large",variant:"contained",disabled:E||!x||u&&g(c).length!==p.VERIFY_CODE_LENGTH,sx:{width:f?"auto":"100%"},children:E?e.jsx(oe,{size:24}):s(u?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{De as default};
18
+ `,pe=a=>{try{if(!a)return null;const r=ae.fromBase64(a).toString();return ce(r)?r:null}catch{return null}};function De(){var O,V;const a=o.useRef(null),{session:r,connectApi:K}=X(),{t:s,locale:d}=Z(),[x,L]=o.useState(((O=r.user)==null?void 0:O.email)||""),[c,R]=o.useState(""),[E,b]=o.useState(!1),[H,U]=o.useState(!1),[u,G]=o.useState(!1),[Y,I]=o.useState(!1),[w,M]=o.useState(!1),{wallet:m}=ee(),[l]=te(),A=l.get("inviter")||localStorage.getItem("inviter"),f=l.get("updateKyc")==="1";o.useEffect(()=>{const n=l.get("subject"),t=pe(n);t&&L(t)},[]),o.useEffect(()=>{var n;(n=r.user)!=null&&n.emailVerified&&f&&(I(!0),setTimeout(()=>{if(m&&y()){_(()=>import("./index-l43P3Pet.js").then(t=>t.i),__vite__mapDeps([0,1,2])).then(t=>{t.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},1e3))},[r.user,f,m,l]);const q=o.useCallback(async n=>{var t;n.preventDefault(),b(!0);try{await $.post(`/kyc/email/send?locale=${d}`,{email:x}),G(!0),j.success(s("login.issueKyc.codeSentSuccess"))}catch(i){j.error(S(i)),(t=document.getElementById("email-input"))==null||t.focus()}finally{b(!1)}},[x,d,s]),T=o.useCallback(async n=>{var t;n&&n.preventDefault(),b(!0);try{await $.post(`/kyc/email/verify?locale=${d}`,{code:c}),I(!0),K.open({locale:d,action:"issue-kyc",extraParams:{code:c,updateKyc:l.get("updateKyc")||"0",inviter:A||""},containerEl:a.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:s("login.issueKyc.claim"),scan:s("login.issueKyc.scan"),confirm:s("login.issueKyc.confirm"),success:s("login.issueKyc.success")},useSocket:!0,onSuccess:()=>{M(!0),K.close(),f?(r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(m&&y()){_(()=>import("./index-l43P3Pet.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},1e3)):m&&y()&&_(()=>import("./index-l43P3Pet.js").then(i=>i.i),__vite__mapDeps([0,1,2])).then(i=>{i.call("arcClosePage")})},onError:i=>{j.error(S(i))}})}catch(i){I(!1),j.error(S(i)),(t=document.getElementById(`code-input-${g(c).length-1}`))==null||t.focus()}finally{b(!1)}},[c,d,l,f,m,A]);o.useEffect(()=>{u&&g(c).length===p.VERIFY_CODE_LENGTH&&T()},[c,T,u]);const J=o.useCallback(()=>{U(!0),K.open({locale:d,action:"update-kyc",containerEl:a.current,className:"connect",popup:!1,saveConnect:!1,forceConnected:!0,messages:{title:s("login.updateKyc.title"),scan:s("login.updateKyc.scan"),confirm:s("login.updateKyc.confirm"),success:s("login.updateKyc.success")},useSocket:!0,onSuccess:()=>{r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(m&&y()){_(()=>import("./index-l43P3Pet.js").then(n=>n.i),__vite__mapDeps([0,1,2])).then(n=>{n.call("arcClosePage")});return}window.location.href=P(l.get("redirect")||"/")},2e3)},onError:n=>{j.error(S(n))}})},[d,l,m]),k=o.useCallback(n=>{if(!u)return;n.preventDefault();const t=g(n.clipboardData.getData("text/plain").slice(0,p.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;R(t.padEnd(p.VERIFY_CODE_LENGTH," "));const i=document.getElementById(`code-input-${t.length}`);i&&i.focus()},[u]);o.useEffect(()=>(document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}),[k]);const B=y()?s("login.issueKyc.issueTitle"):s("login.issueKyc.verifyTitle"),Q=y()?s("login.issueKyc.issueAction"):s("login.issueKyc.verifyAction");return e.jsxs(le,{did:(V=window.blocklet)==null?void 0:V.appPid,children:[e.jsx(se,{children:e.jsx("title",{children:B})}),e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",px:2,boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(h,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[w?e.jsx(ue,{sx:{fontSize:72},color:"success"}):e.jsx(de,{sx:{fontSize:72},color:"primary"}),e.jsx(v,{variant:"h5",sx:{textAlign:"center"},children:B}),!w&&e.jsx(v,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:s("login.issueKyc.pageDescription")}),w&&e.jsx(v,{variant:"body1",sx:{textAlign:"center"},children:s("login.issueKyc.success")}),w&&e.jsx(D,{variant:"contained",color:"primary",component:me,href:"/",size:"large",children:s("login.issueKyc.backToHome")}),!w&&r.user&&e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(v,{variant:"body2",color:"info.main",sx:{textAlign:"center",mt:1},children:s("login.issueKyc.issueTarget",{action:Q})}),e.jsxs(h,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{width:"100%",maxWidth:360},children:[e.jsx(ne,{did:r.user.did,responsive:!0,copyable:!0,showQrcode:!1}),e.jsx(ie,{locale:d,session:r,showRole:!0,showManageBlocklet:!1})]})]})]}),e.jsx(F,{ref:a,sx:{width:"100%"},children:!Y&&!H&&e.jsxs(fe,{onSubmit:u?T:q,children:[!u&&e.jsx(N,{type:"email",id:"email-input",placeholder:s("login.issueKyc.emailPlaceholder"),sx:{width:"100%",maxWidth:360},value:x,onChange:n=>L(n.target.value),disabled:E,required:!0}),u&&e.jsxs(h,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(v,{variant:"body2",textAlign:"center",children:s("login.issueKyc.codeSentMessage",{email:x})}),e.jsx(F,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(p.VERIFY_CODE_LENGTH)].map((n,t)=>e.jsx(N,{value:g(c[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:i=>{var W;const C=c.split("");C[t]=i.target.value,R(C.join("")),i.target.value&&t<5&&((W=document.getElementById(`code-input-${t+1}`))==null||W.focus())},onKeyDown:i=>{var C;i.key==="Backspace"&&!g(c[t])&&t>0&&((C=document.getElementById(`code-input-${t-1}`))==null||C.focus())},disabled:E,required:!0,id:`code-input-${t}`,autoComplete:"off"},`code-input-${t}`))})]}),e.jsxs(h,{direction:"row",justifyContent:f?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[f&&e.jsx(D,{variant:"text",disabled:E,onClick:J,size:"large",children:s("login.updateKyc.button")}),e.jsx(D,{type:"submit",size:"large",variant:"contained",disabled:E||!x||u&&g(c).length!==p.VERIFY_CODE_LENGTH,sx:{width:f?"auto":"100%"},children:E?e.jsx(oe,{size:24}):s(u?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{De as default};
@@ -0,0 +1 @@
1
+ import{cy as e,cz as r,cA as s}from"./index-QlD_x8dd.js";const a=e(r),t=e(s);export{t as a,a as r};
@@ -1 +1 @@
1
- import{r as C,u as T,e as W,j as e,C as j,n as k,B as v,V as I,v as m,L,W as R,X as S,x as U,y as b}from"./index-BVLp3zZE.js";import{F}from"./fullpage-Bm4nfkdv.js";import{w as N}from"./wrap-locale-CyPDW3Gl.js";import{g as _}from"./get-safe-url-Doxyyx5u.js";import"./Link-CUqrslkF.js";function B({SessionContext:t,webWalletUrl:a,onSuccess:s}){var g,h;const{api:n,session:i}=C.useContext(t),{t:o,locale:f}=T(),u=W(),{searchParams:l}=new URL(window.location.href),x=l.get("redirect"),w=async(r,E)=>{s(r,E),await i.refresh(),m.success(o("exchangePassport.success")),setTimeout(()=>{if(x){const c=decodeURIComponent(x);c.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=_(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{m.error(r.message)},p={},d=l.get("componentId");return d&&(p.componentId=d),i.loading?e.jsx(j,{children:e.jsx(k,{})}):e.jsx(F,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((h=window==null?void 0:window.env)==null?void 0:h.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(I,{className:"connect",action:"exchange-passport",checkFn:n.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:w,onError:P,locale:f,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:p,extraContent:null})})})}const D=N(B);function K(){const t=R(),a=(s,n)=>{s.sessionToken&&(U(n(s.sessionToken)),b(n(s.refreshToken)))};return e.jsx(D,{SessionContext:S,webWalletUrl:t,onSuccess:a})}export{K as default};
1
+ import{r as C,u as T,e as W,j as e,C as j,n as k,B as v,V as I,v as m,L,W as R,X as S,x as U,y as b}from"./index-QlD_x8dd.js";import{F}from"./fullpage-rXGgPgMY.js";import{w as N}from"./wrap-locale-7OInKuIE.js";import{g as _}from"./get-safe-url-pcN_rKAr.js";import"./Link-do-3aPDc.js";function B({SessionContext:t,webWalletUrl:a,onSuccess:s}){var g,h;const{api:n,session:i}=C.useContext(t),{t:o,locale:f}=T(),u=W(),{searchParams:l}=new URL(window.location.href),x=l.get("redirect"),w=async(r,E)=>{s(r,E),await i.refresh(),m.success(o("exchangePassport.success")),setTimeout(()=>{if(x){const c=decodeURIComponent(x);c.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=_(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{m.error(r.message)},p={},d=l.get("componentId");return d&&(p.componentId=d),i.loading?e.jsx(j,{children:e.jsx(k,{})}):e.jsx(F,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((h=window==null?void 0:window.env)==null?void 0:h.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(I,{className:"connect",action:"exchange-passport",checkFn:n.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:w,onError:P,locale:f,messages:{title:o("exchangePassport.dialog.title"),scan:o("exchangePassport.dialog.scan"),confirm:o("exchangePassport.dialog.confirm"),success:o("exchangePassport.dialog.success")},extraParams:p,extraContent:null})})})}const D=N(B);function K(){const t=R(),a=(s,n)=>{s.sessionToken&&(U(n(s.sessionToken)),b(n(s.refreshToken)))};return e.jsx(D,{SessionContext:S,webWalletUrl:t,onSuccess:a})}export{K as default};
@@ -1,4 +1,4 @@
1
- import{j as e,bx as a,ci as t,a7 as i}from"./index-BVLp3zZE.js";function s({title:r="Something went wrong...",desc:n,retryFunc:o=null}){return e.jsxs(l,{role:"alert",children:[e.jsx("h3",{children:r}),e.jsx("pre",{children:n}),o&&e.jsx(i,{variant:"contained",color:"error",size:"small",onClick:o,children:"Try again"})]})}function d({error:r}){return e.jsx(s,{desc:r.message})}const l=a("div")`
1
+ import{j as e,bv as a,cf as t,a7 as s}from"./index-QlD_x8dd.js";function i({title:r="Something went wrong...",desc:n,retryFunc:o=null}){return e.jsxs(l,{role:"alert",children:[e.jsx("h3",{children:r}),e.jsx("pre",{children:n}),o&&e.jsx(s,{variant:"contained",color:"error",size:"small",onClick:o,children:"Try again"})]})}function d({error:r}){return e.jsx(i,{desc:r.message})}const l=a("div")`
2
2
  padding: 16px;
3
3
  border: 2px solid ${r=>r.theme.palette.error.main};
4
4
  border-radius: 4px;
@@ -1,4 +1,4 @@
1
- import{a2 as U,a3 as X,j as e,P as t,eU as z,aI as S,b as A,br as G,ao as V,bs as W,cG as Z,aZ as H,cT as J,r as i,a6 as Q,B as u,n as Y,dh as ee}from"./index-BVLp3zZE.js";import{d as te}from"./Done-CiqJ6IHh.js";import{F as se,R as ae}from"./logo-uploader-x7kZDmdm.js";import{d as le}from"./EditIcon-B3dfnlOS.js";import{d as ne}from"./ArrowDropDown-Y4EemKOX.js";import{B as re}from"./ButtonGroup-Z3Ze7Bhq.js";import{T as ie}from"./TextField-2xBiC_3q.js";var R={},oe=X;Object.defineProperty(R,"__esModule",{value:!0});var ce=R.default=void 0,ue=oe(U()),de=e;ce=R.default=(0,ue.default)((0,de.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");function I({triggers:l,onEnterEdit:a,disabled:m}){const n=z.useRef(null),[p,o]=z.useState(!1),b=s=>{o(!1),s()},C=()=>{o(s=>!s)},d=s=>{n.current&&n.current.contains(s.target)||o(!1)};return l.length===0?e.jsx(S,{"data-cy":"schema-form-item-edit",onClick:a,disabled:m,size:"large",children:e.jsx(le,{})}):e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"outlined",ref:n,"aria-label":"split button",children:e.jsx(A,{size:"large","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:C,children:e.jsx(ne,{})})}),e.jsx(G,{sx:{zIndex:9999},open:p,anchorEl:n.current,role:void 0,placement:"bottom-end",children:e.jsx(V,{children:e.jsx(W,{onClickAway:d,children:e.jsx(Z,{id:"split-button-menu",autoFocusItem:!0,children:l.map(s=>e.jsx(H,{onClick:()=>b(s.handler),children:s.title},s.key))})})})})]})}I.propTypes={triggers:t.arrayOf(t.shape({key:t.string.isRequired,title:t.string.isRequired,handler:t.func.isRequired})),onEnterEdit:t.func.isRequired,disabled:t.bool.isRequired};I.defaultProps={triggers:[]};const P=(l,a,m)=>l===null&&a&&m?"******":l?a?"******":l:"",fe=J`
1
+ import{a2 as K,a3 as U,j as e,P as t,eU as z,aI as S,b as A,bp as V,ao as W,bq as G,cE as H,aX as J,cR as Q,r as i,a6 as Y,B as u,n as Z,dl as ee}from"./index-QlD_x8dd.js";import{d as te}from"./Done-J-vanIHZ.js";import{F as se,R as ae}from"./logo-uploader-Beq3ukvb.js";import{d as le}from"./EditIcon-AjMrTHbF.js";import{d as ne}from"./ArrowDropDown-Dc5OJFHA.js";import{B as re}from"./ButtonGroup-C95pZQfV.js";import{T as ie}from"./TextField-BglN0hgt.js";var R={},oe=U;Object.defineProperty(R,"__esModule",{value:!0});var ce=R.default=void 0,ue=oe(K()),de=e;ce=R.default=(0,ue.default)((0,de.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");function I({triggers:l,onEnterEdit:a,disabled:m}){const n=z.useRef(null),[p,o]=z.useState(!1),b=s=>{o(!1),s()},C=()=>{o(s=>!s)},d=s=>{n.current&&n.current.contains(s.target)||o(!1)};return l.length===0?e.jsx(S,{"data-cy":"schema-form-item-edit",onClick:a,disabled:m,size:"large",children:e.jsx(le,{})}):e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"outlined",ref:n,"aria-label":"split button",children:e.jsx(A,{size:"large","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:C,children:e.jsx(ne,{})})}),e.jsx(V,{sx:{zIndex:9999},open:p,anchorEl:n.current,role:void 0,placement:"bottom-end",children:e.jsx(W,{children:e.jsx(G,{onClickAway:d,children:e.jsx(H,{id:"split-button-menu",autoFocusItem:!0,children:l.map(s=>e.jsx(J,{onClick:()=>b(s.handler),children:s.title},s.key))})})})})]})}I.propTypes={triggers:t.arrayOf(t.shape({key:t.string.isRequired,title:t.string.isRequired,handler:t.func.isRequired})),onEnterEdit:t.func.isRequired,disabled:t.bool.isRequired};I.defaultProps={triggers:[]};const P=(l,a,m)=>l===null&&a&&m?"******":l?a?"******":l:"",fe=Q`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -8,4 +8,4 @@ import{a2 as U,a3 as X,j as e,P as t,eU as z,aI as S,b as A,br as G,ao as V,bs a
8
8
  25%, 75% {
9
9
  transform: scale(1.1) translateX(3px);
10
10
  }
11
- `;function w({label:l,disabled:a,required:m,initialValue:n,onChange:p,placeholder:o,style:b,onSubmit:C,secure:d,triggers:s,formatterBeforeSubmit:_,...B}){const[q,g]=i.useState(!1),[h,v]=i.useState(!1),{t:N}=i.useContext(Q),[y,L]=i.useState(d&&n==="__encrypted__"?null:n),[c,x]=i.useState(y),[f,j]=i.useState(!1),[O,T]=i.useState(!1),E=async()=>{v(!0);try{if(await C(c)===!1)x(y);else{let k=c;typeof _=="function"&&(k=_(c)),x(k),L(k),j(!1)}}catch{x(y)}finally{v(!1),g(!1)}},D=r=>{j(r!==c),x(r),p(r)},M=r=>{r.key==="Enter"&&E()},F=i.useCallback(()=>{T(!0),setTimeout(()=>{T(!1)},500)},[]),$=i.useCallback(()=>{f&&F(),!f&&!a&&!h&&(g(!1),j(!1))},[f,a,h,F]),K=q?e.jsx(ie,{style:{flex:1},fullWidth:!0,value:c,onChange:r=>{D(r.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o,onKeyDown:M,onBlur:$,disabled:a,type:d?"password":"text",...B}):e.jsx(u,{px:1,"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap",cursor:"text"},onClick:()=>{a||g(!0)},children:P(c,d,n)?P(c,d,n):e.jsx("span",{className:"placeholder",children:N("common.requiredInputPlaceholder",{name:o||l})})});return e.jsx(se,{className:"form",style:b,children:e.jsxs(u,{className:"form-item",children:[e.jsxs(u,{className:"form-item-label",children:[l,m&&e.jsx(ae,{})]}),e.jsxs(u,{className:"form-item-body",style:{alignItems:"flex-start"},children:[e.jsx(u,{className:"form-item-input",children:K}),e.jsx(u,{className:"form-item-action",style:{marginLeft:s.length?12:0},children:q?e.jsxs(e.Fragment,{children:[f?e.jsx(S,{"data-cy":"schema-form-item-confirm",onClick:E,disabled:a||h||!f,sx:{animation:O?`${fe} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:h?e.jsx(Y,{size:24}):e.jsx(te,{})}):null,e.jsx(S,{"data-cy":"schema-form-item-cancel",onClick:()=>{x(y),g(!1),j(!1)},style:{paddingLeft:f?4:8},disabled:a||h,size:"large",children:e.jsx(ee,{})})]}):e.jsx(u,{children:s.length?e.jsx(I,{triggers:s,disabled:a}):null})})]})]})})}w.propTypes={style:t.object,onSubmit:t.func,onChange:t.func,label:t.string,initialValue:t.string,placeholder:t.string,required:t.bool,disabled:t.bool,secure:t.bool,triggers:t.array,formatterBeforeSubmit:t.func};w.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null};export{w as F,ce as d};
11
+ `;function w({label:l,disabled:a,required:m,initialValue:n,onChange:p,placeholder:o,style:b,onSubmit:C,secure:d,triggers:s,formatterBeforeSubmit:_,...B}){const[q,g]=i.useState(!1),[h,v]=i.useState(!1),{t:N}=i.useContext(Y),[y,L]=i.useState(d&&n==="__encrypted__"?null:n),[c,x]=i.useState(y),[f,j]=i.useState(!1),[O,E]=i.useState(!1),F=async()=>{v(!0);try{if(await C(c)===!1)x(y);else{let k=c;typeof _=="function"&&(k=_(c)),x(k),L(k),j(!1)}}catch{x(y)}finally{v(!1),g(!1)}},D=r=>{j(r!==c),x(r),p(r)},M=r=>{r.key==="Enter"&&F()},T=i.useCallback(()=>{E(!0),setTimeout(()=>{E(!1)},500)},[]),$=i.useCallback(()=>{f&&T(),!f&&!a&&!h&&(g(!1),j(!1))},[f,a,h,T]),X=q?e.jsx(ie,{style:{flex:1},fullWidth:!0,value:c,onChange:r=>{D(r.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o,onKeyDown:M,onBlur:$,disabled:a,type:d?"password":"text",...B}):e.jsx(u,{px:1,"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap",cursor:"text"},onClick:()=>{a||g(!0)},children:P(c,d,n)?P(c,d,n):e.jsx("span",{className:"placeholder",children:N("common.requiredInputPlaceholder",{name:o||l})})});return e.jsx(se,{className:"form",style:b,children:e.jsxs(u,{className:"form-item",children:[e.jsxs(u,{className:"form-item-label",children:[l,m&&e.jsx(ae,{})]}),e.jsxs(u,{className:"form-item-body",style:{alignItems:"flex-start"},children:[e.jsx(u,{className:"form-item-input",children:X}),e.jsx(u,{className:"form-item-action",style:{marginLeft:s.length?12:0},children:q?e.jsxs(e.Fragment,{children:[f?e.jsx(S,{"data-cy":"schema-form-item-confirm",onClick:F,disabled:a||h||!f,sx:{animation:O?`${fe} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:h?e.jsx(Z,{size:24}):e.jsx(te,{})}):null,e.jsx(S,{"data-cy":"schema-form-item-cancel",onClick:()=>{x(y),g(!1),j(!1)},style:{paddingLeft:f?4:8},disabled:a||h,size:"large",children:e.jsx(ee,{})})]}):e.jsx(u,{children:s.length?e.jsx(I,{triggers:s,disabled:a}):null})})]})]})})}w.propTypes={style:t.object,onSubmit:t.func,onChange:t.func,label:t.string,initialValue:t.string,placeholder:t.string,required:t.bool,disabled:t.bool,secure:t.bool,triggers:t.array,formatterBeforeSubmit:t.func};w.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null};export{w as F,ce as d};
@@ -1,2 +1,2 @@
1
- import{bc as i}from"./index-BVLp3zZE.js";const f=t=>{const{details:e,errors:s,response:r}=t;if(Array.isArray(s))return s.map(a=>a.message).join(`
2
- `);if(Array.isArray(e))return`Validate failed: ${e.map(o=>{const n=o.message.replace(/["]/g,"'");return`${o.path.join(".")}: ${n}`}).join(";")}`;if(r){if(r.data.message)return r.data.message;if(r.data.error)return r.data.error;const a=typeof r.data=="string"?r.data.slice(0,200):JSON.stringify(r.data);return`Request failed: ${r.status} ${r.statusText}: ${a}`}return t.message};var m=f;const c=i(m);export{c as f};
1
+ import{ba as i}from"./index-QlD_x8dd.js";const f=t=>{const{details:e,errors:s,response:r}=t;if(Array.isArray(s))return s.map(a=>a.message).join(`
2
+ `);if(Array.isArray(e))return`Validate failed: ${e.map(o=>{const n=o.message.replace(/["]/g,"'");return`${o.path.join(".")}: ${n}`}).join(";")}`;if(r){if(r.data.message)return r.data.message;if(r.data.error)return r.data.error;const a=typeof r.data=="string"?r.data.slice(0,200):JSON.stringify(r.data);return`Request failed: ${r.status} ${r.statusText}: ${a}`}return t.message};var m=f;const g=i(m);export{g as f};
@@ -1,4 +1,4 @@
1
- import{r as l,a6 as B,aq as N,d as W,j as e,B as t,n as v,c as L,V as I,P as p,a4 as $}from"./index-BVLp3zZE.js";import{d as D}from"./Launch-BSl6NDxk.js";import{W as E}from"./did-address-BT02fs0z.js";import{P as T}from"./page-header-uP5z14d-.js";import{S as q}from"./layout-CyocM6h2.js";import{S as z}from"./step-actions-epBkt1C9.js";import{S as u}from"./button-DTjLsugU.js";import{L as A}from"./Link-CUqrslkF.js";import"./content-layout-FmzgfnJs.js";function m({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(B),{blocklet:a,gas:c,tokenInfo:h,actions:j}=N(),{api:y}=W(),[g,o]=l.useState(!1),{need:d="",current:k="",owe:r=99999,deficiency:C,symbol:S="",endpoint:i}=c||{},{origin:b="/"}=i?new URL(i):{};l.useEffect(()=>{const P=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(P)}},[]);const w=()=>{o(!1)};return c?e.jsxs(F,{children:[e.jsx("div",{className:"header",children:e.jsx(T,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${d} ${S}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(E,{className:"address",did:a.appDid}),e.jsx(A,{style:{lineHeight:1},target:"_blank",href:L(b,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(D,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(u,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(I,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:C,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:d})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:k})]})]})]}),e.jsx(z,{mt:8,children:e.jsx(u,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(v,{})})}m.propTypes={onNext:p.func,onPrevious:p.func};m.defaultProps={onNext:()=>{},onPrevious:()=>{}};const F=$(q)`
1
+ import{r as l,a6 as B,aq as N,d as W,j as e,B as t,n as v,c as L,V as I,P as p,a4 as $}from"./index-QlD_x8dd.js";import{d as D}from"./Launch-CJJrZfJ6.js";import{W as E}from"./did-address-lS5AVM-f.js";import{P as T}from"./page-header-BWUJXWNp.js";import{S as q}from"./layout-D4UiIZik.js";import{S as z}from"./step-actions-BOANelns.js";import{S as u}from"./button-DfhlQnHj.js";import{L as A}from"./Link-do-3aPDc.js";import"./content-layout-CsBQOuZw.js";function m({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(B),{blocklet:a,gas:c,tokenInfo:h,actions:j}=N(),{api:y}=W(),[g,o]=l.useState(!1),{need:d="",current:k="",owe:r=99999,deficiency:C,symbol:S="",endpoint:i}=c||{},{origin:b="/"}=i?new URL(i):{};l.useEffect(()=>{const P=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(P)}},[]);const w=()=>{o(!1)};return c?e.jsxs(F,{children:[e.jsx("div",{className:"header",children:e.jsx(T,{title:s("setup.fuel.title"),onClickBack:f})}),e.jsxs(t,{className:"qr-body",children:[e.jsxs(t,{mb:6,className:"tip",children:[s("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${d} ${S}`}),s("setup.fuel.tipEnd")]}),e.jsx(t,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:s("setup.fuel.addressTitle")}),e.jsxs(t,{display:"flex",alignItems:"center",children:[e.jsx(E,{className:"address",did:a.appDid}),e.jsx(A,{style:{lineHeight:1},target:"_blank",href:L(b,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(D,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(u,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx(I,{popup:!0,open:g,action:"fuel",checkFn:y.get,checkTimeout:10*60*1e3,onSuccess:w,onClose:()=>o(!1),locale:x,messages:{title:s("setup.connect.title"),scan:s("setup.connect.scan"),confirm:s("setup.connect.confirm"),success:s("setup.connect.success")},extraParams:{amount:C,...h,endpoint:i}}),e.jsxs(t,{display:"flex",color:"text.secondary",children:[e.jsxs(t,{display:"flex",children:[e.jsxs(t,{children:[s("setup.fuel.need"),":"]}),e.jsx(t,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:d})]}),e.jsxs(t,{display:"flex",ml:3,children:[e.jsxs(t,{children:[s("setup.fuel.current"),":"]}),e.jsx(t,{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:k})]})]})]}),e.jsx(z,{mt:8,children:e.jsx(u,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(v,{})})}m.propTypes={onNext:p.func,onPrevious:p.func};m.defaultProps={onNext:()=>{},onPrevious:()=>{}};const F=$(q)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1 +1 @@
1
- import{j as e,T as x,cc as j,B as o,A as v,bF as a,P as r}from"./index-BVLp3zZE.js";import{L as h}from"./Link-CUqrslkF.js";function w({linkProps:t,...c}){return e.jsxs(x,{...c,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...t,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...t,children:"Blocklet Technology"}),", the decentralized web engine."]})}const y="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function k({did:t,children:c,title:l,description:d,logo:n,logoSize:g,appUrl:i}){var b,f,p,m;if(!t)return c;let s;try{s=j(t)}catch{console.warn("Invalid did:",t)}const u=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=u.appName),d===void 0&&(d=u.appDescription),n===void 0&&(n=((b=globalThis==null?void 0:globalThis.blocklet)==null?void 0:b.appLogoRect)||((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(o,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n,alt:`${l}'s logo`}):n=e.jsx(v,{size:g,did:t,src:n,variant:"rounded"})),typeof i=="string"&&(i=((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(m=globalThis==null?void 0:globalThis.env)==null?void 0:m.baseUrl)),e.jsxs(o,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(o,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(o,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${y}), lightgray 50% / cover no-repeat`:`url(${y}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(o,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(o,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(x,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),d&&e.jsx(x,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:d})]}),e.jsx(w,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(o,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:c})]})}k.propTypes={did:r.string.isRequired,children:r.any.isRequired,title:r.any,description:r.any,logo:r.any,logoSize:r.number,appUrl:r.string};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{k as F};
1
+ import{j as e,T as x,c9 as j,B as o,A as v,bF as a,P as r}from"./index-QlD_x8dd.js";import{L as h}from"./Link-do-3aPDc.js";function w({linkProps:t,...d}){return e.jsxs(x,{...d,children:["Powered by"," ",e.jsx(h,{href:"https://www.arcblock.io",target:"_blank",underline:"hover",...t,children:"ArcBlock"}),"'s"," ",e.jsx(h,{href:"https://www.blocklet.io",target:"_blank",underline:"hover",...t,children:"Blocklet Technology"}),", the decentralized web engine."]})}const y="/.well-known/service/static/assets/login-bg-Cbfh9Uc2.png";function k({did:t,children:d,title:l,description:c,logo:n,logoSize:g,appUrl:i}){var b,f,p,m;if(!t)return d;let s;try{s=j(t)}catch{console.warn("Invalid did:",t)}const u=(globalThis==null?void 0:globalThis.blocklet)||(globalThis==null?void 0:globalThis.env)||{};return l===void 0&&(l=u.appName),c===void 0&&(c=u.appDescription),n===void 0&&(n=((b=globalThis==null?void 0:globalThis.blocklet)==null?void 0:b.appLogoRect)||((f=globalThis==null?void 0:globalThis.blocklet)==null?void 0:f.appLogo)||""),typeof n=="string"&&(n?n=e.jsx(o,{sx:{height:g,maxHeight:g,maxWidth:"50%",objectFit:"contain"},component:"img",src:n,alt:`${l}'s logo`}):n=e.jsx(v,{size:g,did:t,src:n,variant:"rounded"})),typeof i=="string"&&(i=((p=globalThis==null?void 0:globalThis.blocklet)==null?void 0:p.appUrl)||"",!i&&(globalThis!=null&&globalThis.env)&&(i=(m=globalThis==null?void 0:globalThis.env)==null?void 0:m.baseUrl)),e.jsxs(o,{sx:{width:"100vw",height:"100vh",overflowX:"auto",display:"flex",backgroundColor:a.backgroundsBgSubtile},children:[e.jsxs(o,{sx:{position:"relative",fontSize:0,flex:30,display:{xs:"none",lg:"flex"},minWidth:"400px",backgroundColor:a.surfaceBgSubtitle},children:[e.jsx(o,{sx:{position:"absolute",top:0,bottom:0,left:0,right:0,background:s?`linear-gradient(0deg, ${s} 0%, ${s} 100%), url(${y}), lightgray 50% / cover no-repeat`:`url(${y}), lightgray 50% / cover no-repeat`,backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:s?"soft-light, normal":"unset",mask:"linear-gradient(172deg, rgba(0, 0, 0, 0.0) 24.62%, rgba(0, 0, 0, 0.80) 44.47%, #000 100%)"}}),e.jsxs(o,{sx:{display:"flex",flexDirection:"column",position:"absolute",top:0,left:0,width:"100%",p:3},children:[i?e.jsx(o,{children:e.jsx(h,{href:i,underline:"none",color:"inherit",children:n})}):n,l&&e.jsx(x,{variant:"h5",sx:{mt:3,mb:1,p:0,mx:0,fontWeight:"bold"},children:i?e.jsx(h,{href:i,underline:"none",color:"inherit",children:l}):l}),c&&e.jsx(x,{variant:"body2",sx:{m:0,p:0,color:a.foregroundsFgSubtile,fontSize:"12px",lineHeight:"20px"},children:c})]}),e.jsx(w,{linkProps:{underline:"always",color:a.textSubtitle},sx:{zIndex:10,position:"absolute",bottom:40,left:20,right:20,textAlign:"center",fontSize:"12px",color:a.textSubtitle}})]}),e.jsx(o,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flex:70,maxWidth:{xs:"100%",md:"90%"},margin:"auto",height:"auto"},children:d})]})}k.propTypes={did:r.string.isRequired,children:r.any.isRequired,title:r.any,description:r.any,logo:r.any,logoSize:r.number,appUrl:r.string};k.defaultProps={title:void 0,description:void 0,logo:void 0,logoSize:40,appUrl:""};export{k as F};
@@ -1 +1 @@
1
- import{ca as t,v as o}from"./index-BVLp3zZE.js";function c(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
1
+ import{c7 as t,v as o}from"./index-QlD_x8dd.js";function c(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
@@ -1 +1 @@
1
- import{ca as t,v as o}from"./index-BVLp3zZE.js";function c(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
1
+ import{c7 as t,v as o}from"./index-QlD_x8dd.js";function c(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
@@ -1 +1 @@
1
- import{j as o,a7 as r,Q as i,L as t}from"./index-BVLp3zZE.js";import{S as n}from"./studio-CtLqrgIC.js";import{S as e}from"./Stack-26B3qUFg.js";import"./index-DRrBV2lp.js";import"./Menu-BYYOSq08.js";import"./Toolbar-BmaPDfrf.js";import"./Hidden-CrmpQdXR.js";import"./fallback-DuTRWfov.js";function E(){return o.jsx(n,{children:o.jsxs(e,{direction:"row",m:4,spacing:2,children:[o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{E as default};
1
+ import{j as o,a7 as r,Q as i,L as t}from"./index-QlD_x8dd.js";import{S as n}from"./studio-CW3R2O1x.js";import{S as e}from"./Stack-BSFkBj-z.js";import"./index-CIiAk_XW.js";import"./Menu-egTGbomH.js";import"./Toolbar-BrM3XdrE.js";import"./Hidden-DX_Kmgml.js";import"./fallback-CXpMA9jN.js";function E(){return o.jsx(n,{children:o.jsxs(e,{direction:"row",m:4,spacing:2,children:[o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(r,{component:i,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{E as default};
@@ -1 +1 @@
1
- import{eT as x,eU as E}from"./index-BVLp3zZE.js";const L=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:w,onMouseOut:b,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:w||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
1
+ import{eT as x,eU as E}from"./index-QlD_x8dd.js";const L=({url:r,allowFullScreen:o,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:w,onMouseOut:b,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||r,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:w||null,onMouseOut:b||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};