@abtnode/webapp 1.16.28-beta-10ca1aad → 1.16.28-beta-8acda0e6

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 (166) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-NewVG93V.js → Add-CazR0vZK.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-Bd9sR9Kj.js → ArrowDropDown-BUrSvBpJ.js} +1 -1
  5. package/dist/assets/{Autocomplete-BvkSiNum.js → Autocomplete-DtvRC-0f.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-AZ_8G3rf.js → Breadcrumbs-D_LYBn3C.js} +1 -1
  7. package/dist/assets/{ButtonGroup-pLJbtCLI.js → ButtonGroup-DxRrpbFw.js} +1 -1
  8. package/dist/assets/{CheckCircle-DkW4b6y7.js → CheckCircle-DbpNufE5.js} +1 -1
  9. package/dist/assets/{ChevronLeft-C0YN2KhY.js → ChevronLeft-Bqynugte.js} +1 -1
  10. package/dist/assets/{ChevronRight-hQNW7SHU.js → ChevronRight-C8sGT-T0.js} +1 -1
  11. package/dist/assets/{Close-S913aeni.js → Close-uiQeu7_r.js} +1 -1
  12. package/dist/assets/{Delete-LMbP8m3y.js → Delete-DHiwhVmP.js} +1 -1
  13. package/dist/assets/DeleteOutline-CnmOxEUl.js +1 -0
  14. package/dist/assets/{Done-BJ9nFL7V.js → Done-LyiBXZqg.js} +1 -1
  15. package/dist/assets/{Edit-BgzVDDnU.js → Edit-BgU3t9-z.js} +1 -1
  16. package/dist/assets/{EditIcon-D0wQcFnY.js → EditIcon-CeWwrlQZ.js} +1 -1
  17. package/dist/assets/{FilterList-YahW7b2T.js → FilterList-usqmRCGh.js} +1 -1
  18. package/dist/assets/{Google-DU7ZCGKH.js → Google-BzTTYoLn.js} +1 -1
  19. package/dist/assets/{Https-CsrqmSk1.js → Https-B3r3YjjJ.js} +1 -1
  20. package/dist/assets/{InputAdornment-CP3BhuEs.js → InputAdornment-0DnARlEj.js} +1 -1
  21. package/dist/assets/{InputLabel-DOxBtPfl.js → InputLabel-Csh1ynXt.js} +1 -1
  22. package/dist/assets/{LastPage-DmVgRYiw.js → LastPage-DnsJsUIR.js} +1 -1
  23. package/dist/assets/{Launch-D-68sLeU.js → Launch-BOea_wCy.js} +1 -1
  24. package/dist/assets/{Link-CSeasEZI.js → Link-ByQdtjfh.js} +1 -1
  25. package/dist/assets/{LoadingButton-CuJ6PUWH.js → LoadingButton-Cj_wXKeI.js} +1 -1
  26. package/dist/assets/{LockIcon-BlIFddg8.js → LockIcon-C082WeKw.js} +1 -1
  27. package/dist/assets/{Loop-DIds44Mh.js → Loop-m_399M1H.js} +1 -1
  28. package/dist/assets/{MoreVert-Cei2Rx5H.js → MoreVert-BzXa-i1R.js} +1 -1
  29. package/dist/assets/{Pagination-C2m02Dsu.js → Pagination-DSEqJST1.js} +1 -1
  30. package/dist/assets/{Public-B9WCVLI7.js → Public-0DIMrFya.js} +1 -1
  31. package/dist/assets/{SchemaReference.es--cFrK-mF.js → SchemaReference.es-ISuYhpDf.js} +1 -1
  32. package/dist/assets/{Search-xUbipjHz.js → Search-CQMDHt0w.js} +1 -1
  33. package/dist/assets/{Select-DdUtkwyq.js → Select-DXPyl9dO.js} +1 -1
  34. package/dist/assets/{Skeleton-DVrY1Qbr.js → Skeleton-URH_1vdL.js} +1 -1
  35. package/dist/assets/{Slider-110G8tdG.js → Slider-Bs8PTrpt.js} +1 -1
  36. package/dist/assets/{Stepper-D1V6NqBX.js → Stepper-F9lgPB4i.js} +1 -1
  37. package/dist/assets/{TextField-3uVNonhd.js → TextField-B9TZBqQf.js} +1 -1
  38. package/dist/assets/{ToggleButtonGroup-JLgFfvsV.js → ToggleButtonGroup-B4DF013K.js} +1 -1
  39. package/dist/assets/{ViewList-jxsh9SMq.js → ViewList-BsKNUMlP.js} +1 -1
  40. package/dist/assets/{actions-C2sJQ8Fo.js → actions-B9P9hAjw.js} +1 -1
  41. package/dist/assets/{actions-DbKUVgjV.js → actions-Dunvsfuf.js} +1 -1
  42. package/dist/assets/{agreement-DDEIcdN2.js → agreement-C1qfhTtQ.js} +1 -1
  43. package/dist/assets/api-BM9dJimB.js +1 -0
  44. package/dist/assets/{app-avatar-DxfZHNQ7.js → app-avatar-DQiSEUVG.js} +1 -1
  45. package/dist/assets/{audit-logs-CteQbS8_.js → audit-logs-C18DG_HF.js} +1 -1
  46. package/dist/assets/{brace-fold.es-CGA9Przx.js → brace-fold.es-5N33ToDI.js} +1 -1
  47. package/dist/assets/{bundle-avatar-DrhjE4I8.js → bundle-avatar-6edO3WvW.js} +1 -1
  48. package/dist/assets/{chart-D4E9CCIm.js → chart-DxusdyLS.js} +1 -1
  49. package/dist/assets/{click-to-copy-Cd2slBnK.js → click-to-copy-DdhnSrH5.js} +1 -1
  50. package/dist/assets/{closebrackets.es-n2RjIdxq.js → closebrackets.es-iyZsaRgi.js} +1 -1
  51. package/dist/assets/{codemirror.es-DPri5EWV.js → codemirror.es-DeO7gDXr.js} +1 -1
  52. package/dist/assets/{comment.es-C5rcyFQ8.js → comment.es-CfO1lV_o.js} +1 -1
  53. package/dist/assets/{config-navigation-Dhvd0Io1.js → config-navigation-CcJGg9PY.js} +1 -1
  54. package/dist/assets/{delete-confirm-ri-NT9BE.js → delete-confirm-C4Bk8D3q.js} +1 -1
  55. package/dist/assets/{detail-DjuS1eoq.js → detail-ByJGw6CQ.js} +3 -3
  56. package/dist/assets/{dialog.es-BwhOJ4Cq.js → dialog.es-CQHFFbgC.js} +1 -1
  57. package/dist/assets/{download-DChiY5q1.js → download-DjWKDAKk.js} +1 -1
  58. package/dist/assets/{foldgutter.es-BBpI4A5D.js → foldgutter.es-D2ybLApJ.js} +1 -1
  59. package/dist/assets/getValidReactChildren-BhT8Dia7.js +1 -0
  60. package/dist/assets/{hint.es-BAS5bESO.js → hint.es-U_5yDQ-L.js} +1 -1
  61. package/dist/assets/{hint.es2-BHkOTzjY.js → hint.es2-B5AxTcUD.js} +1 -1
  62. package/dist/assets/{iframe-9Q6zcs_o.js → iframe-CN6X1zkC.js} +1 -1
  63. package/dist/assets/index-7hmZo5yz.js +54 -0
  64. package/dist/assets/{index-Dw3AMY5z.js → index-9FRtImOR.js} +1 -1
  65. package/dist/assets/{index-D8yUR2aq.js → index-BO1T0fz0.js} +1 -1
  66. package/dist/assets/{index-BQUIGxYm.js → index-BUQuICIV.js} +1 -1
  67. package/dist/assets/{index-DysPnzV7.js → index-BXxemGex.js} +1 -1
  68. package/dist/assets/{index-BJEYtaIe.js → index-BiYiUZU0.js} +1 -1
  69. package/dist/assets/{index-CWU-40xT.js → index-Bj3d2EwJ.js} +3 -3
  70. package/dist/assets/{index-wR2FBwGe.js → index-Bpjx7556.js} +1 -1
  71. package/dist/assets/{index-F32lbxl3.js → index-BsRcoDUD.js} +1 -1
  72. package/dist/assets/{index-BQK6o51a.js → index-BysoAAKf.js} +10 -10
  73. package/dist/assets/{index-C3dyY7Jn.js → index-C5VGS0or.js} +1 -1
  74. package/dist/assets/{index-CFcksbYG.js → index-CBFgpWWt.js} +1 -1
  75. package/dist/assets/{index-CxfL2iNj.js → index-CBQDge9H.js} +1 -1
  76. package/dist/assets/{index-DtqP33jl.js → index-CBcjH65j.js} +1 -1
  77. package/dist/assets/{index-B6ebv4kj.js → index-CDk9gqwO.js} +1 -1
  78. package/dist/assets/{index-f9oKLglL.js → index-CNEFxICJ.js} +1 -1
  79. package/dist/assets/{index-D74eXDyn.js → index-CYqmm0Sa.js} +1 -1
  80. package/dist/assets/{index-CXkSaJRT.js → index-CaM460rw.js} +1 -1
  81. package/dist/assets/{index-CLeW9jNa.js → index-CiB-ceGd.js} +1 -1
  82. package/dist/assets/{index-C9Gucb3e.js → index-ClMriVhA.js} +1 -1
  83. package/dist/assets/{index-Dc91z-EC.js → index-CmUhV6b0.js} +1 -1
  84. package/dist/assets/{index-CcuoQAH9.js → index-Cqf3kTsw.js} +1 -1
  85. package/dist/assets/{index-BnOCj4ky.js → index-CsJW-E3u.js} +1 -1
  86. package/dist/assets/{index-DeBMBarq.js → index-CtlJtm28.js} +1 -1
  87. package/dist/assets/{index-DHhEgUS1.js → index-CzxambID.js} +5 -5
  88. package/dist/assets/{index-CXQ7qGR9.js → index-D3isMJCC.js} +1 -1
  89. package/dist/assets/{index-VH-ysxX_.js → index-D6XxoBY_.js} +1 -1
  90. package/dist/assets/{index-DwmHAX9V.js → index-DB54SdYK.js} +1 -1
  91. package/dist/assets/{index-BJy0Aykg.js → index-DHvVD3rl.js} +2 -2
  92. package/dist/assets/{index-CTxq4D6b.js → index-DINuwc4O.js} +3 -3
  93. package/dist/assets/{index-BhFjM9au.js → index-DRwkxXBX.js} +1 -1
  94. package/dist/assets/{index-CoYxdjrw.js → index-DqHjW7tc.js} +1 -1
  95. package/dist/assets/{index-BhpRo-lZ.js → index-DrZqlcHr.js} +1 -1
  96. package/dist/assets/index-Dw6syXvl.js +21 -0
  97. package/dist/assets/{index-DXRZFI-i.js → index-JuXoqefL.js} +1 -1
  98. package/dist/assets/{index-_GlgH8Bo.js → index-KnfQ44ac.js} +1 -1
  99. package/dist/assets/{index-Dyefferl.js → index-LuGhm-KA.js} +1 -1
  100. package/dist/assets/{index-8O7BlyHt.js → index-UfVz51n9.js} +1 -1
  101. package/dist/assets/{index-CzzL15YH.js → index-Ur9l5Pkv.js} +1 -1
  102. package/dist/assets/{index-Hv2GfUwQ.js → index-edI690Jp.js} +1 -1
  103. package/dist/assets/{index-CB6bYAXd.js → index-jYLpiIQq.js} +2 -2
  104. package/dist/assets/{index-B7nYrN4m.js → index-oWv9ehU5.js} +1 -1
  105. package/dist/assets/{index-BFpB8kh-.js → index-oxLMT1TZ.js} +1 -1
  106. package/dist/assets/{index.es-BYEd319I.js → index.es-BaoJVcS0.js} +1 -1
  107. package/dist/assets/{index.esm-CcmphPDr.js → index.esm-D5EJdopB.js} +1 -1
  108. package/dist/assets/{info-addon.es-Cj5Am4W8.js → info-addon.es-BF8YxAo6.js} +1 -1
  109. package/dist/assets/{info.es-CO85iRU8.js → info.es-BG-sFq93.js} +1 -1
  110. package/dist/assets/{install-from-url-DuMsEyFI.js → install-from-url-D_JUSXN1.js} +1 -1
  111. package/dist/assets/{invitation-B_cHWnei.js → invitation-B9fShyCE.js} +1 -1
  112. package/dist/assets/{is-path-prefix-equal-CYIvKmVL.js → is-path-prefix-equal-DTqcyXik.js} +1 -1
  113. package/dist/assets/{isEqual-GyLZxSRY.js → isEqual-BT0_AVZN.js} +1 -1
  114. package/dist/assets/{item-DE1w-7fx.js → item-k8JU-j43.js} +1 -1
  115. package/dist/assets/{javascript.es-BW5_tRcP.js → javascript.es-BxU6I3W8.js} +1 -1
  116. package/dist/assets/{jump-to-line.es-CHXn1yBu.js → jump-to-line.es-BJmdmPwT.js} +1 -1
  117. package/dist/assets/{jump.es-XIPua2Fi.js → jump.es-DdndOalg.js} +1 -1
  118. package/dist/assets/{line-aqaJQGOE.js → line-h_bDsdkk.js} +3 -3
  119. package/dist/assets/{lint.es-DDqYT3Z3.js → lint.es-S1IqD8Ty.js} +1 -1
  120. package/dist/assets/{lint.es2-UzvCZWiN.js → lint.es2-Pg9vOGzA.js} +1 -1
  121. package/dist/assets/{lint.es3-w94C1fvi.js → lint.es3-S5rsbMt9.js} +1 -1
  122. package/dist/assets/{list-header-BeAWG4F0.js → list-header-sMQeptfh.js} +1 -1
  123. package/dist/assets/{log-C18GoSnt.js → log-cMe-yCc9.js} +1 -1
  124. package/dist/assets/{lottie-BbyPiNfn.js → lottie-oKugLW27.js} +1 -1
  125. package/dist/assets/{matchbrackets.es-DZ1mhuIO.js → matchbrackets.es-CedBfYiO.js} +1 -1
  126. package/dist/assets/{memory-htbPwmSg.js → memory-DtZsgQku.js} +1 -1
  127. package/dist/assets/{mode.es-7keuh6oH.js → mode.es-BCvVo63y.js} +1 -1
  128. package/dist/assets/{mode.es2-vFQEp92Z.js → mode.es2-ahvvTvAM.js} +1 -1
  129. package/dist/assets/{mode.es3-Dn5SA7Oh.js → mode.es3-Bhh5S718.js} +1 -1
  130. package/dist/assets/{onlineParser.es--cELFe5v.js → onlineParser.es-D5Qe3rjM.js} +1 -1
  131. package/dist/assets/{overview-D6KKjePJ.js → overview-C8aXpNrX.js} +1 -1
  132. package/dist/assets/{react-BhYF7sD_.js → react-UY6g3dsd.js} +3 -3
  133. package/dist/assets/{redux-CIzpcDy1.js → redux-DYjmRPcE.js} +1 -1
  134. package/dist/assets/{resource-dialog-AGPGjRF5.js → resource-dialog-C82ZhW4T.js} +1 -1
  135. package/dist/assets/{runtime-CLIPNHPm.js → runtime-D1eyE8B1.js} +1 -1
  136. package/dist/assets/{search.es-CfOeePsS.js → search.es-0GT84-M2.js} +1 -1
  137. package/dist/assets/{searchcursor.es-RLZnp-2M.js → searchcursor.es-CX66aj_i.js} +1 -1
  138. package/dist/assets/service-DOjp5s19.js +1 -0
  139. package/dist/assets/{show-hint.es-D6R1Oh0E.js → show-hint.es-vCcUyQMQ.js} +1 -1
  140. package/dist/assets/{slicedToArray-CkMd8cEG.js → slicedToArray-I-ObepI-.js} +1 -1
  141. package/dist/assets/{spaces-Ndl2Z_l-.js → spaces-m3k1wtEz.js} +1 -1
  142. package/dist/assets/{sublime.es-BWpn5oL5.js → sublime.es-wltndpKH.js} +1 -1
  143. package/dist/assets/{switch-control-BL5Q92y_.js → switch-control-DSzxDtfl.js} +1 -1
  144. package/dist/assets/{table-icons-Bjq5TgED.js → table-icons-D70UZfU7.js} +2 -2
  145. package/dist/assets/{tag-Cksz2rJp.js → tag-BDr72C87.js} +1 -1
  146. package/dist/assets/{team-iad1pbmQ.js → team-Ch-Gj2hO.js} +1 -1
  147. package/dist/assets/{toUpper-DnPhzApo.js → toUpper-Bqm-4sXI.js} +1 -1
  148. package/dist/assets/{traffic-CWlSTLTp.js → traffic-BS6Lfitp.js} +1 -1
  149. package/dist/assets/{url-evaluation-CTHUhxLd.js → url-evaluation-ceiaoY0M.js} +1 -1
  150. package/dist/assets/{url-join-Dfl-k5vL.js → url-join-Bsj5KCM1.js} +1 -1
  151. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-BqhgZgq5.js → use-blocklet-info-for-connect-did-spaces-BQtm5420.js} +1 -1
  152. package/dist/assets/{useLocalStorage-B9e_6vUG.js → useLocalStorage-BOaGasKr.js} +1 -1
  153. package/dist/assets/{util-Brqqzx0p.js → util-CMnoIJSr.js} +1 -1
  154. package/dist/assets/{wait-container-CgxLnrOt.js → wait-container-CtbhxRrL.js} +1 -1
  155. package/dist/assets/{withStyles-CkukjHle.js → withStyles-CjmLVNUl.js} +1 -1
  156. package/dist/assets/{wrap-locale-Bh4fVNfi.js → wrap-locale-K8WYS2HB.js} +1 -1
  157. package/dist/index.html +1 -1
  158. package/dist/service-worker.js +1 -1
  159. package/package.json +1 -1
  160. package/dist/assets/DeleteOutline-BlZHBiGU.js +0 -1
  161. package/dist/assets/DeleteOutline-D7kF8YLA.js +0 -1
  162. package/dist/assets/api-3nNr_UzI.js +0 -1
  163. package/dist/assets/getValidReactChildren-2v0cL06g.js +0 -1
  164. package/dist/assets/index-CV9H0Z8Q.js +0 -54
  165. package/dist/assets/index-HsX6FBQ6.js +0 -21
  166. package/dist/assets/service-BE130afq.js +0 -1
