@abtnode/blocklet-services 1.16.44-beta-20250529-004636-15e80e20 → 1.16.44-beta-20250529-223630-10e16ac8

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 (78) hide show
  1. package/dist/assets/{access-control-eEjmzQYf.js → access-control-BhxOcGdx.js} +1 -1
  2. package/dist/assets/{add-component-core-pJP41zEE.js → add-component-core-XUReAzat.js} +1 -1
  3. package/dist/assets/{add-resource-CZeL421l.js → add-resource-C3kDcfBw.js} +1 -1
  4. package/dist/assets/{advanced-P0pT0XgG.js → advanced-hz-KSWn2.js} +1 -1
  5. package/dist/assets/{appearance-DeIbdwlo.js → appearance-ChvtVBNv.js} +1 -1
  6. package/dist/assets/{audit-logs-DdN0-QQr.js → audit-logs-DXoc97BV.js} +1 -1
  7. package/dist/assets/{authorize-C_rSdM9R.js → authorize-_fbQ19S4.js} +1 -1
  8. package/dist/assets/{branding-C6umqmKR.js → branding-DpkSF6dd.js} +2 -2
  9. package/dist/assets/{branding-HedBd6t0.js → branding-DuPWVNlC.js} +1 -1
  10. package/dist/assets/{bundle-avatar-B9he3Bf1.js → bundle-avatar-D4fwror8.js} +1 -1
  11. package/dist/assets/{complete-D7dveRTo.js → complete-C5D4D-fJ.js} +1 -1
  12. package/dist/assets/{component-cssFwqtY.js → component-CURpjZJ2.js} +1 -1
  13. package/dist/assets/{config-eQ2Et0RC.js → config-e36Xplpo.js} +1 -1
  14. package/dist/assets/config-navigation-BvjYZI_j.js +26 -0
  15. package/dist/assets/{config-space-CQ7Atb1l.js → config-space-EoSm62Er.js} +1 -1
  16. package/dist/assets/{confirm-Tue92P8p.js → confirm-Vzr2I9eM.js} +1 -1
  17. package/dist/assets/{connect-Cm-sTMiW.js → connect-B5Xr7MId.js} +1 -1
  18. package/dist/assets/{connect-PdQoyrqe.js → connect-DXOsnqkO.js} +1 -1
  19. package/dist/assets/{connect-to-FvVJBIsZ.js → connect-to-Bz9wYM04.js} +1 -1
  20. package/dist/assets/{dashboard-BhR1WNzF.js → dashboard-xUr1SbPS.js} +3 -3
  21. package/dist/assets/{delete-confirm-CHnQ2leb.js → delete-confirm-DNn4Os6R.js} +1 -1
  22. package/dist/assets/{domain-FY9-unAU.js → domain-XXgOrJDa.js} +1 -1
  23. package/dist/assets/{domain-action-card-Jvzi8kyL.js → domain-action-card-Cf1AoKOi.js} +1 -1
  24. package/dist/assets/{domains-CiBZW8yk.js → domains-DeFj6Ipl.js} +1 -1
  25. package/dist/assets/{email-z4l1k3Mi.js → email-BIVfXnpk.js} +1 -1
  26. package/dist/assets/{exchange-passport-DSoEjAA_.js → exchange-passport-C9Pvr9Da.js} +1 -1
  27. package/dist/assets/{fuel-CzrPInoR.js → fuel-Cs--pEYt.js} +1 -1
  28. package/dist/assets/{gen-access-key-BU2nGVgA.js → gen-access-key-CIzULsBE.js} +1 -1
  29. package/dist/assets/{index-D0F0qx_R.js → index-B7IOoVDF.js} +1 -1
  30. package/dist/assets/{index-C1XrZATd.js → index-BCJADuMw.js} +5 -5
  31. package/dist/assets/{index-NQMMaHuW.js → index-BU2FTGFr.js} +1 -1
  32. package/dist/assets/{index-C3le1atN.js → index-BoTgqYtV.js} +1 -1
  33. package/dist/assets/{index-5EytSaVA.js → index-C64IgZKt.js} +1 -1
  34. package/dist/assets/{index-D2a97Hdb.js → index-CsXmgylH.js} +3 -3
  35. package/dist/assets/{index-DutfRO7F.js → index-D-Lxloq5.js} +1 -1
  36. package/dist/assets/{index-P2m0RlAs.js → index-DBqLPDUh.js} +1 -1
  37. package/dist/assets/index-DDXNOodN.js +99 -0
  38. package/dist/assets/{index-B_NDUfon.js → index-DDoVX3je.js} +2 -2
  39. package/dist/assets/{index-hkk3GUEf.js → index-Drd9jydY.js} +1 -1
  40. package/dist/assets/{index-klBzz5vO.js → index-Dsd9SXVN.js} +1 -1
  41. package/dist/assets/index-DvBh35bh.js +1 -0
  42. package/dist/assets/{index-DrHUHp5S.js → index-U3mAyHwS.js} +1 -1
  43. package/dist/assets/{index-m831cH-_.js → index-W_fQ-nuf.js} +1 -1
  44. package/dist/assets/{index-ChHy6AQ7.js → index-wLX5GW2c.js} +1 -1
  45. package/dist/assets/{invitation-CGjIZ62g.js → invitation-Dsnc8lab.js} +1 -1
  46. package/dist/assets/{invite-CS_4jRwt.js → invite-CvAru4rZ.js} +1 -1
  47. package/dist/assets/{issue-passport-B6-OzJX7.js → issue-passport-CDE6vHUE.js} +1 -1
  48. package/dist/assets/{item-CuLwkmbx.js → item-rXnALS3b.js} +1 -1
  49. package/dist/assets/{layout-CNC_rrzE.js → layout-DYG0Wl7R.js} +1 -1
  50. package/dist/assets/{list-BTBbj1K4.js → list-DLMy1vVs.js} +1 -1
  51. package/dist/assets/list-b96sX5Y6.js +2 -0
  52. package/dist/assets/{log-29oTWiWO.js → log-Bwqh69bM.js} +1 -1
  53. package/dist/assets/{login-C52vMwpY.js → login-Ygmj8_J7.js} +1 -1
  54. package/dist/assets/{logo-uploader-Cir_HrSm.js → logo-uploader-CLwbDhA_.js} +2 -2
  55. package/dist/assets/{lost-passport-C2-kDXqq.js → lost-passport-CqzPSoLw.js} +1 -1
  56. package/dist/assets/{overview-BKOb0zVP.js → overview-DqabCKYi.js} +1 -1
  57. package/dist/assets/{passport-item-OEfv-Vh7.js → passport-item-C5-ZuTPM.js} +1 -1
  58. package/dist/assets/{publish-resource-DayX-x8-.js → publish-resource-ebKgw7OW.js} +1 -1
  59. package/dist/assets/{runtime-BbgMhX7n.js → runtime-B454s6Gb.js} +1 -1
  60. package/dist/assets/{security-DFHcsUZl.js → security-DCArL_za.js} +1 -1
  61. package/dist/assets/{setup-Do62jucF.js → setup-CX2pUl2y.js} +3 -3
  62. package/dist/assets/{start-B8F850CZ.js → start-Dhbx5j_D.js} +1 -1
  63. package/dist/assets/{status-D5JgbTyM.js → status-D4K-kiXO.js} +1 -1
  64. package/dist/assets/{step-actions-1pM57149.js → step-actions-CISMVGx2.js} +1 -1
  65. package/dist/assets/{traffic-Dvs1P0Re.js → traffic-BqHyn9L9.js} +1 -1
  66. package/dist/assets/{transfer-bax-fMxe.js → transfer-Bqv1gMqL.js} +1 -1
  67. package/dist/assets/{unsubscribe-DwUfpwja.js → unsubscribe-B3OLQIVA.js} +1 -1
  68. package/dist/assets/{use-blocklet-logo-BZU9LLmz.js → use-blocklet-logo-Bhkp-Zm7.js} +1 -1
  69. package/dist/assets/{user-center-DQ_Kc4sL.js → user-center-vIx28YXm.js} +1 -1
  70. package/dist/assets/{util-BiCOL9ao.js → util-Dnkhck-D.js} +1 -1
  71. package/dist/assets/{wrap-locale-0GIFYj8p.js → wrap-locale-C_UOH97U.js} +1 -1
  72. package/dist/index.html +1 -1
  73. package/dist/service-worker.js +1 -1
  74. package/package.json +21 -21
  75. package/dist/assets/config-navigation-0pU9J0da.js +0 -26
  76. package/dist/assets/index-DC3jOsuk.js +0 -99
  77. package/dist/assets/index-DQD2rqsI.js +0 -1
  78. package/dist/assets/list-BNMEncjS.js +0 -2
@@ -1,10 +1,10 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-Cm-sTMiW.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/useAsync-510ntT1B.js","assets/vendor-hooks-BgUTpb6X.js","assets/vendor-ux-did-connect-2jRoUb28.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-B_NDUfon.js","assets/vendor-arcblock-BlrkGjK9.js","assets/index-DOq-_YXu.css","assets/config-eQ2Et0RC.js","assets/index-ChHy6AQ7.js","assets/Done-BTd13H2U.js","assets/collapse-l9wHY9gJ.js","assets/Google-Bn3zPWiu.js","assets/cloneDeep-UpFQ2VNg.js","assets/logo-uploader-Cir_HrSm.js","assets/index-DVQCgvFb.js","assets/page-header-BWqvvXOk.js","assets/layout-CNC_rrzE.js","assets/content-layout-fV4nyVb5.js","assets/step-actions-1pM57149.js","assets/use-mobile-C21X4TYN.js","assets/button-_1HExv7r.js","assets/index-D0F0qx_R.js","assets/config-space-CQ7Atb1l.js","assets/spaces-DApg1wzn.js","assets/api-BjteVZFg.js","assets/connect-to-FvVJBIsZ.js","assets/index-8eXqqyHQ.js","assets/DeleteOutline-DpNyWtNL.js","assets/domain-FY9-unAU.js","assets/domain-action-card-Jvzi8kyL.js","assets/ExpandLess-t1cH-Bc4.js","assets/permission-DSHe73ba.js","assets/session-C_8V_o-O.js","assets/dot-itVN8XTt.js","assets/confirm-Tue92P8p.js","assets/actions-DP7pj6xB.js","assets/MoreHoriz-DpKn_fkc.js","assets/delete-confirm-CHnQ2leb.js","assets/click-to-copy-R7MF4AwY.js","assets/util-BiCOL9ao.js","assets/useSetState-CWq0AVWn.js","assets/InfoOutlined-D3XnF0Vg.js","assets/index-BUHyq-oP.js","assets/CheckCircle-Caqp5gKY.js","assets/access-control-eEjmzQYf.js","assets/config-Cd14MJHa.js","assets/fuel-CzrPInoR.js","assets/Launch-Dz9mQnYC.js","assets/did-address-Dq-4__HB.js","assets/complete-D7dveRTo.js","assets/launch-result-message-FuvJDCvp.js","assets/get-safe-url-Q70tRxL7.js","assets/starting-progress-BHUTOY2b.js","assets/addon-CRj4Enw7.js","assets/QuestionMarkCircle-DTGyWFVS.js","assets/use-server-logo-CxuMvwKh.js","assets/use-mobile-BAa0wi8o.js"])))=>i.map(i=>d[i]);
2
- import{a as $,aV as q,j as N,_ as m}from"./vendor-ux-did-connect-2jRoUb28.js";import{j as e,a7 as X,ah as U,e as G,bD as J,aa as Y,ab as ee,b6 as te}from"./vendor-mui-core-BV2FUxWJ.js";import{r as i,h as se,f as ae,i as ne,j as h,k as oe}from"./vendor-react-DEoibe3W.js";import{B as re,z as ie,A as n,_ as le,ad as ce}from"./vendor-utils-rHXShPKm.js";import{C as pe}from"./config-space-CQ7Atb1l.js";import{H as ue}from"./addon-CRj4Enw7.js";import{S as de,L as he,c as S}from"./vendor-arcblock-BlrkGjK9.js";import{r as me,k as fe,u as _e,t as g,v as Le,w as xe,x as V,N as Ce,f as ge,S as Ee}from"./index-B_NDUfon.js";import{g as ye}from"./get-safe-url-Q70tRxL7.js";import{y as ve}from"./vendor-hooks-BgUTpb6X.js";import{u as Pe}from"./use-server-logo-CxuMvwKh.js";const Se=s=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{d:"M4.00572 31C3.25866 31 2.53839 30.7217 1.98537 30.2194C1.43235 29.7171 1.08623 29.0269 1.01451 28.2833L1.00049 27.9948V5.95637C1.00052 5.2093 1.27881 4.48903 1.78109 3.93601C2.28336 3.38299 2.9736 3.03688 3.71722 2.96516L4.00572 2.95113H13.0214C13.7682 2.95112 14.4882 3.22913 15.0412 3.73099C15.5941 4.23285 15.9405 4.92261 16.0126 5.66586L16.0267 5.95637V6.46526L20.4123 1.91934C20.9292 1.38325 21.6267 1.05817 22.3696 1.00708C23.1125 0.956001 23.8479 1.18256 24.4333 1.64285L24.6657 1.84521L30.1893 7.30472C30.7197 7.82899 31.0362 8.53173 31.0773 9.27635C31.1184 10.021 30.8812 10.7543 30.4117 11.3337L30.2054 11.5661L25.5753 15.9738H26.0441C26.7909 15.9738 27.5109 16.2518 28.0639 16.7537C28.6168 17.2555 28.9631 17.9453 29.0353 18.6886L29.0494 18.9791V27.9948C29.0494 28.7415 28.7714 29.4615 28.2695 30.0145C27.7676 30.5675 27.0779 30.9138 26.3346 30.986L26.0441 31H4.00572ZM14.0232 17.9773H3.00398V27.9948C3.00388 28.1993 3.06641 28.399 3.18317 28.567C3.29993 28.735 3.46533 28.8632 3.65712 28.9344L3.82541 28.9805L4.00572 28.9965H14.0232V17.9773ZM26.0441 17.9773H16.0267V28.9965H26.0441C26.2786 28.9966 26.5056 28.9144 26.6858 28.7643C26.8659 28.6142 26.9876 28.4057 27.0298 28.1751L27.0459 27.9948V18.9791C27.0459 18.7446 26.9638 18.5175 26.8137 18.3374C26.6636 18.1573 26.4551 18.0355 26.2244 17.9933L26.0441 17.9773ZM16.0267 12.3876V15.9738H19.6129L16.0267 12.3876ZM13.0214 4.95462H4.00572C3.77126 4.95455 3.5442 5.03671 3.36409 5.18681C3.18397 5.3369 3.06221 5.54542 3.02001 5.77605L3.00398 5.95637V15.9738H14.0232V5.95637C14.0233 5.75179 13.9607 5.55209 13.844 5.38411C13.7272 5.21613 13.5618 5.08792 13.37 5.01673L13.2017 4.97065L13.0214 4.95462ZM23.2833 3.29774C23.1148 3.13081 22.8929 3.02865 22.6565 3.00922C22.4202 2.9898 22.1845 3.05436 21.9911 3.19155L21.8548 3.31176L16.6137 8.74723C16.4555 8.91127 16.358 9.12433 16.3373 9.35125C16.3165 9.57817 16.3737 9.80539 16.4995 9.99541L16.6257 10.1517L21.8668 15.3908C22.0273 15.5515 22.2377 15.653 22.4634 15.6785C22.6891 15.7039 22.9167 15.652 23.109 15.531L23.2653 15.4088L28.7909 10.1457C28.9556 9.97892 29.0567 9.7597 29.0764 9.52614C29.0962 9.29259 29.0334 9.0595 28.8991 8.86744L28.7809 8.7292L23.2833 3.29774Z"})),O="https://launcher.arcblock.io",je=s=>{if(!s)return O;const{protocol:t,host:f}=le(ce(s));return`${t}//${f}`},we=s=>s?{"__did-connect__":re.from(JSON.stringify({switchBehavior:"auto",forceConnected:s,showClose:!1}),"utf8").toString("base64")}:{};function Re(s,t=O,f=""){const{t:_}=$(),E=we(f),{loading:u,value:p,error:a,retry:l}=ve(async()=>{if(s!=="serverless")return null;const y=je(t),L=await me(y),v=ie(n(L,"/u/apps"),E);return{text:_("launchBlocklet.nav.myApps"),appText:_("launchBlocklet.nav.viewMyApps"),link:v,buttonProps:{sx:{fontSize:"1rem"}},icon:e.jsx(X,{component:Se,fontSize:"small",viewBox:"0 0 32 32"})}},[s,t,f,_]);return s!=="serverless"||p===null?{}:u?{loading:!0}:a?{error:a,retry:l}:p||{}}const Ae=U.span`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-B5Xr7MId.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/useAsync-510ntT1B.js","assets/vendor-hooks-BgUTpb6X.js","assets/vendor-ux-did-connect-2jRoUb28.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-DDoVX3je.js","assets/vendor-arcblock-BlrkGjK9.js","assets/index-DOq-_YXu.css","assets/config-e36Xplpo.js","assets/index-wLX5GW2c.js","assets/Done-BTd13H2U.js","assets/collapse-l9wHY9gJ.js","assets/Google-Bn3zPWiu.js","assets/cloneDeep-UpFQ2VNg.js","assets/logo-uploader-CLwbDhA_.js","assets/index-DVQCgvFb.js","assets/page-header-BWqvvXOk.js","assets/layout-DYG0Wl7R.js","assets/content-layout-fV4nyVb5.js","assets/step-actions-CISMVGx2.js","assets/use-mobile-C21X4TYN.js","assets/button-_1HExv7r.js","assets/index-B7IOoVDF.js","assets/config-space-EoSm62Er.js","assets/spaces-DApg1wzn.js","assets/api-BjteVZFg.js","assets/connect-to-Bz9wYM04.js","assets/index-8eXqqyHQ.js","assets/DeleteOutline-DpNyWtNL.js","assets/domain-XXgOrJDa.js","assets/domain-action-card-Cf1AoKOi.js","assets/ExpandLess-t1cH-Bc4.js","assets/permission-DSHe73ba.js","assets/session-C_8V_o-O.js","assets/dot-itVN8XTt.js","assets/confirm-Vzr2I9eM.js","assets/actions-DP7pj6xB.js","assets/MoreHoriz-DpKn_fkc.js","assets/delete-confirm-DNn4Os6R.js","assets/click-to-copy-R7MF4AwY.js","assets/util-Dnkhck-D.js","assets/useSetState-CWq0AVWn.js","assets/InfoOutlined-D3XnF0Vg.js","assets/index-BUHyq-oP.js","assets/CheckCircle-Caqp5gKY.js","assets/access-control-BhxOcGdx.js","assets/config-Cd14MJHa.js","assets/fuel-Cs--pEYt.js","assets/Launch-Dz9mQnYC.js","assets/did-address-Dq-4__HB.js","assets/complete-C5D4D-fJ.js","assets/launch-result-message-FuvJDCvp.js","assets/get-safe-url-Q70tRxL7.js","assets/starting-progress-BHUTOY2b.js","assets/addon-CRj4Enw7.js","assets/QuestionMarkCircle-DTGyWFVS.js","assets/use-server-logo-CxuMvwKh.js","assets/use-mobile-BAa0wi8o.js"])))=>i.map(i=>d[i]);
2
+ import{a as $,aV as q,j as N,_ as m}from"./vendor-ux-did-connect-2jRoUb28.js";import{j as e,a7 as X,ah as U,e as G,bD as J,aa as Y,ab as ee,b6 as te}from"./vendor-mui-core-BV2FUxWJ.js";import{r as i,h as se,f as ae,i as ne,j as h,k as oe}from"./vendor-react-DEoibe3W.js";import{B as re,z as ie,A as n,_ as le,ad as ce}from"./vendor-utils-rHXShPKm.js";import{C as pe}from"./config-space-EoSm62Er.js";import{H as ue}from"./addon-CRj4Enw7.js";import{S as de,L as he,c as S}from"./vendor-arcblock-BlrkGjK9.js";import{r as me,k as fe,u as _e,t as g,v as Le,w as xe,x as V,N as Ce,f as ge,S as Ee}from"./index-DDoVX3je.js";import{g as ye}from"./get-safe-url-Q70tRxL7.js";import{y as ve}from"./vendor-hooks-BgUTpb6X.js";import{u as Pe}from"./use-server-logo-CxuMvwKh.js";const Se=s=>i.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{d:"M4.00572 31C3.25866 31 2.53839 30.7217 1.98537 30.2194C1.43235 29.7171 1.08623 29.0269 1.01451 28.2833L1.00049 27.9948V5.95637C1.00052 5.2093 1.27881 4.48903 1.78109 3.93601C2.28336 3.38299 2.9736 3.03688 3.71722 2.96516L4.00572 2.95113H13.0214C13.7682 2.95112 14.4882 3.22913 15.0412 3.73099C15.5941 4.23285 15.9405 4.92261 16.0126 5.66586L16.0267 5.95637V6.46526L20.4123 1.91934C20.9292 1.38325 21.6267 1.05817 22.3696 1.00708C23.1125 0.956001 23.8479 1.18256 24.4333 1.64285L24.6657 1.84521L30.1893 7.30472C30.7197 7.82899 31.0362 8.53173 31.0773 9.27635C31.1184 10.021 30.8812 10.7543 30.4117 11.3337L30.2054 11.5661L25.5753 15.9738H26.0441C26.7909 15.9738 27.5109 16.2518 28.0639 16.7537C28.6168 17.2555 28.9631 17.9453 29.0353 18.6886L29.0494 18.9791V27.9948C29.0494 28.7415 28.7714 29.4615 28.2695 30.0145C27.7676 30.5675 27.0779 30.9138 26.3346 30.986L26.0441 31H4.00572ZM14.0232 17.9773H3.00398V27.9948C3.00388 28.1993 3.06641 28.399 3.18317 28.567C3.29993 28.735 3.46533 28.8632 3.65712 28.9344L3.82541 28.9805L4.00572 28.9965H14.0232V17.9773ZM26.0441 17.9773H16.0267V28.9965H26.0441C26.2786 28.9966 26.5056 28.9144 26.6858 28.7643C26.8659 28.6142 26.9876 28.4057 27.0298 28.1751L27.0459 27.9948V18.9791C27.0459 18.7446 26.9638 18.5175 26.8137 18.3374C26.6636 18.1573 26.4551 18.0355 26.2244 17.9933L26.0441 17.9773ZM16.0267 12.3876V15.9738H19.6129L16.0267 12.3876ZM13.0214 4.95462H4.00572C3.77126 4.95455 3.5442 5.03671 3.36409 5.18681C3.18397 5.3369 3.06221 5.54542 3.02001 5.77605L3.00398 5.95637V15.9738H14.0232V5.95637C14.0233 5.75179 13.9607 5.55209 13.844 5.38411C13.7272 5.21613 13.5618 5.08792 13.37 5.01673L13.2017 4.97065L13.0214 4.95462ZM23.2833 3.29774C23.1148 3.13081 22.8929 3.02865 22.6565 3.00922C22.4202 2.9898 22.1845 3.05436 21.9911 3.19155L21.8548 3.31176L16.6137 8.74723C16.4555 8.91127 16.358 9.12433 16.3373 9.35125C16.3165 9.57817 16.3737 9.80539 16.4995 9.99541L16.6257 10.1517L21.8668 15.3908C22.0273 15.5515 22.2377 15.653 22.4634 15.6785C22.6891 15.7039 22.9167 15.652 23.109 15.531L23.2653 15.4088L28.7909 10.1457C28.9556 9.97892 29.0567 9.7597 29.0764 9.52614C29.0962 9.29259 29.0334 9.0595 28.8991 8.86744L28.7809 8.7292L23.2833 3.29774Z"})),O="https://launcher.arcblock.io",je=s=>{if(!s)return O;const{protocol:t,host:f}=le(ce(s));return`${t}//${f}`},we=s=>s?{"__did-connect__":re.from(JSON.stringify({switchBehavior:"auto",forceConnected:s,showClose:!1}),"utf8").toString("base64")}:{};function Re(s,t=O,f=""){const{t:_}=$(),E=we(f),{loading:u,value:p,error:a,retry:l}=ve(async()=>{if(s!=="serverless")return null;const y=je(t),L=await me(y),v=ie(n(L,"/u/apps"),E);return{text:_("launchBlocklet.nav.myApps"),appText:_("launchBlocklet.nav.viewMyApps"),link:v,buttonProps:{sx:{fontSize:"1rem"}},icon:e.jsx(X,{component:Se,fontSize:"small",viewBox:"0 0 32 32"})}},[s,t,f,_]);return s!=="serverless"||p===null?{}:u?{loading:!0}:a?{error:a,retry:l}:p||{}}const Ae=U.span`
3
3
  color: ${s=>s.theme.palette.error.main};
