@abtnode/blocklet-services 1.16.43-beta-20250429-130236-269254ff → 1.16.43-beta-20250430-124448-4edc5502

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 (156) hide show
  1. package/api/libs/connect/session.js +4 -2
  2. package/api/middlewares/ensure-blocklet.js +1 -1
  3. package/api/routes/user-session.js +4 -2
  4. package/api/services/auth/session.js +13 -8
  5. package/dist/assets/{AdapterDayjs-D5LoqHiU.js → AdapterDayjs-BWhMsmQP.js} +1 -1
  6. package/dist/assets/{ArrowDropDown-BCCa5uRn.js → ArrowDropDown-DUCtp8oo.js} +1 -1
  7. package/dist/assets/{CheckCircle-Bxk_pKUt.js → CheckCircle-yKW43XdV.js} +1 -1
  8. package/dist/assets/{ChevronLeft-DgTQnUwX.js → ChevronLeft-6AvuBihM.js} +1 -1
  9. package/dist/assets/{ChevronRight-C-lajCDc.js → ChevronRight-BsdsjNxw.js} +1 -1
  10. package/dist/assets/{DeleteOutline-Csdx_lih.js → DeleteOutline-D_I07sPe.js} +1 -1
  11. package/dist/assets/{Done-DjB4uf97.js → Done-DLTvHdZB.js} +1 -1
  12. package/dist/assets/{Download-CF6ZhZfD.js → Download-DKz_gZX5.js} +1 -1
  13. package/dist/assets/{Edit-C-zkyYSj.js → Edit-odNPT5GK.js} +1 -1
  14. package/dist/assets/{Error-DnzvDd2d.js → Error-js7ePZ5o.js} +1 -1
  15. package/dist/assets/{ExpandLess-DBN4huDO.js → ExpandLess-TUium4RQ.js} +1 -1
  16. package/dist/assets/{Google-VfyWFLKO.js → Google-C7d25Q5r.js} +1 -1
  17. package/dist/assets/{InfoOutlined-BMb9Zu84.js → InfoOutlined-BjII93aR.js} +1 -1
  18. package/dist/assets/{Launch-CVPYIHzD.js → Launch-ryL3I8d9.js} +1 -1
  19. package/dist/assets/{LaunchOutlined-faHvtBle.js → LaunchOutlined-D21Xchdf.js} +1 -1
  20. package/dist/assets/{MoreHoriz-CT231fLS.js → MoreHoriz-DHyMdwpT.js} +1 -1
  21. package/dist/assets/{PlayArrow-CVHX5RbU.js → PlayArrow-zDVVYX6u.js} +1 -1
  22. package/dist/assets/{TuneOutlined-DcBuSd1o.js → TuneOutlined-Bv7cSbWT.js} +1 -1
  23. package/dist/assets/{ViewList-rVo7d5VV.js → ViewList-Ca1IEB31.js} +1 -1
  24. package/dist/assets/{access-control-Cum8iIaB.js → access-control-CwSjARsN.js} +1 -1
  25. package/dist/assets/{actions-D-Helr6n.js → actions-BW0Vx00_.js} +1 -1
  26. package/dist/assets/{add-component-core-kWUUw0fB.js → add-component-core-DXp_ntZ3.js} +1 -1
  27. package/dist/assets/{add-resource-DEesv1LC.js → add-resource-CmPIp37F.js} +1 -1
  28. package/dist/assets/{addon-B5zwPHe5.js → addon-FArG2oUy.js} +1 -1
  29. package/dist/assets/{advanced-CjSPlkxp.js → advanced-mJXTlRFz.js} +2 -2
  30. package/dist/assets/api-Bf1onQOz.js +1 -0
  31. package/dist/assets/{appearance-rlMOco_Q.js → appearance-D9WrcbPF.js} +1 -1
  32. package/dist/assets/{audit-logs-BpacJ0mq.js → audit-logs-CVUuBgdy.js} +1 -1
  33. package/dist/assets/{authorize-Dup4yiJg.js → authorize-Bk0sIDAH.js} +1 -1
  34. package/dist/assets/{base32-yUUlhgnG.js → base32-C_EKY5vU.js} +1 -1
  35. package/dist/assets/{branding-BB4z7dex.js → branding-BoSHL25b.js} +2 -2
  36. package/dist/assets/{branding-3E94pu9e.js → branding-Cywl-fod.js} +4 -4
  37. package/dist/assets/{bundle-avatar-njRzpG6o.js → bundle-avatar-BXQsJw7m.js} +1 -1
  38. package/dist/assets/{button-DRqMfYjF.js → button-h00yLUET.js} +1 -1
  39. package/dist/assets/{click-to-copy-CSwBjJDI.js → click-to-copy-0s0a7Ak5.js} +1 -1
  40. package/dist/assets/{cloneDeep-Cg0h_FaY.js → cloneDeep-WT_kDeVd.js} +1 -1
  41. package/dist/assets/{complete-lhAOowgH.js → complete--raviZZ4.js} +1 -1
  42. package/dist/assets/{component-DG-t6Jac.js → component-C3maTG8x.js} +72 -69
  43. package/dist/assets/{config-Ct2icT-j.js → config-Die5cVWR.js} +1 -1
  44. package/dist/assets/{config-BWuaMoux.js → config-e3P85n7z.js} +1 -1
  45. package/dist/assets/{config-navigation-BZ3T8tYK.js → config-navigation-DhvlW96p.js} +6 -6
  46. package/dist/assets/{config-space-CKx83vmi.js → config-space-CHI2AzS5.js} +1 -1
  47. package/dist/assets/{confirm-Bj4L0Vn8.js → confirm-BqrhdaU7.js} +1 -1
  48. package/dist/assets/connect-DGOqnhoS.js +5 -0
  49. package/dist/assets/{connect-v2Zx9JEk.js → connect-cpTXz6hq.js} +1 -1
  50. package/dist/assets/{connect-to-lcfZI_0b.js → connect-to-C1xSYa-8.js} +1 -1
  51. package/dist/assets/dashboard-CvJ8cVy-.js +280 -0
  52. package/dist/assets/{delete-confirm-kpan5KFX.js → delete-confirm-CmXluMcs.js} +1 -1
  53. package/dist/assets/{did-address-CJZtrzhT.js → did-address-C6ni99I7.js} +1 -1
  54. package/dist/assets/{domain-C8nJlURa.js → domain-B7m2mZGp.js} +1 -1
  55. package/dist/assets/{domain-action-card-BZ3CFKs5.js → domain-action-card-DIGUxqW7.js} +1 -1
  56. package/dist/assets/domains-DV-Gl3-a.js +1 -0
  57. package/dist/assets/{dot-CaKxEi_0.js → dot-WAAJ-O65.js} +1 -1
  58. package/dist/assets/{email-BjCEb0WI.js → email-CxndZMem.js} +2 -2
  59. package/dist/assets/{exchange-passport-B_b6xNH8.js → exchange-passport-JjK-mItt.js} +1 -1
  60. package/dist/assets/{fuel-Dtvd1fJW.js → fuel-bktBZZhG.js} +1 -1
  61. package/dist/assets/{gen-access-key-DsGgHUvi.js → gen-access-key-CPCwDcVa.js} +1 -1
  62. package/dist/assets/{get-safe-url-BTmcSfZP.js → get-safe-url-C-CJKtkC.js} +1 -1
  63. package/dist/assets/{get-safe-url-BYr2jgRv.js → get-safe-url-cyoeQ7Mw.js} +1 -1
  64. package/dist/assets/{home-ClwQWk4f.js → home-BclSkhw2.js} +1 -1
  65. package/dist/assets/{iframe-B7H87IMw.js → iframe-DZlnwo40.js} +1 -1
  66. package/dist/assets/{index-C-rP7qS0.js → index--MMFwLMX.js} +1 -1
  67. package/dist/assets/{index-D9eW5l3E.js → index-17ov_POl.js} +1 -1
  68. package/dist/assets/index-BAstW3VS.js +137 -0
  69. package/dist/assets/{index-C1UHqpp3.js → index-Bdi900W2.js} +3 -3
  70. package/dist/assets/{index-CEmSUlto.js → index-BhX4Vx5B.js} +3 -3
  71. package/dist/assets/{index-2eL6Ndgh.js → index-BugTfB-J.js} +1 -1
  72. package/dist/assets/index-C-rU1lEd.js +10 -0
  73. package/dist/assets/{index-CVKN_Jn1.js → index-C0x4zVBW.js} +2 -2
  74. package/dist/assets/index-C4pzdyRW.js +1 -0
  75. package/dist/assets/{index-B9lBWxnt.js → index-C8EYAWok.js} +2 -2
  76. package/dist/assets/index-CLD6I2fv.js +6 -0
  77. package/dist/assets/{index-a0ZdM5aG.js → index-COTyGW2s.js} +1 -1
  78. package/dist/assets/{index-BDaAwySV.js → index-CiIQJxvH.js} +1 -1
  79. package/dist/assets/{index-Cb1OPKJL.js → index-CksPySYI.js} +86 -93
  80. package/dist/assets/{index-DHIWtN6I.js → index-DJeuTVoT.js} +7 -7
  81. package/dist/assets/{index-DyKjKMmu.js → index-DODYa3Im.js} +1 -1
  82. package/dist/assets/{index-B1ljmpu4.css → index-DOq-_YXu.css} +1 -1
  83. package/dist/assets/{index-i5c4XeO-.js → index-D_z5kVUS.js} +1 -1
  84. package/dist/assets/{index-Cx-tuAMi.js → index-DdLPuFP7.js} +1 -1
  85. package/dist/assets/{index-BUrD6xiH.js → index-DxR1P6Lh.js} +4 -4
  86. package/dist/assets/{index-BOvzhuNp.js → index-htPha6tP.js} +2 -2
  87. package/dist/assets/{invitation-DGRUoRzD.js → invitation-sucipANy.js} +8 -8
  88. package/dist/assets/{invite-uoA9amq7.js → invite-Bkpf8YcY.js} +1 -1
  89. package/dist/assets/{issue-passport-2LsCG1Ym.js → issue-passport-Dm4XKvqR.js} +1 -1
  90. package/dist/assets/{item-taL0aTyr.js → item-CCsztPdL.js} +2 -2
  91. package/dist/assets/landing-page-BJMRDSCP.js +1 -0
  92. package/dist/assets/{layout-DAempiIX.js → layout-DV03YuuA.js} +1 -1
  93. package/dist/assets/list-BgP6u-5j.js +236 -0
  94. package/dist/assets/localization-CTzQFuMS.js +1 -0
  95. package/dist/assets/{log-CL673QLU.js → log-B4LRFTNR.js} +1 -1
  96. package/dist/assets/{logger-OMyVyA8K.js → logger-8RyN9oiF.js} +1 -1
  97. package/dist/assets/{login-CsMJeMSS.js → login-B6TE3gqj.js} +1 -1
  98. package/dist/assets/{login-oauth-callback-Bh6TJ59S.js → login-oauth-callback-CPP0UVME.js} +1 -1
  99. package/dist/assets/{logo-uploader-DFGj09Gp.js → logo-uploader-DMxsEq63.js} +3 -4
  100. package/dist/assets/{lost-passport-D00cnWl_.js → lost-passport-ekwdQ24A.js} +1 -1
  101. package/dist/assets/{omit-1zyydTZL.js → omit-DNeUY6_X.js} +1 -1
  102. package/dist/assets/{open-window-xLNOSl03.js → open-window-BjXpEOv2.js} +1 -1
  103. package/dist/assets/{overview-Ds0WiSnv.js → overview-CJRHh92f.js} +1 -1
  104. package/dist/assets/{page-header-BXC_EZqA.js → page-header-MKUHlyAT.js} +1 -1
  105. package/dist/assets/{passport-item-Dpr4rKdD.js → passport-item-jrknj0MQ.js} +1 -1
  106. package/dist/assets/{permission-DDLyDuSn.js → permission-PNXSTeNL.js} +1 -1
  107. package/dist/assets/{preferences-DXw1rfcr.js → preferences-9BJlt30G.js} +1 -1
  108. package/dist/assets/{profile-embed-co2rsGfl.js → profile-embed-CIWdUuC6.js} +1 -1
  109. package/dist/assets/publish-resource-BQg2Vwb0.js +1 -0
  110. package/dist/assets/{react-beautiful-dnd.esm-CeODMcuS.js → react-beautiful-dnd.esm-C1Wt0pHO.js} +1 -1
  111. package/dist/assets/{relative-time-DlN06RKr.js → relative-time-cijkMMnc.js} +1 -1
  112. package/dist/assets/runtime-71FSw-R0.js +1 -0
  113. package/dist/assets/sdk-BXECCi1q.js +1 -0
  114. package/dist/assets/{security-CHs7ENbZ.js → security-Y5seZEn6.js} +1 -1
  115. package/dist/assets/{session-j-9KoWbs.js → session-DLQ0rbYE.js} +1 -1
  116. package/dist/assets/{setup-CGwOCqjv.js → setup-4hj9RPfM.js} +12 -7
  117. package/dist/assets/{spaces-CZHg-rr5.js → spaces-CP1iyRKS.js} +1 -1
  118. package/dist/assets/{start-Chlvxw3J.js → start-Bt5Vo3K8.js} +1 -1
  119. package/dist/assets/{starting-progress-DpqgCEFM.js → starting-progress-yIv14mT6.js} +1 -1
  120. package/dist/assets/{status-XLk6MkKv.js → status-BKlS-OSq.js} +1 -1
  121. package/dist/assets/{step-actions-hjC-pbPT.js → step-actions-DMwF4axn.js} +1 -1
  122. package/dist/assets/{studio-DrYhFxCD.js → studio-BR3c6nt5.js} +1 -1
  123. package/dist/assets/{switch-control-CqfXXgvP.js → switch-control-yJOWKqcv.js} +1 -1
  124. package/dist/assets/{traffic-Dbf1L1c0.js → traffic-BzRbyLJ-.js} +1 -1
  125. package/dist/assets/{transfer-GcIVZcyL.js → transfer-Ds9NQ12A.js} +1 -1
  126. package/dist/assets/{unsubscribe-D2dQlJJM.js → unsubscribe-hfXD8-ea.js} +1 -1
  127. package/dist/assets/use-blocklet-logo-BOYeM9RY.js +1 -0
  128. package/dist/assets/{useAsync-DXeWUWXr.js → useAsync-GjVghrwi.js} +1 -1
  129. package/dist/assets/{useLocalStorage-Cb6R1F6v.js → useLocalStorage-CXDkfohf.js} +1 -1
  130. package/dist/assets/{user-center-D7lo6m0u.js → user-center-CBh-mxjZ.js} +1 -1
  131. package/dist/assets/{util-BcFfyz6S.js → util-D-LnEy9h.js} +1 -1
  132. package/dist/assets/{util-BYQQqvk1.js → util-DJFgW-07.js} +1 -1
  133. package/dist/assets/{vendor-arcblock-CX-5Ex_f.js → vendor-arcblock-Dkhgjlzn.js} +81 -81
  134. package/dist/assets/{vendor-hooks-DpLLpTSZ.js → vendor-hooks-DXGUREV9.js} +1 -1
  135. package/dist/assets/{vendor-utils-BUwfcN20.js → vendor-utils-CjMBJT5V.js} +17 -17
  136. package/dist/assets/vendor-ux-did-connect-D4-ZeZHm.js +2292 -0
  137. package/dist/assets/{wrap-locale-CzSOEkvO.js → wrap-locale-Dob_mf2V.js} +1 -1
  138. package/dist/index.html +6 -6
  139. package/dist/service-worker.js +2 -2
  140. package/package.json +43 -43
  141. package/dist/assets/api-BkKTvlm_.js +0 -1
  142. package/dist/assets/connect-BoejDqj-.js +0 -5
  143. package/dist/assets/dashboard-0TEl6bJJ.js +0 -280
  144. package/dist/assets/domains-Cn_DfzNS.js +0 -1
  145. package/dist/assets/index-Bco7nZ5q.js +0 -6
  146. package/dist/assets/index-CjZLIV87.js +0 -10
  147. package/dist/assets/index-DAer_mWn.js +0 -137
  148. package/dist/assets/index-M6peJL7s.js +0 -1
  149. package/dist/assets/landing-page-EY5bGAu7.js +0 -1
  150. package/dist/assets/list-B1E5dxgu.js +0 -236
  151. package/dist/assets/localization-Di0I0VVv.js +0 -1
  152. package/dist/assets/publish-resource-CBR18Gc3.js +0 -1
  153. package/dist/assets/runtime-nJVx0iKJ.js +0 -1
  154. package/dist/assets/sdk-DICk2ZHP.js +0 -1
  155. package/dist/assets/use-blocklet-logo-DryhoHen.js +0 -1
  156. package/dist/assets/vendor-ux-did-connect-DVrP2LNw.js +0 -2295