@@ -1,4 +1,4 @@
1
- var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Q=(e,t,n)=>(Ht(e,typeof t!="symbol"?t+"":t,n),n);import{P as l,j as d,cf as ce,fN as ot,fO as Dt,r as T,co as Ut,cj as Bt,a2 as Vt,fP as qe,dQ as Qt,dO as Wt,fQ as Zt,dN as Gt,d2 as A,a7 as Jt,a8 as Yt,fR as Xt,O as P,fS as Kt,m as en,fT as tn,fU as nn,B as on,fV as rn,fz as rt,q as te,fW as sn,fX as cn,cp as an,fY as ln,s as M,fZ as st,f_ as un,c9 as it,f$ as fn,aA as ct,bV as de,b4 as dn,bb as pn,cq as at,g0 as hn}from"./index-BJy0Aykg.js";/**
1
+ var zt=Object.defineProperty;var Ht=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Q=(e,t,n)=>(Ht(e,typeof t!="symbol"?t+"":t,n),n);import{P as l,j as d,cf as ce,fN as ot,fO as Dt,r as T,co as Ut,cj as Bt,a2 as Vt,fP as qe,dQ as Qt,dO as Wt,fQ as Zt,dN as Gt,d2 as A,a7 as Jt,a8 as Yt,fR as Xt,O as P,fS as Kt,m as en,fT as tn,fU as nn,B as on,fV as rn,fz as rt,q as te,fW as sn,fX as cn,cp as an,fY as ln,s as M,fZ as st,f_ as un,c9 as it,f$ as fn,aA as ct,bV as de,b4 as dn,bb as pn,cq as at,g0 as hn}from"./index-DHvVD3rl.js";/**
2
2
  * (c) Iconify
3
3
  *
4
4
  * For the full copyright and license information, please view the license.txt
@@ -1,4 +1,4 @@
1
- import{j as r,m as i,P as e,d6 as c,d7 as f,s as u}from"./index-BJy0Aykg.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>c(f(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
1
+ import{j as r,m as i,P as e,d6 as c,d7 as f,s as u}from"./index-DHvVD3rl.js";function l({name:t,nameFormatter:o,layout:a,children:n,valueComponent:s,nameWidth:m,...p}){return r.jsxs(d,{layout:a,width:m,...p,children:[r.jsx(i,{color:"textSecondary",className:"info-row__name",children:o(t)}),n&&r.jsx(i,{color:"textPrimary",component:s,className:"info-row__value",children:n})]})}l.propTypes={name:e.any.isRequired,layout:e.oneOf(["horizontal","vertical"]),children:e.any,nameFormatter:e.func,valueComponent:e.string,nameWidth:e.number};l.defaultProps={children:null,nameWidth:90,nameFormatter:t=>{const o=t.split(" ").map(a=>c(f(a))).join(" ");return typeof t=="string"?o:t},valueComponent:"div",layout:"horizontal"};const d=u("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1,4 +1,4 @@
1
- import{aK as S,aL as D,j as e,bl as _,r as p,f as O,m as u,aX as U,aY as E,U as F,cd as V,B as $,C as k,bd as K,a7 as X,a8 as R,N as Y,ce as w,cf as A,cg as L,a9 as I,a6 as P,ax as T,a2 as M,O as G,at as H,n as J,P as i,o as Q,ch as W}from"./index-BJy0Aykg.js";import{f as Z}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-C2m02Dsu.js";import"./LastPage-DmVgRYiw.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,N),children:Z(new Date(t.createdAt),Q(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(X,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:Y,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
1
+ import{aK as S,aL as D,j as e,bl as _,r as p,f as O,m as u,aX as U,aY as E,U as F,cd as V,B as $,C as k,bd as K,a7 as X,a8 as R,N as Y,ce as w,cf as A,cg as L,a9 as I,a6 as P,ax as T,a2 as M,O as G,at as H,n as J,P as i,o as Q,ch as W}from"./index-DHvVD3rl.js";import{f as Z}from"./index-D9k2I5J1.js";import{P as ee}from"./Pagination-DSEqJST1.js";import"./LastPage-DnsJsUIR.js";var x={},te=D;Object.defineProperty(x,"__esModule",{value:!0});var g=x.default=void 0,ie=te(S()),ae=e;g=x.default=(0,ie.default)((0,ae.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");function h({api:a,paging:o,loading:c,notifications:s,updateNotifications:r,teamDid:j}){const{inService:d}=_(),[m,q]=p.useState(!0),[y,b]=p.useState(!1),{t:n,locale:N}=p.useContext(O),z=async()=>{b(!0);const t=s.filter(l=>l.read===!1).map(l=>l.id).join(",");d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r(),b(!1)},v=async t=>{d?await a.readBlockletNotifications({input:{id:t,teamDid:j}}):await a.readNotifications({input:{id:t}}),r()},f=m?s:s.filter(t=>t.read===!1),B=s.filter(t=>t.read===!1).length>0,C=t=>e.jsxs("div",{className:"title",children:[t.title," ",e.jsx("span",{className:"time-ago",title:H(t.createdAt,N),children:Z(new Date(t.createdAt),Q(N))})]});return e.jsxs(se,{children:[e.jsxs(u,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[n("notification.title"),e.jsxs(u,{component:"span",className:"notification-actions",children:[e.jsx(U,{control:e.jsx(E,{checked:m,onChange:()=>q(!m),name:"showRead",color:"primary"}),label:n("notification.showRead")}),e.jsx(F,{permission:d?"":"mutate_notification",role:d?V:[],children:B&&e.jsxs($,{disabled:y,onClick:z,className:"",children:[y&&e.jsx(k,{size:16,style:{marginRight:"1em"}}),n("notification.markAllAsRead")]})})]})]}),e.jsx(K,{}),e.jsxs(X,{className:"notification-list",children:[c&&e.jsx(k,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),f.length===0&&e.jsx(u,{component:"p",variant:"body1",className:"notification-tip",children:n("notification.empty")}),f.length>0&&f.map(t=>t.action?e.jsxs(R,{component:Y,to:t.action,alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id):e.jsxs(R,{alignItems:"flex-start",disabled:t.read,children:[e.jsx(w,{className:"list-item-avatar",children:e.jsxs(e.Fragment,{children:[e.jsx(A,{children:t.entityType.substr(0,1).toUpperCase()}),e.jsx(L,{className:"notification-tag",status:t.severity})]})}),e.jsx(I,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:C(t),secondary:t.description}),t.read===!1&&e.jsx(P,{children:e.jsx(T,{title:n("notification.markAsRead"),children:e.jsx(M,{edge:"end","aria-label":"delete",onClick:()=>v(t.id),size:"large",children:e.jsx(g,{})})})})]},t.id))]}),!!f.length&&o.pageCount>1&&e.jsx(G,{mt:2,display:"flex",justifyContent:"flex-end",children:e.jsx(ee,{disabled:c,count:o.pageCount,page:o.page,onChange:(t,l)=>{r({page:l})}})})]})}const se=J.div`
2
2
  min-height: 60vh;
3
3
 
4
4
  .page-header {
@@ -1,4 +1,4 @@
1
- const __vite__fileDeps=["./index-DXRZFI-i.js","./index-D9k2I5J1.js","./index-VH-ysxX_.js","./click-to-copy-Cd2slBnK.js","./withStyles-CkukjHle.js","./index-CFcksbYG.js","./useLocalStorage-B9e_6vUG.js","./index-CLeW9jNa.js","./FilterList-YahW7b2T.js","./Select-DdUtkwyq.js","./Delete-LMbP8m3y.js","./InputLabel-DOxBtPfl.js","./TextField-3uVNonhd.js","./LastPage-DmVgRYiw.js","./index-f9oKLglL.js","./redux-CIzpcDy1.js","./Search-xUbipjHz.js","./index-Dc91z-EC.js","./MoreVert-Cei2Rx5H.js","./url-evaluation-CTHUhxLd.js","./tag-Cksz2rJp.js","./actions-DbKUVgjV.js","./ButtonGroup-pLJbtCLI.js","./getValidReactChildren-2v0cL06g.js","./index-D74eXDyn.js","./isEqual-GyLZxSRY.js","./install-from-url-DuMsEyFI.js","./Stepper-D1V6NqBX.js","./app-avatar-DxfZHNQ7.js","./Add-NewVG93V.js","./index-DeBMBarq.js","./index-BQK6o51a.js","./index-BnOCj4ky.js","./url-join-Dfl-k5vL.js","./Skeleton-DVrY1Qbr.js","./Close-S913aeni.js","./lottie-BbyPiNfn.js","./wait-container-CgxLnrOt.js","./Launch-D-68sLeU.js","./DeleteOutline-BlZHBiGU.js","./DeleteOutline-D7kF8YLA.js","./spaces-Ndl2Z_l-.js","./api-3nNr_UzI.js","./index-HsX6FBQ6.js","./item-DE1w-7fx.js","./index-wR2FBwGe.js","./index-F32lbxl3.js","./InputAdornment-CP3BhuEs.js","./preact.module-B1z5cdvs.js","./Done-BJ9nFL7V.js","./delete-confirm-ri-NT9BE.js","./item-CxkJY_14.css","./ArrowDropDown-Bd9sR9Kj.js","./Breadcrumbs-AZ_8G3rf.js","./index-B7nYrN4m.js","./index-DysPnzV7.js","./index.esm-CcmphPDr.js","./switch-control-BL5Q92y_.js","./is-path-prefix-equal-CYIvKmVL.js","./Link-CSeasEZI.js","./logo-BKA11TRi.js","./LoadingButton-CuJ6PUWH.js","./Public-B9WCVLI7.js","./CheckCircle-DkW4b6y7.js","./ChevronRight-hQNW7SHU.js","./Edit-BgzVDDnU.js","./Https-CsrqmSk1.js","./Slider-110G8tdG.js","./index-CxfL2iNj.js","./download-DChiY5q1.js","./download-D33dFtt_.css","./index-CcuoQAH9.js","./audit-logs-CteQbS8_.js","./index-BQUIGxYm.js","./index-D4PP6P2d.css","./Pagination-C2m02Dsu.js","./index-BJEYtaIe.js","./index-_GlgH8Bo.js","./Loop-DIds44Mh.js","./ViewList-jxsh9SMq.js","./list-header-BeAWG4F0.js","./index-CXQ7qGR9.js","./resource-dialog-AGPGjRF5.js","./index-C9Gucb3e.js","./team-iad1pbmQ.js","./actions-C2sJQ8Fo.js","./index-CoYxdjrw.js","./EditIcon-D0wQcFnY.js","./LockIcon-BlIFddg8.js","./Google-DU7ZCGKH.js","./ToggleButtonGroup-JLgFfvsV.js","./detail-DjuS1eoq.js","./index-DwmHAX9V.js","./index-B6ebv4kj.js","./invitation-B_cHWnei.js","./index-Dyefferl.js","./index-BFpB8kh-.js","./wrap-locale-Bh4fVNfi.js","./index-CTxq4D6b.js","./index-BhpRo-lZ.js","./index-Hv2GfUwQ.js","./agreement-DDEIcdN2.js","./index-C3dyY7Jn.js","./index-D8yUR2aq.js","./index-DHhEgUS1.js","./index-C7igR7se.css","./index-DtqP33jl.js","./traffic-CWlSTLTp.js","./iframe-9Q6zcs_o.js","./ChevronLeft-C0YN2KhY.js","./chart-D4E9CCIm.js","./bundle-avatar-DrhjE4I8.js","./memory-htbPwmSg.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
1
+ const __vite__fileDeps=["./index-JuXoqefL.js","./index-D9k2I5J1.js","./index-D6XxoBY_.js","./click-to-copy-DdhnSrH5.js","./withStyles-CjmLVNUl.js","./index-CBFgpWWt.js","./useLocalStorage-BOaGasKr.js","./index-CiB-ceGd.js","./FilterList-usqmRCGh.js","./Select-DXPyl9dO.js","./Delete-DHiwhVmP.js","./InputLabel-Csh1ynXt.js","./TextField-B9TZBqQf.js","./LastPage-DnsJsUIR.js","./index-CNEFxICJ.js","./redux-DYjmRPcE.js","./Search-CQMDHt0w.js","./index-CmUhV6b0.js","./MoreVert-BzXa-i1R.js","./url-evaluation-ceiaoY0M.js","./tag-BDr72C87.js","./actions-Dunvsfuf.js","./ButtonGroup-DxRrpbFw.js","./getValidReactChildren-BhT8Dia7.js","./index-CYqmm0Sa.js","./isEqual-BT0_AVZN.js","./install-from-url-D_JUSXN1.js","./Stepper-F9lgPB4i.js","./app-avatar-DQiSEUVG.js","./Add-CazR0vZK.js","./index-CtlJtm28.js","./index-BysoAAKf.js","./index-CsJW-E3u.js","./url-join-Bsj5KCM1.js","./Skeleton-URH_1vdL.js","./Close-uiQeu7_r.js","./lottie-oKugLW27.js","./wait-container-CtbhxRrL.js","./Launch-BOea_wCy.js","./DeleteOutline-CnmOxEUl.js","./spaces-m3k1wtEz.js","./api-BM9dJimB.js","./index-Dw6syXvl.js","./item-k8JU-j43.js","./index-Bpjx7556.js","./index-BsRcoDUD.js","./InputAdornment-0DnARlEj.js","./preact.module-B1z5cdvs.js","./Done-LyiBXZqg.js","./delete-confirm-C4Bk8D3q.js","./item-CxkJY_14.css","./ArrowDropDown-BUrSvBpJ.js","./Breadcrumbs-D_LYBn3C.js","./index-oWv9ehU5.js","./index-BXxemGex.js","./index.esm-D5EJdopB.js","./switch-control-DSzxDtfl.js","./is-path-prefix-equal-DTqcyXik.js","./Link-ByQdtjfh.js","./logo-BKA11TRi.js","./LoadingButton-Cj_wXKeI.js","./Public-0DIMrFya.js","./CheckCircle-DbpNufE5.js","./ChevronRight-C8sGT-T0.js","./Edit-BgU3t9-z.js","./Https-B3r3YjjJ.js","./Slider-Bs8PTrpt.js","./index-CBQDge9H.js","./download-DjWKDAKk.js","./download-D33dFtt_.css","./index-Cqf3kTsw.js","./audit-logs-C18DG_HF.js","./index-BUQuICIV.js","./index-D4PP6P2d.css","./Pagination-DSEqJST1.js","./index-BiYiUZU0.js","./index-KnfQ44ac.js","./Loop-m_399M1H.js","./ViewList-BsKNUMlP.js","./list-header-sMQeptfh.js","./index-D3isMJCC.js","./resource-dialog-C82ZhW4T.js","./index-ClMriVhA.js","./team-Ch-Gj2hO.js","./actions-B9P9hAjw.js","./index-DqHjW7tc.js","./EditIcon-CeWwrlQZ.js","./LockIcon-C082WeKw.js","./Google-BzTTYoLn.js","./ToggleButtonGroup-B4DF013K.js","./detail-ByJGw6CQ.js","./index-DB54SdYK.js","./index-CDk9gqwO.js","./invitation-B9fShyCE.js","./index-LuGhm-KA.js","./index-oxLMT1TZ.js","./wrap-locale-K8WYS2HB.js","./index-DINuwc4O.js","./index-DrZqlcHr.js","./index-edI690Jp.js","./agreement-C1qfhTtQ.js","./index-C5VGS0or.js","./index-BO1T0fz0.js","./index-CzxambID.js","./index-C7igR7se.css","./index-CBcjH65j.js","./traffic-BS6Lfitp.js","./iframe-CN6X1zkC.js","./ChevronLeft-Bqynugte.js","./chart-DxusdyLS.js","./bundle-avatar-6edO3WvW.js","./memory-DtZsgQku.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
2
  function OW(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gi(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var IW={exports:{}},i4={},PW={exports:{}},zn={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -2518,4 +2518,4 @@ ${r}
2518
2518
  ${e=>e.scrollable?"":"overflow: hidden"};
2519
2519
  }
2520
2520
  `;function nCt(){const{t:e}=fo(),{session:t}=y0(),{info:n,refresh:r}=Sl();return Ki(ti.TeamEvents.userUpdated,({teamDid:i,user:o})=>{i===n.did&&o&&!o.approved&&t&&t.user&&t.user.did===o.did&&(ci.warning(e("session.forbidLogin"),{autoHideDuration:10*1e3}),t.logout())}),Ki(rn.EVENTS.NOTIFICATION_CREATE,i=>{i.entityType==="node"&&r({silent:!0})}),Ki(rn.EVENTS.NODE_UPDATED,()=>{r({silent:!0})}),null}var Ss={},rCt=sie;function iCt(e){return e&&e.length?rCt(e):[]}var Vle=iCt;const P_t=Kt(Vle),oCt=gi(Lze);class aCt{constructor(t){this.value=t,this.next=void 0}}let sCt=class{constructor(){this.clear()}enqueue(t){const n=new aCt(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var lCt=sCt;const uCt=lCt,cCt=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new uCt;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,l,...c)=>{n++;const u=(async()=>s(...c))();l(u);try{await u}catch{}r()},o=(s,l,...c)=>{t.enqueue(i.bind(null,s,l,...c)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},a=(s,...l)=>new Promise(c=>{o(s,c,...l)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),a};var fCt=cCt,zle={},Ri={};Ri.endianness=function(){return"LE"};Ri.hostname=function(){return typeof location<"u"?location.hostname:""};Ri.loadavg=function(){return[]};Ri.uptime=function(){return 0};Ri.freemem=function(){return Number.MAX_VALUE};Ri.totalmem=function(){return Number.MAX_VALUE};Ri.cpus=function(){return[]};Ri.type=function(){return"Browser"};Ri.release=function(){return typeof navigator<"u"?navigator.appVersion:""};Ri.networkInterfaces=Ri.getNetworkInterfaces=function(){return{}};Ri.arch=function(){return"javascript"};Ri.platform=function(){return"browser"};Ri.tmpdir=Ri.tmpDir=function(){return"/tmp"};Ri.EOL=`
2521
- `;Ri.homedir=function(){return"/"};(function(e){var t=mt&&mt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.hasMountPoint=e.hasStartEngine=e.isPackBlocklet=e.isGatewayBlocklet=e.getBlockletEngine=void 0;const n=t(Ri),r=ti,i=c=>{if(c===void 0)throw new Error("blocklet meta param is required");const{engine:u}=c;if(!u)return{interpreter:"node",source:""};if(!Array.isArray(u))return u;const d=n.default.platform(),p=u.find(g=>g.platform===d);if(!p)throw new Error(`can not find a proper engine interpreter on ${d}`);return p};e.getBlockletEngine=i;const o=c=>(c==null?void 0:c.group)===r.BlockletGroup.gateway;e.isGatewayBlocklet=o;const a=c=>(c==null?void 0:c.group)===r.BlockletGroup.pack;e.isPackBlocklet=a;const s=c=>!!(c!=null&&c.main)||(0,e.getBlockletEngine)(c||{}).interpreter==="blocklet";e.hasStartEngine=s;const l=c=>((0,e.hasStartEngine)(c)||((c==null?void 0:c.interfaces)||[]).find(u=>u.type===r.BLOCKLET_INTERFACE_TYPE_WEB))&&(0,e.isGatewayBlocklet)(c)===!1;e.hasMountPoint=l})(zle);(function(e){var t=mt&&mt.__importDefault||function(te){return te&&te.__esModule?te:{default:te}};Object.defineProperty(e,"__esModule",{value:!0}),e.isPackBlocklet=e.isGatewayBlocklet=e.isAccessible=e.isRunning=e.isBeforeInstalled=e.isInProgress=e.getBlockletServices=e.getBlockletAppIdList=e.getRolesFromAuthConfig=e.isPreferenceKey=e.isExternalBlocklet=e.getBlockletChainInfo=e.getChainInfo=e.getConnectAppUrl=e.getParentComponentName=e.filterComponentsV2=e.findComponentByIdV2=e.findComponentV2=e.findComponentById=e.findComponent=e.getComponentBundleId=e.getComponentName=e.getComponentId=e.replaceSlotToIp=e.getComponentWhoCanAccess=e.getWhoCanAccess=e.findServiceFromMeta=e.findWebInterfacePort=e.findWebInterface=e.fixBlockletStatus=e.getAppDescription=e.getDisplayName=e.getAppName=e.hasRunnableComponent=e.wipeSensitiveData=e.isEnvShareable=e.isEnvShareableToClient=e.getComponentMissingConfigs=e.getAppMissingConfigs=e.getSharedConfigObj=e.isDeletableBlocklet=e.forEachComponentV2Sync=e.forEachComponentV2=e.forEachChildSync=e.forEachChild=e.forEachBlockletSync=e.forEachBlocklet=e.isFreeComponent=e.isFreeBlocklet=e.getAppUrl=void 0,e.hasResourceType=e.hasStartEngine=void 0;const n=t(vw),r=t(Vle),i=oCt,o=t(fCt),a=t(rn),s=ti,l=zle;Object.defineProperty(e,"hasStartEngine",{enumerable:!0,get:function(){return l.hasStartEngine}}),Object.defineProperty(e,"isGatewayBlocklet",{enumerable:!0,get:function(){return l.isGatewayBlocklet}}),Object.defineProperty(e,"isPackBlocklet",{enumerable:!0,get:function(){return l.isPackBlocklet}});const{NODE_SERVICES:c,SLOT_FOR_IP_DNS_SITE:u,WHO_CAN_ACCESS:d,WHO_CAN_ACCESS_PREFIX_ROLES:p}=a.default,g=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.did:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.did:""}`;e.getComponentId=g;const y=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.name:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.name:""}`;e.getComponentName=y;const b=te=>`${te.meta.bundleName}@${te.meta.version}`;e.getComponentBundleId=b;const A=te=>{if(!te)return"";const we=te.split("/");return we.pop(),!we.length||(we[we.length-1].startsWith("@")&&we.pop(),!we.length)?"":we.join("/")};e.getParentComponentName=A;const x=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re,params:q,_parent:W,_root:ce,_level:ke=0,_tasks:Ee,_ancestors:xe=[],_limit:Ue}={})=>{const je=ce||W||te,He=g(te,xe),lt=xe.concat(te);if(re){const Oe=we(te,{parent:W,root:je,level:ke,params:q,ancestors:xe,id:He});if(te.children)for(const Le of te.children)x(Le,we,{sync:re,params:Oe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});return null}if(!$e)return new Promise(async(Oe,Le)=>{try{const Pe=await we(te,{parent:W,root:je,level:ke,ancestors:xe,params:q,id:He});if(te.children)for(const nt of te.children)await x(nt,we,{params:Pe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});Oe(null)}catch(Pe){Le(Pe)}});const Ze=Ue||(0,o.default)(De),Ye=Ee||[];if(Ye.push(Ze(()=>we(te,{parent:W,root:je,level:ke,ancestors:xe,id:He}))),te.children)for(const Oe of te.children)x(Oe,we,{parallel:$e,_parent:te,_root:je,_level:ke+1,_tasks:Ye,_ancestors:lt,_limit:Ze});return Ee?null:Promise.all(Ye)};e.forEachBlocklet=x;const D=(te,we)=>x(te,we,{sync:!0});e.forEachBlockletSync=D;const O=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re}={})=>{if(re){if(te.children)for(const ce of te.children)we(ce);return null}if(!$e)return new Promise(async(ce,ke)=>{try{if(te.children)for(const Ee of te.children)await we(Ee);ce(null)}catch(Ee){ke(Ee)}});const q=(0,o.default)(De),W=[];if(te.children)for(const ce of te.children)W.push(q(()=>we(ce)));return Promise.all(W)};e.forEachComponentV2=O;const P=(te,we)=>O(te,we,{sync:!0});e.forEachComponentV2Sync=P;const V=(te,we,$e)=>x(te,(De,re)=>re.level===0?{}:we(De,re),$e);e.forEachChild=V;const M=(te,we)=>V(te,we,{sync:!0});e.forEachChildSync=M;const j=(te,we,{_ancestors:$e=[],returnAncestors:De=!1}={})=>{if(!we)return null;if(we(te,{ancestors:$e}))return De?{component:te,ancestors:$e}:te;for(const re of te.children||[]){const q=$e.concat(te),W=j(re,we,{_ancestors:q,returnAncestors:De});if(W)return W}return null};e.findComponent=j;const G=(te,we,{returnAncestors:$e=!1}={})=>(Array.isArray(we)&&(we=we.join("/")),j(te,(De,{ancestors:re})=>{const q=g(De,re);return we===q},{returnAncestors:$e}));e.findComponentById=G;const ie=(te,we)=>{if(!we)return null;for(const $e of te.children||[])if(we($e,te))return $e;return null};e.findComponentV2=ie;const ue=(te,we)=>we?(Array.isArray(we)&&(we=we.join("/")),ie(te,($e,De)=>{if(we.includes("/")){const re=g($e,[De]);return we===re}return we===$e.meta.did})):null;e.findComponentByIdV2=ue;const K=(te,we)=>{if(!we)return[];const $e=[];for(const De of te.children||[])we(De,te)&&$e.push(De);return $e};e.filterComponentsV2=K;const N=te=>!!te&&!!(te.key||te.name)&&!te.secure&&te.shared!==!1&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareableToClient=N;const T=te=>!!te&&!!(te.key||te.name)&&!te.secure&&!!te.shared&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareable=T;const f=(te,we)=>{const $e={};return!te||!we||(Array.isArray(te.configs)&&te.configs.forEach(({key:De,value:re,secure:q})=>{if(!T({key:De,secure:q,shared:!0}))return;const W=(te.configObj||{})[De]||re,ce=(we.configs||[]).find(ke=>ke.key===De);(!ce||T(ce)||!ce.value&&!(we.configObj||{})[ce.key])&&($e[De]=W)}),(te.configs||[]).forEach(({key:De,value:re})=>{[s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_HOST,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_ID,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_TYPE].includes(De)&&($e[s.CHAIN_PROP_MAP[De]]=re)})),$e};e.getSharedConfigObj=f;const h=te=>te.key.startsWith(s.BLOCKLET_PREFERENCE_PREFIX)===!0;e.isPreferenceKey=h;const w=(te,we)=>!!(te.required&&(!te.value&&!we[te.key]||Object.values(s.CHAIN_PROP_MAP).includes(te.key)&&Object.keys(we).includes(te.key)&&!we[te.key])),_=(te={})=>{const we=[];return P(te,$e=>{var q;if(((q=$e.meta)==null?void 0:q.group)===s.BlockletGroup.gateway)return;const De=$e.configs||[],re=f(te,$e);De.forEach(W=>{w(W,re)&&we.push({did:$e.meta.did,key:W.key,description:W.description})})}),we.filter($e=>!h($e))};e.getAppMissingConfigs=_;const R=(te={},we={})=>{const $e=[],De=te.configs||[],re=f(we,te);return De.forEach(q=>{w(q,re)&&$e.push({did:te.meta.did,key:q.key,description:q.description})}),$e};e.getComponentMissingConfigs=R;const k=te=>te.payment?(te.payment.price||[]).map($e=>$e.value||0).every($e=>$e===0):!0;e.isFreeBlocklet=k;const C=te=>!te.payment||!te.payment.componentPrice?!0:!te.payment.componentPrice.length;e.isFreeComponent=C;const E=te=>te&&(x(te,we=>{we.configs&&(we.configs=we.configs.filter($e=>!h($e)),we.configs.forEach($e=>{$e.secure&&($e.value=$e.value?"__encrypted__":"")})),(we.environments||[]).forEach($e=>{["BLOCKLET_APP_SK","BLOCKLET_APP_PSK"].includes($e.key)&&($e.value="__encrypted__")}),(we.migratedFrom||[]).forEach($e=>{$e.appSk="__encrypted__"}),delete te.configObj,delete te.environmentObj},{sync:!0}),te);e.wipeSensitiveData=E;const v=te=>{if(!te)return!1;const we=te.environments.find($e=>$e.key==="BLOCKLET_DELETABLE");return we?we.value==="yes":!0};e.isDeletableBlocklet=v;const L=te=>{let we=!1;return D(te,$e=>{$e.meta.group!==s.BlockletGroup.gateway&&(we=!0)}),we};e.hasRunnableComponent=L;const ne=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_NAME");re&&re.value&&(De=re.value)}return De||$e.title||$e.name};e.getAppName=ne,e.getDisplayName=ne;const F=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_DESCRIPTION");re&&re.value&&(De=re.value)}return De||$e.description||$e.name};e.getAppDescription=F;function J(te){var De,re,q;const we=(q=(re=(De=te==null?void 0:te.site)==null?void 0:De.domainAliases)==null?void 0:re.sort((W,ce)=>{var ke,Ee,xe,Ue;return(ke=W.accessibility)!=null&&ke.accessible&&((Ee=ce.accessibility)!=null&&Ee.accessible)?+W.isProtected-+ce.isProtected:+((xe=ce.accessibility)==null?void 0:xe.accessible)-+((Ue=W.accessibility)==null?void 0:Ue.accessible)}))==null?void 0:q.map(W=>{var Ee;const ce=(Ee=W==null?void 0:W.domainStatus)!=null&&Ee.isHttps?"https://":"http://",ke=W==null?void 0:W.value;return`${ce}${ke}`}).filter(Boolean);return we==null?void 0:we[0]}e.getAppUrl=J;const se=te=>{te&&(D(te,we=>{we.status=(0,s.fromBlockletStatus)(we.status),we.source!==void 0&&(we.source=(0,s.fromBlockletSource)(we.source))}),te.settings&&(te.settings.children||[]).forEach(we=>{D(we,$e=>{$e.status=(0,s.fromBlockletStatus)($e.status),$e.source!==void 0&&($e.source=(0,s.fromBlockletSource)($e.source))})}))};e.fixBlockletStatus=se;const pe=te=>{if(!te)return null;const we=te.meta||te||{},{interfaces:$e=[]}=we;return Array.isArray($e)?$e.find(De=>De.type===s.BLOCKLET_INTERFACE_TYPE_WEB):null};e.findWebInterface=pe;const be=te=>{if(!te)return null;const we=pe(te),{ports:$e}=te;return!we||!$e?null:$e[we.port]};e.findWebInterfacePort=be;const Re=(te,we)=>{const $e=[we];we===c.AUTH&&$e.push(c.AUTH_SERVICE);const De=pe(te);return De?(De.services||[]).find(re=>$e.includes(re.name)):null};e.findServiceFromMeta=Re;const H=te=>{if(!te)return d.ALL;if((0,n.default)(te,"settings.whoCanAccess"))return te.settings.whoCanAccess;const we=Re(te.meta,c.AUTH);return(0,n.default)(we,"config.whoCanAccess")?we.config.whoCanAccess:d.ALL};e.getWhoCanAccess=H;const $=(te,we)=>{const $e=(te.configs||[]).find(re=>re.key===s.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO);if($e)return $e.value;if(we&&(0,n.default)(we,"settings.whoCanAccess")&&(0,n.default)(we,"settings.whoCanAccess")!==d.ALL)return(0,n.default)(we,"settings.whoCanAccess");const De=Re(te.meta,c.AUTH);return(0,n.default)(De,"config.whoCanAccess")?De.config.whoCanAccess:d.ALL};e.getComponentWhoCanAccess=$;const X=({request:te,baseUrl:we})=>{const $e=te.headers["x-blocklet-did"]||"",De=te.headers["x-blocklet-real-did"]||"",re=te.headers["x-path-prefix"]||"/",q=te.headers["x-group-path-prefix"]||"/";let W=we;return $e!==De&&re!==q&&(W=(0,i.joinURL)(W,"/").replace(re,q)),W};e.getConnectAppUrl=X;const Y=(te,we)=>{const $e=(we||"").includes(":")?":":/\./;return(te||"").replace(u,(we||"").replace(new RegExp($e,"g"),"-"))};e.replaceSlotToIp=Y;const oe=te=>{const we=Object.entries(s.CHAIN_INFO_CONFIG).reduce(($e,De)=>{const[re,[q,W]]=De;return $e[q]=(0,n.default)(te,re)||W,$e},{});return we.type==="ethereum"&&we.id==="none"&&(we.id="1"),we};e.getChainInfo=oe;const Te=te=>{const we=oe({});if(!te)return we;const $e=oe(te.configObj);if($e.host!=="none")return $e;let De;return M(te,re=>{if(De&&De.host!=="none")return;const q=oe(re.configObj);q.host!=="none"&&(De=q)}),De||we};e.getBlockletChainInfo=Te;const me=te=>!!(te!=null&&te.controller);e.isExternalBlocklet=me;const le=te=>te.whoCanAccess.startsWith(p)?te.whoCanAccess.substring(p.length).split(","):[];e.getRolesFromAuthConfig=le;const ve=te=>{const we=Array.isArray(te.migratedFrom)?te.migratedFrom.map($e=>$e.appDid):[];return(0,r.default)([te.appDid,te.appPid,...we].filter(Boolean))};e.getBlockletAppIdList=ve;const _e=te=>{const we=[];return te&&D(te,$e=>{var re;(((re=$e.meta)==null?void 0:re.interfaces)||[]).filter(q=>q.type===s.BLOCKLET_INTERFACE_TYPE_SERVICE).forEach(q=>{const W=q.port||{};we.push({name:q.name,protocol:q.protocol,port:Number(W.external),upstreamPort:Number(($e.ports||{})[W.internal])})})}),we};e.getBlockletServices=_e;const Se=te=>[s.BlockletStatus.downloading,s.BlockletStatus.waiting,s.BlockletStatus.starting,s.BlockletStatus.installing,s.BlockletStatus.stopping,s.BlockletStatus.upgrading,"downloading","waiting","starting","installing","extracting","stopping","upgrading","restarting","deleting"].includes(te);e.isInProgress=Se;const ze=te=>[s.BlockletStatus.added,s.BlockletStatus.waiting,s.BlockletStatus.downloading,s.BlockletStatus.installing,"added","waiting","downloading","installing"].includes(te);e.isBeforeInstalled=ze;const Je=te=>[s.BlockletStatus.running,"running"].includes(te);e.isRunning=Je;const ge=te=>[s.BlockletStatus.running,s.BlockletStatus.waiting,s.BlockletStatus.downloading,"running","waiting","downloading"].includes(te);e.isAccessible=ge;const Ie=(te,{type:we,did:$e}={type:"",did:""})=>{var De,re,q;return te?!(0,l.hasStartEngine)(te.meta)&&((q=(re=(De=te.meta)==null?void 0:De.resource)==null?void 0:re.bundles)==null?void 0:q.length)>0&&(te.meta.resource.bundles||[]).some(W=>W.type===we&&W.did===$e):!1};e.hasResourceType=Ie,e.default={isFreeBlocklet:k,isFreeComponent:C,forEachBlocklet:x,forEachBlockletSync:D,forEachChild:V,forEachChildSync:M,forEachComponentV2:O,forEachComponentV2Sync:P,isDeletableBlocklet:v,getSharedConfigObj:f,getAppMissingConfigs:_,getComponentMissingConfigs:R,isEnvShareableToClient:N,isEnvShareable:T,wipeSensitiveData:E,hasRunnableComponent:L,getAppName:ne,getAppDescription:F,getAppUrl:J,getDisplayName:ne,fixBlockletStatus:se,findWebInterface:pe,findWebInterfacePort:be,findServiceFromMeta:Re,getWhoCanAccess:H,getComponentWhoCanAccess:$,replaceSlotToIp:Y,getComponentId:g,getComponentName:y,getComponentBundleId:b,findComponent:j,findComponentById:G,findComponentV2:ie,findComponentByIdV2:ue,filterComponentsV2:K,getParentComponentName:A,getConnectAppUrl:X,getChainInfo:oe,getBlockletChainInfo:Te,isExternalBlocklet:me,isPreferenceKey:h,getRolesFromAuthConfig:le,getBlockletServices:_e,isInProgress:Se,isBeforeInstalled:ze,isRunning:Je,isAccessible:ge,isGatewayBlocklet:l.isGatewayBlocklet,isPackBlocklet:l.isPackBlocklet,hasStartEngine:l.hasStartEngine,hasResourceType:Ie}})(Ss);const Hle=(e,t=!1)=>{const n=e.routing.adminPath;return t?encodeURIComponent(Ln(window.location.origin,n)):Ln(window.location.origin,n)},B_t=(e,t,n)=>{const r=Hle(t),i=Ln(n,`/api/blocklets/${e.did}/blocklet.json`),o=new URL(Ln(r,"/launch-blocklet/agreement"));return o.searchParams.set("blocklet_meta_url",i),o.searchParams.set("from",window.location.href),o.href},dCt=async(e,{getIP:t}={})=>{if(!e||!e.length)return[];if(!t||!e.some(r=>r.value.includes(rn.SLOT_FOR_IP_DNS_SITE)))return e;const n=await t();return n?e.map(r=>{try{return r.value=Ss.replaceSlotToIp(r.value,n),r}catch{return r}}).filter(Boolean):e},pCt=e=>{const t={didSpace:null};return Ss.forEachBlockletSync(e,n=>{var r,i;t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP||(i=(r=n==null?void 0:n.meta)==null?void 0:r.capabilities)!=null&&i.didSpace&&(t.didSpace=n.meta.capabilities.didSpace)}),t},_W=async(e,{fixRuntime:t=!0,oldBlocklet:n,getIP:r}={})=>{if(e.site||(e.site={domainAliases:[],rules:[]}),e.site.rules.forEach(i=>{i.from.pathPrefix=G9(i.from.pathPrefix||"/")}),e.site.rules=cie(e.site.rules,i=>i.from.pathPrefix),t===!0)e.site.domainAliases=await dCt(e.site.domainAliases,{getIP:r}),e.appRuntimeInfo&&(e.appRuntimeInfo.startAt=new Date-e.appRuntimeInfo.uptime),Ss.forEachBlockletSync(e,i=>{i.runtimeInfo&&(i.runtimeInfo.startAt=new Date-i.runtimeInfo.uptime)});else if(t==="merge-old"&&n){e.site.domainAliases=n.site.domainAliases,e.appRuntimeInfo=n.appRuntimeInfo;const i={};Ss.forEachBlockletSync(n,(o,{id:a})=>{i[a]=o}),Ss.forEachBlockletSync(e,(o,{id:a})=>{const s=i[a];s&&(o.runtimeInfo=s.runtimeInfo,o.diskInfo=s.diskInfo,o.engine=s.engine)})}else e.site.domainAliases=[];e.capabilities=pCt(e)},EW="arcblock",N_t=(e,t=!1)=>{let n;return t?(n=(e.configs||[]).find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE"),n&&n.value||(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.key)),n&&n.value)?n.value:EW):(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.name)),n&&n.default?n.default:EW)},$_t=e=>!Ok(e==null?void 0:e.controller);let PC=null;const hCt=async()=>{const e=window.env.apiPrefix||"/",t=Ln(e,"/api/dns-resolve?accessible=1");try{return(await Ir.get(t)).data.address}catch{return null}},RW=()=>(PC||(PC=hCt()),PC),Wle=U.createContext({}),{Provider:mCt,Consumer:F_t}=Wle,kW=(e,t,n)=>n?e.map(r=>{const i={...r},o=t.find(a=>a.meta.did===r.meta.did);return o&&n.forEach(a=>{i[a]=o[a]}),i}):t;function gCt({children:e}){const t=Sl(),n=i5(),[r,i]=U.useState(null),[o,a]=U.useState(!1),[s,l]=U.useState([]),[c,u]=U.useState([]),[d,p]=U.useState(!1),g=(P,V)=>{Ss.isExternalBlocklet(P)?u(V):l(V)},y=4,b=async({silent:P=!0,retries:V=y,updates:M,useCache:j=!0}={})=>{P||a(!0);try{i(null);const{blocklets:G}=await n.getBlocklets({input:{useCache:j}});for(const K of G)await _W(K,{getIP:RW});const ie=G.filter(K=>!Ss.isExternalBlocklet(K)),ue=G.filter(Ss.isExternalBlocklet);l(K=>kW(K,ie,M)),u(K=>kW(K,ue,M)),a(!1),p(!0)}catch(G){V>0?setTimeout(()=>b({silent:P,retries:V-1,useCache:j}),1e3):(a(!1),i(G))}},A=async P=>{try{const{blocklet:V}=await t.api.getBlocklet({input:{did:P.meta.did,attachRuntimeInfo:!0}});await _W(V,{getIP:RW}),g(V,M=>M.some(j=>j.meta.did===V.meta.did)?M.map(j=>j.meta.did===V.meta.did?V:j):[...M,V])}catch(V){i(V)}},x=P=>{t.refresh(),A(P)};U.useEffect(()=>{b({silent:!1})},[]);const D=P=>{const V={};Ss.forEachBlockletSync(P,(M,{id:j})=>{V[j]=ti.fromBlockletStatus(M.status)}),g(P,M=>M.map(j=>(j.meta.did===P.meta.did&&Ss.forEachBlockletSync(j,(G,{id:ie})=>{V[ie]&&(G.status=V[ie])}),j)))};Ki(ti.BlockletEvents.added,P=>{P.status=ti.fromBlockletStatus(P.status),g(P,V=>[...V,P])}),Ki(ti.BlockletEvents.removed,P=>{t.refresh(),g(P,V=>V.filter(M=>M.meta.did!==P.meta.did))}),Ki(ti.BlockletEvents.statusChange,D),Ki(ti.BlockletEvents.installed,x),Ki(ti.BlockletEvents.upgraded,x),Ki(ti.BlockletEvents.updated,A),Ki(ti.BlockletEvents.startFailed,A),Ki(ti.BlockletEvents.reloaded,A);const O={loading:o,error:r,data:s,externalData:c,refresh:b,initialized:d,api:n};return I.jsx(mCt,{value:{blocklets:O},children:e})}function U_t(){const{blocklets:e}=U.useContext(Wle);return e}const yCt=({user:e,launchType:t,nftId:n})=>{var r;if(!e)return!1;if(t==="serverless"){if(!n)throw new Error("nftId is required");return((r=e==null?void 0:e.controller)==null?void 0:r.nftId)===n}return(e.permissions||[]).includes("mutate_blocklets")},j_t=e=>{var t,n;return e.isGetBlocklet&&((n=(t=e.runtimeBlocklet)==null?void 0:t.controller)==null?void 0:n.consumedAt)},q_t=async e=>{const t=bdt({blocklet:e});let n="";return n=t.find(r=>{try{const{hostname:i}=new URL(r);return koe.isSlpDomain(i)}catch(i){return console.error(i),!1}}),n||(n=await Sdt(t)),n},Gle=U.createContext({}),{Provider:vCt,Consumer:V_t}=Gle;function bCt({children:e}){const{session:t}=y0(),{t:n}=fo(),{api:r,info:i}=Sl(),[o]=BJ(),a=i5(),s=o.get("launchType"),l=o.get("fromLauncher"),c=o.get("blocklet_meta_url")||"",u=o.get("nftId")||"",d=o.get("launcherSessionId")||"",p=o.get("launcherUrl")||"",g=new URL(c).origin,[y,b]=U.useState({meta:null,appDid:o.get("appDid")||null,sessionId:o.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null}),A=(ue,K)=>b(N=>({...N,appDid:ue,sessionId:K})),x=yCt({user:t.user,launchType:s,nftId:u}),[D,O]=U.useState(null),[P,V]=U.useState(!0),M=U.useMemo(()=>i?Hle(i):"",[i]),j=async ue=>{if(!ue)throw new Error("appDid should not be empty");const{blocklet:K}=await r.getBlocklet({input:{did:ue,attachConfig:!1}});if(!K)return null;const N=ti.BlockletStatus[K.status],T=!!u,f=N<ti.BlockletStatus.installed,h=N===ti.BlockletStatus.installed,w=N===ti.BlockletStatus.running;return b(_=>({..._,isInstalled:h,isRunning:w,isExternal:T,isInstalling:f})),{isInstalled:h,isRunning:w,isExternal:T,isInstalling:f}},G=async()=>{V(!0);try{if(!c)throw new Error(n("common.invalidParam"));const[{meta:ue,isFree:K},{launcherSession:N,error:T}]=await Promise.all([r.getBlockletMetaFromUrl({input:{url:c,checkPrice:!0}}),d?r.getLauncherSession({input:{launcherSessionId:d,launcherUrl:p}}):Promise.resolve({})]);if(d&&!N)throw new Error(`Launch session invalid: ${T}`);if(!ue)throw new Error(n("LaunchBlockletBlocklet.error.loadMetaFailed"));let f={};x&&y.appDid&&(f=await j(y.appDid)),b(h=>({...h,...f,meta:ue,isFree:K,launcherSession:N}))}catch(ue){console.error(ue),O(ue.message)}finally{V(!1)}};U.useEffect(()=>{var ue,K,N;((ue=t==null?void 0:t.user)==null?void 0:ue.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&((N=(K=t==null?void 0:t.user)==null?void 0:K.controller)==null?void 0:N.nftId)!==u&&t.logout(),G()},[]),U.useEffect(()=>{P||!y.meta||(x?y.appDid&&j(y.appDid).catch(ue=>{ci.error(ue.message)}):(b(ue=>({...ue,isInstalled:!1,isRunning:!1,isExternal:!1})),O(null)))},[x]);const ie={meta:y.meta,isFree:y.isFree,appDid:y.appDid,sessionId:y.sessionId,isInstalling:y.isInstalling,isInstalled:y.isInstalled,isExternal:y.isExternal,isRunning:y.isRunning,serverUrl:M,storeUrl:g,blockletMetaUrl:c,fromLauncher:l,loading:P,error:D,api:a,getBlocklet:j,setAppDid:A,launcherUrl:p,launcherSession:y.launcherSession,launcherSessionId:d};return I.jsx(vCt,{value:ie,children:e})}function z_t(){return U.useContext(Gle)}function Kle(){return new URLSearchParams(yi().search)}const Jle=U.createContext(),{Provider:wCt,Consumer:H_t}=Jle;function Yle({children:e}){const n=Kle().get("blocklet_meta_url"),r=S8t(async()=>{const{data:o}=await W9.get(n);return o});if(r.loading)return I.jsx(Qo,{children:I.jsx(ra,{})});const i={meta:r.value,error:r.error};return I.jsx(wCt,{value:i,children:e})}Yle.propTypes={children:Z.any.isRequired};function W_t(){return U.useContext(Jle)}const TCt=U.lazy(()=>gn(()=>import("./index-DXRZFI-i.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),xCt=U.lazy(()=>gn(()=>import("./index-CFcksbYG.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,2,27,28,29,30]),import.meta.url)),SCt=U.lazy(()=>gn(()=>import("./index-BQK6o51a.js"),__vite__mapDeps([31,32,33,34,35,36,37,6,38,39,40,41,42,12,9,11,25,18,17]),import.meta.url)),CCt=U.lazy(()=>gn(()=>import("./index-HsX6FBQ6.js"),__vite__mapDeps([43,6,44,45,17,16,46,9,47,48,29,12,11,38,49,39,40,50,3,18,22,23,51,52,53]),import.meta.url)),ACt=U.lazy(()=>gn(()=>import("./index-B7nYrN4m.js"),__vite__mapDeps([54,55,10,52,56,57,46,58,12,9,11,7,8,13,14,15,16,17,18,59,50,3,2,60,6,61,62,29,19,20,63,64,65,66,4,67]),import.meta.url)),_Ct=U.lazy(()=>gn(()=>import("./index-CxfL2iNj.js"),__vite__mapDeps([68,69,22,23,9,70]),import.meta.url)),ECt=U.lazy(()=>gn(()=>import("./index-CcuoQAH9.js"),__vite__mapDeps([71,55,10,72,73,74,17,6,9,11,75,13,76,77,29,78,79,80,16,12,7,8,14,15,18,81,82,83,46,20,84,3,2,85,86,30,22,23,87,88,89,24,25,45,47,90,1,50,65]),import.meta.url)),RCt=U.lazy(()=>gn(()=>import("./detail-DjuS1eoq.js").then(e=>e.d),__vite__mapDeps([91,55,10,19,20,21,6,18,22,23,28,84,41,42,53]),import.meta.url)),kCt=U.lazy(()=>gn(()=>import("./index-CXkSaJRT.js"),[],import.meta.url)),DCt=U.lazy(()=>gn(()=>import("./index-DwmHAX9V.js"),__vite__mapDeps([92,1,75,13]),import.meta.url)),LCt=U.lazy(()=>gn(()=>import("./index-B6ebv4kj.js"),__vite__mapDeps([93,94,95,96,63,97]),import.meta.url)),OCt=U.lazy(()=>gn(()=>import("./index-CTxq4D6b.js"),__vite__mapDeps([98,63,79,49,97,27]),import.meta.url)),ICt=U.lazy(()=>gn(()=>import("./index-BhpRo-lZ.js"),__vite__mapDeps([99,97]),import.meta.url)),PCt=U.lazy(()=>gn(()=>import("./index-Hv2GfUwQ.js"),__vite__mapDeps([100,32,33,34,35,36,37,101,73,74,42,25,6,60]),import.meta.url)),MCt=U.lazy(()=>gn(()=>import("./index-C3dyY7Jn.js"),__vite__mapDeps([102,95]),import.meta.url)),BCt=U.lazy(()=>gn(()=>import("./index-D8yUR2aq.js"),__vite__mapDeps([103,94,95,96,63,97]),import.meta.url)),NCt=U.lazy(()=>gn(()=>import("./index-DHhEgUS1.js").then(e=>e.a2),__vite__mapDeps([104,105]),import.meta.url)),$Ct=U.lazy(()=>gn(()=>import("./index-DtqP33jl.js"),__vite__mapDeps([106,55,10,107,108,109,64,9,110,12,11,47,7,8,13,14,15,16,17,18,28,111,112,4,6,90,23]),import.meta.url));function Zle(){const e=Sl(),{session:t}=y0(),{wallet:n}=Vh(),r=t.user&&t.user.did;return U.useEffect(()=>{const i=f5();return r?i.connect():i.isConnected()&&i.disconnect(),()=>{i.isConnected()&&i.disconnect()}},[r]),U.useEffect(()=>{if(n)return()=>{};const i=()=>{document.visibilityState==="visible"&&t.refresh()};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i)}},[]),{node:e,session:t}}function FCt(){var a;const{t:e}=fo(),{node:t,session:n}=Zle(),r=yi();U.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${r.pathname}${r.search}`)},[r]),U.useEffect(()=>{var s;((s=n==null?void 0:n.user)==null?void 0:s.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&n.logout()},[(a=n==null?void 0:n.user)==null?void 0:a.role]);const i=I.jsx(ra,{});if(t.loading||n.loading)return I.jsx(Qo,{children:i});if(!t.info.initialized)return b8e.getServerAuthMethod(t.info)==="nft"?I.jsx(YL,{action:"verify-owner"}):I.jsx(Qo,{children:I.jsx(m6t,{})});if(t.info.upgradeSessionId)return I.jsx(Qo,{children:I.jsx(Nse,{})});if(!n.user)return I.jsx(XL,{loadingEle:i});const o=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(Q8t,{children:I.jsxs(gCt,{children:[I.jsx(C6t,{}),I.jsx(OTt,{}),I.jsx(nCt,{}),I.jsx(U.Suspense,{fallback:o,children:I.jsxs(A4,{children:[I.jsx(or,{path:"/dashboard",element:I.jsx(Ko,{fullWidth:!0,title:"Dashboard",children:I.jsx(TCt,{})})}),I.jsx(or,{path:"/blocklets",element:I.jsx(Ko,{fullWidth:!0,title:e("common.blocklets"),children:I.jsx(xCt,{})})}),I.jsx(or,{path:"/blocklets/:did/:tab",element:I.jsx(Ko,{fullWidth:!0,title:"Blocklets",children:I.jsx(RCt,{})})}),I.jsx(or,{path:"/settings/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.setting"),children:I.jsx(ACt,{})})}),I.jsx(or,{path:"/eula",element:I.jsx(Ko,{fullWidth:!0,title:e("setup.steps.eula"),children:I.jsx(kCt,{})})}),I.jsx(or,{path:"/store",element:I.jsx(Ko,{fullWidth:!0,title:e("common.store"),children:I.jsx(CCt,{})})}),I.jsx(or,{path:"/console",element:I.jsx(Ko,{title:`GraphQL ${e("common.console")}`,scrollable:!1,fullWidth:!0,children:I.jsx(NCt,{})})}),I.jsx(or,{path:"/notifications",element:I.jsx(Ko,{children:I.jsx(DCt,{})})}),I.jsx(or,{path:"/team/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.team"),children:I.jsx(ECt,{})})}),I.jsx(or,{path:"/logs/:name",element:I.jsx(Ko,{scrollable:!1,fullWidth:!0,title:e("common.logs"),children:I.jsx(_Ct,{})})}),I.jsx(or,{path:"/analytics/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.analytics"),children:I.jsx($Ct,{})})}),I.jsx(or,{path:"/",element:I.jsx(Gs,{to:"/dashboard",replace:!0})}),I.jsx(or,{path:"/team",element:I.jsx(Gs,{to:"/team/members",replace:!0})}),I.jsx(or,{path:"/analytics",element:I.jsx(Gs,{to:"/analytics/traffic",replace:!0})}),I.jsx(or,{path:"/logs",element:I.jsx(Gs,{to:"/logs/abtnode",replace:!0})}),I.jsx(or,{path:"/router",element:I.jsx(Gs,{to:"/router/rules",replace:!0})}),I.jsx(or,{path:"/settings",element:I.jsx(Gs,{to:"/settings/basic",replace:!0})}),I.jsx(or,{path:"/marketplace",element:I.jsx(Gs,{to:"/store",replace:!0})}),I.jsx(or,{path:"/marketplace/:did",element:I.jsx(Gs,{to:"/store/:did",replace:!0})}),I.jsx(or,{path:"*",element:I.jsx(MCt,{})})]})})]})})}function Jc({children:e}){const{node:t,session:n}=Zle();return t.loading||!n.initialized&&n.loading?I.jsx(Qo,{children:I.jsx(ra,{})}):t.info.upgradeSessionId?I.jsx(Qo,{children:I.jsx(Nse,{})}):e}function UCt(){const{changeLocale:e}=fo(),t=Kle();U.useEffect(()=>{const r=t.get("locale");r&&["zh","en"].includes(r)&&e(r)},[]);const n=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(U.Suspense,{fallback:n,children:I.jsxs(A4,{children:[I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:I.jsx(Jc,{children:I.jsx(LCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:I.jsx(Jc,{children:I.jsx(OCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:I.jsx(Jc,{children:I.jsx(ICt,{})})}),I.jsx(or,{path:"/accept-server",element:I.jsx(Jc,{children:I.jsx(YL,{action:"accept-server"})})}),I.jsx(or,{path:"/launch-blocklet/*",element:I.jsx(Jc,{children:I.jsx(bCt,{children:I.jsx(PCt,{})})})}),I.jsx(or,{path:"/blocklets/restore/*",element:I.jsx(Jc,{children:I.jsx(Yle,{children:I.jsx(SCt,{})})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:I.jsx(Jc,{children:I.jsx(BCt,{})})}),I.jsx(or,{path:"/*",element:I.jsx(FCt,{})})]})})}function jCt(){const e=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return I.jsxs(I.Fragment,{children:[I.jsx($7,{}),I.jsx(OJ,{history:X8e,basename:e,children:I.jsx(VTt,{children:I.jsx(UCt,{})})})]})}const qCt=WK(document.getElementById("root"));qCt.render(I.jsx(jCt,{}));const DW=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";wge(`${DW}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:DW},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});export{Hp as $,ci as A,ks as B,ra as C,QD as D,BJ as E,rn as F,gx as G,Ps as H,SO as I,Tat as J,Yct as K,DX as L,Ss as M,cl as N,ft as O,Z as P,Ok as Q,ND as R,B1 as S,Lle as T,y5 as U,Qo as V,oO as W,Ac as X,Ave as Y,OD as Z,Qst as _,Ki as a,wk as a$,rL as a0,Ln as a1,to as a2,_6 as a3,kTt as a4,S_t as a5,s9e as a6,bk as a7,m9e as a8,IX as a9,dle as aA,Tdt as aB,zle as aC,R9e as aD,dCt as aE,G9 as aF,cie as aG,RW as aH,XAt as aI,joe as aJ,fa as aK,co as aL,X8e as aM,vdt as aN,sk as aO,KAt as aP,Lke as aQ,l_t as aR,S8t as aS,W9 as aT,YAt as aU,g_t as aV,ydt as aW,AX as aX,yX as aY,tLe as aZ,ZAt as a_,Hle as aa,W_t as ab,b8e as ac,iO as ad,nL as ae,q_t as af,DAt as ag,j_t as ah,f5 as ai,Kle as aj,o_t as ak,GO as al,KL as am,x7 as an,A4 as ao,or as ap,Gs as aq,cu as ar,yl as as,$V as at,B_t as au,Ir as av,y0 as aw,Io as ax,c_t as ay,T6 as az,ti as b,NA as b$,NRe as b0,JRe as b1,wdt as b2,m_t as b3,xle as b4,xCe as b5,hct as b6,Iw as b7,Pw as b8,jX as b9,sie as bA,zg as bB,PXe as bC,Wre as bD,JD as bE,sle as bF,HAt as bG,L_t as bH,FAt as bI,s_t as bJ,Zte as bK,ua as bL,kt as bM,mc as bN,ye as bO,Ybe as bP,Bt as bQ,un as bR,an as bS,hn as bT,fl as bU,Pt as bV,sn as bW,fu as bX,d7e as bY,ht as bZ,Gn as b_,en as ba,Hr as bb,Wu as bc,uh as bd,a_t as be,B6 as bf,bJ as bg,Yo as bh,qX as bi,G1 as bj,T_t as bk,Cie as bl,N_t as bm,iQ as bn,gn as bo,zAt as bp,mRe as bq,IJ as br,x_t as bs,GD as bt,Uh as bu,Og as bv,pre as bw,hre as bx,KD as by,r9 as bz,i5 as c,fw as c$,B7 as c0,$r as c1,M7 as c2,sAt as c3,MAt as c4,bdt as c5,koe as c6,ile as c7,p_t as c8,D6 as c9,_f as cA,yi as cB,CD as cC,pi as cD,VAt as cE,UAt as cF,jAt as cG,rle as cH,FTt as cI,tk as cJ,gi as cK,oAt as cL,wm as cM,Np as cN,Zut as cO,mt as cP,Jne as cQ,zCt as cR,cAt as cS,_ct as cT,V6 as cU,I8t as cV,pbe as cW,b_t as cX,Ya as cY,P7 as cZ,dc as c_,_W as ca,SRe as cb,ARe as cc,Adt as cd,T9e as ce,XEe as cf,Ule as cg,eCt as ch,NOe as ci,Ct as cj,GLe as ck,Or as cl,dh as cm,nu as cn,mi as co,Vh as cp,_g as cq,Ku as cr,S6t as cs,d5 as ct,z_t as cu,hGe as cv,yCt as cw,f_t as cx,Sdt as cy,i_t as cz,U_t as d,YCt as d$,$a as d0,Ai as d1,Rt as d2,hX as d3,FEe as d4,Ba as d5,OAt as d6,IAt as d7,PD as d8,Uke as d9,yu as dA,L9 as dB,SZe as dC,Vie as dD,JAt as dE,jEe as dF,s3 as dG,K4e as dH,cc as dI,_o as dJ,zY as dK,bwe as dL,Rw as dM,rs as dN,zh as dO,Lw as dP,Hh as dQ,N7 as dR,AY as dS,L4e as dT,I4e as dU,jve as dV,tY as dW,mg as dX,ZCt as dY,QCt as dZ,XCt as d_,M1 as da,c3 as db,MX as dc,q9e as dd,J$ as de,K$ as df,N9e as dg,yAt as dh,dn as di,GCt as dj,WCt as dk,HCt as dl,KCt as dm,Rh as dn,kD as dp,L6 as dq,ad as dr,Hg as ds,cJe as dt,CZ as du,Jn as dv,aAt as dw,Wp as dx,AZ as dy,Qt as dz,_8t as e,Y4 as e$,Xbe as e0,ug as e1,Dh as e2,RN as e3,JCt as e4,$f as e5,E3e as e6,S7 as e7,XY as e8,rAt as e9,OEe as eA,wv as eB,wRe as eC,hx as eD,g7e as eE,xm as eF,Oke as eG,k9e as eH,f3 as eI,nLe as eJ,em as eK,SLe as eL,Wl as eM,Xb as eN,Zb as eO,NLe as eP,LLe as eQ,bAt as eR,Yre as eS,Ls as eT,T_ as eU,F7 as eV,xY as eW,RX as eX,LGe as eY,Lh as eZ,qY as e_,eAt as ea,l4e as eb,fc as ec,BY as ed,I3e as ee,c4e as ef,nAt as eg,BA as eh,o4e as ei,s4e as ej,vl as ek,u4e as el,Wbe as em,lw as en,Mwe as eo,tAt as ep,Dwe as eq,jc as er,SCe as es,pAt as et,eAe as eu,tAe as ev,vAe as ew,hAt as ex,tr as ey,Tp as ez,Ec as f,ay as f$,hg as f0,_7 as f1,p3 as f2,tF as f3,jf as f4,fi as f5,Bot as f6,$o as f7,a0 as f8,tn as f9,t_t as fA,PAt as fB,r_t as fC,Aie as fD,hoe as fE,t6t as fF,p9 as fG,tse as fH,Uoe as fI,vw as fJ,T2t as fK,iie as fL,Q4e as fM,QY as fN,U7 as fO,Kn as fP,Ew as fQ,n9e as fR,Y7 as fS,d8e as fT,$O as fU,uAt as fV,qO as fW,jO as fX,I6 as fY,EAt as fZ,RO as f_,Eg as fa,Hf as fb,UOe as fc,WK as fd,Kh as fe,Xn as ff,bee as fg,gee as fh,Sw as fi,Xct as fj,kY as fk,cw as fl,l3 as fm,i7 as fn,tQ as fo,VQ as fp,v6t as fq,qAt as fr,nI as fs,rQ as ft,VCt as fu,pc as fv,CYe as fw,_c as fx,QAt as fy,ud as fz,Kt as g,Sh as g$,IO as g0,UWe as g1,Gh as g2,Tle as g3,A6 as g4,lot as g5,bot as g6,qte as g7,Sk as g8,Zrt as g9,Hct as gA,ID as gB,$_t as gC,v_t as gD,GAt as gE,e_t as gF,n_t as gG,R6 as gH,Tre as gI,xre as gJ,wre as gK,Pre as gL,WY as gM,e3 as gN,cAe as gO,dbe as gP,f5t as gQ,y5t as gR,w5t as gS,C5t as gT,E5t as gU,lTt as gV,uTt as gW,Vse as gX,zse as gY,MVe as gZ,Ktt as g_,wie as ga,Kf as gb,E6 as gc,L1 as gd,kw as ge,mx as gf,Dw as gg,YAe as gh,bX as gi,hCe as gj,ZZ as gk,cve as gl,WAt as gm,d_t as gn,Lxt as go,Sg as gp,lCe as gq,Cw as gr,dre as gs,H7 as gt,mSe as gu,W7 as gv,yct as gw,K7 as gx,$At as gy,oCt as gz,rO as h,q1 as h0,jVe as h1,BAt as h2,TAt as h3,y_t as h4,sV as h5,Zm as h6,GOe as h7,aQ as h8,d3 as h9,RAt as hA,Act as hB,O_t as hC,wX as hD,mot as hE,e9 as hF,LOe as hG,E_t as hH,__t as hI,nQ as hJ,Ite as hK,P_t as hL,mX as hM,wAt as ha,N1 as hb,iAt as hc,wwe as hd,dAt as he,mCe as hf,yRe as hg,bDe as hh,hDe as hi,mAt as hj,wDe as hk,gAt as hl,z9e as hm,vAt as hn,D5t as ho,KA as hp,YA as hq,$se as hr,X4e as hs,LD as ht,hN as hu,u_t as hv,Ibt as hw,w_t as hx,h_t as hy,mH as hz,ch as i,I as j,Tf as k,NAt as l,Xt as m,Ka as n,q6 as o,jE as p,fo as q,U as r,er as s,F8t as t,Sl as u,R8t as v,ake as w,C9 as x,tL as y,xc as z};
2521
+ `;Ri.homedir=function(){return"/"};(function(e){var t=mt&&mt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.hasMountPoint=e.hasStartEngine=e.isPackBlocklet=e.isGatewayBlocklet=e.getBlockletEngine=void 0;const n=t(Ri),r=ti,i=c=>{if(c===void 0)throw new Error("blocklet meta param is required");const{engine:u}=c;if(!u)return{interpreter:"node",source:""};if(!Array.isArray(u))return u;const d=n.default.platform(),p=u.find(g=>g.platform===d);if(!p)throw new Error(`can not find a proper engine interpreter on ${d}`);return p};e.getBlockletEngine=i;const o=c=>(c==null?void 0:c.group)===r.BlockletGroup.gateway;e.isGatewayBlocklet=o;const a=c=>(c==null?void 0:c.group)===r.BlockletGroup.pack;e.isPackBlocklet=a;const s=c=>!!(c!=null&&c.main)||(0,e.getBlockletEngine)(c||{}).interpreter==="blocklet";e.hasStartEngine=s;const l=c=>((0,e.hasStartEngine)(c)||((c==null?void 0:c.interfaces)||[]).find(u=>u.type===r.BLOCKLET_INTERFACE_TYPE_WEB))&&(0,e.isGatewayBlocklet)(c)===!1;e.hasMountPoint=l})(zle);(function(e){var t=mt&&mt.__importDefault||function(te){return te&&te.__esModule?te:{default:te}};Object.defineProperty(e,"__esModule",{value:!0}),e.isPackBlocklet=e.isGatewayBlocklet=e.isAccessible=e.isRunning=e.isBeforeInstalled=e.isInProgress=e.getBlockletServices=e.getBlockletAppIdList=e.getRolesFromAuthConfig=e.isPreferenceKey=e.isExternalBlocklet=e.getBlockletChainInfo=e.getChainInfo=e.getConnectAppUrl=e.getParentComponentName=e.filterComponentsV2=e.findComponentByIdV2=e.findComponentV2=e.findComponentById=e.findComponent=e.getComponentBundleId=e.getComponentName=e.getComponentId=e.replaceSlotToIp=e.getComponentWhoCanAccess=e.getWhoCanAccess=e.findServiceFromMeta=e.findWebInterfacePort=e.findWebInterface=e.fixBlockletStatus=e.getAppDescription=e.getDisplayName=e.getAppName=e.hasRunnableComponent=e.wipeSensitiveData=e.isEnvShareable=e.isEnvShareableToClient=e.getComponentMissingConfigs=e.getAppMissingConfigs=e.getSharedConfigObj=e.isDeletableBlocklet=e.forEachComponentV2Sync=e.forEachComponentV2=e.forEachChildSync=e.forEachChild=e.forEachBlockletSync=e.forEachBlocklet=e.isFreeComponent=e.isFreeBlocklet=e.getAppUrl=void 0,e.hasResourceType=e.hasStartEngine=void 0;const n=t(vw),r=t(Vle),i=oCt,o=t(fCt),a=t(rn),s=ti,l=zle;Object.defineProperty(e,"hasStartEngine",{enumerable:!0,get:function(){return l.hasStartEngine}}),Object.defineProperty(e,"isGatewayBlocklet",{enumerable:!0,get:function(){return l.isGatewayBlocklet}}),Object.defineProperty(e,"isPackBlocklet",{enumerable:!0,get:function(){return l.isPackBlocklet}});const{NODE_SERVICES:c,SLOT_FOR_IP_DNS_SITE:u,WHO_CAN_ACCESS:d,WHO_CAN_ACCESS_PREFIX_ROLES:p}=a.default,g=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.did:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.did:""}`;e.getComponentId=g;const y=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.name:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.name:""}`;e.getComponentName=y;const b=te=>`${te.meta.bundleName}@${te.meta.version}`;e.getComponentBundleId=b;const A=te=>{if(!te)return"";const we=te.split("/");return we.pop(),!we.length||(we[we.length-1].startsWith("@")&&we.pop(),!we.length)?"":we.join("/")};e.getParentComponentName=A;const x=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re,params:q,_parent:W,_root:ce,_level:ke=0,_tasks:Ee,_ancestors:xe=[],_limit:Ue}={})=>{const je=ce||W||te,He=g(te,xe),lt=xe.concat(te);if(re){const Oe=we(te,{parent:W,root:je,level:ke,params:q,ancestors:xe,id:He});if(te.children)for(const Le of te.children)x(Le,we,{sync:re,params:Oe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});return null}if(!$e)return new Promise(async(Oe,Le)=>{try{const Pe=await we(te,{parent:W,root:je,level:ke,ancestors:xe,params:q,id:He});if(te.children)for(const nt of te.children)await x(nt,we,{params:Pe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});Oe(null)}catch(Pe){Le(Pe)}});const Ze=Ue||(0,o.default)(De),Ye=Ee||[];if(Ye.push(Ze(()=>we(te,{parent:W,root:je,level:ke,ancestors:xe,id:He}))),te.children)for(const Oe of te.children)x(Oe,we,{parallel:$e,_parent:te,_root:je,_level:ke+1,_tasks:Ye,_ancestors:lt,_limit:Ze});return Ee?null:Promise.all(Ye)};e.forEachBlocklet=x;const D=(te,we)=>x(te,we,{sync:!0});e.forEachBlockletSync=D;const O=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re}={})=>{if(re){if(te.children)for(const ce of te.children)we(ce);return null}if(!$e)return new Promise(async(ce,ke)=>{try{if(te.children)for(const Ee of te.children)await we(Ee);ce(null)}catch(Ee){ke(Ee)}});const q=(0,o.default)(De),W=[];if(te.children)for(const ce of te.children)W.push(q(()=>we(ce)));return Promise.all(W)};e.forEachComponentV2=O;const P=(te,we)=>O(te,we,{sync:!0});e.forEachComponentV2Sync=P;const V=(te,we,$e)=>x(te,(De,re)=>re.level===0?{}:we(De,re),$e);e.forEachChild=V;const M=(te,we)=>V(te,we,{sync:!0});e.forEachChildSync=M;const j=(te,we,{_ancestors:$e=[],returnAncestors:De=!1}={})=>{if(!we)return null;if(we(te,{ancestors:$e}))return De?{component:te,ancestors:$e}:te;for(const re of te.children||[]){const q=$e.concat(te),W=j(re,we,{_ancestors:q,returnAncestors:De});if(W)return W}return null};e.findComponent=j;const G=(te,we,{returnAncestors:$e=!1}={})=>(Array.isArray(we)&&(we=we.join("/")),j(te,(De,{ancestors:re})=>{const q=g(De,re);return we===q},{returnAncestors:$e}));e.findComponentById=G;const ie=(te,we)=>{if(!we)return null;for(const $e of te.children||[])if(we($e,te))return $e;return null};e.findComponentV2=ie;const ue=(te,we)=>we?(Array.isArray(we)&&(we=we.join("/")),ie(te,($e,De)=>{if(we.includes("/")){const re=g($e,[De]);return we===re}return we===$e.meta.did})):null;e.findComponentByIdV2=ue;const K=(te,we)=>{if(!we)return[];const $e=[];for(const De of te.children||[])we(De,te)&&$e.push(De);return $e};e.filterComponentsV2=K;const N=te=>!!te&&!!(te.key||te.name)&&!te.secure&&te.shared!==!1&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareableToClient=N;const T=te=>!!te&&!!(te.key||te.name)&&!te.secure&&!!te.shared&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareable=T;const f=(te,we)=>{const $e={};return!te||!we||(Array.isArray(te.configs)&&te.configs.forEach(({key:De,value:re,secure:q})=>{if(!T({key:De,secure:q,shared:!0}))return;const W=(te.configObj||{})[De]||re,ce=(we.configs||[]).find(ke=>ke.key===De);(!ce||T(ce)||!ce.value&&!(we.configObj||{})[ce.key])&&($e[De]=W)}),(te.configs||[]).forEach(({key:De,value:re})=>{[s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_HOST,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_ID,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_TYPE].includes(De)&&($e[s.CHAIN_PROP_MAP[De]]=re)})),$e};e.getSharedConfigObj=f;const h=te=>te.key.startsWith(s.BLOCKLET_PREFERENCE_PREFIX)===!0;e.isPreferenceKey=h;const w=(te,we)=>!!(te.required&&(!te.value&&!we[te.key]||Object.values(s.CHAIN_PROP_MAP).includes(te.key)&&Object.keys(we).includes(te.key)&&!we[te.key])),_=(te={})=>{const we=[];return P(te,$e=>{var q;if(((q=$e.meta)==null?void 0:q.group)===s.BlockletGroup.gateway)return;const De=$e.configs||[],re=f(te,$e);De.forEach(W=>{w(W,re)&&we.push({did:$e.meta.did,key:W.key,description:W.description})})}),we.filter($e=>!h($e))};e.getAppMissingConfigs=_;const R=(te={},we={})=>{const $e=[],De=te.configs||[],re=f(we,te);return De.forEach(q=>{w(q,re)&&$e.push({did:te.meta.did,key:q.key,description:q.description})}),$e};e.getComponentMissingConfigs=R;const k=te=>te.payment?(te.payment.price||[]).map($e=>$e.value||0).every($e=>$e===0):!0;e.isFreeBlocklet=k;const C=te=>!te.payment||!te.payment.componentPrice?!0:!te.payment.componentPrice.length;e.isFreeComponent=C;const E=te=>te&&(x(te,we=>{we.configs&&(we.configs=we.configs.filter($e=>!h($e)),we.configs.forEach($e=>{$e.secure&&($e.value=$e.value?"__encrypted__":"")})),(we.environments||[]).forEach($e=>{["BLOCKLET_APP_SK","BLOCKLET_APP_PSK"].includes($e.key)&&($e.value="__encrypted__")}),(we.migratedFrom||[]).forEach($e=>{$e.appSk="__encrypted__"}),delete te.configObj,delete te.environmentObj},{sync:!0}),te);e.wipeSensitiveData=E;const v=te=>{if(!te)return!1;const we=te.environments.find($e=>$e.key==="BLOCKLET_DELETABLE");return we?we.value==="yes":!0};e.isDeletableBlocklet=v;const L=te=>{let we=!1;return D(te,$e=>{$e.meta.group!==s.BlockletGroup.gateway&&(we=!0)}),we};e.hasRunnableComponent=L;const ne=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_NAME");re&&re.value&&(De=re.value)}return De||$e.title||$e.name};e.getAppName=ne,e.getDisplayName=ne;const F=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_DESCRIPTION");re&&re.value&&(De=re.value)}return De||$e.description||$e.name};e.getAppDescription=F;function J(te){var De,re,q;const we=(q=(re=(De=te==null?void 0:te.site)==null?void 0:De.domainAliases)==null?void 0:re.sort((W,ce)=>{var ke,Ee,xe,Ue;return(ke=W.accessibility)!=null&&ke.accessible&&((Ee=ce.accessibility)!=null&&Ee.accessible)?+W.isProtected-+ce.isProtected:+((xe=ce.accessibility)==null?void 0:xe.accessible)-+((Ue=W.accessibility)==null?void 0:Ue.accessible)}))==null?void 0:q.map(W=>{var Ee;const ce=(Ee=W==null?void 0:W.domainStatus)!=null&&Ee.isHttps?"https://":"http://",ke=W==null?void 0:W.value;return`${ce}${ke}`}).filter(Boolean);return we==null?void 0:we[0]}e.getAppUrl=J;const se=te=>{te&&(D(te,we=>{we.status=(0,s.fromBlockletStatus)(we.status),we.source!==void 0&&(we.source=(0,s.fromBlockletSource)(we.source))}),te.settings&&(te.settings.children||[]).forEach(we=>{D(we,$e=>{$e.status=(0,s.fromBlockletStatus)($e.status),$e.source!==void 0&&($e.source=(0,s.fromBlockletSource)($e.source))})}))};e.fixBlockletStatus=se;const pe=te=>{if(!te)return null;const we=te.meta||te||{},{interfaces:$e=[]}=we;return Array.isArray($e)?$e.find(De=>De.type===s.BLOCKLET_INTERFACE_TYPE_WEB):null};e.findWebInterface=pe;const be=te=>{if(!te)return null;const we=pe(te),{ports:$e}=te;return!we||!$e?null:$e[we.port]};e.findWebInterfacePort=be;const Re=(te,we)=>{const $e=[we];we===c.AUTH&&$e.push(c.AUTH_SERVICE);const De=pe(te);return De?(De.services||[]).find(re=>$e.includes(re.name)):null};e.findServiceFromMeta=Re;const H=te=>{if(!te)return d.ALL;if((0,n.default)(te,"settings.whoCanAccess"))return te.settings.whoCanAccess;const we=Re(te.meta,c.AUTH);return(0,n.default)(we,"config.whoCanAccess")?we.config.whoCanAccess:d.ALL};e.getWhoCanAccess=H;const $=(te,we)=>{const $e=(te.configs||[]).find(re=>re.key===s.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO);if($e)return $e.value;if(we&&(0,n.default)(we,"settings.whoCanAccess")&&(0,n.default)(we,"settings.whoCanAccess")!==d.ALL)return(0,n.default)(we,"settings.whoCanAccess");const De=Re(te.meta,c.AUTH);return(0,n.default)(De,"config.whoCanAccess")?De.config.whoCanAccess:d.ALL};e.getComponentWhoCanAccess=$;const X=({request:te,baseUrl:we})=>{const $e=te.headers["x-blocklet-did"]||"",De=te.headers["x-blocklet-real-did"]||"",re=te.headers["x-path-prefix"]||"/",q=te.headers["x-group-path-prefix"]||"/";let W=we;return $e!==De&&re!==q&&(W=(0,i.joinURL)(W,"/").replace(re,q)),W};e.getConnectAppUrl=X;const Y=(te,we)=>{const $e=(we||"").includes(":")?":":/\./;return(te||"").replace(u,(we||"").replace(new RegExp($e,"g"),"-"))};e.replaceSlotToIp=Y;const oe=te=>{const we=Object.entries(s.CHAIN_INFO_CONFIG).reduce(($e,De)=>{const[re,[q,W]]=De;return $e[q]=(0,n.default)(te,re)||W,$e},{});return we.type==="ethereum"&&we.id==="none"&&(we.id="1"),we};e.getChainInfo=oe;const Te=te=>{const we=oe({});if(!te)return we;const $e=oe(te.configObj);if($e.host!=="none")return $e;let De;return M(te,re=>{if(De&&De.host!=="none")return;const q=oe(re.configObj);q.host!=="none"&&(De=q)}),De||we};e.getBlockletChainInfo=Te;const me=te=>!!(te!=null&&te.controller);e.isExternalBlocklet=me;const le=te=>te.whoCanAccess.startsWith(p)?te.whoCanAccess.substring(p.length).split(","):[];e.getRolesFromAuthConfig=le;const ve=te=>{const we=Array.isArray(te.migratedFrom)?te.migratedFrom.map($e=>$e.appDid):[];return(0,r.default)([te.appDid,te.appPid,...we].filter(Boolean))};e.getBlockletAppIdList=ve;const _e=te=>{const we=[];return te&&D(te,$e=>{var re;(((re=$e.meta)==null?void 0:re.interfaces)||[]).filter(q=>q.type===s.BLOCKLET_INTERFACE_TYPE_SERVICE).forEach(q=>{const W=q.port||{};we.push({name:q.name,protocol:q.protocol,port:Number(W.external),upstreamPort:Number(($e.ports||{})[W.internal])})})}),we};e.getBlockletServices=_e;const Se=te=>[s.BlockletStatus.downloading,s.BlockletStatus.waiting,s.BlockletStatus.starting,s.BlockletStatus.installing,s.BlockletStatus.stopping,s.BlockletStatus.upgrading,"downloading","waiting","starting","installing","extracting","stopping","upgrading","restarting","deleting"].includes(te);e.isInProgress=Se;const ze=te=>[s.BlockletStatus.added,s.BlockletStatus.waiting,s.BlockletStatus.downloading,s.BlockletStatus.installing,"added","waiting","downloading","installing"].includes(te);e.isBeforeInstalled=ze;const Je=te=>[s.BlockletStatus.running,"running"].includes(te);e.isRunning=Je;const ge=te=>[s.BlockletStatus.running,s.BlockletStatus.waiting,s.BlockletStatus.downloading,"running","waiting","downloading"].includes(te);e.isAccessible=ge;const Ie=(te,{type:we,did:$e}={type:"",did:""})=>{var De,re,q;return te?!(0,l.hasStartEngine)(te.meta)&&((q=(re=(De=te.meta)==null?void 0:De.resource)==null?void 0:re.bundles)==null?void 0:q.length)>0&&(te.meta.resource.bundles||[]).some(W=>W.type===we&&W.did===$e):!1};e.hasResourceType=Ie,e.default={isFreeBlocklet:k,isFreeComponent:C,forEachBlocklet:x,forEachBlockletSync:D,forEachChild:V,forEachChildSync:M,forEachComponentV2:O,forEachComponentV2Sync:P,isDeletableBlocklet:v,getSharedConfigObj:f,getAppMissingConfigs:_,getComponentMissingConfigs:R,isEnvShareableToClient:N,isEnvShareable:T,wipeSensitiveData:E,hasRunnableComponent:L,getAppName:ne,getAppDescription:F,getAppUrl:J,getDisplayName:ne,fixBlockletStatus:se,findWebInterface:pe,findWebInterfacePort:be,findServiceFromMeta:Re,getWhoCanAccess:H,getComponentWhoCanAccess:$,replaceSlotToIp:Y,getComponentId:g,getComponentName:y,getComponentBundleId:b,findComponent:j,findComponentById:G,findComponentV2:ie,findComponentByIdV2:ue,filterComponentsV2:K,getParentComponentName:A,getConnectAppUrl:X,getChainInfo:oe,getBlockletChainInfo:Te,isExternalBlocklet:me,isPreferenceKey:h,getRolesFromAuthConfig:le,getBlockletServices:_e,isInProgress:Se,isBeforeInstalled:ze,isRunning:Je,isAccessible:ge,isGatewayBlocklet:l.isGatewayBlocklet,isPackBlocklet:l.isPackBlocklet,hasStartEngine:l.hasStartEngine,hasResourceType:Ie}})(Ss);const Hle=(e,t=!1)=>{const n=e.routing.adminPath;return t?encodeURIComponent(Ln(window.location.origin,n)):Ln(window.location.origin,n)},B_t=(e,t,n)=>{const r=Hle(t),i=Ln(n,`/api/blocklets/${e.did}/blocklet.json`),o=new URL(Ln(r,"/launch-blocklet/agreement"));return o.searchParams.set("blocklet_meta_url",i),o.searchParams.set("from",window.location.href),o.href},dCt=async(e,{getIP:t}={})=>{if(!e||!e.length)return[];if(!t||!e.some(r=>r.value.includes(rn.SLOT_FOR_IP_DNS_SITE)))return e;const n=await t();return n?e.map(r=>{try{return r.value=Ss.replaceSlotToIp(r.value,n),r}catch{return r}}).filter(Boolean):e},pCt=e=>{const t={didSpace:null};return Ss.forEachBlockletSync(e,n=>{var r,i;t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP||(i=(r=n==null?void 0:n.meta)==null?void 0:r.capabilities)!=null&&i.didSpace&&(t.didSpace=n.meta.capabilities.didSpace)}),t},_W=async(e,{fixRuntime:t=!0,oldBlocklet:n,getIP:r}={})=>{if(e.site||(e.site={domainAliases:[],rules:[]}),e.site.rules.forEach(i=>{i.from.pathPrefix=G9(i.from.pathPrefix||"/")}),e.site.rules=cie(e.site.rules,i=>i.from.pathPrefix),t===!0)e.site.domainAliases=await dCt(e.site.domainAliases,{getIP:r}),e.appRuntimeInfo&&(e.appRuntimeInfo.startAt=new Date-e.appRuntimeInfo.uptime),Ss.forEachBlockletSync(e,i=>{i.runtimeInfo&&(i.runtimeInfo.startAt=new Date-i.runtimeInfo.uptime)});else if(t==="merge-old"&&n){e.site.domainAliases=n.site.domainAliases,e.appRuntimeInfo=n.appRuntimeInfo;const i={};Ss.forEachBlockletSync(n,(o,{id:a})=>{i[a]=o}),Ss.forEachBlockletSync(e,(o,{id:a})=>{const s=i[a];s&&(o.runtimeInfo=s.runtimeInfo,o.diskInfo=s.diskInfo,o.engine=s.engine)})}else e.site.domainAliases=[];e.capabilities=pCt(e)},EW="arcblock",N_t=(e,t=!1)=>{let n;return t?(n=(e.configs||[]).find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE"),n&&n.value||(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.key)),n&&n.value)?n.value:EW):(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.name)),n&&n.default?n.default:EW)},$_t=e=>!Ok(e==null?void 0:e.controller);let PC=null;const hCt=async()=>{const e=window.env.apiPrefix||"/",t=Ln(e,"/api/dns-resolve?accessible=1");try{return(await Ir.get(t)).data.address}catch{return null}},RW=()=>(PC||(PC=hCt()),PC),Wle=U.createContext({}),{Provider:mCt,Consumer:F_t}=Wle,kW=(e,t,n)=>n?e.map(r=>{const i={...r},o=t.find(a=>a.meta.did===r.meta.did);return o&&n.forEach(a=>{i[a]=o[a]}),i}):t;function gCt({children:e}){const t=Sl(),n=i5(),[r,i]=U.useState(null),[o,a]=U.useState(!1),[s,l]=U.useState([]),[c,u]=U.useState([]),[d,p]=U.useState(!1),g=(P,V)=>{Ss.isExternalBlocklet(P)?u(V):l(V)},y=4,b=async({silent:P=!0,retries:V=y,updates:M,useCache:j=!0}={})=>{P||a(!0);try{i(null);const{blocklets:G}=await n.getBlocklets({input:{useCache:j}});for(const K of G)await _W(K,{getIP:RW});const ie=G.filter(K=>!Ss.isExternalBlocklet(K)),ue=G.filter(Ss.isExternalBlocklet);l(K=>kW(K,ie,M)),u(K=>kW(K,ue,M)),a(!1),p(!0)}catch(G){V>0?setTimeout(()=>b({silent:P,retries:V-1,useCache:j}),1e3):(a(!1),i(G))}},A=async P=>{try{const{blocklet:V}=await t.api.getBlocklet({input:{did:P.meta.did,attachRuntimeInfo:!0}});await _W(V,{getIP:RW}),g(V,M=>M.some(j=>j.meta.did===V.meta.did)?M.map(j=>j.meta.did===V.meta.did?V:j):[...M,V])}catch(V){i(V)}},x=P=>{t.refresh(),A(P)};U.useEffect(()=>{b({silent:!1})},[]);const D=P=>{const V={};Ss.forEachBlockletSync(P,(M,{id:j})=>{V[j]=ti.fromBlockletStatus(M.status)}),g(P,M=>M.map(j=>(j.meta.did===P.meta.did&&Ss.forEachBlockletSync(j,(G,{id:ie})=>{V[ie]&&(G.status=V[ie])}),j)))};Ki(ti.BlockletEvents.added,P=>{P.status=ti.fromBlockletStatus(P.status),g(P,V=>[...V,P])}),Ki(ti.BlockletEvents.removed,P=>{t.refresh(),g(P,V=>V.filter(M=>M.meta.did!==P.meta.did))}),Ki(ti.BlockletEvents.statusChange,D),Ki(ti.BlockletEvents.installed,x),Ki(ti.BlockletEvents.upgraded,x),Ki(ti.BlockletEvents.updated,A),Ki(ti.BlockletEvents.startFailed,A),Ki(ti.BlockletEvents.reloaded,A);const O={loading:o,error:r,data:s,externalData:c,refresh:b,initialized:d,api:n};return I.jsx(mCt,{value:{blocklets:O},children:e})}function U_t(){const{blocklets:e}=U.useContext(Wle);return e}const yCt=({user:e,launchType:t,nftId:n})=>{var r;if(!e)return!1;if(t==="serverless"){if(!n)throw new Error("nftId is required");return((r=e==null?void 0:e.controller)==null?void 0:r.nftId)===n}return(e.permissions||[]).includes("mutate_blocklets")},j_t=e=>{var t,n;return e.isGetBlocklet&&((n=(t=e.runtimeBlocklet)==null?void 0:t.controller)==null?void 0:n.consumedAt)},q_t=async e=>{const t=bdt({blocklet:e});let n="";return n=t.find(r=>{try{const{hostname:i}=new URL(r);return koe.isSlpDomain(i)}catch(i){return console.error(i),!1}}),n||(n=await Sdt(t)),n},Gle=U.createContext({}),{Provider:vCt,Consumer:V_t}=Gle;function bCt({children:e}){const{session:t}=y0(),{t:n}=fo(),{api:r,info:i}=Sl(),[o]=BJ(),a=i5(),s=o.get("launchType"),l=o.get("fromLauncher"),c=o.get("blocklet_meta_url")||"",u=o.get("nftId")||"",d=o.get("launcherSessionId")||"",p=o.get("launcherUrl")||"",g=new URL(c).origin,[y,b]=U.useState({meta:null,appDid:o.get("appDid")||null,sessionId:o.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null}),A=(ue,K)=>b(N=>({...N,appDid:ue,sessionId:K})),x=yCt({user:t.user,launchType:s,nftId:u}),[D,O]=U.useState(null),[P,V]=U.useState(!0),M=U.useMemo(()=>i?Hle(i):"",[i]),j=async ue=>{if(!ue)throw new Error("appDid should not be empty");const{blocklet:K}=await r.getBlocklet({input:{did:ue,attachConfig:!1}});if(!K)return null;const N=ti.BlockletStatus[K.status],T=!!u,f=N<ti.BlockletStatus.installed,h=N===ti.BlockletStatus.installed,w=N===ti.BlockletStatus.running;return b(_=>({..._,isInstalled:h,isRunning:w,isExternal:T,isInstalling:f})),{isInstalled:h,isRunning:w,isExternal:T,isInstalling:f}},G=async()=>{V(!0);try{if(!c)throw new Error(n("common.invalidParam"));const[{meta:ue,isFree:K},{launcherSession:N,error:T}]=await Promise.all([r.getBlockletMetaFromUrl({input:{url:c,checkPrice:!0}}),d?r.getLauncherSession({input:{launcherSessionId:d,launcherUrl:p}}):Promise.resolve({})]);if(d&&!N)throw new Error(`Launch session invalid: ${T}`);if(!ue)throw new Error(n("LaunchBlockletBlocklet.error.loadMetaFailed"));let f={};x&&y.appDid&&(f=await j(y.appDid)),b(h=>({...h,...f,meta:ue,isFree:K,launcherSession:N}))}catch(ue){console.error(ue),O(ue.message)}finally{V(!1)}};U.useEffect(()=>{var ue,K,N;((ue=t==null?void 0:t.user)==null?void 0:ue.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&((N=(K=t==null?void 0:t.user)==null?void 0:K.controller)==null?void 0:N.nftId)!==u&&t.logout(),G()},[]),U.useEffect(()=>{P||!y.meta||(x?y.appDid&&j(y.appDid).catch(ue=>{ci.error(ue.message)}):(b(ue=>({...ue,isInstalled:!1,isRunning:!1,isExternal:!1})),O(null)))},[x]);const ie={meta:y.meta,isFree:y.isFree,appDid:y.appDid,sessionId:y.sessionId,isInstalling:y.isInstalling,isInstalled:y.isInstalled,isExternal:y.isExternal,isRunning:y.isRunning,serverUrl:M,storeUrl:g,blockletMetaUrl:c,fromLauncher:l,loading:P,error:D,api:a,getBlocklet:j,setAppDid:A,launcherUrl:p,launcherSession:y.launcherSession,launcherSessionId:d};return I.jsx(vCt,{value:ie,children:e})}function z_t(){return U.useContext(Gle)}function Kle(){return new URLSearchParams(yi().search)}const Jle=U.createContext(),{Provider:wCt,Consumer:H_t}=Jle;function Yle({children:e}){const n=Kle().get("blocklet_meta_url"),r=S8t(async()=>{const{data:o}=await W9.get(n);return o});if(r.loading)return I.jsx(Qo,{children:I.jsx(ra,{})});const i={meta:r.value,error:r.error};return I.jsx(wCt,{value:i,children:e})}Yle.propTypes={children:Z.any.isRequired};function W_t(){return U.useContext(Jle)}const TCt=U.lazy(()=>gn(()=>import("./index-JuXoqefL.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),xCt=U.lazy(()=>gn(()=>import("./index-CBFgpWWt.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,2,27,28,29,30]),import.meta.url)),SCt=U.lazy(()=>gn(()=>import("./index-BysoAAKf.js"),__vite__mapDeps([31,32,33,34,35,36,37,6,38,39,40,41,12,9,11,25,18,17]),import.meta.url)),CCt=U.lazy(()=>gn(()=>import("./index-Dw6syXvl.js"),__vite__mapDeps([42,6,43,44,17,16,45,9,46,47,29,12,11,38,48,39,49,3,18,22,23,50,51,52]),import.meta.url)),ACt=U.lazy(()=>gn(()=>import("./index-oWv9ehU5.js"),__vite__mapDeps([53,54,10,51,55,56,45,57,12,9,11,7,8,13,14,15,16,17,18,58,49,3,2,59,6,60,61,29,19,20,62,63,64,65,4,66]),import.meta.url)),_Ct=U.lazy(()=>gn(()=>import("./index-CBQDge9H.js"),__vite__mapDeps([67,68,22,23,9,69]),import.meta.url)),ECt=U.lazy(()=>gn(()=>import("./index-Cqf3kTsw.js"),__vite__mapDeps([70,54,10,71,72,73,17,6,9,11,74,13,75,76,29,77,78,79,16,12,7,8,14,15,18,80,81,82,45,20,83,3,2,84,85,30,22,23,86,87,88,24,25,44,46,89,1,49,64]),import.meta.url)),RCt=U.lazy(()=>gn(()=>import("./detail-ByJGw6CQ.js").then(e=>e.d),__vite__mapDeps([90,54,10,19,20,21,6,18,22,23,28,83,40,41,52]),import.meta.url)),kCt=U.lazy(()=>gn(()=>import("./index-CaM460rw.js"),[],import.meta.url)),DCt=U.lazy(()=>gn(()=>import("./index-DB54SdYK.js"),__vite__mapDeps([91,1,74,13]),import.meta.url)),LCt=U.lazy(()=>gn(()=>import("./index-CDk9gqwO.js"),__vite__mapDeps([92,93,94,95,62,96]),import.meta.url)),OCt=U.lazy(()=>gn(()=>import("./index-DINuwc4O.js"),__vite__mapDeps([97,62,78,48,96,27]),import.meta.url)),ICt=U.lazy(()=>gn(()=>import("./index-DrZqlcHr.js"),__vite__mapDeps([98,96]),import.meta.url)),PCt=U.lazy(()=>gn(()=>import("./index-edI690Jp.js"),__vite__mapDeps([99,32,33,34,35,36,37,100,72,73,41,25,6,59]),import.meta.url)),MCt=U.lazy(()=>gn(()=>import("./index-C5VGS0or.js"),__vite__mapDeps([101,94]),import.meta.url)),BCt=U.lazy(()=>gn(()=>import("./index-BO1T0fz0.js"),__vite__mapDeps([102,93,94,95,62,96]),import.meta.url)),NCt=U.lazy(()=>gn(()=>import("./index-CzxambID.js").then(e=>e.a2),__vite__mapDeps([103,104]),import.meta.url)),$Ct=U.lazy(()=>gn(()=>import("./index-CBcjH65j.js"),__vite__mapDeps([105,54,10,106,107,108,63,9,109,12,11,46,7,8,13,14,15,16,17,18,28,110,111,4,6,89,23]),import.meta.url));function Zle(){const e=Sl(),{session:t}=y0(),{wallet:n}=Vh(),r=t.user&&t.user.did;return U.useEffect(()=>{const i=f5();return r?i.connect():i.isConnected()&&i.disconnect(),()=>{i.isConnected()&&i.disconnect()}},[r]),U.useEffect(()=>{if(n)return()=>{};const i=()=>{document.visibilityState==="visible"&&t.refresh()};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i)}},[]),{node:e,session:t}}function FCt(){var a;const{t:e}=fo(),{node:t,session:n}=Zle(),r=yi();U.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${r.pathname}${r.search}`)},[r]),U.useEffect(()=>{var s;((s=n==null?void 0:n.user)==null?void 0:s.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&n.logout()},[(a=n==null?void 0:n.user)==null?void 0:a.role]);const i=I.jsx(ra,{});if(t.loading||n.loading)return I.jsx(Qo,{children:i});if(!t.info.initialized)return b8e.getServerAuthMethod(t.info)==="nft"?I.jsx(YL,{action:"verify-owner"}):I.jsx(Qo,{children:I.jsx(m6t,{})});if(t.info.upgradeSessionId)return I.jsx(Qo,{children:I.jsx(Nse,{})});if(!n.user)return I.jsx(XL,{loadingEle:i});const o=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(Q8t,{children:I.jsxs(gCt,{children:[I.jsx(C6t,{}),I.jsx(OTt,{}),I.jsx(nCt,{}),I.jsx(U.Suspense,{fallback:o,children:I.jsxs(A4,{children:[I.jsx(or,{path:"/dashboard",element:I.jsx(Ko,{fullWidth:!0,title:"Dashboard",children:I.jsx(TCt,{})})}),I.jsx(or,{path:"/blocklets",element:I.jsx(Ko,{fullWidth:!0,title:e("common.blocklets"),children:I.jsx(xCt,{})})}),I.jsx(or,{path:"/blocklets/:did/:tab",element:I.jsx(Ko,{fullWidth:!0,title:"Blocklets",children:I.jsx(RCt,{})})}),I.jsx(or,{path:"/settings/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.setting"),children:I.jsx(ACt,{})})}),I.jsx(or,{path:"/eula",element:I.jsx(Ko,{fullWidth:!0,title:e("setup.steps.eula"),children:I.jsx(kCt,{})})}),I.jsx(or,{path:"/store",element:I.jsx(Ko,{fullWidth:!0,title:e("common.store"),children:I.jsx(CCt,{})})}),I.jsx(or,{path:"/console",element:I.jsx(Ko,{title:`GraphQL ${e("common.console")}`,scrollable:!1,fullWidth:!0,children:I.jsx(NCt,{})})}),I.jsx(or,{path:"/notifications",element:I.jsx(Ko,{children:I.jsx(DCt,{})})}),I.jsx(or,{path:"/team/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.team"),children:I.jsx(ECt,{})})}),I.jsx(or,{path:"/logs/:name",element:I.jsx(Ko,{scrollable:!1,fullWidth:!0,title:e("common.logs"),children:I.jsx(_Ct,{})})}),I.jsx(or,{path:"/analytics/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.analytics"),children:I.jsx($Ct,{})})}),I.jsx(or,{path:"/",element:I.jsx(Gs,{to:"/dashboard",replace:!0})}),I.jsx(or,{path:"/team",element:I.jsx(Gs,{to:"/team/members",replace:!0})}),I.jsx(or,{path:"/analytics",element:I.jsx(Gs,{to:"/analytics/traffic",replace:!0})}),I.jsx(or,{path:"/logs",element:I.jsx(Gs,{to:"/logs/abtnode",replace:!0})}),I.jsx(or,{path:"/router",element:I.jsx(Gs,{to:"/router/rules",replace:!0})}),I.jsx(or,{path:"/settings",element:I.jsx(Gs,{to:"/settings/basic",replace:!0})}),I.jsx(or,{path:"/marketplace",element:I.jsx(Gs,{to:"/store",replace:!0})}),I.jsx(or,{path:"/marketplace/:did",element:I.jsx(Gs,{to:"/store/:did",replace:!0})}),I.jsx(or,{path:"*",element:I.jsx(MCt,{})})]})})]})})}function Jc({children:e}){const{node:t,session:n}=Zle();return t.loading||!n.initialized&&n.loading?I.jsx(Qo,{children:I.jsx(ra,{})}):t.info.upgradeSessionId?I.jsx(Qo,{children:I.jsx(Nse,{})}):e}function UCt(){const{changeLocale:e}=fo(),t=Kle();U.useEffect(()=>{const r=t.get("locale");r&&["zh","en"].includes(r)&&e(r)},[]);const n=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(U.Suspense,{fallback:n,children:I.jsxs(A4,{children:[I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:I.jsx(Jc,{children:I.jsx(LCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:I.jsx(Jc,{children:I.jsx(OCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:I.jsx(Jc,{children:I.jsx(ICt,{})})}),I.jsx(or,{path:"/accept-server",element:I.jsx(Jc,{children:I.jsx(YL,{action:"accept-server"})})}),I.jsx(or,{path:"/launch-blocklet/*",element:I.jsx(Jc,{children:I.jsx(bCt,{children:I.jsx(PCt,{})})})}),I.jsx(or,{path:"/blocklets/restore/*",element:I.jsx(Jc,{children:I.jsx(Yle,{children:I.jsx(SCt,{})})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:I.jsx(Jc,{children:I.jsx(BCt,{})})}),I.jsx(or,{path:"/*",element:I.jsx(FCt,{})})]})})}function jCt(){const e=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return I.jsxs(I.Fragment,{children:[I.jsx($7,{}),I.jsx(OJ,{history:X8e,basename:e,children:I.jsx(VTt,{children:I.jsx(UCt,{})})})]})}const qCt=WK(document.getElementById("root"));qCt.render(I.jsx(jCt,{}));const DW=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";wge(`${DW}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:DW},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});export{Hp as $,ci as A,ks as B,ra as C,QD as D,BJ as E,rn as F,gx as G,Ps as H,SO as I,Tat as J,Yct as K,DX as L,Ss as M,cl as N,ft as O,Z as P,Ok as Q,ND as R,B1 as S,Lle as T,y5 as U,Qo as V,oO as W,Ac as X,Ave as Y,OD as Z,Qst as _,Ki as a,wk as a$,rL as a0,Ln as a1,to as a2,_6 as a3,kTt as a4,S_t as a5,s9e as a6,bk as a7,m9e as a8,IX as a9,dle as aA,Tdt as aB,zle as aC,R9e as aD,dCt as aE,G9 as aF,cie as aG,RW as aH,XAt as aI,joe as aJ,fa as aK,co as aL,X8e as aM,vdt as aN,sk as aO,KAt as aP,Lke as aQ,l_t as aR,S8t as aS,W9 as aT,YAt as aU,g_t as aV,ydt as aW,AX as aX,yX as aY,tLe as aZ,ZAt as a_,Hle as aa,W_t as ab,b8e as ac,iO as ad,nL as ae,q_t as af,DAt as ag,j_t as ah,f5 as ai,Kle as aj,o_t as ak,GO as al,KL as am,x7 as an,A4 as ao,or as ap,Gs as aq,cu as ar,yl as as,$V as at,B_t as au,Ir as av,y0 as aw,Io as ax,c_t as ay,T6 as az,ti as b,NA as b$,NRe as b0,JRe as b1,wdt as b2,m_t as b3,xle as b4,xCe as b5,hct as b6,Iw as b7,Pw as b8,jX as b9,sie as bA,zg as bB,PXe as bC,Wre as bD,JD as bE,sle as bF,HAt as bG,L_t as bH,FAt as bI,s_t as bJ,Zte as bK,ua as bL,kt as bM,mc as bN,ye as bO,Ybe as bP,Bt as bQ,un as bR,an as bS,hn as bT,fl as bU,Pt as bV,sn as bW,fu as bX,d7e as bY,ht as bZ,Gn as b_,en as ba,Hr as bb,Wu as bc,uh as bd,a_t as be,B6 as bf,bJ as bg,Yo as bh,qX as bi,G1 as bj,T_t as bk,Cie as bl,N_t as bm,iQ as bn,gn as bo,zAt as bp,mRe as bq,IJ as br,x_t as bs,GD as bt,Uh as bu,Og as bv,pre as bw,hre as bx,KD as by,r9 as bz,i5 as c,fw as c$,B7 as c0,$r as c1,M7 as c2,sAt as c3,MAt as c4,bdt as c5,koe as c6,ile as c7,p_t as c8,D6 as c9,_f as cA,yi as cB,CD as cC,pi as cD,VAt as cE,UAt as cF,jAt as cG,rle as cH,FTt as cI,tk as cJ,gi as cK,oAt as cL,wm as cM,Np as cN,Zut as cO,mt as cP,Jne as cQ,zCt as cR,cAt as cS,_ct as cT,V6 as cU,I8t as cV,pbe as cW,b_t as cX,Ya as cY,P7 as cZ,dc as c_,_W as ca,SRe as cb,ARe as cc,Adt as cd,T9e as ce,XEe as cf,Ule as cg,eCt as ch,NOe as ci,Ct as cj,GLe as ck,Or as cl,dh as cm,nu as cn,mi as co,Vh as cp,_g as cq,Ku as cr,S6t as cs,d5 as ct,z_t as cu,hGe as cv,yCt as cw,f_t as cx,Sdt as cy,i_t as cz,U_t as d,YCt as d$,$a as d0,Ai as d1,Rt as d2,hX as d3,FEe as d4,Ba as d5,OAt as d6,IAt as d7,PD as d8,Uke as d9,yu as dA,L9 as dB,SZe as dC,Vie as dD,JAt as dE,jEe as dF,s3 as dG,K4e as dH,cc as dI,_o as dJ,zY as dK,bwe as dL,Rw as dM,rs as dN,zh as dO,Lw as dP,Hh as dQ,N7 as dR,AY as dS,L4e as dT,I4e as dU,jve as dV,tY as dW,mg as dX,ZCt as dY,QCt as dZ,XCt as d_,M1 as da,c3 as db,MX as dc,q9e as dd,J$ as de,K$ as df,N9e as dg,yAt as dh,dn as di,GCt as dj,WCt as dk,HCt as dl,KCt as dm,Rh as dn,kD as dp,L6 as dq,ad as dr,Hg as ds,cJe as dt,CZ as du,Jn as dv,aAt as dw,Wp as dx,AZ as dy,Qt as dz,_8t as e,Y4 as e$,Xbe as e0,ug as e1,Dh as e2,RN as e3,JCt as e4,$f as e5,E3e as e6,S7 as e7,XY as e8,rAt as e9,OEe as eA,wv as eB,wRe as eC,hx as eD,g7e as eE,xm as eF,Oke as eG,k9e as eH,f3 as eI,nLe as eJ,em as eK,SLe as eL,Wl as eM,Xb as eN,Zb as eO,NLe as eP,LLe as eQ,bAt as eR,Yre as eS,Ls as eT,T_ as eU,F7 as eV,xY as eW,RX as eX,LGe as eY,Lh as eZ,qY as e_,eAt as ea,l4e as eb,fc as ec,BY as ed,I3e as ee,c4e as ef,nAt as eg,BA as eh,o4e as ei,s4e as ej,vl as ek,u4e as el,Wbe as em,lw as en,Mwe as eo,tAt as ep,Dwe as eq,jc as er,SCe as es,pAt as et,eAe as eu,tAe as ev,vAe as ew,hAt as ex,tr as ey,Tp as ez,Ec as f,ay as f$,hg as f0,_7 as f1,p3 as f2,tF as f3,jf as f4,fi as f5,Bot as f6,$o as f7,a0 as f8,tn as f9,t_t as fA,PAt as fB,r_t as fC,Aie as fD,hoe as fE,t6t as fF,p9 as fG,tse as fH,Uoe as fI,vw as fJ,T2t as fK,iie as fL,Q4e as fM,QY as fN,U7 as fO,Kn as fP,Ew as fQ,n9e as fR,Y7 as fS,d8e as fT,$O as fU,uAt as fV,qO as fW,jO as fX,I6 as fY,EAt as fZ,RO as f_,Eg as fa,Hf as fb,UOe as fc,WK as fd,Kh as fe,Xn as ff,bee as fg,gee as fh,Sw as fi,Xct as fj,kY as fk,cw as fl,l3 as fm,i7 as fn,tQ as fo,VQ as fp,v6t as fq,qAt as fr,nI as fs,rQ as ft,VCt as fu,pc as fv,CYe as fw,_c as fx,QAt as fy,ud as fz,Kt as g,Sh as g$,IO as g0,UWe as g1,Gh as g2,Tle as g3,A6 as g4,lot as g5,bot as g6,qte as g7,Sk as g8,Zrt as g9,Hct as gA,ID as gB,$_t as gC,v_t as gD,GAt as gE,e_t as gF,n_t as gG,R6 as gH,Tre as gI,xre as gJ,wre as gK,Pre as gL,WY as gM,e3 as gN,cAe as gO,dbe as gP,f5t as gQ,y5t as gR,w5t as gS,C5t as gT,E5t as gU,lTt as gV,uTt as gW,Vse as gX,zse as gY,MVe as gZ,Ktt as g_,wie as ga,Kf as gb,E6 as gc,L1 as gd,kw as ge,mx as gf,Dw as gg,YAe as gh,bX as gi,hCe as gj,ZZ as gk,cve as gl,WAt as gm,d_t as gn,Lxt as go,Sg as gp,lCe as gq,Cw as gr,dre as gs,H7 as gt,mSe as gu,W7 as gv,yct as gw,K7 as gx,$At as gy,oCt as gz,rO as h,q1 as h0,jVe as h1,BAt as h2,TAt as h3,y_t as h4,sV as h5,Zm as h6,GOe as h7,aQ as h8,d3 as h9,RAt as hA,Act as hB,O_t as hC,wX as hD,mot as hE,e9 as hF,LOe as hG,E_t as hH,__t as hI,nQ as hJ,Ite as hK,P_t as hL,mX as hM,wAt as ha,N1 as hb,iAt as hc,wwe as hd,dAt as he,mCe as hf,yRe as hg,bDe as hh,hDe as hi,mAt as hj,wDe as hk,gAt as hl,z9e as hm,vAt as hn,D5t as ho,KA as hp,YA as hq,$se as hr,X4e as hs,LD as ht,hN as hu,u_t as hv,Ibt as hw,w_t as hx,h_t as hy,mH as hz,ch as i,I as j,Tf as k,NAt as l,Xt as m,Ka as n,q6 as o,jE as p,fo as q,U as r,er as s,F8t as t,Sl as u,R8t as v,ake as w,C9 as x,tL as y,xc as z};
@@ -1,5 +1,5 @@
1
- const __vite__fileDeps=["./index-Dw3AMY5z.js","./index-BJy0Aykg.js","./index-D7K8de1w.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- import{r as p,ck as B,cl as F,cm as H,cn as q,aK as O,aL as G,j as s,n as R,P as y,H as V,co as J,f as K,cp as Q,x as I,O as x,cf as Y,W as Z,B as M,m as D,N as ee,cq as te,bo as se,cr as ae,cs as ne,u as oe,y as re,am as ie,bk as ce,ae as le}from"./index-BJy0Aykg.js";import{d as pe}from"./CheckCircle-DkW4b6y7.js";import{d as de}from"./ViewList-jxsh9SMq.js";import{d as ue}from"./Done-BJ9nFL7V.js";import{w as me}from"./wrap-locale-Bh4fVNfi.js";import{S as fe,a as he,b as xe}from"./Stepper-D1V6NqBX.js";var S=function(e){if(!e)return 0;var r=q(e).valueOf()-Date.now();return r<0?0:r},ge=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},ve=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return B(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,f=F(p.useState(function(){return S(a)}),2),h=f[0],u=f[1],n=H(b);p.useEffect(function(){if(!a){u(0);return}u(S(a));var w=setInterval(function(){var o,c=S(a);u(c),c===0&&(clearInterval(w),(o=n.current)===null||o===void 0||o.call(n))},v);return function(){return clearInterval(w)}},[a,v]);var j=p.useMemo(function(){return ge(h)},[h]);return[h,j]},k={},be=G;Object.defineProperty(k,"__esModule",{value:!0});var E=k.default=void 0,we=be(O()),je=s;E=k.default=(0,we.default)((0,je.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:e,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,f]=p.useState(0),h=p.useRef(null),u=o=>{if(o<0||o>e.length-1)return;g(o);const c=h.current.clientWidth;f(o*(r+i)-(c-r)/2+i*.5),d(o)};p.useEffect(()=>{u(v);const o=c=>c.preventDefault();h.current.addEventListener("touchmove",o,{passive:!1})},[]);let n;const j=o=>{n=o.touches[0].clientX},w=o=>{const c=o.changedTouches[0],P=n-c.clientX;Math.abs(P)>60&&(P>0?u(b+1):u(b-1))};return s.jsx(ye,{ref:h,onTouchStart:j,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((o,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:o.src}})},o.id))})})}const ye=R.div`
1
+ const __vite__fileDeps=["./index-9FRtImOR.js","./index-DHvVD3rl.js","./index-D7K8de1w.css"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ import{r as p,ck as B,cl as F,cm as H,cn as q,aK as O,aL as G,j as s,n as R,P as y,H as V,co as J,f as K,cp as Q,x as I,O as x,cf as Y,W as Z,B as M,m as D,N as ee,cq as te,bo as se,cr as ae,cs as ne,u as oe,y as re,am as ie,bk as ce,ae as le}from"./index-DHvVD3rl.js";import{d as pe}from"./CheckCircle-DbpNufE5.js";import{d as de}from"./ViewList-BsKNUMlP.js";import{d as ue}from"./Done-LyiBXZqg.js";import{w as me}from"./wrap-locale-K8WYS2HB.js";import{S as fe,a as he,b as xe}from"./Stepper-F9lgPB4i.js";var S=function(e){if(!e)return 0;var r=q(e).valueOf()-Date.now();return r<0?0:r},ge=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},ve=function(e){e===void 0&&(e={});var r=e||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return B(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in e?g:i,f=F(p.useState(function(){return S(a)}),2),h=f[0],u=f[1],n=H(b);p.useEffect(function(){if(!a){u(0);return}u(S(a));var w=setInterval(function(){var o,c=S(a);u(c),c===0&&(clearInterval(w),(o=n.current)===null||o===void 0||o.call(n))},v);return function(){return clearInterval(w)}},[a,v]);var j=p.useMemo(function(){return ge(h)},[h]);return[h,j]},k={},be=G;Object.defineProperty(k,"__esModule",{value:!0});var E=k.default=void 0,we=be(O()),je=s;E=k.default=(0,we.default)((0,je.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:e,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,f]=p.useState(0),h=p.useRef(null),u=o=>{if(o<0||o>e.length-1)return;g(o);const c=h.current.clientWidth;f(o*(r+i)-(c-r)/2+i*.5),d(o)};p.useEffect(()=>{u(v);const o=c=>c.preventDefault();h.current.addEventListener("touchmove",o,{passive:!1})},[]);let n;const j=o=>{n=o.touches[0].clientX},w=o=>{const c=o.changedTouches[0],P=n-c.clientX;Math.abs(P)>60&&(P>0?u(b+1):u(b-1))};return s.jsx(ye,{ref:h,onTouchStart:j,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:e.map((o,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:o.src}})},o.id))})})}const ye=R.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -33,7 +33,7 @@ import{r as p,ck as B,cl as F,cm as H,cn as q,aK as O,aL as G,j as s,n as R,P as
33
33
  }
34
34
  }
35
35
  }
36
- `;T.propTypes={list:y.array,width:y.number,height:y.number,cardSpace:y.number,onSelect:y.func,defaultIndex:y.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};const $=()=>{const{searchParams:e}=new URL(window.location.href);return e.get("fromWallet")==="1"};function Pe({icon:e,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(E,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(e)]})}function Se({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(e),g=V(t=>t.breakpoints.down("sm")),a=J({user:null,passport:null,success:!1,activeStep:0}),f=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:h,clearPassportId:u}=ne(),{t:n,locale:j}=p.useContext(K),{wallet:w}=Q(),[o,c]=p.useState(0),{searchParams:P}=new URL(window.location.href),C=()=>{a.activeStep++},W=t=>{a.user=t.user},A=()=>{C()},z=(t,m)=>{t!=null&&t.passportId&&h(t.passportId),t!=null&&t.sessionToken&&(f.current.sessionToken=m(t.sessionToken)),t!=null&&t.refreshToken&&(f.current.refreshToken=m(t.refreshToken)),a.success=!0,C()},U=()=>new Promise(t=>{try{b.logout(()=>{t()})}catch{t()}}),L=async()=>{if(w&&$()){se(()=>import("./index-Dw3AMY5z.js").then(m=>m.i),__vite__mapDeps([0,1,2]),import.meta.url).then(m=>{m.call("arcClosePage")});return}await U(),ae(d)&&d({sessionToken:f.current.sessionToken,refreshToken:f.current.refreshToken});const t=P.get("redirect");if(t){window.location.replace(t);return}u(),window.location.replace("/")},X=t=>{a.passport=t.target.value},[N]=ve({leftTime:o,onEnd:()=>{L()}}),_=[{label:n("lostPassport.selectPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(t=>({src:l({title:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto"}),name:t.title,id:t.id})),onSelect:t=>X({target:{value:a.user.passportTypes[t].name}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(M,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:n("common.next")})})]}):s.jsx(I,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:j,messages:{title:n("lostPassport.dialog.title"),scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")}})},{label:n("lostPassport.receivePassport"),content:()=>{var m;const t={receiverDid:a.user.did,passportName:a.passport,teamDid:((m=window==null?void 0:window.blocklet)==null?void 0:m.did)||""};return s.jsx(I,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:j,messages:{title:`${n("lostPassport.dialog.title")}`,scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")},extraParams:t})}},{label:n("common.complete"),content:()=>(o===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(pe,{style:{fontSize:60}})}),s.jsx(D,{component:"p",variant:"body1",className:"subheader",children:n("issuePassport.dialog.success")}),s.jsx(D,{component:"p",variant:"body2",color:"gray",children:w&&$()?n("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):n("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(M,{style:{marginTop:40},variant:"contained",color:"primary",onClick:L,children:n("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(ke,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(fe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:_.map(({label:t})=>s.jsx(he,{children:s.jsx(xe,{StepIconComponent:Pe,children:t})},t))}),s.jsx("div",{className:"stepper-content",children:_[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(ee,{to:"/",style:{color:"#4598FA"},children:n("lostPassport.return")})})]})})}const ke=R(te)`
36
+ `;T.propTypes={list:y.array,width:y.number,height:y.number,cardSpace:y.number,onSelect:y.func,defaultIndex:y.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};const $=()=>{const{searchParams:e}=new URL(window.location.href);return e.get("fromWallet")==="1"};function Pe({icon:e,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(E,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(e)]})}function Se({SessionContext:e,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(e),g=V(t=>t.breakpoints.down("sm")),a=J({user:null,passport:null,success:!1,activeStep:0}),f=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:h,clearPassportId:u}=ne(),{t:n,locale:j}=p.useContext(K),{wallet:w}=Q(),[o,c]=p.useState(0),{searchParams:P}=new URL(window.location.href),C=()=>{a.activeStep++},W=t=>{a.user=t.user},A=()=>{C()},z=(t,m)=>{t!=null&&t.passportId&&h(t.passportId),t!=null&&t.sessionToken&&(f.current.sessionToken=m(t.sessionToken)),t!=null&&t.refreshToken&&(f.current.refreshToken=m(t.refreshToken)),a.success=!0,C()},U=()=>new Promise(t=>{try{b.logout(()=>{t()})}catch{t()}}),L=async()=>{if(w&&$()){se(()=>import("./index-9FRtImOR.js").then(m=>m.i),__vite__mapDeps([0,1,2]),import.meta.url).then(m=>{m.call("arcClosePage")});return}await U(),ae(d)&&d({sessionToken:f.current.sessionToken,refreshToken:f.current.refreshToken});const t=P.get("redirect");if(t){window.location.replace(t);return}u(),window.location.replace("/")},X=t=>{a.passport=t.target.value},[N]=ve({leftTime:o,onEnd:()=>{L()}}),_=[{label:n("lostPassport.selectPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(t=>({src:l({title:t.title,issuer:t.issuer.name,issuerDid:t.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto"}),name:t.title,id:t.id})),onSelect:t=>X({target:{value:a.user.passportTypes[t].name}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(M,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:n("common.next")})})]}):s.jsx(I,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:j,messages:{title:n("lostPassport.dialog.title"),scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")}})},{label:n("lostPassport.receivePassport"),content:()=>{var m;const t={receiverDid:a.user.did,passportName:a.passport,teamDid:((m=window==null?void 0:window.blocklet)==null?void 0:m.did)||""};return s.jsx(I,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:j,messages:{title:`${n("lostPassport.dialog.title")}`,scan:n("lostPassport.dialog.scan"),confirm:n("lostPassport.dialog.confirm"),success:n("lostPassport.dialog.success")},extraParams:t})}},{label:n("common.complete"),content:()=>(o===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(pe,{style:{fontSize:60}})}),s.jsx(D,{component:"p",variant:"body1",className:"subheader",children:n("issuePassport.dialog.success")}),s.jsx(D,{component:"p",variant:"body2",color:"gray",children:w&&$()?n("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):n("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(M,{style:{marginTop:40},variant:"contained",color:"primary",onClick:L,children:n("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(ke,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(fe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:_.map(({label:t})=>s.jsx(he,{children:s.jsx(xe,{StepIconComponent:Pe,children:t})},t))}),s.jsx("div",{className:"stepper-content",children:_[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(ee,{to:"/",style:{color:"#4598FA"},children:n("lostPassport.return")})})]})})}const ke=R(te)`
37
37
  padding-top: 46px;
38
38
  padding-bottom: 46px;
39
39
  height: 100%;
@@ -1 +1 @@
1
- import{g as y}from"./index-BJy0Aykg.js";var c={};function u(e,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var T=u;u.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};u.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};u.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var i=new Date().getTime();if(e&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};u.prototype.attempt=function(e,i){this._fn=e,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};u.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};u.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};u.prototype.start=u.prototype.try;u.prototype.errors=function(){return this._errors};u.prototype.attempts=function(){return this._attempts};u.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},i=null,t=0,r=0;r<this._errors.length;r++){var n=this._errors[r],o=n.message,a=(e[o]||0)+1;e[o]=a,a>=t&&(i=n,t=a)}return i};(function(e){var i=T;e.operation=function(t){var r=e.timeouts(t);return new i(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)r[n]=t[n];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],a=0;a<r.retries;a++)o.push(this.createTimeout(a,r));return t&&t.forever&&!o.length&&o.push(this.createTimeout(a,r)),o.sort(function(s,m){return s-m}),o},e.createTimeout=function(t,r){var n=r.randomize?Math.random()+1:1,o=Math.round(n*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));return o=Math.min(o,r.maxTimeout),o},e.wrap=function(t,r,n){if(r instanceof Array&&(n=r,r=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var a=0;a<n.length;a++){var s=n[a],m=t[s];t[s]=(function(p){var f=e.operation(r),h=Array.prototype.slice.call(arguments,1),l=h.pop();h.push(function(_){f.retry(_)||(_&&(arguments[0]=f.mainError()),l.apply(this,arguments))}),f.attempt(function(){p.apply(t,h)})}).bind(t,m),t[s].options=r}}})(c);var v=c;const R=y(v);export{R as a,v as r};
1
+ import{g as y}from"./index-DHvVD3rl.js";var c={};function u(e,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var T=u;u.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};u.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};u.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var i=new Date().getTime();if(e&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};u.prototype.attempt=function(e,i){this._fn=e,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};u.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};u.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};u.prototype.start=u.prototype.try;u.prototype.errors=function(){return this._errors};u.prototype.attempts=function(){return this._attempts};u.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},i=null,t=0,r=0;r<this._errors.length;r++){var n=this._errors[r],o=n.message,a=(e[o]||0)+1;e[o]=a,a>=t&&(i=n,t=a)}return i};(function(e){var i=T;e.operation=function(t){var r=e.timeouts(t);return new i(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)r[n]=t[n];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],a=0;a<r.retries;a++)o.push(this.createTimeout(a,r));return t&&t.forever&&!o.length&&o.push(this.createTimeout(a,r)),o.sort(function(s,m){return s-m}),o},e.createTimeout=function(t,r){var n=r.randomize?Math.random()+1:1,o=Math.round(n*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));return o=Math.min(o,r.maxTimeout),o},e.wrap=function(t,r,n){if(r instanceof Array&&(n=r,r=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var a=0;a<n.length;a++){var s=n[a],m=t[s];t[s]=(function(p){var f=e.operation(r),h=Array.prototype.slice.call(arguments,1),l=h.pop();h.push(function(_){f.retry(_)||(_&&(arguments[0]=f.mainError()),l.apply(this,arguments))}),f.attempt(function(){p.apply(t,h)})}).bind(t,m),t[s].options=r}}})(c);var v=c;const R=y(v);export{R as a,v as r};
@@ -1,4 +1,4 @@
1
- import{r as y,j as e,g as m3,bl as _,q as X,m as Y,D as Z,B as v,C as k,w as Ae,J as He,K as n3,P as S,bH as w,n as Q,cd as q,dx as z,fC as b3,aX as le,aY as ce,a2 as j,ad as h3,A as R,fD as Ee,O as h,fE as Ie,M as De,b as ue,aK as de,aL as Je,F as k3,S as w3,aN as a3,W as K3,cP as f3,fF as Fe,fG as pe,dD as X3,dz as fe,dA as Z3,fH as Ge,fI as me,dC as he,fJ as ge,fK as Be,fL as ye,v as Ne,ax as d3,T as Te,f as Oe,H as Se,U as M3}from"./index-BJy0Aykg.js";import{d as g3}from"./Add-NewVG93V.js";import{S as o3}from"./index-DeBMBarq.js";import{d as l3}from"./EditIcon-D0wQcFnY.js";import{d as Ce}from"./LockIcon-BlIFddg8.js";import{L as B3,S as y3,d as xe}from"./list-header-BeAWG4F0.js";import{b as s3,u as Pe}from"./team-iad1pbmQ.js";import{T as W,F as ve}from"./TextField-3uVNonhd.js";import{C as Re}from"./Google-DU7ZCGKH.js";import{E as N3}from"./index-Dc91z-EC.js";import{l as Q3}from"./index-D74eXDyn.js";import{j as Me}from"./index-wR2FBwGe.js";import{I as Le}from"./InputAdornment-CP3BhuEs.js";import{I as Ve}from"./InputLabel-DOxBtPfl.js";import{T as _e,a as J3}from"./ToggleButtonGroup-JLgFfvsV.js";import{O as We}from"./Select-DdUtkwyq.js";import"./ButtonGroup-pLJbtCLI.js";import"./getValidReactChildren-2v0cL06g.js";import"./Search-xUbipjHz.js";import"./isEqual-GyLZxSRY.js";var T3={};Object.defineProperty(T3,"__esModule",{value:!0});var i3=T3.default=void 0;Ue(y);var L3=e;function Ue(n){return n&&n.__esModule?n:{default:n}}function V3(n,o){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(n);o&&(H=H.filter(function(I){return Object.getOwnPropertyDescriptor(n,I).enumerable})),i.push.apply(i,H)}return i}function _3(n){for(var o=1;o<arguments.length;o++){var i=arguments[o]!=null?arguments[o]:{};o%2?V3(Object(i),!0).forEach(function(H){je(n,H,i[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):V3(Object(i)).forEach(function(H){Object.defineProperty(n,H,Object.getOwnPropertyDescriptor(i,H))})}return n}function je(n,o,i){return o=be(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n}function be(n){var o=ke(n,"string");return typeof o=="symbol"?o:String(o)}function ke(n,o){if(typeof n!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var H=i.call(n,o||"default");if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(n)}var O3=function(o){return(0,L3.jsx)("svg",_3(_3({},o),{},{children:(0,L3.jsx)("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188c0 .103.085.188.188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"})}))};O3.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};O3.displayName="delete";i3=T3.default=O3;var Y3={exports:{}},q3={exports:{}};(function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o={rotl:function(i,H){return i<<H|i>>>32-H},rotr:function(i,H){return i<<32-H|i>>>H},endian:function(i){if(i.constructor==Number)return o.rotl(i,8)&16711935|o.rotl(i,24)&4278255360;for(var H=0;H<i.length;H++)i[H]=o.endian(i[H]);return i},randomBytes:function(i){for(var H=[];i>0;i--)H.push(Math.floor(Math.random()*256));return H},bytesToWords:function(i){for(var H=[],I=0,c=0;I<i.length;I++,c+=8)H[c>>>5]|=i[I]<<24-c%32;return H},wordsToBytes:function(i){for(var H=[],I=0;I<i.length*32;I+=8)H.push(i[I>>>5]>>>24-I%32&255);return H},bytesToHex:function(i){for(var H=[],I=0;I<i.length;I++)H.push((i[I]>>>4).toString(16)),H.push((i[I]&15).toString(16));return H.join("")},hexToBytes:function(i){for(var H=[],I=0;I<i.length;I+=2)H.push(parseInt(i.substr(I,2),16));return H},bytesToBase64:function(i){for(var H=[],I=0;I<i.length;I+=3)for(var c=i[I]<<16|i[I+1]<<8|i[I+2],u=0;u<4;u++)I*8+u*6<=i.length*8?H.push(n.charAt(c>>>6*(3-u)&63)):H.push("=");return H.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/ig,"");for(var H=[],I=0,c=0;I<i.length;c=++I%4)c!=0&&H.push((n.indexOf(i.charAt(I-1))&Math.pow(2,-2*c+8)-1)<<c*2|n.indexOf(i.charAt(I))>>>6-c*2);return H}};q3.exports=o})();var we=q3.exports,G3={utf8:{stringToBytes:function(n){return G3.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(G3.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var o=[],i=0;i<n.length;i++)o.push(n.charCodeAt(i)&255);return o},bytesToString:function(n){for(var o=[],i=0;i<n.length;i++)o.push(String.fromCharCode(n[i]));return o.join("")}}},W3=G3;/*!
1
+ import{r as y,j as e,g as m3,bl as _,q as X,m as Y,D as Z,B as v,C as k,w as Ae,J as He,K as n3,P as S,bH as w,n as Q,cd as q,dx as z,fC as b3,aX as le,aY as ce,a2 as j,ad as h3,A as R,fD as Ee,O as h,fE as Ie,M as De,b as ue,aK as de,aL as Je,F as k3,S as w3,aN as a3,W as K3,cP as f3,fF as Fe,fG as pe,dD as X3,dz as fe,dA as Z3,fH as Ge,fI as me,dC as he,fJ as ge,fK as Be,fL as ye,v as Ne,ax as d3,T as Te,f as Oe,H as Se,U as M3}from"./index-DHvVD3rl.js";import{d as g3}from"./Add-CazR0vZK.js";import{S as o3}from"./index-CtlJtm28.js";import{d as l3}from"./EditIcon-CeWwrlQZ.js";import{d as Ce}from"./LockIcon-C082WeKw.js";import{L as B3,S as y3,d as xe}from"./list-header-sMQeptfh.js";import{b as s3,u as Pe}from"./team-Ch-Gj2hO.js";import{T as W,F as ve}from"./TextField-B9TZBqQf.js";import{C as Re}from"./Google-BzTTYoLn.js";import{E as N3}from"./index-CmUhV6b0.js";import{l as Q3}from"./index-CYqmm0Sa.js";import{j as Me}from"./index-Bpjx7556.js";import{I as Le}from"./InputAdornment-0DnARlEj.js";import{I as Ve}from"./InputLabel-Csh1ynXt.js";import{T as _e,a as J3}from"./ToggleButtonGroup-B4DF013K.js";import{O as We}from"./Select-DXPyl9dO.js";import"./ButtonGroup-DxRrpbFw.js";import"./getValidReactChildren-BhT8Dia7.js";import"./Search-CQMDHt0w.js";import"./isEqual-BT0_AVZN.js";var T3={};Object.defineProperty(T3,"__esModule",{value:!0});var i3=T3.default=void 0;Ue(y);var L3=e;function Ue(n){return n&&n.__esModule?n:{default:n}}function V3(n,o){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(n);o&&(H=H.filter(function(I){return Object.getOwnPropertyDescriptor(n,I).enumerable})),i.push.apply(i,H)}return i}function _3(n){for(var o=1;o<arguments.length;o++){var i=arguments[o]!=null?arguments[o]:{};o%2?V3(Object(i),!0).forEach(function(H){je(n,H,i[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):V3(Object(i)).forEach(function(H){Object.defineProperty(n,H,Object.getOwnPropertyDescriptor(i,H))})}return n}function je(n,o,i){return o=be(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n}function be(n){var o=ke(n,"string");return typeof o=="symbol"?o:String(o)}function ke(n,o){if(typeof n!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var H=i.call(n,o||"default");if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(n)}var O3=function(o){return(0,L3.jsx)("svg",_3(_3({},o),{},{children:(0,L3.jsx)("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188c0 .103.085.188.188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"})}))};O3.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};O3.displayName="delete";i3=T3.default=O3;var Y3={exports:{}},q3={exports:{}};(function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o={rotl:function(i,H){return i<<H|i>>>32-H},rotr:function(i,H){return i<<32-H|i>>>H},endian:function(i){if(i.constructor==Number)return o.rotl(i,8)&16711935|o.rotl(i,24)&4278255360;for(var H=0;H<i.length;H++)i[H]=o.endian(i[H]);return i},randomBytes:function(i){for(var H=[];i>0;i--)H.push(Math.floor(Math.random()*256));return H},bytesToWords:function(i){for(var H=[],I=0,c=0;I<i.length;I++,c+=8)H[c>>>5]|=i[I]<<24-c%32;return H},wordsToBytes:function(i){for(var H=[],I=0;I<i.length*32;I+=8)H.push(i[I>>>5]>>>24-I%32&255);return H},bytesToHex:function(i){for(var H=[],I=0;I<i.length;I++)H.push((i[I]>>>4).toString(16)),H.push((i[I]&15).toString(16));return H.join("")},hexToBytes:function(i){for(var H=[],I=0;I<i.length;I+=2)H.push(parseInt(i.substr(I,2),16));return H},bytesToBase64:function(i){for(var H=[],I=0;I<i.length;I+=3)for(var c=i[I]<<16|i[I+1]<<8|i[I+2],u=0;u<4;u++)I*8+u*6<=i.length*8?H.push(n.charAt(c>>>6*(3-u)&63)):H.push("=");return H.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/ig,"");for(var H=[],I=0,c=0;I<i.length;c=++I%4)c!=0&&H.push((n.indexOf(i.charAt(I-1))&Math.pow(2,-2*c+8)-1)<<c*2|n.indexOf(i.charAt(I))>>>6-c*2);return H}};q3.exports=o})();var we=q3.exports,G3={utf8:{stringToBytes:function(n){return G3.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(G3.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var o=[],i=0;i<n.length;i++)o.push(n.charCodeAt(i)&255);return o},bytesToString:function(n){for(var o=[],i=0;i<n.length;i++)o.push(String.fromCharCode(n[i]));return o.join("")}}},W3=G3;/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -1 +1 @@
1
- import{r as E,q as j,z as I,j as e,V as W,C as k,ct as T,O as v,x as L,A as h,F as N,u as R,y as S,am as U,ae as b}from"./index-BJy0Aykg.js";import{w as F}from"./wrap-locale-Bh4fVNfi.js";function _({SessionContext:t,webWalletUrl:a,onSuccess:c}){var g,u;const{api:o,session:n}=E.useContext(t),{t:s,locale:m}=j(),w=I(),{searchParams:l}=new URL(window.location.href),d=l.get("redirect"),P=async(r,C)=>{c(r,C),await n.refresh(),h.success(s("exchangePassport.success")),setTimeout(()=>{if(d){const i=decodeURIComponent(d);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?w(i,{replace:!0}):window.location=i}else window.location=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=r=>{h.error(r.message)},x={},p=l.get("componentId");return p&&(x.componentId=p),n.loading?e.jsx(W,{children:e.jsx(k,{})}):e.jsx(T,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((u=window==null?void 0:window.env)==null?void 0:u.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(L,{className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:P,onError:f,locale:m,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:x,extraContent:null})})})}const y=F(_);function O(){const{info:t}=R(),a=S(t),c=(o,n)=>{o.sessionToken&&b(n(o.sessionToken))};return e.jsx(y,{SessionContext:U,webWalletUrl:a,onSuccess:c})}export{O as default};
1
+ import{r as E,q as j,z as I,j as e,V as W,C as k,ct as T,O as v,x as L,A as h,F as N,u as R,y as S,am as U,ae as b}from"./index-DHvVD3rl.js";import{w as F}from"./wrap-locale-K8WYS2HB.js";function _({SessionContext:t,webWalletUrl:a,onSuccess:c}){var g,u;const{api:o,session:n}=E.useContext(t),{t:s,locale:m}=j(),w=I(),{searchParams:l}=new URL(window.location.href),d=l.get("redirect"),P=async(r,C)=>{c(r,C),await n.refresh(),h.success(s("exchangePassport.success")),setTimeout(()=>{if(d){const i=decodeURIComponent(d);i.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?w(i,{replace:!0}):window.location=i}else window.location=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},f=r=>{h.error(r.message)},x={},p=l.get("componentId");return p&&(x.componentId=p),n.loading?e.jsx(W,{children:e.jsx(k,{})}):e.jsx(T,{did:((g=window==null?void 0:window.blocklet)==null?void 0:g.appPid)||((u=window==null?void 0:window.env)==null?void 0:u.appPid),children:e.jsx(v,{sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(L,{className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:P,onError:f,locale:m,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:x,extraContent:null})})})}const y=F(_);function O(){const{info:t}=R(),a=S(t),c=(o,n)=>{o.sessionToken&&b(n(o.sessionToken))};return e.jsx(y,{SessionContext:U,webWalletUrl:a,onSuccess:c})}export{O as default};
@@ -0,0 +1,21 @@
1
+ import{aj as J,z as A,r as p,a as X,b as Z,P as x,q as j,u as P,y as ee,au as $,M as N,j as t,x as _,av as te,a1 as S,m as v,D as q,aw as se,U as M,ax as oe,B as O,C as W,ay as re,A as z,K,az as ne,aA as ae,aB as ie,F as le,aC as ce,i as ue,n as V,aa as de,a4 as pe,a7 as he,a8 as fe,aD as me,a9 as ge,O as xe}from"./index-DHvVD3rl.js";import{_ as D}from"./useLocalStorage-BOaGasKr.js";import{c as be,C as ye,A as ke,D as Se,B as je,S as H,a as Pe,b as we}from"./item-k8JU-j43.js";import{d as Re}from"./ArrowDropDown-BUrSvBpJ.js";import{B as ve}from"./Breadcrumbs-D_LYBn3C.js";import"./index-Bpjx7556.js";import"./index-CmUhV6b0.js";import"./Search-CQMDHt0w.js";import"./index-BsRcoDUD.js";import"./Select-DXPyl9dO.js";import"./InputAdornment-0DnARlEj.js";import"./preact.module-B1z5cdvs.js";import"./Add-CazR0vZK.js";import"./TextField-B9TZBqQf.js";import"./InputLabel-Csh1ynXt.js";import"./Launch-BOea_wCy.js";import"./Done-LyiBXZqg.js";import"./DeleteOutline-CnmOxEUl.js";import"./delete-confirm-C4Bk8D3q.js";import"./click-to-copy-DdhnSrH5.js";import"./MoreVert-BzXa-i1R.js";import"./ButtonGroup-DxRrpbFw.js";import"./getValidReactChildren-BhT8Dia7.js";function Ce(e){const n=J(),c=A(),[s,o]=D(`sid:blocklet:purchase:${e}`),[l,u]=p.useState(!1),[h,a]=p.useState(null),d=()=>{const{pathname:r,searchParams:m}=new URL(window.location.href),b=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";m.get("sid")&&(o(""),c(r.replace(b,"/"),{replace:!0}))},i=!!(n.get("assetDid")&&s&&n.get("sid")===s);return X(Z.BlockletEvents.purchaseChange,r=>{r.did===e&&(a(r.session),["declined","confirmed","error"].includes(r.session.status)&&(u(!0),setTimeout(d,2e3)))}),p.useEffect(()=>{h&&h.id!==s&&o(h.id)},[h]),{hasCompleted:l,hasPurchased:i,session:h,setSession:a,doRedirect:d}}function B({meta:e,onCancel:n,handlePaySuccess:c,storeUrl:s}){const{t:o}=j(),{info:l}=P(),[u,h]=p.useState("both"),[a,d]=p.useState(1),i=ee(l),r=$(e,l,s),m=R=>{R!==u&&h(R)},b=()=>{u&&(d(2),u==="verify"&&(window.location.href=r))},y=(R,L)=>{L!=="backdropClick"&&n()},w=()=>{c(r)},f=N.getDisplayName({meta:e});if(u==="purchase"&&a===2)return t.jsx(_,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:te.create({baseURL:S(s,"/store")}).get,onSuccess:w,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:i,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:o("store.purchase.auth.title",{name:f}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(v,{gutterBottom:!0,children:o("store.purchase.auth.success")}),t.jsxs(v,{variant:"subtitle2",children:[" ",o("store.purchase.autoLaunch",{name:f})]})]})}});const g=q;return t.jsx(g,{title:o("store.purchase.title",{name:f}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:y,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ye,{action:u,onNext:b,onSelect:m})})})}B.propTypes={...be,storeUrl:x.string.isRequired,handlePaySuccess:x.func};B.defaultProps={handlePaySuccess:e=>{setTimeout(()=>{window.location.href=e},1e3)}};function E({meta:e,buttonText:n,storeUrl:c,isResource:s}){const{t:o}=j(),l=A(),{info:u}=P(),{api:h}=se(),a=N.isFreeBlocklet(e)===!1,[d,i]=p.useState(!1),{hasPurchased:r}=Ce(e.did),[m,b]=p.useState(!1),[y]=D("instant-blocklet-install",!1),[w,f]=p.useState(!1),g=p.useMemo(()=>d?o(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,o,a]),R=p.useMemo(()=>s?o("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),L=k=>{k.preventDefault(),k.stopPropagation();try{if(i(!0),a){b(!0);return}if(y){f(!0);return}if(!a){const C=$(e,u,c);window.location.href=C;return}}catch(C){z.error(K(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{i(!1)}},G=()=>{i(!1),b(!1)},Q=k=>{i(!1),f(!1),l(`/blocklets/${k.appDid}/components`)},Y=()=>{i(!1),f(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(ke,{children:t.jsx(M,{permission:"mutate_blocklets",children:k=>t.jsx(oe,{title:s?o("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(O,{onClick:L,size:"small",sx:{cursor:s?"not-allowed":"pointer"},disabled:!!(g||!k),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:g?t.jsxs(t.Fragment,{children:[t.jsx(W,{size:16,style:{marginRight:3}}),g]}):R},e.did)})})}),(r||m)&&t.jsx(B,{method:"launch",meta:e,mode:"both",onCancel:G,storeUrl:c}),w&&t.jsx(_,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:Q,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(re(c,e.did).trim())},messages:{title:o("setup.keyPair.title"),scan:o("setup.keyPair.scan"),confirm:o("setup.keyPair.confirm"),success:o("setup.keyPair.success")},onClose:Y})]})}E.propTypes={isResource:x.bool,meta:x.object.isRequired,buttonText:x.shape({purchase:x.string.isRequired,launch:x.string.isRequired}).isRequired,storeUrl:x.string.isRequired};E.defaultProps={isResource:!1};const De=(e,n,c)=>{const s=de(n);return S(c,`/blocklets/${e.did}/?server-url=${s}`)},F=({meta:e,attribute:n,value:c})=>e._formatted?e._formatted[n]:c;function U({blocklet:e,endpoint:n}){const{t:c}=j(),s=P();let o=S(s.imgPrefix,"blocklet.png");const l=n;if(l.startsWith("http")&&e.logo)o=S(l,ie(e.did,e.logo,e.version));else{let r=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");r&&(r=`/${r}`),o=S(r,`/blocklet/logo/${e.did}`)}try{const i=new URL(o);i.searchParams.set("v",e.version||+new Date),o=i.href}catch{}const u=(s==null?void 0:s.info.mode)!==le.NODE_MODES.SERVERLESS,h=i=>i.currentTarget.contains(i.target)?!0:(i.preventDefault(),!1),a={meta:e,buttonText:{purchase:c("common.purchase"),launch:c("common.launch")},storeUrl:l};let d=null;return u&&(d=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(E,{isResource:!ce.hasStartEngine(e),...a})})),t.jsx(ue,{href:De(e,s.info,n),style:{color:"initial",textDecoration:"none"},onClick:h,target:"_blank",children:t.jsx(Le,{title:F({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:F({meta:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,button:d})})}U.propTypes={blocklet:x.object.isRequired,endpoint:x.string};U.defaultProps={endpoint:""};function T({storeUrl:e,handleSearchSelect:n,extraFilter:c,...s}){var r;const{locale:o}=j(),l=P(),[u,h]=p.useState({}),a=m=>{h(m)},d=e,i=(r=l==null?void 0:l.info)==null?void 0:r.version;return p.useEffect(()=>{h({})},[d]),t.jsx(ne,{FallbackComponent:ae,resetKeys:[d],children:t.jsx("div",{...s,children:t.jsx(Se,{blockletRender:m=>{const b={...m,endpoint:d};return t.jsx(U,{...b})},baseSearch:!0,endpoint:d,locale:o,onFilterChange:a,onSearchSelect:n,filters:u,extraFilter:c,serverVersion:i})})})}T.propTypes={storeUrl:x.string.isRequired,handleSearchSelect:x.func,extraFilter:x.func};T.defaultProps={handleSearchSelect:null,extraFilter:void 0};const Le=V(je)`
2
+ .ms-highlight {
3
+ color: ${e=>e.theme.palette.primary.main};
4
+ }
5
+ `,Be=pe(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},menuName:{display:"flex",flexDirection:"column",marginRight:"100px","& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})),I=p.forwardRef(({onChange:e,onDelete:n},c)=>{const{info:s}=P(),{t:o}=j(),[l,u]=p.useState(!1),[h,a]=p.useState(!1),[d,i]=p.useState(-1),r=Be(),[m,b]=D(H),y=Math.max(s.blockletRegistryList.findIndex(f=>f.url===m),0),w=f=>{try{u(!0),i(f);const g=s.blockletRegistryList[f];b(g.url),e(g.url),a(!1)}catch(g){console.error(g),z.error(`${o("store.blockletRegistry.changeFailed")} ${K(g)}`)}finally{u(!1)}};return p.useImperativeHandle(c,()=>({setOpen:a})),t.jsxs(t.Fragment,{children:[t.jsx(M,{permission:"mutate_node",children:f=>t.jsx(O,{disabled:!f,classes:{text:r.buttonText},color:"secondary","data-cy":"store-toggle",onClick:()=>{a(!0)},endIcon:t.jsx(Re,{}),children:t.jsx(v,{color:"secondary",children:s.blockletRegistryList[y].name})})}),t.jsx(q,{title:o("store.blockletRegistry.switchRegistry"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:h,onClose:()=>a(!1),children:t.jsxs(he,{className:r.tabPanel,children:[s.blockletRegistryList.map((f,g)=>t.jsxs(fe,{button:!0,disabled:l,selected:y===g,"data-cy":"store-switch",onClick:()=>{if(!l){if(g===y){a(!1);return}w(g)}},children:[d===g&&l&&t.jsx(me,{className:r.iconRoot,children:t.jsx(W,{size:16})}),t.jsx(ge,{children:t.jsx(Pe,{teamDid:s.did,store:f,onDelete:()=>n(f.url)})})]},f.url)),t.jsx(we,{disabled:l,onAdd:e,teamDid:s.did,blockletRegistryList:s.blockletRegistryList})]})})]})});I.propTypes={onChange:x.func,onDelete:x.func};I.defaultProps={onChange:()=>{},onDelete:()=>{}};const Ee=I;function st(){const{t:e}=j(),{info:n}=P(),[c]=D(H),{blockletRegistryList:s}=n,o=s.find(r=>c===r.url)||s[0],[l,u]=p.useState(o.url),h=n.routing.adminPath,a=S(window.location.origin,h),d=({detailUrl:r})=>{const m=new URL(r);m.searchParams.set("server-url",a);const b=document.createElement("a");b.setAttribute("target","_blank"),b.setAttribute("href",m.href),b.click()},i=p.useRef(null);return t.jsxs(Ue,{children:[t.jsxs(ve,{separator:"›","aria-label":"breadcrumb",className:"page-breadcrumb",children:[t.jsx(v,{color:"textPrimary",children:e("common.store")}),t.jsx(Ee,{ref:i,onChange:r=>u(r),onDelete:r=>{var m;l===r&&u((m=n.blockletRegistryList[0])==null?void 0:m.url)}})]}),t.jsx(xe,{className:"store-header",display:"flex",justifyContent:"space-between",p:0,m:0,children:t.jsx(v,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:e("store.headerDescription")})}),t.jsx(T,{className:"blocklet-list",handleSearchSelect:d,storeUrl:l})]})}const Ue=V.main`
6
+ @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
7
+ .store-header {
8
+ flex-direction: column;
9
+ margin-bottom: 32px !important;
10
+ }
11
+
12
+ .page-header {
13
+ margin-bottom: 16px !important;
14
+ }
15
+ }
16
+ .blocklet-list {
17
+ aside:hover {
18
+ height: calc(100vh - 235px);
19
+ }
20
+ }
21
+ `;export{st as default};
@@ -1,4 +1,4 @@
1
- import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-BJy0Aykg.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-VH-ysxX_.js";import{C as I}from"./click-to-copy-Cd2slBnK.js";import{w as ie}from"./withStyles-CkukjHle.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
1
+ import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-DHvVD3rl.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-D6XxoBY_.js";import{C as I}from"./click-to-copy-DdhnSrH5.js";import{w as ie}from"./withStyles-CjmLVNUl.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
2
2
  border-left: 1px solid ${n=>n.theme.typography.color.main};
3
3
  padding: 10px 0 10px 16px;
4
4
  @media (max-width: ${n=>n.theme.breakpoints.values.sm}px) {
@@ -1,4 +1,4 @@
1
- import{g as l}from"./index-BJy0Aykg.js";var c={exports:{}};/*!
1
+ import{g as l}from"./index-DHvVD3rl.js";var c={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -1,4 +1,4 @@
1
- import{P as o,s as C,j as n,O as u,aK as x,aL as g,bb as j,q as T}from"./index-BJy0Aykg.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
1
+ import{P as o,s as C,j as n,O as u,aK as x,aL as g,bb as j,q as T}from"./index-DHvVD3rl.js";function i({icon:e,title:t,description:s,extra:E,...I}){return n.jsxs(w,{...I,children:[e,typeof t=="string"?n.jsx(u,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:t}):t,typeof s=="string"?n.jsx(u,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:s}):s,n.jsx(u,{mt:3,children:E})]})}i.propTypes={icon:o.element,title:o.oneOfType([o.string,o.element]),description:o.oneOfType([o.string,o.element]),actions:o.any,extra:o.element};i.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};const w=C("div")`
2
2
  box-sizing: border-box;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- import{aK as Re,aL as Oe,j as t,P as U,n as _e,dQ as pa,r as K,ba as ma,O as m,f8 as Mn,ez as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,gE as Ea,A as Y,M as Me,ad as _a,x as ss,fz as xa,m as Ft,gF as ya,at as Sa,aX as Te,aY as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bl as fe,bH as is,cd as Aa,f as xe,k as ze,bp as $t,bd as Ye,U as Ta,gG as Ca,g as et,cj as j,co as De,dv as me,a3 as Ra,gH as Ce,f9 as We,S as os,bb as tt,a9 as Oa,bI as wa,bJ as Ia,ax as Dn,b5 as La,b4 as cs,dM as Ae,d2 as rt,fP as He,gI as ja,gJ as Ma,gK as Da,aQ as ka,bu as Pa,bv as Ba,gL as Fa,gs as $a,bB as Ua,b6 as ls,a1 as Ut,bj as Kt,Q as Ka,eT as us,s as za,ff as Ie,Z as Ha,cQ as ds,E as Ga,G as vt}from"./index-BJy0Aykg.js";import{I as Wa}from"./iframe-9Q6zcs_o.js";import{F as qa,R as Va,I as Ya,a as zt,L as Nt,b as Za,d as Ja}from"./line-aqaJQGOE.js";import{d as fs}from"./ChevronRight-hQNW7SHU.js";import{T as tn}from"./index-DysPnzV7.js";import{B as gs}from"./bundle-avatar-DrhjE4I8.js";import{u as Xa,B as Qa}from"./app-avatar-DxfZHNQ7.js";import{i as er}from"./isEqual-GyLZxSRY.js";import{d as tr}from"./Loop-DIds44Mh.js";import{d as nr}from"./Done-BJ9nFL7V.js";import{a as kn,A as sr}from"./Autocomplete-BvkSiNum.js";import{T as te,F as ar}from"./TextField-3uVNonhd.js";import{e as rr}from"./mode-B2dWMeTO.js";import{C as ir,d as or}from"./Public-B9WCVLI7.js";import{u as ge,b as nn}from"./team-iad1pbmQ.js";import{C as cr}from"./click-to-copy-Cd2slBnK.js";import{a as Ge}from"./index-F32lbxl3.js";import{E as sn}from"./index-Dc91z-EC.js";import{u as ke,C as X}from"./index.esm-CcmphPDr.js";import{F as re}from"./Select-DdUtkwyq.js";import{d as lr}from"./Launch-D-68sLeU.js";import{d as ur}from"./EditIcon-D0wQcFnY.js";import{d as dr}from"./Edit-BgzVDDnU.js";import{d as fr}from"./actions-DbKUVgjV.js";import{u as gr,a as pr,D as mr,H as hr}from"./index-f9oKLglL.js";import{S as mt}from"./switch-control-BL5Q92y_.js";import{S as br}from"./Slider-110G8tdG.js";import{D as Er}from"./index-CLeW9jNa.js";import{I as _r}from"./index-VH-ysxX_.js";import"./index-BFpB8kh-.js";import"./ArrowDropDown-Bd9sR9Kj.js";import"./ButtonGroup-pLJbtCLI.js";import"./getValidReactChildren-2v0cL06g.js";import"./index-_GlgH8Bo.js";import"./Delete-LMbP8m3y.js";import"./InputLabel-DOxBtPfl.js";import"./useLocalStorage-B9e_6vUG.js";import"./MoreVert-Cei2Rx5H.js";import"./url-evaluation-CTHUhxLd.js";import"./tag-Cksz2rJp.js";import"./redux-CIzpcDy1.js";import"./FilterList-YahW7b2T.js";import"./LastPage-DmVgRYiw.js";import"./Search-xUbipjHz.js";var an={},xr=Oe;Object.defineProperty(an,"__esModule",{value:!0});var ps=an.default=void 0,yr=xr(Re()),Sr=t;ps=an.default=(0,yr.default)((0,Sr.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var rn={},vr=Oe;Object.defineProperty(rn,"__esModule",{value:!0});var ms=rn.default=void 0,Nr=vr(Re()),Ar=t;ms=rn.default=(0,Nr.default)((0,Ar.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var on={},Tr=Oe;Object.defineProperty(on,"__esModule",{value:!0});var hs=on.default=void 0,Cr=Tr(Re()),Rr=t;hs=on.default=(0,Cr.default)((0,Rr.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var cn={},Or=Oe;Object.defineProperty(cn,"__esModule",{value:!0});var bs=cn.default=void 0,wr=Or(Re()),Ir=t;bs=cn.default=(0,wr.default)((0,Ir.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");function ln({label:e,disabled:n,required:s,initialValue:r,onChange:u,style:c,onSubmit:i,triggers:a,options:o,formatterBeforeSubmit:l,helperText:d,placeholder:y,renderImage:b,renderLabel:h,filterKeys:v,noEmpty:A,...C}){const[w,f]=K.useState(!1),[g,S]=K.useState(!1),[p,x]=ma.useState(""),[R,D]=K.useState(r),[O,_]=K.useState(R),L=K.useMemo(()=>{if(!o)return{};const F={};return o.forEach(E=>{F[E.code]=E}),F},[o]),T=()=>{if(!o)return[];if(!p)return o.map(E=>E.code);const F=new RegExp(p.toLowerCase());return o.filter(E=>{var N;for(let k=0;k<v.length;k++){const z=v[k];if(F.test((N=E[z])==null?void 0:N.toLowerCase()))return!0}return!1}).map(E=>E.code)},M=async()=>{S(!0);try{await i(typeof l=="function"?l(O):O)===!1?_(R):A&&!O.length?(_(r),D(r)):(_(O),D(O))}catch{_(R)}finally{S(!1),f(!1)}},$=(F,E)=>{if(!Array.isArray(E)){_([]),u([]);return}const N=E.filter(k=>L[k]);if(!N.length){_([]),u([]);return}_(N),u(N)},q=w?t.jsx(sr,{options:o,value:O,onChange:$,inputValue:p,onInputChange:(F,E)=>{x(E)},PopperComponent:jr,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:T,getOptionLabel:F=>{var E;return(E=L[F])==null?void 0:E.name},renderInput:F=>t.jsx(te,{...F,label:"",placeholder:y}),renderOption:(F,E)=>{var k;const N=O.indexOf(E)!==-1;return K.createElement(Lr,{component:"li",...F,key:E},b(L[E]||{}),t.jsx(m,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:h(E,L[E])||((k=L[E])==null?void 0:k.name)}),t.jsx(m,{component:Mn,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...C}):t.jsx(m,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:O.filter(F=>o.some(E=>E.code===F)).map(F=>t.jsx(ns,{label:o.find(E=>E.code===F).name,style:{marginRight:8},size:"small"},F))});return t.jsx(qa,{className:"form",style:c,children:t.jsxs(m,{className:"form-item",children:[t.jsxs(m,{className:"form-item-label",children:[e,s&&t.jsx(Va,{})]}),t.jsxs(m,{className:"form-item-body",children:[t.jsx(m,{className:"form-item-input",children:q}),t.jsx(m,{className:"form-item-action",children:w?t.jsxs(t.Fragment,{children:[t.jsx(Le,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:n||g,size:"large",children:g?t.jsx(en,{size:24}):t.jsx(nr,{})}),t.jsx(Le,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(R),f(!1)},disabled:n||g,size:"large",children:t.jsx(Mn,{})})]}):t.jsx(Ya,{triggers:a,onEnterEdit:()=>f(!0),disabled:n})})]}),w&&d&&t.jsx(ar,{children:d})]})})}ln.propTypes={style:U.object,onSubmit:U.func,onChange:U.func,label:U.string,initialValue:U.string,required:U.bool,disabled:U.bool,triggers:U.array,options:U.array,helperText:U.string,formatterBeforeSubmit:U.func,placeholder:U.string,renderImage:U.func,filterKeys:U.arrayOf(U.string),noEmpty:U.bool,renderLabel:U.func};ln.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const Lr=_e.div`
1
+ import{aK as Re,aL as Oe,j as t,P as U,n as _e,dQ as pa,r as K,ba as ma,O as m,f8 as Mn,ez as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,gE as Ea,A as Y,M as Me,ad as _a,x as ss,fz as xa,m as Ft,gF as ya,at as Sa,aX as Te,aY as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bl as fe,bH as is,cd as Aa,f as xe,k as ze,bp as $t,bd as Ye,U as Ta,gG as Ca,g as et,cj as j,co as De,dv as me,a3 as Ra,gH as Ce,f9 as We,S as os,bb as tt,a9 as Oa,bI as wa,bJ as Ia,ax as Dn,b5 as La,b4 as cs,dM as Ae,d2 as rt,fP as He,gI as ja,gJ as Ma,gK as Da,aQ as ka,bu as Pa,bv as Ba,gL as Fa,gs as $a,bB as Ua,b6 as ls,a1 as Ut,bj as Kt,Q as Ka,eT as us,s as za,ff as Ie,Z as Ha,cQ as ds,E as Ga,G as vt}from"./index-DHvVD3rl.js";import{I as Wa}from"./iframe-CN6X1zkC.js";import{F as qa,R as Va,I as Ya,a as zt,L as Nt,b as Za,d as Ja}from"./line-h_bDsdkk.js";import{d as fs}from"./ChevronRight-C8sGT-T0.js";import{T as tn}from"./index-BXxemGex.js";import{B as gs}from"./bundle-avatar-6edO3WvW.js";import{u as Xa,B as Qa}from"./app-avatar-DQiSEUVG.js";import{i as er}from"./isEqual-BT0_AVZN.js";import{d as tr}from"./Loop-m_399M1H.js";import{d as nr}from"./Done-LyiBXZqg.js";import{a as kn,A as sr}from"./Autocomplete-DtvRC-0f.js";import{T as te,F as ar}from"./TextField-B9TZBqQf.js";import{e as rr}from"./mode-B2dWMeTO.js";import{C as ir,d as or}from"./Public-0DIMrFya.js";import{u as ge,b as nn}from"./team-Ch-Gj2hO.js";import{C as cr}from"./click-to-copy-DdhnSrH5.js";import{a as Ge}from"./index-BsRcoDUD.js";import{E as sn}from"./index-CmUhV6b0.js";import{u as ke,C as X}from"./index.esm-D5EJdopB.js";import{F as re}from"./Select-DXPyl9dO.js";import{d as lr}from"./Launch-BOea_wCy.js";import{d as ur}from"./EditIcon-CeWwrlQZ.js";import{d as dr}from"./Edit-BgU3t9-z.js";import{d as fr}from"./actions-Dunvsfuf.js";import{u as gr,a as pr,D as mr,H as hr}from"./index-CNEFxICJ.js";import{S as mt}from"./switch-control-DSzxDtfl.js";import{S as br}from"./Slider-Bs8PTrpt.js";import{D as Er}from"./index-CiB-ceGd.js";import{I as _r}from"./index-D6XxoBY_.js";import"./index-oxLMT1TZ.js";import"./ArrowDropDown-BUrSvBpJ.js";import"./ButtonGroup-DxRrpbFw.js";import"./getValidReactChildren-BhT8Dia7.js";import"./index-KnfQ44ac.js";import"./Delete-DHiwhVmP.js";import"./InputLabel-Csh1ynXt.js";import"./useLocalStorage-BOaGasKr.js";import"./MoreVert-BzXa-i1R.js";import"./url-evaluation-ceiaoY0M.js";import"./tag-BDr72C87.js";import"./redux-DYjmRPcE.js";import"./FilterList-usqmRCGh.js";import"./LastPage-DnsJsUIR.js";import"./Search-CQMDHt0w.js";var an={},xr=Oe;Object.defineProperty(an,"__esModule",{value:!0});var ps=an.default=void 0,yr=xr(Re()),Sr=t;ps=an.default=(0,yr.default)((0,Sr.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var rn={},vr=Oe;Object.defineProperty(rn,"__esModule",{value:!0});var ms=rn.default=void 0,Nr=vr(Re()),Ar=t;ms=rn.default=(0,Nr.default)((0,Ar.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var on={},Tr=Oe;Object.defineProperty(on,"__esModule",{value:!0});var hs=on.default=void 0,Cr=Tr(Re()),Rr=t;hs=on.default=(0,Cr.default)((0,Rr.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var cn={},Or=Oe;Object.defineProperty(cn,"__esModule",{value:!0});var bs=cn.default=void 0,wr=Or(Re()),Ir=t;bs=cn.default=(0,wr.default)((0,Ir.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");function ln({label:e,disabled:n,required:s,initialValue:r,onChange:u,style:c,onSubmit:i,triggers:a,options:o,formatterBeforeSubmit:l,helperText:d,placeholder:y,renderImage:b,renderLabel:h,filterKeys:v,noEmpty:A,...C}){const[w,f]=K.useState(!1),[g,S]=K.useState(!1),[p,x]=ma.useState(""),[R,D]=K.useState(r),[O,_]=K.useState(R),L=K.useMemo(()=>{if(!o)return{};const F={};return o.forEach(E=>{F[E.code]=E}),F},[o]),T=()=>{if(!o)return[];if(!p)return o.map(E=>E.code);const F=new RegExp(p.toLowerCase());return o.filter(E=>{var N;for(let k=0;k<v.length;k++){const z=v[k];if(F.test((N=E[z])==null?void 0:N.toLowerCase()))return!0}return!1}).map(E=>E.code)},M=async()=>{S(!0);try{await i(typeof l=="function"?l(O):O)===!1?_(R):A&&!O.length?(_(r),D(r)):(_(O),D(O))}catch{_(R)}finally{S(!1),f(!1)}},$=(F,E)=>{if(!Array.isArray(E)){_([]),u([]);return}const N=E.filter(k=>L[k]);if(!N.length){_([]),u([]);return}_(N),u(N)},q=w?t.jsx(sr,{options:o,value:O,onChange:$,inputValue:p,onInputChange:(F,E)=>{x(E)},PopperComponent:jr,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:T,getOptionLabel:F=>{var E;return(E=L[F])==null?void 0:E.name},renderInput:F=>t.jsx(te,{...F,label:"",placeholder:y}),renderOption:(F,E)=>{var k;const N=O.indexOf(E)!==-1;return K.createElement(Lr,{component:"li",...F,key:E},b(L[E]||{}),t.jsx(m,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:h(E,L[E])||((k=L[E])==null?void 0:k.name)}),t.jsx(m,{component:Mn,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...C}):t.jsx(m,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:O.filter(F=>o.some(E=>E.code===F)).map(F=>t.jsx(ns,{label:o.find(E=>E.code===F).name,style:{marginRight:8},size:"small"},F))});return t.jsx(qa,{className:"form",style:c,children:t.jsxs(m,{className:"form-item",children:[t.jsxs(m,{className:"form-item-label",children:[e,s&&t.jsx(Va,{})]}),t.jsxs(m,{className:"form-item-body",children:[t.jsx(m,{className:"form-item-input",children:q}),t.jsx(m,{className:"form-item-action",children:w?t.jsxs(t.Fragment,{children:[t.jsx(Le,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:n||g,size:"large",children:g?t.jsx(en,{size:24}):t.jsx(nr,{})}),t.jsx(Le,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(R),f(!1)},disabled:n||g,size:"large",children:t.jsx(Mn,{})})]}):t.jsx(Ya,{triggers:a,onEnterEdit:()=>f(!0),disabled:n})})]}),w&&d&&t.jsx(ar,{children:d})]})})}ln.propTypes={style:U.object,onSubmit:U.func,onChange:U.func,label:U.string,initialValue:U.string,required:U.bool,disabled:U.bool,triggers:U.array,options:U.array,helperText:U.string,formatterBeforeSubmit:U.func,placeholder:U.string,renderImage:U.func,filterKeys:U.arrayOf(U.string),noEmpty:U.bool,renderLabel:U.func};ln.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const Lr=_e.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{h7 as J,r as P,h8 as V,cm as x,f2 as $,h9 as S,ha as j,ck as B,hb as Q,di as U}from"./index-BJy0Aykg.js";var X=function(i,e){return i===void 0&&(i=[]),e===void 0&&(e=[]),J(i,e)},Y=function(i,e,r){var n=P.useRef(),t=P.useRef(0);X(e,n.current)||(n.current=e,t.current+=1),V(i,[t.current],r)},Z=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),D={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:Z?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},R={ctrl:function(i){return i.ctrlKey},shift:function(i){return i.shiftKey},alt:function(i){return i.altKey},meta:function(i){return i.type==="keyup"?D.meta.includes(i.keyCode):i.metaKey}};function G(i){return j(i)||B(i)}function p(i){var e=Object.keys(R).reduce(function(r,n){return R[n](i)?r+1:r},0);return[16,17,18,91,92].includes(i.keyCode)?e:e+1}function q(i,e,r){var n,t;if(!i.key)return!1;if(B(e))return i.keyCode===e?e:!1;var l=e.split("."),a=0;try{for(var f=S(l),o=f.next();!o.done;o=f.next()){var c=o.value,s=R[c],u=D[c.toLowerCase()];(s&&s(i)||u&&u===i.keyCode)&&a++}}catch(b){n={error:b}}finally{try{o&&!o.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}return r?a===l.length&&p(i)===l.length?e:!1:a===l.length?e:!1}function N(i,e){return Q(i)?i:G(i)?function(r){return q(r,i,e)}:Array.isArray(i)?function(r){return i.find(function(n){return q(r,n,e)})}:function(){return!!i}}var O=["keydown"];function _(i,e,r){var n=r||{},t=n.events,l=t===void 0?O:t,a=n.target,f=n.exactMatch,o=f===void 0?!1:f,c=n.useCapture,s=c===void 0?!1:c,u=x(e),b=x(i);Y(function(){var k,m,L,v=$(a,window);if(v){var T=function(g){var C,E=N(b.current,o),h=E(g),y=G(h)?h:g.key;if(h)return(C=u.current)===null||C===void 0?void 0:C.call(u,g,y)};try{for(var K=S(l),A=K.next();!A.done;A=K.next()){var H=A.value;(L=v==null?void 0:v.addEventListener)===null||L===void 0||L.call(v,H,T,s)}}catch(g){k={error:g}}finally{try{A&&!A.done&&(m=K.return)&&m.call(K)}finally{if(k)throw k.error}}return function(){var g,C,E;try{for(var h=S(l),y=h.next();!y.done;y=h.next()){var M=y.value;(E=v==null?void 0:v.removeEventListener)===null||E===void 0||E.call(v,M,T,s)}}catch(W){g={error:W}}finally{try{y&&!y.done&&(C=h.return)&&C.call(h)}finally{if(g)throw g.error}}}}},[l],a)}function d(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function z(i,e){for(var r="",n=0,t=-1,l=0,a,f=0;f<=i.length;++f){if(f<i.length)a=i.charCodeAt(f);else{if(a===47)break;a=47}if(a===47){if(!(t===f-1||l===1))if(t!==f-1&&l===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var o=r.lastIndexOf("/");if(o!==r.length-1){o===-1?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),t=f,l=0;continue}}else if(r.length===2||r.length===1){r="",n=0,t=f,l=0;continue}}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+i.slice(t+1,f):r=i.slice(t+1,f),n=f-t-1;t=f,l=0}else a===46&&l!==-1?++l:l=-1}return r}function I(i,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+i+n:n}var w={resolve:function(){for(var e="",r=!1,n,t=arguments.length-1;t>=-1&&!r;t--){var l;t>=0?l=arguments[t]:(n===void 0&&(n=U.cwd()),l=n),d(l),l.length!==0&&(e=l+"/"+e,r=l.charCodeAt(0)===47)}return e=z(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(d(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=z(e,!r),e.length===0&&!r&&(e="."),e.length>0&&n&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return d(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var n=arguments[r];d(n),n.length>0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":w.normalize(e)},relative:function(e,r){if(d(e),d(r),e===r||(e=w.resolve(e),r=w.resolve(r),e===r))return"";for(var n=1;n<e.length&&e.charCodeAt(n)===47;++n);for(var t=e.length,l=t-n,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var f=r.length,o=f-a,c=l<o?l:o,s=-1,u=0;u<=c;++u){if(u===c){if(o>c){if(r.charCodeAt(a+u)===47)return r.slice(a+u+1);if(u===0)return r.slice(a+u)}else l>c&&(e.charCodeAt(n+u)===47?s=u:u===0&&(s=0));break}var b=e.charCodeAt(n+u),k=r.charCodeAt(a+u);if(b!==k)break;b===47&&(s=u)}var m="";for(u=n+s+1;u<=t;++u)(u===t||e.charCodeAt(u)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(a+s):(a+=s,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(d(e),e.length===0)return".";for(var r=e.charCodeAt(0),n=r===47,t=-1,l=!0,a=e.length-1;a>=1;--a)if(r=e.charCodeAt(a),r===47){if(!l){t=a;break}}else l=!1;return t===-1?n?"/":".":n&&t===1?"//":e.slice(0,t)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');d(e);var n=0,t=-1,l=!0,a;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,o=-1;for(a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(c===47){if(!l){n=a+1;break}}else o===-1&&(l=!1,o=a+1),f>=0&&(c===r.charCodeAt(f)?--f===-1&&(t=a):(f=-1,t=o))}return n===t?t=o:t===-1&&(t=e.length),e.slice(n,t)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!l){n=a+1;break}}else t===-1&&(l=!1,t=a+1);return t===-1?"":e.slice(n,t)}},extname:function(e){d(e);for(var r=-1,n=0,t=-1,l=!0,a=0,f=e.length-1;f>=0;--f){var o=e.charCodeAt(f);if(o===47){if(!l){n=f+1;break}continue}t===-1&&(l=!1,t=f+1),o===46?r===-1?r=f:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||t===-1||a===0||a===1&&r===t-1&&r===n+1?"":e.slice(r,t)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return I("/",e)},parse:function(e){d(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),t=n===47,l;t?(r.root="/",l=1):l=0;for(var a=-1,f=0,o=-1,c=!0,s=e.length-1,u=0;s>=l;--s){if(n=e.charCodeAt(s),n===47){if(!c){f=s+1;break}continue}o===-1&&(c=!1,o=s+1),n===46?a===-1?a=s:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||o===-1||u===0||u===1&&a===o-1&&a===f+1?o!==-1&&(f===0&&t?r.base=r.name=e.slice(1,o):r.base=r.name=e.slice(f,o)):(f===0&&t?(r.name=e.slice(1,a),r.base=e.slice(1,o)):(r.name=e.slice(f,a),r.base=e.slice(f,o)),r.ext=e.slice(a,o)),f>0?r.dir=e.slice(0,f-1):t&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w;var ee=w;export{ee as p,_ as u};
1
+ import{h7 as J,r as P,h8 as V,cm as x,f2 as $,h9 as S,ha as j,ck as B,hb as Q,di as U}from"./index-DHvVD3rl.js";var X=function(i,e){return i===void 0&&(i=[]),e===void 0&&(e=[]),J(i,e)},Y=function(i,e,r){var n=P.useRef(),t=P.useRef(0);X(e,n.current)||(n.current=e,t.current+=1),V(i,[t.current],r)},Z=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),D={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:Z?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},R={ctrl:function(i){return i.ctrlKey},shift:function(i){return i.shiftKey},alt:function(i){return i.altKey},meta:function(i){return i.type==="keyup"?D.meta.includes(i.keyCode):i.metaKey}};function G(i){return j(i)||B(i)}function p(i){var e=Object.keys(R).reduce(function(r,n){return R[n](i)?r+1:r},0);return[16,17,18,91,92].includes(i.keyCode)?e:e+1}function q(i,e,r){var n,t;if(!i.key)return!1;if(B(e))return i.keyCode===e?e:!1;var l=e.split("."),a=0;try{for(var f=S(l),o=f.next();!o.done;o=f.next()){var c=o.value,s=R[c],u=D[c.toLowerCase()];(s&&s(i)||u&&u===i.keyCode)&&a++}}catch(b){n={error:b}}finally{try{o&&!o.done&&(t=f.return)&&t.call(f)}finally{if(n)throw n.error}}return r?a===l.length&&p(i)===l.length?e:!1:a===l.length?e:!1}function N(i,e){return Q(i)?i:G(i)?function(r){return q(r,i,e)}:Array.isArray(i)?function(r){return i.find(function(n){return q(r,n,e)})}:function(){return!!i}}var O=["keydown"];function _(i,e,r){var n=r||{},t=n.events,l=t===void 0?O:t,a=n.target,f=n.exactMatch,o=f===void 0?!1:f,c=n.useCapture,s=c===void 0?!1:c,u=x(e),b=x(i);Y(function(){var k,m,L,v=$(a,window);if(v){var T=function(g){var C,E=N(b.current,o),h=E(g),y=G(h)?h:g.key;if(h)return(C=u.current)===null||C===void 0?void 0:C.call(u,g,y)};try{for(var K=S(l),A=K.next();!A.done;A=K.next()){var H=A.value;(L=v==null?void 0:v.addEventListener)===null||L===void 0||L.call(v,H,T,s)}}catch(g){k={error:g}}finally{try{A&&!A.done&&(m=K.return)&&m.call(K)}finally{if(k)throw k.error}}return function(){var g,C,E;try{for(var h=S(l),y=h.next();!y.done;y=h.next()){var M=y.value;(E=v==null?void 0:v.removeEventListener)===null||E===void 0||E.call(v,M,T,s)}}catch(W){g={error:W}}finally{try{y&&!y.done&&(C=h.return)&&C.call(h)}finally{if(g)throw g.error}}}}},[l],a)}function d(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function z(i,e){for(var r="",n=0,t=-1,l=0,a,f=0;f<=i.length;++f){if(f<i.length)a=i.charCodeAt(f);else{if(a===47)break;a=47}if(a===47){if(!(t===f-1||l===1))if(t!==f-1&&l===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var o=r.lastIndexOf("/");if(o!==r.length-1){o===-1?(r="",n=0):(r=r.slice(0,o),n=r.length-1-r.lastIndexOf("/")),t=f,l=0;continue}}else if(r.length===2||r.length===1){r="",n=0,t=f,l=0;continue}}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+i.slice(t+1,f):r=i.slice(t+1,f),n=f-t-1;t=f,l=0}else a===46&&l!==-1?++l:l=-1}return r}function I(i,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+i+n:n}var w={resolve:function(){for(var e="",r=!1,n,t=arguments.length-1;t>=-1&&!r;t--){var l;t>=0?l=arguments[t]:(n===void 0&&(n=U.cwd()),l=n),d(l),l.length!==0&&(e=l+"/"+e,r=l.charCodeAt(0)===47)}return e=z(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(d(e),e.length===0)return".";var r=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=z(e,!r),e.length===0&&!r&&(e="."),e.length>0&&n&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return d(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var n=arguments[r];d(n),n.length>0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":w.normalize(e)},relative:function(e,r){if(d(e),d(r),e===r||(e=w.resolve(e),r=w.resolve(r),e===r))return"";for(var n=1;n<e.length&&e.charCodeAt(n)===47;++n);for(var t=e.length,l=t-n,a=1;a<r.length&&r.charCodeAt(a)===47;++a);for(var f=r.length,o=f-a,c=l<o?l:o,s=-1,u=0;u<=c;++u){if(u===c){if(o>c){if(r.charCodeAt(a+u)===47)return r.slice(a+u+1);if(u===0)return r.slice(a+u)}else l>c&&(e.charCodeAt(n+u)===47?s=u:u===0&&(s=0));break}var b=e.charCodeAt(n+u),k=r.charCodeAt(a+u);if(b!==k)break;b===47&&(s=u)}var m="";for(u=n+s+1;u<=t;++u)(u===t||e.charCodeAt(u)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(a+s):(a+=s,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(d(e),e.length===0)return".";for(var r=e.charCodeAt(0),n=r===47,t=-1,l=!0,a=e.length-1;a>=1;--a)if(r=e.charCodeAt(a),r===47){if(!l){t=a;break}}else l=!1;return t===-1?n?"/":".":n&&t===1?"//":e.slice(0,t)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');d(e);var n=0,t=-1,l=!0,a;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,o=-1;for(a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(c===47){if(!l){n=a+1;break}}else o===-1&&(l=!1,o=a+1),f>=0&&(c===r.charCodeAt(f)?--f===-1&&(t=a):(f=-1,t=o))}return n===t?t=o:t===-1&&(t=e.length),e.slice(n,t)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!l){n=a+1;break}}else t===-1&&(l=!1,t=a+1);return t===-1?"":e.slice(n,t)}},extname:function(e){d(e);for(var r=-1,n=0,t=-1,l=!0,a=0,f=e.length-1;f>=0;--f){var o=e.charCodeAt(f);if(o===47){if(!l){n=f+1;break}continue}t===-1&&(l=!1,t=f+1),o===46?r===-1?r=f:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||t===-1||a===0||a===1&&r===t-1&&r===n+1?"":e.slice(r,t)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return I("/",e)},parse:function(e){d(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var n=e.charCodeAt(0),t=n===47,l;t?(r.root="/",l=1):l=0;for(var a=-1,f=0,o=-1,c=!0,s=e.length-1,u=0;s>=l;--s){if(n=e.charCodeAt(s),n===47){if(!c){f=s+1;break}continue}o===-1&&(c=!1,o=s+1),n===46?a===-1?a=s:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||o===-1||u===0||u===1&&a===o-1&&a===f+1?o!==-1&&(f===0&&t?r.base=r.name=e.slice(1,o):r.base=r.name=e.slice(f,o)):(f===0&&t?(r.name=e.slice(1,a),r.base=e.slice(1,o)):(r.name=e.slice(f,a),r.base=e.slice(f,o)),r.ext=e.slice(a,o)),f>0?r.dir=e.slice(0,f-1):t&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w;var ee=w;export{ee as p,_ as u};