@abtnode/blocklet-services 1.17.3 → 1.17.4-beta-20251201-225048-b1682a09

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 (124) hide show
  1. package/dist/assets/{access-control-2f5ZUYvn.js → access-control-BpDf5eCc.js} +1 -1
  2. package/dist/assets/{add-component-core-C8wP5DXr.js → add-component-core-DZMleaf7.js} +1 -1
  3. package/dist/assets/{add-resource-D-X1I5_V.js → add-resource-fReirUEj.js} +1 -1
  4. package/dist/assets/{addon-DWBAL8PD.js → addon-CD2tT3Vk.js} +1 -1
  5. package/dist/assets/{advanced-l0XvYXrR.js → advanced-D_HYmeDL.js} +1 -1
  6. package/dist/assets/{aigne-CsKyE9Oj.js → aigne-DKzLdZPY.js} +1 -1
  7. package/dist/assets/{appearance-CDE_5zqq.js → appearance-DoI_K1yx.js} +1 -1
  8. package/dist/assets/{arrow-down.svg-C5rjQJG2.js → arrow-down.svg-mj2eIUoA.js} +1 -1
  9. package/dist/assets/{audit-logs-CvWoJqnE.js → audit-logs-CBeb46aa.js} +1 -1
  10. package/dist/assets/{authorize-CgqsMeVu.js → authorize-BQTDaD7S.js} +1 -1
  11. package/dist/assets/{bind-account-C_93rOKB.js → bind-account--wlCwoIh.js} +1 -1
  12. package/dist/assets/{branding-D-5p5wha.js → branding-Bs3FNZ79.js} +1 -1
  13. package/dist/assets/{branding-MYLazJOV.js → branding-CMNxsyrp.js} +1 -1
  14. package/dist/assets/{branding-C56V2vpD.js → branding-Sd6X0YqE.js} +1 -1
  15. package/dist/assets/{bundle-avatar-BdQv8P8t.js → bundle-avatar-DACPWlAj.js} +1 -1
  16. package/dist/assets/{complete-BSud_fLS.js → complete-BIrSCTBJ.js} +1 -1
  17. package/dist/assets/{component-Z_4kfVE0.js → component-BrH7uZv7.js} +2 -2
  18. package/dist/assets/{config-tFuMpr42.js → config-BbbJtsEK.js} +1 -1
  19. package/dist/assets/{config-QNXiPFng.js → config-BlvlFPnu.js} +1 -1
  20. package/dist/assets/config-C0IukdMa.js +57 -0
  21. package/dist/assets/{config-navigation-BdlyLYhE.js → config-navigation-CPqSm2b8.js} +2 -2
  22. package/dist/assets/{config-space-BSBup5aB.js → config-space-B6ikfnoY.js} +1 -1
  23. package/dist/assets/{confirm-DPD7yjeR.js → confirm-Dge1BR0a.js} +1 -1
  24. package/dist/assets/{connect-C51xT0zT.js → connect-DwfU2nBg.js} +1 -1
  25. package/dist/assets/{connect-DFCRlbN9.js → connect-DwftqrTP.js} +1 -1
  26. package/dist/assets/{connect-to-B-qzDPba.js → connect-to-D3Fxg-mH.js} +1 -1
  27. package/dist/assets/{dashboard-Cto_eSyJ.js → dashboard-BZMyxtap.js} +2 -2
  28. package/dist/assets/{delete-confirm-G3d9EUZU.js → delete-confirm-CaK42Rqi.js} +1 -1
  29. package/dist/assets/{domain-CJ3ZeLQs.js → domain-DZhOKUFR.js} +1 -1
  30. package/dist/assets/{domain-action-card-BAzAGOUR.js → domain-action-card-KBcfeUDt.js} +1 -1
  31. package/dist/assets/{domains-CbYSc-np.js → domains-Dr63r27w.js} +1 -1
  32. package/dist/assets/{email-BbooLxm_.js → email-mM-fSS-l.js} +1 -1
  33. package/dist/assets/engine-BCYKeHn7.js +1 -0
  34. package/dist/assets/{exchange-passport-B7UqzIxE.js → exchange-passport-CL0-QMoV.js} +1 -1
  35. package/dist/assets/{form-Ci18kVmF.js → form-BQvsWiOt.js} +1 -1
  36. package/dist/assets/{fuel-BE74WZ6j.js → fuel-BpMa6xEp.js} +1 -1
  37. package/dist/assets/{gen-access-key-s40ict9x.js → gen-access-key-BLtBtR5W.js} +1 -1
  38. package/dist/assets/{gen-simple-access-key-D8YVPusH.js → gen-simple-access-key-9tFWfYxA.js} +1 -1
  39. package/dist/assets/{get-safe-url-DT47R_1b.js → get-safe-url-CxrqaBih.js} +1 -1
  40. package/dist/assets/{home-C9ok8LuA.js → home-BG4Bn0-p.js} +1 -1
  41. package/dist/assets/{iframe-BoFxpqBT.js → iframe-BjsS1KQR.js} +1 -1
  42. package/dist/assets/{index-DbmL_qgW.js → index-5hr4oNRS.js} +3 -3
  43. package/dist/assets/{index-CionuFLd.js → index-88gdbkao.js} +1 -1
  44. package/dist/assets/{index-YApW_a5L.js → index-B00Da_zr.js} +1 -1
  45. package/dist/assets/{index-ByWjeUNp.js → index-B4Q4y_7n.js} +1 -1
  46. package/dist/assets/{index-CimoFUNL.js → index-B6-5SXSy.js} +1 -1
  47. package/dist/assets/{index-CCaP8G-5.js → index-B8mnhcds.js} +2 -2
  48. package/dist/assets/{index-DXYr8-bJ.js → index-B8uWH9ks.js} +1 -1
  49. package/dist/assets/{index-DA4iEV0M.js → index-BIlfbBZ2.js} +1 -1
  50. package/dist/assets/{index-tukXJbMk.js → index-BUomsang.js} +1 -1
  51. package/dist/assets/{index-CUHwnb5s.js → index-BVYUGxzR.js} +1 -1
  52. package/dist/assets/{index-ClpPXMAi.js → index-BmuOS9l2.js} +1 -1
  53. package/dist/assets/{index-CgnIkelt.js → index-BoeLorfn.js} +1 -1
  54. package/dist/assets/{index-CTzNs74h.js → index-BzCDxVOL.js} +1 -1
  55. package/dist/assets/{index-BpNkmzkz.js → index-C40tsw4I.js} +1 -1
  56. package/dist/assets/{index-CFLPfp6M.js → index-CNE3uN5c.js} +1 -1
  57. package/dist/assets/{index-h3JyhqqC.js → index-CgTWMV4T.js} +1 -1
  58. package/dist/assets/{index-DQB7DBpQ.js → index-CxJOg5jI.js} +1 -1
  59. package/dist/assets/{index-DrJnt_vf.js → index-Cy73v3o9.js} +1 -1
  60. package/dist/assets/{index-C0TbDTja.js → index-D6MFQa2J.js} +1 -1
  61. package/dist/assets/{index-BJz7bmlp.js → index-D9UpcFKi.js} +1 -1
  62. package/dist/assets/{index-DaIayPTI.js → index-DEDj0oVc.js} +1 -1
  63. package/dist/assets/{index-DtUiw_0b.js → index-KUb_kVWp.js} +1 -1
  64. package/dist/assets/{index-CpVl3QY6.js → index-V83VNrab.js} +1 -1
  65. package/dist/assets/{index-CMuQuCcn.js → index-h0Os_ox8.js} +1 -1
  66. package/dist/assets/{index-CN4lpn74.js → index-lFDZOk_k.js} +3 -3
  67. package/dist/assets/{index-CekShFJg.js → index-sfOXn4Gu.js} +1 -1
  68. package/dist/assets/{invitation-XkzkbIwS.js → invitation-LJOuA09f.js} +1 -1
  69. package/dist/assets/{invitations-Cy_dNcIE.js → invitations-DtmYY9Tr.js} +1 -1
  70. package/dist/assets/{invite-BSYvges4.js → invite-DrIYCYzj.js} +1 -1
  71. package/dist/assets/{isURL-DskT4RKm.js → isURL-fcz3vuMN.js} +1 -1
  72. package/dist/assets/{issue-passport-opYjcMCB.js → issue-passport-Dv9gH2LH.js} +1 -1
  73. package/dist/assets/{item-DToR6hlW.js → item-weuCOdTL.js} +1 -1
  74. package/dist/assets/{landing-page-DFIsLbb7.js → landing-page-Djj9jDve.js} +1 -1
  75. package/dist/assets/{layout-CkQwn0NR.js → layout-0zU7a-3v.js} +1 -1
  76. package/dist/assets/{list-D5UHzaOx.js → list-Co62gn7d.js} +1 -1
  77. package/dist/assets/{list-D4Gs036Z.js → list-DXe9E4ws.js} +1 -1
  78. package/dist/assets/{localization-DzNUtlVV.js → localization-CufkU3et.js} +1 -1
  79. package/dist/assets/{log-RL9u31-I.js → log-BCC7blv9.js} +1 -1
  80. package/dist/assets/{login-CqeIoGod.js → login-DlWL3WVr.js} +1 -1
  81. package/dist/assets/{login-oauth-callback-0Nu4mPXk.js → login-oauth-callback-CQFS2s22.js} +1 -1
  82. package/dist/assets/{logo-uploader-Cv5-KB8L.js → logo-uploader-Dz85eY-W.js} +1 -1
  83. package/dist/assets/{lost-passport-CoOQTlhO.js → lost-passport-pRlBbp2M.js} +1 -1
  84. package/dist/assets/{open-window-BHKfDlI-.js → open-window-X4W6wF0y.js} +1 -1
  85. package/dist/assets/{over-due-invoice-payment-MovV2cwi.js → over-due-invoice-payment-CvKa0suc.js} +1 -1
  86. package/dist/assets/{overview-CCLvrJi4.js → overview-d6xffU9N.js} +1 -1
  87. package/dist/assets/{passport-CqvORkfw.js → passport-DHiNUeVn.js} +1 -1
  88. package/dist/assets/{passport-item-BMa8rd85.js → passport-item-BkmVlAdr.js} +1 -1
  89. package/dist/assets/{permission-DLnMVuoy.js → permission-B3_OQqtH.js} +1 -1
  90. package/dist/assets/{preferences-CDvS8_ng.js → preferences-D321ZAU1.js} +1 -1
  91. package/dist/assets/{profile-embed-C8ofqlbV.js → profile-embed-Ba3F6nXm.js} +1 -1
  92. package/dist/assets/{publish-resource-CMoJF5DA.js → publish-resource-Aoo5xCZX.js} +1 -1
  93. package/dist/assets/{runtime-D2sDgwrj.js → runtime-xK-SJ1cq.js} +1 -1
  94. package/dist/assets/sdk-DAuiCSLy.js +1 -0
  95. package/dist/assets/{security-D7O7D2Dn.js → security-B3q0KDVH.js} +1 -1
  96. package/dist/assets/{session-DNlfWI2Z.js → session-DR7jqIW5.js} +1 -1
  97. package/dist/assets/{setup-CxJT_7C9.js → setup-CPrn9v2_.js} +1 -1
  98. package/dist/assets/{simple-select-BAtHv3cq.js → simple-select-SyYgbCc2.js} +1 -1
  99. package/dist/assets/{spaces-B9YyAxJd.js → spaces-C_pXJSzm.js} +1 -1
  100. package/dist/assets/{start-TaXS82Bg.js → start-BUxgx8Ah.js} +1 -1
  101. package/dist/assets/{starting-progress-B6ma-ZGa.js → starting-progress-BP_Sqg1X.js} +1 -1
  102. package/dist/assets/{status-DsksxwVa.js → status-CE6iXPs_.js} +1 -1
  103. package/dist/assets/{step-actions-DbAALRbw.js → step-actions-tRQyAl6A.js} +1 -1
  104. package/dist/assets/{studio-IkWmW2Xk.js → studio-bbXFMut7.js} +1 -1
  105. package/dist/assets/{team-BnNEVFdE.js → team-KWOyNaWn.js} +1 -1
  106. package/dist/assets/{traffic-BibrNphF.js → traffic-ChddnVTm.js} +1 -1
  107. package/dist/assets/{transfer-CPU5ZBFf.js → transfer-CcCi6t4X.js} +1 -1
  108. package/dist/assets/{unsubscribe-CBHokiq9.js → unsubscribe-Bp5VQCnR.js} +1 -1
  109. package/dist/assets/{use-app-logo-BWOYOuhG.js → use-app-logo-hGlkw2d_.js} +1 -1
  110. package/dist/assets/{user-center-DxoxMBFK.js → user-center-CXduwafJ.js} +2 -2
  111. package/dist/assets/{user-follower-CNxYFKVI.js → user-follower-CmGz7Inx.js} +1 -1
  112. package/dist/assets/{util-DWpY3O7e.js → util-D-cKMKUM.js} +1 -1
  113. package/dist/assets/{util-DzwOLYt5.js → util-MbDHkO8z.js} +1 -1
  114. package/dist/assets/{wait-connect-Crb0Z6pk.js → wait-connect-DDyEqw4h.js} +1 -1
  115. package/dist/assets/{wizard-GO-eYrph.js → wizard-B588KidT.js} +1 -1
  116. package/dist/assets/{wizard-components-B0p6B74G.js → wizard-components-DP7Z_TTm.js} +1 -1
  117. package/dist/assets/{wrap-locale-C_7Ff1OO.js → wrap-locale-CFMie_Pc.js} +1 -1
  118. package/dist/assets/{zh-kaABsCb2.js → zh-C_L8CY4f.js} +1 -1
  119. package/dist/index.html +1 -1
  120. package/dist/service-worker.js +1 -1
  121. package/package.json +23 -23
  122. package/dist/assets/config-YjT0ptkh.js +0 -57
  123. package/dist/assets/engine-7kGw4V-U.js +0 -1
  124. package/dist/assets/sdk-CiQg0Ndf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cI as V,ao as J,cJ as Ke,ak as h,b1 as K,a$ as Ge,s as fe,cK as be,cp as Fe,am as ge,cr as Ye,M as F,aO as Y,bX as $e,aP as $,Q as qe,be as He,aR as Qe,cL as Xe,cM as Ve,cN as Je,cO as Ze,c2 as he}from"./vendor-mui-core-DHT36AZL.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-fhL5FJET.js";import{r as b,u as et}from"./vendor-react-CUXIiAnY.js";import{ac as O,_ as L,a1 as E,Y as N,aQ as tt,aR as st,aI as nt,c as T,v as ot}from"./index-CN4lpn74.js";import{H as B,V as D,p as at,Q as q,h as rt,W as it,n as le,j as ct}from"./vendor-ux-sqP3hEhY.js";import{u as lt}from"./use-mobile-DoKVMODs.js";import{a as H,d as Ce,a0 as dt,c as pt,D as we,C as me}from"./vendor-utils-BSZ4yJws.js";import{o as Be}from"./vendor-arcblock-3xKfH3F1.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-DQB7DBpQ.js";import"./index-bbu7QFpz.js";import"./index-BojVbZw0.js";import"./api-DIucIOLX.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-B-qzDPba.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-B9YyAxJd.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-BF7MtybM.js";import{E as Et}from"./index-DA2Pny4B.js";import{x as It}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-DT47R_1b.js";import{S as Tt}from"./switch-control-DdOZdvsu.js";import{C as Rt,u as Pt}from"./config-space-BSBup5aB.js";import{L as ye}from"./list-header-CA-QkwGq.js";import"./lottie-web-4koyQiv_.js";import"./index-B9Igf2rm.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Ie=b.createContext({}),{Provider:Lt,Consumer:bs}=Ie;function Te({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),I=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},G=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await G({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:G,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}Te.propTypes={children:u.any.isRequired};function U(){return b.useContext(Ie)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
1
+ import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cI as V,ao as J,cJ as Ke,ak as h,b1 as K,a$ as Ge,s as fe,cK as be,cp as Fe,am as ge,cr as Ye,M as F,aO as Y,bX as $e,aP as $,Q as qe,be as He,aR as Qe,cL as Xe,cM as Ve,cN as Je,cO as Ze,c2 as he}from"./vendor-mui-core-DHT36AZL.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-fhL5FJET.js";import{r as b,u as et}from"./vendor-react-CUXIiAnY.js";import{ac as O,_ as L,a1 as E,Y as N,aQ as tt,aR as st,aI as nt,c as T,v as ot}from"./index-lFDZOk_k.js";import{H as B,V as D,p as at,Q as q,h as rt,W as it,n as le,j as ct}from"./vendor-ux-sqP3hEhY.js";import{u as lt}from"./use-mobile-DoKVMODs.js";import{a as H,d as Ce,a0 as dt,c as pt,D as we,C as me}from"./vendor-utils-BSZ4yJws.js";import{o as Be}from"./vendor-arcblock-3xKfH3F1.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-CxJOg5jI.js";import"./index-bbu7QFpz.js";import"./index-BojVbZw0.js";import"./api-DIucIOLX.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-D3Fxg-mH.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-C_pXJSzm.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-BF7MtybM.js";import{E as Et}from"./index-DA2Pny4B.js";import{x as It}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-CxrqaBih.js";import{S as Tt}from"./switch-control-DdOZdvsu.js";import{C as Rt,u as Pt}from"./config-space-B6ikfnoY.js";import{L as ye}from"./list-header-CA-QkwGq.js";import"./lottie-web-4koyQiv_.js";import"./index-B9Igf2rm.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Ie=b.createContext({}),{Provider:Lt,Consumer:bs}=Ie;function Te({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),I=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},G=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await G({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:G,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}Te.propTypes={children:u.any.isRequired};function U(){return b.useContext(Ie)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
2
2
  `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:V[600]},{min:-9,max:-6,color:V[500]},{min:-6,max:-3,color:V[400]},{min:-3,max:-1,color:V[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ke[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Et,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(K,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(K,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:n="",createdAt:o}){const{t:s}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:n||a,children:e.jsx(be,{children:e.jsx(Ye,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:u.string.isRequired,message:u.string,createdAt:u.string.isRequired};function ze({metadata:t={}}){const{t:n}=D();if(H(t))return e.jsx(q,{type:"success",children:n("common.succeeded")});const o=t.count||0,s=t.size||0,r=It(s,{iec:!0}),a=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[n("common.fileCount"),": ",o]}),e.jsxs(j,{variant:"body2",children:[n("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:n("common.succeeded")}),e.jsx(Nt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Fe,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ze.propTypes={metadata:u.object};function Oe(){const{t,locale:n}=D(),{spaceGateways:o,backups:s,backupsLoading:r}=U(),a=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:g}=s[i],m=x===T.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=T.BACKUPS.TIMEOUT_HOURS,p=x===T.BACKUPS.STATUS.SUCCEEDED&&!m,k=l||o.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return p?e.jsx(Ge,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:g,metadata:m}=d,p=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!p,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!p;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ze,{metadata:m}):e.jsx(Ae,{status:l,message:x,createdAt:g})}}}],[s,o,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",n),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Re,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(ve,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Le({spaceGateway:t,onConfirm:n=()=>{},onCancel:o=()=>{}}){const{t:s}=D(),[r,a]=b.useState(!1),[c,i]=b.useState(!1),d=(g,m)=>{g?.preventDefault(),g?.stopPropagation(),a(m)},l=async g=>{try{g?.stopPropagation(),i(!0),await n?.(t),a(!1)}catch(m){console.error(m),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(m)}`)}finally{a(!1),i(!1)}},x=g=>{d(g,!1),o?.(g)};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{color:"red",onClick:g=>d(g,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx($e,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Le.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool}).isRequired,onConfirm:u.func,onCancel:u.func};function Ue({spaceGateway:t,selected:n,onDelete:o=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=U(),[d,l]=b.useState(null),{t:x}=D(),[g,m]=b.useState(!1),p=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{m(!0),p(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}},w=async S=>{try{m(!0),p(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[g||t?.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>p(S,!0),...c,children:e.jsx(He,{})}),e.jsxs(Qe,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>p(S,!1),children:[e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!n&&r&&e.jsxs(F,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(F,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Le,{spaceGateway:t,onConfirm:async()=>{l(null),await o?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool,endpoint:u.string.isRequired,loading:u.bool}).isRequired,selected:u.bool.isRequired,enableSwitchToSpace:u.bool,onDelete:u.func,onConnect:u.func,backupInProgress:u.bool};const Wt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Me({spaceGateway:t,spaceStatus:n,selected:o,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=O(),{api:l,info:{did:x}}=L(),{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S}=De({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=U(),[_,M]=b.useState(!1),[I,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:m},i),scan:c("storage.spaces.authorize.scan",{appName:m},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=o&&!_&&n===de.DISCONNECTED,oe=o&&!_&&!t.loading&&n===de.CONNECTED,G=o&&_&&n===de.CONNECTED&&y?.progress>=0,X=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:we.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,f)=>{const A=f(C.endpoint),R=xe(A),v=C.space?f(C.space):{};if(t.did&&R!==t.did){P(Ne=>({...Ne,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:v.name??"DID Space",did:v.did??xe(A),endpoint:A};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(o&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):y.message&&a?.(new Error(y?.message),t),y.progress=0,y.message=""),M(!1),te(),se()):y.progress&&M(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:X,children:c("storage.spaces.disconnected.reconnectNow")}),G&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ae,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:ie,onConnect:X,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:G})]})}Me.propTypes={spaceGateway:u.shape({did:u.string.isRequired,name:u.string.isRequired,url:u.string.isRequired,endpoint:u.string.isRequired,protected:u.bool,loading:u.bool}).isRequired,spaceStatus:u.string.isRequired,selected:u.bool.isRequired,onConnected:u.func,onDeleted:u.func,onBackedUp:u.func};function Kt({...t}){const{t:n}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("storage.spaces.backup.records")})}),e.jsx(ve,{}),e.jsx(Oe,{})]})}function Gt({...t}){const{t:n}=D(),{autoBackup:o,updateAutoBackup:s}=U(),r=async()=>{try{const a=!o?.enabled;await s({enabled:a}),B.success(n(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Tt,{checked:!!o?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:n("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Ft(){const{t}=D(),{spaceGateways:n,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=U(),r=o&&!n?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Me,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Gt,{}),e.jsx(Re,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(z,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:n.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(Kt,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:n}=U();return t?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):H(n)?e.jsx(_t,{}):e.jsx(Ft,{})}function $t(){return e.jsx(Te,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:n,updateSpaceGateway:o,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=Pt(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:n}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:o,storageEndpoint:a})})]})}function Ht(){const{t}=D();return e.jsxs(Rt,{children:[e.jsxs(K,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...n}){const{t:o,locale:s}=D(),{blocklet:r}=O(),a=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=a?"horizontal":t,x=ue(()=>{const w=[{label:o("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:o("common.storage"),value:"storage"}),w},[s,l]),m=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],p=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:m});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:p,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...n,children:e.jsxs(K,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:m})})]})});if(l==="horizontal")return e.jsxs(h,{...n,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:m})]})}Qt.propTypes={navOrientation:u.oneOf(["vertical","horizontal"])};const pe=fe(h)`
3
3
  position: relative;
4
4
  min-height: 66vh;
@@ -1,4 +1,4 @@
1
- import{j as e,y as hr,bc as ye,M as oe,ak as m,Q as G,W as h,J as ve,c1 as xr,I as W,aN as mr,T as A,aj as gr,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,cj as br,bh as yr,U as Me,cS as vr,cT as wr,at as Z,cU as jr,a6 as V,n as ne,D as Cr,cV as kr,ar as Ae,b1 as we,cW as Sr,aX as Pr,a$ as Ir,cX as Tr}from"./vendor-mui-core-DHT36AZL.js";import{r as y,a as Rr,u as Mr,j as Ar}from"./vendor-react-CUXIiAnY.js";import{t as _e,Z as Er,a4 as zr,R as Ee,D as Lr,C as se,n as H,A as Dr}from"./vendor-utils-BSZ4yJws.js";import{a as Wr,G as Br,bf as $r,c as je,ad as Or,Z as Nr,bg as Ur,aA as qe,X as le,bc as Fr,bh as _r,a9 as qr,aa as Hr,bi as Gr}from"./index-CN4lpn74.js";import{a as R,h as Kr,k as ce,g as Q,b as M,j as Vr}from"./vendor-hooks-fhL5FJET.js";import{l as He}from"./arrow-down.svg-C5rjQJG2.js";import{p as Ce,U as z,V as L,at as Yr,i as Ge,au as Zr,H as O,av as Qr,aw as Xr,ax as ze,e as Jr,n as Ke,d as ke,ay as et,az as T,D as rt,C as tt,$ as ot,aA as nt,aB as st,o as Ve}from"./vendor-ux-sqP3hEhY.js";import{N as it}from"./list-D4Gs036Z.js";import{d as at}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-BdQv8P8t.js";import{h as De,T as lt}from"./team-BnNEVFdE.js";import{b as ct,d as dt,a as ut,c as pt,e as ft,f as ht,h as xt,$ as mt}from"./user-center-DxoxMBFK.js";import{T as We,O as gt}from"./index-CekShFJg.js";import{c as bt}from"./passport-CqvORkfw.js";import{N as Ye,U as Ze}from"./index-h3JyhqqC.js";import{u as de}from"./use-mobile-BpPz1bKz.js";import yt from"./index-BJz7bmlp.js";import{U as vt,a as wt}from"./user-follower-CNxYFKVI.js";import{f as Y}from"./index-DBs9Ljax.js";import{u as ge}from"./index-B9Igf2rm.js";import jt from"./index-tukXJbMk.js";import{o as Ct}from"./vendor-arcblock-3xKfH3F1.js";import{c as kt,b as ie,a as St,S as Pt}from"./index-DQB7DBpQ.js";import"./index-bbu7QFpz.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./util-DzwOLYt5.js";import"./base32-AX-I0UaR.js";import"./session-DNlfWI2Z.js";import"./isURL-DskT4RKm.js";import"./use-app-logo-BWOYOuhG.js";import"./index-DrJnt_vf.js";import"./revoke.svg-CuiCGfVW.js";import"./use-mobile-DoKVMODs.js";import"./actions-CIp6hu8_.js";import"./index-BF7MtybM.js";import"./form-text-input-CBL3JAev.js";import"./required-glXJjYm5.js";import"./form-wrapper-CqFSijKV.js";import"./edit.svg-Dz9cVo7r.js";import"./lock.svg-BPCZ0CT3.js";import"./index-C0TbDTja.js";import"./permission-DLnMVuoy.js";import"./confirm-DPD7yjeR.js";import"./click-to-copy-DZ_4RDjR.js";import"./invitations-Cy_dNcIE.js";import"./create-passport-svg-BZVXsAoP.js";import"./api-DIucIOLX.js";import"./table-tips-cVuoMOXE.js";import"./ua-parser-DP5omx3I.js";import"./sdk-CiQg0Ndf.js";import"./passport-item-BMa8rd85.js";import"./did-address-CihvGtuj.js";import"./index-CgnIkelt.js";import"./vendor-mui-x-B4OOX5Es.js";import"./AdapterDayjs-OZNn2tpO.js";import"./delete-confirm-G3d9EUZU.js";import"./index-DRYJ0xIl.js";function It(){let r=new Map;function a({root:s,rootMargin:o,threshold:n}){let f=r.get(s);f||(f=new Map,r.set(s,f));let i=JSON.stringify({rootMargin:o,threshold:n}),u=f.get(i);if(!u){let l=new Map;u={observer:new IntersectionObserver(t=>{t.forEach(b=>{l.get(b.target)?.(b)})},{root:s,rootMargin:o,threshold:n}),entryCallbacks:l},f.set(i,u)}return{observe:(l,t)=>{u.entryCallbacks.set(l,t),u.observer.observe(l)},unobserve:l=>{u.entryCallbacks.delete(l),u.observer.unobserve(l)}}}return{getObserver:a}}var Tt="0px",Rt=[0],Mt=It();function At(r){let a=r?.rootMargin??Tt,s=r?.threshold??Rt,o=y.useRef(null),n=y.useRef(null),f=y.useRef(null),[i,u]=y.useState(),l=y.useCallback(()=>{let j=o.current;if(!j){u(void 0);return}let v=Mt.getObserver({root:n.current,rootMargin:a,threshold:s});v.observe(j,d=>{u(d)}),f.current=v},[a,s]),t=y.useCallback(()=>{let j=f.current,v=o.current;v&&j?.unobserve(v),f.current=null},[]),b=y.useCallback(j=>{t(),o.current=j,l()},[l,t]),p=y.useCallback(j=>{t(),n.current=j,l()},[l,t]);return[b,{entry:i,rootRef:p}]}var Et=At;function zt(r){let[a,s]=Et(r),o=!!s.entry?.isIntersecting,[n,f]=y.useState(o);return o&&!n&&f(!0),[a,{...s,isVisible:o,wasEverVisible:n}]}var Lt=zt,Dt=100;function Wt({loading:r,hasNextPage:a,onLoadMore:s,rootMargin:o,disabled:n,delayInMs:f=Dt}){let i=y.useRef(s),[u,{rootRef:l,isVisible:t}]=Lt({rootMargin:o});y.useEffect(()=>{i.current=s},[s]);let b=!n&&!r&&t&&a;return y.useEffect(()=>{if(b){let p=setTimeout(()=>{i.current()},f);return()=>{clearTimeout(p)}}},[b,f]),[u,{rootRef:l}]}var Bt=Wt;const me={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:h.oneOf(["info","success","warning","error",""]).isRequired,size:h.number};function ae({severity:r,size:a=8}){return me[r]?e.jsx(m,{component:"span",sx:{display:"inline-block",width:a,height:a,borderRadius:"50%",backgroundColor:me[r]||me.info}}):null}Qe.propTypes={theme:h.string,type:h.oneOf(["button","line","select"]),onSelectType:h.func,extra:h.node,loading:h.bool,currentTab:h.oneOf(["info","success","warning","error",""])};function Qe({theme:r="dark",type:a="button",onSelectType:s,extra:o=void 0,currentTab:n="",loading:f=!1,...i}){const{t:u}=y.useContext(Ce),l=[{label:u("notification.allSeverity"),value:""},{label:u("notification.severityType.info"),value:"info"},{label:u("notification.severityType.success"),value:"success"},{label:u("notification.severityType.warning"),value:"warning"},{label:u("notification.severityType.error"),value:"error"}],t=x=>{(x!==n||!f)&&s(x)},b=y.useMemo(()=>{const x={width:"100%",bgcolor:r==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:a==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return a==="line"?Object.assign(x,{}):x},[a,r]),p=(x,k,I)=>e.jsx(G,{disabled:f,onClick:()=>t(x.value),className:`profile-button ${k?"active":""}`,...i,children:x.label},x.value||I),j=(x,k,I)=>e.jsx(G,{variant:"text",disabled:f,onClick:()=>t(x.value),className:`profile-line-button ${k?"active":""}`,...i,children:x.label},x.value||I),v=()=>l?.map((x,k)=>{const I=n===x?.value;return a==="line"?e.jsx(y.Fragment,{children:j(x,I,k)},x.value||k):e.jsx(y.Fragment,{children:p(x,I,k)},x.value||k)}),d=x=>{const{value:k}=x.target;t(k==="all"?"":k)};return a==="select"?e.jsx(hr,{sx:{maxWidth:300},children:e.jsx(ye,{value:n||"all",onChange:d,size:"small",label:"Severity",IconComponent:x=>e.jsx(He,{...x,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:l.map((x,k)=>e.jsx(oe,{value:x.value||"all",children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:x.value}),x.label]})},x.value||k))})}):e.jsxs(m,{className:"severity-tabs",sx:b,children:[e.jsx(m,{sx:{...a==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}Xe.propTypes={paging:h.objectOf(h.any).isRequired,loading:h.bool.isRequired,onChange:h.func.isRequired};function Xe({loading:r,paging:a,onChange:s}){const{t:o}=y.useContext(Ce),n=ve(l=>l.breakpoints.down("md"));if(a.pageCount<=0||n)return null;const f=(l,t)=>{s({page:t+1})},i=l=>{const t=Number(l.target.value);s({page:1,pageSize:t})},u=a.page-1<=0?0:a.page-1;return e.jsx(m,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xr,{component:"div",disabled:r,count:a.total,page:u,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:t,count:b})=>`${l}–${t} / ${b!==-1?b:`${o()}more than ${t}`}`,rowsPerPage:a.pageSize,onPageChange:f,onRowsPerPageChange:i})})}const $t=y.memo(Xe),Ot={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"/>'},Be=6,$e={"& .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}},Nt={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Nt,width:"calc(50% - 8px)"});Je.propTypes={loading:h.bool,type:h.oneOf(["server","service"]),onFilterChange:h.func,blockletMap:h.object,filterType:h.oneOf(["component","entity"]),selectedId:h.array,severity:h.array,enableMarkAllAsRead:h.bool,unReadCount:h.number,onReadFilterChange:h.func,currentReadFilter:h.string};function Je({onFilterChange:r=()=>{},loading:a=!1,type:s="service",blockletMap:o={},filterType:n="component",selectedId:f=[],severity:i=[],enableMarkAllAsRead:u=!0,unReadCount:l=0,onReadFilterChange:t=()=>{},currentReadFilter:b="all"}){const{t:p}=y.useContext(Ce),[j,v]=y.useState(null),d=!!j,[x,k]=y.useState(f),[I,D]=y.useState(i),[g,C]=y.useState(!1),[S,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{k(f),D(i)},[f,i]);const U=[{label:p("notification.filterType.all"),value:"all"},{label:p("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==b||!a)&&t(c)},K=[{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),C(!1)},pe=()=>{v(null)},ee=c=>{const w=x.includes(c)?x.filter(P=>P!==c):[...x,c];k(w),r({id:w,severity:I})},re=c=>{const w=I.includes(c)?I.filter(P=>P!==c):[...I,c];D(w),r({severity:w,id:x})},fe=c=>{_(c.target.value)},he=()=>{C(!g)},q=Rr.useMemo(()=>{if(!o.size)return[];const c=[];return n==="component"&&c.push({label:p("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const P=w.did||w.meta?.did,E=w.title||w.meta?.title||"",$=w.appPid||w.appDid;(n==="component"&&$!==P||n==="entity"&&$===P)&&c.push({label:E,id:P,blocklet:w,ancestors:w.ancestors})}),c},[o,n,p]);y.useEffect(()=>{if(S.trim()==="")N(q);else{const c=S.toLowerCase(),w=q.filter(P=>P.label.toLowerCase().includes(c));N(w)}},[S,q]);const xe=S.trim()!==""||g?B:B.slice(0,Be);return e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:u?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[u&&e.jsx(m,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:a,onClick:()=>X(c.value),className:`profile-button ${b===c.value?"active":""}`,sx:{...s==="service"&&b===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:b===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&l>0&&` (${l})`]},c.value))}),e.jsxs(m,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(W,{size:"small",onClick:J,disabled:a,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(z,{icon:Ot,hFlip:!0})}),e.jsx(mr,{open:d,anchorEl:j,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{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:e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("notification.severity")}),e.jsx(m,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(x.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{k([]),D([]),r({severity:[],id:[]})},startIcon:e.jsx(gr,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:p("notification.clear")})})]}),e.jsx(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...$e},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>re(c.value),disabled:a,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(m,{sx:{mb:2},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:p("notification.from")}),e.jsx(m,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:S,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(z,{icon:at})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(x.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...$e},control:e.jsx(Re,{checked:x.includes(c.id),onChange:()=>ee(c.id),disabled:a,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(A,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&S.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:g?e.jsx(br,{}):e.jsx(yr,{})})]})]})})]})]}),x.length>0||I.length>0?e.jsxs(m,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(P=>P.value===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>re(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),x.map(c=>{const w=q.find(P=>P.id===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Ut=Z(jr)`
1
+ import{j as e,y as hr,bc as ye,M as oe,ak as m,Q as G,W as h,J as ve,c1 as xr,I as W,aN as mr,T as A,aj as gr,b5 as Pe,P as Ie,b6 as Te,a5 as Re,z as Ue,A as Fe,cj as br,bh as yr,U as Me,cS as vr,cT as wr,at as Z,cU as jr,a6 as V,n as ne,D as Cr,cV as kr,ar as Ae,b1 as we,cW as Sr,aX as Pr,a$ as Ir,cX as Tr}from"./vendor-mui-core-DHT36AZL.js";import{r as y,a as Rr,u as Mr,j as Ar}from"./vendor-react-CUXIiAnY.js";import{t as _e,Z as Er,a4 as zr,R as Ee,D as Lr,C as se,n as H,A as Dr}from"./vendor-utils-BSZ4yJws.js";import{a as Wr,G as Br,bf as $r,c as je,ad as Or,Z as Nr,bg as Ur,aA as qe,X as le,bc as Fr,bh as _r,a9 as qr,aa as Hr,bi as Gr}from"./index-lFDZOk_k.js";import{a as R,h as Kr,k as ce,g as Q,b as M,j as Vr}from"./vendor-hooks-fhL5FJET.js";import{l as He}from"./arrow-down.svg-mj2eIUoA.js";import{p as Ce,U as z,V as L,at as Yr,i as Ge,au as Zr,H as O,av as Qr,aw as Xr,ax as ze,e as Jr,n as Ke,d as ke,ay as et,az as T,D as rt,C as tt,$ as ot,aA as nt,aB as st,o as Ve}from"./vendor-ux-sqP3hEhY.js";import{N as it}from"./list-DXe9E4ws.js";import{d as at}from"./search-4YYphs0l.js";import{B as Le}from"./bundle-avatar-DACPWlAj.js";import{h as De,T as lt}from"./team-KWOyNaWn.js";import{b as ct,d as dt,a as ut,c as pt,e as ft,f as ht,h as xt,$ as mt}from"./user-center-CXduwafJ.js";import{T as We,O as gt}from"./index-sfOXn4Gu.js";import{c as bt}from"./passport-DHiNUeVn.js";import{N as Ye,U as Ze}from"./index-CgTWMV4T.js";import{u as de}from"./use-mobile-BpPz1bKz.js";import yt from"./index-D9UpcFKi.js";import{U as vt,a as wt}from"./user-follower-CmGz7Inx.js";import{f as Y}from"./index-DBs9Ljax.js";import{u as ge}from"./index-B9Igf2rm.js";import jt from"./index-BUomsang.js";import{o as Ct}from"./vendor-arcblock-3xKfH3F1.js";import{c as kt,b as ie,a as St,S as Pt}from"./index-CxJOg5jI.js";import"./index-bbu7QFpz.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./util-MbDHkO8z.js";import"./base32-AX-I0UaR.js";import"./session-DR7jqIW5.js";import"./isURL-fcz3vuMN.js";import"./use-app-logo-hGlkw2d_.js";import"./index-Cy73v3o9.js";import"./revoke.svg-CuiCGfVW.js";import"./use-mobile-DoKVMODs.js";import"./actions-CIp6hu8_.js";import"./index-BF7MtybM.js";import"./form-text-input-CBL3JAev.js";import"./required-glXJjYm5.js";import"./form-wrapper-CqFSijKV.js";import"./edit.svg-Dz9cVo7r.js";import"./lock.svg-BPCZ0CT3.js";import"./index-D6MFQa2J.js";import"./permission-B3_OQqtH.js";import"./confirm-Dge1BR0a.js";import"./click-to-copy-DZ_4RDjR.js";import"./invitations-DtmYY9Tr.js";import"./create-passport-svg-BZVXsAoP.js";import"./api-DIucIOLX.js";import"./table-tips-cVuoMOXE.js";import"./ua-parser-DP5omx3I.js";import"./sdk-DAuiCSLy.js";import"./passport-item-BkmVlAdr.js";import"./did-address-CihvGtuj.js";import"./index-BoeLorfn.js";import"./vendor-mui-x-B4OOX5Es.js";import"./AdapterDayjs-OZNn2tpO.js";import"./delete-confirm-CaK42Rqi.js";import"./index-DRYJ0xIl.js";function It(){let r=new Map;function a({root:s,rootMargin:o,threshold:n}){let f=r.get(s);f||(f=new Map,r.set(s,f));let i=JSON.stringify({rootMargin:o,threshold:n}),u=f.get(i);if(!u){let l=new Map;u={observer:new IntersectionObserver(t=>{t.forEach(b=>{l.get(b.target)?.(b)})},{root:s,rootMargin:o,threshold:n}),entryCallbacks:l},f.set(i,u)}return{observe:(l,t)=>{u.entryCallbacks.set(l,t),u.observer.observe(l)},unobserve:l=>{u.entryCallbacks.delete(l),u.observer.unobserve(l)}}}return{getObserver:a}}var Tt="0px",Rt=[0],Mt=It();function At(r){let a=r?.rootMargin??Tt,s=r?.threshold??Rt,o=y.useRef(null),n=y.useRef(null),f=y.useRef(null),[i,u]=y.useState(),l=y.useCallback(()=>{let j=o.current;if(!j){u(void 0);return}let v=Mt.getObserver({root:n.current,rootMargin:a,threshold:s});v.observe(j,d=>{u(d)}),f.current=v},[a,s]),t=y.useCallback(()=>{let j=f.current,v=o.current;v&&j?.unobserve(v),f.current=null},[]),b=y.useCallback(j=>{t(),o.current=j,l()},[l,t]),p=y.useCallback(j=>{t(),n.current=j,l()},[l,t]);return[b,{entry:i,rootRef:p}]}var Et=At;function zt(r){let[a,s]=Et(r),o=!!s.entry?.isIntersecting,[n,f]=y.useState(o);return o&&!n&&f(!0),[a,{...s,isVisible:o,wasEverVisible:n}]}var Lt=zt,Dt=100;function Wt({loading:r,hasNextPage:a,onLoadMore:s,rootMargin:o,disabled:n,delayInMs:f=Dt}){let i=y.useRef(s),[u,{rootRef:l,isVisible:t}]=Lt({rootMargin:o});y.useEffect(()=>{i.current=s},[s]);let b=!n&&!r&&t&&a;return y.useEffect(()=>{if(b){let p=setTimeout(()=>{i.current()},f);return()=>{clearTimeout(p)}}},[b,f]),[u,{rootRef:l}]}var Bt=Wt;const me={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:h.oneOf(["info","success","warning","error",""]).isRequired,size:h.number};function ae({severity:r,size:a=8}){return me[r]?e.jsx(m,{component:"span",sx:{display:"inline-block",width:a,height:a,borderRadius:"50%",backgroundColor:me[r]||me.info}}):null}Qe.propTypes={theme:h.string,type:h.oneOf(["button","line","select"]),onSelectType:h.func,extra:h.node,loading:h.bool,currentTab:h.oneOf(["info","success","warning","error",""])};function Qe({theme:r="dark",type:a="button",onSelectType:s,extra:o=void 0,currentTab:n="",loading:f=!1,...i}){const{t:u}=y.useContext(Ce),l=[{label:u("notification.allSeverity"),value:""},{label:u("notification.severityType.info"),value:"info"},{label:u("notification.severityType.success"),value:"success"},{label:u("notification.severityType.warning"),value:"warning"},{label:u("notification.severityType.error"),value:"error"}],t=x=>{(x!==n||!f)&&s(x)},b=y.useMemo(()=>{const x={width:"100%",bgcolor:r==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:a==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return a==="line"?Object.assign(x,{}):x},[a,r]),p=(x,k,I)=>e.jsx(G,{disabled:f,onClick:()=>t(x.value),className:`profile-button ${k?"active":""}`,...i,children:x.label},x.value||I),j=(x,k,I)=>e.jsx(G,{variant:"text",disabled:f,onClick:()=>t(x.value),className:`profile-line-button ${k?"active":""}`,...i,children:x.label},x.value||I),v=()=>l?.map((x,k)=>{const I=n===x?.value;return a==="line"?e.jsx(y.Fragment,{children:j(x,I,k)},x.value||k):e.jsx(y.Fragment,{children:p(x,I,k)},x.value||k)}),d=x=>{const{value:k}=x.target;t(k==="all"?"":k)};return a==="select"?e.jsx(hr,{sx:{maxWidth:300},children:e.jsx(ye,{value:n||"all",onChange:d,size:"small",label:"Severity",IconComponent:x=>e.jsx(He,{...x,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:l.map((x,k)=>e.jsx(oe,{value:x.value||"all",children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:x.value}),x.label]})},x.value||k))})}):e.jsxs(m,{className:"severity-tabs",sx:b,children:[e.jsx(m,{sx:{...a==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}Xe.propTypes={paging:h.objectOf(h.any).isRequired,loading:h.bool.isRequired,onChange:h.func.isRequired};function Xe({loading:r,paging:a,onChange:s}){const{t:o}=y.useContext(Ce),n=ve(l=>l.breakpoints.down("md"));if(a.pageCount<=0||n)return null;const f=(l,t)=>{s({page:t+1})},i=l=>{const t=Number(l.target.value);s({page:1,pageSize:t})},u=a.page-1<=0?0:a.page-1;return e.jsx(m,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(xr,{component:"div",disabled:r,count:a.total,page:u,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:t,count:b})=>`${l}–${t} / ${b!==-1?b:`${o()}more than ${t}`}`,rowsPerPage:a.pageSize,onPageChange:f,onRowsPerPageChange:i})})}const $t=y.memo(Xe),Ot={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"/>'},Be=6,$e={"& .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}},Nt={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Nt,width:"calc(50% - 8px)"});Je.propTypes={loading:h.bool,type:h.oneOf(["server","service"]),onFilterChange:h.func,blockletMap:h.object,filterType:h.oneOf(["component","entity"]),selectedId:h.array,severity:h.array,enableMarkAllAsRead:h.bool,unReadCount:h.number,onReadFilterChange:h.func,currentReadFilter:h.string};function Je({onFilterChange:r=()=>{},loading:a=!1,type:s="service",blockletMap:o={},filterType:n="component",selectedId:f=[],severity:i=[],enableMarkAllAsRead:u=!0,unReadCount:l=0,onReadFilterChange:t=()=>{},currentReadFilter:b="all"}){const{t:p}=y.useContext(Ce),[j,v]=y.useState(null),d=!!j,[x,k]=y.useState(f),[I,D]=y.useState(i),[g,C]=y.useState(!1),[S,_]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{k(f),D(i)},[f,i]);const U=[{label:p("notification.filterType.all"),value:"all"},{label:p("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==b||!a)&&t(c)},K=[{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),_(""),C(!1)},pe=()=>{v(null)},ee=c=>{const w=x.includes(c)?x.filter(P=>P!==c):[...x,c];k(w),r({id:w,severity:I})},re=c=>{const w=I.includes(c)?I.filter(P=>P!==c):[...I,c];D(w),r({severity:w,id:x})},fe=c=>{_(c.target.value)},he=()=>{C(!g)},q=Rr.useMemo(()=>{if(!o.size)return[];const c=[];return n==="component"&&c.push({label:p("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const P=w.did||w.meta?.did,E=w.title||w.meta?.title||"",$=w.appPid||w.appDid;(n==="component"&&$!==P||n==="entity"&&$===P)&&c.push({label:E,id:P,blocklet:w,ancestors:w.ancestors})}),c},[o,n,p]);y.useEffect(()=>{if(S.trim()==="")N(q);else{const c=S.toLowerCase(),w=q.filter(P=>P.label.toLowerCase().includes(c));N(w)}},[S,q]);const xe=S.trim()!==""||g?B:B.slice(0,Be);return e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:u?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[u&&e.jsx(m,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:a,onClick:()=>X(c.value),className:`profile-button ${b===c.value?"active":""}`,sx:{...s==="service"&&b===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:b===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&l>0&&` (${l})`]},c.value))}),e.jsxs(m,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(W,{size:"small",onClick:J,disabled:a,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(z,{icon:Ot,hFlip:!0})}),e.jsx(mr,{open:d,anchorEl:j,onClose:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{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:e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("notification.severity")}),e.jsx(m,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(x.length>0||I.length>0)&&e.jsx(G,{size:"small",onClick:()=>{k([]),D([]),r({severity:[],id:[]})},startIcon:e.jsx(gr,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:p("notification.clear")})})]}),e.jsx(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(I.includes(c.value)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...$e},control:e.jsx(Re,{checked:I.includes(c.value),onChange:()=>re(c.value),disabled:a,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(m,{sx:{mb:2},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:p("notification.from")}),e.jsx(m,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ue,{size:"small",placeholder:"search",value:S,onChange:fe,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Fe,{position:"start",sx:{marginRight:"2px"},children:e.jsx(z,{icon:at})})}}})})]}),e.jsx(Pe,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Ie,{elevation:0,sx:Oe(x.includes(c.id)),children:e.jsx(Te,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...$e},control:e.jsx(Re,{checked:x.includes(c.id),onChange:()=>ee(c.id),disabled:a,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(Le,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(A,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>Be&&S.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:g?e.jsx(br,{}):e.jsx(yr,{})})]})]})})]})]}),x.length>0||I.length>0?e.jsxs(m,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[I.map(c=>{const w=K.find(P=>P.value===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>re(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),x.map(c=>{const w=q.find(P=>P.id===c);return e.jsx(Me,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Le,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const Ut=Z(jr)`
2
2
  position: fixed;
3
3
  bottom: 20px;
4
4
  right: 20px;
@@ -1,4 +1,4 @@
1
- import{j as U,ax as rr,ak as en,f as ar}from"./vendor-mui-core-DHT36AZL.js";import{g as bi,d as sr,h as or,f as un,r as L}from"./vendor-react-CUXIiAnY.js";import{D as wi,ab as lr,e as fr,n as cr,ac as yi}from"./vendor-utils-BSZ4yJws.js";import{bx as dr,bN as ur}from"./index-CN4lpn74.js";import{l as Ie,aI as hr,aJ as _r}from"./vendor-ux-sqP3hEhY.js";import{j as pr}from"./vendor-hooks-fhL5FJET.js";/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gr=4,hn=0,_n=1,br=2;function Re(e){let n=e.length;for(;--n>=0;)e[n]=0}const wr=0,xi=1,yr=2,xr=3,mr=258,tn=29,We=256,je=We+1+tn,Se=30,nn=19,mi=2*je+1,be=15,yt=16,Er=7,rn=256,Ei=16,vi=17,Ni=18,Xt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ct=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),vr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ki=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=512,le=new Array((je+2)*2);Re(le);const Be=new Array(Se*2);Re(Be);const He=new Array(Nr);Re(He);const Ve=new Array(mr-xr+1);Re(Ve);const an=new Array(tn);Re(an);const dt=new Array(Se);Re(dt);function xt(e,n,t,i,l){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=l,this.has_stree=e&&e.length}let Ti,Ai,Si;function mt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const Oi=e=>e<256?He[e]:He[256+(e>>>7)],Xe=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},K=(e,n,t)=>{e.bi_valid>yt-t?(e.bi_buf|=n<<e.bi_valid&65535,Xe(e,e.bi_buf),e.bi_buf=n>>yt-e.bi_valid,e.bi_valid+=t-yt):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},ne=(e,n,t)=>{K(e,t[n*2],t[n*2+1])},Fi=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},kr=e=>{e.bi_valid===16?(Xe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Tr=(e,n)=>{const t=n.dyn_tree,i=n.max_code,l=n.stat_desc.static_tree,a=n.stat_desc.has_stree,f=n.stat_desc.extra_bits,s=n.stat_desc.extra_base,c=n.stat_desc.max_length;let r,o,E,_,h,v,T=0;for(_=0;_<=be;_++)e.bl_count[_]=0;for(t[e.heap[e.heap_max]*2+1]=0,r=e.heap_max+1;r<mi;r++)o=e.heap[r],_=t[t[o*2+1]*2+1]+1,_>c&&(_=c,T++),t[o*2+1]=_,!(o>i)&&(e.bl_count[_]++,h=0,o>=s&&(h=f[o-s]),v=t[o*2],e.opt_len+=v*(_+h),a&&(e.static_len+=v*(l[o*2+1]+h)));if(T!==0){do{for(_=c-1;e.bl_count[_]===0;)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[c]--,T-=2}while(T>0);for(_=c;_!==0;_--)for(o=e.bl_count[_];o!==0;)E=e.heap[--r],!(E>i)&&(t[E*2+1]!==_&&(e.opt_len+=(_-t[E*2+1])*t[E*2],t[E*2+1]=_),o--)}},Ii=(e,n,t)=>{const i=new Array(be+1);let l=0,a,f;for(a=1;a<=be;a++)l=l+t[a-1]<<1,i[a]=l;for(f=0;f<=n;f++){let s=e[f*2+1];s!==0&&(e[f*2]=Fi(i[s]++,s))}},Ar=()=>{let e,n,t,i,l;const a=new Array(be+1);for(t=0,i=0;i<tn-1;i++)for(an[i]=t,e=0;e<1<<Xt[i];e++)Ve[t++]=i;for(Ve[t-1]=i,l=0,i=0;i<16;i++)for(dt[i]=l,e=0;e<1<<ct[i];e++)He[l++]=i;for(l>>=7;i<Se;i++)for(dt[i]=l<<7,e=0;e<1<<ct[i]-7;e++)He[256+l++]=i;for(n=0;n<=be;n++)a[n]=0;for(e=0;e<=143;)le[e*2+1]=8,e++,a[8]++;for(;e<=255;)le[e*2+1]=9,e++,a[9]++;for(;e<=279;)le[e*2+1]=7,e++,a[7]++;for(;e<=287;)le[e*2+1]=8,e++,a[8]++;for(Ii(le,je+1,a),e=0;e<Se;e++)Be[e*2+1]=5,Be[e*2]=Fi(e,5);Ti=new xt(le,Xt,We+1,je,be),Ai=new xt(Be,ct,0,Se,be),Si=new xt(new Array(0),vr,0,nn,Er)},Ri=e=>{let n;for(n=0;n<je;n++)e.dyn_ltree[n*2]=0;for(n=0;n<Se;n++)e.dyn_dtree[n*2]=0;for(n=0;n<nn;n++)e.bl_tree[n*2]=0;e.dyn_ltree[rn*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},zi=e=>{e.bi_valid>8?Xe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},pn=(e,n,t,i)=>{const l=n*2,a=t*2;return e[l]<e[a]||e[l]===e[a]&&i[n]<=i[t]},Et=(e,n,t)=>{const i=e.heap[t];let l=t<<1;for(;l<=e.heap_len&&(l<e.heap_len&&pn(n,e.heap[l+1],e.heap[l],e.depth)&&l++,!pn(n,i,e.heap[l],e.depth));)e.heap[t]=e.heap[l],t=l,l<<=1;e.heap[t]=i},gn=(e,n,t)=>{let i,l,a=0,f,s;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+a++]&255,i+=(e.pending_buf[e.sym_buf+a++]&255)<<8,l=e.pending_buf[e.sym_buf+a++],i===0?ne(e,l,n):(f=Ve[l],ne(e,f+We+1,n),s=Xt[f],s!==0&&(l-=an[f],K(e,l,s)),i--,f=Oi(i),ne(e,f,t),s=ct[f],s!==0&&(i-=dt[f],K(e,i,s)));while(a<e.sym_next);ne(e,rn,n)},qt=(e,n)=>{const t=n.dyn_tree,i=n.stat_desc.static_tree,l=n.stat_desc.has_stree,a=n.stat_desc.elems;let f,s,c=-1,r;for(e.heap_len=0,e.heap_max=mi,f=0;f<a;f++)t[f*2]!==0?(e.heap[++e.heap_len]=c=f,e.depth[f]=0):t[f*2+1]=0;for(;e.heap_len<2;)r=e.heap[++e.heap_len]=c<2?++c:0,t[r*2]=1,e.depth[r]=0,e.opt_len--,l&&(e.static_len-=i[r*2+1]);for(n.max_code=c,f=e.heap_len>>1;f>=1;f--)Et(e,t,f);r=a;do f=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Et(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=f,e.heap[--e.heap_max]=s,t[r*2]=t[f*2]+t[s*2],e.depth[r]=(e.depth[f]>=e.depth[s]?e.depth[f]:e.depth[s])+1,t[f*2+1]=t[s*2+1]=r,e.heap[1]=r++,Et(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Tr(e,n),Ii(t,c,e.bl_count)},bn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)&&(s<r?e.bl_tree[a*2]+=s:a!==0?(a!==l&&e.bl_tree[a*2]++,e.bl_tree[Ei*2]++):s<=10?e.bl_tree[vi*2]++:e.bl_tree[Ni*2]++,s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4))},wn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),i=0;i<=t;i++)if(a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)){if(s<r)do ne(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==l&&(ne(e,a,e.bl_tree),s--),ne(e,Ei,e.bl_tree),K(e,s-3,2)):s<=10?(ne(e,vi,e.bl_tree),K(e,s-3,3)):(ne(e,Ni,e.bl_tree),K(e,s-11,7));s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4)}},Sr=e=>{let n;for(bn(e,e.dyn_ltree,e.l_desc.max_code),bn(e,e.dyn_dtree,e.d_desc.max_code),qt(e,e.bl_desc),n=nn-1;n>=3&&e.bl_tree[ki[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Or=(e,n,t,i)=>{let l;for(K(e,n-257,5),K(e,t-1,5),K(e,i-4,4),l=0;l<i;l++)K(e,e.bl_tree[ki[l]*2+1],3);wn(e,e.dyn_ltree,n-1),wn(e,e.dyn_dtree,t-1)},Fr=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return hn;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return _n;for(t=32;t<We;t++)if(e.dyn_ltree[t*2]!==0)return _n;return hn};let yn=!1;const Ir=e=>{yn||(Ar(),yn=!0),e.l_desc=new mt(e.dyn_ltree,Ti),e.d_desc=new mt(e.dyn_dtree,Ai),e.bl_desc=new mt(e.bl_tree,Si),e.bi_buf=0,e.bi_valid=0,Ri(e)},Ci=(e,n,t,i)=>{K(e,(wr<<1)+(i?1:0),3),zi(e),Xe(e,t),Xe(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Rr=e=>{K(e,xi<<1,3),ne(e,rn,le),kr(e)},zr=(e,n,t,i)=>{let l,a,f=0;e.level>0?(e.strm.data_type===br&&(e.strm.data_type=Fr(e)),qt(e,e.l_desc),qt(e,e.d_desc),f=Sr(e),l=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=l&&(l=a)):l=a=t+5,t+4<=l&&n!==-1?Ci(e,n,t,i):e.strategy===gr||a===l?(K(e,(xi<<1)+(i?1:0),3),gn(e,le,Be)):(K(e,(yr<<1)+(i?1:0),3),Or(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1),gn(e,e.dyn_ltree,e.dyn_dtree)),Ri(e),i&&zi(e)},Cr=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Ve[t]+We+1)*2]++,e.dyn_dtree[Oi(n)*2]++),e.sym_next===e.sym_end);var Lr=Ir,Pr=Ci,$r=zr,Zr=Cr,Br=Rr,Ur={_tr_init:Lr,_tr_stored_block:Pr,_tr_flush_block:$r,_tr_tally:Zr,_tr_align:Br};const Mr=(e,n,t,i)=>{let l=e&65535|0,a=e>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do l=l+n[i++]|0,a=a+l|0;while(--f);l%=65521,a%=65521}return l|a<<16|0};var qe=Mr;const jr=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},Hr=new Uint32Array(jr()),Vr=(e,n,t,i)=>{const l=Hr,a=i+t;e^=-1;for(let f=i;f<a;f++)e=e>>>8^l[(e^n[f])&255];return e^-1};var H=Vr,xe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Je={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Xr,_tr_stored_block:Gt,_tr_flush_block:qr,_tr_tally:_e,_tr_align:Gr}=Ur,{Z_NO_FLUSH:pe,Z_PARTIAL_FLUSH:Kr,Z_FULL_FLUSH:Yr,Z_FINISH:Q,Z_BLOCK:xn,Z_OK:V,Z_STREAM_END:mn,Z_STREAM_ERROR:ie,Z_DATA_ERROR:Wr,Z_BUF_ERROR:vt,Z_DEFAULT_COMPRESSION:Jr,Z_FILTERED:Qr,Z_HUFFMAN_ONLY:nt,Z_RLE:Dr,Z_FIXED:ea,Z_DEFAULT_STRATEGY:ta,Z_UNKNOWN:na,Z_DEFLATED:_t}=Je,ia=9,ra=15,aa=8,sa=29,oa=256,Kt=oa+1+sa,la=30,fa=19,ca=2*Kt+1,da=15,P=3,he=258,re=he+P+1,ua=32,Oe=42,sn=57,Yt=69,Wt=73,Jt=91,Qt=103,we=113,$e=666,X=1,ze=2,me=3,Ce=4,ha=3,ye=(e,n)=>(e.msg=xe[n],n),En=e=>e*2-(e>4?9:0),ue=e=>{let n=e.length;for(;--n>=0;)e[n]=0},_a=e=>{let n,t,i,l=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=l?t-l:0;while(--n);n=l,i=n;do t=e.prev[--i],e.prev[i]=t>=l?t-l:0;while(--n)};let pa=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask,ge=pa;const W=e=>{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},J=(e,n)=>{qr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,W(e.strm)},B=(e,n)=>{e.pending_buf[e.pending++]=n},Le=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Dt=(e,n,t,i)=>{let l=e.avail_in;return l>i&&(l=i),l===0?0:(e.avail_in-=l,n.set(e.input.subarray(e.next_in,e.next_in+l),t),e.state.wrap===1?e.adler=qe(e.adler,n,l,t):e.state.wrap===2&&(e.adler=H(e.adler,n,l,t)),e.next_in+=l,e.total_in+=l,l)},Li=(e,n)=>{let t=e.max_chain_length,i=e.strstart,l,a,f=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-re?e.strstart-(e.w_size-re):0,r=e.window,o=e.w_mask,E=e.prev,_=e.strstart+he;let h=r[i+f-1],v=r[i+f];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(l=n,!(r[l+f]!==v||r[l+f-1]!==h||r[l]!==r[i]||r[++l]!==r[i+1])){i+=2,l++;do;while(r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&i<_);if(a=he-(_-i),i=_-he,a>f){if(e.match_start=n,f=a,a>=s)break;h=r[i+f-1],v=r[i+f]}}while((n=E[n&o])>c&&--t!==0);return f<=e.lookahead?f:e.lookahead},Fe=e=>{const n=e.w_size;let t,i,l;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-re)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),_a(e),i+=n),e.strm.avail_in===0)break;if(t=Dt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=P)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=ge(e,e.ins_h,e.window[l+1]);e.insert&&(e.ins_h=ge(e,e.ins_h,e.window[l+P-1]),e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<P)););}while(e.lookahead<re&&e.strm.avail_in!==0)},Pi=(e,n)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,l,a,f=0,s=e.strm.avail_in;do{if(i=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,l=e.strstart-e.block_start,i>l+e.strm.avail_in&&(i=l+e.strm.avail_in),i>a&&(i=a),i<t&&(i===0&&n!==Q||n===pe||i!==l+e.strm.avail_in)))break;f=n===Q&&i===l+e.strm.avail_in?1:0,Gt(e,0,0,f),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,W(e.strm),l&&(l>i&&(l=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+l),e.strm.next_out),e.strm.next_out+=l,e.strm.avail_out-=l,e.strm.total_out+=l,e.block_start+=l,i-=l),i&&(Dt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(f===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),f?Ce:n!==pe&&n!==Q&&e.strm.avail_in===0&&e.strstart===e.block_start?ze:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Dt(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,l=e.strstart-e.block_start,(l>=t||(l||n===Q)&&n!==pe&&e.strm.avail_in===0&&l<=a)&&(i=l>a?a:l,f=n===Q&&e.strm.avail_in===0&&i===l?1:0,Gt(e,e.block_start,i,f),e.block_start+=i,W(e.strm)),f?me:X)},Nt=(e,n)=>{let t,i;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=P&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-re&&(e.match_length=Li(e,t)),e.match_length>=P)if(i=_e(e,e.strstart-e.match_start,e.match_length-P),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=P){e.match_length--;do e.strstart++,e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ge(e,e.ins_h,e.window[e.strstart+1]);else i=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=e.strstart<P-1?e.strstart:P-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},Te=(e,n)=>{let t,i,l;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=P&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=P-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-re&&(e.match_length=Li(e,t),e.match_length<=5&&(e.strategy===Qr||e.match_length===P&&e.strstart-e.match_start>4096)&&(e.match_length=P-1)),e.prev_length>=P&&e.match_length<=e.prev_length){l=e.strstart+e.lookahead-P,i=_e(e,e.strstart-1-e.prev_match,e.prev_length-P),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=l&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=P-1,e.strstart++,i&&(J(e,!1),e.strm.avail_out===0))return X}else if(e.match_available){if(i=_e(e,0,e.window[e.strstart-1]),i&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return X}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=_e(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<P-1?e.strstart:P-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ga=(e,n)=>{let t,i,l,a;const f=e.window;for(;;){if(e.lookahead<=he){if(Fe(e),e.lookahead<=he&&n===pe)return X;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=P&&e.strstart>0&&(l=e.strstart-1,i=f[l],i===f[++l]&&i===f[++l]&&i===f[++l])){a=e.strstart+he;do;while(i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&l<a);e.match_length=he-(a-l),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=P?(t=_e(e,1,e.match_length-P),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ba=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(Fe(e),e.lookahead===0)){if(n===pe)return X;break}if(e.match_length=0,t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze};function te(e,n,t,i,l){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=l}const Ze=[new te(0,0,0,0,Pi),new te(4,4,8,4,Nt),new te(4,5,16,8,Nt),new te(4,6,32,32,Nt),new te(4,4,16,16,Te),new te(8,16,32,32,Te),new te(8,16,128,128,Te),new te(8,32,128,256,Te),new te(32,128,258,1024,Te),new te(32,258,258,4096,Te)],wa=e=>{e.window_size=2*e.w_size,ue(e.head),e.max_lazy_match=Ze[e.level].max_lazy,e.good_match=Ze[e.level].good_length,e.nice_match=Ze[e.level].nice_length,e.max_chain_length=Ze[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=P-1,e.match_available=0,e.ins_h=0};function ya(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ca*2),this.dyn_dtree=new Uint16Array((2*la+1)*2),this.bl_tree=new Uint16Array((2*fa+1)*2),ue(this.dyn_ltree),ue(this.dyn_dtree),ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(da+1),this.heap=new Uint16Array(2*Kt+1),ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Kt+1),ue(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Oe&&n.status!==sn&&n.status!==Yt&&n.status!==Wt&&n.status!==Jt&&n.status!==Qt&&n.status!==we&&n.status!==$e?1:0},$i=e=>{if(Qe(e))return ye(e,ie);e.total_in=e.total_out=0,e.data_type=na;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?sn:n.wrap?Oe:we,e.adler=n.wrap===2?0:1,n.last_flush=-2,Xr(n),V},Zi=e=>{const n=$i(e);return n===V&&wa(e.state),n},xa=(e,n)=>Qe(e)||e.state.wrap!==2?ie:(e.state.gzhead=n,V),Bi=(e,n,t,i,l,a)=>{if(!e)return ie;let f=1;if(n===Jr&&(n=6),i<0?(f=0,i=-i):i>15&&(f=2,i-=16),l<1||l>ia||t!==_t||i<8||i>15||n<0||n>9||a<0||a>ea||i===8&&f!==1)return ye(e,ie);i===8&&(i=9);const s=new ya;return e.state=s,s.strm=e,s.status=Oe,s.wrap=f,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=l+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+P-1)/P),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<l+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=n,s.strategy=a,s.method=t,Zi(e)},ma=(e,n)=>Bi(e,n,_t,ra,aa,ta),Ea=(e,n)=>{if(Qe(e)||n>xn||n<0)return e?ye(e,ie):ie;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===$e&&n!==Q)return ye(e,e.avail_out===0?vt:ie);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(W(e),e.avail_out===0)return t.last_flush=-1,V}else if(e.avail_in===0&&En(n)<=En(i)&&n!==Q)return ye(e,vt);if(t.status===$e&&e.avail_in!==0)return ye(e,vt);if(t.status===Oe&&t.wrap===0&&(t.status=we),t.status===Oe){let l=_t+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=nt||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,l|=a<<6,t.strstart!==0&&(l|=ua),l+=31-l%31,Le(t,l),t.strstart!==0&&(Le(t,e.adler>>>16),Le(t,e.adler&65535)),e.adler=1,t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===sn){if(e.adler=0,B(t,31),B(t,139),B(t,8),t.gzhead)B(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),B(t,t.gzhead.time&255),B(t,t.gzhead.time>>8&255),B(t,t.gzhead.time>>16&255),B(t,t.gzhead.time>>24&255),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(B(t,t.gzhead.extra.length&255),B(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=H(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Yt;else if(B(t,0),B(t,0),B(t,0),B(t,0),B(t,0),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,ha),t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===Yt){if(t.gzhead.extra){let l=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex+=s,W(e),t.pending!==0)return t.last_flush=-1,V;l=0,a-=s}let f=new Uint8Array(t.gzhead.extra);t.pending_buf.set(f.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Wt}if(t.status===Wt){if(t.gzhead.name){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Jt}if(t.status===Jt){if(t.gzhead.comment){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l))}t.status=Qt}if(t.status===Qt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(W(e),t.pending!==0))return t.last_flush=-1,V;B(t,e.adler&255),B(t,e.adler>>8&255),e.adler=0}if(t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(e.avail_in!==0||t.lookahead!==0||n!==pe&&t.status!==$e){let l=t.level===0?Pi(t,n):t.strategy===nt?ba(t,n):t.strategy===Dr?ga(t,n):Ze[t.level].func(t,n);if((l===me||l===Ce)&&(t.status=$e),l===X||l===me)return e.avail_out===0&&(t.last_flush=-1),V;if(l===ze&&(n===Kr?Gr(t):n!==xn&&(Gt(t,0,0,!1),n===Yr&&(ue(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),W(e),e.avail_out===0))return t.last_flush=-1,V}return n!==Q?V:t.wrap<=0?mn:(t.wrap===2?(B(t,e.adler&255),B(t,e.adler>>8&255),B(t,e.adler>>16&255),B(t,e.adler>>24&255),B(t,e.total_in&255),B(t,e.total_in>>8&255),B(t,e.total_in>>16&255),B(t,e.total_in>>24&255)):(Le(t,e.adler>>>16),Le(t,e.adler&65535)),W(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?V:mn)},va=e=>{if(Qe(e))return ie;const n=e.state.status;return e.state=null,n===we?ye(e,Wr):V},Na=(e,n)=>{let t=n.length;if(Qe(e))return ie;const i=e.state,l=i.wrap;if(l===2||l===1&&i.status!==Oe||i.lookahead)return ie;if(l===1&&(e.adler=qe(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){l===0&&(ue(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(n.subarray(t-i.w_size,t),0),n=c,t=i.w_size}const a=e.avail_in,f=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,Fe(i);i.lookahead>=P;){let c=i.strstart,r=i.lookahead-(P-1);do i.ins_h=ge(i,i.ins_h,i.window[c+P-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--r);i.strstart=c,i.lookahead=P-1,Fe(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=P-1,i.match_available=0,e.next_in=f,e.input=s,e.avail_in=a,i.wrap=l,V};var ka=ma,Ta=Bi,Aa=Zi,Sa=$i,Oa=xa,Fa=Ea,Ia=va,Ra=Na,za="pako deflate (from Nodeca project)",Ue={deflateInit:ka,deflateInit2:Ta,deflateReset:Aa,deflateResetKeep:Sa,deflateSetHeader:Oa,deflate:Fa,deflateEnd:Ia,deflateSetDictionary:Ra,deflateInfo:za};const Ca=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var La=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)Ca(t,i)&&(e[i]=t[i])}}return e},Pa=e=>{let n=0;for(let i=0,l=e.length;i<l;i++)n+=e[i].length;const t=new Uint8Array(n);for(let i=0,l=0,a=e.length;i<a;i++){let f=e[i];t.set(f,l),l+=f.length}return t},pt={assign:La,flattenChunks:Pa};let Ui=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ui=!1}const Ge=new Uint8Array(256);for(let e=0;e<256;e++)Ge[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ge[254]=Ge[254]=1;var $a=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,l,a,f=e.length,s=0;for(l=0;l<f;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(s),a=0,l=0;a<s;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),t<128?n[a++]=t:t<2048?(n[a++]=192|t>>>6,n[a++]=128|t&63):t<65536?(n[a++]=224|t>>>12,n[a++]=128|t>>>6&63,n[a++]=128|t&63):(n[a++]=240|t>>>18,n[a++]=128|t>>>12&63,n[a++]=128|t>>>6&63,n[a++]=128|t&63);return n};const Za=(e,n)=>{if(n<65534&&e.subarray&&Ui)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return t};var Ba=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,l;const a=new Array(t*2);for(l=0,i=0;i<t;){let f=e[i++];if(f<128){a[l++]=f;continue}let s=Ge[f];if(s>4){a[l++]=65533,i+=s-1;continue}for(f&=s===2?31:s===3?15:7;s>1&&i<t;)f=f<<6|e[i++]&63,s--;if(s>1){a[l++]=65533;continue}f<65536?a[l++]=f:(f-=65536,a[l++]=55296|f>>10&1023,a[l++]=56320|f&1023)}return Za(a,l)},Ua=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Ge[e[t]]>n?t:n},Ke={string2buf:$a,buf2string:Ba,utf8border:Ua};function Ma(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Mi=Ma;const ji=Object.prototype.toString,{Z_NO_FLUSH:ja,Z_SYNC_FLUSH:Ha,Z_FULL_FLUSH:Va,Z_FINISH:Xa,Z_OK:ut,Z_STREAM_END:qa,Z_DEFAULT_COMPRESSION:Ga,Z_DEFAULT_STRATEGY:Ka,Z_DEFLATED:Ya}=Je;function De(e){this.options=pt.assign({level:Ga,method:Ya,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ka},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=Ue.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==ut)throw new Error(xe[t]);if(n.header&&Ue.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Ke.string2buf(n.dictionary):ji.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=Ue.deflateSetDictionary(this.strm,i),t!==ut)throw new Error(xe[t]);this._dict_set=!0}}De.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let l,a;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?Xa:ja,typeof e=="string"?t.input=Ke.string2buf(e):ji.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===Ha||a===Va)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(l=Ue.deflate(t,a),l===qa)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),l=Ue.deflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===ut;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};De.prototype.onData=function(e){this.chunks.push(e)};De.prototype.onEnd=function(e){e===ut&&(this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function on(e,n){const t=new De(n);if(t.push(e,!0),t.err)throw t.msg||xe[t.err];return t.result}function Wa(e,n){return n=n||{},n.raw=!0,on(e,n)}function Ja(e,n){return n=n||{},n.gzip=!0,on(e,n)}var Qa=De,Da=on,es=Wa,ts=Ja,ns={Deflate:Qa,deflate:Da,deflateRaw:es,gzip:ts};const it=16209,is=16191;var rs=function(n,t){let i,l,a,f,s,c,r,o,E,_,h,v,T,I,d,g,N,k,u,p,b,A,y,m;const O=n.state;i=n.next_in,y=n.input,l=i+(n.avail_in-5),a=n.next_out,m=n.output,f=a-(t-n.avail_out),s=a+(n.avail_out-257),c=O.dmax,r=O.wsize,o=O.whave,E=O.wnext,_=O.window,h=O.hold,v=O.bits,T=O.lencode,I=O.distcode,d=(1<<O.lenbits)-1,g=(1<<O.distbits)-1;e:do{v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=T[h&d];t:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k===0)m[a++]=N&65535;else if(k&16){u=N&65535,k&=15,k&&(v<k&&(h+=y[i++]<<v,v+=8),u+=h&(1<<k)-1,h>>>=k,v-=k),v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=I[h&g];n:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k&16){if(p=N&65535,k&=15,v<k&&(h+=y[i++]<<v,v+=8,v<k&&(h+=y[i++]<<v,v+=8)),p+=h&(1<<k)-1,p>c){n.msg="invalid distance too far back",O.mode=it;break e}if(h>>>=k,v-=k,k=a-f,p>k){if(k=p-k,k>o&&O.sane){n.msg="invalid distance too far back",O.mode=it;break e}if(b=0,A=_,E===0){if(b+=r-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}else if(E<k){if(b+=r+E-k,k-=E,k<u){u-=k;do m[a++]=_[b++];while(--k);if(b=0,E<u){k=E,u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}}else if(b+=E-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}for(;u>2;)m[a++]=A[b++],m[a++]=A[b++],m[a++]=A[b++],u-=3;u&&(m[a++]=A[b++],u>1&&(m[a++]=A[b++]))}else{b=a-p;do m[a++]=m[b++],m[a++]=m[b++],m[a++]=m[b++],u-=3;while(u>2);u&&(m[a++]=m[b++],u>1&&(m[a++]=m[b++]))}}else if((k&64)===0){N=I[(N&65535)+(h&(1<<k)-1)];continue n}else{n.msg="invalid distance code",O.mode=it;break e}break}}else if((k&64)===0){N=T[(N&65535)+(h&(1<<k)-1)];continue t}else if(k&32){O.mode=is;break e}else{n.msg="invalid literal/length code",O.mode=it;break e}break}}while(i<l&&a<s);u=v>>3,i-=u,v-=u<<3,h&=(1<<v)-1,n.next_in=i,n.next_out=a,n.avail_in=i<l?5+(l-i):5-(i-l),n.avail_out=a<s?257+(s-a):257-(a-s),O.hold=h,O.bits=v};const Ae=15,vn=852,Nn=592,kn=0,kt=1,Tn=2,as=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ss=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),os=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ls=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),fs=(e,n,t,i,l,a,f,s)=>{const c=s.bits;let r=0,o=0,E=0,_=0,h=0,v=0,T=0,I=0,d=0,g=0,N,k,u,p,b,A=null,y;const m=new Uint16Array(Ae+1),O=new Uint16Array(Ae+1);let w=null,x,S,F;for(r=0;r<=Ae;r++)m[r]=0;for(o=0;o<i;o++)m[n[t+o]]++;for(h=c,_=Ae;_>=1&&m[_]===0;_--);if(h>_&&(h=_),_===0)return l[a++]=1<<24|64<<16|0,l[a++]=1<<24|64<<16|0,s.bits=1,0;for(E=1;E<_&&m[E]===0;E++);for(h<E&&(h=E),I=1,r=1;r<=Ae;r++)if(I<<=1,I-=m[r],I<0)return-1;if(I>0&&(e===kn||_!==1))return-1;for(O[1]=0,r=1;r<Ae;r++)O[r+1]=O[r]+m[r];for(o=0;o<i;o++)n[t+o]!==0&&(f[O[n[t+o]]++]=o);if(e===kn?(A=w=f,y=20):e===kt?(A=as,w=ss,y=257):(A=os,w=ls,y=0),g=0,o=0,r=E,b=a,v=h,T=0,u=-1,d=1<<h,p=d-1,e===kt&&d>vn||e===Tn&&d>Nn)return 1;for(;;){x=r-T,f[o]+1<y?(S=0,F=f[o]):f[o]>=y?(S=w[f[o]-y],F=A[f[o]-y]):(S=96,F=0),N=1<<r-T,k=1<<v,E=k;do k-=N,l[b+(g>>T)+k]=x<<24|S<<16|F|0;while(k!==0);for(N=1<<r-1;g&N;)N>>=1;if(N!==0?(g&=N-1,g+=N):g=0,o++,--m[r]===0){if(r===_)break;r=n[t+f[o]]}if(r>h&&(g&p)!==u){for(T===0&&(T=h),b+=E,v=r-T,I=1<<v;v+T<_&&(I-=m[v+T],!(I<=0));)v++,I<<=1;if(d+=1<<v,e===kt&&d>vn||e===Tn&&d>Nn)return 1;u=g&p,l[u]=h<<24|v<<16|b-a|0}}return g!==0&&(l[b+g]=r-T<<24|64<<16|0),s.bits=h,0};var Me=fs;const cs=0,Hi=1,Vi=2,{Z_FINISH:An,Z_BLOCK:ds,Z_TREES:rt,Z_OK:Ee,Z_STREAM_END:us,Z_NEED_DICT:hs,Z_STREAM_ERROR:D,Z_DATA_ERROR:Xi,Z_MEM_ERROR:qi,Z_BUF_ERROR:_s,Z_DEFLATED:Sn}=Je,gt=16180,On=16181,Fn=16182,In=16183,Rn=16184,zn=16185,Cn=16186,Ln=16187,Pn=16188,$n=16189,ht=16190,oe=16191,Tt=16192,Zn=16193,At=16194,Bn=16195,Un=16196,Mn=16197,jn=16198,at=16199,st=16200,Hn=16201,Vn=16202,Xn=16203,qn=16204,Gn=16205,St=16206,Kn=16207,Yn=16208,j=16209,Gi=16210,Ki=16211,ps=852,gs=592,bs=15,ws=bs,Wn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ys(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ve=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode<gt||n.mode>Ki?1:0},Yi=e=>{if(ve(e))return D;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=gt,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(ps),n.distcode=n.distdyn=new Int32Array(gs),n.sane=1,n.back=-1,Ee},Wi=e=>{if(ve(e))return D;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,Yi(e)},Ji=(e,n)=>{let t;if(ve(e))return D;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?D:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,Wi(e))},Qi=(e,n)=>{if(!e)return D;const t=new ys;e.state=t,t.strm=e,t.window=null,t.mode=gt;const i=Ji(e,n);return i!==Ee&&(e.state=null),i},xs=e=>Qi(e,ws);let Jn=!0,Ot,Ft;const ms=e=>{if(Jn){Ot=new Int32Array(512),Ft=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Me(Hi,e.lens,0,288,Ot,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Me(Vi,e.lens,0,32,Ft,0,e.work,{bits:5}),Jn=!1}e.lencode=Ot,e.lenbits=9,e.distcode=Ft,e.distbits=5},Di=(e,n,t,i)=>{let l;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(n.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(l=a.wsize-a.wnext,l>i&&(l=i),a.window.set(n.subarray(t-i,t-i+l),a.wnext),i-=l,i?(a.window.set(n.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=l,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=l))),0},Es=(e,n)=>{let t,i,l,a,f,s,c,r,o,E,_,h,v,T,I=0,d,g,N,k,u,p,b,A;const y=new Uint8Array(4);let m,O;const w=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ve(e)||!e.output||!e.input&&e.avail_in!==0)return D;t=e.state,t.mode===oe&&(t.mode=Tt),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,E=s,_=c,A=Ee;e:for(;;)switch(t.mode){case gt:if(t.wrap===0){t.mode=Tt;break}for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&2&&r===35615){t.wbits===0&&(t.wbits=15),t.check=0,y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0),r=0,o=0,t.mode=On;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((r&255)<<8)+(r>>8))%31){e.msg="incorrect header check",t.mode=j;break}if((r&15)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(r>>>=4,o-=4,b=(r&15)+8,t.wbits===0&&(t.wbits=b),b>15||b>t.wbits){e.msg="invalid window size",t.mode=j;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=r&512?$n:oe,r=0,o=0;break;case On:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.flags=r,(t.flags&255)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=j;break}t.head&&(t.head.text=r>>8&1),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Fn;case Fn:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.time=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,y[2]=r>>>16&255,y[3]=r>>>24&255,t.check=H(t.check,y,4,0)),r=0,o=0,t.mode=In;case In:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.xflags=r&255,t.head.os=r>>8),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Rn;case Rn:if(t.flags&1024){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length=r,t.head&&(t.head.extra_len=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0}else t.head&&(t.head.extra=null);t.mode=zn;case zn:if(t.flags&1024&&(h=t.length,h>s&&(h=s),h&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+h),b)),t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,t.length-=h),t.length))break e;t.length=0,t.mode=Cn;case Cn:if(t.flags&2048){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Ln;case Ln:if(t.flags&4096){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.comment+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.comment=null);t.mode=Pn;case Pn:if(t.flags&512){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.check&65535)){e.msg="header crc mismatch",t.mode=j;break}r=0,o=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=oe;break;case $n:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}e.adler=t.check=Wn(r),r=0,o=0,t.mode=ht;case ht:if(t.havedict===0)return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,hs;e.adler=t.check=1,t.mode=oe;case oe:if(n===ds||n===rt)break e;case Tt:if(t.last){r>>>=o&7,o-=o&7,t.mode=St;break}for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}switch(t.last=r&1,r>>>=1,o-=1,r&3){case 0:t.mode=Zn;break;case 1:if(ms(t),t.mode=at,n===rt){r>>>=2,o-=2;break e}break;case 2:t.mode=Un;break;case 3:e.msg="invalid block type",t.mode=j}r>>>=2,o-=2;break;case Zn:for(r>>>=o&7,o-=o&7;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((r&65535)!==(r>>>16^65535)){e.msg="invalid stored block lengths",t.mode=j;break}if(t.length=r&65535,r=0,o=0,t.mode=At,n===rt)break e;case At:t.mode=Bn;case Bn:if(h=t.length,h){if(h>s&&(h=s),h>c&&(h=c),h===0)break e;l.set(i.subarray(a,a+h),f),s-=h,a+=h,c-=h,f+=h,t.length-=h;break}t.mode=oe;break;case Un:for(;o<14;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.nlen=(r&31)+257,r>>>=5,o-=5,t.ndist=(r&31)+1,r>>>=5,o-=5,t.ncode=(r&15)+4,r>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=j;break}t.have=0,t.mode=Mn;case Mn:for(;t.have<t.ncode;){for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.lens[w[t.have++]]=r&7,r>>>=3,o-=3}for(;t.have<19;)t.lens[w[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,m={bits:t.lenbits},A=Me(cs,t.lens,0,19,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid code lengths set",t.mode=j;break}t.have=0,t.mode=jn;case jn:for(;t.have<t.nlen+t.ndist;){for(;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(N<16)r>>>=d,o-=d,t.lens[t.have++]=N;else{if(N===16){for(O=d+2;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(r>>>=d,o-=d,t.have===0){e.msg="invalid bit length repeat",t.mode=j;break}b=t.lens[t.have-1],h=3+(r&3),r>>>=2,o-=2}else if(N===17){for(O=d+3;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=3+(r&7),r>>>=3,o-=3}else{for(O=d+7;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=11+(r&127),r>>>=7,o-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=j;break}for(;h--;)t.lens[t.have++]=b}}if(t.mode===j)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=j;break}if(t.lenbits=9,m={bits:t.lenbits},A=Me(Hi,t.lens,0,t.nlen,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid literal/lengths set",t.mode=j;break}if(t.distbits=6,t.distcode=t.distdyn,m={bits:t.distbits},A=Me(Vi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,m),t.distbits=m.bits,A){e.msg="invalid distances set",t.mode=j;break}if(t.mode=at,n===rt)break e;case at:t.mode=st;case st:if(s>=6&&c>=258){e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,rs(e,_),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,t.mode===oe&&(t.back=-1);break}for(t.back=0;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(g&&(g&240)===0){for(k=d,u=g,p=N;I=t.lencode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,t.length=N,g===0){t.mode=Gn;break}if(g&32){t.back=-1,t.mode=oe;break}if(g&64){e.msg="invalid literal/length code",t.mode=j;break}t.extra=g&15,t.mode=Hn;case Hn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Vn;case Vn:for(;I=t.distcode[r&(1<<t.distbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((g&240)===0){for(k=d,u=g,p=N;I=t.distcode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,g&64){e.msg="invalid distance code",t.mode=j;break}t.offset=N,t.extra=g&15,t.mode=Xn;case Xn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.offset+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=j;break}t.mode=qn;case qn:if(c===0)break e;if(h=_-c,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=j;break}h>t.wnext?(h-=t.wnext,v=t.wsize-h):v=t.wnext-h,h>t.length&&(h=t.length),T=t.window}else T=l,v=f-t.offset,h=t.length;h>c&&(h=c),c-=h,t.length-=h;do l[f++]=T[v++];while(--h);t.length===0&&(t.mode=st);break;case Gn:if(c===0)break e;l[f++]=t.length,c--,t.mode=st;break;case St:if(t.wrap){for(;o<32;){if(s===0)break e;s--,r|=i[a++]<<o,o+=8}if(_-=c,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,f-_):qe(t.check,l,_,f-_)),_=c,t.wrap&4&&(t.flags?r:Wn(r))!==t.check){e.msg="incorrect data check",t.mode=j;break}r=0,o=0}t.mode=Kn;case Kn:if(t.wrap&&t.flags){for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=j;break}r=0,o=0}t.mode=Yn;case Yn:A=us;break e;case j:A=Xi;break e;case Gi:return qi;case Ki:default:return D}return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,(t.wsize||_!==e.avail_out&&t.mode<j&&(t.mode<St||n!==An))&&Di(e,e.output,e.next_out,_-e.avail_out),E-=e.avail_in,_-=e.avail_out,e.total_in+=E,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,e.next_out-_):qe(t.check,l,_,e.next_out-_)),e.data_type=t.bits+(t.last?64:0)+(t.mode===oe?128:0)+(t.mode===at||t.mode===At?256:0),(E===0&&_===0||n===An)&&A===Ee&&(A=_s),A},vs=e=>{if(ve(e))return D;let n=e.state;return n.window&&(n.window=null),e.state=null,Ee},Ns=(e,n)=>{if(ve(e))return D;const t=e.state;return(t.wrap&2)===0?D:(t.head=n,n.done=!1,Ee)},ks=(e,n)=>{const t=n.length;let i,l,a;return ve(e)||(i=e.state,i.wrap!==0&&i.mode!==ht)?D:i.mode===ht&&(l=1,l=qe(l,n,t,0),l!==i.check)?Xi:(a=Di(e,n,t,t),a?(i.mode=Gi,qi):(i.havedict=1,Ee))};var Ts=Wi,As=Ji,Ss=Yi,Os=xs,Fs=Qi,Is=Es,Rs=vs,zs=Ns,Cs=ks,Ls="pako inflate (from Nodeca project)",fe={inflateReset:Ts,inflateReset2:As,inflateResetKeep:Ss,inflateInit:Os,inflateInit2:Fs,inflate:Is,inflateEnd:Rs,inflateGetHeader:zs,inflateSetDictionary:Cs,inflateInfo:Ls};function Ps(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $s=Ps;const er=Object.prototype.toString,{Z_NO_FLUSH:Zs,Z_FINISH:Bs,Z_OK:Ye,Z_STREAM_END:It,Z_NEED_DICT:Rt,Z_STREAM_ERROR:Us,Z_DATA_ERROR:Qn,Z_MEM_ERROR:Ms}=Je;function et(e){this.options=pt.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=fe.inflateInit2(this.strm,n.windowBits);if(t!==Ye)throw new Error(xe[t]);if(this.header=new $s,fe.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ke.string2buf(n.dictionary):er.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=fe.inflateSetDictionary(this.strm,n.dictionary),t!==Ye)))throw new Error(xe[t])}et.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,l=this.options.dictionary;let a,f,s;if(this.ended)return!1;for(n===~~n?f=n:f=n===!0?Bs:Zs,er.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=fe.inflate(t,f),a===Rt&&l&&(a=fe.inflateSetDictionary(t,l),a===Ye?a=fe.inflate(t,f):a===Qn&&(a=Rt));t.avail_in>0&&a===It&&t.state.wrap>0&&e[t.next_in]!==0;)fe.inflateReset(t),a=fe.inflate(t,f);switch(a){case Us:case Qn:case Rt:case Ms:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===It))if(this.options.to==="string"){let c=Ke.utf8border(t.output,t.next_out),r=t.next_out-c,o=Ke.buf2string(t.output,c);t.next_out=r,t.avail_out=i-r,r&&t.output.set(t.output.subarray(c,c+r),0),this.onData(o)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ye&&s===0)){if(a===It)return a=fe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};et.prototype.onData=function(e){this.chunks.push(e)};et.prototype.onEnd=function(e){e===Ye&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ln(e,n){const t=new et(n);if(t.push(e),t.err)throw t.msg||xe[t.err];return t.result}function js(e,n){return n=n||{},n.raw=!0,ln(e,n)}var Hs=et,Vs=ln,Xs=js,qs=ln,Gs={Inflate:Hs,inflate:Vs,inflateRaw:Xs,ungzip:qs};const{Deflate:Ks,deflate:Ys,deflateRaw:Ws,gzip:Js}=ns,{Inflate:Qs,inflate:Ds,inflateRaw:eo,ungzip:to}=Gs;var no=Ks,io=Ys,ro=Ws,ao=Js,so=Qs,oo=Ds,lo=eo,fo=to,co=Je,uo={Deflate:no,deflate:io,deflateRaw:ro,gzip:ao,Inflate:so,inflate:oo,inflateRaw:lo,ungzip:fo,constants:co},ot={exports:{}},zt={},Ct={},Dn;function fn(){return Dn||(Dn=1,function(e){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",i="["+n+"]["+t+"]*",l=new RegExp("^"+i+"$"),a=function(s,c){const r=[];let o=c.exec(s);for(;o;){const E=[];E.startIndex=c.lastIndex-o[0].length;const _=o.length;for(let h=0;h<_;h++)E.push(o[h]);r.push(E),o=c.exec(s)}return r},f=function(s){const c=l.exec(s);return!(c===null||typeof c>"u")};e.isExist=function(s){return typeof s<"u"},e.isEmptyObject=function(s){return Object.keys(s).length===0},e.merge=function(s,c,r){if(c){const o=Object.keys(c),E=o.length;for(let _=0;_<E;_++)r==="strict"?s[o[_]]=[c[o[_]]]:s[o[_]]=c[o[_]]}},e.getValue=function(s){return e.isExist(s)?s:""},e.isName=f,e.getAllMatches=a,e.nameRegexp=i}(Ct)),Ct}var ei;function tr(){if(ei)return zt;ei=1;const e=fn(),n={allowBooleanAttributes:!1,unpairedTags:[]};zt.validate=function(d,g){g=Object.assign({},n,g);const N=[];let k=!1,u=!1;d[0]==="\uFEFF"&&(d=d.substr(1));for(let p=0;p<d.length;p++)if(d[p]==="<"&&d[p+1]==="?"){if(p+=2,p=i(d,p),p.err)return p}else if(d[p]==="<"){let b=p;if(p++,d[p]==="!"){p=l(d,p);continue}else{let A=!1;d[p]==="/"&&(A=!0,p++);let y="";for(;p<d.length&&d[p]!==">"&&d[p]!==" "&&d[p]!==" "&&d[p]!==`
1
+ import{j as U,ax as rr,ak as en,f as ar}from"./vendor-mui-core-DHT36AZL.js";import{g as bi,d as sr,h as or,f as un,r as L}from"./vendor-react-CUXIiAnY.js";import{D as wi,ab as lr,e as fr,n as cr,ac as yi}from"./vendor-utils-BSZ4yJws.js";import{bx as dr,bN as ur}from"./index-lFDZOk_k.js";import{l as Ie,aI as hr,aJ as _r}from"./vendor-ux-sqP3hEhY.js";import{j as pr}from"./vendor-hooks-fhL5FJET.js";/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const gr=4,hn=0,_n=1,br=2;function Re(e){let n=e.length;for(;--n>=0;)e[n]=0}const wr=0,xi=1,yr=2,xr=3,mr=258,tn=29,We=256,je=We+1+tn,Se=30,nn=19,mi=2*je+1,be=15,yt=16,Er=7,rn=256,Ei=16,vi=17,Ni=18,Xt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ct=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),vr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ki=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=512,le=new Array((je+2)*2);Re(le);const Be=new Array(Se*2);Re(Be);const He=new Array(Nr);Re(He);const Ve=new Array(mr-xr+1);Re(Ve);const an=new Array(tn);Re(an);const dt=new Array(Se);Re(dt);function xt(e,n,t,i,l){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=l,this.has_stree=e&&e.length}let Ti,Ai,Si;function mt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const Oi=e=>e<256?He[e]:He[256+(e>>>7)],Xe=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},K=(e,n,t)=>{e.bi_valid>yt-t?(e.bi_buf|=n<<e.bi_valid&65535,Xe(e,e.bi_buf),e.bi_buf=n>>yt-e.bi_valid,e.bi_valid+=t-yt):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},ne=(e,n,t)=>{K(e,t[n*2],t[n*2+1])},Fi=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},kr=e=>{e.bi_valid===16?(Xe(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Tr=(e,n)=>{const t=n.dyn_tree,i=n.max_code,l=n.stat_desc.static_tree,a=n.stat_desc.has_stree,f=n.stat_desc.extra_bits,s=n.stat_desc.extra_base,c=n.stat_desc.max_length;let r,o,E,_,h,v,T=0;for(_=0;_<=be;_++)e.bl_count[_]=0;for(t[e.heap[e.heap_max]*2+1]=0,r=e.heap_max+1;r<mi;r++)o=e.heap[r],_=t[t[o*2+1]*2+1]+1,_>c&&(_=c,T++),t[o*2+1]=_,!(o>i)&&(e.bl_count[_]++,h=0,o>=s&&(h=f[o-s]),v=t[o*2],e.opt_len+=v*(_+h),a&&(e.static_len+=v*(l[o*2+1]+h)));if(T!==0){do{for(_=c-1;e.bl_count[_]===0;)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[c]--,T-=2}while(T>0);for(_=c;_!==0;_--)for(o=e.bl_count[_];o!==0;)E=e.heap[--r],!(E>i)&&(t[E*2+1]!==_&&(e.opt_len+=(_-t[E*2+1])*t[E*2],t[E*2+1]=_),o--)}},Ii=(e,n,t)=>{const i=new Array(be+1);let l=0,a,f;for(a=1;a<=be;a++)l=l+t[a-1]<<1,i[a]=l;for(f=0;f<=n;f++){let s=e[f*2+1];s!==0&&(e[f*2]=Fi(i[s]++,s))}},Ar=()=>{let e,n,t,i,l;const a=new Array(be+1);for(t=0,i=0;i<tn-1;i++)for(an[i]=t,e=0;e<1<<Xt[i];e++)Ve[t++]=i;for(Ve[t-1]=i,l=0,i=0;i<16;i++)for(dt[i]=l,e=0;e<1<<ct[i];e++)He[l++]=i;for(l>>=7;i<Se;i++)for(dt[i]=l<<7,e=0;e<1<<ct[i]-7;e++)He[256+l++]=i;for(n=0;n<=be;n++)a[n]=0;for(e=0;e<=143;)le[e*2+1]=8,e++,a[8]++;for(;e<=255;)le[e*2+1]=9,e++,a[9]++;for(;e<=279;)le[e*2+1]=7,e++,a[7]++;for(;e<=287;)le[e*2+1]=8,e++,a[8]++;for(Ii(le,je+1,a),e=0;e<Se;e++)Be[e*2+1]=5,Be[e*2]=Fi(e,5);Ti=new xt(le,Xt,We+1,je,be),Ai=new xt(Be,ct,0,Se,be),Si=new xt(new Array(0),vr,0,nn,Er)},Ri=e=>{let n;for(n=0;n<je;n++)e.dyn_ltree[n*2]=0;for(n=0;n<Se;n++)e.dyn_dtree[n*2]=0;for(n=0;n<nn;n++)e.bl_tree[n*2]=0;e.dyn_ltree[rn*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},zi=e=>{e.bi_valid>8?Xe(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},pn=(e,n,t,i)=>{const l=n*2,a=t*2;return e[l]<e[a]||e[l]===e[a]&&i[n]<=i[t]},Et=(e,n,t)=>{const i=e.heap[t];let l=t<<1;for(;l<=e.heap_len&&(l<e.heap_len&&pn(n,e.heap[l+1],e.heap[l],e.depth)&&l++,!pn(n,i,e.heap[l],e.depth));)e.heap[t]=e.heap[l],t=l,l<<=1;e.heap[t]=i},gn=(e,n,t)=>{let i,l,a=0,f,s;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+a++]&255,i+=(e.pending_buf[e.sym_buf+a++]&255)<<8,l=e.pending_buf[e.sym_buf+a++],i===0?ne(e,l,n):(f=Ve[l],ne(e,f+We+1,n),s=Xt[f],s!==0&&(l-=an[f],K(e,l,s)),i--,f=Oi(i),ne(e,f,t),s=ct[f],s!==0&&(i-=dt[f],K(e,i,s)));while(a<e.sym_next);ne(e,rn,n)},qt=(e,n)=>{const t=n.dyn_tree,i=n.stat_desc.static_tree,l=n.stat_desc.has_stree,a=n.stat_desc.elems;let f,s,c=-1,r;for(e.heap_len=0,e.heap_max=mi,f=0;f<a;f++)t[f*2]!==0?(e.heap[++e.heap_len]=c=f,e.depth[f]=0):t[f*2+1]=0;for(;e.heap_len<2;)r=e.heap[++e.heap_len]=c<2?++c:0,t[r*2]=1,e.depth[r]=0,e.opt_len--,l&&(e.static_len-=i[r*2+1]);for(n.max_code=c,f=e.heap_len>>1;f>=1;f--)Et(e,t,f);r=a;do f=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Et(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=f,e.heap[--e.heap_max]=s,t[r*2]=t[f*2]+t[s*2],e.depth[r]=(e.depth[f]>=e.depth[s]?e.depth[f]:e.depth[s])+1,t[f*2+1]=t[s*2+1]=r,e.heap[1]=r++,Et(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Tr(e,n),Ii(t,c,e.bl_count)},bn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)&&(s<r?e.bl_tree[a*2]+=s:a!==0?(a!==l&&e.bl_tree[a*2]++,e.bl_tree[Ei*2]++):s<=10?e.bl_tree[vi*2]++:e.bl_tree[Ni*2]++,s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4))},wn=(e,n,t)=>{let i,l=-1,a,f=n[0*2+1],s=0,c=7,r=4;for(f===0&&(c=138,r=3),i=0;i<=t;i++)if(a=f,f=n[(i+1)*2+1],!(++s<c&&a===f)){if(s<r)do ne(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==l&&(ne(e,a,e.bl_tree),s--),ne(e,Ei,e.bl_tree),K(e,s-3,2)):s<=10?(ne(e,vi,e.bl_tree),K(e,s-3,3)):(ne(e,Ni,e.bl_tree),K(e,s-11,7));s=0,l=a,f===0?(c=138,r=3):a===f?(c=6,r=3):(c=7,r=4)}},Sr=e=>{let n;for(bn(e,e.dyn_ltree,e.l_desc.max_code),bn(e,e.dyn_dtree,e.d_desc.max_code),qt(e,e.bl_desc),n=nn-1;n>=3&&e.bl_tree[ki[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Or=(e,n,t,i)=>{let l;for(K(e,n-257,5),K(e,t-1,5),K(e,i-4,4),l=0;l<i;l++)K(e,e.bl_tree[ki[l]*2+1],3);wn(e,e.dyn_ltree,n-1),wn(e,e.dyn_dtree,t-1)},Fr=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return hn;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return _n;for(t=32;t<We;t++)if(e.dyn_ltree[t*2]!==0)return _n;return hn};let yn=!1;const Ir=e=>{yn||(Ar(),yn=!0),e.l_desc=new mt(e.dyn_ltree,Ti),e.d_desc=new mt(e.dyn_dtree,Ai),e.bl_desc=new mt(e.bl_tree,Si),e.bi_buf=0,e.bi_valid=0,Ri(e)},Ci=(e,n,t,i)=>{K(e,(wr<<1)+(i?1:0),3),zi(e),Xe(e,t),Xe(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Rr=e=>{K(e,xi<<1,3),ne(e,rn,le),kr(e)},zr=(e,n,t,i)=>{let l,a,f=0;e.level>0?(e.strm.data_type===br&&(e.strm.data_type=Fr(e)),qt(e,e.l_desc),qt(e,e.d_desc),f=Sr(e),l=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=l&&(l=a)):l=a=t+5,t+4<=l&&n!==-1?Ci(e,n,t,i):e.strategy===gr||a===l?(K(e,(xi<<1)+(i?1:0),3),gn(e,le,Be)):(K(e,(yr<<1)+(i?1:0),3),Or(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1),gn(e,e.dyn_ltree,e.dyn_dtree)),Ri(e),i&&zi(e)},Cr=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Ve[t]+We+1)*2]++,e.dyn_dtree[Oi(n)*2]++),e.sym_next===e.sym_end);var Lr=Ir,Pr=Ci,$r=zr,Zr=Cr,Br=Rr,Ur={_tr_init:Lr,_tr_stored_block:Pr,_tr_flush_block:$r,_tr_tally:Zr,_tr_align:Br};const Mr=(e,n,t,i)=>{let l=e&65535|0,a=e>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do l=l+n[i++]|0,a=a+l|0;while(--f);l%=65521,a%=65521}return l|a<<16|0};var qe=Mr;const jr=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},Hr=new Uint32Array(jr()),Vr=(e,n,t,i)=>{const l=Hr,a=i+t;e^=-1;for(let f=i;f<a;f++)e=e>>>8^l[(e^n[f])&255];return e^-1};var H=Vr,xe={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Je={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Xr,_tr_stored_block:Gt,_tr_flush_block:qr,_tr_tally:_e,_tr_align:Gr}=Ur,{Z_NO_FLUSH:pe,Z_PARTIAL_FLUSH:Kr,Z_FULL_FLUSH:Yr,Z_FINISH:Q,Z_BLOCK:xn,Z_OK:V,Z_STREAM_END:mn,Z_STREAM_ERROR:ie,Z_DATA_ERROR:Wr,Z_BUF_ERROR:vt,Z_DEFAULT_COMPRESSION:Jr,Z_FILTERED:Qr,Z_HUFFMAN_ONLY:nt,Z_RLE:Dr,Z_FIXED:ea,Z_DEFAULT_STRATEGY:ta,Z_UNKNOWN:na,Z_DEFLATED:_t}=Je,ia=9,ra=15,aa=8,sa=29,oa=256,Kt=oa+1+sa,la=30,fa=19,ca=2*Kt+1,da=15,P=3,he=258,re=he+P+1,ua=32,Oe=42,sn=57,Yt=69,Wt=73,Jt=91,Qt=103,we=113,$e=666,X=1,ze=2,me=3,Ce=4,ha=3,ye=(e,n)=>(e.msg=xe[n],n),En=e=>e*2-(e>4?9:0),ue=e=>{let n=e.length;for(;--n>=0;)e[n]=0},_a=e=>{let n,t,i,l=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=l?t-l:0;while(--n);n=l,i=n;do t=e.prev[--i],e.prev[i]=t>=l?t-l:0;while(--n)};let pa=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask,ge=pa;const W=e=>{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},J=(e,n)=>{qr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,W(e.strm)},B=(e,n)=>{e.pending_buf[e.pending++]=n},Le=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Dt=(e,n,t,i)=>{let l=e.avail_in;return l>i&&(l=i),l===0?0:(e.avail_in-=l,n.set(e.input.subarray(e.next_in,e.next_in+l),t),e.state.wrap===1?e.adler=qe(e.adler,n,l,t):e.state.wrap===2&&(e.adler=H(e.adler,n,l,t)),e.next_in+=l,e.total_in+=l,l)},Li=(e,n)=>{let t=e.max_chain_length,i=e.strstart,l,a,f=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-re?e.strstart-(e.w_size-re):0,r=e.window,o=e.w_mask,E=e.prev,_=e.strstart+he;let h=r[i+f-1],v=r[i+f];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(l=n,!(r[l+f]!==v||r[l+f-1]!==h||r[l]!==r[i]||r[++l]!==r[i+1])){i+=2,l++;do;while(r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&r[++i]===r[++l]&&i<_);if(a=he-(_-i),i=_-he,a>f){if(e.match_start=n,f=a,a>=s)break;h=r[i+f-1],v=r[i+f]}}while((n=E[n&o])>c&&--t!==0);return f<=e.lookahead?f:e.lookahead},Fe=e=>{const n=e.w_size;let t,i,l;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-re)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),_a(e),i+=n),e.strm.avail_in===0)break;if(t=Dt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=P)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=ge(e,e.ins_h,e.window[l+1]);e.insert&&(e.ins_h=ge(e,e.ins_h,e.window[l+P-1]),e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<P)););}while(e.lookahead<re&&e.strm.avail_in!==0)},Pi=(e,n)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,l,a,f=0,s=e.strm.avail_in;do{if(i=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,l=e.strstart-e.block_start,i>l+e.strm.avail_in&&(i=l+e.strm.avail_in),i>a&&(i=a),i<t&&(i===0&&n!==Q||n===pe||i!==l+e.strm.avail_in)))break;f=n===Q&&i===l+e.strm.avail_in?1:0,Gt(e,0,0,f),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,W(e.strm),l&&(l>i&&(l=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+l),e.strm.next_out),e.strm.next_out+=l,e.strm.avail_out-=l,e.strm.total_out+=l,e.block_start+=l,i-=l),i&&(Dt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(f===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),f?Ce:n!==pe&&n!==Q&&e.strm.avail_in===0&&e.strstart===e.block_start?ze:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Dt(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,l=e.strstart-e.block_start,(l>=t||(l||n===Q)&&n!==pe&&e.strm.avail_in===0&&l<=a)&&(i=l>a?a:l,f=n===Q&&e.strm.avail_in===0&&i===l?1:0,Gt(e,e.block_start,i,f),e.block_start+=i,W(e.strm)),f?me:X)},Nt=(e,n)=>{let t,i;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=P&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-re&&(e.match_length=Li(e,t)),e.match_length>=P)if(i=_e(e,e.strstart-e.match_start,e.match_length-P),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=P){e.match_length--;do e.strstart++,e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ge(e,e.ins_h,e.window[e.strstart+1]);else i=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=e.strstart<P-1?e.strstart:P-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},Te=(e,n)=>{let t,i,l;for(;;){if(e.lookahead<re){if(Fe(e),e.lookahead<re&&n===pe)return X;if(e.lookahead===0)break}if(t=0,e.lookahead>=P&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=P-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-re&&(e.match_length=Li(e,t),e.match_length<=5&&(e.strategy===Qr||e.match_length===P&&e.strstart-e.match_start>4096)&&(e.match_length=P-1)),e.prev_length>=P&&e.match_length<=e.prev_length){l=e.strstart+e.lookahead-P,i=_e(e,e.strstart-1-e.prev_match,e.prev_length-P),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=l&&(e.ins_h=ge(e,e.ins_h,e.window[e.strstart+P-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=P-1,e.strstart++,i&&(J(e,!1),e.strm.avail_out===0))return X}else if(e.match_available){if(i=_e(e,0,e.window[e.strstart-1]),i&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return X}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=_e(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<P-1?e.strstart:P-1,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ga=(e,n)=>{let t,i,l,a;const f=e.window;for(;;){if(e.lookahead<=he){if(Fe(e),e.lookahead<=he&&n===pe)return X;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=P&&e.strstart>0&&(l=e.strstart-1,i=f[l],i===f[++l]&&i===f[++l]&&i===f[++l])){a=e.strstart+he;do;while(i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&i===f[++l]&&l<a);e.match_length=he-(a-l),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=P?(t=_e(e,1,e.match_length-P),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze},ba=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(Fe(e),e.lookahead===0)){if(n===pe)return X;break}if(e.match_length=0,t=_e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(J(e,!1),e.strm.avail_out===0))return X}return e.insert=0,n===Q?(J(e,!0),e.strm.avail_out===0?me:Ce):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?X:ze};function te(e,n,t,i,l){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=l}const Ze=[new te(0,0,0,0,Pi),new te(4,4,8,4,Nt),new te(4,5,16,8,Nt),new te(4,6,32,32,Nt),new te(4,4,16,16,Te),new te(8,16,32,32,Te),new te(8,16,128,128,Te),new te(8,32,128,256,Te),new te(32,128,258,1024,Te),new te(32,258,258,4096,Te)],wa=e=>{e.window_size=2*e.w_size,ue(e.head),e.max_lazy_match=Ze[e.level].max_lazy,e.good_match=Ze[e.level].good_length,e.nice_match=Ze[e.level].nice_length,e.max_chain_length=Ze[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=P-1,e.match_available=0,e.ins_h=0};function ya(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ca*2),this.dyn_dtree=new Uint16Array((2*la+1)*2),this.bl_tree=new Uint16Array((2*fa+1)*2),ue(this.dyn_ltree),ue(this.dyn_dtree),ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(da+1),this.heap=new Uint16Array(2*Kt+1),ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Kt+1),ue(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==Oe&&n.status!==sn&&n.status!==Yt&&n.status!==Wt&&n.status!==Jt&&n.status!==Qt&&n.status!==we&&n.status!==$e?1:0},$i=e=>{if(Qe(e))return ye(e,ie);e.total_in=e.total_out=0,e.data_type=na;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?sn:n.wrap?Oe:we,e.adler=n.wrap===2?0:1,n.last_flush=-2,Xr(n),V},Zi=e=>{const n=$i(e);return n===V&&wa(e.state),n},xa=(e,n)=>Qe(e)||e.state.wrap!==2?ie:(e.state.gzhead=n,V),Bi=(e,n,t,i,l,a)=>{if(!e)return ie;let f=1;if(n===Jr&&(n=6),i<0?(f=0,i=-i):i>15&&(f=2,i-=16),l<1||l>ia||t!==_t||i<8||i>15||n<0||n>9||a<0||a>ea||i===8&&f!==1)return ye(e,ie);i===8&&(i=9);const s=new ya;return e.state=s,s.strm=e,s.status=Oe,s.wrap=f,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=l+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+P-1)/P),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<l+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=n,s.strategy=a,s.method=t,Zi(e)},ma=(e,n)=>Bi(e,n,_t,ra,aa,ta),Ea=(e,n)=>{if(Qe(e)||n>xn||n<0)return e?ye(e,ie):ie;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===$e&&n!==Q)return ye(e,e.avail_out===0?vt:ie);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(W(e),e.avail_out===0)return t.last_flush=-1,V}else if(e.avail_in===0&&En(n)<=En(i)&&n!==Q)return ye(e,vt);if(t.status===$e&&e.avail_in!==0)return ye(e,vt);if(t.status===Oe&&t.wrap===0&&(t.status=we),t.status===Oe){let l=_t+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=nt||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,l|=a<<6,t.strstart!==0&&(l|=ua),l+=31-l%31,Le(t,l),t.strstart!==0&&(Le(t,e.adler>>>16),Le(t,e.adler&65535)),e.adler=1,t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===sn){if(e.adler=0,B(t,31),B(t,139),B(t,8),t.gzhead)B(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),B(t,t.gzhead.time&255),B(t,t.gzhead.time>>8&255),B(t,t.gzhead.time>>16&255),B(t,t.gzhead.time>>24&255),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(B(t,t.gzhead.extra.length&255),B(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=H(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Yt;else if(B(t,0),B(t,0),B(t,0),B(t,0),B(t,0),B(t,t.level===9?2:t.strategy>=nt||t.level<2?4:0),B(t,ha),t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(t.status===Yt){if(t.gzhead.extra){let l=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex+=s,W(e),t.pending!==0)return t.last_flush=-1,V;l=0,a-=s}let f=new Uint8Array(t.gzhead.extra);t.pending_buf.set(f.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Wt}if(t.status===Wt){if(t.gzhead.name){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),t.gzindex=0}t.status=Jt}if(t.status===Jt){if(t.gzhead.comment){let l=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l)),W(e),t.pending!==0)return t.last_flush=-1,V;l=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,B(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>l&&(e.adler=H(e.adler,t.pending_buf,t.pending-l,l))}t.status=Qt}if(t.status===Qt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(W(e),t.pending!==0))return t.last_flush=-1,V;B(t,e.adler&255),B(t,e.adler>>8&255),e.adler=0}if(t.status=we,W(e),t.pending!==0)return t.last_flush=-1,V}if(e.avail_in!==0||t.lookahead!==0||n!==pe&&t.status!==$e){let l=t.level===0?Pi(t,n):t.strategy===nt?ba(t,n):t.strategy===Dr?ga(t,n):Ze[t.level].func(t,n);if((l===me||l===Ce)&&(t.status=$e),l===X||l===me)return e.avail_out===0&&(t.last_flush=-1),V;if(l===ze&&(n===Kr?Gr(t):n!==xn&&(Gt(t,0,0,!1),n===Yr&&(ue(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),W(e),e.avail_out===0))return t.last_flush=-1,V}return n!==Q?V:t.wrap<=0?mn:(t.wrap===2?(B(t,e.adler&255),B(t,e.adler>>8&255),B(t,e.adler>>16&255),B(t,e.adler>>24&255),B(t,e.total_in&255),B(t,e.total_in>>8&255),B(t,e.total_in>>16&255),B(t,e.total_in>>24&255)):(Le(t,e.adler>>>16),Le(t,e.adler&65535)),W(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?V:mn)},va=e=>{if(Qe(e))return ie;const n=e.state.status;return e.state=null,n===we?ye(e,Wr):V},Na=(e,n)=>{let t=n.length;if(Qe(e))return ie;const i=e.state,l=i.wrap;if(l===2||l===1&&i.status!==Oe||i.lookahead)return ie;if(l===1&&(e.adler=qe(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){l===0&&(ue(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(n.subarray(t-i.w_size,t),0),n=c,t=i.w_size}const a=e.avail_in,f=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,Fe(i);i.lookahead>=P;){let c=i.strstart,r=i.lookahead-(P-1);do i.ins_h=ge(i,i.ins_h,i.window[c+P-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--r);i.strstart=c,i.lookahead=P-1,Fe(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=P-1,i.match_available=0,e.next_in=f,e.input=s,e.avail_in=a,i.wrap=l,V};var ka=ma,Ta=Bi,Aa=Zi,Sa=$i,Oa=xa,Fa=Ea,Ia=va,Ra=Na,za="pako deflate (from Nodeca project)",Ue={deflateInit:ka,deflateInit2:Ta,deflateReset:Aa,deflateResetKeep:Sa,deflateSetHeader:Oa,deflate:Fa,deflateEnd:Ia,deflateSetDictionary:Ra,deflateInfo:za};const Ca=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var La=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)Ca(t,i)&&(e[i]=t[i])}}return e},Pa=e=>{let n=0;for(let i=0,l=e.length;i<l;i++)n+=e[i].length;const t=new Uint8Array(n);for(let i=0,l=0,a=e.length;i<a;i++){let f=e[i];t.set(f,l),l+=f.length}return t},pt={assign:La,flattenChunks:Pa};let Ui=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ui=!1}const Ge=new Uint8Array(256);for(let e=0;e<256;e++)Ge[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ge[254]=Ge[254]=1;var $a=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,l,a,f=e.length,s=0;for(l=0;l<f;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(s),a=0,l=0;a<s;l++)t=e.charCodeAt(l),(t&64512)===55296&&l+1<f&&(i=e.charCodeAt(l+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),l++)),t<128?n[a++]=t:t<2048?(n[a++]=192|t>>>6,n[a++]=128|t&63):t<65536?(n[a++]=224|t>>>12,n[a++]=128|t>>>6&63,n[a++]=128|t&63):(n[a++]=240|t>>>18,n[a++]=128|t>>>12&63,n[a++]=128|t>>>6&63,n[a++]=128|t&63);return n};const Za=(e,n)=>{if(n<65534&&e.subarray&&Ui)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return t};var Ba=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,l;const a=new Array(t*2);for(l=0,i=0;i<t;){let f=e[i++];if(f<128){a[l++]=f;continue}let s=Ge[f];if(s>4){a[l++]=65533,i+=s-1;continue}for(f&=s===2?31:s===3?15:7;s>1&&i<t;)f=f<<6|e[i++]&63,s--;if(s>1){a[l++]=65533;continue}f<65536?a[l++]=f:(f-=65536,a[l++]=55296|f>>10&1023,a[l++]=56320|f&1023)}return Za(a,l)},Ua=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Ge[e[t]]>n?t:n},Ke={string2buf:$a,buf2string:Ba,utf8border:Ua};function Ma(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Mi=Ma;const ji=Object.prototype.toString,{Z_NO_FLUSH:ja,Z_SYNC_FLUSH:Ha,Z_FULL_FLUSH:Va,Z_FINISH:Xa,Z_OK:ut,Z_STREAM_END:qa,Z_DEFAULT_COMPRESSION:Ga,Z_DEFAULT_STRATEGY:Ka,Z_DEFLATED:Ya}=Je;function De(e){this.options=pt.assign({level:Ga,method:Ya,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ka},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=Ue.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==ut)throw new Error(xe[t]);if(n.header&&Ue.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Ke.string2buf(n.dictionary):ji.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=Ue.deflateSetDictionary(this.strm,i),t!==ut)throw new Error(xe[t]);this._dict_set=!0}}De.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let l,a;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?Xa:ja,typeof e=="string"?t.input=Ke.string2buf(e):ji.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===Ha||a===Va)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(l=Ue.deflate(t,a),l===qa)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),l=Ue.deflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===ut;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};De.prototype.onData=function(e){this.chunks.push(e)};De.prototype.onEnd=function(e){e===ut&&(this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function on(e,n){const t=new De(n);if(t.push(e,!0),t.err)throw t.msg||xe[t.err];return t.result}function Wa(e,n){return n=n||{},n.raw=!0,on(e,n)}function Ja(e,n){return n=n||{},n.gzip=!0,on(e,n)}var Qa=De,Da=on,es=Wa,ts=Ja,ns={Deflate:Qa,deflate:Da,deflateRaw:es,gzip:ts};const it=16209,is=16191;var rs=function(n,t){let i,l,a,f,s,c,r,o,E,_,h,v,T,I,d,g,N,k,u,p,b,A,y,m;const O=n.state;i=n.next_in,y=n.input,l=i+(n.avail_in-5),a=n.next_out,m=n.output,f=a-(t-n.avail_out),s=a+(n.avail_out-257),c=O.dmax,r=O.wsize,o=O.whave,E=O.wnext,_=O.window,h=O.hold,v=O.bits,T=O.lencode,I=O.distcode,d=(1<<O.lenbits)-1,g=(1<<O.distbits)-1;e:do{v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=T[h&d];t:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k===0)m[a++]=N&65535;else if(k&16){u=N&65535,k&=15,k&&(v<k&&(h+=y[i++]<<v,v+=8),u+=h&(1<<k)-1,h>>>=k,v-=k),v<15&&(h+=y[i++]<<v,v+=8,h+=y[i++]<<v,v+=8),N=I[h&g];n:for(;;){if(k=N>>>24,h>>>=k,v-=k,k=N>>>16&255,k&16){if(p=N&65535,k&=15,v<k&&(h+=y[i++]<<v,v+=8,v<k&&(h+=y[i++]<<v,v+=8)),p+=h&(1<<k)-1,p>c){n.msg="invalid distance too far back",O.mode=it;break e}if(h>>>=k,v-=k,k=a-f,p>k){if(k=p-k,k>o&&O.sane){n.msg="invalid distance too far back",O.mode=it;break e}if(b=0,A=_,E===0){if(b+=r-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}else if(E<k){if(b+=r+E-k,k-=E,k<u){u-=k;do m[a++]=_[b++];while(--k);if(b=0,E<u){k=E,u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}}}else if(b+=E-k,k<u){u-=k;do m[a++]=_[b++];while(--k);b=a-p,A=m}for(;u>2;)m[a++]=A[b++],m[a++]=A[b++],m[a++]=A[b++],u-=3;u&&(m[a++]=A[b++],u>1&&(m[a++]=A[b++]))}else{b=a-p;do m[a++]=m[b++],m[a++]=m[b++],m[a++]=m[b++],u-=3;while(u>2);u&&(m[a++]=m[b++],u>1&&(m[a++]=m[b++]))}}else if((k&64)===0){N=I[(N&65535)+(h&(1<<k)-1)];continue n}else{n.msg="invalid distance code",O.mode=it;break e}break}}else if((k&64)===0){N=T[(N&65535)+(h&(1<<k)-1)];continue t}else if(k&32){O.mode=is;break e}else{n.msg="invalid literal/length code",O.mode=it;break e}break}}while(i<l&&a<s);u=v>>3,i-=u,v-=u<<3,h&=(1<<v)-1,n.next_in=i,n.next_out=a,n.avail_in=i<l?5+(l-i):5-(i-l),n.avail_out=a<s?257+(s-a):257-(a-s),O.hold=h,O.bits=v};const Ae=15,vn=852,Nn=592,kn=0,kt=1,Tn=2,as=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ss=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),os=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ls=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),fs=(e,n,t,i,l,a,f,s)=>{const c=s.bits;let r=0,o=0,E=0,_=0,h=0,v=0,T=0,I=0,d=0,g=0,N,k,u,p,b,A=null,y;const m=new Uint16Array(Ae+1),O=new Uint16Array(Ae+1);let w=null,x,S,F;for(r=0;r<=Ae;r++)m[r]=0;for(o=0;o<i;o++)m[n[t+o]]++;for(h=c,_=Ae;_>=1&&m[_]===0;_--);if(h>_&&(h=_),_===0)return l[a++]=1<<24|64<<16|0,l[a++]=1<<24|64<<16|0,s.bits=1,0;for(E=1;E<_&&m[E]===0;E++);for(h<E&&(h=E),I=1,r=1;r<=Ae;r++)if(I<<=1,I-=m[r],I<0)return-1;if(I>0&&(e===kn||_!==1))return-1;for(O[1]=0,r=1;r<Ae;r++)O[r+1]=O[r]+m[r];for(o=0;o<i;o++)n[t+o]!==0&&(f[O[n[t+o]]++]=o);if(e===kn?(A=w=f,y=20):e===kt?(A=as,w=ss,y=257):(A=os,w=ls,y=0),g=0,o=0,r=E,b=a,v=h,T=0,u=-1,d=1<<h,p=d-1,e===kt&&d>vn||e===Tn&&d>Nn)return 1;for(;;){x=r-T,f[o]+1<y?(S=0,F=f[o]):f[o]>=y?(S=w[f[o]-y],F=A[f[o]-y]):(S=96,F=0),N=1<<r-T,k=1<<v,E=k;do k-=N,l[b+(g>>T)+k]=x<<24|S<<16|F|0;while(k!==0);for(N=1<<r-1;g&N;)N>>=1;if(N!==0?(g&=N-1,g+=N):g=0,o++,--m[r]===0){if(r===_)break;r=n[t+f[o]]}if(r>h&&(g&p)!==u){for(T===0&&(T=h),b+=E,v=r-T,I=1<<v;v+T<_&&(I-=m[v+T],!(I<=0));)v++,I<<=1;if(d+=1<<v,e===kt&&d>vn||e===Tn&&d>Nn)return 1;u=g&p,l[u]=h<<24|v<<16|b-a|0}}return g!==0&&(l[b+g]=r-T<<24|64<<16|0),s.bits=h,0};var Me=fs;const cs=0,Hi=1,Vi=2,{Z_FINISH:An,Z_BLOCK:ds,Z_TREES:rt,Z_OK:Ee,Z_STREAM_END:us,Z_NEED_DICT:hs,Z_STREAM_ERROR:D,Z_DATA_ERROR:Xi,Z_MEM_ERROR:qi,Z_BUF_ERROR:_s,Z_DEFLATED:Sn}=Je,gt=16180,On=16181,Fn=16182,In=16183,Rn=16184,zn=16185,Cn=16186,Ln=16187,Pn=16188,$n=16189,ht=16190,oe=16191,Tt=16192,Zn=16193,At=16194,Bn=16195,Un=16196,Mn=16197,jn=16198,at=16199,st=16200,Hn=16201,Vn=16202,Xn=16203,qn=16204,Gn=16205,St=16206,Kn=16207,Yn=16208,j=16209,Gi=16210,Ki=16211,ps=852,gs=592,bs=15,ws=bs,Wn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ys(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ve=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode<gt||n.mode>Ki?1:0},Yi=e=>{if(ve(e))return D;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=gt,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(ps),n.distcode=n.distdyn=new Int32Array(gs),n.sane=1,n.back=-1,Ee},Wi=e=>{if(ve(e))return D;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,Yi(e)},Ji=(e,n)=>{let t;if(ve(e))return D;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?D:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,Wi(e))},Qi=(e,n)=>{if(!e)return D;const t=new ys;e.state=t,t.strm=e,t.window=null,t.mode=gt;const i=Ji(e,n);return i!==Ee&&(e.state=null),i},xs=e=>Qi(e,ws);let Jn=!0,Ot,Ft;const ms=e=>{if(Jn){Ot=new Int32Array(512),Ft=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Me(Hi,e.lens,0,288,Ot,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Me(Vi,e.lens,0,32,Ft,0,e.work,{bits:5}),Jn=!1}e.lencode=Ot,e.lenbits=9,e.distcode=Ft,e.distbits=5},Di=(e,n,t,i)=>{let l;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(n.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(l=a.wsize-a.wnext,l>i&&(l=i),a.window.set(n.subarray(t-i,t-i+l),a.wnext),i-=l,i?(a.window.set(n.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=l,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=l))),0},Es=(e,n)=>{let t,i,l,a,f,s,c,r,o,E,_,h,v,T,I=0,d,g,N,k,u,p,b,A;const y=new Uint8Array(4);let m,O;const w=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ve(e)||!e.output||!e.input&&e.avail_in!==0)return D;t=e.state,t.mode===oe&&(t.mode=Tt),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,E=s,_=c,A=Ee;e:for(;;)switch(t.mode){case gt:if(t.wrap===0){t.mode=Tt;break}for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&2&&r===35615){t.wbits===0&&(t.wbits=15),t.check=0,y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0),r=0,o=0,t.mode=On;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((r&255)<<8)+(r>>8))%31){e.msg="incorrect header check",t.mode=j;break}if((r&15)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(r>>>=4,o-=4,b=(r&15)+8,t.wbits===0&&(t.wbits=b),b>15||b>t.wbits){e.msg="invalid window size",t.mode=j;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=r&512?$n:oe,r=0,o=0;break;case On:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.flags=r,(t.flags&255)!==Sn){e.msg="unknown compression method",t.mode=j;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=j;break}t.head&&(t.head.text=r>>8&1),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Fn;case Fn:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.time=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,y[2]=r>>>16&255,y[3]=r>>>24&255,t.check=H(t.check,y,4,0)),r=0,o=0,t.mode=In;case In:for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.head&&(t.head.xflags=r&255,t.head.os=r>>8),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0,t.mode=Rn;case Rn:if(t.flags&1024){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length=r,t.head&&(t.head.extra_len=r),t.flags&512&&t.wrap&4&&(y[0]=r&255,y[1]=r>>>8&255,t.check=H(t.check,y,2,0)),r=0,o=0}else t.head&&(t.head.extra=null);t.mode=zn;case zn:if(t.flags&1024&&(h=t.length,h>s&&(h=s),h&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+h),b)),t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,t.length-=h),t.length))break e;t.length=0,t.mode=Cn;case Cn:if(t.flags&2048){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Ln;case Ln:if(t.flags&4096){if(s===0)break e;h=0;do b=i[a+h++],t.head&&b&&t.length<65536&&(t.head.comment+=String.fromCharCode(b));while(b&&h<s);if(t.flags&512&&t.wrap&4&&(t.check=H(t.check,i,h,a)),s-=h,a+=h,b)break e}else t.head&&(t.head.comment=null);t.mode=Pn;case Pn:if(t.flags&512){for(;o<16;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.check&65535)){e.msg="header crc mismatch",t.mode=j;break}r=0,o=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=oe;break;case $n:for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}e.adler=t.check=Wn(r),r=0,o=0,t.mode=ht;case ht:if(t.havedict===0)return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,hs;e.adler=t.check=1,t.mode=oe;case oe:if(n===ds||n===rt)break e;case Tt:if(t.last){r>>>=o&7,o-=o&7,t.mode=St;break}for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}switch(t.last=r&1,r>>>=1,o-=1,r&3){case 0:t.mode=Zn;break;case 1:if(ms(t),t.mode=at,n===rt){r>>>=2,o-=2;break e}break;case 2:t.mode=Un;break;case 3:e.msg="invalid block type",t.mode=j}r>>>=2,o-=2;break;case Zn:for(r>>>=o&7,o-=o&7;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((r&65535)!==(r>>>16^65535)){e.msg="invalid stored block lengths",t.mode=j;break}if(t.length=r&65535,r=0,o=0,t.mode=At,n===rt)break e;case At:t.mode=Bn;case Bn:if(h=t.length,h){if(h>s&&(h=s),h>c&&(h=c),h===0)break e;l.set(i.subarray(a,a+h),f),s-=h,a+=h,c-=h,f+=h,t.length-=h;break}t.mode=oe;break;case Un:for(;o<14;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.nlen=(r&31)+257,r>>>=5,o-=5,t.ndist=(r&31)+1,r>>>=5,o-=5,t.ncode=(r&15)+4,r>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=j;break}t.have=0,t.mode=Mn;case Mn:for(;t.have<t.ncode;){for(;o<3;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.lens[w[t.have++]]=r&7,r>>>=3,o-=3}for(;t.have<19;)t.lens[w[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,m={bits:t.lenbits},A=Me(cs,t.lens,0,19,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid code lengths set",t.mode=j;break}t.have=0,t.mode=jn;case jn:for(;t.have<t.nlen+t.ndist;){for(;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(N<16)r>>>=d,o-=d,t.lens[t.have++]=N;else{if(N===16){for(O=d+2;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(r>>>=d,o-=d,t.have===0){e.msg="invalid bit length repeat",t.mode=j;break}b=t.lens[t.have-1],h=3+(r&3),r>>>=2,o-=2}else if(N===17){for(O=d+3;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=3+(r&7),r>>>=3,o-=3}else{for(O=d+7;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=d,o-=d,b=0,h=11+(r&127),r>>>=7,o-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=j;break}for(;h--;)t.lens[t.have++]=b}}if(t.mode===j)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=j;break}if(t.lenbits=9,m={bits:t.lenbits},A=Me(Hi,t.lens,0,t.nlen,t.lencode,0,t.work,m),t.lenbits=m.bits,A){e.msg="invalid literal/lengths set",t.mode=j;break}if(t.distbits=6,t.distcode=t.distdyn,m={bits:t.distbits},A=Me(Vi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,m),t.distbits=m.bits,A){e.msg="invalid distances set",t.mode=j;break}if(t.mode=at,n===rt)break e;case at:t.mode=st;case st:if(s>=6&&c>=258){e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,rs(e,_),f=e.next_out,l=e.output,c=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,o=t.bits,t.mode===oe&&(t.back=-1);break}for(t.back=0;I=t.lencode[r&(1<<t.lenbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(g&&(g&240)===0){for(k=d,u=g,p=N;I=t.lencode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,t.length=N,g===0){t.mode=Gn;break}if(g&32){t.back=-1,t.mode=oe;break}if(g&64){e.msg="invalid literal/length code",t.mode=j;break}t.extra=g&15,t.mode=Hn;case Hn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.length+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Vn;case Vn:for(;I=t.distcode[r&(1<<t.distbits)-1],d=I>>>24,g=I>>>16&255,N=I&65535,!(d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if((g&240)===0){for(k=d,u=g,p=N;I=t.distcode[p+((r&(1<<k+u)-1)>>k)],d=I>>>24,g=I>>>16&255,N=I&65535,!(k+d<=o);){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}r>>>=k,o-=k,t.back+=k}if(r>>>=d,o-=d,t.back+=d,g&64){e.msg="invalid distance code",t.mode=j;break}t.offset=N,t.extra=g&15,t.mode=Xn;case Xn:if(t.extra){for(O=t.extra;o<O;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}t.offset+=r&(1<<t.extra)-1,r>>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=j;break}t.mode=qn;case qn:if(c===0)break e;if(h=_-c,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=j;break}h>t.wnext?(h-=t.wnext,v=t.wsize-h):v=t.wnext-h,h>t.length&&(h=t.length),T=t.window}else T=l,v=f-t.offset,h=t.length;h>c&&(h=c),c-=h,t.length-=h;do l[f++]=T[v++];while(--h);t.length===0&&(t.mode=st);break;case Gn:if(c===0)break e;l[f++]=t.length,c--,t.mode=st;break;case St:if(t.wrap){for(;o<32;){if(s===0)break e;s--,r|=i[a++]<<o,o+=8}if(_-=c,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,f-_):qe(t.check,l,_,f-_)),_=c,t.wrap&4&&(t.flags?r:Wn(r))!==t.check){e.msg="incorrect data check",t.mode=j;break}r=0,o=0}t.mode=Kn;case Kn:if(t.wrap&&t.flags){for(;o<32;){if(s===0)break e;s--,r+=i[a++]<<o,o+=8}if(t.wrap&4&&r!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=j;break}r=0,o=0}t.mode=Yn;case Yn:A=us;break e;case j:A=Xi;break e;case Gi:return qi;case Ki:default:return D}return e.next_out=f,e.avail_out=c,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=o,(t.wsize||_!==e.avail_out&&t.mode<j&&(t.mode<St||n!==An))&&Di(e,e.output,e.next_out,_-e.avail_out),E-=e.avail_in,_-=e.avail_out,e.total_in+=E,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?H(t.check,l,_,e.next_out-_):qe(t.check,l,_,e.next_out-_)),e.data_type=t.bits+(t.last?64:0)+(t.mode===oe?128:0)+(t.mode===at||t.mode===At?256:0),(E===0&&_===0||n===An)&&A===Ee&&(A=_s),A},vs=e=>{if(ve(e))return D;let n=e.state;return n.window&&(n.window=null),e.state=null,Ee},Ns=(e,n)=>{if(ve(e))return D;const t=e.state;return(t.wrap&2)===0?D:(t.head=n,n.done=!1,Ee)},ks=(e,n)=>{const t=n.length;let i,l,a;return ve(e)||(i=e.state,i.wrap!==0&&i.mode!==ht)?D:i.mode===ht&&(l=1,l=qe(l,n,t,0),l!==i.check)?Xi:(a=Di(e,n,t,t),a?(i.mode=Gi,qi):(i.havedict=1,Ee))};var Ts=Wi,As=Ji,Ss=Yi,Os=xs,Fs=Qi,Is=Es,Rs=vs,zs=Ns,Cs=ks,Ls="pako inflate (from Nodeca project)",fe={inflateReset:Ts,inflateReset2:As,inflateResetKeep:Ss,inflateInit:Os,inflateInit2:Fs,inflate:Is,inflateEnd:Rs,inflateGetHeader:zs,inflateSetDictionary:Cs,inflateInfo:Ls};function Ps(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $s=Ps;const er=Object.prototype.toString,{Z_NO_FLUSH:Zs,Z_FINISH:Bs,Z_OK:Ye,Z_STREAM_END:It,Z_NEED_DICT:Rt,Z_STREAM_ERROR:Us,Z_DATA_ERROR:Qn,Z_MEM_ERROR:Ms}=Je;function et(e){this.options=pt.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mi,this.strm.avail_out=0;let t=fe.inflateInit2(this.strm,n.windowBits);if(t!==Ye)throw new Error(xe[t]);if(this.header=new $s,fe.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ke.string2buf(n.dictionary):er.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=fe.inflateSetDictionary(this.strm,n.dictionary),t!==Ye)))throw new Error(xe[t])}et.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,l=this.options.dictionary;let a,f,s;if(this.ended)return!1;for(n===~~n?f=n:f=n===!0?Bs:Zs,er.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=fe.inflate(t,f),a===Rt&&l&&(a=fe.inflateSetDictionary(t,l),a===Ye?a=fe.inflate(t,f):a===Qn&&(a=Rt));t.avail_in>0&&a===It&&t.state.wrap>0&&e[t.next_in]!==0;)fe.inflateReset(t),a=fe.inflate(t,f);switch(a){case Us:case Qn:case Rt:case Ms:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===It))if(this.options.to==="string"){let c=Ke.utf8border(t.output,t.next_out),r=t.next_out-c,o=Ke.buf2string(t.output,c);t.next_out=r,t.avail_out=i-r,r&&t.output.set(t.output.subarray(c,c+r),0),this.onData(o)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ye&&s===0)){if(a===It)return a=fe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};et.prototype.onData=function(e){this.chunks.push(e)};et.prototype.onEnd=function(e){e===Ye&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=pt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ln(e,n){const t=new et(n);if(t.push(e),t.err)throw t.msg||xe[t.err];return t.result}function js(e,n){return n=n||{},n.raw=!0,ln(e,n)}var Hs=et,Vs=ln,Xs=js,qs=ln,Gs={Inflate:Hs,inflate:Vs,inflateRaw:Xs,ungzip:qs};const{Deflate:Ks,deflate:Ys,deflateRaw:Ws,gzip:Js}=ns,{Inflate:Qs,inflate:Ds,inflateRaw:eo,ungzip:to}=Gs;var no=Ks,io=Ys,ro=Ws,ao=Js,so=Qs,oo=Ds,lo=eo,fo=to,co=Je,uo={Deflate:no,deflate:io,deflateRaw:ro,gzip:ao,Inflate:so,inflate:oo,inflateRaw:lo,ungzip:fo,constants:co},ot={exports:{}},zt={},Ct={},Dn;function fn(){return Dn||(Dn=1,function(e){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",i="["+n+"]["+t+"]*",l=new RegExp("^"+i+"$"),a=function(s,c){const r=[];let o=c.exec(s);for(;o;){const E=[];E.startIndex=c.lastIndex-o[0].length;const _=o.length;for(let h=0;h<_;h++)E.push(o[h]);r.push(E),o=c.exec(s)}return r},f=function(s){const c=l.exec(s);return!(c===null||typeof c>"u")};e.isExist=function(s){return typeof s<"u"},e.isEmptyObject=function(s){return Object.keys(s).length===0},e.merge=function(s,c,r){if(c){const o=Object.keys(c),E=o.length;for(let _=0;_<E;_++)r==="strict"?s[o[_]]=[c[o[_]]]:s[o[_]]=c[o[_]]}},e.getValue=function(s){return e.isExist(s)?s:""},e.isName=f,e.getAllMatches=a,e.nameRegexp=i}(Ct)),Ct}var ei;function tr(){if(ei)return zt;ei=1;const e=fn(),n={allowBooleanAttributes:!1,unpairedTags:[]};zt.validate=function(d,g){g=Object.assign({},n,g);const N=[];let k=!1,u=!1;d[0]==="\uFEFF"&&(d=d.substr(1));for(let p=0;p<d.length;p++)if(d[p]==="<"&&d[p+1]==="?"){if(p+=2,p=i(d,p),p.err)return p}else if(d[p]==="<"){let b=p;if(p++,d[p]==="!"){p=l(d,p);continue}else{let A=!1;d[p]==="/"&&(A=!0,p++);let y="";for(;p<d.length&&d[p]!==">"&&d[p]!==" "&&d[p]!==" "&&d[p]!==`
2
2
  `&&d[p]!=="\r";p++)y+=d[p];if(y=y.trim(),y[y.length-1]==="/"&&(y=y.substring(0,y.length-1),p--),!v(y)){let w;return y.trim().length===0?w="Invalid space after '<'.":w="Tag '"+y+"' is an invalid name.",_("InvalidTag",w,T(d,p))}const m=s(d,p);if(m===!1)return _("InvalidAttr","Attributes for '"+y+"' have open quote.",T(d,p));let O=m.value;if(p=m.index,O[O.length-1]==="/"){const w=p-O.length;O=O.substring(0,O.length-1);const x=r(O,g);if(x===!0)k=!0;else return _(x.err.code,x.err.msg,T(d,w+x.err.line))}else if(A)if(m.tagClosed){if(O.trim().length>0)return _("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",T(d,b));if(N.length===0)return _("InvalidTag","Closing tag '"+y+"' has not been opened.",T(d,b));{const w=N.pop();if(y!==w.tagName){let x=T(d,w.tagStartPos);return _("InvalidTag","Expected closing tag '"+w.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+y+"'.",T(d,b))}N.length==0&&(u=!0)}}else return _("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",T(d,p));else{const w=r(O,g);if(w!==!0)return _(w.err.code,w.err.msg,T(d,p-O.length+w.err.line));if(u===!0)return _("InvalidXml","Multiple possible root nodes found.",T(d,p));g.unpairedTags.indexOf(y)!==-1||N.push({tagName:y,tagStartPos:b}),k=!0}for(p++;p<d.length;p++)if(d[p]==="<")if(d[p+1]==="!"){p++,p=l(d,p);continue}else if(d[p+1]==="?"){if(p=i(d,++p),p.err)return p}else break;else if(d[p]==="&"){const w=E(d,p);if(w==-1)return _("InvalidChar","char '&' is not expected.",T(d,p));p=w}else if(u===!0&&!t(d[p]))return _("InvalidXml","Extra text at the end",T(d,p));d[p]==="<"&&p--}}else{if(t(d[p]))continue;return _("InvalidChar","char '"+d[p]+"' is not expected.",T(d,p))}if(k){if(N.length==1)return _("InvalidTag","Unclosed tag '"+N[0].tagName+"'.",T(d,N[0].tagStartPos));if(N.length>0)return _("InvalidXml","Invalid '"+JSON.stringify(N.map(p=>p.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return _("InvalidXml","Start tag expected.",1);return!0};function t(d){return d===" "||d===" "||d===`
3
3
  `||d==="\r"}function i(d,g){const N=g;for(;g<d.length;g++)if(d[g]=="?"||d[g]==" "){const k=d.substr(N,g-N);if(g>5&&k==="xml")return _("InvalidXml","XML declaration allowed only at the start of the document.",T(d,g));if(d[g]=="?"&&d[g+1]==">"){g++;break}else continue}return g}function l(d,g){if(d.length>g+5&&d[g+1]==="-"&&d[g+2]==="-"){for(g+=3;g<d.length;g++)if(d[g]==="-"&&d[g+1]==="-"&&d[g+2]===">"){g+=2;break}}else if(d.length>g+8&&d[g+1]==="D"&&d[g+2]==="O"&&d[g+3]==="C"&&d[g+4]==="T"&&d[g+5]==="Y"&&d[g+6]==="P"&&d[g+7]==="E"){let N=1;for(g+=8;g<d.length;g++)if(d[g]==="<")N++;else if(d[g]===">"&&(N--,N===0))break}else if(d.length>g+9&&d[g+1]==="["&&d[g+2]==="C"&&d[g+3]==="D"&&d[g+4]==="A"&&d[g+5]==="T"&&d[g+6]==="A"&&d[g+7]==="["){for(g+=8;g<d.length;g++)if(d[g]==="]"&&d[g+1]==="]"&&d[g+2]===">"){g+=2;break}}return g}const a='"',f="'";function s(d,g){let N="",k="",u=!1;for(;g<d.length;g++){if(d[g]===a||d[g]===f)k===""?k=d[g]:k!==d[g]||(k="");else if(d[g]===">"&&k===""){u=!0;break}N+=d[g]}return k!==""?!1:{value:N,index:g,tagClosed:u}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function r(d,g){const N=e.getAllMatches(d,c),k={};for(let u=0;u<N.length;u++){if(N[u][1].length===0)return _("InvalidAttr","Attribute '"+N[u][2]+"' has no space in starting.",I(N[u]));if(N[u][3]!==void 0&&N[u][4]===void 0)return _("InvalidAttr","Attribute '"+N[u][2]+"' is without value.",I(N[u]));if(N[u][3]===void 0&&!g.allowBooleanAttributes)return _("InvalidAttr","boolean attribute '"+N[u][2]+"' is not allowed.",I(N[u]));const p=N[u][2];if(!h(p))return _("InvalidAttr","Attribute '"+p+"' is an invalid name.",I(N[u]));if(!k.hasOwnProperty(p))k[p]=1;else return _("InvalidAttr","Attribute '"+p+"' is repeated.",I(N[u]))}return!0}function o(d,g){let N=/\d/;for(d[g]==="x"&&(g++,N=/[\da-fA-F]/);g<d.length;g++){if(d[g]===";")return g;if(!d[g].match(N))break}return-1}function E(d,g){if(g++,d[g]===";")return-1;if(d[g]==="#")return g++,o(d,g);let N=0;for(;g<d.length;g++,N++)if(!(d[g].match(/\w/)&&N<20)){if(d[g]===";")break;return-1}return g}function _(d,g,N){return{err:{code:d,msg:g,line:N.line||N,col:N.col}}}function h(d){return e.isName(d)}function v(d){return e.isName(d)}function T(d,g){const N=d.substring(0,g).split(/\r?\n/);return{line:N.length,col:N[N.length-1].length+1}}function I(d){return d.startIndex+d[1].length}return zt}var lt={},ti;function ho(){if(ti)return lt;ti=1;const e={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,i){return i},attributeValueProcessor:function(t,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,i,l){return t}},n=function(t){return Object.assign({},e,t)};return lt.buildOptions=n,lt.defaultOptions=e,lt}var Lt,ni;function _o(){if(ni)return Lt;ni=1;class e{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}return Lt=e,Lt}var Pt,ii;function po(){if(ii)return Pt;ii=1;const e=fn();function n(r,o){const E={};if(r[o+3]==="O"&&r[o+4]==="C"&&r[o+5]==="T"&&r[o+6]==="Y"&&r[o+7]==="P"&&r[o+8]==="E"){o=o+9;let _=1,h=!1,v=!1,T="";for(;o<r.length;o++)if(r[o]==="<"&&!v){if(h&&l(r,o))o+=7,[entityName,val,o]=t(r,o+1),val.indexOf("&")===-1&&(E[c(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(h&&a(r,o))o+=8;else if(h&&f(r,o))o+=8;else if(h&&s(r,o))o+=9;else if(i)v=!0;else throw new Error("Invalid DOCTYPE");_++,T=""}else if(r[o]===">"){if(v?r[o-1]==="-"&&r[o-2]==="-"&&(v=!1,_--):_--,_===0)break}else r[o]==="["?h=!0:T+=r[o];if(_!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:E,i:o}}function t(r,o){let E="";for(;o<r.length&&r[o]!=="'"&&r[o]!=='"';o++)E+=r[o];if(E=E.trim(),E.indexOf(" ")!==-1)throw new Error("External entites are not supported");const _=r[o++];let h="";for(;o<r.length&&r[o]!==_;o++)h+=r[o];return[E,h,o]}function i(r,o){return r[o+1]==="!"&&r[o+2]==="-"&&r[o+3]==="-"}function l(r,o){return r[o+1]==="!"&&r[o+2]==="E"&&r[o+3]==="N"&&r[o+4]==="T"&&r[o+5]==="I"&&r[o+6]==="T"&&r[o+7]==="Y"}function a(r,o){return r[o+1]==="!"&&r[o+2]==="E"&&r[o+3]==="L"&&r[o+4]==="E"&&r[o+5]==="M"&&r[o+6]==="E"&&r[o+7]==="N"&&r[o+8]==="T"}function f(r,o){return r[o+1]==="!"&&r[o+2]==="A"&&r[o+3]==="T"&&r[o+4]==="T"&&r[o+5]==="L"&&r[o+6]==="I"&&r[o+7]==="S"&&r[o+8]==="T"}function s(r,o){return r[o+1]==="!"&&r[o+2]==="N"&&r[o+3]==="O"&&r[o+4]==="T"&&r[o+5]==="A"&&r[o+6]==="T"&&r[o+7]==="I"&&r[o+8]==="O"&&r[o+9]==="N"}function c(r){if(e.isName(r))return r;throw new Error(`Invalid entity name ${r}`)}return Pt=n,Pt}var $t,ri;function go(){if(ri)return $t;ri=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const t={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function i(a,f={}){if(f=Object.assign({},t,f),!a||typeof a!="string")return a;let s=a.trim();if(f.skipLike!==void 0&&f.skipLike.test(s))return a;if(f.hex&&e.test(s))return Number.parseInt(s,16);{const c=n.exec(s);if(c){const r=c[1],o=c[2];let E=l(c[3]);const _=c[4]||c[6];if(!f.leadingZeros&&o.length>0&&r&&s[2]!==".")return a;if(!f.leadingZeros&&o.length>0&&!r&&s[1]!==".")return a;{const h=Number(s),v=""+h;return v.search(/[eE]/)!==-1||_?f.eNotation?h:a:s.indexOf(".")!==-1?v==="0"&&E===""||v===E||r&&v==="-"+E?h:a:o?E===v||r+E===v?h:a:s===v||s===r+v?h:a}}else return a}}function l(a){return a&&a.indexOf(".")!==-1&&(a=a.replace(/0+$/,""),a==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a}return $t=i,$t}var Zt,ai;function nr(){if(ai)return Zt;ai=1;function e(n){return typeof n=="function"?n:Array.isArray(n)?t=>{for(const i of n)if(typeof i=="string"&&t===i||i instanceof RegExp&&i.test(t))return!0}:()=>!1}return Zt=e,Zt}var Bt,si;function bo(){if(si)return Bt;si=1;const e=fn(),n=_o(),t=po(),i=go(),l=nr();class a{constructor(p){this.options=p,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(b,A)=>String.fromCharCode(Number.parseInt(A,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(b,A)=>String.fromCharCode(Number.parseInt(A,16))}},this.addExternalEntities=f,this.parseXml=E,this.parseTextData=s,this.resolveNameSpace=c,this.buildAttributesMap=o,this.isItStopNode=T,this.replaceEntitiesValue=h,this.readStopNodeData=N,this.saveTextToParentTag=v,this.addChild=_,this.ignoreAttributesFn=l(this.options.ignoreAttributes)}}function f(u){const p=Object.keys(u);for(let b=0;b<p.length;b++){const A=p[b];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:u[A]}}}function s(u,p,b,A,y,m,O){if(u!==void 0&&(this.options.trimValues&&!A&&(u=u.trim()),u.length>0)){O||(u=this.replaceEntitiesValue(u));const w=this.options.tagValueProcessor(p,u,b,y,m);return w==null?u:typeof w!=typeof u||w!==u?w:this.options.trimValues?k(u,this.options.parseTagValue,this.options.numberParseOptions):u.trim()===u?k(u,this.options.parseTagValue,this.options.numberParseOptions):u}}function c(u){if(this.options.removeNSPrefix){const p=u.split(":"),b=u.charAt(0)==="/"?"/":"";if(p[0]==="xmlns")return"";p.length===2&&(u=b+p[1])}return u}const r=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function o(u,p,b){if(this.options.ignoreAttributes!==!0&&typeof u=="string"){const A=e.getAllMatches(u,r),y=A.length,m={};for(let O=0;O<y;O++){const w=this.resolveNameSpace(A[O][1]);if(this.ignoreAttributesFn(w,p))continue;let x=A[O][4],S=this.options.attributeNamePrefix+w;if(w.length)if(this.options.transformAttributeName&&(S=this.options.transformAttributeName(S)),S==="__proto__"&&(S="#__proto__"),x!==void 0){this.options.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x);const F=this.options.attributeValueProcessor(w,x,p);F==null?m[S]=x:typeof F!=typeof x||F!==x?m[S]=F:m[S]=k(x,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(m[S]=!0)}if(!Object.keys(m).length)return;if(this.options.attributesGroupName){const O={};return O[this.options.attributesGroupName]=m,O}return m}}const E=function(u){u=u.replace(/\r\n?/g,`
4
4
  `);const p=new n("!xml");let b=p,A="",y="";for(let m=0;m<u.length;m++)if(u[m]==="<")if(u[m+1]==="/"){const w=d(u,">",m,"Closing Tag is not closed.");let x=u.substring(m+2,w).trim();if(this.options.removeNSPrefix){const R=x.indexOf(":");R!==-1&&(x=x.substr(R+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),b&&(A=this.saveTextToParentTag(A,b,y));const S=y.substring(y.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let F=0;S&&this.options.unpairedTags.indexOf(S)!==-1?(F=y.lastIndexOf(".",y.lastIndexOf(".")-1),this.tagsNodeStack.pop()):F=y.lastIndexOf("."),y=y.substring(0,F),b=this.tagsNodeStack.pop(),A="",m=w}else if(u[m+1]==="?"){let w=g(u,m,!1,"?>");if(!w)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,b,y),!(this.options.ignoreDeclaration&&w.tagName==="?xml"||this.options.ignorePiTags)){const x=new n(w.tagName);x.add(this.options.textNodeName,""),w.tagName!==w.tagExp&&w.attrExpPresent&&(x[":@"]=this.buildAttributesMap(w.tagExp,y,w.tagName)),this.addChild(b,x,y)}m=w.closeIndex+1}else if(u.substr(m+1,3)==="!--"){const w=d(u,"-->",m+4,"Comment is not closed.");if(this.options.commentPropName){const x=u.substring(m+4,w-2);A=this.saveTextToParentTag(A,b,y),b.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}m=w}else if(u.substr(m+1,2)==="!D"){const w=t(u,m);this.docTypeEntities=w.entities,m=w.i}else if(u.substr(m+1,2)==="!["){const w=d(u,"]]>",m,"CDATA is not closed.")-2,x=u.substring(m+9,w);A=this.saveTextToParentTag(A,b,y);let S=this.parseTextData(x,b.tagname,y,!0,!1,!0,!0);S==null&&(S=""),this.options.cdataPropName?b.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):b.add(this.options.textNodeName,S),m=w+2}else{let w=g(u,m,this.options.removeNSPrefix),x=w.tagName;const S=w.rawTagName;let F=w.tagExp,R=w.attrExpPresent,C=w.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),b&&A&&b.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,b,y,!1));const Z=b;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1&&(b=this.tagsNodeStack.pop(),y=y.substring(0,y.lastIndexOf("."))),x!==p.tagname&&(y+=y?"."+x:x),this.isItStopNode(this.options.stopNodes,y,x)){let M="";if(F.length>0&&F.lastIndexOf("/")===F.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),y=y.substr(0,y.length-1),F=x):F=F.substr(0,F.length-1),m=w.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)m=w.closeIndex;else{const ee=this.readStopNodeData(u,S,C+1);if(!ee)throw new Error(`Unexpected end of ${S}`);m=ee.i,M=ee.tagContent}const q=new n(x);x!==F&&R&&(q[":@"]=this.buildAttributesMap(F,y,x)),M&&(M=this.parseTextData(M,x,y,!0,R,!0,!0)),y=y.substr(0,y.lastIndexOf(".")),q.add(this.options.textNodeName,M),this.addChild(b,q,y)}else{if(F.length>0&&F.lastIndexOf("/")===F.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),y=y.substr(0,y.length-1),F=x):F=F.substr(0,F.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const M=new n(x);x!==F&&R&&(M[":@"]=this.buildAttributesMap(F,y,x)),this.addChild(b,M,y),y=y.substr(0,y.lastIndexOf("."))}else{const M=new n(x);this.tagsNodeStack.push(b),x!==F&&R&&(M[":@"]=this.buildAttributesMap(F,y,x)),this.addChild(b,M,y),b=M}A="",m=C}}else A+=u[m];return p.child};function _(u,p,b){const A=this.options.updateTag(p.tagname,b,p[":@"]);A===!1||(typeof A=="string"&&(p.tagname=A),u.addChild(p))}const h=function(u){if(this.options.processEntities){for(let p in this.docTypeEntities){const b=this.docTypeEntities[p];u=u.replace(b.regx,b.val)}for(let p in this.lastEntities){const b=this.lastEntities[p];u=u.replace(b.regex,b.val)}if(this.options.htmlEntities)for(let p in this.htmlEntities){const b=this.htmlEntities[p];u=u.replace(b.regex,b.val)}u=u.replace(this.ampEntity.regex,this.ampEntity.val)}return u};function v(u,p,b,A){return u&&(A===void 0&&(A=Object.keys(p.child).length===0),u=this.parseTextData(u,p.tagname,b,!1,p[":@"]?Object.keys(p[":@"]).length!==0:!1,A),u!==void 0&&u!==""&&p.add(this.options.textNodeName,u),u=""),u}function T(u,p,b){const A="*."+b;for(const y in u){const m=u[y];if(A===m||p===m)return!0}return!1}function I(u,p,b=">"){let A,y="";for(let m=p;m<u.length;m++){let O=u[m];if(A)O===A&&(A="");else if(O==='"'||O==="'")A=O;else if(O===b[0])if(b[1]){if(u[m+1]===b[1])return{data:y,index:m}}else return{data:y,index:m};else O===" "&&(O=" ");y+=O}}function d(u,p,b,A){const y=u.indexOf(p,b);if(y===-1)throw new Error(A);return y+p.length-1}function g(u,p,b,A=">"){const y=I(u,p+1,A);if(!y)return;let m=y.data;const O=y.index,w=m.search(/\s/);let x=m,S=!0;w!==-1&&(x=m.substring(0,w),m=m.substring(w+1).trimStart());const F=x;if(b){const R=x.indexOf(":");R!==-1&&(x=x.substr(R+1),S=x!==y.data.substr(R+1))}return{tagName:x,tagExp:m,closeIndex:O,attrExpPresent:S,rawTagName:F}}function N(u,p,b){const A=b;let y=1;for(;b<u.length;b++)if(u[b]==="<")if(u[b+1]==="/"){const m=d(u,">",b,`${p} is not closed`);if(u.substring(b+2,m).trim()===p&&(y--,y===0))return{tagContent:u.substring(A,b),i:m};b=m}else if(u[b+1]==="?")b=d(u,"?>",b+1,"StopNode is not closed.");else if(u.substr(b+1,3)==="!--")b=d(u,"-->",b+3,"StopNode is not closed.");else if(u.substr(b+1,2)==="![")b=d(u,"]]>",b,"StopNode is not closed.")-2;else{const m=g(u,b,">");m&&((m&&m.tagName)===p&&m.tagExp[m.tagExp.length-1]!=="/"&&y++,b=m.closeIndex)}}function k(u,p,b){if(p&&typeof u=="string"){const A=u.trim();return A==="true"?!0:A==="false"?!1:i(u,b)}else return e.isExist(u)?u:""}return Bt=a,Bt}var Ut={},oi;function wo(){if(oi)return Ut;oi=1;function e(a,f){return n(a,f)}function n(a,f,s){let c;const r={};for(let o=0;o<a.length;o++){const E=a[o],_=t(E);let h="";if(s===void 0?h=_:h=s+"."+_,_===f.textNodeName)c===void 0?c=E[_]:c+=""+E[_];else{if(_===void 0)continue;if(E[_]){let v=n(E[_],f,h);const T=l(v,f);E[":@"]?i(v,E[":@"],h,f):Object.keys(v).length===1&&v[f.textNodeName]!==void 0&&!f.alwaysCreateTextNode?v=v[f.textNodeName]:Object.keys(v).length===0&&(f.alwaysCreateTextNode?v[f.textNodeName]="":v=""),r[_]!==void 0&&r.hasOwnProperty(_)?(Array.isArray(r[_])||(r[_]=[r[_]]),r[_].push(v)):f.isArray(_,h,T)?r[_]=[v]:r[_]=v}}}return typeof c=="string"?c.length>0&&(r[f.textNodeName]=c):c!==void 0&&(r[f.textNodeName]=c),r}function t(a){const f=Object.keys(a);for(let s=0;s<f.length;s++){const c=f[s];if(c!==":@")return c}}function i(a,f,s,c){if(f){const r=Object.keys(f),o=r.length;for(let E=0;E<o;E++){const _=r[E];c.isArray(_,s+"."+_,!0,!0)?a[_]=[f[_]]:a[_]=f[_]}}}function l(a,f){const{textNodeName:s}=f,c=Object.keys(a).length;return!!(c===0||c===1&&(a[s]||typeof a[s]=="boolean"||a[s]===0))}return Ut.prettify=e,Ut}var Mt,li;function yo(){if(li)return Mt;li=1;const{buildOptions:e}=ho(),n=bo(),{prettify:t}=wo(),i=tr();class l{constructor(f){this.externalEntities={},this.options=e(f)}parse(f,s){if(typeof f!="string")if(f.toString)f=f.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(s){s===!0&&(s={});const o=i.validate(f,s);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const c=new n(this.options);c.addExternalEntities(this.externalEntities);const r=c.parseXml(f);return this.options.preserveOrder||r===void 0?r:t(r,this.options)}addEntity(f,s){if(s.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(f.indexOf("&")!==-1||f.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(s==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[f]=s}}return Mt=l,Mt}var jt,fi;function xo(){if(fi)return jt;fi=1;const e=`
@@ -1,4 +1,4 @@
1
- import{D as w1,J as K1,j as r,Y as Y1,$ as W1,I as q1,dg as _1,ar as I1,ak as U,a$ as R,cX as y1,b1 as $1,am as B1,T,bD as e6,z as t6,cr as n6,a6,Q as r6}from"./vendor-mui-core-DHT36AZL.js";import{C as x,a as i6,a9 as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BSZ4yJws.js";import{V as l6,I as F1,e as u6,A as H,l as C6,x as p6,b as d6,n as t1,aF as n1}from"./vendor-ux-sqP3hEhY.js";import{r as t}from"./vendor-react-CUXIiAnY.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-fhL5FJET.js";import{bj as Y,Z as W,bz as U1,bA as h6,v as m6,bs as E6,bf as g6}from"./index-CN4lpn74.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-bbu7QFpz.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return K1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
1
+ import{D as w1,J as K1,j as r,Y as Y1,$ as W1,I as q1,dg as _1,ar as I1,ak as U,a$ as R,cX as y1,b1 as $1,am as B1,T,bD as e6,z as t6,cr as n6,a6,Q as r6}from"./vendor-mui-core-DHT36AZL.js";import{C as x,a as i6,a9 as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BSZ4yJws.js";import{V as l6,I as F1,e as u6,A as H,l as C6,x as p6,b as d6,n as t1,aF as n1}from"./vendor-ux-sqP3hEhY.js";import{r as t}from"./vendor-react-CUXIiAnY.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-fhL5FJET.js";import{bj as Y,Z as W,bz as U1,bA as h6,v as m6,bs as E6,bf as g6}from"./index-lFDZOk_k.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-bbu7QFpz.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return K1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
4
4
  If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),I6=U1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败:
@@ -1,4 +1,4 @@
1
- import{W as o,j as n,ak as h,f as y,bh as q,av as w,D as I}from"./vendor-mui-core-DHT36AZL.js";import{r as $}from"./vendor-react-CUXIiAnY.js";import{l as k,a3 as W,V as A,m as B,K as H}from"./vendor-ux-sqP3hEhY.js";import{aX as Y,aY as V,aZ as Z,a_ as C,k as K,a$ as P,b0 as X,b1 as G,am as J,b2 as N,b3 as Q}from"./index-CN4lpn74.js";import{Y as U,I as ee,Z as ne}from"./vendor-utils-BSZ4yJws.js";import{a as oe}from"./vendor-hooks-fhL5FJET.js";function z({name:e="",logo:t="",description:i="",...c}){if(!e&&!t&&!i)return null;const d=$.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...c,children:[n.jsxs("div",{children:[t&&n.jsx(h,{component:"a",href:"/",className:"footer-brand-logo",children:d}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
1
+ import{W as o,j as n,ak as h,f as y,bh as q,av as w,D as I}from"./vendor-mui-core-DHT36AZL.js";import{r as $}from"./vendor-react-CUXIiAnY.js";import{l as k,a3 as W,V as A,m as B,K as H}from"./vendor-ux-sqP3hEhY.js";import{aX as Y,aY as V,aZ as Z,a_ as C,k as K,a$ as P,b0 as X,b1 as G,am as J,b2 as N,b3 as Q}from"./index-lFDZOk_k.js";import{Y as U,I as ee,Z as ne}from"./vendor-utils-BSZ4yJws.js";import{a as oe}from"./vendor-hooks-fhL5FJET.js";function z({name:e="",logo:t="",description:i="",...c}){if(!e&&!t&&!i)return null;const d=$.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(te,{...c,children:[n.jsxs("div",{children:[t&&n.jsx(h,{component:"a",href:"/",className:"footer-brand-logo",children:d}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const te=k("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -1,4 +1,4 @@
1
- import{r as j,g as ge}from"./vendor-react-CUXIiAnY.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-DHT36AZL.js";import{_ as E,b6 as ae,B as le,c as Ne}from"./index-CN4lpn74.js";import{V as L,b as ce,n as _,H as z,E as ee,S as Pe}from"./vendor-ux-sqP3hEhY.js";import{e as ue}from"./edit.svg-Dz9cVo7r.js";import{C as He}from"./lock.svg-BPCZ0CT3.js";import{G as Ie,H as _e}from"./vendor-utils-BSZ4yJws.js";import{f as pe}from"./index-DBs9Ljax.js";import{u as de}from"./team-BnNEVFdE.js";import{w as me,P as Ee}from"./permission-DLnMVuoy.js";import{C as Le}from"./confirm-DPD7yjeR.js";const Me=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
1
+ import{r as j,g as ge}from"./vendor-react-CUXIiAnY.js";import{j as o,T as H,z as $,x as ye,c3 as ve,c4 as Y,bw as je,F as Ce,bD as Te,aX as Fe,a6 as U,W as C,b6 as be,a5 as we,I as K,at as G,ak as B,J as Se,Q as Be,cb as De,am as Re}from"./vendor-mui-core-DHT36AZL.js";import{_ as E,b6 as ae,B as le,c as Ne}from"./index-lFDZOk_k.js";import{V as L,b as ce,n as _,H as z,E as ee,S as Pe}from"./vendor-ux-sqP3hEhY.js";import{e as ue}from"./edit.svg-Dz9cVo7r.js";import{C as He}from"./lock.svg-BPCZ0CT3.js";import{G as Ie,H as _e}from"./vendor-utils-BSZ4yJws.js";import{f as pe}from"./index-DBs9Ljax.js";import{u as de}from"./team-KWOyNaWn.js";import{w as me,P as Ee}from"./permission-B3_OQqtH.js";import{C as Le}from"./confirm-Dge1BR0a.js";const Me=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>