@@ -1,4 +1,4 @@
1
- import{ao as We,aF as At,aC as He,L as Pt,u as I,ar as It,a2 as L,a as J,b8 as Ve,r as Ge,a4 as Tt,bl as Ke,bA as kt,au as Et,G as Le}from"./vendor-ux-did-connect-DVrP2LNw.js";import{j as e,ca as Qe,aa as h,ab as M,T as A,ak as pe,e as G,v as ee,ad as _,b4 as Xe,H as i,q as Ye,b5 as qt,b6 as Lt,a9 as Ze,bL as _t,bX as $t,ah as Ft,al as H,w as Je,ap as Mt,cb as zt,cc as Bt,cd as Nt,ce as _e,cf as O,cg as Ut,O as Ot,m as Wt}from"./vendor-mui-core-B6POpIBB.js";import{A as Z,z as Ht,b as Vt,e as Gt,J as fe,at as Kt,au as Qt,n as $e}from"./vendor-utils-BUwfcN20.js";import{r as b,a as et,g as Xt}from"./vendor-react-DEoibe3W.js";import{d as Yt}from"./ExpandLess-DBN4huDO.js";import{c as Fe,q as Zt,r as Jt,T as en,W as tn,O as nn}from"./vendor-arcblock-CX-5Ex_f.js";import{aj as sn,ak as tt,z as F,C as xe,b as on,I as Me,al as rn,U as an,K as ln,am as nt,ai as le,an as it,ao as cn,f as st,ap as dn}from"./index-Cb1OPKJL.js";import{w as ot}from"./permission-DDLyDuSn.js";import{_ as un,D as ze}from"./dot-CaKxEi_0.js";import{C as he}from"./confirm-Bj4L0Vn8.js";import{A as mn}from"./actions-D-Helr6n.js";import{D as pn}from"./delete-confirm-kpan5KFX.js";import{d as fn,a as xn,g as hn,p as Be}from"./util-BYQQqvk1.js";import{_ as te}from"./useSetState-CWq0AVWn.js";import{d as gn}from"./InfoOutlined-BMb9Zu84.js";import{_ as Dn}from"./useAsync-DXeWUWXr.js";import{f as rt}from"./format-error-BrmqJs5a.js";import{I as yn}from"./index-i5c4XeO-.js";import{C as jn}from"./click-to-copy-CSwBjJDI.js";import{w as bn,m as vn,u as Y,s as Cn,y as wn}from"./vendor-hooks-DpLLpTSZ.js";import{d as Rn}from"./CheckCircle-Bxk_pKUt.js";const Sn=We({});Sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=Z("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=At()),n},n=>Promise.reject(n));const at=(...n)=>We(...n),An=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,Pn=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",r,d.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Ht(n,{opener:window.location.origin}),l},In="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",lt=async n=>{var m;if(!n||!(n!=null&&n.trim()))return null;const t=at(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(m=r==null?void 0:r.componentMountPoints)==null?void 0:m.find(f=>f.did===In),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),l=Z(d,"/api");return{base:d,api:l}},Tn=He({embed:{iconTip:"Click to view subscription details"},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"}}}),kn=He({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),En={zh:kn,en:Tn},qn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await lt(n);if(!r)return null;const o=at({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ct({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:l}=I(),[m,f]=bn({currentState:1}),p=b.useRef(null),g=vn(async()=>{const c=await qn({didDomainURL:s,delegatee:n,delegateePk:t});return c},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(c){console.error(c)}}),y=Y(c=>{var D,v,w,E;c.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=c.data)==null?void 0:D.nftDid,domain:(v=c.data)==null?void 0:v.domain,chainHost:(w=c.data)==null?void 0:w.chainHost}),(E=p.current)==null||E.close(),p.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});Cn(()=>{var c;try{window.removeEventListener("message",y),(c=p.current)==null||c.close(),p.current=null}catch(D){console.warn("Failed to close popup",D)}});const u=Y(()=>{f({currentState:1})}),j=Y(()=>{if(f({currentState:2}),!g.data){console.error("Failed to create session");return}x({sessionId:g.data.sessionId,baseURL:g.data.baseURL})}),x=Y(({sessionId:c,baseURL:D})=>{window.addEventListener("message",y);const v=new URL(D);v.searchParams.set("sessionId",c),v.searchParams.set("locale",r),v.searchParams.set("embed","1"),p.current=Pn(v.toString());const w=setInterval(()=>{var E;(E=p.current)!=null&&E.closed&&(clearInterval(w),u())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(Qe,{loading:g.loading,onClick:j,variant:"contained",startIcon:e.jsx(fn,{}),...d,children:o||l("buy.button.title")}),e.jsxs(It,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:u,children:[!g.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(M,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(A,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(A,{children:l("buy.status.success")})]}),g.error&&e.jsx(pe,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}const dt={onSuccess:()=>{},title:""};ct.defaultProps=dt;function ut(n){return e.jsx(Pt,{locale:n.locale,translations:En,children:e.jsx(ct,{...n})})}ut.defaultProps=dt;function mt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=te({safeIframeRef:null,popoverAnchorEl:null}),l=b.useRef(null),m=G(),f=ee(m.breakpoints.down("md")),p=j=>{d({popoverAnchorEl:j.currentTarget})},g=()=>{d({popoverAnchorEl:null})},y=wn(async()=>{const j=await lt(t);return j?j.base:null});if(!y.value)return null;if(y.loading)return e.jsx(M,{});const u=Z(y.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:Z(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:p,sx:An({cursor:"pointer"},r)})}),e.jsx(Xe,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:o("common.subscription"),width:f?"320px":"400px",height:"350px",style:{border:0},src:u})})]})}mt.defaultProps={sx:{}};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var S,P;const{t}=I(),[s,r]=b.useState(!1),{inService:o}=F(),[a,d]=b.useState(null),{siteId:l,domain:m,onAdd:f,children:p,did:g,issuing:y,setIssuing:u}=n,{api:j,ws:{useSubscription:x}}=F(),{mode:c,actions:{refreshDomainStatus:D}}=xe(),v=un(async()=>{const{cert:R}=await j.findCertificateByDomain({input:{domain:m,did:g}});return R}),w=(R,K)=>{R.domain===m&&(u(!1),r(!1),o&&c!=="setup"&&(K==="success"?L.success(t("setup.domain.genCertSuccess",{domain:R.domain})):K==="error"&&L.error(t("setup.domain.genCertFailed",{domain:R.domain,message:R.message}))))};if(b.useEffect(()=>{var R;v.loading||u(Ln((R=v.value)==null?void 0:R.status))},[v.loading,(S=v.value)==null?void 0:S.status,u]),x(Fe.BlockletEvents.certError,R=>w(R,"error")),x(Fe.BlockletEvents.certIssued,R=>{v.retry(),D(R.domain),w(R,"success")}),v.loading||((P=v.value)==null?void 0:P.status)==="normal")return"";const E=()=>{r(!1),d(null)},$=async()=>{r(!0);try{await j.issueLetsEncryptCert({input:{siteId:l,domain:m,did:g,inBlockletSetup:c==="setup"}}),f(),u(!0)}catch(R){console.error(R),u(!1)}finally{r(!1),d(null)}},z={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(pe,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:$,onCancel:E},oe=R=>{R.stopPropagation(),d(z)};return e.jsxs(e.Fragment,{children:[y?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(M,{size:13,style:{fontSize:"13px"}})}):p({loading:s,open:oe}),a&&e.jsx(he,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ge.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ge.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function De(n){const{domain:t,domainStatus:s,...r}=n;return sn(t)||!tt(t)||Vt(s)||s!=null&&s.isHttps?"":e.jsx(ge,{domain:t,...r})}De.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};De.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function ye(n){const{t}=I(),[s,r]=b.useState(!1),[o,a]=b.useState(null),{id:d,domain:l,children:m,teamDid:f,onDelete:p}=n,{api:g}=F(),y=()=>{r(!1),a(null)},u=async()=>{r(!0);try{await g.deleteDomainAlias({input:{id:d,domainAlias:l,teamDid:f}}),p==null||p(),await on(2e3)}catch(c){L.error(c.message)}finally{a(null),r(!1)}},j={keyName:l,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:l}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:l}),confirm:t("common.delete"),onConfirm:u,onCancel:y},x=c=>{c.stopPropagation(),a(j)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:s,open:x}):e.jsxs(J,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(M,{size:16}):e.jsx(Ve,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(pn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}ye.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};ye.defaultProps={children:null,teamDid:"",onDelete:null};function je({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(mn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var l;return e.jsx(ye,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,onDelete:r,children:({open:m})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ye,{disabled:t.isProtected||a,dense:!0,onClick:f=>{d(),m(f)},"data-cy":"action-toggle-block",children:[e.jsx(qt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ve,{})}),e.jsx(Lt,{primary:o("common.delete")})]},"remove")})})})}]})}je.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};je.defaultProps={onDelete:()=>{}};var be={},_n=Ze;Object.defineProperty(be,"__esModule",{value:!0});var pt=be.default=void 0,$n=_n(Ge()),Fn=e;pt=be.default=(0,$n.default)((0,Fn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");const ne=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function ve({certificate:n}){const[t,s]=b.useState(null),r=F(),{t:o,locale:a}=I(),d=f=>{s(f.currentTarget)},l=()=>{s(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(xn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(Xe,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(_t,{children:e.jsxs($t,{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(A,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(A,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(A,{component:"div",children:`${o("common.issuer")}: ${Gt(n,"issuer.commonName","")}`}),e.jsx(A,{component:"div",children:`${o("router.cert.issuedOn")}: ${Me(n.validFrom,a)}`}),e.jsx(A,{component:"div",children:`${o("router.cert.expiryOn")}: ${Me(n.validTo,a)}`})]})]})})})]})}ve.propTypes={certificate:i.object};ve.defaultProps={certificate:{}};function V({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!tt(r))return null;let a=null,d=null;const{isHttps:l,matchedCert:m}=o;if(!rn(r)){const{dns:{ip:p,isDnsResolved:g,isCnameMatch:y}={}}=o;g&&y||p==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(ze,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(ze,{color:"error"})})}l?d=e.jsx(ve,{certificate:m}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(pt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const f=t.map(p=>p==="domain"?a:p==="http"?d:null);return b.createElement(b.Fragment,null,...f)}V.propTypes={domain:ne.isRequired,filters:i.array};V.defaultProps={filters:["domain","http"]};const Mn=ot(ie,"mutate_blocklets"),zn=ot(ie,"",an);function Pi(n){const{inService:t}=F(),{blocklet:s,loadingRuntimeInfo:r}=xe();let o=Mn;return t&&(o=zn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Ne="nft-domain";function ie({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var c;const{t:l}=I(),m=ee(D=>D.breakpoints.down("md")),f=b.useMemo(()=>{let D=n;return ln(t)&&(D=D&&r),D},[n,r,t]),{site:p}=t,g=b.useMemo(()=>{var D;return nt((D=t.site)==null?void 0:D.domainAliases)},[(c=t.site)==null?void 0:c.domainAliases]),y=b.useMemo(()=>g.filter(D=>!le.isCustomDomain(D.value)),[g]),u=b.useMemo(()=>g.filter(D=>le.isCustomDomain(D.value)),[g]),j=b.useMemo(()=>u.filter(D=>D.type!==Ne),[u]),x=b.useMemo(()=>u.filter(D=>D.type===Ne),[u]);return e.jsxs(e.Fragment,{children:[e.jsxs(H,{gap:3,children:[!!x.length&&e.jsx(W,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:x,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsx(W,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:j,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!y.length&&e.jsxs(h,{children:[d,e.jsx(W,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:y,hasMutatePermission:f,blocklet:t,site:p,mobile:m,updateBlockletDomainAliases:a})]})]}),!g.length&&(s?e.jsx(M,{size:16}):e.jsx(Tt,{children:l("common.empty")}))]})}ie.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ie.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function ce({domain:n,children:t,...s}){const{t:r,locale:o}=I(),a=G(),{href:d,accessibility:l,value:m}=n,f=b.useCallback(()=>e.jsx(Ke,{content:fe(m),locale:o,style:{marginLeft:"4px",color:a.palette.text.secondary,fontSize:"0.8em"}}),[m,o,a]);return!l||l.loading?e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),f(),e.jsx(_,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(M,{size:13,style:{fontSize:"13px"}})})})]}):l.accessible?e.jsxs(ae,{component:"span",...s,children:[e.jsx(h,{component:"a",href:d,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),f()]}):e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&f()]})}ce.propTypes={domain:ne.isRequired,children:i.any.isRequired};const ae=Ft(h)`
1
+ import{an as We,aE as At,aB as He,L as Pt,u as I,aq as It,a2 as L,a as J,b7 as Ve,r as Ge,a4 as Tt,bk as Ke,bz as kt,at as Et,G as Le}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{j as e,ca as Qe,aa as h,ab as M,T as A,ak as pe,e as G,v as ee,ad as _,b4 as Xe,H as i,q as Ye,b5 as qt,b6 as Lt,a9 as Ze,bL as _t,bX as $t,ah as Ft,al as H,w as Je,ap as Mt,cb as zt,cc as Bt,cd as Nt,ce as _e,cf as O,cg as Ut,O as Ot,m as Wt}from"./vendor-mui-core-B6POpIBB.js";import{A as Z,z as Ht,b as Vt,e as Gt,J as fe,at as Kt,au as Qt,n as $e}from"./vendor-utils-CjMBJT5V.js";import{r as b,a as et,g as Xt}from"./vendor-react-DEoibe3W.js";import{d as Yt}from"./ExpandLess-TUium4RQ.js";import{c as Fe,q as Zt,r as Jt,T as en,W as tn,O as nn}from"./vendor-arcblock-Dkhgjlzn.js";import{aj as sn,ak as tt,z as F,C as xe,b as on,I as Me,al as rn,U as an,K as ln,am as nt,ai as le,an as it,ao as cn,f as st,ap as dn}from"./index-CksPySYI.js";import{w as ot}from"./permission-PNXSTeNL.js";import{_ as un,D as ze}from"./dot-WAAJ-O65.js";import{C as he}from"./confirm-BqrhdaU7.js";import{A as mn}from"./actions-BW0Vx00_.js";import{D as pn}from"./delete-confirm-CmXluMcs.js";import{d as fn,a as xn,g as hn,p as Be}from"./util-DJFgW-07.js";import{_ as te}from"./useSetState-CWq0AVWn.js";import{d as gn}from"./InfoOutlined-BjII93aR.js";import{_ as Dn}from"./useAsync-GjVghrwi.js";import{f as rt}from"./format-error-BrmqJs5a.js";import{I as yn}from"./index-D_z5kVUS.js";import{C as jn}from"./click-to-copy-0s0a7Ak5.js";import{w as bn,m as vn,u as Y,s as Cn,y as wn}from"./vendor-hooks-DXGUREV9.js";import{d as Rn}from"./CheckCircle-yKW43XdV.js";const Sn=We({});Sn.interceptors.request.use(n=>{const t=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=t||"",n.url=Z("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=At()),n},n=>Promise.reject(n));const at=(...n)=>We(...n),An=(n,t)=>t?n?[n,...Array.isArray(t)?t:[t]]:t:n,Pn=(n,{width:t=600,height:s=700,name:r="did-domain:popup"}={})=>{const o=window.screenX+(window.innerWidth-t)/2,a=window.screenY+(window.innerHeight-s)/2,d=[`left=${o}`,`top=${a}`,`width=${t}`,`height=${s}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",r,d.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Ht(n,{opener:window.location.origin}),l},In="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",lt=async n=>{var m;if(!n||!(n!=null&&n.trim()))return null;const t=at(),s=new URL(n);s.pathname="__blocklet__.js",s.searchParams.set("type","json");const{data:r}=await t.get(s.toString()),o=(m=r==null?void 0:r.componentMountPoints)==null?void 0:m.find(f=>f.did===In),a=new URL(n);a.pathname=o==null?void 0:o.mountPoint;const d=a.toString(),l=Z(d,"/api");return{base:d,api:l}},Tn=He({embed:{iconTip:"Click to view subscription details"},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"}}}),kn=He({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),En={zh:kn,en:Tn},qn=async({didDomainURL:n,delegatee:t,delegateePk:s})=>{const r=await lt(n);if(!r)return null;const o=at({baseURL:r.api}),{data:a}=await o.post("/payment/session",{delegatee:t,delegateePk:s});return{sessionId:a.sessionId,baseURL:r.base}};function ct({delegatee:n,delegateePk:t,didDomainURL:s,locale:r,title:o,onSuccess:a,...d}){const{t:l}=I(),[m,f]=bn({currentState:1}),p=b.useRef(null),g=vn(async()=>{const c=await qn({didDomainURL:s,delegatee:n,delegateePk:t});return c},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(c){console.error(c)}}),y=Y(c=>{var D,v,w,E;c.data.type==="didDomain.success"&&(a==null||a({nftDid:(D=c.data)==null?void 0:D.nftDid,domain:(v=c.data)==null?void 0:v.domain,chainHost:(w=c.data)==null?void 0:w.chainHost}),(E=p.current)==null||E.close(),p.current=null,f({currentState:4}),setTimeout(()=>{f({currentState:8})},2e3))});Cn(()=>{var c;try{window.removeEventListener("message",y),(c=p.current)==null||c.close(),p.current=null}catch(D){console.warn("Failed to close popup",D)}});const u=Y(()=>{f({currentState:1})}),j=Y(()=>{if(f({currentState:2}),!g.data){console.error("Failed to create session");return}x({sessionId:g.data.sessionId,baseURL:g.data.baseURL})}),x=Y(({sessionId:c,baseURL:D})=>{window.addEventListener("message",y);const v=new URL(D);v.searchParams.set("sessionId",c),v.searchParams.set("locale",r),v.searchParams.set("embed","1"),p.current=Pn(v.toString());const w=setInterval(()=>{var E;(E=p.current)!=null&&E.closed&&(clearInterval(w),u())},1e3);return()=>clearInterval(w)});return e.jsxs(e.Fragment,{children:[e.jsx(Qe,{loading:g.loading,onClick:j,variant:"contained",startIcon:e.jsx(fn,{}),...d,children:o||l("buy.button.title")}),e.jsxs(It,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:u,children:[!g.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(M,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(A,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(A,{children:l("buy.status.success")})]}),g.error&&e.jsx(pe,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}const dt={onSuccess:()=>{},title:""};ct.defaultProps=dt;function ut(n){return e.jsx(Pt,{locale:n.locale,translations:En,children:e.jsx(ct,{...n})})}ut.defaultProps=dt;function mt({nftDid:n,didDomainURL:t,locale:s,sx:r}){const{t:o}=I(),[a,d]=te({safeIframeRef:null,popoverAnchorEl:null}),l=b.useRef(null),m=G(),f=ee(m.breakpoints.down("md")),p=j=>{d({popoverAnchorEl:j.currentTarget})},g=()=>{d({popoverAnchorEl:null})},y=wn(async()=>{const j=await lt(t);return j?j.base:null});if(!y.value)return null;if(y.loading)return e.jsx(M,{});const u=Z(y.value,`/embed/domain?nft-did=${n}&locale=${s}`);return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:o("embed.iconTip"),children:e.jsx(h,{component:"img",src:Z(t,"/.well-known/service/blocklet/logo"),alt:"logo",width:16,height:16,onClick:p,sx:An({cursor:"pointer"},r)})}),e.jsx(Xe,{id:"popover-info",open:!!a.popoverAnchorEl,anchorEl:a.popoverAnchorEl,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:o("common.subscription"),width:f?"320px":"400px",height:"350px",style:{border:0},src:u})})]})}mt.defaultProps={sx:{}};const Ln=n=>["waiting","creating","renewaling"].includes(n);function ge(n){var S,P;const{t}=I(),[s,r]=b.useState(!1),{inService:o}=F(),[a,d]=b.useState(null),{siteId:l,domain:m,onAdd:f,children:p,did:g,issuing:y,setIssuing:u}=n,{api:j,ws:{useSubscription:x}}=F(),{mode:c,actions:{refreshDomainStatus:D}}=xe(),v=un(async()=>{const{cert:R}=await j.findCertificateByDomain({input:{domain:m,did:g}});return R}),w=(R,K)=>{R.domain===m&&(u(!1),r(!1),o&&c!=="setup"&&(K==="success"?L.success(t("setup.domain.genCertSuccess",{domain:R.domain})):K==="error"&&L.error(t("setup.domain.genCertFailed",{domain:R.domain,message:R.message}))))};if(b.useEffect(()=>{var R;v.loading||u(Ln((R=v.value)==null?void 0:R.status))},[v.loading,(S=v.value)==null?void 0:S.status,u]),x(Fe.BlockletEvents.certError,R=>w(R,"error")),x(Fe.BlockletEvents.certIssued,R=>{v.retry(),D(R.domain),w(R,"success")}),v.loading||((P=v.value)==null?void 0:P.status)==="normal")return"";const E=()=>{r(!1),d(null)},$=async()=>{r(!0);try{await j.issueLetsEncryptCert({input:{siteId:l,domain:m,did:g,inBlockletSetup:c==="setup"}}),f(),u(!0)}catch(R){console.error(R),u(!1)}finally{r(!1),d(null)}},z={title:t("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(pe,{severity:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:$,onCancel:E},oe=R=>{R.stopPropagation(),d(z)};return e.jsxs(e.Fragment,{children:[y?e.jsx(_,{title:t("router.cert.issuing"),children:e.jsx(M,{size:13,style:{fontSize:"13px"}})}):p({loading:s,open:oe}),a&&e.jsx(he,{color:"primary",title:a.title,description:a.description,confirm:a.confirm,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})]})}ge.propTypes={domain:i.string.isRequired,did:i.string.isRequired,siteId:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};ge.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function De(n){const{domain:t,domainStatus:s,...r}=n;return sn(t)||!tt(t)||Vt(s)||s!=null&&s.isHttps?"":e.jsx(ge,{domain:t,...r})}De.propTypes={domain:i.string.isRequired,domainStatus:i.shape({isHttps:i.bool}).isRequired,did:i.string.isRequired,onAdd:i.func,children:i.any,issuing:i.bool,setIssuing:i.func};De.defaultProps={onAdd:()=>{},children:null,issuing:!1,setIssuing:()=>{}};function ye(n){const{t}=I(),[s,r]=b.useState(!1),[o,a]=b.useState(null),{id:d,domain:l,children:m,teamDid:f,onDelete:p}=n,{api:g}=F(),y=()=>{r(!1),a(null)},u=async()=>{r(!0);try{await g.deleteDomainAlias({input:{id:d,domainAlias:l,teamDid:f}}),p==null||p(),await on(2e3)}catch(c){L.error(c.message)}finally{a(null),r(!1)}},j={keyName:l,title:t("router.domainAlias.delete.title"),description:t("router.domainAlias.delete.description",{domain:l}),confirmPlaceholder:t("router.domainAlias.delete.confirmPlaceholder",{domain:l}),confirm:t("common.delete"),onConfirm:u,onCancel:y},x=c=>{c.stopPropagation(),a(j)};return e.jsxs(e.Fragment,{children:[typeof m=="function"?m({loading:s,open:x}):e.jsxs(J,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[s?e.jsx(M,{size:16}):e.jsx(Ve,{style:{fontSize:16}}),t("common.delete")]}),o&&e.jsx(pn,{keyName:o.keyName,title:o.title,description:o.description,confirmPlaceholder:o.confirmPlaceholder,confirm:o.confirm,params:o.params,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}ye.propTypes={id:i.string.isRequired,domain:i.string.isRequired,children:i.any,teamDid:i.string,onDelete:i.func};ye.defaultProps={children:null,teamDid:"",onDelete:null};function je({site:n,domain:t,blocklet:s,onDelete:r}){const{t:o}=I(),a=t.value===window.location.hostname;return e.jsx(mn,{"data-cy":"domain-actions",size:"large",actions:[({close:d})=>{var l;return e.jsx(ye,{id:n.id,domain:t.value,teamDid:(l=s==null?void 0:s.meta)==null?void 0:l.did,onDelete:r,children:({open:m})=>e.jsx(_,{title:a?o("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Ye,{disabled:t.isProtected||a,dense:!0,onClick:f=>{d(),m(f)},"data-cy":"action-toggle-block",children:[e.jsx(qt,{style:{minWidth:24,marginRight:8},children:e.jsx(Ve,{})}),e.jsx(Lt,{primary:o("common.delete")})]},"remove")})})})}]})}je.propTypes={site:i.object.isRequired,domain:i.object.isRequired,blocklet:i.object.isRequired,onDelete:i.func};je.defaultProps={onDelete:()=>{}};var be={},_n=Ze;Object.defineProperty(be,"__esModule",{value:!0});var pt=be.default=void 0,$n=_n(Ge()),Fn=e;pt=be.default=(0,$n.default)((0,Fn.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-1 6h2v2h-2zm0 4h2v6h-2z"}),"PrivacyTip");const ne=i.shape({href:i.string,accessibility:i.shape({loading:i.bool,accessible:i.bool}),domainStatus:i.shape({isHttps:i.bool,matchedCert:i.object}),dns:i.shape({resolved:i.bool,ip:i.string})});function ve({certificate:n}){const[t,s]=b.useState(null),r=F(),{t:o,locale:a}=I(),d=f=>{s(f.currentTarget)},l=()=>{s(null)},m=!!t;return e.jsxs(e.Fragment,{children:[e.jsx(xn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:d,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx(Xe,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(_t,{children:e.jsxs($t,{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(A,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(A,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(A,{component:"div",children:`${o("common.issuer")}: ${Gt(n,"issuer.commonName","")}`}),e.jsx(A,{component:"div",children:`${o("router.cert.issuedOn")}: ${Me(n.validFrom,a)}`}),e.jsx(A,{component:"div",children:`${o("router.cert.expiryOn")}: ${Me(n.validTo,a)}`})]})]})})})]})}ve.propTypes={certificate:i.object};ve.defaultProps={certificate:{}};function V({domain:n,filters:t}){const{t:s}=I(),{value:r,domainStatus:o}=n;if(!tt(r))return null;let a=null,d=null;const{isHttps:l,matchedCert:m}=o;if(!rn(r)){const{dns:{ip:p,isDnsResolved:g,isCnameMatch:y}={}}=o;g&&y||p==="127.0.0.1"?a=e.jsx(_,{title:s("router.domain.verify.ok"),children:e.jsx(ze,{color:"success"})}):a=e.jsx(_,{title:s("router.domain.verify.notResolved"),children:e.jsx(ze,{color:"error"})})}l?d=e.jsx(ve,{certificate:m}):d=e.jsx(_,{title:s("router.domain.https.bad"),children:e.jsx(pt,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const f=t.map(p=>p==="domain"?a:p==="http"?d:null);return b.createElement(b.Fragment,null,...f)}V.propTypes={domain:ne.isRequired,filters:i.array};V.defaultProps={filters:["domain","http"]};const Mn=ot(ie,"mutate_blocklets"),zn=ot(ie,"",an);function Pi(n){const{inService:t}=F(),{blocklet:s,loadingRuntimeInfo:r}=xe();let o=Mn;return t&&(o=zn),e.jsx(o,{...n,blocklet:s,inService:t,loadingRuntimeInfo:r})}const Ne="nft-domain";function ie({hasPermission:n,blocklet:t,loadingRuntimeInfo:s,inService:r,showAllDomains:o,updateBlockletDomainAliases:a,systemTips:d}){var c;const{t:l}=I(),m=ee(D=>D.breakpoints.down("md")),f=b.useMemo(()=>{let D=n;return ln(t)&&(D=D&&r),D},[n,r,t]),{site:p}=t,g=b.useMemo(()=>{var D;return nt((D=t.site)==null?void 0:D.domainAliases)},[(c=t.site)==null?void 0:c.domainAliases]),y=b.useMemo(()=>g.filter(D=>!le.isCustomDomain(D.value)),[g]),u=b.useMemo(()=>g.filter(D=>le.isCustomDomain(D.value)),[g]),j=b.useMemo(()=>u.filter(D=>D.type!==Ne),[u]),x=b.useMemo(()=>u.filter(D=>D.type===Ne),[u]);return e.jsxs(e.Fragment,{children:[e.jsxs(H,{gap:3,children:[!!x.length&&e.jsx(W,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:x,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!j.length&&e.jsx(W,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:j,hasMutatePermission:f,blocklet:t,site:p,mobile:m,showAllDomains:o,updateBlockletDomainAliases:a}),!!y.length&&e.jsxs(h,{children:[d,e.jsx(W,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:y,hasMutatePermission:f,blocklet:t,site:p,mobile:m,updateBlockletDomainAliases:a})]})]}),!g.length&&(s?e.jsx(M,{size:16}):e.jsx(Tt,{children:l("common.empty")}))]})}ie.propTypes={hasPermission:i.bool,blocklet:i.object.isRequired,loadingRuntimeInfo:i.bool,inService:i.bool.isRequired,showAllDomains:i.bool,updateBlockletDomainAliases:i.func,systemTips:i.node};ie.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1,showAllDomains:!1,updateBlockletDomainAliases:()=>{},systemTips:null};function ce({domain:n,children:t,...s}){const{t:r,locale:o}=I(),a=G(),{href:d,accessibility:l,value:m}=n,f=b.useCallback(()=>e.jsx(Ke,{content:fe(m),locale:o,style:{marginLeft:"4px",color:a.palette.text.secondary,fontSize:"0.8em"}}),[m,o,a]);return!l||l.loading?e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),f(),e.jsx(_,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(M,{size:13,style:{fontSize:"13px"}})})})]}):l.accessible?e.jsxs(ae,{component:"span",...s,children:[e.jsx(h,{component:"a",href:d,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(_,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:t})})}),f()]}):e.jsxs(ae,{component:"span",...s,children:[e.jsx(_,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:t})}),!n.loading&&f()]})}ce.propTypes={domain:ne.isRequired,children:i.any.isRequired};const ae=Ft(h)`
2
2
  display: inline-block;
3
3
  vertical-align: middle;
4
4
 
@@ -0,0 +1 @@
1
+ import{r as m}from"./vendor-react-DEoibe3W.js";import{u as n}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{C as p,z as l,K as c,f as u}from"./index-CksPySYI.js";import{a as x,b as d}from"./domain-action-card-DIGUxqW7.js";import{j as t,aa as k,al as f,ak as h}from"./vendor-mui-core-B6POpIBB.js";import"./vendor-utils-CjMBJT5V.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Dkhgjlzn.js";import"./ExpandLess-TUium4RQ.js";import"./permission-PNXSTeNL.js";import"./session-DLQ0rbYE.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./confirm-BqrhdaU7.js";import"./format-error-BrmqJs5a.js";import"./actions-BW0Vx00_.js";import"./MoreHoriz-DHyMdwpT.js";import"./delete-confirm-CmXluMcs.js";import"./click-to-copy-0s0a7Ak5.js";import"./util-DJFgW-07.js";import"./useSetState-CWq0AVWn.js";import"./InfoOutlined-BjII93aR.js";import"./index-D_z5kVUS.js";import"./CheckCircle-yKW43XdV.js";function D(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{maxWidth:820},gap:3,children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}D.propTypes={};export{D as default};
@@ -1,4 +1,4 @@
1
- import{x as m}from"./vendor-hooks-DpLLpTSZ.js";import{r as v}from"./vendor-react-DEoibe3W.js";import{u as y}from"./useAsync-DXeWUWXr.js";import{ah as p}from"./vendor-mui-core-B6POpIBB.js";var c={};Object.defineProperty(c,"__esModule",{value:!0});var t=m,i=v,b=t.__importDefault(y),A=function(r,e){e===void 0&&(e=[]);var a=i.useState(0),l=a[0],_=a[1],s=b.default(r,t.__spreadArrays(e,[l])),o=s.loading,d=i.useCallback(function(){o||_(function(f){return f+1})},t.__spreadArrays(e,[o]));return t.__assign(t.__assign({},s),{retry:d})},D=c.default=A;const n={success:"#3ab39d",error:"#D0021B"},u="10px",k=p.div`
1
+ import{x as m}from"./vendor-hooks-DXGUREV9.js";import{r as v}from"./vendor-react-DEoibe3W.js";import{u as y}from"./useAsync-GjVghrwi.js";import{ah as p}from"./vendor-mui-core-B6POpIBB.js";var c={};Object.defineProperty(c,"__esModule",{value:!0});var t=m,i=v,b=t.__importDefault(y),A=function(r,e){e===void 0&&(e=[]);var a=i.useState(0),l=a[0],_=a[1],s=b.default(r,t.__spreadArrays(e,[l])),o=s.loading,d=i.useCallback(function(){o||_(function(f){return f+1})},t.__spreadArrays(e,[o]));return t.__assign(t.__assign({},s),{retry:d})},D=c.default=A;const n={success:"#3ab39d",error:"#D0021B"},u="10px",k=p.div`
2
2
  display: inline-block;
3
3
  min-width: ${r=>r.size||u};
4
4
  min-height: ${r=>r.size||u};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
2
- import{_ as b,H as ee,l as te}from"./vendor-arcblock-CX-5Ex_f.js";import{a9 as se,j as e,al as g,T as w,y as T,ap as ne,aa as z,O as H,ab as ie,ah as oe}from"./vendor-mui-core-B6POpIBB.js";import{r as o,h as re}from"./vendor-react-DEoibe3W.js";import{J as h}from"./vendor-utils-BUwfcN20.js";import{n as p,r as ae,u as ce,w as le,a2 as j,a0 as ue,v as de,aE as fe}from"./vendor-ux-did-connect-DVrP2LNw.js";import{L as me}from"./landing-page-EY5bGAu7.js";import{u as pe,d as M}from"./index-Cb1OPKJL.js";import{f as S}from"./format-error-BrmqJs5a.js";import{d as ge}from"./CheckCircle-Bxk_pKUt.js";import{g as D}from"./get-safe-url-BTmcSfZP.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";var N;(N=window.env)!=null&&N.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},he=se;Object.defineProperty(P,"__esModule",{value:!0});var F=P.default=void 0,ye=he(ae()),xe=e;F=P.default=(0,ye.default)((0,xe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const Ee=oe.form`
2
+ import{_ as b,H as ee,l as te}from"./vendor-arcblock-Dkhgjlzn.js";import{a9 as se,j as e,al as g,T as w,y as R,ap as ne,aa as z,O as H,ab as ie,ah as oe}from"./vendor-mui-core-B6POpIBB.js";import{r as o,h as re}from"./vendor-react-DEoibe3W.js";import{J as h}from"./vendor-utils-CjMBJT5V.js";import{n as p,r as ae,u as ce,w as le,a2 as j,a0 as ue,v as de,aD as fe}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{L as me}from"./landing-page-BJMRDSCP.js";import{u as pe,d as M}from"./index-CksPySYI.js";import{f as S}from"./format-error-BrmqJs5a.js";import{d as ge}from"./CheckCircle-yKW43XdV.js";import{g as T}from"./get-safe-url-C-CJKtkC.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";var N;(N=window.env)!=null&&N.groupPathPrefix;p.ROLES.ADMIN,p.ROLES.OWNER;const y=()=>{const{searchParams:u}=new URL(window.location.href);return u.get("fromWallet")==="1"};var P={},he=se;Object.defineProperty(P,"__esModule",{value:!0});var F=P.default=void 0,ye=he(ae()),xe=e;F=P.default=(0,ye.default)((0,xe.jsx)("path",{d:"M12 19c0-3.87 3.13-7 7-7 1.08 0 2.09.25 3 .68V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1M4 6l8 5 8-5v2l-8 5-8-5zm13.34 16-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34z"}),"MarkEmailRead");const Ee=oe.form`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  align-items: center;
@@ -15,4 +15,4 @@ import{_ as b,H as ee,l as te}from"./vendor-arcblock-CX-5Ex_f.js";import{a9 as s
15
15
  div.Mui-focused input {
16
16
  caret-color: ${u=>u.theme.palette.primary.main};
17
17
  }
18
- `,ve=u=>{try{if(!u)return null;const r=fe.fromBase64(u).toString();return te(r)?r:null}catch{return null}};function Pe(){var V,W;const u=o.useRef(null),{session:r,connectApi:I}=pe(),{t:s,locale:d}=ce(),[x,L]=o.useState(((V=r.user)==null?void 0:V.email)||""),[a,A]=o.useState(""),[E,_]=o.useState(!1),[U,q]=o.useState(!1),[l,G]=o.useState(!1),[Y,K]=o.useState(!1),[v,J]=o.useState(!1),{wallet:f}=le(),[c]=re(),O=c.get("inviter")||localStorage.getItem("inviter"),m=c.get("updateKyc")==="1";o.useEffect(()=>{const n=c.get("subject"),t=ve(n);t&&L(t)},[]),o.useEffect(()=>{var n;(n=r.user)!=null&&n.emailVerified&&m&&(K(!0),setTimeout(()=>{if(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(t=>t.i),__vite__mapDeps([0,1])).then(t=>{t.call("arcClosePage")});return}window.location.href=D(c.get("redirect")||"/")},1e3))},[r.user,m,f,c]);const Q=o.useCallback(async n=>{var t;n.preventDefault(),_(!0);try{await M.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{_(!1)}},[x,d,s]),k=o.useCallback(async n=>{var t;n&&n.preventDefault(),_(!0);try{await M.post(`/kyc/email/verify?locale=${d}`,{code:a}),K(!0),I.open({locale:d,action:"issue-kyc",extraParams:{code:a,updateKyc:c.get("updateKyc")||"0",inviter:O||""},className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!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:()=>{J(!0),I.close(),m?(r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(i=>i.i),__vite__mapDeps([0,1])).then(i=>{i.call("arcClosePage")});return}window.location.href=D(c.get("redirect")||"/")},1e3)):f&&y()&&b(()=>import("./index-CPE8Apzb.js").then(i=>i.i),__vite__mapDeps([0,1])).then(i=>{i.call("arcClosePage")})},onError:i=>{j.error(S(i))}})}catch(i){K(!1),j.error(S(i)),(t=document.getElementById(`code-input-${h(a).length-1}`))==null||t.focus()}finally{_(!1)}},[a,d,c,m,f,O]);o.useEffect(()=>{l&&h(a).length===p.VERIFY_CODE_LENGTH&&k()},[a,k,l]);const X=o.useCallback(()=>{q(!0),I.open({locale:d,action:"update-kyc",className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!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(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(n=>n.i),__vite__mapDeps([0,1])).then(n=>{n.call("arcClosePage")});return}window.location.href=D(c.get("redirect")||"/")},2e3)},onError:n=>{j.error(S(n))}})},[d,c,f]),R=o.useCallback(n=>{if(!l)return;n.preventDefault();const t=h(n.clipboardData.getData("text/plain").slice(0,p.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;A(t.padEnd(p.VERIFY_CODE_LENGTH," "));const i=document.getElementById(`code-input-${t.length}`);i&&i.focus()},[l]);o.useEffect(()=>(document.addEventListener("paste",R),()=>{document.removeEventListener("paste",R)}),[R]);const B=y()?s("login.issueKyc.issueTitle"):s("login.issueKyc.verifyTitle"),Z=y()?s("login.issueKyc.issueAction"):s("login.issueKyc.verifyAction");return e.jsxs(me,{did:(W=window.blocklet)==null?void 0:W.appPid,children:[e.jsx(ee,{children:e.jsx("title",{children:B})}),e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",px:2,boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(g,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[v?e.jsx(ge,{sx:{fontSize:72},color:"success"}):e.jsx(F,{sx:{fontSize:72},color:"primary"}),e.jsx(w,{variant:"h5",sx:{textAlign:"center"},children:B}),!v&&e.jsx(w,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:s("login.issueKyc.pageDescription")}),v&&e.jsx(w,{variant:"body1",sx:{textAlign:"center"},children:s("login.issueKyc.success")}),v&&e.jsx(T,{variant:"contained",color:"primary",component:ne,href:"/",size:"large",children:s("login.issueKyc.backToHome")}),!v&&r.user&&e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(w,{variant:"body2",color:"info.main",sx:{textAlign:"center",mt:1},children:s("login.issueKyc.issueTarget",{action:Z})}),e.jsxs(g,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{width:"100%",maxWidth:360},children:[e.jsx(ue,{did:r.user.did,responsive:!0,copyable:!0,showQrcode:!1}),e.jsx(de,{locale:d,session:r,showRole:!0,showManageBlocklet:!1})]})]})]}),e.jsx(z,{ref:u,sx:{width:"100%"},children:!Y&&!U&&e.jsxs(Ee,{onSubmit:l?k:Q,children:[!l&&e.jsx(H,{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}),l&&e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(w,{variant:"body2",textAlign:"center",children:s("login.issueKyc.codeSentMessage",{email:x})}),e.jsx(z,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(p.VERIFY_CODE_LENGTH)].map((n,t)=>e.jsx(H,{value:h(a[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:i=>{var $;const C=a.split("");C[t]=i.target.value,A(C.join("")),i.target.value&&t<5&&(($=document.getElementById(`code-input-${t+1}`))==null||$.focus())},onKeyDown:i=>{var C;i.key==="Backspace"&&!h(a[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(g,{direction:"row",justifyContent:m?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[m&&e.jsx(T,{variant:"text",disabled:E,onClick:X,size:"large",children:s("login.updateKyc.button")}),e.jsx(T,{type:"submit",size:"large",variant:"contained",disabled:E||!x||l&&h(a).length!==p.VERIFY_CODE_LENGTH,sx:{width:m?"auto":"100%"},children:E?e.jsx(ie,{size:24}):s(l?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{Pe as default};
18
+ `,ve=u=>{try{if(!u)return null;const r=fe.fromBase64(u).toString();return te(r)?r:null}catch{return null}};function Pe(){var V,W;const u=o.useRef(null),{session:r,connectApi:I}=pe(),{t:s,locale:d}=ce(),[x,L]=o.useState(((V=r.user)==null?void 0:V.email)||""),[a,A]=o.useState(""),[E,_]=o.useState(!1),[U,q]=o.useState(!1),[l,G]=o.useState(!1),[Y,K]=o.useState(!1),[v,J]=o.useState(!1),{wallet:f}=le(),[c]=re(),O=c.get("inviter")||localStorage.getItem("inviter"),m=c.get("updateKyc")==="1";o.useEffect(()=>{const n=c.get("subject"),t=ve(n);t&&L(t)},[]),o.useEffect(()=>{var n;(n=r.user)!=null&&n.emailVerified&&m&&(K(!0),setTimeout(()=>{if(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(t=>t.i),__vite__mapDeps([0,1])).then(t=>{t.call("arcClosePage")});return}window.location.href=T(c.get("redirect")||"/")},1e3))},[r.user,m,f,c]);const Q=o.useCallback(async n=>{var t;n.preventDefault(),_(!0);try{await M.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{_(!1)}},[x,d,s]),k=o.useCallback(async n=>{var t;n&&n.preventDefault(),_(!0);try{await M.post(`/kyc/email/verify?locale=${d}`,{code:a}),K(!0),I.open({locale:d,action:"issue-kyc",extraParams:{code:a,updateKyc:c.get("updateKyc")||"0",inviter:O||""},className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!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:()=>{J(!0),I.close(),m?(r.refresh({showProgress:!1,forceRefreshToken:!0}),setTimeout(()=>{if(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(i=>i.i),__vite__mapDeps([0,1])).then(i=>{i.call("arcClosePage")});return}window.location.href=T(c.get("redirect")||"/")},1e3)):f&&y()&&b(()=>import("./index-CPE8Apzb.js").then(i=>i.i),__vite__mapDeps([0,1])).then(i=>{i.call("arcClosePage")})},onError:i=>{j.error(S(i))}})}catch(i){K(!1),j.error(S(i)),(t=document.getElementById(`code-input-${h(a).length-1}`))==null||t.focus()}finally{_(!1)}},[a,d,c,m,f,O]);o.useEffect(()=>{l&&h(a).length===p.VERIFY_CODE_LENGTH&&k()},[a,k,l]);const X=o.useCallback(()=>{q(!0),I.open({locale:d,action:"update-kyc",className:"connect",popup:!0,saveConnect:!1,forceConnected:!0,hideCloseButton:!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(f&&y()){b(()=>import("./index-CPE8Apzb.js").then(n=>n.i),__vite__mapDeps([0,1])).then(n=>{n.call("arcClosePage")});return}window.location.href=T(c.get("redirect")||"/")},2e3)},onError:n=>{j.error(S(n))}})},[d,c,f]),D=o.useCallback(n=>{if(!l)return;n.preventDefault();const t=h(n.clipboardData.getData("text/plain").slice(0,p.VERIFY_CODE_LENGTH));if(!/^\d+$/.test(t))return;A(t.padEnd(p.VERIFY_CODE_LENGTH," "));const i=document.getElementById(`code-input-${t.length}`);i&&i.focus()},[l]);o.useEffect(()=>(document.addEventListener("paste",D),()=>{document.removeEventListener("paste",D)}),[D]);const B=y()?s("login.issueKyc.issueTitle"):s("login.issueKyc.verifyTitle"),Z=y()?s("login.issueKyc.issueAction"):s("login.issueKyc.verifyAction");return e.jsxs(me,{did:(W=window.blocklet)==null?void 0:W.appPid,children:[e.jsx(ee,{children:e.jsx("title",{children:B})}),e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",sx:{width:"560px",px:2,boxSizing:"border-box",maxWidth:"100%",height:"100%"},children:[e.jsxs(g,{spacing:1,justifyContent:"center",alignItems:"center",sx:{mb:3},children:[v?e.jsx(ge,{sx:{fontSize:72},color:"success"}):e.jsx(F,{sx:{fontSize:72},color:"primary"}),e.jsx(w,{variant:"h5",sx:{textAlign:"center"},children:B}),!v&&e.jsx(w,{variant:"body2",color:"text.secondary",sx:{textAlign:"center"},children:s("login.issueKyc.pageDescription")}),v&&e.jsx(w,{variant:"body1",sx:{textAlign:"center"},children:s("login.issueKyc.success")}),v&&e.jsx(R,{variant:"contained",color:"primary",component:ne,href:"/",size:"large",children:s("login.issueKyc.backToHome")}),!v&&r.user&&e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",children:[e.jsx(w,{variant:"body2",color:"info.main",sx:{textAlign:"center",mt:1},children:s("login.issueKyc.issueTarget",{action:Z})}),e.jsxs(g,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{width:"100%",maxWidth:360},children:[e.jsx(ue,{did:r.user.did,responsive:!0,copyable:!0,showQrcode:!1}),e.jsx(de,{locale:d,session:r,showRole:!0,showManageBlocklet:!1})]})]})]}),e.jsx(z,{ref:u,sx:{width:"100%"},children:!Y&&!U&&e.jsxs(Ee,{onSubmit:l?k:Q,children:[!l&&e.jsx(H,{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}),l&&e.jsxs(g,{direction:"column",justifyContent:"center",alignItems:"center",spacing:2,children:[e.jsx(w,{variant:"body2",textAlign:"center",children:s("login.issueKyc.codeSentMessage",{email:x})}),e.jsx(z,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"space-between"},children:[...Array(p.VERIFY_CODE_LENGTH)].map((n,t)=>e.jsx(H,{value:h(a[t])||"",type:"number",inputProps:{maxLength:1,style:{textAlign:"center",fontSize:"1.5rem"},autoComplete:"off"},sx:{width:"14%"},onChange:i=>{var $;const C=a.split("");C[t]=i.target.value,A(C.join("")),i.target.value&&t<5&&(($=document.getElementById(`code-input-${t+1}`))==null||$.focus())},onKeyDown:i=>{var C;i.key==="Backspace"&&!h(a[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(g,{direction:"row",justifyContent:m?"space-between":"center",alignItems:"center",spacing:2,sx:{width:"100%",maxWidth:360},children:[m&&e.jsx(R,{variant:"text",disabled:E,onClick:X,size:"large",children:s("login.updateKyc.button")}),e.jsx(R,{type:"submit",size:"large",variant:"contained",disabled:E||!x||l&&h(a).length!==p.VERIFY_CODE_LENGTH,sx:{width:m?"auto":"100%"},children:E?e.jsx(ie,{size:24}):s(l?"login.issueKyc.verifyButton":"login.issueKyc.sendCodeButton")})]})]})})]})]})}export{Pe as default};
@@ -1 +1 @@
1
- import{j as e,ab as C,aa as T}from"./vendor-mui-core-B6POpIBB.js";import{r as W,f as j}from"./vendor-react-DEoibe3W.js";import{u as k,G as L,at as S,a2 as h,n as b,b5 as I}from"./vendor-ux-did-connect-DVrP2LNw.js";import{L as R}from"./landing-page-EY5bGAu7.js";import{w as U}from"./wrap-locale-CzSOEkvO.js";import{g as v}from"./get-safe-url-BYr2jgRv.js";import{S as N,s as _,a as B}from"./index-Cb1OPKJL.js";import"./vendor-utils-BUwfcN20.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CX-5Ex_f.js";function F({SessionContext:a,webWalletUrl:n,onSuccess:s}){var d,g;const{api:t,session:i}=W.useContext(a),{t:o,locale:f}=k(),u=j(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),w=async(r,E)=>{s(r,E),await i.refresh(),h.success(o("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(b.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=v(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{h.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(L,{children:e.jsx(C,{})}):e.jsx(R,{did:((d=window==null?void 0:window.blocklet)==null?void 0:d.appPid)||((g=window==null?void 0:window.env)==null?void 0:g.appPid),children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(S,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:n,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:m,extraContent:null,hideCloseButton:!0})})})}const A=U(F);function J(){const a=I(),n=(s,t)=>{s.sessionToken&&(_(t(s.sessionToken)),B(t(s.refreshToken)))};return e.jsx(A,{SessionContext:N,webWalletUrl:a,onSuccess:n})}export{J as default};
1
+ import{j as e,ab as C,aa as T}from"./vendor-mui-core-B6POpIBB.js";import{r as W,f as j}from"./vendor-react-DEoibe3W.js";import{u as k,G as L,as as S,a2 as h,n as b,b4 as I}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{L as R}from"./landing-page-BJMRDSCP.js";import{w as U}from"./wrap-locale-Dob_mf2V.js";import{g as v}from"./get-safe-url-cyoeQ7Mw.js";import{S as N,s as _,a as B}from"./index-CksPySYI.js";import"./vendor-utils-CjMBJT5V.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Dkhgjlzn.js";function F({SessionContext:a,webWalletUrl:n,onSuccess:s}){var d,g;const{api:t,session:i}=W.useContext(a),{t:o,locale:f}=k(),u=j(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),w=async(r,E)=>{s(r,E),await i.refresh(),h.success(o("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(b.WELLKNOWN_SERVICE_PATH_PREFIX)?u(c,{replace:!0}):window.location.href=v(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},P=r=>{h.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(L,{children:e.jsx(C,{})}):e.jsx(R,{did:((d=window==null?void 0:window.blocklet)==null?void 0:d.appPid)||((g=window==null?void 0:window.env)==null?void 0:g.appPid),children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(S,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:n,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:m,extraContent:null,hideCloseButton:!0})})})}const A=U(F);function J(){const a=I(),n=(s,t)=>{s.sessionToken&&(_(t(s.sessionToken)),B(t(s.refreshToken)))};return e.jsx(A,{SessionContext:N,webWalletUrl:a,onSuccess:n})}export{J as default};
@@ -1,4 +1,4 @@
1
- import{j as e,aa as t,ab as P,ap as W,H as d,ah as B}from"./vendor-mui-core-B6POpIBB.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{A as v}from"./vendor-utils-BUwfcN20.js";import{d as I}from"./Launch-CVPYIHzD.js";import{b6 as L,at as $}from"./vendor-ux-did-connect-DVrP2LNw.js";import{W as A}from"./did-address-CJZtrzhT.js";import{P as E}from"./page-header-BXC_EZqA.js";import{n as T,u as z}from"./index-Cb1OPKJL.js";import{S as D}from"./layout-DAempiIX.js";import{S as F}from"./step-actions-hjC-pbPT.js";import{S as m}from"./button-DRqMfYjF.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CX-5Ex_f.js";import"./content-layout-C3Yd4mK9.js";import"./use-mobile-BNUwcWCH.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:h,actions:j}=T(),{api:y}=z(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(H,{children:[e.jsx("div",{className:"header",children:e.jsx(E,{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:`${p} ${C}`}),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(A,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(I,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx($,{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:k,...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:p})]}),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:b})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const H=B(D)`
1
+ import{j as e,aa as t,ab as P,ap as W,H as d,ah as B}from"./vendor-mui-core-B6POpIBB.js";import{r as l}from"./vendor-react-DEoibe3W.js";import{A as v}from"./vendor-utils-CjMBJT5V.js";import{d as I}from"./Launch-ryL3I8d9.js";import{b5 as L,as as $}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{W as A}from"./did-address-C6ni99I7.js";import{P as E}from"./page-header-MKUHlyAT.js";import{n as T,u as z}from"./index-CksPySYI.js";import{S as D}from"./layout-DV03YuuA.js";import{S as F}from"./step-actions-DMwF4axn.js";import{S as m}from"./button-h00yLUET.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Dkhgjlzn.js";import"./content-layout-C3Yd4mK9.js";import"./use-mobile-BKvZ6hcv.js";function u({onNext:n,onPrevious:f}){const{locale:x,t:s}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:h,actions:j}=T(),{api:y}=z(),[g,o]=l.useState(!1),{need:p="",current:b="",owe:r=99999,deficiency:k,symbol:C="",endpoint:i}=c||{},{origin:S="/"}=i?new URL(i):{};l.useEffect(()=>{const N=setInterval(()=>{j.refreshFuel()},2e3);return()=>{clearInterval(N)}},[]);const w=()=>{o(!1)};return c?e.jsxs(H,{children:[e.jsx("div",{className:"header",children:e.jsx(E,{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:`${p} ${C}`}),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(A,{className:"address",did:a.appDid}),e.jsx(W,{style:{lineHeight:1},target:"_blank",href:v(S,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(I,{className:"icon-launch"})})]}),e.jsx(t,{my:2,children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:s("setup.fuel.fuelApp")})}),e.jsx($,{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:k,...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:p})]}),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:b})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:s("setup.next")})})]}):e.jsx(t,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:e.jsx(P,{})})}u.propTypes={onNext:d.func,onPrevious:d.func};u.defaultProps={onNext:()=>{},onPrevious:()=>{}};const H=B(D)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CPE8Apzb.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
2
- import{a9 as D,j as e,e as T,y as A,aa as l,T as d,ab as U}from"./vendor-mui-core-B6POpIBB.js";import{r as W,w as F,b6 as M,G as N,b0 as z,bh as O,n as k}from"./vendor-ux-did-connect-DVrP2LNw.js";import{_ as q,R as m}from"./vendor-arcblock-CX-5Ex_f.js";import{d as B}from"./CheckCircle-Bxk_pKUt.js";import{a as H,u as P}from"./vendor-hooks-DpLLpTSZ.js";import{r as a,f as G,h as K}from"./vendor-react-DEoibe3W.js";import{L as u}from"./landing-page-EY5bGAu7.js";import{A as V}from"./vendor-utils-BUwfcN20.js";import{u as X}from"./index-Cb1OPKJL.js";import"./lottie-web-jYmAQWuC.js";var f={},$=D;Object.defineProperty(f,"__esModule",{value:!0});var S=f.default=void 0,J=$(W()),Q=e;S=f.default=(0,J.default)((0,Q.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");function Y(){const o=F();return a.useCallback(()=>{if(o!=null&&o.wallet){q(()=>import("./index-CPE8Apzb.js").then(r=>r.i),__vite__mapDeps([0,1])).then(r=>{setTimeout(()=>{r.call("arcClosePage")},2e3)});return}setTimeout(()=>{window.close()},500)},[o==null?void 0:o.wallet])}function de(){var y,j,_,E;const o=G(),r=a.useRef(null),{t:s,locale:p}=a.useContext(M),{api:x,connectApi:h}=X(),[C]=K(),b=T(),R=Y(),t=H({ready:!1,success:!1,error:null,invalidSession:!1}),I=()=>{try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const c=n.searchParams.get("__connect_url__"),L=z(c);if(!O(L))throw new Error("No token");t.ready=!0}catch{t.invalidSession=!0,o("#invalid",{replace:!0})}};a.useLayoutEffect(()=>I(),[]);const v=P(n=>{var c;t.error=n.message,(c=window.opener)==null||c.postMessage({type:"connect-endpoint-message",error:t.error},"*"),o("#invalid",{replace:!0})}),g=P(()=>{var n;(n=window.opener)==null||n.postMessage({type:"connect-endpoint-message",success:!0},"*"),t.success=!0}),i=C.get("source")||"Generate Access Key";a.useEffect(()=>{r.current&&t.ready&&h.open({locale:p,containerEl:r.current,action:"gen-access-key",extraParams:{remark:i},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:V(window.location.origin,k.WELLKNOWN_SERVICE_PATH_PREFIX,k.API_DID_PREFIX),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:v},{locale:p})},[h,t.ready,x,v,g,p,s,i]);const w=e.jsx(A,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(S,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(t.invalidSession)return e.jsx(u,{did:(y=window.blocklet)==null?void 0:y.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:w})},"invalid");if(t.error){const n=t.error,c=w;return e.jsx(u,{did:(j=window.blocklet)==null?void 0:j.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:n,extra:c})},"error")}return t.success?(C.has("closeOnSuccess")&&R(),e.jsx(u,{did:(_=window.blocklet)==null?void 0:_.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(B,{style:{color:b.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:i}),description:s("connectCli.successDesc",{source:i})})},"success")):t.ready?e.jsx(u,{did:(E=window.blocklet)==null?void 0:E.appPid,standalone:!0,children:e.jsxs(l,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(l,{sx:{mb:5},children:[e.jsx(d,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(l,{sx:{display:"inline-block"},ref:r})]})},"ready"):e.jsx(N,{children:e.jsx(U,{})})}export{de as default};
2
+ import{a9 as D,j as e,e as T,y as A,aa as l,T as d,ab as U}from"./vendor-mui-core-B6POpIBB.js";import{r as W,w as F,b5 as M,G as N,a$ as z,bg as O,n as k}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{_ as q,R as m}from"./vendor-arcblock-Dkhgjlzn.js";import{d as B}from"./CheckCircle-yKW43XdV.js";import{a as H,u as P}from"./vendor-hooks-DXGUREV9.js";import{r as a,f as G,h as K}from"./vendor-react-DEoibe3W.js";import{L as u}from"./landing-page-BJMRDSCP.js";import{A as V}from"./vendor-utils-CjMBJT5V.js";import{u as X}from"./index-CksPySYI.js";import"./lottie-web-jYmAQWuC.js";var f={},$=D;Object.defineProperty(f,"__esModule",{value:!0});var S=f.default=void 0,J=$(W()),Q=e;S=f.default=(0,J.default)((0,Q.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");function Y(){const o=F();return a.useCallback(()=>{if(o!=null&&o.wallet){q(()=>import("./index-CPE8Apzb.js").then(r=>r.i),__vite__mapDeps([0,1])).then(r=>{setTimeout(()=>{r.call("arcClosePage")},2e3)});return}setTimeout(()=>{window.close()},500)},[o==null?void 0:o.wallet])}function de(){var y,j,_,E;const o=G(),r=a.useRef(null),{t:s,locale:p}=a.useContext(M),{api:x,connectApi:h}=X(),[C]=K(),R=T(),b=Y(),t=H({ready:!1,success:!1,error:null,invalidSession:!1}),I=()=>{try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const c=n.searchParams.get("__connect_url__"),L=z(c);if(!O(L))throw new Error("No token");t.ready=!0}catch{t.invalidSession=!0,o("#invalid",{replace:!0})}};a.useLayoutEffect(()=>I(),[]);const v=P(n=>{var c;t.error=n.message,(c=window.opener)==null||c.postMessage({type:"connect-endpoint-message",error:t.error},"*"),o("#invalid",{replace:!0})}),g=P(()=>{var n;(n=window.opener)==null||n.postMessage({type:"connect-endpoint-message",success:!0},"*"),t.success=!0}),i=C.get("source")||"Generate Access Key";a.useEffect(()=>{r.current&&t.ready&&h.open({locale:p,containerEl:r.current,action:"gen-access-key",extraParams:{remark:i},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:V(window.location.origin,k.WELLKNOWN_SERVICE_PATH_PREFIX,k.API_DID_PREFIX),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:v},{locale:p})},[h,t.ready,x,v,g,p,s,i]);const w=e.jsx(A,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(S,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(t.invalidSession)return e.jsx(u,{did:(y=window.blocklet)==null?void 0:y.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:w})},"invalid");if(t.error){const n=t.error,c=w;return e.jsx(u,{did:(j=window.blocklet)==null?void 0:j.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:n,extra:c})},"error")}return t.success?(C.has("closeOnSuccess")&&b(),e.jsx(u,{did:(_=window.blocklet)==null?void 0:_.appPid,standalone:!0,children:e.jsx(m,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(B,{style:{color:R.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:i}),description:s("connectCli.successDesc",{source:i})})},"success")):t.ready?e.jsx(u,{did:(E=window.blocklet)==null?void 0:E.appPid,standalone:!0,children:e.jsxs(l,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(l,{sx:{mb:5},children:[e.jsx(d,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(d,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(l,{sx:{display:"inline-block"},ref:r})]})},"ready"):e.jsx(N,{children:e.jsx(U,{})})}export{de as default};
@@ -1 +1 @@
1
- import{bg as t,a2 as o}from"./vendor-ux-did-connect-DVrP2LNw.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
1
+ import{bf as t,a2 as o}from"./vendor-ux-did-connect-D4-ZeZHm.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
@@ -1 +1 @@
1
- import{bg as t,a2 as o}from"./vendor-ux-did-connect-DVrP2LNw.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
1
+ import{bf as t,a2 as o}from"./vendor-ux-did-connect-D4-ZeZHm.js";function i(...e){try{return t(...e)}catch(r){throw o.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{i as g};
@@ -1 +1 @@
1
- import{j as o,al as n}from"./vendor-mui-core-B6POpIBB.js";import{L as r}from"./vendor-react-DEoibe3W.js";import{a as i,n as t}from"./vendor-ux-did-connect-DVrP2LNw.js";import{S as e}from"./studio-DrYhFxCD.js";import"./vendor-utils-BUwfcN20.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CX-5Ex_f.js";import"./TuneOutlined-DcBuSd1o.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
1
+ import{j as o,al as n}from"./vendor-mui-core-B6POpIBB.js";import{L as r}from"./vendor-react-DEoibe3W.js";import{a as i,n as t}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{S as e}from"./studio-BR3c6nt5.js";import"./vendor-utils-CjMBJT5V.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Dkhgjlzn.js";import"./TuneOutlined-Bv7cSbWT.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",m:4,spacing:2,children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
@@ -1 +1 @@
1
- import{b as x}from"./vendor-react-DEoibe3W.js";import{B as E}from"./vendor-arcblock-CX-5Ex_f.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,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=E({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||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)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
1
+ import{b as x}from"./vendor-react-DEoibe3W.js";import{B as E}from"./vendor-arcblock-Dkhgjlzn.js";const L=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:c,overflow:f,styles:y,onLoad:p,onMouseOver:m,onMouseOut:b,scrolling:w,id:d,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=E({src:$||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:f||null},scrolling:w||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:y||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:u||null,onLoad:p||null,onMouseOver:m||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)),x.createElement("iframe",Object.assign({},l))},z=L;export{z as I};
@@ -1,4 +1,4 @@
1
- import{B as tT,D as qm,E as Km,F as jm}from"./vendor-hooks-DpLLpTSZ.js";import{B as Jm}from"./vendor-utils-BUwfcN20.js";import{g as s2,b as l2,r as u2}from"./vendor-react-DEoibe3W.js";/*! *****************************************************************************
1
+ import{B as tT,D as qm,E as Km,F as jm}from"./vendor-hooks-DXGUREV9.js";import{B as Jm}from"./vendor-utils-CjMBJT5V.js";import{g as s2,b as l2,r as u2}from"./vendor-react-DEoibe3W.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,4 +1,4 @@
1
- import{r as Z,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a9 as rn,j as n,aa as ae,bp as Yt,bs as Zt,bo as Qt,q as xt,T as Be,O as lt,ab as rt,by as nr,ak as tt,H as K,ah as Se,e as Wn,ad as wt,w as Hn,y as nn,b5 as Gn,b6 as Yn,I as Zn,bi as Qn,bt as Xn,bS as Jn}from"./vendor-mui-core-B6POpIBB.js";import{v as Ie,B as Xt,e as Jt,_ as ei,ax as ti,n as Rr,A as ri,b as ni}from"./vendor-utils-BUwfcN20.js";import{r as on,bB as ut,bC as ii,bD as oi,bE as an,bF as ai,bG as si,bH as ci,bI as sn,bJ as li,bK as ir,bL as ui,bM as fi,bN as di,bO as pi,aN as or,bP as cn,aE as mi,k as hi,u as Te,a1 as gi,a0 as yi,ar as Ye,a as je,i as vi,at as bi,d as xi,b6 as ft,a2 as Fe,br as wi,n as Ze,a4 as ln,an as Ei,I as ji,aw as Si,b8 as Ci,ab as un,aa as fn,bx as Pi,$ as Ai}from"./vendor-ux-did-connect-DVrP2LNw.js";import{c as Ke,a as Ii,X as dn,O as Et,I as Oi,Y as Ri}from"./vendor-arcblock-CX-5Ex_f.js";import{d as Ti}from"./ViewList-rVo7d5VV.js";import{a1 as Ni,f as Di,z as Ae,at as ar,l as Qe,a2 as _i,U as Xe,au as Li,C as pn,av as mn,t as Ui,b as ki}from"./index-Cb1OPKJL.js";import{U as hn,C as gn,I as qi}from"./index-CjZLIV87.js";import{k as Bi,u as sr,a as cr,l as Ki,f as Mi}from"./vendor-hooks-DpLLpTSZ.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-0TEl6bJJ.js";import{W as lr}from"./did-address-CJZtrzhT.js";import{P as Me}from"./permission-DDLyDuSn.js";import{C as At}from"./click-to-copy-CSwBjJDI.js";import{T as vn}from"./index-Cx-tuAMi.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Fi}from"./useAsync-DXeWUWXr.js";import{I as Pe}from"./index-i5c4XeO-.js";import{d as $i}from"./DeleteOutline-Csdx_lih.js";import{C as dt}from"./confirm-Bj4L0Vn8.js";import{u as pt}from"./session-j-9KoWbs.js";import{i as bn,a as jt,p as xn}from"./util-BcFfyz6S.js";import{b as Vi}from"./sdk-DICk2ZHP.js";import{A as zi}from"./actions-D-Helr6n.js";import{S as Wi}from"./shorten-label-SbKUBkvs.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-Cb6R1F6v.js";import"./PlayArrow-CVHX5RbU.js";import"./get-safe-url-BYr2jgRv.js";import"./use-blocklet-logo-DryhoHen.js";import"./InfoOutlined-BMb9Zu84.js";import"./dot-CaKxEi_0.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-D5LoqHiU.js";import"./base32-yUUlhgnG.js";import"./MoreHoriz-CT231fLS.js";var ur={},Hi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Gi=Hi(on()),Yi=n;wn=ur.default=(0,Gi.default)((0,Yi.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Zi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const En=dr;var vt={},Qi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),jn="%[a-f0-9]{2}",Nr=new RegExp("("+jn+")|([^%]+?)","gi"),Dr=new RegExp("("+jn+")+","gi");function er(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],er(r),er(i))}function Xi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=er(t,r).join(""),t=e.match(Nr)||[];return e}}function Ji(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Xi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),u=0;u<a.length;u++){var m=a[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var eo=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ji(e)}},to=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ro=function(e,t){for(var r={},i=Object.keys(e),a=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(a?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Qi,r=eo,i=to,a=ro,u=s=>s==null;function m(s){switch(s.arrayFormat){case"index":return o=>(l,d)=>{const E=l.length;return d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[",E,"]"].join("")]:[...l,[b(o,s),"[",b(E,s),"]=",b(d,s)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[]"].join("")]:[...l,[b(o,s),"[]=",b(d,s)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,s),"=",b(d,s)].join("")]:[[l,b(d,s)].join(s.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,b(o,s)]:[...l,[b(o,s),"=",b(d,s)].join("")]}}function x(s){let o;switch(s.arrayFormat){case"index":return(l,d,E)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){E[l]=d;return}E[l]===void 0&&(E[l]={}),E[l][o[1]]=d};case"bracket":return(l,d,E)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){E[l]=d;return}if(E[l]===void 0){E[l]=[d];return}E[l]=[].concat(E[l],d)};case"comma":case"separator":return(l,d,E)=>{const P=typeof d=="string"&&d.includes(s.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,s).includes(s.arrayFormatSeparator);d=S?h(d,s):d;const J=P||S?d.split(s.arrayFormatSeparator).map(G=>h(G,s)):d===null?d:h(d,s);E[l]=J};default:return(l,d,E)=>{if(E[l]===void 0){E[l]=d;return}E[l]=[].concat(E[l],d)}}}function j(s){if(typeof s!="string"||s.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(s,o){return o.encode?o.strict?t(s):encodeURIComponent(s):s}function h(s,o){return o.decode?r(s):s}function N(s){return Array.isArray(s)?s.sort():typeof s=="object"?N(Object.keys(s)).sort((o,l)=>Number(o)-Number(l)).map(o=>s[o]):s}function C(s){const o=s.indexOf("#");return o!==-1&&(s=s.slice(0,o)),s}function A(s){let o="";const l=s.indexOf("#");return l!==-1&&(o=s.slice(l)),o}function y(s){s=C(s);const o=s.indexOf("?");return o===-1?"":s.slice(o+1)}function B(s,o){return o.parseNumbers&&!Number.isNaN(Number(s))&&typeof s=="string"&&s.trim()!==""?s=Number(s):o.parseBooleans&&s!==null&&(s.toLowerCase()==="true"||s.toLowerCase()==="false")&&(s=s.toLowerCase()==="true"),s}function w(s,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const l=x(o),d=Object.create(null);if(typeof s!="string"||(s=s.trim().replace(/^[?#&]/,""),!s))return d;for(const E of s.split("&")){if(E==="")continue;let[P,S]=i(o.decode?E.replace(/\+/g," "):E,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const E of Object.keys(d)){const P=d[E];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=B(P[S],o);else d[E]=B(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((E,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?E[P]=N(S):E[P]=S,E},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(s,o)=>{if(!s)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(s[S])||o.skipEmptyString&&s[S]==="",d=m(o),E={};for(const S of Object.keys(s))l(S)||(E[S]=s[S]);const P=Object.keys(E);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=s[S];return J===void 0?"":J===null?b(S,o):Array.isArray(J)?J.reduce(d(S),[]).join("&"):b(S,o)+"="+b(J,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(s,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(s,"#");return Object.assign({url:l.split("?")[0]||"",query:w(y(s),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(s,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(s.url).split("?")[0]||"",d=e.extract(s.url),E=e.parse(d,{sort:!1}),P=Object.assign(E,s.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(s.url);return s.fragmentIdentifier&&(J=`#${b(s.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(s,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:E,fragmentIdentifier:P}=e.parseUrl(s,l);return e.stringifyUrl({url:d,query:a(E,o),fragmentIdentifier:P},l)},e.exclude=(s,o,l)=>{const d=Array.isArray(o)?E=>!o.includes(E):(E,P)=>!o(E,P);return e.pick(s,d,l)}})(vt);const at=$n,no={parseNumbers:!1,parseBooleans:!1},io={skipNull:!1,skipEmptyString:!1},oo=(e,t)=>{var r,i;const{navigateMode:a="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},no),u),j=Object.assign(Object.assign({},io),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),C=Bi(),A=Z.useRef(typeof e=="function"?e():e||{}),y=Z.useMemo(()=>vt.parse(b.search,x),[b.search]),B=Z.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[B,sr(s=>{const o=typeof s=="function"?s(B):s;C(),h&&h[a]({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},b.state),N&&N({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},{replace:a==="replace",state:b.state})})]},ao=oo;var Dt={exports:{}},_t={},_r;function Sn(){if(_r)return _t;_r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function i(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&a(o,l)}function a(o,l){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,P){return E.__proto__=P,E},a(o,l)}function u(o){var l=j();return function(){var E=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(E,arguments,S)}else P=E.apply(this,arguments);return m(this,P)}}function m(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(o)}function x(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,C;function A(o,l,d){d||(d=Error);function E(S,J,G){return typeof l=="string"?l:l(S,J,G)}var P=function(S){i(G,S);var J=u(G);function G(Y,W,$){var H;return r(this,G),H=J.call(this,E(Y,W,$)),H.code=o,H}return t(G)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(E){return String(E)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function B(o,l,d){return o.substr(0,l.length)===l}function w(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function s(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,l,d){N===void 0&&(N=tr()),N(typeof o=="string","'name' must be a string");var E;typeof l=="string"&&B(l,"not ")?(E="must not be",l=l.replace(/^not /,"")):E="must be";var P;if(w(o," argument"))P="The ".concat(o," ").concat(E," ").concat(y(l,"type"));else{var S=s(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(E," ").concat(y(l,"type"))}return P+=". Received type ".concat(e(d)),P},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";C===void 0&&(C=ut);var E=C.inspect(l);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(E)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var E;return d&&d.constructor&&d.constructor.name?E="instance of ".concat(d.constructor.name):E="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(E,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];N===void 0&&(N=tr()),N(l.length>0,"At least one arg needs to be specified");var E="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:E+="".concat(l[0]," argument");break;case 2:E+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:E+=l.slice(0,P-1).join(", "),E+=", and ".concat(l[P-1]," arguments");break}return"".concat(E," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function so(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(I);O&&(q=q.filter(function(k){return Object.getOwnPropertyDescriptor(I,k).enumerable})),M.push.apply(M,q)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(q){r(I,q,M[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(q){Object.defineProperty(I,q,Object.getOwnPropertyDescriptor(M,q))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function a(I,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(I,m(q.key),q)}}function u(I,O,M){return O&&a(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=x(I,"string");return o(O)==="symbol"?O:String(O)}function x(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var q=M.call(I,O||"default");if(o(q)!=="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function j(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var q=s(I),k;if(O){var g=s(this).constructor;k=Reflect.construct(q,arguments,g)}else k=q.apply(this,arguments);return h(this,k)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function C(I){var O=typeof Map=="function"?new Map:void 0;return C=function(q){if(q===null||!B(q))return q;if(typeof q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(q))return O.get(q);O.set(q,k)}function k(){return A(q,arguments,s(this).constructor)}return k.prototype=Object.create(q.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),w(k,q)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(k,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(k,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(q,k){return q.__proto__=k,q},w(I,O)}function s(I){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},s(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var l=ut,d=l.inspect,E=Sn(),P=E.codes.ERR_INVALID_ARG_TYPE;function S(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function J(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Y="",W="",$="",H={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},de=10;function we(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(q){M[q]=I[q]}),Object.defineProperty(M,"message",{value:I.message}),M}function Q(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function me(I,O,M){var q="",k="",g=0,p="",v=!1,_=Q(I),R=_.split(`
1
+ import{r as Z,t as $n,g as Vn,e as Or,a as zn}from"./vendor-react-DEoibe3W.js";import{a9 as rn,j as n,aa as ae,bp as Yt,bs as Zt,bo as Qt,q as xt,T as Be,O as lt,ab as rt,by as nr,ak as tt,H as K,ah as Se,e as Wn,ad as wt,w as Hn,y as nn,b5 as Gn,b6 as Yn,I as Zn,bi as Qn,bt as Xn,bS as Jn}from"./vendor-mui-core-B6POpIBB.js";import{v as Ie,B as Xt,e as Jt,_ as ei,ax as ti,n as Rr,A as ri,b as ni}from"./vendor-utils-CjMBJT5V.js";import{r as on,bA as ut,bB as ii,bC as oi,bD as an,bE as ai,bF as si,bG as ci,bH as sn,bI as li,bJ as ir,bK as ui,bL as fi,bM as di,bN as pi,aM as or,bO as cn,aD as mi,k as hi,u as Te,a1 as gi,a0 as yi,aq as Ye,a as je,i as vi,as as bi,d as xi,b5 as ft,a2 as Fe,bq as wi,n as Ze,a4 as ln,am as Ei,I as ji,av as Si,b7 as Ci,ab as un,aa as fn,bw as Pi,$ as Ai}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{c as Ke,a as Ii,X as dn,O as Et,I as Oi,Y as Ri}from"./vendor-arcblock-Dkhgjlzn.js";import{d as Ti}from"./ViewList-Ca1IEB31.js";import{a1 as Ni,f as Di,z as Ae,at as ar,l as Qe,a2 as _i,U as Xe,au as Li,C as pn,av as mn,t as Ui,b as ki}from"./index-CksPySYI.js";import{U as hn,C as gn,I as qi}from"./index-C-rU1lEd.js";import{k as Bi,u as sr,a as cr,l as Ki,f as Mi}from"./vendor-hooks-DXGUREV9.js";import{u as Ne,d as Tr,W as yn}from"./dashboard-CvJ8cVy-.js";import{W as lr}from"./did-address-C6ni99I7.js";import{P as Me}from"./permission-PNXSTeNL.js";import{C as At}from"./click-to-copy-0s0a7Ak5.js";import{T as vn}from"./index-DdLPuFP7.js";import{f as $e}from"./format-error-BrmqJs5a.js";import{_ as Fi}from"./useAsync-GjVghrwi.js";import{I as Pe}from"./index-D_z5kVUS.js";import{d as $i}from"./DeleteOutline-D_I07sPe.js";import{C as dt}from"./confirm-BqrhdaU7.js";import{u as pt}from"./session-DLQ0rbYE.js";import{i as bn,a as jt,p as xn}from"./util-D-LnEy9h.js";import{b as Vi}from"./sdk-BXECCi1q.js";import{A as zi}from"./actions-BW0Vx00_.js";import{S as Wi}from"./shorten-label-SbKUBkvs.js";import"./lottie-web-jYmAQWuC.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-CXDkfohf.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./use-blocklet-logo-BOYeM9RY.js";import"./InfoOutlined-BjII93aR.js";import"./dot-WAAJ-O65.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BKvZ6hcv.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-BWhMsmQP.js";import"./base32-C_EKY5vU.js";import"./MoreHoriz-DHyMdwpT.js";var ur={},Hi=rn;Object.defineProperty(ur,"__esModule",{value:!0});var wn=ur.default=void 0,Gi=Hi(on()),Yi=n;wn=ur.default=(0,Gi.default)((0,Yi.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Loop");var fr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("g",{clipPath:"url(#clip0)",children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99997 1.59778C8.19071 1.59778 7.39961 1.83775 6.72673 2.28736C6.05385 2.73697 5.5294 3.37601 5.21971 4.12367C4.91001 4.87134 4.82898 5.69405 4.98686 6.48777C5.14474 7.28149 5.53444 8.01056 6.10668 8.5828C6.67892 9.15504 7.408 9.54474 8.20172 9.70262C8.99544 9.8605 9.81815 9.77947 10.5658 9.46978C11.3135 9.16009 11.9525 8.63564 12.4021 7.96276C12.8517 7.28987 13.0917 6.49878 13.0917 5.68951C13.0917 4.60432 12.6606 3.56357 11.8933 2.79622C11.1259 2.02887 10.0852 1.59778 8.99997 1.59778ZM7.27426 3.9638C7.73195 3.50611 8.35271 3.24899 8.99997 3.24899C9.48266 3.24899 9.95452 3.39212 10.3559 3.66029C10.7572 3.92846 11.07 4.30962 11.2547 4.75556C11.4394 5.20151 11.4878 5.69222 11.3936 6.16563C11.2994 6.63905 11.067 7.07391 10.7257 7.41522C10.3844 7.75654 9.94951 7.98897 9.4761 8.08314C9.00268 8.17731 8.51197 8.12898 8.06603 7.94426C7.62008 7.75954 7.23892 7.44674 6.97075 7.04539C6.70258 6.64405 6.55945 6.1722 6.55945 5.68951C6.55945 5.04224 6.81658 4.42149 7.27426 3.9638ZM7.36691 10.3075C6.28172 10.3075 5.24097 10.7385 4.47362 11.5059C3.70627 12.2732 3.27518 13.314 3.27518 14.3992V17.121C3.27518 17.2763 3.4011 17.4022 3.55643 17.4022H4.64514C4.80047 17.4022 4.92639 17.2763 4.92639 17.121V14.3992C4.92639 13.7519 5.18351 13.1312 5.6412 12.6735C6.09889 12.2158 6.71964 11.9587 7.36691 11.9587H10.633C10.9535 11.9587 11.2709 12.0218 11.567 12.1444C11.8631 12.2671 12.1321 12.4469 12.3588 12.6735C12.5854 12.9001 12.7651 13.1691 12.8878 13.4652C13.0104 13.7613 13.0736 14.0787 13.0736 14.3992V17.121C13.0736 17.2763 13.1995 17.4022 13.3548 17.4022H14.4435C14.5989 17.4022 14.7248 17.2763 14.7248 17.121V14.3992C14.7248 13.314 14.2937 12.2732 13.5263 11.5059C12.759 10.7385 11.7182 10.3075 10.633 10.3075H7.36691Z"})}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0",children:n.jsx("rect",{width:"18",height:"18",transform:"translate(0 0.5)"})})})]})};fr.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};fr.displayName="person";const Zi=fr;var dr=function(e){return n.jsxs("svg",{...e,children:[n.jsx("path",{d:"M1.25 2.7087C1.25 2.24826 1.62326 1.875 2.0837 1.875H14.339C14.7995 1.875 15.1727 2.24826 15.1727 2.7087V9.31574C15.1727 9.77618 14.7995 10.1494 14.339 10.1494C13.8786 10.1494 13.5053 9.77618 13.5053 9.31574V3.54239H2.91739V16.7565H6.53772H8.34788H9.32435C9.78479 16.7565 10.158 17.1297 10.158 17.5902C10.158 18.0506 9.78479 18.4239 9.32435 18.4239H8.34788H2.0837C1.62326 18.4239 1.25 18.0506 1.25 17.5902V2.7087Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.21129 7.91935C7.70481 7.91935 7.29422 8.32993 7.29422 8.83641C7.29422 9.34289 7.70481 9.75348 8.21129 9.75348C8.71777 9.75348 9.12836 9.34289 9.12836 8.83641C9.12836 8.32993 8.71777 7.91935 8.21129 7.91935ZM5.62683 8.83641C5.62683 7.40905 6.78393 6.25195 8.21129 6.25195C9.63865 6.25195 10.7957 7.40905 10.7957 8.83641C10.7957 10.2638 9.63865 11.4209 8.21129 11.4209C6.78393 11.4209 5.62683 10.2638 5.62683 8.83641Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.62683 13.2133C5.62683 12.7529 6.00009 12.3796 6.46053 12.3796H9.96205C10.4225 12.3796 10.7957 12.7529 10.7957 13.2133C10.7957 13.6737 10.4225 14.047 9.96205 14.047H6.46053C6.00009 14.047 5.62683 13.6737 5.62683 13.2133Z"}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6406 11.3125C15.8547 11.3125 16.0503 11.434 16.145 11.626L17.1779 13.7184L19.4876 14.056C19.6994 14.087 19.8753 14.2355 19.9413 14.4391C20.0074 14.6427 19.9521 14.8662 19.7987 15.0156L18.1279 16.643L18.5222 18.9421C18.5584 19.1532 18.4716 19.3665 18.2984 19.4923C18.1252 19.6182 17.8955 19.6347 17.706 19.5351L15.6406 18.4489L13.5753 19.5351C13.3858 19.6347 13.1561 19.6182 12.9829 19.4923C12.8096 19.3665 12.7229 19.1532 12.7591 18.9421L13.1534 16.643L11.4825 15.0156C11.3292 14.8662 11.2739 14.6427 11.3399 14.4391C11.406 14.2355 11.5818 14.087 11.7937 14.056L14.1034 13.7184L15.1362 11.626C15.231 11.434 15.4265 11.3125 15.6406 11.3125ZM15.6406 13.1458L14.9815 14.4813C14.8996 14.6471 14.7414 14.7621 14.5584 14.7889L13.0835 15.0044L14.1503 16.0435C14.283 16.1727 14.3435 16.359 14.3122 16.5416L14.0606 18.0088L15.3788 17.3155C15.5427 17.2293 15.7386 17.2293 15.9025 17.3155L17.2207 18.0088L16.969 16.5416C16.9377 16.359 16.9983 16.1727 17.131 16.0435L18.1978 15.0044L16.7229 14.7889C16.5399 14.7621 16.3817 14.6471 16.2998 14.4813L15.6406 13.1458Z"})]})};dr.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"};dr.displayName="external-issuer";const En=dr;var vt={},Qi=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),jn="%[a-f0-9]{2}",Nr=new RegExp("("+jn+")|([^%]+?)","gi"),Dr=new RegExp("("+jn+")+","gi");function er(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),i=e.slice(t);return Array.prototype.concat.call([],er(r),er(i))}function Xi(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(Nr)||[],r=1;r<t.length;r++)e=er(t,r).join(""),t=e.match(Nr)||[];return e}}function Ji(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=Dr.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var i=Xi(r[0]);i!==r[0]&&(t[r[0]]=i)}r=Dr.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),u=0;u<a.length;u++){var m=a[u];e=e.replace(new RegExp(m,"g"),t[m])}return e}var eo=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return Ji(e)}},to=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},ro=function(e,t){for(var r={},i=Object.keys(e),a=Array.isArray(t),u=0;u<i.length;u++){var m=i[u],x=e[m];(a?t.indexOf(m)!==-1:t(m,x,e))&&(r[m]=x)}return r};(function(e){const t=Qi,r=eo,i=to,a=ro,u=s=>s==null;function m(s){switch(s.arrayFormat){case"index":return o=>(l,d)=>{const E=l.length;return d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[",E,"]"].join("")]:[...l,[b(o,s),"[",b(E,s),"]=",b(d,s)].join("")]};case"bracket":return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,[b(o,s),"[]"].join("")]:[...l,[b(o,s),"[]=",b(d,s)].join("")];case"comma":case"separator":return o=>(l,d)=>d==null||d.length===0?l:l.length===0?[[b(o,s),"=",b(d,s)].join("")]:[[l,b(d,s)].join(s.arrayFormatSeparator)];default:return o=>(l,d)=>d===void 0||s.skipNull&&d===null||s.skipEmptyString&&d===""?l:d===null?[...l,b(o,s)]:[...l,[b(o,s),"=",b(d,s)].join("")]}}function x(s){let o;switch(s.arrayFormat){case"index":return(l,d,E)=>{if(o=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!o){E[l]=d;return}E[l]===void 0&&(E[l]={}),E[l][o[1]]=d};case"bracket":return(l,d,E)=>{if(o=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!o){E[l]=d;return}if(E[l]===void 0){E[l]=[d];return}E[l]=[].concat(E[l],d)};case"comma":case"separator":return(l,d,E)=>{const P=typeof d=="string"&&d.includes(s.arrayFormatSeparator),S=typeof d=="string"&&!P&&h(d,s).includes(s.arrayFormatSeparator);d=S?h(d,s):d;const J=P||S?d.split(s.arrayFormatSeparator).map(G=>h(G,s)):d===null?d:h(d,s);E[l]=J};default:return(l,d,E)=>{if(E[l]===void 0){E[l]=d;return}E[l]=[].concat(E[l],d)}}}function j(s){if(typeof s!="string"||s.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(s,o){return o.encode?o.strict?t(s):encodeURIComponent(s):s}function h(s,o){return o.decode?r(s):s}function N(s){return Array.isArray(s)?s.sort():typeof s=="object"?N(Object.keys(s)).sort((o,l)=>Number(o)-Number(l)).map(o=>s[o]):s}function C(s){const o=s.indexOf("#");return o!==-1&&(s=s.slice(0,o)),s}function A(s){let o="";const l=s.indexOf("#");return l!==-1&&(o=s.slice(l)),o}function y(s){s=C(s);const o=s.indexOf("?");return o===-1?"":s.slice(o+1)}function B(s,o){return o.parseNumbers&&!Number.isNaN(Number(s))&&typeof s=="string"&&s.trim()!==""?s=Number(s):o.parseBooleans&&s!==null&&(s.toLowerCase()==="true"||s.toLowerCase()==="false")&&(s=s.toLowerCase()==="true"),s}function w(s,o){o=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},o),j(o.arrayFormatSeparator);const l=x(o),d=Object.create(null);if(typeof s!="string"||(s=s.trim().replace(/^[?#&]/,""),!s))return d;for(const E of s.split("&")){if(E==="")continue;let[P,S]=i(o.decode?E.replace(/\+/g," "):E,"=");S=S===void 0?null:["comma","separator"].includes(o.arrayFormat)?S:h(S,o),l(h(P,o),S,d)}for(const E of Object.keys(d)){const P=d[E];if(typeof P=="object"&&P!==null)for(const S of Object.keys(P))P[S]=B(P[S],o);else d[E]=B(P,o)}return o.sort===!1?d:(o.sort===!0?Object.keys(d).sort():Object.keys(d).sort(o.sort)).reduce((E,P)=>{const S=d[P];return S&&typeof S=="object"&&!Array.isArray(S)?E[P]=N(S):E[P]=S,E},Object.create(null))}e.extract=y,e.parse=w,e.stringify=(s,o)=>{if(!s)return"";o=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},o),j(o.arrayFormatSeparator);const l=S=>o.skipNull&&u(s[S])||o.skipEmptyString&&s[S]==="",d=m(o),E={};for(const S of Object.keys(s))l(S)||(E[S]=s[S]);const P=Object.keys(E);return o.sort!==!1&&P.sort(o.sort),P.map(S=>{const J=s[S];return J===void 0?"":J===null?b(S,o):Array.isArray(J)?J.reduce(d(S),[]).join("&"):b(S,o)+"="+b(J,o)}).filter(S=>S.length>0).join("&")},e.parseUrl=(s,o)=>{o=Object.assign({decode:!0},o);const[l,d]=i(s,"#");return Object.assign({url:l.split("?")[0]||"",query:w(y(s),o)},o&&o.parseFragmentIdentifier&&d?{fragmentIdentifier:h(d,o)}:{})},e.stringifyUrl=(s,o)=>{o=Object.assign({encode:!0,strict:!0},o);const l=C(s.url).split("?")[0]||"",d=e.extract(s.url),E=e.parse(d,{sort:!1}),P=Object.assign(E,s.query);let S=e.stringify(P,o);S&&(S=`?${S}`);let J=A(s.url);return s.fragmentIdentifier&&(J=`#${b(s.fragmentIdentifier,o)}`),`${l}${S}${J}`},e.pick=(s,o,l)=>{l=Object.assign({parseFragmentIdentifier:!0},l);const{url:d,query:E,fragmentIdentifier:P}=e.parseUrl(s,l);return e.stringifyUrl({url:d,query:a(E,o),fragmentIdentifier:P},l)},e.exclude=(s,o,l)=>{const d=Array.isArray(o)?E=>!o.includes(E):(E,P)=>!o(E,P);return e.pick(s,d,l)}})(vt);const at=$n,no={parseNumbers:!1,parseBooleans:!1},io={skipNull:!1,skipEmptyString:!1},oo=(e,t)=>{var r,i;const{navigateMode:a="push",parseOptions:u,stringifyOptions:m}={},x=Object.assign(Object.assign({},no),u),j=Object.assign(Object.assign({},io),m),b=at.useLocation(),h=(r=at.useHistory)===null||r===void 0?void 0:r.call(at),N=(i=at.useNavigate)===null||i===void 0?void 0:i.call(at),C=Bi(),A=Z.useRef(typeof e=="function"?e():e||{}),y=Z.useMemo(()=>vt.parse(b.search,x),[b.search]),B=Z.useMemo(()=>Object.assign(Object.assign({},A.current),y),[y]);return[B,sr(s=>{const o=typeof s=="function"?s(B):s;C(),h&&h[a]({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},b.state),N&&N({hash:b.hash,search:vt.stringify(Object.assign(Object.assign({},y),o),j)||"?"},{replace:a==="replace",state:b.state})})]},ao=oo;var Dt={exports:{}},_t={},_r;function Sn(){if(_r)return _t;_r=1;function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(o)}function t(o,l,d){return Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}function i(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&a(o,l)}function a(o,l){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,P){return E.__proto__=P,E},a(o,l)}function u(o){var l=j();return function(){var E=b(o),P;if(l){var S=b(this).constructor;P=Reflect.construct(E,arguments,S)}else P=E.apply(this,arguments);return m(this,P)}}function m(o,l){if(l&&(e(l)==="object"||typeof l=="function"))return l;if(l!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(o)}function x(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(o){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},b(o)}var h={},N,C;function A(o,l,d){d||(d=Error);function E(S,J,G){return typeof l=="string"?l:l(S,J,G)}var P=function(S){i(G,S);var J=u(G);function G(Y,W,$){var H;return r(this,G),H=J.call(this,E(Y,W,$)),H.code=o,H}return t(G)}(d);h[o]=P}function y(o,l){if(Array.isArray(o)){var d=o.length;return o=o.map(function(E){return String(E)}),d>2?"one of ".concat(l," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(l," ").concat(o[0]," or ").concat(o[1]):"of ".concat(l," ").concat(o[0])}else return"of ".concat(l," ").concat(String(o))}function B(o,l,d){return o.substr(0,l.length)===l}function w(o,l,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-l.length,d)===l}function s(o,l,d){return typeof d!="number"&&(d=0),d+l.length>o.length?!1:o.indexOf(l,d)!==-1}return A("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),A("ERR_INVALID_ARG_TYPE",function(o,l,d){N===void 0&&(N=tr()),N(typeof o=="string","'name' must be a string");var E;typeof l=="string"&&B(l,"not ")?(E="must not be",l=l.replace(/^not /,"")):E="must be";var P;if(w(o," argument"))P="The ".concat(o," ").concat(E," ").concat(y(l,"type"));else{var S=s(o,".")?"property":"argument";P='The "'.concat(o,'" ').concat(S," ").concat(E," ").concat(y(l,"type"))}return P+=". Received type ".concat(e(d)),P},TypeError),A("ERR_INVALID_ARG_VALUE",function(o,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";C===void 0&&(C=ut);var E=C.inspect(l);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(o,"' ").concat(d,". Received ").concat(E)},TypeError),A("ERR_INVALID_RETURN_VALUE",function(o,l,d){var E;return d&&d.constructor&&d.constructor.name?E="instance of ".concat(d.constructor.name):E="type ".concat(e(d)),"Expected ".concat(o,' to be returned from the "').concat(l,'"')+" function but got ".concat(E,".")},TypeError),A("ERR_MISSING_ARGS",function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];N===void 0&&(N=tr()),N(l.length>0,"At least one arg needs to be specified");var E="The ",P=l.length;switch(l=l.map(function(S){return'"'.concat(S,'"')}),P){case 1:E+="".concat(l[0]," argument");break;case 2:E+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:E+=l.slice(0,P-1).join(", "),E+=", and ".concat(l[P-1]," arguments");break}return"".concat(E," must be specified")},TypeError),_t.codes=h,_t}var Lt,Lr;function so(){if(Lr)return Lt;Lr=1;function e(I,O){var M=Object.keys(I);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(I);O&&(q=q.filter(function(k){return Object.getOwnPropertyDescriptor(I,k).enumerable})),M.push.apply(M,q)}return M}function t(I){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?e(Object(M),!0).forEach(function(q){r(I,q,M[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(M)):e(Object(M)).forEach(function(q){Object.defineProperty(I,q,Object.getOwnPropertyDescriptor(M,q))})}return I}function r(I,O,M){return O=m(O),O in I?Object.defineProperty(I,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):I[O]=M,I}function i(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function a(I,O){for(var M=0;M<O.length;M++){var q=O[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(I,m(q.key),q)}}function u(I,O,M){return O&&a(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(I){var O=x(I,"string");return o(O)==="symbol"?O:String(O)}function x(I,O){if(o(I)!=="object"||I===null)return I;var M=I[Symbol.toPrimitive];if(M!==void 0){var q=M.call(I,O||"default");if(o(q)!=="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}function j(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),Object.defineProperty(I,"prototype",{writable:!1}),O&&w(I,O)}function b(I){var O=y();return function(){var q=s(I),k;if(O){var g=s(this).constructor;k=Reflect.construct(q,arguments,g)}else k=q.apply(this,arguments);return h(this,k)}}function h(I,O){if(O&&(o(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return N(I)}function N(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function C(I){var O=typeof Map=="function"?new Map:void 0;return C=function(q){if(q===null||!B(q))return q;if(typeof q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O<"u"){if(O.has(q))return O.get(q);O.set(q,k)}function k(){return A(q,arguments,s(this).constructor)}return k.prototype=Object.create(q.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),w(k,q)},C(I)}function A(I,O,M){return y()?A=Reflect.construct.bind():A=function(k,g,p){var v=[null];v.push.apply(v,g);var _=Function.bind.apply(k,v),R=new _;return p&&w(R,p.prototype),R},A.apply(null,arguments)}function y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(I){return Function.toString.call(I).indexOf("[native code]")!==-1}function w(I,O){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(q,k){return q.__proto__=k,q},w(I,O)}function s(I){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},s(I)}function o(I){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},o(I)}var l=ut,d=l.inspect,E=Sn(),P=E.codes.ERR_INVALID_ARG_TYPE;function S(I,O,M){return(M===void 0||M>I.length)&&(M=I.length),I.substring(M-O.length,M)===O}function J(I,O){if(O=Math.floor(O),I.length==0||O==0)return"";var M=I.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)I+=I,O--;return I+=I.substring(0,M-I.length),I}var G="",Y="",W="",$="",H={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},de=10;function we(I){var O=Object.keys(I),M=Object.create(Object.getPrototypeOf(I));return O.forEach(function(q){M[q]=I[q]}),Object.defineProperty(M,"message",{value:I.message}),M}function Q(I){return d(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function me(I,O,M){var q="",k="",g=0,p="",v=!1,_=Q(I),R=_.split(`
2
2
  `),L=Q(O).split(`
3
3
  `),V=0,ne="";if(M==="strictEqual"&&o(I)==="object"&&o(O)==="object"&&I!==null&&O!==null&&(M="strictEqualObject"),R.length===1&&L.length===1&&R[0]!==L[0]){var ce=R[0].length+L[0].length;if(ce<=de){if((o(I)!=="object"||I===null)&&(o(O)!=="object"||O===null)&&(I!==0||O!==0))return"".concat(H[M],`
4
4
 
@@ -0,0 +1,137 @@
1
+ import{u as q,a2 as z,bP as K,I as be,bQ as ge,a4 as fe,ab as je,bw as ye}from"./vendor-ux-did-connect-D4-ZeZHm.js";import{t as we,m as de,j as ke}from"./vendor-hooks-DXGUREV9.js";import{r as C,b as X}from"./vendor-react-DEoibe3W.js";import{d as Z}from"./InfoOutlined-BjII93aR.js";import{z as F,E as ve,F as Y,C as ce,t as Ee}from"./index-CksPySYI.js";import{u as N}from"./dashboard-CvJ8cVy-.js";import{H as o,j as e,D as Ce,aj as Te,t as Se,aa as g,O as ie,T as S,ab as U,ak as ee,z as Re,y as B,bt as le,bS as V,ad as W,L as Q,A as G,be as Ie,E as A,I as _,C as Me,br as Pe,al as P,ch as De,X as $e,bd as J,bq as ze,b5 as We,ci as Ae,cj as Oe,b6 as qe,an as Le,c1 as Be,s as pe,v as He,ck as Fe,cl as Ne,cm as Ue,cn as _e,co as Ke}from"./vendor-mui-core-B6POpIBB.js";import{q as Ye}from"./vendor-arcblock-Dkhgjlzn.js";import{d as Ve}from"./ExpandLess-TUium4RQ.js";import{b as ue,z as Je,A as Qe}from"./vendor-utils-CjMBJT5V.js";import{C as Ge}from"./confirm-BqrhdaU7.js";import{A as Xe}from"./actions-BW0Vx00_.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-CXDkfohf.js";import"./PlayArrow-zDVVYX6u.js";import"./get-safe-url-cyoeQ7Mw.js";import"./format-error-BrmqJs5a.js";import"./session-DLQ0rbYE.js";import"./use-blocklet-logo-BOYeM9RY.js";import"./dot-WAAJ-O65.js";import"./useAsync-GjVghrwi.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BKvZ6hcv.js";import"./MoreHoriz-DHyMdwpT.js";const Ze=t=>{var j,y;const[d,c]=C.useState(null),[a,b]=C.useState(!t),[R,p]=C.useState(null),{blocklet:s}=ce(),l=(y=(j=s==null?void 0:s.site)==null?void 0:j.domainAliases[0])==null?void 0:y.value,v=C.useMemo(()=>{const x={};return d&&(d.sources.forEach(r=>{x[r.did]={source:r,events:[],count:0}}),d.events.forEach(r=>{x[r.source]&&(x[r.source].events.push(r),x[r.source].count+=1)})),x},[d]),T=async()=>{try{if(b(!0),!l)return;const r=await(await fetch(`https://${l}/.well-known/service/openevent.json`)).json();c(r),p(null)}catch(x){p(x instanceof Error?x:new Error(String(x)))}finally{b(!1)}};return C.useEffect(()=>{T()},[l]),{openEvent:d,setOpenEvent:c,eventsBySource:v,loading:a,error:R,loadData:T}};function te({eventsBySource:t,selectedEvents:d,setSelectedEvents:c,error:a}){const{t:b}=q(),[R,p]=C.useState({}),s=C.useMemo(()=>{const r={};return Object.entries(t).forEach(([w,{events:f}])=>{const E=f.filter(u=>d[`${u.type}-${u.source}`]).length;r[w]=E}),r},[t,d]),l=C.useMemo(()=>Object.values(s).reduce((r,w)=>r+w,0),[s]),v=C.useMemo(()=>Object.values(t).reduce((r,{events:w})=>r+w.length,0),[t]),T=(r,w)=>{w.stopPropagation(),p({...R,[r]:!R[r]})},j=r=>{const w=`${r.type}-${r.source}`;c(f=>({...f,[w]:!f[w]}))},y=(r,w)=>{const f={};r.forEach(E=>{const u=`${E.type}-${E.source}`;f[u]=!w}),c(E=>({...E,...f}))},x=r=>{const w={};Object.values(t).forEach(({events:f})=>{f.forEach(E=>{const u=`${E.type}-${E.source}`;w[u]=r.target.checked})}),c(w)};return e.jsxs(g,{sx:{width:"100%"},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(le,{control:e.jsx(V,{onChange:x,checked:l>0&&l===v}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[b("webhookEndpoint.selectAllEvents"),e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:e.jsx(W,{title:b("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(Z,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(S,{variant:"body2",color:"primary",sx:{ml:"auto"},children:b("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(g,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(Q,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(t).map(([r,{source:w,events:f,count:E}],u)=>{const M=s[r]>0,i=s[r]===f.length&&f.length>0,h=R[r];return e.jsxs(X.Fragment,{children:[e.jsx(G,{sx:{borderBottom:({palette:n})=>u<Object.keys(t).length-1?`1px solid ${n.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(g,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:n=>{n.target.closest(".MuiFormControlLabel-root")||T(r,n)},children:[e.jsx(g,{sx:{display:"flex",alignItems:"center"},children:f.length>0&&e.jsx(le,{control:e.jsx(V,{checked:i,indeterminate:M&&!i,onChange:n=>{n.stopPropagation(),y(f,i)}}),label:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[w.logo&&e.jsx(Ie,{src:w.logo,sx:{width:24,height:24}}),e.jsx(g,{children:w.title||r}),M&&e.jsx(A,{label:b("webhookEndpoint.selectedCount",{count:s[r]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:n=>`${n.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(g,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(S,{variant:"body2",color:"text.secondary",sx:{mr:1},children:b("webhookEndpoint.eventsCount",{count:E})}),f.length>0&&e.jsx(_,{size:"small",edge:"end",children:h?e.jsx(Ve,{}):e.jsx(Ye,{})})]})]})}),f.length>0&&e.jsx(Me,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(Q,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:f.map(n=>{const m=`${n.type}-${n.source}`,k=!!d[m];return e.jsx(G,{dense:!0,sx:{py:.75},onClick:()=>j(n),children:e.jsxs(g,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(V,{checked:k,sx:{mr:1}}),e.jsxs(g,{children:[e.jsx(S,{variant:"body1",sx:{cursor:"pointer"},children:n.type}),e.jsx(S,{variant:"caption",color:"text.disabled",sx:{display:"block",cursor:"pointer"},children:n.description})]})]})},m)})})})]},r)})})}),a&&e.jsx(Pe,{error:!0,sx:{mt:1},children:a})]})}te.propTypes={eventsBySource:o.objectOf(o.shape({source:o.shape({did:o.string.isRequired,title:o.string,description:o.string,version:o.string,logo:o.string}).isRequired,events:o.arrayOf(o.shape({type:o.string.isRequired,description:o.string.isRequired,source:o.string.isRequired})).isRequired,count:o.number.isRequired})).isRequired,selectedEvents:o.objectOf(o.bool).isRequired,setSelectedEvents:o.func.isRequired,error:o.string};te.defaultProps={error:null};function oe({id:t,url:d,description:c,enabledEvents:a,onSubmit:b,onClose:R}){var n;const{t:p}=q(),[s,l]=C.useState({}),{teamDid:v}=N(),{api:T}=F(),{loading:j,error:y,eventsBySource:x}=Ze(),{control:r,handleSubmit:w,formState:{errors:f},reset:E,setValue:u,trigger:M}=ve({defaultValues:{url:"",description:""}});C.useEffect(()=>{const m=Object.values(s).some(k=>k);u("selectedEvents",m?"valid":""),M("selectedEvents")},[s,u,M]);const i=()=>{l({}),E(),R()},h=async m=>{const k=Object.keys(s).filter(I=>s[I]),D={url:m.url,description:m.description,enabledEvents:k.map(I=>{const[O,L]=I.split("-");return!O||!L?null:{type:O,source:L}}).filter(Boolean)};try{if(t){const I=await T.updateWebhookEndpoint({input:{teamDid:v,id:t,data:D}});z.success(`${p("webhookEndpoint.updateWebhook")} ${p("webhookEndpoint.success")}`),b(I)}else{const I=await T.createWebhookEndpoint({input:{teamDid:v,input:D}});z.success(`${p("webhookEndpoint.createWebhook")} ${p("webhookEndpoint.success")}`),b(I)}}catch(I){z.error(I==null?void 0:I.message)}i()};return C.useEffect(()=>{E({url:d,description:c}),l(a.reduce((m,k)=>(m[`${k.type}-${k.source}`]=!0,m),{}))},[E,l,d,c,a]),e.jsx(Ce,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:w(h),children:[e.jsx(Te,{children:p(t?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Se,{children:e.jsxs(g,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(Y,{name:"url",control:r,rules:{required:p("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:p("webhookEndpoint.validation.urlInvalid")}},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.url.label"),fullWidth:!0,error:!!f.url,helperText:(k=f.url)==null?void 0:k.message})}}),e.jsx(Y,{name:"description",control:r,rules:{required:p("webhookEndpoint.validation.descriptionRequired")},render:({field:m})=>{var k;return e.jsx(ie,{...m,label:p("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!f.description,helperText:(k=f.description)==null?void 0:k.message})}}),e.jsx(Y,{name:"selectedEvents",control:r,rules:{required:p("webhookEndpoint.validation.eventRequired")},render:({field:m})=>e.jsx("input",{type:"hidden",...m})}),!j&&x&&Object.keys(x).length>0&&e.jsx(te,{eventsBySource:x,selectedEvents:s,setSelectedEvents:l,error:(n=f.selectedEvents)==null?void 0:n.message}),!j&&(!x||Object.keys(x).length===0)&&e.jsx(S,{color:"text.secondary",children:p("webhookEndpoint.noAvailableEvents")}),j&&e.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),y&&e.jsx(ee,{severity:"error",children:p("webhookEndpoint.loadingError",{message:y==null?void 0:y.message})})]})}),e.jsxs(Re,{sx:{p:"8px 24px 24px"},children:[e.jsx(B,{onClick:i,children:p("common.cancel")}),e.jsx(B,{type:"submit",variant:"contained",color:"primary",children:p(t?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}oe.propTypes={onSubmit:o.func.isRequired,id:o.string,url:o.string,description:o.string,enabledEvents:o.arrayOf(o.shape({type:o.string.isRequired,source:o.string.isRequired})),onClose:o.func};oe.defaultProps={id:null,url:"",description:"",enabledEvents:[],onClose:()=>{}};function xe(t){switch(t){case"enabled":return"success";case"disabled":default:return"default"}}const et=(t="en")=>t==="tw"?"zh":t;function H(t,d="YYYY-MM-DD HH:mm:ss",c="en"){return t?Ee(t).locale(et(c)).format(d):"-"}function tt(t){return typeof t=="number"?!1:ue(t)}function ot(t){return t>=200&&t<300}function $(t){const d=tt(t.value);return e.jsxs(e.Fragment,{children:[e.jsxs(P,{direction:"column",alignItems:"flex-start",children:[e.jsxs(S,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[t.label,!!t.tip&&e.jsx(W,{title:t.tip,children:e.jsx(De,{fontSize:"small"})})]}),e.jsx(S,{component:"div",variant:"body1",color:d?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:d?"-":t.value})]}),t.divider&&e.jsx($e,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:o.oneOfType([o.string,o.node]).isRequired,value:o.oneOfType([o.string,o.node]).isRequired,tip:o.oneOfType([o.string,o.node]),divider:o.bool};$.defaultProps={tip:"",divider:!1};function ne(t){return e.jsxs(P,{className:"section-header",direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:t.mb,mt:t.mt,pb:1},children:[e.jsx(S,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:t.title}),t.children]})}ne.propTypes={title:o.oneOfType([o.string,o.node]).isRequired,children:o.node,mb:o.number,mt:o.number};ne.defaultProps={children:null,mb:1.5,mt:1.5};const nt=t=>{const d={};return t.forEach(c=>{var b;const a=new Date(c.createdAt).toLocaleDateString();d[a]||(d[a]=[]),(b=d[a])==null||b.push(c)}),d};function se({eventId:t,webhookEndpointId:d,event:c}){const{api:a}=F(),{t:b}=q(),{teamDid:R}=N(),{blocklet:p}=ce(),{data:s,loadMore:l,loadingMore:v,loading:T}=we(u=>{const i=u?Math.ceil(u.list.length/15)+1:1;return a.getWebhookAttempts({input:{teamDid:R,input:{eventId:t,webhookId:d},paging:{page:i,pageSize:15}}})},{reloadDeps:[t,d]}),j=(s==null?void 0:s.list)||[],[y,x]=C.useState(null),r=nt(j);C.useEffect(()=>{!y&&(s!=null&&s.list.length)&&x(s.list[0])},[s==null?void 0:s.list.length,y]);const w=u=>{x(u)};if(T)return e.jsx(U,{});const f=s&&s.list.length<s.paging.total,E=u=>{var M,i,h,n,m;if(u.responseBody&&((M=u.responseBody)!=null&&M.sessionId)&&((i=u.responseBody)!=null&&i.projectId)&&((h=u.responseBody)!=null&&h.agentId)){const k=(m=(n=p==null?void 0:p.site)==null?void 0:n.domainAliases[0])==null?void 0:m.value,D=(p.children||[]).find(O=>{var L;return((L=O==null?void 0:O.meta)==null?void 0:L.name)==="ai-studio"}),I=Je(Qe(`https://${k}`,(D==null?void 0:D.mountPoint)||"","projects",u.responseBody.projectId,"logs/main"),{sessionId:u.responseBody.sessionId,agentId:u.responseBody.agentId});return e.jsx(_,{sx:{fontSize:20},onClick:()=>window.open(I,"_blank"),children:e.jsx(g,{component:be,icon:ge})})}return null};return e.jsxs(J,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(J,{item:!0,xs:12,md:4,height:1,children:ue(Object.keys(r))?e.jsx(S,{color:"text.secondary",children:b("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(r).map(([u,M])=>e.jsxs(X.Fragment,{children:[e.jsx(ze,{children:u}),M.map(i=>e.jsxs(G,{sx:{cursor:"pointer"},onClick:()=>w(i),selected:y===i,secondaryAction:e.jsx(S,{color:"text.secondary",children:H(i.createdAt,"HH:mm:ss")}),children:[e.jsx(We,{sx:{minWidth:0,mr:1.5},children:ot(i.responseStatus)===!1?e.jsx(Ae,{color:"error"}):e.jsx(Oe,{color:"success"})}),e.jsx(qe,{primary:e.jsx(S,{color:"text.primary",children:i.event.type})})]},i.id))]},u))}),f&&e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,children:e.jsx(B,{variant:"text",type:"button",color:"inherit",onClick:l,disabled:v,sx:{color:u=>u.palette.text.disabled},children:b(v?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(J,{item:!0,xs:12,md:8,height:1,children:[y&&e.jsxs(P,{height:1,overflow:"auto",direction:"column",spacing:2,sx:{pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h6",children:t?y.endpoint.url:y.event.type}),e.jsx(g,{children:E(y)})]}),e.jsxs(g,{children:[e.jsxs(S,{variant:"h6",children:[b("webhookEndpoint.response")," (",y.responseStatus,")"]}),e.jsx(K,{language:"json",children:JSON.stringify(y.responseBody,null,2)})]}),e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.request")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(y.event,null,2)})]})]}),(s==null?void 0:s.list.length)===0&&c&&e.jsxs(g,{children:[e.jsx(P,{direction:"row",alignItems:"center",spacing:1,children:e.jsx(S,{variant:"h6",children:b("webhookEndpoint.eventData")})}),e.jsx(K,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}se.propTypes={eventId:o.string,webhookEndpointId:o.string,event:o.shape({type:o.string,data:o.object,request:o.object,requestInfo:o.object})};se.defaultProps={eventId:"",webhookEndpointId:"",event:null};function he({id:t,onClose:d}){var v,T,j,y;const{t:c}=q(),{api:a}=F(),{teamDid:b}=N(),{loading:R,error:p,data:s}=de(()=>a.getWebhookEndpoint({input:{teamDid:b,id:t}})),l=s==null?void 0:s.data;return p?e.jsx(ee,{severity:"error",children:p.message}):R||!l?e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1,children:e.jsx(U,{})}):e.jsxs(st,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(g,{children:[e.jsxs(P,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(P,{flex:1,width:0,children:e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(S,{variant:"h5",fontWeight:600,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:l.description}),e.jsx(W,{title:l.url,children:e.jsx(Z,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(P,{direction:"row",alignItems:"center",children:e.jsx(_,{edge:"end",color:"inherit",onClick:d,children:e.jsx(Be,{})})})]}),e.jsx(g,{mt:2,children:e.jsxs(P,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},justifyContent:"flex-start",flexWrap:"wrap",sx:{pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(A,{size:"small",variant:"filled",label:l.status,color:xe(l.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(W,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:l.enabledEvents.map(x=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:x==null?void 0:x.type},x))}),children:e.jsx(A,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:l.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:l.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(l.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(l.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(W,{arrow:!0,title:(v=l.createUser)==null?void 0:v.did,children:e.jsx(A,{size:"small",variant:"filled",label:(T=l.createUser)==null?void 0:T.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(W,{arrow:!0,title:(j=l.updateUser)==null?void 0:j.did,children:e.jsx(A,{size:"small",variant:"filled",label:(y=l.updateUser)==null?void 0:y.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(P,{className:"section",flex:1,height:0,overflow:"hidden",children:[e.jsx(ne,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(P,{height:0,flex:1,overflow:"hidden",children:e.jsx(se,{webhookEndpointId:l.id})})]})]})}he.propTypes={id:o.string.isRequired,onClose:o.func.isRequired};const st=pe(P)``;function me({open:t,onClose:d,id:c}){return e.jsx(Le,{anchor:"right",open:t,onClose:d,PaperProps:{sx:{width:"90vw",maxWidth:"1200px"}},children:e.jsx(g,{sx:{height:"100vh",p:3},children:e.jsx(he,{id:c,onClose:d})})})}me.propTypes={open:o.bool.isRequired,onClose:o.func.isRequired,id:o.string.isRequired};function ae(){return null}const re=X.memo(({options:t,columns:d,toolbar:c=!0,footer:a=!0,hasRowLink:b=!1,emptyNodeText:R="",...p})=>{const{locale:s}=q(),l=He(j=>j.breakpoints.down("md")),v={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:l?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},T={};return c||(T.TableToolbar=ae),a||(T.TableFooter=ae),e.jsx(rt,{locale:s,options:{...v,...t},columns:(d||[]).map(j=>(j.options=j.options||{},j.options.filter=j.options.filter||!1,j.options.sort=j.options.sort||!1,j)),emptyNode:e.jsx(fe,{children:R}),...p,components:T,hasRowLink:b,isMobile:l})});re.propTypes={options:o.object,columns:o.array,toolbar:o.bool,footer:o.bool,hasRowLink:o.bool,emptyNodeText:o.node,durable:o.string,durableKeys:o.array,data:o.array,loading:o.bool,onChange:o.func,title:o.node,components:o.object};re.defaultProps={options:{},columns:[],toolbar:!0,footer:!0,hasRowLink:!1,emptyNodeText:null,durable:"",durableKeys:[],data:[],loading:!1,onChange:()=>{},title:null,components:{}};const rt=pe(je)`
2
+ .MuiPaper-root {
3
+ border-radius: 8px;
4
+ overflow: hidden;
5
+ }
6
+ table.MuiTable-root {
7
+ outline: 1px solid ${({theme:t})=>t.palette.divider};
8
+ border-radius: var(--radius-m, 8px);
9
+ overflow: hidden;
10
+ }
11
+ [class*='MUIDataTable-responsiveBase'] {
12
+ outline: 1px solid ${({theme:t})=>t.palette.divider};
13
+ border-radius: var(--radius-m, 8px);
14
+ }
15
+
16
+ th.MuiTableCell-head {
17
+ padding: 8px 16px 8px 16px;
18
+ text-transform: inherit;
19
+ border-bottom: none;
20
+ &:first-of-type {
21
+ border-top-left-radius: 8px;
22
+ padding-left: 20px;
23
+ }
24
+ &:last-of-type {
25
+ border-top-right-radius: 8px;
26
+ }
27
+ }
28
+
29
+ tr.MuiTableRow-root:not(.MuiTableRow-footer):hover {
30
+ background: ${({theme:t})=>t.palette.grey[100]};
31
+ }
32
+ tr.MuiTableRow-root:last-of-type td:first-of-type {
33
+ border-bottom-left-radius: 8px;
34
+ }
35
+
36
+ tr.MuiTableRow-root:last-of-type td:last-of-type {
37
+ border-bottom-right-radius: 8px;
38
+ }
39
+
40
+ tr.MuiTableRow-root:nth-of-type(even) {
41
+ background: ${({theme:t})=>t.palette.grey[50]};
42
+ }
43
+ td.MuiTableCell-root {
44
+ border-bottom: none;
45
+ padding-top: 12px;
46
+ padding-bottom: 12px;
47
+ padding-left: 16px;
48
+ padding-right: 16px;
49
+ &:first-of-type {
50
+ padding-left: 20px;
51
+ }
52
+ &.MuiTableCell-footer {
53
+ border: none;
54
+ }
55
+ }
56
+
57
+ .datatable-footer {
58
+ .MuiTableRow-root.MuiTableRow-footer {
59
+ border: none;
60
+ }
61
+ table.MuiTable-root {
62
+ outline: none;
63
+ overflow: hidden;
64
+ }
65
+ .MuiTablePagination-input {
66
+ background: none;
67
+ }
68
+ div.MuiSelect-select {
69
+ padding: 0 24px 0 0;
70
+ }
71
+ }
72
+
73
+ th a,
74
+ td a {
75
+ text-decoration: none;
76
+ display: block;
77
+ color: inherit;
78
+ &:first-of-type {
79
+ padding-left: 0;
80
+ }
81
+ }
82
+
83
+ > div {
84
+ overflow: auto;
85
+ }
86
+ .custom-toobar-title-inner {
87
+ display: flex;
88
+ align-items: center;
89
+ }
90
+ @media (max-width: ${({theme:t})=>t.breakpoints.values.md}px) {
91
+ th a,
92
+ td a {
93
+ text-decoration: none;
94
+ display: block;
95
+ color: inherit;
96
+ padding-top: 0;
97
+ padding-bottom: 0;
98
+ padding-right: 0;
99
+ }
100
+ tr.MuiTableRow-root {
101
+ border: none;
102
+ padding: 20px;
103
+ display: block;
104
+ }
105
+ td.MuiTableCell-root:first-of-type {
106
+ padding-left: 0;
107
+ margin-top: 0;
108
+ }
109
+ td.MuiTableCell-root {
110
+ margin: 0;
111
+ margin-top: 8px;
112
+ align-items: center;
113
+ padding: 0;
114
+ flex-wrap: wrap;
115
+ flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
116
+ align-items: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"center"};
117
+ justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="column"?"flex-start":"space-between"};
118
+ }
119
+ td.MuiTableCell-root > div {
120
+ margin-bottom: 4px;
121
+ }
122
+ .MuiTable-root > .MuiTableBody-root > .MuiTableRow-root > td.MuiTableCell-root {
123
+ display: flex;
124
+ flex-direction: ${({mobileTDFlexDirection:t="column"})=>t||"row"};
125
+ align-items: flex-start;
126
+ justify-content: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"space-between":"flex-start"};
127
+ flex-wrap: ${({mobileTDFlexDirection:t="column"})=>t==="row"?"nowrap":"wrap"};
128
+ word-break: break-all;
129
+ &.datatables-noprint {
130
+ justify-content: center;
131
+ }
132
+ }
133
+ [class*='MUIDataTable-responsiveBase'] tr:not([class*='responsiveSimple']) td.MuiTableCell-body > div {
134
+ width: inherit;
135
+ }
136
+ }
137
+ `,it=re;function Pt(){const{teamDid:t}=N(),d=`webhook-endpoints-${t}`,c=ye(d),{t:a}=q(),{api:b}=F(),[R,p]=C.useState(""),[s,l]=C.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[v,T]=ke(d,{defaultValue:{pageSize:c.rowsPerPage||20,page:c.page?c.page+1:1}}),{loading:j,error:y,data:x,refresh:r}=de(()=>b.getWebhookEndpoints({input:{teamDid:t,paging:{page:v.page,pageSize:v.pageSize}}}));C.useEffect(()=>{r()},[v,r]);const w=C.useCallback(async(i,h)=>{try{await b.updateWebhookEndpoint({input:{teamDid:t,id:i.id,data:{status:h?"disabled":"enabled"}}}),r(),z.success(`${a(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${a("webhookEndpoint.success")}`)}catch(n){z.error(n==null?void 0:n.message)}},[b,t,r,a]),f=C.useCallback(async i=>{try{await b.deleteWebhookEndpoint({input:{teamDid:t,id:i}}),r(),l(h=>({...h,deleteConfirm:null})),z.success(`${a("common.delete")}${a("webhookEndpoint.success")}`)}catch(h){z.error(h==null?void 0:h.message)}},[b,t,r,a]),E=(i,h)=>{let n=i.page+1;const m=i.searchText||"";if(m!==R){p(m);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(n=1);const k={page:n,pageSize:i.rowsPerPage};p(""),T(k)}};if(y)return e.jsx(ee,{severity:"error",children:y.message});if(j||!x)return e.jsx(g,{display:"flex",justifyContent:"center",alignItems:"center",width:1,height:500,children:e.jsx(U,{})});const u=((x==null?void 0:x.list)||[]).filter(i=>{if(!R)return!0;const h=R.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),M=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(S,{variant:"body2",children:n.description}),e.jsx(g,{sx:{display:"flex"},onClick:m=>{m.stopPropagation()},children:e.jsx(W,{title:n.url,children:e.jsx(Z,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:n.enabledEvents.map(m=>e.jsx(A,{size:"small",variant:"filled",label:m.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${n.source}-${m.type}`))})}}},{label:a("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const n=u[h];return e.jsx(A,{size:"small",variant:"filled",label:a(`webhookEndpoint.${n==null?void 0:n.status}`),color:xe(n==null?void 0:n.status),sx:{borderRadius:"4px",textTransform:"capitalize"}},`status-${n.status}`)}}},{label:a("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:a("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const n=u[h],m=(n==null?void 0:n.status)==="enabled";return e.jsx(Xe,{actions:[{icon:m?e.jsx(Fe,{}):e.jsx(Ne,{}),text:a(m?"webhookEndpoint.disable":"webhookEndpoint.enable"),onClick:k=>{k.stopPropagation(),w(n,m)}},{icon:e.jsx(Ue,{}),text:a("common.edit"),onClick:k=>{k.stopPropagation(),l(D=>({...D,createEdit:{open:!0,id:n.id,url:n.url,description:n.description,enabledEvents:n.enabledEvents}}))}},{icon:e.jsx(_e,{}),text:a("common.delete"),onClick:k=>{k.stopPropagation(),l(D=>({...D,deleteConfirm:{title:a("webhookEndpoint.deleteWebhook.title"),description:a("webhookEndpoint.deleteWebhook.description"),confirm:a("common.confirm"),cancel:a("common.cancel"),onConfirm:()=>f(n.id),onCancel:()=>l(I=>({...I,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(e.Fragment,{children:[e.jsx(it,{durable:d,durableKeys:["page","rowsPerPage"],data:u,columns:M,options:{count:x.count,page:v.page-1,rowsPerPage:v.pageSize,customToolbar:()=>e.jsx(_,{onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:e.jsx(Ke,{})},"add"),onRowClick:(i,{dataIndex:h})=>{const n=x.list[h];l(m=>({...m,webhookDetail:{open:!0,id:n.id}}))}},loading:j,onChange:E,title:e.jsx(S,{variant:"h6",children:a("webhookEndpoint.title")}),emptyNodeText:e.jsxs(P,{gap:1,children:[a("webhookEndpoint.noWebhooksAdded"),e.jsx(B,{variant:"contained",color:"primary",onClick:()=>l(i=>({...i,createEdit:{...i.createEdit,open:!0}})),children:a("webhookEndpoint.createWebhook")})]})}),s.webhookDetail.open&&e.jsx(me,{open:!0,onClose:()=>l(i=>({...i,webhookDetail:{open:!1,id:null}})),id:s.webhookDetail.id}),s.createEdit.open&&e.jsx(oe,{onSubmit:r,...s.createEdit,onClose:()=>l(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),s.deleteConfirm&&e.jsx(Ge,{title:s.deleteConfirm.title,description:s.deleteConfirm.description,confirm:s.deleteConfirm.confirm,cancel:s.deleteConfirm.cancel,params:s.deleteConfirm.params,onConfirm:s.deleteConfirm.onConfirm,onCancel:s.deleteConfirm.onCancel})]})}export{Pt as default};