4
4
  &::before {
5
5
  content: '*';
6
6
  }
7
- `,j=Ae,Ie=i.lazy(()=>m(()=>import("./connect-Cm-sTMiW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ke=i.lazy(()=>m(()=>import("./config-eQ2Et0RC.js"),__vite__mapDeps([12,1,2,3,6,5,7,8,13,14,15,16,17,9,10,11,18,19,20,21,22,23,24,25]))),Te=i.lazy(()=>m(()=>import("./index-D0F0qx_R.js"),__vite__mapDeps([26,1,2,6,3,5,7,8,20,9,10,11,27,28,29,30,31,32,23,24,21,22]))),Be=i.lazy(()=>m(()=>import("./domain-FY9-unAU.js"),__vite__mapDeps([33,1,2,9,6,3,5,7,8,10,11,34,35,36,37,38,4,39,31,40,41,42,43,44,45,46,47,48,20,25,21,22,23,24]))),Ne=i.lazy(()=>m(()=>import("./access-control-eEjmzQYf.js"),__vite__mapDeps([49,1,2,6,3,5,7,8,50,20,9,10,11,21,22,23,24,25]))),Ve=i.lazy(()=>m(()=>import("./fuel-CzrPInoR.js"),__vite__mapDeps([51,1,2,3,52,6,5,7,8,53,20,9,10,11,21,22,23,24,25]))),$e=i.lazy(()=>m(()=>import("./complete-D7dveRTo.js"),__vite__mapDeps([54,1,2,6,3,5,7,8,9,10,11,55,56,25,21,22,57,27,28,29,58,59,60,61])));function Ue(){var k,T,B;const s=G(),{t,locale:f}=$(),[_,E]=se(),u=ae(),{meta:p,blocklet:a,actions:l,loading:y,launcherSession:L}=fe(),v=localStorage.getItem("blocklet-server-url"),{session:w}=_e(),b=Pe({onClick:()=>{window.open(ye(v,{allowDomains:null}))}}),H=g("fromLauncher"),D=g("launcherUrl"),M=g("launchType"),R=g("visitorId"),z=Re(M,D,L==null?void 0:L.userDid);R&&(q(R),_.delete("visitorId"),E(_)),i.useEffect(()=>{Le(),w.user&&(l==null||l.refreshMeta(),l==null||l.refreshBlocklet({showError:!1}))},[w.user]),i.useEffect(()=>{l.refreshFuel({showError:!1})},[(k=a==null?void 0:a.meta)==null?void 0:k.did]);const o=`${N.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,F=c=>{var C;const r=(C=c==null?void 0:c.capabilities)==null?void 0:C.didSpace;return r?r===S.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||r===S.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[t("setup.steps.didSpace")," ",e.jsx(j,{})]}),path:n(o,"did-space")}:r===S.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:t("setup.steps.didSpace")}),path:n(o,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${r}`),null):null},d=[{key:"access",name:t("setup.steps.access"),path:n(o,"access")},{key:"domain",name:t("setup.domain.title"),path:n(o,"domain")},F(a),{key:"config",name:e.jsxs(e.Fragment,{children:[t("setup.steps.config")," ",xe(p)&&e.jsx(j,{})]}),path:n(o,"config")},(B=(T=p==null?void 0:p.requirements)==null?void 0:T.fuels)!=null&&B.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[t("setup.steps.fuel")," ",e.jsx(j,{})]}),path:n(o,"fuel")}:null].filter(Boolean),P=d.findIndex(c=>`${V.replace(/\/$/,"")}${o}/${c.key}`===window.location.pathname),Q=n(V,N.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${a==null?void 0:a.updatedAt}`),W=async c=>{const{search:r}=new URL(window.location.href);if(!c)d[P+1]?u(`${n(o,d[P+1].key)}${r}`):u(`${n(o,"complete")}${r}`);else{const C=d.findIndex(K=>K.key===c);C>-1?u(`${n(o,d[C].key)}${r}`):u(`${n(o,"complete")}${r}`)}await l.refreshBlocklet()},Z=()=>{u(-1)};function x(c,r){return e.jsxs(Ie,{children:[!a&&e.jsx(Y,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(ee,{})}),a&&e.jsx(c,{blocklet:a,...r,onNext:W,onPrevious:Z,buttonText:P===d.length-1?t("setup.startNow"):""})]})}const A=[{key:"install",name:t("launchBlocklet.steps.installApp"),path:n(o,"install")},{key:"setup",name:t("setup.steps.launchApp"),children:d}];let I=[{key:"agreement",name:t("launchBlocklet.introduction"),path:n(o,"agreement")},...A];return H&&(I=[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...A]),e.jsx(de,{steps:I,children:e.jsx(Ce,{children:e.jsxs(pe,{children:[e.jsx(J,{styles:Oe}),e.jsx(be,{children:e.jsx(he,{locale:f,loading:y,blockletMeta:{...p,title:ge.getDisplayName({...a,meta:p})},navLogo:b,pcWidth:"80%",style:{height:"100%"},logoUrl:Q,useOfSkeleton:!1,extraNav:z,headerEndAddons:e.jsx(ue,{SessionContext:Ee,sessionManagerProps:{disableLogout:!0}}),theme:s,launchingText:t("setup.title"),children:e.jsxs(ne,{children:[e.jsx(h,{path:"access",element:x(Ne)}),e.jsx(h,{path:"domain",element:x(Be)}),e.jsx(h,{path:"did-space",element:x(Te)}),e.jsx(h,{path:"config",element:x(ke)}),e.jsx(h,{path:"fuel",element:x(Ve)}),e.jsx(h,{path:"complete",element:x($e,{launcherSession:L})}),e.jsx(h,{path:"*",element:e.jsx(oe,{to:`access${window.location.search}`,replace:!0})})]})})})]})})})}const Oe=te`
7
+ `,j=Ae,Ie=i.lazy(()=>m(()=>import("./connect-B5Xr7MId.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),ke=i.lazy(()=>m(()=>import("./config-e36Xplpo.js"),__vite__mapDeps([12,1,2,3,6,5,7,8,13,14,15,16,17,9,10,11,18,19,20,21,22,23,24,25]))),Te=i.lazy(()=>m(()=>import("./index-B7IOoVDF.js"),__vite__mapDeps([26,1,2,6,3,5,7,8,20,9,10,11,27,28,29,30,31,32,23,24,21,22]))),Be=i.lazy(()=>m(()=>import("./domain-XXgOrJDa.js"),__vite__mapDeps([33,1,2,9,6,3,5,7,8,10,11,34,35,36,37,38,4,39,31,40,41,42,43,44,45,46,47,48,20,25,21,22,23,24]))),Ne=i.lazy(()=>m(()=>import("./access-control-BhxOcGdx.js"),__vite__mapDeps([49,1,2,6,3,5,7,8,50,20,9,10,11,21,22,23,24,25]))),Ve=i.lazy(()=>m(()=>import("./fuel-Cs--pEYt.js"),__vite__mapDeps([51,1,2,3,52,6,5,7,8,53,20,9,10,11,21,22,23,24,25]))),$e=i.lazy(()=>m(()=>import("./complete-C5D4D-fJ.js"),__vite__mapDeps([54,1,2,6,3,5,7,8,9,10,11,55,56,25,21,22,57,27,28,29,58,59,60,61])));function Ue(){var k,T,B;const s=G(),{t,locale:f}=$(),[_,E]=se(),u=ae(),{meta:p,blocklet:a,actions:l,loading:y,launcherSession:L}=fe(),v=localStorage.getItem("blocklet-server-url"),{session:w}=_e(),b=Pe({onClick:()=>{window.open(ye(v,{allowDomains:null}))}}),H=g("fromLauncher"),D=g("launcherUrl"),M=g("launchType"),R=g("visitorId"),z=Re(M,D,L==null?void 0:L.userDid);R&&(q(R),_.delete("visitorId"),E(_)),i.useEffect(()=>{Le(),w.user&&(l==null||l.refreshMeta(),l==null||l.refreshBlocklet({showError:!1}))},[w.user]),i.useEffect(()=>{l.refreshFuel({showError:!1})},[(k=a==null?void 0:a.meta)==null?void 0:k.did]);const o=`${N.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,F=c=>{var C;const r=(C=c==null?void 0:c.capabilities)==null?void 0:C.didSpace;return r?r===S.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||r===S.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[t("setup.steps.didSpace")," ",e.jsx(j,{})]}),path:n(o,"did-space")}:r===S.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:t("setup.steps.didSpace")}),path:n(o,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${r}`),null):null},d=[{key:"access",name:t("setup.steps.access"),path:n(o,"access")},{key:"domain",name:t("setup.domain.title"),path:n(o,"domain")},F(a),{key:"config",name:e.jsxs(e.Fragment,{children:[t("setup.steps.config")," ",xe(p)&&e.jsx(j,{})]}),path:n(o,"config")},(B=(T=p==null?void 0:p.requirements)==null?void 0:T.fuels)!=null&&B.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[t("setup.steps.fuel")," ",e.jsx(j,{})]}),path:n(o,"fuel")}:null].filter(Boolean),P=d.findIndex(c=>`${V.replace(/\/$/,"")}${o}/${c.key}`===window.location.pathname),Q=n(V,N.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${a==null?void 0:a.updatedAt}`),W=async c=>{const{search:r}=new URL(window.location.href);if(!c)d[P+1]?u(`${n(o,d[P+1].key)}${r}`):u(`${n(o,"complete")}${r}`);else{const C=d.findIndex(K=>K.key===c);C>-1?u(`${n(o,d[C].key)}${r}`):u(`${n(o,"complete")}${r}`)}await l.refreshBlocklet()},Z=()=>{u(-1)};function x(c,r){return e.jsxs(Ie,{children:[!a&&e.jsx(Y,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(ee,{})}),a&&e.jsx(c,{blocklet:a,...r,onNext:W,onPrevious:Z,buttonText:P===d.length-1?t("setup.startNow"):""})]})}const A=[{key:"install",name:t("launchBlocklet.steps.installApp"),path:n(o,"install")},{key:"setup",name:t("setup.steps.launchApp"),children:d}];let I=[{key:"agreement",name:t("launchBlocklet.introduction"),path:n(o,"agreement")},...A];return H&&(I=[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")},...A]),e.jsx(de,{steps:I,children:e.jsx(Ce,{children:e.jsxs(pe,{children:[e.jsx(J,{styles:Oe}),e.jsx(be,{children:e.jsx(he,{locale:f,loading:y,blockletMeta:{...p,title:ge.getDisplayName({...a,meta:p})},navLogo:b,pcWidth:"80%",style:{height:"100%"},logoUrl:Q,useOfSkeleton:!1,extraNav:z,headerEndAddons:e.jsx(ue,{SessionContext:Ee,sessionManagerProps:{disableLogout:!0}}),theme:s,launchingText:t("setup.title"),children:e.jsxs(ne,{children:[e.jsx(h,{path:"access",element:x(Ne)}),e.jsx(h,{path:"domain",element:x(Be)}),e.jsx(h,{path:"did-space",element:x(Te)}),e.jsx(h,{path:"config",element:x(ke)}),e.jsx(h,{path:"fuel",element:x(Ve)}),e.jsx(h,{path:"complete",element:x($e,{launcherSession:L})}),e.jsx(h,{path:"*",element:e.jsx(oe,{to:`access${window.location.search}`,replace:!0})})]})})})]})})})}const Oe=te`
8
8
  html,
9
9
  body,
10
10
  #app,
@@ -1,4 +1,4 @@
1
- import{j as t,ab as G,bD as X,aa as p,v as Q,H as v,be as J,b6 as Y,ah as S,w as Z}from"./vendor-mui-core-BV2FUxWJ.js";import{r as g,L as H}from"./vendor-react-DEoibe3W.js";import{x as ee,f as E}from"./vendor-hooks-BgUTpb6X.js";import{A as L}from"./vendor-utils-rHXShPKm.js";import{d as te}from"./PlayArrow-CDOOUxMp.js";import{d as re}from"./Error-DEKvwVoF.js";import{a as F,a0 as z,C as oe,j as A,R as ne,B as R,$ as se,z as ie}from"./vendor-ux-did-connect-2jRoUb28.js";import{W as ae}from"./did-address-Dq-4__HB.js";import{d as D,e as W,g as le,f as U,h as de,j as T,S as ce,u as pe,k as me,l as he,m as ue,P as ge,O as fe,n as I,o as xe,q as B}from"./index-B_NDUfon.js";import{H as be}from"./addon-CRj4Enw7.js";import{u as ke}from"./use-server-logo-CxuMvwKh.js";import{g as M}from"./get-safe-url-Q70tRxL7.js";import{b as je}from"./vendor-arcblock-BlrkGjK9.js";import{p as ye,S as we,P as ve}from"./starting-progress-BHUTOY2b.js";import"./lottie-web-jYmAQWuC.js";import"./QuestionMarkCircle-DTGyWFVS.js";import"./use-mobile-BAa0wi8o.js";function K({appInfo:e,...o}){const[r,i]=g.useState(!1),d=Q(f=>f.breakpoints.down("md"))?32:48;return r?t.jsx(se,{did:e.publisher,size:d}):t.jsx(ie,{src:e.icon,alt:e.title,width:d,height:d,...o,onError:()=>i(!0)})}K.propTypes={appInfo:v.object.isRequired};const q=(e,o)=>U.findComponentByIdV2(e,o)||e;function Ke(){var w,N,k;const{t:e,locale:o}=F(),[r,i]=ee({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:"",restart:!1}),l=localStorage.getItem("blocklet-server-url"),d=ke({onClick:()=>{l&&window.open(M(l,{allowDomains:null}))}}),f=new URL(window.location.href),P=f.searchParams.get("componentId"),_=()=>{const s=f.searchParams.get("redirect")||"/";window.location.href=M(decodeURIComponent(s))},x=()=>{const s=setInterval(()=>{D.get("/blocklet/detail?nocache=1").then(({data:n})=>{i(u=>({...u,blocklet:n}));const a=q(n,P);if(a.status==="running"){_();return}a.status!=="starting"&&!r.restart&&(i({blocklet:n,starting:!1}),n!==a&&i({component:a}),clearInterval(s))}).catch(n=>{i({loading:!1,restart:!1}),z.error(n.message)})},3e3)},j=()=>{i({restart:!0,starting:!0,loading:!0}),setTimeout(()=>{x()},10)};g.useEffect(()=>{i({loading:!0}),D.get("/blocklet/detail?nocache=1").then(({data:s})=>{const n=q(s,P);if(i({blocklet:s,loading:!1}),n.status==="running"){_();return}i({blocklet:s}),s!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),x())}).catch(s=>{i({loading:!1}),z.error(s.message)})},[]);const C=g.useCallback(()=>{i({loading:!0,starting:!0});const s=r.blocklet;if(!s)return;const n={did:s==null?void 0:s.meta.did};s.children.length>0&&(n.componentDids=s.children.map(a=>a.meta.did)),W.startBlocklet({input:n}).then(({blocklet:a})=>{i(u=>({...u,blocklet:a})),x()}).catch(a=>{z.error(a.message),i({loading:!1,starting:!1})})},[r.component,r.blocklet]);g.useEffect(()=>{var s;(s=r.blocklet)!=null&&s.controller&&(le({launcherUrl:r.blocklet.controller.launcherUrl,launcherSessionId:r.blocklet.controller.launcherSessionId,locale:o}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),W.getLauncherSession({input:{launcherSessionId:r.blocklet.controller.launcherSessionId,launcherUrl:r.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession})}).catch(n=>{console.error("get launcher session error",n)}))},[(w=r.blocklet)==null?void 0:w.controller]);const b=E(()=>{var s,n;return(n=(s=r.blocklet)==null?void 0:s.children)==null?void 0:n.length},[r.blocklet]),c=E(()=>{var s,n,a;return((a=(n=(s=r.blocklet)==null?void 0:s.children)==null?void 0:n.filter(u=>u.status==="running"))==null?void 0:a.length)||0},[r.blocklet]),m=E(()=>b?c?Math.round(Math.max(c/b,.15)*100):5:0,[c,b]);if(!r.blocklet)return t.jsx(oe,{children:t.jsx(G,{})});const h={icon:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:U.getDisplayName(r.blocklet),publisher:r.blocklet.appDid},$=ne(ye,r.starting?{width:`${m}%`,"&::after":{width:`${m}%`},"&::before":{width:`${m}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${m}%`}}}}:{}),y=de(r.blocklet)||T(r.launcherSession);return t.jsxs(_e,{children:[t.jsx(X,{styles:Pe}),t.jsxs("header",{className:"root-header",children:[t.jsx("div",{className:"left",children:d}),t.jsx(je,{children:t.jsx(be,{SessionContext:ce})})]}),t.jsxs(Ce,{elevation:0,children:[t.jsxs($e,{children:[t.jsx(K,{appInfo:h}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(p,{className:"app-info_name",children:h.title}),t.jsx(ae,{size:14,className:"app-info_did",did:h.publisher})]})]}),(r.restart||!y)&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{className:"title-box",children:[t.jsx(p,{className:"icon",children:t.jsx(te,{})}),t.jsx(p,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(p,{className:"sub-title",children:r.starting?t.jsx(we,{blocklets:((N=r.blocklet)==null?void 0:N.children)??[]}):e("blocklet.startDescription",{name:r.component?U.getDisplayName(r.component,!0):U.getDisplayName(r.blocklet)})}),t.jsx(p,{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:t.jsx(ve,{blocklets:((k=r.blocklet)==null?void 0:k.children)??[],status:r.starting?"starting":"",children:t.jsx(R,{sx:$,disabled:r.loading||r.starting,variant:"contained",color:"primary",size:"large",loading:r.starting,onClick:()=>C(),children:t.jsx("span",{style:{position:"relative",zIndex:2},children:r.starting?`(${c}/${b}) ${e("blocklet.starting")}`:e("blocklet.start")})})})})]}),y&&!r.restart&&t.jsx(O,{blocklet:r.blocklet,launcherSession:r.launcherSession,manageSubscriptionURL:r.manageSubscriptionURL,handleRestart:j}),t.jsx(p,{mt:5,children:t.jsx(H,{className:"footer-link",to:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function O({blocklet:e,launcherSession:o,manageSubscriptionURL:r,handleRestart:i}){var $,y;const{t:l,locale:d}=F(),{connectApi:f,session:P}=pe(),{refreshSubscription:_}=me(),[x,j]=g.useState(!1),[C,b]=g.useState("");if(g.useEffect(()=>{var w;if((w=e==null?void 0:e.controller)!=null&&w.launcherUrl&&T(o)){const N=L(e.controller.launcherUrl,"__blocklet__.js?type=json");fetch(N).then(k=>k.json()).then(k=>{var a,u;const s=(u=(a=k.componentMountPoints)==null?void 0:a.find(V=>V.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:u.mountPoint,n=L(e.controller.launcherUrl,s);b(n)})}},[($=e==null?void 0:e.controller)==null?void 0:$.launcherUrl,o]),!e||!o)return"";const c=T(o),m=!c&&he(e,o),h=!c&&ue(e,o);return!m&&!h&&!c?"":t.jsxs(t.Fragment,{children:[x&&C&&o&&t.jsx(ge,{session:P,connect:f,baseUrl:C,authToken:o.subscription.authToken,children:t.jsx(fe,{dialogProps:{open:x,onClose:()=>j(!1)},subscriptionId:o.subscription.id,successToast:!0,onPaid:()=>{D.post("/blocklet/start?fromSetup=1"),_(),i(),j(!1)}})}),t.jsxs(p,{className:"title-box",children:[t.jsx(re,{className:"icon-error"}),t.jsxs(p,{className:"title error",children:[m&&l("blocklet.suspended"),h&&l("blocklet.terminated"),c&&l("blocklet.suspended")]})]}),t.jsxs(p,{className:"sub-title",children:[m&&l("blocklet.suspendedCausedByExpired",{deadline:I(o==null?void 0:o.reservedUntil,d),canceledAt:I((((y=o==null?void 0:o.subscription)==null?void 0:y.canceled_at)||0)*1e3,d)}),h&&l("blocklet.suspendedCausedByTerminated",{canceledAt:I(o==null?void 0:o.terminatedAt,d),deadline:xe(o==null?void 0:o.terminatedAt,d)}),c&&l("blocklet.suspendedCausedByPastDue",{deadline:I(o==null?void 0:o.reservedUntil,d)})]}),t.jsxs(p,{mt:8,children:[c&&!B(o)&&t.jsx(R,{style:{minWidth:200},variant:"contained",color:"primary",size:"large",onClick:()=>j(!0),children:l("blocklet.payNow")}),(m||B(o))&&t.jsx(R,{component:J,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:r||"#",children:l("blocklet.manageSubscription")}),h&&t.jsx(R,{component:H,to:L(A.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:l("common.backup")})]})]})}O.propTypes={blocklet:v.object.isRequired,launcherSession:v.object.isRequired,manageSubscriptionURL:v.string.isRequired,handleRestart:v.func.isRequired};const Pe=Y`
1
+ import{j as t,ab as G,bD as X,aa as p,v as Q,H as v,be as J,b6 as Y,ah as S,w as Z}from"./vendor-mui-core-BV2FUxWJ.js";import{r as g,L as H}from"./vendor-react-DEoibe3W.js";import{x as ee,f as E}from"./vendor-hooks-BgUTpb6X.js";import{A as L}from"./vendor-utils-rHXShPKm.js";import{d as te}from"./PlayArrow-CDOOUxMp.js";import{d as re}from"./Error-DEKvwVoF.js";import{a as F,a0 as z,C as oe,j as A,R as ne,B as R,$ as se,z as ie}from"./vendor-ux-did-connect-2jRoUb28.js";import{W as ae}from"./did-address-Dq-4__HB.js";import{d as D,e as W,g as le,f as U,h as de,j as T,S as ce,u as pe,k as me,l as he,m as ue,P as ge,O as fe,n as I,o as xe,q as B}from"./index-DDoVX3je.js";import{H as be}from"./addon-CRj4Enw7.js";import{u as ke}from"./use-server-logo-CxuMvwKh.js";import{g as M}from"./get-safe-url-Q70tRxL7.js";import{b as je}from"./vendor-arcblock-BlrkGjK9.js";import{p as ye,S as we,P as ve}from"./starting-progress-BHUTOY2b.js";import"./lottie-web-jYmAQWuC.js";import"./QuestionMarkCircle-DTGyWFVS.js";import"./use-mobile-BAa0wi8o.js";function K({appInfo:e,...o}){const[r,i]=g.useState(!1),d=Q(f=>f.breakpoints.down("md"))?32:48;return r?t.jsx(se,{did:e.publisher,size:d}):t.jsx(ie,{src:e.icon,alt:e.title,width:d,height:d,...o,onError:()=>i(!0)})}K.propTypes={appInfo:v.object.isRequired};const q=(e,o)=>U.findComponentByIdV2(e,o)||e;function Ke(){var w,N,k;const{t:e,locale:o}=F(),[r,i]=ee({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:"",restart:!1}),l=localStorage.getItem("blocklet-server-url"),d=ke({onClick:()=>{l&&window.open(M(l,{allowDomains:null}))}}),f=new URL(window.location.href),P=f.searchParams.get("componentId"),_=()=>{const s=f.searchParams.get("redirect")||"/";window.location.href=M(decodeURIComponent(s))},x=()=>{const s=setInterval(()=>{D.get("/blocklet/detail?nocache=1").then(({data:n})=>{i(u=>({...u,blocklet:n}));const a=q(n,P);if(a.status==="running"){_();return}a.status!=="starting"&&!r.restart&&(i({blocklet:n,starting:!1}),n!==a&&i({component:a}),clearInterval(s))}).catch(n=>{i({loading:!1,restart:!1}),z.error(n.message)})},3e3)},j=()=>{i({restart:!0,starting:!0,loading:!0}),setTimeout(()=>{x()},10)};g.useEffect(()=>{i({loading:!0}),D.get("/blocklet/detail?nocache=1").then(({data:s})=>{const n=q(s,P);if(i({blocklet:s,loading:!1}),n.status==="running"){_();return}i({blocklet:s}),s!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),x())}).catch(s=>{i({loading:!1}),z.error(s.message)})},[]);const C=g.useCallback(()=>{i({loading:!0,starting:!0});const s=r.blocklet;if(!s)return;const n={did:s==null?void 0:s.meta.did};s.children.length>0&&(n.componentDids=s.children.map(a=>a.meta.did)),W.startBlocklet({input:n}).then(({blocklet:a})=>{i(u=>({...u,blocklet:a})),x()}).catch(a=>{z.error(a.message),i({loading:!1,starting:!1})})},[r.component,r.blocklet]);g.useEffect(()=>{var s;(s=r.blocklet)!=null&&s.controller&&(le({launcherUrl:r.blocklet.controller.launcherUrl,launcherSessionId:r.blocklet.controller.launcherSessionId,locale:o}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),W.getLauncherSession({input:{launcherSessionId:r.blocklet.controller.launcherSessionId,launcherUrl:r.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession})}).catch(n=>{console.error("get launcher session error",n)}))},[(w=r.blocklet)==null?void 0:w.controller]);const b=E(()=>{var s,n;return(n=(s=r.blocklet)==null?void 0:s.children)==null?void 0:n.length},[r.blocklet]),c=E(()=>{var s,n,a;return((a=(n=(s=r.blocklet)==null?void 0:s.children)==null?void 0:n.filter(u=>u.status==="running"))==null?void 0:a.length)||0},[r.blocklet]),m=E(()=>b?c?Math.round(Math.max(c/b,.15)*100):5:0,[c,b]);if(!r.blocklet)return t.jsx(oe,{children:t.jsx(G,{})});const h={icon:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:U.getDisplayName(r.blocklet),publisher:r.blocklet.appDid},$=ne(ye,r.starting?{width:`${m}%`,"&::after":{width:`${m}%`},"&::before":{width:`${m}%`,animation:"shimmer 1s infinite cubic-bezier(0.4, 0.0, 0.2, 1)","@keyframes shimmer":{"0%":{width:0},"100%":{width:`${m}%`}}}}:{}),y=de(r.blocklet)||T(r.launcherSession);return t.jsxs(_e,{children:[t.jsx(X,{styles:Pe}),t.jsxs("header",{className:"root-header",children:[t.jsx("div",{className:"left",children:d}),t.jsx(je,{children:t.jsx(be,{SessionContext:ce})})]}),t.jsxs(Ce,{elevation:0,children:[t.jsxs($e,{children:[t.jsx(K,{appInfo:h}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(p,{className:"app-info_name",children:h.title}),t.jsx(ae,{size:14,className:"app-info_did",did:h.publisher})]})]}),(r.restart||!y)&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{className:"title-box",children:[t.jsx(p,{className:"icon",children:t.jsx(te,{})}),t.jsx(p,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(p,{className:"sub-title",children:r.starting?t.jsx(we,{blocklets:((N=r.blocklet)==null?void 0:N.children)??[]}):e("blocklet.startDescription",{name:r.component?U.getDisplayName(r.component,!0):U.getDisplayName(r.blocklet)})}),t.jsx(p,{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:t.jsx(ve,{blocklets:((k=r.blocklet)==null?void 0:k.children)??[],status:r.starting?"starting":"",children:t.jsx(R,{sx:$,disabled:r.loading||r.starting,variant:"contained",color:"primary",size:"large",loading:r.starting,onClick:()=>C(),children:t.jsx("span",{style:{position:"relative",zIndex:2},children:r.starting?`(${c}/${b}) ${e("blocklet.starting")}`:e("blocklet.start")})})})})]}),y&&!r.restart&&t.jsx(O,{blocklet:r.blocklet,launcherSession:r.launcherSession,manageSubscriptionURL:r.manageSubscriptionURL,handleRestart:j}),t.jsx(p,{mt:5,children:t.jsx(H,{className:"footer-link",to:`${A.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function O({blocklet:e,launcherSession:o,manageSubscriptionURL:r,handleRestart:i}){var $,y;const{t:l,locale:d}=F(),{connectApi:f,session:P}=pe(),{refreshSubscription:_}=me(),[x,j]=g.useState(!1),[C,b]=g.useState("");if(g.useEffect(()=>{var w;if((w=e==null?void 0:e.controller)!=null&&w.launcherUrl&&T(o)){const N=L(e.controller.launcherUrl,"__blocklet__.js?type=json");fetch(N).then(k=>k.json()).then(k=>{var a,u;const s=(u=(a=k.componentMountPoints)==null?void 0:a.find(V=>V.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:u.mountPoint,n=L(e.controller.launcherUrl,s);b(n)})}},[($=e==null?void 0:e.controller)==null?void 0:$.launcherUrl,o]),!e||!o)return"";const c=T(o),m=!c&&he(e,o),h=!c&&ue(e,o);return!m&&!h&&!c?"":t.jsxs(t.Fragment,{children:[x&&C&&o&&t.jsx(ge,{session:P,connect:f,baseUrl:C,authToken:o.subscription.authToken,children:t.jsx(fe,{dialogProps:{open:x,onClose:()=>j(!1)},subscriptionId:o.subscription.id,successToast:!0,onPaid:()=>{D.post("/blocklet/start?fromSetup=1"),_(),i(),j(!1)}})}),t.jsxs(p,{className:"title-box",children:[t.jsx(re,{className:"icon-error"}),t.jsxs(p,{className:"title error",children:[m&&l("blocklet.suspended"),h&&l("blocklet.terminated"),c&&l("blocklet.suspended")]})]}),t.jsxs(p,{className:"sub-title",children:[m&&l("blocklet.suspendedCausedByExpired",{deadline:I(o==null?void 0:o.reservedUntil,d),canceledAt:I((((y=o==null?void 0:o.subscription)==null?void 0:y.canceled_at)||0)*1e3,d)}),h&&l("blocklet.suspendedCausedByTerminated",{canceledAt:I(o==null?void 0:o.terminatedAt,d),deadline:xe(o==null?void 0:o.terminatedAt,d)}),c&&l("blocklet.suspendedCausedByPastDue",{deadline:I(o==null?void 0:o.reservedUntil,d)})]}),t.jsxs(p,{mt:8,children:[c&&!B(o)&&t.jsx(R,{style:{minWidth:200},variant:"contained",color:"primary",size:"large",onClick:()=>j(!0),children:l("blocklet.payNow")}),(m||B(o))&&t.jsx(R,{component:J,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:r||"#",children:l("blocklet.manageSubscription")}),h&&t.jsx(R,{component:H,to:L(A.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:l("common.backup")})]})]})}O.propTypes={blocklet:v.object.isRequired,launcherSession:v.object.isRequired,manageSubscriptionURL:v.string.isRequired,handleRestart:v.func.isRequired};const Pe=Y`
2
2
  html,
3
3
  body,
4
4
  #app,
@@ -1 +1 @@
1
- import{e as m,r as h}from"./vendor-react-DEoibe3W.js";import{a9 as b,j as n,ab as j,ad as g,H as y}from"./vendor-mui-core-BV2FUxWJ.js";import{x}from"./vendor-hooks-BgUTpb6X.js";import{r as P,aJ as S,bE as R,h as k,a as V}from"./vendor-ux-did-connect-2jRoUb28.js";import{d as q}from"./dashboard-BhR1WNzF.js";import{B as u}from"./vendor-utils-rHXShPKm.js";import{r as D}from"./omit-D2k92RIF.js";var c={},E=b;Object.defineProperty(c,"__esModule",{value:!0});var _=c.default=void 0,T=E(P()),G=n;_=c.default=(0,T.default)((0,G.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm-1.06 13.54L7.4 12l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"GppGood");var p={},$=m&&m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0});p.signResponse=z;p.verifyResponse=M;var I=p.verifyVault=C;const K=$(D),w=$(S),d=R,l=k;function z(e,a){const t=(0,w.default)(e),s=a.sign(t);return{...e,$signature:s}}function M(e,a){return e.$signature?Promise.resolve(a.verify((0,w.default)((0,K.default)(e,"$signature")),e.$signature)):Promise.resolve(!1)}async function C(e,a,t=!1){if(!Array.isArray(e)||e.length===0){if(t)throw new Error("vaults list is empty");return""}for(let i=1;i<e.length;i++)if(e[i].at<=e[i-1].at){if(t)throw new Error("vaults are not in ascending order");return""}if(new Set(e.map(i=>i.did)).size!==e.length){if(t)throw new Error("vaults list has duplicate vaults");return""}for(let i=0;i<e.length;i++){const r=e[i];if(!(0,l.isFromPublicKey)(r.did,r.pk)){if(t)throw new Error(`vault did and pk mismatch: ${r.did}(${r.pk})`);return""}let f=u.from(`vault:${a}`);for(let o=0;o<=i;o++)f=u.concat([f,u.from(`:${e[o].did}`)]);if(!r.approverSig){if(t)throw new Error(`vault approve signature missing for ${r.did}`);return""}try{let o;if(i>0){const v=e[i-1];o=(0,d.fromPublicKey)(v.pk,(0,l.toTypeInfo)(v.did))}else{if(!r.approverPk||!r.approverDid||!(0,l.isFromPublicKey)(r.approverDid,r.approverPk)){if(t)throw new Error(`approver config missing for ${r.did}`);return""}o=(0,d.fromPublicKey)(r.approverPk,(0,l.toTypeInfo)(r.approverDid))}if(await o.verify(f,r.approverSig)===!1){if(t)throw new Error(`signature verify failed for ${r.did}`);return""}}catch(o){if(console.error(o),t)throw new Error(`vault approve verify failed: ${o.message}`);return""}if(!r.sig){if(t)throw new Error(`vault commit signature missing for ${r.did}`);return""}try{const o=(0,d.fromPublicKey)(r.pk,(0,l.toTypeInfo)(r.did));if(r.approverSig&&(f=u.concat([f,u.from(`:${r.approverSig}`)])),await o.verify(f,r.sig)===!1){if(t)throw new Error(`commit signature verify failed for ${r.did}`);return""}}catch(o){if(console.error(o),t)throw new Error(`vault commit verify failed: ${o.message}`);return""}}return e[e.length-1].did}function A({vaults:e,appPid:a}){const{t}=V(),[s,i]=x({verified:!1,verifying:!0,error:""});return h.useEffect(()=>{I(e,a,!0).then(r=>{i({verified:!!r,verifying:!1})}).catch(r=>{i({verified:!1,verifying:!1,error:r.message})})},[e,a,i]),s.verifying?n.jsx(j,{}):s.verified?n.jsx(g,{title:t("blocklet.config.vault.verified"),children:n.jsx(_,{fontSize:"small",color:"success"})}):n.jsx(g,{title:s.error,children:n.jsx(q,{color:"error"})})}A.propTypes={vaults:y.array.isRequired,appPid:y.string.isRequired};export{A as V};
1
+ import{e as m,r as h}from"./vendor-react-DEoibe3W.js";import{a9 as b,j as n,ab as j,ad as g,H as y}from"./vendor-mui-core-BV2FUxWJ.js";import{x}from"./vendor-hooks-BgUTpb6X.js";import{r as P,aJ as S,bE as R,h as k,a as V}from"./vendor-ux-did-connect-2jRoUb28.js";import{d as q}from"./dashboard-xUr1SbPS.js";import{B as u}from"./vendor-utils-rHXShPKm.js";import{r as D}from"./omit-D2k92RIF.js";var c={},E=b;Object.defineProperty(c,"__esModule",{value:!0});var _=c.default=void 0,T=E(P()),G=n;_=c.default=(0,T.default)((0,G.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm-1.06 13.54L7.4 12l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"GppGood");var p={},$=m&&m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0});p.signResponse=z;p.verifyResponse=M;var I=p.verifyVault=C;const K=$(D),w=$(S),d=R,l=k;function z(e,a){const t=(0,w.default)(e),s=a.sign(t);return{...e,$signature:s}}function M(e,a){return e.$signature?Promise.resolve(a.verify((0,w.default)((0,K.default)(e,"$signature")),e.$signature)):Promise.resolve(!1)}async function C(e,a,t=!1){if(!Array.isArray(e)||e.length===0){if(t)throw new Error("vaults list is empty");return""}for(let i=1;i<e.length;i++)if(e[i].at<=e[i-1].at){if(t)throw new Error("vaults are not in ascending order");return""}if(new Set(e.map(i=>i.did)).size!==e.length){if(t)throw new Error("vaults list has duplicate vaults");return""}for(let i=0;i<e.length;i++){const r=e[i];if(!(0,l.isFromPublicKey)(r.did,r.pk)){if(t)throw new Error(`vault did and pk mismatch: ${r.did}(${r.pk})`);return""}let f=u.from(`vault:${a}`);for(let o=0;o<=i;o++)f=u.concat([f,u.from(`:${e[o].did}`)]);if(!r.approverSig){if(t)throw new Error(`vault approve signature missing for ${r.did}`);return""}try{let o;if(i>0){const v=e[i-1];o=(0,d.fromPublicKey)(v.pk,(0,l.toTypeInfo)(v.did))}else{if(!r.approverPk||!r.approverDid||!(0,l.isFromPublicKey)(r.approverDid,r.approverPk)){if(t)throw new Error(`approver config missing for ${r.did}`);return""}o=(0,d.fromPublicKey)(r.approverPk,(0,l.toTypeInfo)(r.approverDid))}if(await o.verify(f,r.approverSig)===!1){if(t)throw new Error(`signature verify failed for ${r.did}`);return""}}catch(o){if(console.error(o),t)throw new Error(`vault approve verify failed: ${o.message}`);return""}if(!r.sig){if(t)throw new Error(`vault commit signature missing for ${r.did}`);return""}try{const o=(0,d.fromPublicKey)(r.pk,(0,l.toTypeInfo)(r.did));if(r.approverSig&&(f=u.concat([f,u.from(`:${r.approverSig}`)])),await o.verify(f,r.sig)===!1){if(t)throw new Error(`commit signature verify failed for ${r.did}`);return""}}catch(o){if(console.error(o),t)throw new Error(`vault commit verify failed: ${o.message}`);return""}}return e[e.length-1].did}function A({vaults:e,appPid:a}){const{t}=V(),[s,i]=x({verified:!1,verifying:!0,error:""});return h.useEffect(()=>{I(e,a,!0).then(r=>{i({verified:!!r,verifying:!1})}).catch(r=>{i({verified:!1,verifying:!1,error:r.message})})},[e,a,i]),s.verifying?n.jsx(j,{}):s.verified?n.jsx(g,{title:t("blocklet.config.vault.verified"),children:n.jsx(_,{fontSize:"small",color:"success"})}):n.jsx(g,{title:s.error,children:n.jsx(q,{color:"error"})})}A.propTypes={vaults:y.array.isRequired,appPid:y.string.isRequired};export{A as V};
@@ -1,4 +1,4 @@
1
- import{j as e,aa as a,H as o,ah as p}from"./vendor-mui-core-BV2FUxWJ.js";import{u as l}from"./use-mobile-C21X4TYN.js";import{al as m}from"./index-B_NDUfon.js";function r({blocklet:t,children:n}){const i=l();return!t||m(t.meta)?e.jsx(s,{isMobile:i,children:n}):e.jsx(s,{isMobile:i,children:e.jsx(a,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:n})})}r.propTypes={blocklet:o.object,children:o.any};r.defaultProps={blocklet:null,children:null};const s=p(a)`
1
+ import{j as e,aa as a,H as o,ah as p}from"./vendor-mui-core-BV2FUxWJ.js";import{u as l}from"./use-mobile-C21X4TYN.js";import{al as m}from"./index-DDoVX3je.js";function r({blocklet:t,children:n}){const i=l();return!t||m(t.meta)?e.jsx(s,{isMobile:i,children:n}):e.jsx(s,{isMobile:i,children:e.jsx(a,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:n})})}r.propTypes={blocklet:o.object,children:o.any};r.defaultProps={blocklet:null,children:null};const s=p(a)`
2
2
  padding-top: 24px;
3
3
  margin-top: auto;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{b as n,r as M}from"./vendor-react-DEoibe3W.js";import{aw as Te,y as N,D as Ne,aE as fe,K as pe}from"./index-B_NDUfon.js";import{A as Ie,aC as Pe}from"./vendor-utils-rHXShPKm.js";import{_ as _e}from"./dot-itVN8XTt.js";import{I as Ye}from"./iframe-Dl8NEFc5.js";import{d as Fe}from"./LaunchOutlined-E7HcQu_6.js";import{cq as Me,a9 as He,j as f,aa as $,w as ke,bb as p,X as ae,T as Y,L as Le,A as Ae,b5 as We,I as K,bo as he,bn as ge,q as De,e as qe,m as ve,H as P,ab as ze,ak as Ve,y as Be,b3 as $e}from"./vendor-mui-core-BV2FUxWJ.js";import{r as Ke,a as Re,j as Je}from"./vendor-ux-did-connect-2jRoUb28.js";import{d as Ue}from"./ChevronLeft-DONyUbIg.js";import{d as Xe}from"./ChevronRight-DgAwWLdY.js";import{r as se,t as Se,i as T,a as F,b as j,p as Ge,c as Qe,d as ie,e as ne,s as A,f as W,g as _,h as q,j as z,k as J,l as U,m as Ze,n as re,o as L,q as xe,u as le,v as et,w as tt,x as at,y as nt,z as rt}from"./index-iB7JyXwh.js";import{f as ot}from"./index-8eXqqyHQ.js";import{B as st}from"./base-chart-D6qRW4Yg.js";import{L as it,c as lt}from"./vendor-mui-x-Bo-XOtzq.js";import{A as ct}from"./AdapterDayjs-CDDcwz3P.js";function we(e){se(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(Me(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(o){var s=Se(o);(a===void 0||a<s||isNaN(Number(s)))&&(a=s)}),a||new Date(NaN)}function Ce(e){se(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(Me(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(o){var s=Se(o);(a===void 0||a>s||isNaN(s.getDate()))&&(a=s)}),a||new Date(NaN)}function ut(e){return se(1,arguments),T(e,Date.now())}var ce={},dt=He;Object.defineProperty(ce,"__esModule",{value:!0});var je=ce.default=void 0,mt=dt(Ke()),ft=f;je=ce.default=(0,mt.default)((0,ft.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");const pt=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(a,o)=>e.slice(o*t,o*t+t)),ht=(e,t)=>{const a=A(q(e),{locale:t}),o=W(z(e),{locale:t}),s=[];for(let i=a;L(i,o);)s.push(i),i=ne(i,1);return s},gt=({startDate:e},t)=>e&&T(t,e),Dt=({endDate:e},t)=>e&&T(t,e),vt=({startDate:e,endDate:t},a)=>e&&t&&(le(a,{start:e,end:t})||T(a,e)||T(a,t)),xt=({startDate:e,endDate:t})=>e&&t?T(e,t):!1,be=(e,t)=>{if(e){const a=e instanceof Date?e:Ge(e);if(Qe(a))return a}return t},bt=(e,t,a)=>{const{startDate:o,endDate:s}=e;if(o&&s){const i=we([o,t]),u=Ce([s,a]);return[i,ie(i,u)?j(i,1):u]}return[o,s]},Et=(e,t)=>[{label:"Today",startDate:e,endDate:e},{label:"Yesterday",startDate:ne(e,-1),endDate:ne(e,-1)},{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(_(e,-1),{locale:t}),endDate:W(_(e,-1),{locale:t})},{label:"Last 7 Days",startDate:_(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:z(e)},{label:"Last Month",startDate:q(j(e,-1)),endDate:z(j(e,-1))},{label:"This Year",startDate:J(e),endDate:U(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:U(F(e,-1))}],yt=(e,t)=>{const a=Math.floor(t/2);return Array(t).fill(0).map((o,s)=>e.getFullYear()-a+s)},Mt=({date:e,setDate:t,nextDisabled:a,prevDisabled:o,onClickNext:s,onClickPrevious:i,locale:u})=>{const d=typeof u<"u"?[...Array(12).keys()].map(l=>{var D;return(D=u.localize)===null||D===void 0?void 0:D.month(l,{width:"abbreviated",context:"standalone"})}):["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],h=l=>{t(nt(e,parseInt(l.target.value,10)))},c=l=>{t(rt(e,parseInt(l.target.value,10)))};return n.createElement(p,{container:!0,justifyContent:"space-between",alignItems:"center"},n.createElement(p,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:o,onClick:i},n.createElement(Ue,{color:o?"disabled":"action"}))),n.createElement(p,{item:!0},n.createElement(he,{variant:"standard"},n.createElement(ge,{value:tt(e),onChange:h,MenuProps:{disablePortal:!0}},d.map((l,D)=>n.createElement(De,{key:l,value:D},l))))),n.createElement(p,{item:!0},n.createElement(he,{variant:"standard"},n.createElement(ge,{value:at(e),onChange:c,MenuProps:{disablePortal:!0}},yt(e,30).map(l=>n.createElement(De,{key:l,value:l},l))))),n.createElement(p,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:a,onClick:s},n.createElement(Xe,{color:a?"disabled":"action"}))))},kt=({startOfRange:e,endOfRange:t,disabled:a,highlighted:o,outlined:s,filled:i,onClick:u,onHover:d,value:h})=>n.createElement($,{sx:{display:"flex",borderRadius:e?"50% 0 0 50%":t?"0 50% 50% 0":void 0,backgroundColor:c=>!a&&o?c.palette.primary.light:void 0}},n.createElement(K,{sx:Object.assign({height:"36px",width:"36px",padding:0,border:c=>!a&&s?`1px solid ${c.palette.primary.dark}`:void 0},!a&&i?{"&:hover":{backgroundColor:c=>c.palette.primary.dark},backgroundColor:c=>c.palette.primary.dark}:{}),disabled:a,onClick:u,onMouseOver:d},n.createElement(Y,{sx:{lineHeight:1.6,color:c=>a?c.palette.text.secondary:i?c.palette.primary.contrastText:c.palette.text.primary},variant:"body2"},h)));var X;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(X||(X={}));const Ee=e=>{var t;const{helpers:a,handlers:o,value:s,dateRange:i,marker:u,setValue:d,minDate:h,maxDate:c,locale:l}=e,D=((t=l==null?void 0:l.options)===null||t===void 0?void 0:t.weekStartsOn)||0,w=typeof l<"u"?[...Array(7).keys()].map(g=>{var x;return(x=l.localize)===null||x===void 0?void 0:x.day((g+D)%7,{width:"short",context:"standalone"})}):["Su","Mo","Tu","We","Th","Fr","Sa"],[v,k]=e.navState;return n.createElement(ke,{square:!0,elevation:0,sx:{width:290}},n.createElement(p,{container:!0},n.createElement(Mt,{date:s,setDate:d,nextDisabled:!k,prevDisabled:!v,onClickPrevious:()=>o.onMonthNavigate(u,X.Previous),onClickNext:()=>o.onMonthNavigate(u,X.Next),locale:l}),n.createElement(p,{item:!0,container:!0,direction:"row",justifyContent:"space-between",sx:{marginTop:"10px",paddingLeft:"30px",paddingRight:"30px"}},w.map((g,x)=>n.createElement(Y,{color:"textSecondary",key:x,variant:"caption"},g))),n.createElement(p,{item:!0,container:!0,direction:"column",justifyContent:"space-between",sx:{paddingLeft:"15px",paddingRight:"15px",marginTop:"15px",marginBottom:"20px"}},pt(ht(s,l),7).map((g,x)=>n.createElement(p,{key:x,container:!0,direction:"row",justifyContent:"center"},g.map(m=>{const y=gt(i,m),C=Dt(i,m),E=xt(i),R=vt(i,m)||a.inHoverRange(m);return n.createElement(kt,{key:re(m,"dd-MM-yyyy"),filled:y||C,outlined:ut(m),highlighted:R&&!E,disabled:!ie(s,m)||!le(m,{start:h,end:c}),startOfRange:y&&!E,endOfRange:C&&!E,onClick:()=>o.onDayClick(m),onHover:()=>o.onDayHover(m),value:et(m)})}))))))},ye=(e,t)=>{const{startDate:a,endDate:o}=e,{startDate:s,endDate:i}=t;return a&&s&&o&&i?T(a,s)&&T(o,i):!1},Rt=({ranges:e,setRange:t,selectedRange:a})=>n.createElement(Le,null,e.map((o,s)=>n.createElement(Ae,{button:!0,key:s,onClick:()=>t(o),sx:[ye(o,a)&&{backgroundColor:i=>i.palette.primary.dark,color:"primary.contrastText","&:hover":{color:"inherit"}}]},n.createElement(We,{primaryTypographyProps:{variant:"body2",sx:{fontWeight:ye(o,a)?"bold":"normal"}}},o.label)))),oe={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},St=e=>{const{ranges:t,dateRange:a,minDate:o,maxDate:s,firstMonth:i,setFirstMonth:u,secondMonth:d,setSecondMonth:h,setDateRange:c,helpers:l,handlers:D,locale:w}=e,{startDate:v,endDate:k}=a,g=Ze(d,i)>=2,x={dateRange:a,minDate:o,maxDate:s,helpers:l,handlers:D};return n.createElement(ke,{elevation:5,square:!0},n.createElement(p,{container:!0,direction:"row",wrap:"nowrap"},n.createElement(p,null,n.createElement(Rt,{selectedRange:a,ranges:t,setRange:c})),n.createElement(ae,{orientation:"vertical",flexItem:!0}),n.createElement(p,null,n.createElement(p,{container:!0,sx:{padding:"20px 70px"},alignItems:"center"},n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},v?re(v,"dd MMMM yyyy",{locale:w}):"Start Date")),n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(je,{color:"action"})),n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},k?re(k,"dd MMMM yyyy",{locale:w}):"End Date"))),n.createElement(ae,null),n.createElement(p,{container:!0,direction:"row",justifyContent:"center",wrap:"nowrap"},n.createElement(Ee,Object.assign({},x,{value:i,setValue:u,navState:[!0,g],marker:oe.FIRST_MONTH,locale:w})),n.createElement(ae,{orientation:"vertical",flexItem:!0}),n.createElement(Ee,Object.assign({},x,{value:d,setValue:h,navState:[g,!0],marker:oe.SECOND_MONTH,locale:w}))))))},wt=e=>{const t=new Date,{open:a,onChange:o,initialDateRange:s,minDate:i,maxDate:u,definedRanges:d=Et(new Date,e.locale),locale:h}=e,c=be(i,F(t,-10)),l=be(u,F(t,10)),[D,w]=bt(s||{},c,l),[v,k]=M.useState(Object.assign({},s)),[g,x]=M.useState(),[m,y]=M.useState(D||t),[C,E]=M.useState(w||j(m,1)),{startDate:R,endDate:I}=v,H=r=>{L(r,C)&&y(r)},G=r=>{xe(r,m)&&E(r)},V=r=>{let{startDate:b,endDate:S}=r;if(b&&S)r.startDate=b=we([b,c]),r.endDate=S=Ce([S,l]),k(r),o(r),y(b),E(ie(b,S)?j(b,1):S);else{const me={};k(me),o(me),y(t),E(j(m,1))}},Q=r=>{if(R&&!I&&!L(r,R)){const b={startDate:R,endDate:r};o(b),k(b)}else k({startDate:r,endDate:void 0});x(r)},Z=(r,b)=>{if(r===oe.FIRST_MONTH){const S=j(m,b);L(S,C)&&y(S)}else{const S=j(C,b);L(m,S)&&E(S)}},B=r=>{R&&!I&&(!g||!T(r,g))&&x(r)},ee={inHoverRange:r=>R&&!I&&g&&xe(g,R)&&le(r,{start:R,end:g})},te={onDayClick:Q,onDayHover:B,onMonthNavigate:Z};return a?M.createElement(St,{dateRange:v,minDate:c,maxDate:l,ranges:d,firstMonth:m,secondMonth:C,setFirstMonth:H,setSecondMonth:G,setDateRange:V,helpers:ee,handlers:te,locale:h}):null},Ct=e=>{const{closeOnClickOutside:t,wrapperClassName:a,toggle:o,open:s}=e,i=()=>{t!==!1&&o()},u=d=>(d==null?void 0:d.key)==="Escape"&&i();return n.createElement($,{sx:{position:"relative"}},s&&n.createElement($,{sx:{position:"fixed",height:"100vh",width:"100vw",bottom:0,zIndex:0,right:0,left:0,top:0},onKeyPress:u,onClick:i}),n.createElement($,{sx:{position:"relative",zIndex:1},className:a},n.createElement(wt,Object.assign({},e))))},jt=e=>n.createElement(Ct,Object.assign({},e));function ue({title:e,total:t,hoverIndex:a,onHover:o,history:s,valueFn:i}){const u=qe(),{locale:d}=Re(),h=[{min:0,max:t,color:ve(u.palette.primary.main,u.palette.mode==="dark"?.15:.08)},{min:t,color:ve(u.palette.primary.main,u.palette.mode==="dark"?.15:.08)}];return f.jsx(st,{title:e,total:t,history:s,valueFn:i,onHover:o,hoverIndex:a,xAxisFormat:c=>Te(c,"MM-DD",d),visualMapPieces:h,markLineData:void 0,extraInfo:null})}ue.propTypes={title:P.string,total:P.number,history:P.array,valueFn:P.func,hoverIndex:P.number,onHover:P.func};ue.defaultProps={title:"",total:0,history:[],valueFn:e=>e,hoverIndex:null,onHover:()=>{}};const O=Pe(0),Oe=(e,t)=>[{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(_(e,-1),{locale:t}),endDate:W(_(e,-1),{locale:t})},{label:"Last 7 Days",startDate:_(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:z(e)},{label:"Last Month",startDate:q(j(e,-1)),endDate:z(j(e,-1))},{label:"This Year",startDate:J(e),endDate:U(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:U(F(e,-1))}],Ot=Array.from({length:7},(e,t)=>({value:0,date:N().subtract(t,"day").format("YYYY-MM-DD")})).reverse();function Tt({client:e,did:t}){const a=N().subtract(1,"day").toDate(),{info:o,inService:s}=Ne(),{t:i,locale:u}=Re(),[d,h]=M.useState(null),[c,l]=M.useState(!1),[D,w]=M.useState(a),[v,k]=M.useState({startDate:N().subtract(30,"day").toDate(),endDate:a}),[g,x]=M.useState(null),m=M.useCallback(r=>{x(r)},[]),y=_e(async()=>(await e.getTrafficInsights({input:{did:t,startDate:N(v.startDate).format("YYYY-MM-DD"),endDate:N(v.endDate).format("YYYY-MM-DD")}})).list);M.useEffect(()=>{y.loading||v.startDate&&v.endDate&&y.retry()},[v]);const C=r=>{h(d?null:r.currentTarget)},E=y.value||[],{loading:R,error:I}=y;if(!E.length&&R)return f.jsx(ze,{});if(I)return f.jsx(Ve,{severity:"error",children:ot(I)});const H={totalRequests:O,validRequests:O,failedRequests:O,uniqueVisitors:O,uniqueFiles:O,uniqueReferrers:O,uniqueNotFound:O,uniqueStaticFiles:O,logSize:fe,bandwidth:fe},G=Object.keys(H).map(r=>({id:`${r}_chart`,title:i(`analytics.traffic.${r}`),current:E.length?H[r](E[0][r]):0,data:E.length?E.map(b=>({date:b.date,value:b[r]})).reverse():Ot,dateFn:O,valueFn:H[r],total:0})),V=!!d,Q=V?"date-range-picker-popover":void 0,Z=s?Je.WELLKNOWN_SERVICE_PATH_PREFIX:o.routing.adminPath,B=Ie(window.location.origin,Z,`/api/analytics/traffic?date=${N(D).format("YYYY-MM-DD")}&did=${t}`),de=r=>{k(r),h(null)},ee=r=>{w(r.toDate()),l(!1)},te=()=>{window.open(B)};return f.jsxs("div",{children:[f.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[i("analytics.trend"),f.jsxs(Be,{onClick:C,variant:"outlined",size:"small",color:"inherit",sx:{fontWeight:400},children:[pe(v.startDate,u)," - ",pe(v.endDate,u)]})]}),f.jsx($e,{id:Q,open:V,anchorEl:d,onClose:()=>h(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:f.jsx(jt,{open:!0,toggle:C,maxDate:a,definedRanges:Oe(D),onChange:de})}),f.jsx(p,{container:!0,spacing:4,children:G.map(r=>f.jsx(p,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:f.jsx(ue,{title:`${r.title}`,total:r.total,empty:null,history:r.data,style:{height:150},valueFn:r.valueFn,hoverIndex:g,onHover:m})},r.id))}),f.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[i("analytics.detail"),f.jsxs("span",{children:[c&&f.jsx(K,{onClick:te,style:{marginRight:32},children:f.jsx(Fe,{})}),f.jsx(it,{dateAdapter:ct,children:f.jsx(lt,{disableFuture:!0,format:"ll",value:N(D),onChange:ee,slotProps:{textField:{size:"small"}}})})]})]}),f.jsx(Ye,{url:B,width:"100%",height:"100%",frameBorder:0,onLoad:()=>l(!0),styles:{border:0,minHeight:"400vh"}})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt,getDefaultRanges:Oe},Symbol.toStringTag,{value:"Module"}));export{jt as D,Oe as g,Kt as t};
1
+ import{b as n,r as M}from"./vendor-react-DEoibe3W.js";import{aw as Te,y as N,D as Ne,aE as fe,K as pe}from"./index-DDoVX3je.js";import{A as Ie,aC as Pe}from"./vendor-utils-rHXShPKm.js";import{_ as _e}from"./dot-itVN8XTt.js";import{I as Ye}from"./iframe-Dl8NEFc5.js";import{d as Fe}from"./LaunchOutlined-E7HcQu_6.js";import{cq as Me,a9 as He,j as f,aa as $,w as ke,bb as p,X as ae,T as Y,L as Le,A as Ae,b5 as We,I as K,bo as he,bn as ge,q as De,e as qe,m as ve,H as P,ab as ze,ak as Ve,y as Be,b3 as $e}from"./vendor-mui-core-BV2FUxWJ.js";import{r as Ke,a as Re,j as Je}from"./vendor-ux-did-connect-2jRoUb28.js";import{d as Ue}from"./ChevronLeft-DONyUbIg.js";import{d as Xe}from"./ChevronRight-DgAwWLdY.js";import{r as se,t as Se,i as T,a as F,b as j,p as Ge,c as Qe,d as ie,e as ne,s as A,f as W,g as _,h as q,j as z,k as J,l as U,m as Ze,n as re,o as L,q as xe,u as le,v as et,w as tt,x as at,y as nt,z as rt}from"./index-iB7JyXwh.js";import{f as ot}from"./index-8eXqqyHQ.js";import{B as st}from"./base-chart-D6qRW4Yg.js";import{L as it,c as lt}from"./vendor-mui-x-Bo-XOtzq.js";import{A as ct}from"./AdapterDayjs-CDDcwz3P.js";function we(e){se(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(Me(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(o){var s=Se(o);(a===void 0||a<s||isNaN(Number(s)))&&(a=s)}),a||new Date(NaN)}function Ce(e){se(1,arguments);var t;if(e&&typeof e.forEach=="function")t=e;else if(Me(e)==="object"&&e!==null)t=Array.prototype.slice.call(e);else return new Date(NaN);var a;return t.forEach(function(o){var s=Se(o);(a===void 0||a>s||isNaN(s.getDate()))&&(a=s)}),a||new Date(NaN)}function ut(e){return se(1,arguments),T(e,Date.now())}var ce={},dt=He;Object.defineProperty(ce,"__esModule",{value:!0});var je=ce.default=void 0,mt=dt(Ke()),ft=f;je=ce.default=(0,mt.default)((0,ft.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");const pt=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(a,o)=>e.slice(o*t,o*t+t)),ht=(e,t)=>{const a=A(q(e),{locale:t}),o=W(z(e),{locale:t}),s=[];for(let i=a;L(i,o);)s.push(i),i=ne(i,1);return s},gt=({startDate:e},t)=>e&&T(t,e),Dt=({endDate:e},t)=>e&&T(t,e),vt=({startDate:e,endDate:t},a)=>e&&t&&(le(a,{start:e,end:t})||T(a,e)||T(a,t)),xt=({startDate:e,endDate:t})=>e&&t?T(e,t):!1,be=(e,t)=>{if(e){const a=e instanceof Date?e:Ge(e);if(Qe(a))return a}return t},bt=(e,t,a)=>{const{startDate:o,endDate:s}=e;if(o&&s){const i=we([o,t]),u=Ce([s,a]);return[i,ie(i,u)?j(i,1):u]}return[o,s]},Et=(e,t)=>[{label:"Today",startDate:e,endDate:e},{label:"Yesterday",startDate:ne(e,-1),endDate:ne(e,-1)},{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(_(e,-1),{locale:t}),endDate:W(_(e,-1),{locale:t})},{label:"Last 7 Days",startDate:_(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:z(e)},{label:"Last Month",startDate:q(j(e,-1)),endDate:z(j(e,-1))},{label:"This Year",startDate:J(e),endDate:U(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:U(F(e,-1))}],yt=(e,t)=>{const a=Math.floor(t/2);return Array(t).fill(0).map((o,s)=>e.getFullYear()-a+s)},Mt=({date:e,setDate:t,nextDisabled:a,prevDisabled:o,onClickNext:s,onClickPrevious:i,locale:u})=>{const d=typeof u<"u"?[...Array(12).keys()].map(l=>{var D;return(D=u.localize)===null||D===void 0?void 0:D.month(l,{width:"abbreviated",context:"standalone"})}):["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],h=l=>{t(nt(e,parseInt(l.target.value,10)))},c=l=>{t(rt(e,parseInt(l.target.value,10)))};return n.createElement(p,{container:!0,justifyContent:"space-between",alignItems:"center"},n.createElement(p,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:o,onClick:i},n.createElement(Ue,{color:o?"disabled":"action"}))),n.createElement(p,{item:!0},n.createElement(he,{variant:"standard"},n.createElement(ge,{value:tt(e),onChange:h,MenuProps:{disablePortal:!0}},d.map((l,D)=>n.createElement(De,{key:l,value:D},l))))),n.createElement(p,{item:!0},n.createElement(he,{variant:"standard"},n.createElement(ge,{value:at(e),onChange:c,MenuProps:{disablePortal:!0}},yt(e,30).map(l=>n.createElement(De,{key:l,value:l},l))))),n.createElement(p,{item:!0,sx:{padding:"5px"}},n.createElement(K,{sx:{padding:"10px","&:hover":{background:"none"}},disabled:a,onClick:s},n.createElement(Xe,{color:a?"disabled":"action"}))))},kt=({startOfRange:e,endOfRange:t,disabled:a,highlighted:o,outlined:s,filled:i,onClick:u,onHover:d,value:h})=>n.createElement($,{sx:{display:"flex",borderRadius:e?"50% 0 0 50%":t?"0 50% 50% 0":void 0,backgroundColor:c=>!a&&o?c.palette.primary.light:void 0}},n.createElement(K,{sx:Object.assign({height:"36px",width:"36px",padding:0,border:c=>!a&&s?`1px solid ${c.palette.primary.dark}`:void 0},!a&&i?{"&:hover":{backgroundColor:c=>c.palette.primary.dark},backgroundColor:c=>c.palette.primary.dark}:{}),disabled:a,onClick:u,onMouseOver:d},n.createElement(Y,{sx:{lineHeight:1.6,color:c=>a?c.palette.text.secondary:i?c.palette.primary.contrastText:c.palette.text.primary},variant:"body2"},h)));var X;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(X||(X={}));const Ee=e=>{var t;const{helpers:a,handlers:o,value:s,dateRange:i,marker:u,setValue:d,minDate:h,maxDate:c,locale:l}=e,D=((t=l==null?void 0:l.options)===null||t===void 0?void 0:t.weekStartsOn)||0,w=typeof l<"u"?[...Array(7).keys()].map(g=>{var x;return(x=l.localize)===null||x===void 0?void 0:x.day((g+D)%7,{width:"short",context:"standalone"})}):["Su","Mo","Tu","We","Th","Fr","Sa"],[v,k]=e.navState;return n.createElement(ke,{square:!0,elevation:0,sx:{width:290}},n.createElement(p,{container:!0},n.createElement(Mt,{date:s,setDate:d,nextDisabled:!k,prevDisabled:!v,onClickPrevious:()=>o.onMonthNavigate(u,X.Previous),onClickNext:()=>o.onMonthNavigate(u,X.Next),locale:l}),n.createElement(p,{item:!0,container:!0,direction:"row",justifyContent:"space-between",sx:{marginTop:"10px",paddingLeft:"30px",paddingRight:"30px"}},w.map((g,x)=>n.createElement(Y,{color:"textSecondary",key:x,variant:"caption"},g))),n.createElement(p,{item:!0,container:!0,direction:"column",justifyContent:"space-between",sx:{paddingLeft:"15px",paddingRight:"15px",marginTop:"15px",marginBottom:"20px"}},pt(ht(s,l),7).map((g,x)=>n.createElement(p,{key:x,container:!0,direction:"row",justifyContent:"center"},g.map(m=>{const y=gt(i,m),C=Dt(i,m),E=xt(i),R=vt(i,m)||a.inHoverRange(m);return n.createElement(kt,{key:re(m,"dd-MM-yyyy"),filled:y||C,outlined:ut(m),highlighted:R&&!E,disabled:!ie(s,m)||!le(m,{start:h,end:c}),startOfRange:y&&!E,endOfRange:C&&!E,onClick:()=>o.onDayClick(m),onHover:()=>o.onDayHover(m),value:et(m)})}))))))},ye=(e,t)=>{const{startDate:a,endDate:o}=e,{startDate:s,endDate:i}=t;return a&&s&&o&&i?T(a,s)&&T(o,i):!1},Rt=({ranges:e,setRange:t,selectedRange:a})=>n.createElement(Le,null,e.map((o,s)=>n.createElement(Ae,{button:!0,key:s,onClick:()=>t(o),sx:[ye(o,a)&&{backgroundColor:i=>i.palette.primary.dark,color:"primary.contrastText","&:hover":{color:"inherit"}}]},n.createElement(We,{primaryTypographyProps:{variant:"body2",sx:{fontWeight:ye(o,a)?"bold":"normal"}}},o.label)))),oe={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},St=e=>{const{ranges:t,dateRange:a,minDate:o,maxDate:s,firstMonth:i,setFirstMonth:u,secondMonth:d,setSecondMonth:h,setDateRange:c,helpers:l,handlers:D,locale:w}=e,{startDate:v,endDate:k}=a,g=Ze(d,i)>=2,x={dateRange:a,minDate:o,maxDate:s,helpers:l,handlers:D};return n.createElement(ke,{elevation:5,square:!0},n.createElement(p,{container:!0,direction:"row",wrap:"nowrap"},n.createElement(p,null,n.createElement(Rt,{selectedRange:a,ranges:t,setRange:c})),n.createElement(ae,{orientation:"vertical",flexItem:!0}),n.createElement(p,null,n.createElement(p,{container:!0,sx:{padding:"20px 70px"},alignItems:"center"},n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},v?re(v,"dd MMMM yyyy",{locale:w}):"Start Date")),n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(je,{color:"action"})),n.createElement(p,{item:!0,sx:{flex:1,textAlign:"center"}},n.createElement(Y,{variant:"subtitle1"},k?re(k,"dd MMMM yyyy",{locale:w}):"End Date"))),n.createElement(ae,null),n.createElement(p,{container:!0,direction:"row",justifyContent:"center",wrap:"nowrap"},n.createElement(Ee,Object.assign({},x,{value:i,setValue:u,navState:[!0,g],marker:oe.FIRST_MONTH,locale:w})),n.createElement(ae,{orientation:"vertical",flexItem:!0}),n.createElement(Ee,Object.assign({},x,{value:d,setValue:h,navState:[g,!0],marker:oe.SECOND_MONTH,locale:w}))))))},wt=e=>{const t=new Date,{open:a,onChange:o,initialDateRange:s,minDate:i,maxDate:u,definedRanges:d=Et(new Date,e.locale),locale:h}=e,c=be(i,F(t,-10)),l=be(u,F(t,10)),[D,w]=bt(s||{},c,l),[v,k]=M.useState(Object.assign({},s)),[g,x]=M.useState(),[m,y]=M.useState(D||t),[C,E]=M.useState(w||j(m,1)),{startDate:R,endDate:I}=v,H=r=>{L(r,C)&&y(r)},G=r=>{xe(r,m)&&E(r)},V=r=>{let{startDate:b,endDate:S}=r;if(b&&S)r.startDate=b=we([b,c]),r.endDate=S=Ce([S,l]),k(r),o(r),y(b),E(ie(b,S)?j(b,1):S);else{const me={};k(me),o(me),y(t),E(j(m,1))}},Q=r=>{if(R&&!I&&!L(r,R)){const b={startDate:R,endDate:r};o(b),k(b)}else k({startDate:r,endDate:void 0});x(r)},Z=(r,b)=>{if(r===oe.FIRST_MONTH){const S=j(m,b);L(S,C)&&y(S)}else{const S=j(C,b);L(m,S)&&E(S)}},B=r=>{R&&!I&&(!g||!T(r,g))&&x(r)},ee={inHoverRange:r=>R&&!I&&g&&xe(g,R)&&le(r,{start:R,end:g})},te={onDayClick:Q,onDayHover:B,onMonthNavigate:Z};return a?M.createElement(St,{dateRange:v,minDate:c,maxDate:l,ranges:d,firstMonth:m,secondMonth:C,setFirstMonth:H,setSecondMonth:G,setDateRange:V,helpers:ee,handlers:te,locale:h}):null},Ct=e=>{const{closeOnClickOutside:t,wrapperClassName:a,toggle:o,open:s}=e,i=()=>{t!==!1&&o()},u=d=>(d==null?void 0:d.key)==="Escape"&&i();return n.createElement($,{sx:{position:"relative"}},s&&n.createElement($,{sx:{position:"fixed",height:"100vh",width:"100vw",bottom:0,zIndex:0,right:0,left:0,top:0},onKeyPress:u,onClick:i}),n.createElement($,{sx:{position:"relative",zIndex:1},className:a},n.createElement(wt,Object.assign({},e))))},jt=e=>n.createElement(Ct,Object.assign({},e));function ue({title:e,total:t,hoverIndex:a,onHover:o,history:s,valueFn:i}){const u=qe(),{locale:d}=Re(),h=[{min:0,max:t,color:ve(u.palette.primary.main,u.palette.mode==="dark"?.15:.08)},{min:t,color:ve(u.palette.primary.main,u.palette.mode==="dark"?.15:.08)}];return f.jsx(st,{title:e,total:t,history:s,valueFn:i,onHover:o,hoverIndex:a,xAxisFormat:c=>Te(c,"MM-DD",d),visualMapPieces:h,markLineData:void 0,extraInfo:null})}ue.propTypes={title:P.string,total:P.number,history:P.array,valueFn:P.func,hoverIndex:P.number,onHover:P.func};ue.defaultProps={title:"",total:0,history:[],valueFn:e=>e,hoverIndex:null,onHover:()=>{}};const O=Pe(0),Oe=(e,t)=>[{label:"This Week",startDate:A(e,{locale:t}),endDate:W(e,{locale:t})},{label:"Last Week",startDate:A(_(e,-1),{locale:t}),endDate:W(_(e,-1),{locale:t})},{label:"Last 7 Days",startDate:_(e,-1),endDate:e},{label:"This Month",startDate:q(e),endDate:z(e)},{label:"Last Month",startDate:q(j(e,-1)),endDate:z(j(e,-1))},{label:"This Year",startDate:J(e),endDate:U(e)},{label:"Last Year",startDate:J(F(e,-1)),endDate:U(F(e,-1))}],Ot=Array.from({length:7},(e,t)=>({value:0,date:N().subtract(t,"day").format("YYYY-MM-DD")})).reverse();function Tt({client:e,did:t}){const a=N().subtract(1,"day").toDate(),{info:o,inService:s}=Ne(),{t:i,locale:u}=Re(),[d,h]=M.useState(null),[c,l]=M.useState(!1),[D,w]=M.useState(a),[v,k]=M.useState({startDate:N().subtract(30,"day").toDate(),endDate:a}),[g,x]=M.useState(null),m=M.useCallback(r=>{x(r)},[]),y=_e(async()=>(await e.getTrafficInsights({input:{did:t,startDate:N(v.startDate).format("YYYY-MM-DD"),endDate:N(v.endDate).format("YYYY-MM-DD")}})).list);M.useEffect(()=>{y.loading||v.startDate&&v.endDate&&y.retry()},[v]);const C=r=>{h(d?null:r.currentTarget)},E=y.value||[],{loading:R,error:I}=y;if(!E.length&&R)return f.jsx(ze,{});if(I)return f.jsx(Ve,{severity:"error",children:ot(I)});const H={totalRequests:O,validRequests:O,failedRequests:O,uniqueVisitors:O,uniqueFiles:O,uniqueReferrers:O,uniqueNotFound:O,uniqueStaticFiles:O,logSize:fe,bandwidth:fe},G=Object.keys(H).map(r=>({id:`${r}_chart`,title:i(`analytics.traffic.${r}`),current:E.length?H[r](E[0][r]):0,data:E.length?E.map(b=>({date:b.date,value:b[r]})).reverse():Ot,dateFn:O,valueFn:H[r],total:0})),V=!!d,Q=V?"date-range-picker-popover":void 0,Z=s?Je.WELLKNOWN_SERVICE_PATH_PREFIX:o.routing.adminPath,B=Ie(window.location.origin,Z,`/api/analytics/traffic?date=${N(D).format("YYYY-MM-DD")}&did=${t}`),de=r=>{k(r),h(null)},ee=r=>{w(r.toDate()),l(!1)},te=()=>{window.open(B)};return f.jsxs("div",{children:[f.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[i("analytics.trend"),f.jsxs(Be,{onClick:C,variant:"outlined",size:"small",color:"inherit",sx:{fontWeight:400},children:[pe(v.startDate,u)," - ",pe(v.endDate,u)]})]}),f.jsx($e,{id:Q,open:V,anchorEl:d,onClose:()=>h(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:f.jsx(jt,{open:!0,toggle:C,maxDate:a,definedRanges:Oe(D),onChange:de})}),f.jsx(p,{container:!0,spacing:4,children:G.map(r=>f.jsx(p,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:f.jsx(ue,{title:`${r.title}`,total:r.total,empty:null,history:r.data,style:{height:150},valueFn:r.valueFn,hoverIndex:g,onHover:m})},r.id))}),f.jsxs(Y,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[i("analytics.detail"),f.jsxs("span",{children:[c&&f.jsx(K,{onClick:te,style:{marginRight:32},children:f.jsx(Fe,{})}),f.jsx(it,{dateAdapter:ct,children:f.jsx(lt,{disableFuture:!0,format:"ll",value:N(D),onChange:ee,slotProps:{textField:{size:"small"}}})})]})]}),f.jsx(Ye,{url:B,width:"100%",height:"100%",frameBorder:0,onLoad:()=>l(!0),styles:{border:0,minHeight:"400vh"}})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt,getDefaultRanges:Oe},Symbol.toStringTag,{value:"Module"}));export{jt as D,Oe as g,Kt as t};
@@ -1,4 +1,4 @@
1
- import{j as e,ab as k,aa as f,T,ah as m}from"./vendor-mui-core-BV2FUxWJ.js";import{a as A,j as b,B as R,aq as D}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as P}from"./addon-CRj4Enw7.js";import{L as E}from"./landing-page-DrVLCVAm.js";import{R as I,b as L}from"./vendor-arcblock-BlrkGjK9.js";import{d as B}from"./CheckCircle-Caqp5gKY.js";import{l as F}from"./vendor-hooks-BgUTpb6X.js";import{r as o}from"./vendor-react-DEoibe3W.js";import{u as H,d as W,s as _,a as q,S as z}from"./index-B_NDUfon.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./QuestionMarkCircle-DTGyWFVS.js";function se(){var i,c,l,p;const{t:s,locale:u}=A(),{api:h,session:x}=H(),{searchParams:g}=new URL(window.location.href),[j,S]=o.useState(!1),r=g.get("transferId"),v=(i=window==null?void 0:window.env)==null?void 0:i.appId,w=o.useCallback(async()=>{const{data:t}=await W.get("/blocklet/transfer",{params:{transferId:r}});return t},[r]),a=F(w),C=o.useCallback(async(t,d)=>{t&&(_(d(t.sessionToken)),q(d(t.refreshToken))),await x.refresh(),S(!0)},[]);if(a.loading)return e.jsx(k,{});if(a.error)return e.jsx(K,{children:e.jsx(I,{status:"404",title:(l=(c=a.error)==null?void 0:c.response)==null?void 0:l.data,description:""})});const y=a.data.status==="success";let n;return y||j?n=e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsx(P,{SessionContext:z})}),e.jsx(f,{pt:1,color:"success.main",children:e.jsx(B,{style:{fontSize:80}})}),e.jsx(T,{my:4,variant:"h5",children:s("team.transferApp.successTitle")}),e.jsx("a",{href:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`,children:e.jsx(R,{variant:"contained",children:s("team.transferApp.visitDashboard")})})]}):n=e.jsx(D,{popup:!0,open:!0,action:"receive-transfer-app-owner",checkFn:h.get,forceConnected:!1,autoConnect:!1,checkTimeout:10*60*1e3,onSuccess:C,onClose:()=>{},locale:u,messages:{title:s("team.transferApp.receiveDialog.title"),scan:s("team.transferApp.receiveDialog.scan"),confirm:s("team.transferApp.receiveDialog.confirm"),success:s("team.transferApp.receiveDialog.success")},extraParams:{transferId:r,appDid:v},hideCloseButton:!0}),e.jsx(E,{did:(p=window.blocklet)==null?void 0:p.appPid,children:e.jsx(f,{sx:{maxWidth:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:n})})}const N=m(L)`
1
+ import{j as e,ab as k,aa as f,T,ah as m}from"./vendor-mui-core-BV2FUxWJ.js";import{a as A,j as b,B as R,aq as D}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as P}from"./addon-CRj4Enw7.js";import{L as E}from"./landing-page-DrVLCVAm.js";import{R as I,b as L}from"./vendor-arcblock-BlrkGjK9.js";import{d as B}from"./CheckCircle-Caqp5gKY.js";import{l as F}from"./vendor-hooks-BgUTpb6X.js";import{r as o}from"./vendor-react-DEoibe3W.js";import{u as H,d as W,s as _,a as q,S as z}from"./index-DDoVX3je.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./QuestionMarkCircle-DTGyWFVS.js";function se(){var i,c,l,p;const{t:s,locale:u}=A(),{api:h,session:x}=H(),{searchParams:g}=new URL(window.location.href),[j,S]=o.useState(!1),r=g.get("transferId"),v=(i=window==null?void 0:window.env)==null?void 0:i.appId,w=o.useCallback(async()=>{const{data:t}=await W.get("/blocklet/transfer",{params:{transferId:r}});return t},[r]),a=F(w),C=o.useCallback(async(t,d)=>{t&&(_(d(t.sessionToken)),q(d(t.refreshToken))),await x.refresh(),S(!0)},[]);if(a.loading)return e.jsx(k,{});if(a.error)return e.jsx(K,{children:e.jsx(I,{status:"404",title:(l=(c=a.error)==null?void 0:c.response)==null?void 0:l.data,description:""})});const y=a.data.status==="success";let n;return y||j?n=e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsx(P,{SessionContext:z})}),e.jsx(f,{pt:1,color:"success.main",children:e.jsx(B,{style:{fontSize:80}})}),e.jsx(T,{my:4,variant:"h5",children:s("team.transferApp.successTitle")}),e.jsx("a",{href:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`,children:e.jsx(R,{variant:"contained",children:s("team.transferApp.visitDashboard")})})]}):n=e.jsx(D,{popup:!0,open:!0,action:"receive-transfer-app-owner",checkFn:h.get,forceConnected:!1,autoConnect:!1,checkTimeout:10*60*1e3,onSuccess:C,onClose:()=>{},locale:u,messages:{title:s("team.transferApp.receiveDialog.title"),scan:s("team.transferApp.receiveDialog.scan"),confirm:s("team.transferApp.receiveDialog.confirm"),success:s("team.transferApp.receiveDialog.success")},extraParams:{transferId:r,appDid:v},hideCloseButton:!0}),e.jsx(E,{did:(p=window.blocklet)==null?void 0:p.appPid,children:e.jsx(f,{sx:{maxWidth:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:n})})}const N=m(L)`
2
2
  position: fixed;
3
3
  top: 16px;
4
4
  right: 16px;
@@ -1 +1 @@
1
- import{j as i,aa as t,bK as C,bV as w,bW as k,bX as E,T as L}from"./vendor-mui-core-BV2FUxWJ.js";import{u as R,L as v}from"./vendor-react-DEoibe3W.js";import{a as F,B as u,a0 as a,aO as P,j as d}from"./vendor-ux-did-connect-2jRoUb28.js";import{a as T,u as f,m as S}from"./vendor-hooks-BgUTpb6X.js";import{A as m}from"./vendor-utils-rHXShPKm.js";import{u as I}from"./index-B_NDUfon.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BlrkGjK9.js";function B(){var c,l;const{api:b}=I(),h=R(),{t:n}=F(),r=new URLSearchParams(h.search).get("token"),e=T({error:"",finished:!1,loading:!1}),p=f(()=>{window.close(),window.location.replace("/")}),x=f(async()=>{try{e.loading=!0;const{data:o}=await b.post("/api/user/notification/unsubscribe",{token:r});o.success===!0?(e.finished=!0,a.success(n("notification.unsubscribeSucceed"))):(e.finished=!1,a.error(n("notification.unsubscribeFailed")))}catch(o){e.finished=!1,a.error(o.message||n("notification.unsubscribeFailed"))}finally{e.loading=!1}});S(()=>{if(!r)e.error=n("notification.unsubscribeTokenRequired");else{const o=P(r);if(!o)e.error=n("notification.unsubscribeTokenInvalid");else{const{exp:y}=o;y*1e3<=Date.now()&&(e.error=n("notification.unsubscribeTokenExpired"))}}});const s=(c=window==null?void 0:window.blocklet)==null?void 0:c.copyright,g=(s==null?void 0:s.owner)||((l=window==null?void 0:window.blocklet)==null?void 0:l.appName),j=(s==null?void 0:s.year)||new Date().getFullYear();return i.jsx(t,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#fafafa"},children:i.jsxs(t,{sx:{width:"450px",maxWidth:"90%"},children:[i.jsx(t,{sx:{width:"100%"},children:i.jsx("img",{style:{height:"40px"},src:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-rect?imageFilter=convert&f=png"),alt:"blocklet logo"})}),i.jsxs(C,{variant:"outlined",sx:{my:1},children:[i.jsx(w,{title:e.finished?n("notification.unsubscribeSucceed"):n("notification.email.unsubscribe")}),i.jsxs(k,{sx:{minHeight:"10em"},children:[e.error?e.error:null,!e.error&&!e.finished?n("notification.email.unsubscribeDescription"):null,!e.error&&e.finished?i.jsxs(i.Fragment,{children:[n("notification.email.subscribeDescription")," ",i.jsx(v,{to:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/user/settings"),color:"primary",children:n("notification.email.subscribe")})]}):null]}),i.jsxs(E,{sx:{justifyContent:"end!important"},children:[i.jsx(u,{size:"small",color:e.error?"error":"primary",variant:"outlined",onClick:p,children:n("common.close")}),e.error||e.finished?null:i.jsx(u,{size:"small",color:"primary",variant:"contained",onClick:x,loading:e.loading,children:n("notification.unsubscribe")})]})]}),i.jsxs(L,{variant:"body2",color:"gray",children:["Copyright © ",j," ",g]})]})})}export{B as default};
1
+ import{j as i,aa as t,bK as C,bV as w,bW as k,bX as E,T as L}from"./vendor-mui-core-BV2FUxWJ.js";import{u as R,L as v}from"./vendor-react-DEoibe3W.js";import{a as F,B as u,a0 as a,aO as P,j as d}from"./vendor-ux-did-connect-2jRoUb28.js";import{a as T,u as f,m as S}from"./vendor-hooks-BgUTpb6X.js";import{A as m}from"./vendor-utils-rHXShPKm.js";import{u as I}from"./index-DDoVX3je.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-BlrkGjK9.js";function B(){var c,l;const{api:b}=I(),h=R(),{t:n}=F(),r=new URLSearchParams(h.search).get("token"),e=T({error:"",finished:!1,loading:!1}),p=f(()=>{window.close(),window.location.replace("/")}),x=f(async()=>{try{e.loading=!0;const{data:o}=await b.post("/api/user/notification/unsubscribe",{token:r});o.success===!0?(e.finished=!0,a.success(n("notification.unsubscribeSucceed"))):(e.finished=!1,a.error(n("notification.unsubscribeFailed")))}catch(o){e.finished=!1,a.error(o.message||n("notification.unsubscribeFailed"))}finally{e.loading=!1}});S(()=>{if(!r)e.error=n("notification.unsubscribeTokenRequired");else{const o=P(r);if(!o)e.error=n("notification.unsubscribeTokenInvalid");else{const{exp:y}=o;y*1e3<=Date.now()&&(e.error=n("notification.unsubscribeTokenExpired"))}}});const s=(c=window==null?void 0:window.blocklet)==null?void 0:c.copyright,g=(s==null?void 0:s.owner)||((l=window==null?void 0:window.blocklet)==null?void 0:l.appName),j=(s==null?void 0:s.year)||new Date().getFullYear();return i.jsx(t,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#fafafa"},children:i.jsxs(t,{sx:{width:"450px",maxWidth:"90%"},children:[i.jsx(t,{sx:{width:"100%"},children:i.jsx("img",{style:{height:"40px"},src:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-rect?imageFilter=convert&f=png"),alt:"blocklet logo"})}),i.jsxs(C,{variant:"outlined",sx:{my:1},children:[i.jsx(w,{title:e.finished?n("notification.unsubscribeSucceed"):n("notification.email.unsubscribe")}),i.jsxs(k,{sx:{minHeight:"10em"},children:[e.error?e.error:null,!e.error&&!e.finished?n("notification.email.unsubscribeDescription"):null,!e.error&&e.finished?i.jsxs(i.Fragment,{children:[n("notification.email.subscribeDescription")," ",i.jsx(v,{to:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/user/settings"),color:"primary",children:n("notification.email.subscribe")})]}):null]}),i.jsxs(E,{sx:{justifyContent:"end!important"},children:[i.jsx(u,{size:"small",color:e.error?"error":"primary",variant:"outlined",onClick:p,children:n("common.close")}),e.error||e.finished?null:i.jsx(u,{size:"small",color:"primary",variant:"contained",onClick:x,loading:e.loading,children:n("notification.unsubscribe")})]})]}),i.jsxs(L,{variant:"body2",color:"gray",children:["Copyright © ",j," ",g]})]})})}export{B as default};
@@ -1,2 +1,2 @@
1
- import{g as X,r as W,b as ce}from"./vendor-react-DEoibe3W.js";import{H as j,j as l,be as J,s as k,w as ue,aa as G,T as B,y as pe}from"./vendor-mui-core-BV2FUxWJ.js";import{f as M,u as Y}from"./vendor-hooks-BgUTpb6X.js";import{q as de,bc as fe,bd as he,be as me,bf as ge,j as Z,I as ye}from"./vendor-ux-did-connect-2jRoUb28.js";import{b as z,z as ee,A as C}from"./vendor-utils-rHXShPKm.js";import{u as ve}from"./session-C_8V_o-O.js";import{c as U,l as Le}from"./vendor-arcblock-BlrkGjK9.js";import{D as xe,Y as _e,W as Ee}from"./index-B_NDUfon.js";var b={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=N;var r=p(de),s=p(fe),n=p(he),a=p(me),u=p(ge);function p(o){return o&&o.__esModule?o:{default:o}}function h(o,i){return m(o)||w(o,i)||d(o,i)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{g as X,r as W,b as ce}from"./vendor-react-DEoibe3W.js";import{H as j,j as l,be as J,s as k,w as ue,aa as G,T as B,y as pe}from"./vendor-mui-core-BV2FUxWJ.js";import{f as M,u as Y}from"./vendor-hooks-BgUTpb6X.js";import{q as de,bc as fe,bd as he,be as me,bf as ge,j as Z,I as ye}from"./vendor-ux-did-connect-2jRoUb28.js";import{b as z,z as ee,A as C}from"./vendor-utils-rHXShPKm.js";import{u as ve}from"./session-C_8V_o-O.js";import{c as U,l as Le}from"./vendor-arcblock-BlrkGjK9.js";import{D as xe,Y as _e,W as Ee}from"./index-DDoVX3je.js";var b={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=N;var r=p(de),s=p(fe),n=p(he),a=p(me),u=p(ge);function p(o){return o&&o.__esModule?o:{default:o}}function h(o,i){return m(o)||w(o,i)||d(o,i)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(o,i){if(o){if(typeof o=="string")return O(o,i);var c={}.toString.call(o).slice(8,-1);return c==="Object"&&o.constructor&&(c=o.constructor.name),c==="Map"||c==="Set"?Array.from(o):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?O(o,i):void 0}}function O(o,i){(i==null||i>o.length)&&(i=o.length);for(var c=0,v=Array(i);c<i;c++)v[c]=o[c];return v}function w(o,i){var c=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(c!=null){var v,g,_,E,x=[],f=!0,S=!1;try{if(_=(c=c.call(o)).next,i!==0)for(;!(f=(v=_.call(c)).done)&&(x.push(v.value),x.length!==i);f=!0);}catch(P){S=!0,g=P}finally{try{if(!f&&c.return!=null&&(E=c.return(),Object(E)!==E))return}finally{if(S)throw g}}return x}}function m(o){if(Array.isArray(o))return o}var T={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},A=/^\[([^\]]+)\](?::([0-9]+))?$/;function N(o,i){if((0,r.default)(o),!o||/[\s<>]/.test(o)||o.indexOf("mailto:")===0||(i=(0,u.default)(i,T),i.validate_length&&o.length>i.max_allowed_length)||!i.allow_fragments&&o.includes("#")||!i.allow_query_components&&(o.includes("?")||o.includes("&")))return!1;var c,v,g,_,E,x,f,S;if(f=o.split("#"),o=f.shift(),f=o.split("?"),o=f.shift(),f=o.split("://"),f.length>1){if(c=f.shift().toLowerCase(),i.require_valid_protocol&&i.protocols.indexOf(c)===-1)return!1}else{if(i.require_protocol)return!1;if(o.slice(0,2)==="//"){if(!i.allow_protocol_relative_urls)return!1;f[0]=o.slice(2)}}if(o=f.join("://"),o==="")return!1;if(f=o.split("/"),o=f.shift(),o===""&&!i.require_host)return!0;if(f=o.split("@"),f.length>1){if(i.disallow_auth||f[0]===""||(v=f.shift(),v.indexOf(":")>=0&&v.split(":").length>2))return!1;var P=v.split(":"),y=h(P,2),oe=y[0],le=y[1];if(oe===""&&le==="")return!1}_=f.join("@"),x=null,S=null;var H=_.match(A);if(H?(g="",S=H[1],x=H[2]||null):(f=_.split(":"),g=f.shift(),f.length&&(x=f.join(":"))),x!==null&&x.length>0){if(E=parseInt(x,10),!/^[0-9]+$/.test(x)||E<=0||E>65535)return!1}else if(i.require_port)return!1;return i.host_whitelist?(0,s.default)(g,i.host_whitelist):g===""&&!i.require_host?!0:!(!(0,a.default)(g)&&!(0,n.default)(g,i)&&(!S||!(0,a.default)(S,6))||(g=g||S,i.host_blacklist&&(0,s.default)(g,i.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(b,b.exports);var Te=b.exports;const Se=X(Te),tt=e=>{if(!e||!e.length)return[];const t=[];let r=null,s=[];if(e.forEach(n=>{var m,T,A,N;if(!n.activity||!n.activity.type||!r){r&&(s.length===1?t.push(s[0]):(r.items=s,t.push(r))),n.activity&&n.activity.type?(r=n,s=[n]):(t.push(n),r=null,s=[]);return}const a=s[0].activity,u=a.type,p=(m=a.target)==null?void 0:m.type,h=(T=a.target)==null?void 0:T.id,L=n.activity.type,d=(A=n.activity.target)==null?void 0:A.type,O=(N=n.activity.target)==null?void 0:N.id;if(u&&L&&u===L&&(!a.target&&!n.activity.target||a.target&&n.activity.target&&p===d&&h===O))s.push(n);else{if(s.length===1)t.push(s[0]);else{const o=Object.assign({},r,{items:s});t.push(o)}r=n,s=[n]}}),r)if(s.length===1)t.push(s[0]);else{const n=Object.assign({},r,{items:s});t.push(n)}return t},Ce=e=>!z(e.activity)&&!!e.activity.type&&!!e.activity.actor,nt=e=>Ce(e)&&!!e.actorInfo&&!!e.actorInfo.did,Oe=e=>{if(!e)return null;const{meta:t,target:r,actor:s}=e||{};let n=r==null?void 0:r.id;return(r==null?void 0:r.type)==="user"&&(n=ee(C(Z.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:s})),{metaLink:t==null?void 0:t.id,targetLink:n}},we=e=>Se(e),R={COMMENT:"comment",LIKE:"like",FOLLOW:"follow",TIPS:"tips",MENTION:"mention",ASSIGN:"assign",UN_ASSIGN:"un_assign"},Ae={[R.COMMENT]:(e,t,r)=>t>1?l.jsxs(l.Fragment,{children:["have left ",t," comments on ",r?"your":"the"," ",e,":"]}):l.jsxs(l.Fragment,{children:["has commented on ",r?"your":"the"," ",e,":"]}),[R.LIKE]:(e,t,r)=>t>1?l.jsxs(l.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}):l.jsxs(l.Fragment,{children:["have liked ",r?"your":"the"," ",e,":"]}),[R.FOLLOW]:(e,t)=>t>1?l.jsx(l.Fragment,{children:"have followed you"}):l.jsx(l.Fragment,{children:"has followed you"}),[R.TIPS]:(e,t,r)=>t>1?l.jsxs(l.Fragment,{children:["left tips for ",r?"your":"the"," ",e,":"]}):l.jsxs(l.Fragment,{children:["left a tip for ",r?"your":"the"," ",e,":"]}),[R.MENTION]:(e,t,r)=>t>1?l.jsxs(l.Fragment,{children:["have mentioned you in ",r?"your":"the"," ",e,":"]}):l.jsxs(l.Fragment,{children:["mentioned you in ",r?"your":"the"," ",e,":"]}),[R.ASSIGN]:()=>l.jsx(l.Fragment,{children:"has assigned you a task: "}),[R.UN_ASSIGN]:()=>l.jsx(l.Fragment,{children:"has revoked your task assignment: "})},F=W.memo(function({user:t,color:r="text.secondary"}){const s=ee(C(Z.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:t.did});return l.jsx(J,{href:s,color:r,fontWeight:600,target:"_blank",sx:{textDecoration:"none"},onClick:n=>{n.customPreventRedirect=!0},children:t.fullName||"System"})});F.propTypes={user:j.shape({did:j.string.isRequired,fullName:j.string.isRequired}).isRequired,color:j.string};F.displayName="UserLink";function rt({activity:e,users:t,actors:r,extra:s={},mountPoint:n=""}){const{session:a}=ve()||{},{type:u,target:p}=e||{},{type:h,author:L}=p||{},{linkColor:d="text.secondary"}=s||{},O=M(()=>{var c;return L?(((c=a==null?void 0:a.user)==null?void 0:c.did)||(s==null?void 0:s.userDid))===L:!0},[a,L]),w=M(()=>{if(!Array.isArray(t))return new Map;const i=new Map;return t.forEach(c=>{c!=null&&c.did&&!i.has(c.did)&&i.set(c.did,c)}),i},[t]),m=M(()=>Array.isArray(r)?[...new Set(r)].map(c=>c?w.get(c)||{did:c,fullName:"System"}:null):[],[r,w]),T=Y(()=>{if(!Array.isArray(m)||m.length===0)return null;if(m.length===1)return l.jsx(F,{user:m[0],color:d});const i=m.slice(0,-1),c=m[m.length-1];if(m.length===2)return l.jsxs(l.Fragment,{children:[l.jsx(F,{user:i[0],color:d})," and ",l.jsx(F,{user:c,color:d})]});const v=m.length>3,g=v?m.slice(0,2):i;return l.jsxs(l.Fragment,{children:[g.map((_,E)=>l.jsxs(ce.Fragment,{children:[l.jsx(F,{user:_,color:d}),E<g.length-1?", ":""]},_.did)),v?`, and ${m.length-2} others`:l.jsxs(l.Fragment,{children:[", and ",l.jsx(F,{user:c,color:d})]})]})}),A=Y(()=>{const i=Ae[u];return i?i(h==="doc"?"document":h,t.length,O):null}),N=M(()=>{const i=T(),c=A();return!i||!c?null:l.jsxs(l.Fragment,{children:[i," ",c]})},[u,h,m,T,A]),o=M(()=>{if(!e)return null;const i=Oe(e);return i!=null&&i.targetLink?we(i==null?void 0:i.targetLink)?i==null?void 0:i.targetLink:C(n,i.targetLink):null},[e,n]);return!u||z(p)?null:l.jsxs(l.Fragment,{children:[N," ",l.jsx(J,{href:o,color:"primary",target:"_blank",sx:{textDecoration:"none"},onClick:i=>{i.customPreventRedirect=!0},children:p.name||p.desc})]})}const je={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 7L7 17M8 7h9v9"/>'};te.propTypes={meta:j.object.isRequired};const Ne=k(ue)(({theme:e})=>({maxWidth:320,display:"flex",flexDirection:"column",gap:e.spacing(1.5),padding:e.spacing(2),marginTop:e.spacing(1),borderRadius:e.spacing(1),border:`1px solid ${e.palette.divider}`,boxShadow:"none"})),Ue=k(G)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1),marginBottom:e.spacing(1)})),Ie=k(G)({display:"flex",justifyContent:"space-between",alignItems:"center"});function te({meta:e}){const{amount:t,symbol:r,chainId:s}=e,n=()=>{window.open(`https://explorer.arcblock.io/chain/${s}`,"_blank")};return l.jsxs(Ne,{children:[l.jsxs(Ue,{children:[l.jsx("img",{alt:"ArcBlock Beta",src:"https://bbqat7g5cg33cyr4pdrd6foycgzfb5xxeh2se7gcqkq.did.abtnet.io/payment-kit/methods/arcblock.png",width:32,height:32,style:{borderRadius:16}}),l.jsx(B,{variant:"h5",color:"text.primary",children:"ArcBlock"})]}),l.jsxs(Ie,{children:[l.jsxs(G,{display:"flex",alignItems:"baseline",gap:1,children:[l.jsxs(B,{component:"span",variant:"h5",color:"text.primary",fontWeight:"bold",children:["+ ",t]}),l.jsx(B,{component:"span",variant:"subtitle2",color:"text.secondary",children:r})]}),l.jsx(pe,{variant:"outlined",size:"small",color:"secondary",endIcon:l.jsx(ye,{icon:je}),onClick:n,sx:{borderRadius:4},children:"View on Chain"})]})]})}ne.propTypes={meta:j.object.isRequired,type:j.string.isRequired,hideTips:j.bool,sx:j.object};ne.defaultProps={hideTips:!1,sx:{}};function ne({meta:e,type:t,hideTips:r=!1,sx:s}){return z(e)?null:t==="tips"&&!r?l.jsx(te,{meta:e}):l.jsx(B,{variant:"subtitle2",fontSize:16,component:"p",sx:s,color:"text.secondary",children:e.content})}var Re=W;function Fe(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var $=Fe(Re);function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},K.apply(this,arguments)}function Pe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q(e,t)}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},q(e,t)}function Me(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,a;for(a=0;a<s.length;a++)n=s[a],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}var V={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Be=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function He(e,t){if(!e||typeof e!="object")return e;var r={};return Object.keys(e).forEach(function(s){t.indexOf(s)>-1||(r[s]=e[s])}),r}var $e=["component","className","unsafeHTML"];function re(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var r=document.createDocumentFragment(),s;switch(t){case"words":s=e.textContent.split(/\b|(?=\W)/);break;case"letters":s=Array.from(e.textContent);break}s.forEach(function(p){r.appendChild(De(p))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var n=[].slice.call(e.childNodes),a=n.length,u=0;u<a;u++)re(n[u],t)}function De(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function Q(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function se(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);se(e.parentNode,t)}}function be(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function D(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ie={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Ke=Object.keys(ie),ae=function(e){Pe(t,e);function t(s){var n;return n=e.call(this,s)||this,n.state={html:s.unsafeHTML,clamped:!1},n.canvas=null,n.maxLine=0,n.nlUnits=[],n}var r=t.prototype;return r.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},r.componentDidUpdate=function(n){n.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==n&&this.reflow(this.props)},r.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},r.setState=function(n,a){return typeof n.clamped<"u"&&(this.clamped=n.clamped),e.prototype.setState.call(this,n,a)},r.initCanvas=function(){if(!this.canvas){var n=this.canvas=document.createElement("div");n.className="LinesEllipsis-canvas "+this.props.className,n.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(V).forEach(function(a){n.style[a]=V[a]}),document.body.appendChild(n)}},r.copyStyleToCanvas=function(){var n=this,a=window.getComputedStyle(this.target);Be.forEach(function(u){n.canvas.style[u]=a[u]})},r.reflow=function(n){this.maxLine=+n.maxLine||1,this.canvas.innerHTML=n.unsafeHTML;var a=n.basedOn||(/^[\x00-\x7F]+$/.test(n.unsafeHTML)?"words":"letters");re(this.canvas,a);var u=this.putEllipsis(this.calcIndexes()),p={clamped:u,html:this.canvas.innerHTML};this.setState(p,n.onReflow.bind(this,p))},r.calcIndexes=function(){var n=[0],a=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),u=a.length;if(!a.length)return n;var p=a.find(D);if(!p)return n;for(var h=1,L=p.offsetTop,d=1;d<u&&!(D(a[d])&&a[d].offsetTop-L>1&&(h++,n.push(d),L=a[d].offsetTop,h>this.maxLine));d++);return n},r.putEllipsis=function(n){if(n.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,n[this.maxLine]);var a=this.nlUnits.pop(),u=this.makeEllipsisSpan();do se(a,this.canvas),be(a).appendChild(u),a=this.nlUnits.pop();while(a&&(!D(a)||u.offsetHeight>a.offsetHeight||u.offsetTop>a.offsetTop));return a&&Q(a),this.nlUnits.forEach(Q),!0},r.makeEllipsisSpan=function(){var n=this.props,a=n.ellipsisHTML,u=n.ellipsis,p=document.createElement("span");p.appendChild(document.createElement("wbr"));var h=document.createElement("span");return h.className="LinesEllipsis-ellipsis",a?h.innerHTML=a:h.textContent=u,p.appendChild(h),p},r.isClamped=function(){return this.clamped},r.render=function(){var n=this,a=this.state,u=a.html,p=a.clamped,h=this.props,L=h.component,d=h.className,O=h.unsafeHTML,w=Me(h,$e);return $.default.createElement(L,K({className:"LinesEllipsis "+(p?"LinesEllipsis--clamped":"")+" "+d,ref:function(T){return n.target=T}},He(w,Ke)),$.default.createElement("div",{dangerouslySetInnerHTML:{__html:p?u:O}}))},t}($.default.Component);ae.defaultProps=ie;var qe=ae;const st=X(qe),We=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},ke=e=>{try{return new URL(e).host}catch{return e}};var it={getChainHost:We,getUrlHost:ke},at={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}};const I=(e,t)=>{var s;let r="?v=";return t?r+=_e(t):r+=`${(s=e==null?void 0:e.meta)==null?void 0:s.version}${Ee(e==null?void 0:e.status)?"~":""}`,r};function Ge({blocklet:e}){var c,v,g,_,E,x,f,S,P;const{inService:t}=xe(),r=(c=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE))==null?void 0:c.value,s=(v=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE_DARK))==null?void 0:v.value,n=(g=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT))==null?void 0:g.value,a=(_=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT_DARK))==null?void 0:_.value,u=(E=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON))==null?void 0:E.value,p=(x=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_PORTRAIT))==null?void 0:x.value,h=(f=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPLASH_LANDSCAPE))==null?void 0:f.value,L=(S=((e==null?void 0:e.environments)||[]).find(y=>y.key===U.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_OG_IMAGE))==null?void 0:S.value,d=((P=window.env)==null?void 0:P.apiPrefix)||"/",O=`${C(d,`/blocklet/logo/${t?"":e.meta.did}`)}${I(e,r)}`,w=`${C(d,`/blocklet/logo-dark/${t?"":e.meta.did}`)}${I(e,s)}`,m=`${C(d,`/blocklet/logo-rect/${t?"":e.meta.did}`)}${I(e,n??r)}`,T=`${C(d,`/blocklet/logo-rect-dark/${t?"":e.meta.did}`)}${I(e,a??s)}`,A=`${C(d,`/blocklet/logo-favicon/${t?"":e.meta.did}`)}${I(e,u??r)}`,N=`${C(d,`/blocklet/splash/portrait/${t?"":e.meta.did}`)}${I(e,p)}`,o=`${C(d,`/blocklet/splash/landscape/${t?"":e.meta.did}`)}${I(e,h)}`,i=`${C(d,`/blocklet/og-image/${t?"":e.meta.did}`)}${I(e,L)}`;return{logoUrl:O,logoDarkUrl:w,rectLogoUrl:m,rectLogoDarkUrl:T,faviconUrl:A,splashPortraitUrl:N,splashLandscapeUrl:o,ogImageUrl:i}}function ot({blocklet:e,square:t}={}){const{logoUrl:r,logoDarkUrl:s,rectLogoUrl:n,rectLogoDarkUrl:a}=Ge({blocklet:e}),u=W.useMemo(()=>({appLogo:r,appLogoDark:s,appLogoRect:n,appLogoRectDark:a}),[r,s,n,a]);return Le({meta:u,square:t})}export{st as H,ne as M,ot as a,we as b,it as c,nt as d,je as e,Se as f,Oe as g,Ge as h,Ce as i,tt as m,at as s,rt as u};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-arcblock-BlrkGjK9.js","assets/vendor-mui-core-BV2FUxWJ.js","assets/vendor-react-DEoibe3W.js","assets/vendor-ux-did-connect-2jRoUb28.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-hooks-BgUTpb6X.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css"])))=>i.map(i=>d[i]);
2
- import{b4 as Z,I as oe,d as Ce,a as we,_ as je,j as ke}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as g,j as t,bo as Me,bn as Se,q as Pe,aa as v,y as L,v as he,bP as Ie,I as Te,b3 as Re,T as X,bQ as ne,w as re,bs as ae,bR as ie,O as Ee,N as Be,E as se,ah as xe,bS as Fe,bT as Oe,m as le,ab as ce}from"./vendor-mui-core-BV2FUxWJ.js";import{r as s,b as $e,h as ze,l as Ne}from"./vendor-react-DEoibe3W.js";import{A as Ae,j as Le,k as We,H as _e}from"./vendor-arcblock-BlrkGjK9.js";import{t as me,D as De,A as He}from"./vendor-utils-rHXShPKm.js";import{f as O,m as qe}from"./vendor-hooks-BgUTpb6X.js";import{N as Ue,c as de}from"./list-BTBbj1K4.js";import{d as Ve}from"./ExpandLess-t1cH-Bc4.js";import{B as ue}from"./bundle-avatar-B9he3Bf1.js";import{X as Ye}from"./index-B_NDUfon.js";import"./lottie-web-jYmAQWuC.js";import"./index-D2uDBC1o.js";import"./use-blocklet-logo-BZU9LLmz.js";import"./session-C_8V_o-O.js";import"./InfoOutlined-D3XnF0Vg.js";import"./CheckCircle-Caqp5gKY.js";import"./index-D1kTR2xk.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./util-DMfPwzVN.js";import"./base32-WurN0cIW.js";function Ke(){let n=new Map;function c({root:p,rootMargin:u,threshold:f}){let x=n.get(p);x||(x=new Map,n.set(p,x));let b=JSON.stringify({rootMargin:u,threshold:f}),l=x.get(b);if(!l){let r=new Map;l={observer:new IntersectionObserver(d=>{d.forEach(h=>{var a;(a=r.get(h.target))==null||a(h)})},{root:p,rootMargin:u,threshold:f}),entryCallbacks:r},x.set(b,l)}return{observe:(r,d)=>{l.entryCallbacks.set(r,d),l.observer.observe(r)},unobserve:r=>{l.entryCallbacks.delete(r),l.observer.unobserve(r)}}}return{getObserver:c}}var Ge="0px",Qe=[0],Xe=Ke();function Je(n){let c=(n==null?void 0:n.rootMargin)??Ge,p=(n==null?void 0:n.threshold)??Qe,u=s.useRef(null),f=s.useRef(null),x=s.useRef(null),[b,l]=s.useState(),r=s.useCallback(()=>{let w=u.current;if(!w){l(void 0);return}let j=Xe.getObserver({root:f.current,rootMargin:c,threshold:p});j.observe(w,I=>{l(I)}),x.current=j},[c,p]),d=s.useCallback(()=>{let w=x.current,j=u.current;j&&(w==null||w.unobserve(j)),x.current=null},[]),h=s.useCallback(w=>{d(),u.current=w,r()},[r,d]),a=s.useCallback(w=>{d(),f.current=w,r()},[r,d]);return[h,{entry:b,rootRef:a}]}var Ze=Je;function et(n){var b;let[c,p]=Ze(n),u=!!((b=p.entry)!=null&&b.isIntersecting),[f,x]=s.useState(u);return u&&!f&&x(!0),[c,{...p,isVisible:u,wasEverVisible:f}]}var tt=et,ot=100;function nt({loading:n,hasNextPage:c,onLoadMore:p,rootMargin:u,disabled:f,delayInMs:x=ot}){let b=s.useRef(p),[l,{rootRef:r,isVisible:d}]=tt({rootMargin:u});s.useEffect(()=>{b.current=p},[p]);let h=!f&&!n&&d&&c;return s.useEffect(()=>{if(h){let a=setTimeout(()=>{b.current()},x);return()=>{clearTimeout(a)}}},[h,x]),[l,{rootRef:r}]}var rt=nt;const J={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};W.propTypes={severity:g.oneOf(["info","success","warning","error",""]).isRequired,size:g.number};W.defaultProps={size:8};function W({severity:n,size:c}){return J[n]?t.jsx(v,{component:"span",sx:{display:"inline-block",width:c,height:c,borderRadius:"50%",backgroundColor:J[n]||J.info}}):null}be.propTypes={theme:g.string,type:g.oneOf(["button","line","select"]),onSelectType:g.func,extra:g.node,loading:g.bool,currentTab:g.oneOf(["info","success","warning","error",""])};function be({theme:n="dark",type:c="button",onSelectType:p,extra:u=void 0,currentTab:f="",loading:x=!1,...b}){const{t:l}=s.useContext(Z),r=[{label:l("notification.allSeverity"),value:""},{label:l("notification.severityType.info"),value:"info"},{label:l("notification.severityType.success"),value:"success"},{label:l("notification.severityType.warning"),value:"warning"},{label:l("notification.severityType.error"),value:"error"}],d=i=>{(i!==f||!x)&&p(i)},h=s.useMemo(()=>{const i={width:"100%",bgcolor:n==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:c==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return c==="line"?Object.assign(i,{}):i},[c,n]),a=(i,y,C)=>t.jsx(L,{disabled:x,onClick:()=>d(i.value),className:`profile-button ${y?"active":""}`,...b,children:i.label},i.value||C),w=(i,y,C)=>t.jsx(L,{variant:"text",disabled:x,onClick:()=>d(i.value),className:`profile-line-button ${y?"active":""}`,...b,children:i.label},i.value||C),j=()=>r==null?void 0:r.map((i,y)=>{const C=f===(i==null?void 0:i.value);return c==="line"?t.jsx(s.Fragment,{children:w(i,C,y)},i.value||y):t.jsx(s.Fragment,{children:a(i,C,y)},i.value||y)}),I=i=>{const{value:y}=i.target;d(y==="all"?"":y)};return c==="select"?t.jsx(Me,{sx:{maxWidth:300},children:t.jsx(Se,{value:f||"all",onChange:I,size:"small",label:"Severity",IconComponent:i=>t.jsx(Ae,{...i,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((i,y)=>t.jsx(Pe,{value:i.value||"all",children:t.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(W,{severity:i.value}),i.label]})},i.value||y))})}):t.jsxs(v,{className:"severity-tabs",sx:h,children:[t.jsx(v,{sx:{...c==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:j()}),u]})}ve.propTypes={paging:g.objectOf(g.any).isRequired,loading:g.bool.isRequired,onChange:g.func.isRequired};function ve({loading:n,paging:c,onChange:p}){const{t:u}=s.useContext(Z),f=he(r=>r.breakpoints.down("md"));if(c.pageCount<=0||f)return null;const x=(r,d)=>{p({page:d+1})},b=r=>{const d=Number(r.target.value);p({page:1,pageSize:d})},l=c.page-1<=0?0:c.page-1;return t.jsx(v,{mt:2,display:"flex",justifyContent:"flex-end",className:"notification-pagination",children:t.jsx(Ie,{component:"div",disabled:n,count:c.total,page:l,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:u("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:d,count:h})=>`${r}–${d} / ${h!==-1?h:`${u()}more than ${d}`}`,rowsPerPage:c.pageSize,onPageChange:x,onRowsPerPageChange:b})})}const at=s.memo(ve),it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},st={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"/>'},pe=6,fe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},lt={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},ge=()=>({...lt,width:"calc(50% - 8px)"});ee.propTypes={loading:g.bool,type:g.oneOf(["server","service"]),onFilterChange:g.func,blockletMap:g.object,filterType:g.oneOf(["component","entity"]),selectedId:g.array,severity:g.array,enableMarkAllAsRead:g.bool,unReadCount:g.number,onReadFilterChange:g.func,currentReadFilter:g.string};ee.defaultProps={loading:!1,onFilterChange:()=>{},type:"service",blockletMap:{},filterType:"component",selectedId:[],severity:[],enableMarkAllAsRead:!0,unReadCount:0,onReadFilterChange:()=>{},currentReadFilter:"all"};function ee({onFilterChange:n,loading:c,type:p,blockletMap:u,filterType:f="component",selectedId:x=[],severity:b=[],enableMarkAllAsRead:l=!0,unReadCount:r=0,onReadFilterChange:d,currentReadFilter:h="all"}){const{t:a}=s.useContext(Z),[w,j]=s.useState(null),I=!!w,[i,y]=s.useState(x),[C,T]=s.useState(b),[S,$]=s.useState(!1),[P,_]=s.useState(""),[E,B]=s.useState([]);s.useEffect(()=>{y(x),T(b)},[x,b]);const z=[{label:a("notification.filterType.all"),value:"all"},{label:a("notification.filterType.unread"),value:"unread"}],D=e=>{(e!==h||!c)&&d(e)},N=[{label:a("notification.severityType.info"),value:"info"},{label:a("notification.severityType.success"),value:"success"},{label:a("notification.severityType.warning"),value:"warning"},{label:a("notification.severityType.error"),value:"error"}],H=e=>{j(e.currentTarget),_(""),$(!1)},Y=()=>{j(null)},q=e=>{const o=i.includes(e)?i.filter(m=>m!==e):[...i,e];y(o),n({id:o,severity:C})},U=e=>{const o=C.includes(e)?C.filter(m=>m!==e):[...C,e];T(o),n({severity:o,id:i})},K=e=>{_(e.target.value)},G=()=>{$(!S)},F=$e.useMemo(()=>{if(!u.size)return[];const e=[];return f==="component"&&e.push({label:a("notification.system"),id:"system"}),Array.from(u).forEach(([,o])=>{var A,k;const m=o.did||((A=o.meta)==null?void 0:A.did),M=o.title||((k=o.meta)==null?void 0:k.title)||"",R=o.appPid||o.appDid;(f==="component"&&R!==m||f==="entity"&&R===m)&&e.push({label:M,id:m,blocklet:o,ancestors:o.ancestors})}),e},[u,f,a]);s.useEffect(()=>{if(P.trim()==="")B(F);else{const e=P.toLowerCase(),o=F.filter(m=>m.label.toLowerCase().includes(e));B(o)}},[P,F]);const Q=P.trim()!==""||S?E:E.slice(0,pe);return t.jsxs(v,{children:[t.jsxs(v,{sx:{display:"flex",justifyContent:l?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[l&&t.jsx(v,{display:"flex",gap:1.5,children:z.map(e=>t.jsxs(L,{disabled:c,onClick:()=>D(e.value),className:`profile-button ${h===e.value?"active":""}`,sx:{...p==="service"&&h===e.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&r>0&&` (${r})`]},e.value))}),t.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(Te,{size:"small",onClick:H,disabled:c,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:t.jsx(oe,{icon:it,hFlip:!0})}),t.jsx(Re,{open:I,anchorEl:w,onClose:Y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}},children:t.jsxs(v,{children:[t.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px",children:[t.jsx(X,{variant:"subtitle1",fontWeight:"bold",children:a("notification.severity")}),t.jsx(v,{minWidth:"60px",display:"flex",justifyContent:"flex-end",children:(i.length>0||C.length>0)&&t.jsx(L,{size:"small",onClick:()=>{y([]),T([]),n({severity:[],id:[]})},startIcon:t.jsx(Ce,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:a("notification.clear")})})]}),t.jsx(v,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(ne,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:N.map(e=>t.jsx(re,{elevation:0,sx:ge(C.includes(e.value)),children:t.jsx(ae,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...fe},control:t.jsx(ie,{checked:C.includes(e.value),onChange:()=>U(e.value),disabled:c,size:"small"}),label:t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,children:[t.jsx(W,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(v,{mb:2,children:[t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5,children:[t.jsx(X,{variant:"subtitle1",fontWeight:"bold",width:"calc(100% - 36px)",children:a("notification.from")}),t.jsx(v,{display:"flex",alignItems:"center",width:"calc(100% - 36px)",children:t.jsx(Ee,{size:"small",placeholder:"search",value:P,onChange:K,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},InputProps:{size:"small",startAdornment:t.jsx(Be,{position:"start",sx:{marginRight:"2px"},children:t.jsx(oe,{icon:st})})}})})]}),t.jsx(ne,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:Q.map(e=>t.jsx(re,{elevation:0,sx:ge(i.includes(e.id)),children:t.jsx(ae,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...fe},control:t.jsx(ie,{checked:i.includes(e.id),onChange:()=>q(e.id),disabled:c,size:"small"}),label:t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,sx:{minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(ue,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(X,{noWrap:!0,variant:"body2",component:"span",title:e.label,flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),E.length>pe&&P.trim()===""&&t.jsx(L,{fullWidth:!0,size:"small",onClick:G,sx:{mt:1},endIcon:S?t.jsx(Ve,{}):t.jsx(Le,{})})]})]})})]})]}),i.length>0||C.length>0?t.jsxs(v,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[C.map(e=>{const o=N.find(m=>m.value===e);return t.jsx(se,{label:t.jsxs(v,{display:"flex",alignItems:"center",gap:.5,children:[t.jsx(W,{severity:e}),o?o.label:e]}),onDelete:()=>U(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),i.map(e=>{const o=F.find(m=>m.id===e);return t.jsx(se,{label:t.jsxs(v,{display:"flex",alignItems:"center",gap:.5,children:[(o==null?void 0:o.blocklet)&&t.jsx(ue,{size:16,blocklet:o.blocklet,ancestors:o.ancestors,style:{borderRadius:4,flexShrink:0}}),o?o.label:e]}),variant:"outlined",onDelete:()=>q(e),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const ct=xe(Fe)`
2
+ import{b4 as Z,I as oe,d as Ce,a as we,_ as je,j as ke}from"./vendor-ux-did-connect-2jRoUb28.js";import{H as g,j as t,bo as Me,bn as Se,q as Pe,aa as v,y as L,v as he,bP as Ie,I as Te,b3 as Re,T as X,bQ as ne,w as re,bs as ae,bR as ie,O as Ee,N as Be,E as se,ah as xe,bS as Fe,bT as Oe,m as le,ab as ce}from"./vendor-mui-core-BV2FUxWJ.js";import{r as s,b as $e,h as ze,l as Ne}from"./vendor-react-DEoibe3W.js";import{A as Ae,j as Le,k as We,H as _e}from"./vendor-arcblock-BlrkGjK9.js";import{t as me,D as De,A as He}from"./vendor-utils-rHXShPKm.js";import{f as O,m as qe}from"./vendor-hooks-BgUTpb6X.js";import{N as Ue,c as de}from"./list-DLMy1vVs.js";import{d as Ve}from"./ExpandLess-t1cH-Bc4.js";import{B as ue}from"./bundle-avatar-D4fwror8.js";import{X as Ye}from"./index-DDoVX3je.js";import"./lottie-web-jYmAQWuC.js";import"./index-D2uDBC1o.js";import"./use-blocklet-logo-Bhkp-Zm7.js";import"./session-C_8V_o-O.js";import"./InfoOutlined-D3XnF0Vg.js";import"./CheckCircle-Caqp5gKY.js";import"./index-D1kTR2xk.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./util-DMfPwzVN.js";import"./base32-WurN0cIW.js";function Ke(){let n=new Map;function c({root:p,rootMargin:u,threshold:f}){let x=n.get(p);x||(x=new Map,n.set(p,x));let b=JSON.stringify({rootMargin:u,threshold:f}),l=x.get(b);if(!l){let r=new Map;l={observer:new IntersectionObserver(d=>{d.forEach(h=>{var a;(a=r.get(h.target))==null||a(h)})},{root:p,rootMargin:u,threshold:f}),entryCallbacks:r},x.set(b,l)}return{observe:(r,d)=>{l.entryCallbacks.set(r,d),l.observer.observe(r)},unobserve:r=>{l.entryCallbacks.delete(r),l.observer.unobserve(r)}}}return{getObserver:c}}var Ge="0px",Qe=[0],Xe=Ke();function Je(n){let c=(n==null?void 0:n.rootMargin)??Ge,p=(n==null?void 0:n.threshold)??Qe,u=s.useRef(null),f=s.useRef(null),x=s.useRef(null),[b,l]=s.useState(),r=s.useCallback(()=>{let w=u.current;if(!w){l(void 0);return}let j=Xe.getObserver({root:f.current,rootMargin:c,threshold:p});j.observe(w,I=>{l(I)}),x.current=j},[c,p]),d=s.useCallback(()=>{let w=x.current,j=u.current;j&&(w==null||w.unobserve(j)),x.current=null},[]),h=s.useCallback(w=>{d(),u.current=w,r()},[r,d]),a=s.useCallback(w=>{d(),f.current=w,r()},[r,d]);return[h,{entry:b,rootRef:a}]}var Ze=Je;function et(n){var b;let[c,p]=Ze(n),u=!!((b=p.entry)!=null&&b.isIntersecting),[f,x]=s.useState(u);return u&&!f&&x(!0),[c,{...p,isVisible:u,wasEverVisible:f}]}var tt=et,ot=100;function nt({loading:n,hasNextPage:c,onLoadMore:p,rootMargin:u,disabled:f,delayInMs:x=ot}){let b=s.useRef(p),[l,{rootRef:r,isVisible:d}]=tt({rootMargin:u});s.useEffect(()=>{b.current=p},[p]);let h=!f&&!n&&d&&c;return s.useEffect(()=>{if(h){let a=setTimeout(()=>{b.current()},x);return()=>{clearTimeout(a)}}},[h,x]),[l,{rootRef:r}]}var rt=nt;const J={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};W.propTypes={severity:g.oneOf(["info","success","warning","error",""]).isRequired,size:g.number};W.defaultProps={size:8};function W({severity:n,size:c}){return J[n]?t.jsx(v,{component:"span",sx:{display:"inline-block",width:c,height:c,borderRadius:"50%",backgroundColor:J[n]||J.info}}):null}be.propTypes={theme:g.string,type:g.oneOf(["button","line","select"]),onSelectType:g.func,extra:g.node,loading:g.bool,currentTab:g.oneOf(["info","success","warning","error",""])};function be({theme:n="dark",type:c="button",onSelectType:p,extra:u=void 0,currentTab:f="",loading:x=!1,...b}){const{t:l}=s.useContext(Z),r=[{label:l("notification.allSeverity"),value:""},{label:l("notification.severityType.info"),value:"info"},{label:l("notification.severityType.success"),value:"success"},{label:l("notification.severityType.warning"),value:"warning"},{label:l("notification.severityType.error"),value:"error"}],d=i=>{(i!==f||!x)&&p(i)},h=s.useMemo(()=>{const i={width:"100%",bgcolor:n==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:c==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return c==="line"?Object.assign(i,{}):i},[c,n]),a=(i,y,C)=>t.jsx(L,{disabled:x,onClick:()=>d(i.value),className:`profile-button ${y?"active":""}`,...b,children:i.label},i.value||C),w=(i,y,C)=>t.jsx(L,{variant:"text",disabled:x,onClick:()=>d(i.value),className:`profile-line-button ${y?"active":""}`,...b,children:i.label},i.value||C),j=()=>r==null?void 0:r.map((i,y)=>{const C=f===(i==null?void 0:i.value);return c==="line"?t.jsx(s.Fragment,{children:w(i,C,y)},i.value||y):t.jsx(s.Fragment,{children:a(i,C,y)},i.value||y)}),I=i=>{const{value:y}=i.target;d(y==="all"?"":y)};return c==="select"?t.jsx(Me,{sx:{maxWidth:300},children:t.jsx(Se,{value:f||"all",onChange:I,size:"small",label:"Severity",IconComponent:i=>t.jsx(Ae,{...i,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((i,y)=>t.jsx(Pe,{value:i.value||"all",children:t.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[t.jsx(W,{severity:i.value}),i.label]})},i.value||y))})}):t.jsxs(v,{className:"severity-tabs",sx:h,children:[t.jsx(v,{sx:{...c==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:j()}),u]})}ve.propTypes={paging:g.objectOf(g.any).isRequired,loading:g.bool.isRequired,onChange:g.func.isRequired};function ve({loading:n,paging:c,onChange:p}){const{t:u}=s.useContext(Z),f=he(r=>r.breakpoints.down("md"));if(c.pageCount<=0||f)return null;const x=(r,d)=>{p({page:d+1})},b=r=>{const d=Number(r.target.value);p({page:1,pageSize:d})},l=c.page-1<=0?0:c.page-1;return t.jsx(v,{mt:2,display:"flex",justifyContent:"flex-end",className:"notification-pagination",children:t.jsx(Ie,{component:"div",disabled:n,count:c.total,page:l,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:u("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:d,count:h})=>`${r}–${d} / ${h!==-1?h:`${u()}more than ${d}`}`,rowsPerPage:c.pageSize,onPageChange:x,onRowsPerPageChange:b})})}const at=s.memo(ve),it={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},st={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"/>'},pe=6,fe={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},lt={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},ge=()=>({...lt,width:"calc(50% - 8px)"});ee.propTypes={loading:g.bool,type:g.oneOf(["server","service"]),onFilterChange:g.func,blockletMap:g.object,filterType:g.oneOf(["component","entity"]),selectedId:g.array,severity:g.array,enableMarkAllAsRead:g.bool,unReadCount:g.number,onReadFilterChange:g.func,currentReadFilter:g.string};ee.defaultProps={loading:!1,onFilterChange:()=>{},type:"service",blockletMap:{},filterType:"component",selectedId:[],severity:[],enableMarkAllAsRead:!0,unReadCount:0,onReadFilterChange:()=>{},currentReadFilter:"all"};function ee({onFilterChange:n,loading:c,type:p,blockletMap:u,filterType:f="component",selectedId:x=[],severity:b=[],enableMarkAllAsRead:l=!0,unReadCount:r=0,onReadFilterChange:d,currentReadFilter:h="all"}){const{t:a}=s.useContext(Z),[w,j]=s.useState(null),I=!!w,[i,y]=s.useState(x),[C,T]=s.useState(b),[S,$]=s.useState(!1),[P,_]=s.useState(""),[E,B]=s.useState([]);s.useEffect(()=>{y(x),T(b)},[x,b]);const z=[{label:a("notification.filterType.all"),value:"all"},{label:a("notification.filterType.unread"),value:"unread"}],D=e=>{(e!==h||!c)&&d(e)},N=[{label:a("notification.severityType.info"),value:"info"},{label:a("notification.severityType.success"),value:"success"},{label:a("notification.severityType.warning"),value:"warning"},{label:a("notification.severityType.error"),value:"error"}],H=e=>{j(e.currentTarget),_(""),$(!1)},Y=()=>{j(null)},q=e=>{const o=i.includes(e)?i.filter(m=>m!==e):[...i,e];y(o),n({id:o,severity:C})},U=e=>{const o=C.includes(e)?C.filter(m=>m!==e):[...C,e];T(o),n({severity:o,id:i})},K=e=>{_(e.target.value)},G=()=>{$(!S)},F=$e.useMemo(()=>{if(!u.size)return[];const e=[];return f==="component"&&e.push({label:a("notification.system"),id:"system"}),Array.from(u).forEach(([,o])=>{var A,k;const m=o.did||((A=o.meta)==null?void 0:A.did),M=o.title||((k=o.meta)==null?void 0:k.title)||"",R=o.appPid||o.appDid;(f==="component"&&R!==m||f==="entity"&&R===m)&&e.push({label:M,id:m,blocklet:o,ancestors:o.ancestors})}),e},[u,f,a]);s.useEffect(()=>{if(P.trim()==="")B(F);else{const e=P.toLowerCase(),o=F.filter(m=>m.label.toLowerCase().includes(e));B(o)}},[P,F]);const Q=P.trim()!==""||S?E:E.slice(0,pe);return t.jsxs(v,{children:[t.jsxs(v,{sx:{display:"flex",justifyContent:l?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[l&&t.jsx(v,{display:"flex",gap:1.5,children:z.map(e=>t.jsxs(L,{disabled:c,onClick:()=>D(e.value),className:`profile-button ${h===e.value?"active":""}`,sx:{...p==="service"&&h===e.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===e.value?"bold":"normal"},children:[e.label,e.value==="unread"&&r>0&&` (${r})`]},e.value))}),t.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(Te,{size:"small",onClick:H,disabled:c,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:t.jsx(oe,{icon:it,hFlip:!0})}),t.jsx(Re,{open:I,anchorEl:w,onClose:Y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}},children:t.jsxs(v,{children:[t.jsxs(v,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px",children:[t.jsx(X,{variant:"subtitle1",fontWeight:"bold",children:a("notification.severity")}),t.jsx(v,{minWidth:"60px",display:"flex",justifyContent:"flex-end",children:(i.length>0||C.length>0)&&t.jsx(L,{size:"small",onClick:()=>{y([]),T([]),n({severity:[],id:[]})},startIcon:t.jsx(Ce,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:a("notification.clear")})})]}),t.jsx(v,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:t.jsx(ne,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:N.map(e=>t.jsx(re,{elevation:0,sx:ge(C.includes(e.value)),children:t.jsx(ae,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...fe},control:t.jsx(ie,{checked:C.includes(e.value),onChange:()=>U(e.value),disabled:c,size:"small"}),label:t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,children:[t.jsx(W,{severity:e.value}),e.label]})})},e.value))})}),t.jsxs(v,{mb:2,children:[t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5,children:[t.jsx(X,{variant:"subtitle1",fontWeight:"bold",width:"calc(100% - 36px)",children:a("notification.from")}),t.jsx(v,{display:"flex",alignItems:"center",width:"calc(100% - 36px)",children:t.jsx(Ee,{size:"small",placeholder:"search",value:P,onChange:K,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},InputProps:{size:"small",startAdornment:t.jsx(Be,{position:"start",sx:{marginRight:"2px"},children:t.jsx(oe,{icon:st})})}})})]}),t.jsx(ne,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:Q.map(e=>t.jsx(re,{elevation:0,sx:ge(i.includes(e.id)),children:t.jsx(ae,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...fe},control:t.jsx(ie,{checked:i.includes(e.id),onChange:()=>q(e.id),disabled:c,size:"small"}),label:t.jsxs(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,sx:{minWidth:0,width:"100%"},children:[e.blocklet&&t.jsx(ue,{size:20,blocklet:e.blocklet,ancestors:e.ancestors,style:{borderRadius:4,flexShrink:0}}),t.jsx(X,{noWrap:!0,variant:"body2",component:"span",title:e.label,flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:e.label})]})})},e.id))}),E.length>pe&&P.trim()===""&&t.jsx(L,{fullWidth:!0,size:"small",onClick:G,sx:{mt:1},endIcon:S?t.jsx(Ve,{}):t.jsx(Le,{})})]})]})})]})]}),i.length>0||C.length>0?t.jsxs(v,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[C.map(e=>{const o=N.find(m=>m.value===e);return t.jsx(se,{label:t.jsxs(v,{display:"flex",alignItems:"center",gap:.5,children:[t.jsx(W,{severity:e}),o?o.label:e]}),onDelete:()=>U(e),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${e}`)}),i.map(e=>{const o=F.find(m=>m.id===e);return t.jsx(se,{label:t.jsxs(v,{display:"flex",alignItems:"center",gap:.5,children:[(o==null?void 0:o.blocklet)&&t.jsx(ue,{size:16,blocklet:o.blocklet,ancestors:o.ancestors,style:{borderRadius:4,flexShrink:0}}),o?o.label:e]}),variant:"outlined",onDelete:()=>q(e),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${e}`)})]}):null]})}const ct=xe(Fe)`
3
3
  position: fixed;
4
4
  bottom: 20px;
5
5
  right: 20px;