@dcl/shop 0.1.0-29489010081.commit-c04e72d → 0.1.0-29527153652.commit-d2eebfa
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.
- package/assets/{AnimatedBackground-C3tCIt3_.js → AnimatedBackground-BtDeGtuY.js} +3 -3
- package/assets/Assets-CicnCRkP.js +1 -0
- package/assets/Cart-bywt8_CL.js +1 -0
- package/assets/{CircularProgress-CFx6Tc-u.js → CircularProgress-3Y_POW5D.js} +4 -4
- package/assets/Collection-C4oILWgm.js +1 -0
- package/assets/Collection-CxRRuAdy.css +1 -0
- package/assets/{ConstantsUtil-rB_9qX5U.js → ConstantsUtil-BTo1-KgH.js} +1 -1
- package/assets/ContentClient-CEkpPq6Z.js +1 -0
- package/assets/Creator-C4puJP6z.js +1 -0
- package/assets/Creator-DJqbQ8AX.css +1 -0
- package/assets/DeploymentBuilder-DPr-ptgp.js +3 -0
- package/assets/{ExchangeController-BKVj-wUk.js → ExchangeController-D4CpJ8kl.js} +1 -1
- package/assets/GetCredits-gEfRJgGT.js +1 -0
- package/assets/{HelpersUtil-D3RJTtBW.js → HelpersUtil-BeiA-N3I.js} +1 -1
- package/assets/ImportListings-DgevLbSo.js +1 -0
- package/assets/ItemDetail-DFD_2ZeC.js +2 -0
- package/assets/{LoadMore-8Dx5lULo.js → LoadMore-DsKzH4Rv.js} +1 -1
- package/assets/MyAssets-C_jVBeCP.js +1 -0
- package/assets/{MyFavorites-CK5_WnC2.js → MyFavorites-B6ImIszd.js} +1 -1
- package/assets/{MyPurchases-CpT7mJeg.js → MyPurchases-BH0keZsh.js} +1 -1
- package/assets/{NetworkUtil-Cm_KFCNa.js → NetworkUtil-DInevqnn.js} +1 -1
- package/assets/{NotFound-CwEJRJsv.js → NotFound-BUwRH5h0.js} +1 -1
- package/assets/StoreSettings-BsV7iEJX.css +1 -0
- package/assets/StoreSettings-C66yF7xF.js +1 -0
- package/assets/Success-B2aNqHp6.js +1 -0
- package/assets/{SwapController-DdOdLkW2.js → SwapController-fK7v6beM.js} +1 -1
- package/assets/TradeService-BYjElQ_J.js +1 -0
- package/assets/{W3MFrameProviderSingleton-ZaFH8iXi.js → W3MFrameProviderSingleton-BvT93_mb.js} +3 -3
- package/assets/{WebCryptoP256-H5nw1_R9.js → WebCryptoP256-lk8Phz0j.js} +1 -1
- package/assets/{basic-ajzFEC0k.js → basic-DLKrLmdo.js} +1 -1
- package/assets/{biconomy-BthW3jTV.js → biconomy-7wiec39b.js} +1 -1
- package/assets/{browser-BMhVVB-A.js → browser-9oFjBwrz.js} +1 -1
- package/assets/browser-ponyfill-DMgE6PM5.js +2 -0
- package/assets/browser-ponyfill-Djb5Py6a.js +1 -0
- package/assets/{buy-DEy5oWx-.js → buy-DIwWkpJJ.js} +1 -1
- package/assets/{buy-gasless-VIo89iNM.js → buy-gasless-CFOJz7EI.js} +1 -1
- package/assets/categories-DYe3ZXtu.js +1 -0
- package/assets/categories-FoGfjyVm.css +1 -0
- package/assets/{ccip-BkNQa8cV.js → ccip-DNX1aV6c.js} +1 -1
- package/assets/{ccip-YAHPm4lT.js → ccip-Dgzo1FXe.js} +1 -1
- package/assets/{chains-ahXbxt0q.js → chains-BQ5Swd2q.js} +1 -1
- package/assets/collection-BHilCUwH.js +1 -0
- package/assets/{collection-Ds5shVfK.css → collection-CrgnzsVL.css} +1 -1
- package/assets/{common-B5mo5Owz.js → common-CBPtpBt7.js} +1 -1
- package/assets/controller-16-J3O8L.js +2 -0
- package/assets/{core-CYiLxEzM.js → core-DXuYXUj1.js} +4 -4
- package/assets/{custom-Dp9Dh7zL.js → custom-BTyOEs9D.js} +1 -1
- package/assets/{data-capture-BDOOE_ef.js → data-capture-DQHZCQ9R.js} +1 -1
- package/assets/{decimals-l9QqXFQS.js → decimals-DKkXzXLC.js} +1 -1
- package/assets/decimals-DWEHw5Cf.js +1 -0
- package/assets/default-cover-7vUE644d.jpeg +0 -0
- package/assets/{detectExtension-DbxURuLG.js → detectExtension-Wqss5tRf.js} +1 -1
- package/assets/{email-COb083lm.js → email-BA8oF4Sb.js} +1 -1
- package/assets/{embedded-wallet-AiyWyM1t.js → embedded-wallet-CmR3JoQA.js} +1 -1
- package/assets/emotion-styled.browser.esm-hMeaJLB-.js +1 -0
- package/assets/{engine-clsNVx05.js → engine-D7X1-7M_.js} +1 -1
- package/assets/{estimate-l1-fee-jUmzX2ld.js → estimate-l1-fee-mP34fdnr.js} +1 -1
- package/assets/eth_estimateGas-hNSxz4co.js +1 -0
- package/assets/{eth_getStorageAt-CvLG1_Jo.js → eth_getStorageAt-CcAHGbyZ.js} +1 -1
- package/assets/eth_getTransactionCount-kHoTdsNW.js +1 -0
- package/assets/{ethereum-CfGZ1o2B.js → ethereum-CD3dxaW_.js} +1 -1
- package/assets/{ethers-D-4WUfRB.js → ethers-DwWf2RqE.js} +1 -1
- package/assets/events-DQ172AOg.js +1 -0
- package/assets/{extractIPFS-w7ac0ws4.js → extractIPFS-ptBh3aqV.js} +1 -1
- package/assets/{features-CspU5qNv.js → features-Dadqu3Gy.js} +2 -2
- package/assets/{fetchTokenMetadata-BaEvnlSD.js → fetchTokenMetadata-Yjbzq3OX.js} +2 -2
- package/assets/{fortmatic-Be6frCcv.js → fortmatic-DhmlcDbL.js} +1 -1
- package/assets/get-ecosystem-wallet-info-BHxUH0sn.js +1 -0
- package/assets/{getBalance-DQeLy4UX.js → getBalance-CcpUJJbb.js} +2 -2
- package/assets/{getInstalledModules-56AfvyZo.js → getInstalledModules-B29UYWwx.js} +1 -1
- package/assets/{getNFT-Cuo1y-Dw.js → getNFT-C8XHKgBR.js} +1 -1
- package/assets/{getNFT-DIM-F27_.js → getNFT-DRamL_wJ.js} +2 -2
- package/assets/{hashTypedData-CHOppTRC.js → hashTypedData-B8qJCKv2.js} +1 -1
- package/assets/{hashTypedData-BLO0uf-r.js → hashTypedData-BRhQ_lPd.js} +1 -1
- package/assets/{import-JBeySj3d.js → import-C0KzuCTc.js} +1 -1
- package/assets/in-app-wallet-calls-BMeL3YV4.js +1 -0
- package/assets/index-B3ocNsJt.js +2 -0
- package/assets/{index-BIij5F98.js → index-BCzwAhbN.js} +1 -1
- package/assets/index-BL5vFwJv.js +1 -0
- package/assets/index-BPiKxEfw.js +1 -0
- package/assets/index-BSOhCppl.js +2 -0
- package/assets/{index-D9vktHzl.js → index-BWmqibNa.js} +1 -1
- package/assets/index-BcX-FSIU.css +1 -0
- package/assets/index-Bh8SuC59.js +74 -0
- package/assets/{index-DSsR20MG.js → index-BiY5ZJ1L.js} +1 -1
- package/assets/index-BmHevYxh.js +1 -0
- package/assets/index-BpmLS8_h.js +5 -0
- package/assets/{index-Fy50YzQ3.js → index-BsFR4koq.js} +1 -1
- package/assets/{index-D9Qz4bzh.js → index-BtK9ZDTb.js} +1 -1
- package/assets/{index-LXawog8O.js → index-BuUSB4r5.js} +2 -2
- package/assets/index-BxFWKJ00.js +8 -0
- package/assets/{index-GKORwvdA.js → index-BxnBUVzy.js} +1 -1
- package/assets/{index-BaSxcMLe.js → index-By6STTNb.js} +1 -1
- package/assets/{index-BqKiriHU.js → index-ByM1xTND.js} +1 -1
- package/assets/{index-ScgGQAhq.js → index-Bz7fb3vC.js} +1 -1
- package/assets/{index-C1zw_jvz.js → index-C0kv5kHB.js} +40 -40
- package/assets/{index-BHjrNg9z.js → index-C1AneBnm.js} +1 -1
- package/assets/{index-CP8m1u84.js → index-C5nVlEYH.js} +1 -1
- package/assets/index-CEeQH9eo.js +2 -0
- package/assets/{index-DEu_mGCU.js → index-CG-dA0rF.js} +1 -1
- package/assets/{index-DZdvpJR7.js → index-CGecUMNA.js} +1 -1
- package/assets/{index--Cp_hd__.js → index-CJQuE4Vh.js} +1 -1
- package/assets/{index-CgFd602S.js → index-CUe6g2db.js} +1 -1
- package/assets/{index-BD4IJd4v.js → index-CXOpVxKU.js} +1 -1
- package/assets/{index-C5sIT0tb.js → index-CYZw7sLz.js} +1 -1
- package/assets/{index-BKR9QEHq.js → index-Cd5vM2Jh.js} +1 -1
- package/assets/{index-BQkCy5n9.js → index-CjpJ162L.js} +1 -1
- package/assets/{index-BzBBEm1y.js → index-CrKpXY-Z.js} +1 -1
- package/assets/{index-NJd4P5K3.js → index-CuwAAEkV.js} +2 -2
- package/assets/{index-vd9YojnC.js → index-Czt6tP80.js} +1 -1
- package/assets/{index-Drll3iZv.js → index-D2HgI4Mu.js} +1 -1
- package/assets/{index-DwXY_0me.js → index-D4UonDIb.js} +3 -3
- package/assets/{index-D4UBoQqv.js → index-DFGIa8d3.js} +1 -1
- package/assets/index-DGIRcK5n.js +1 -0
- package/assets/index-DH3Yzbz3.js +1 -0
- package/assets/{index-Ba1nPvJW.js → index-DNGhO1UM.js} +1 -1
- package/assets/{index-4CyAhAID.js → index-DOk2P7Zl.js} +1 -1
- package/assets/{index-Bc_XrzTG.js → index-DT90wIp1.js} +1 -1
- package/assets/{index-Du5uk45Q.js → index-DVAVXeLV.js} +1 -1
- package/assets/{index-CFX7-nql.js → index-DVG9WYtE.js} +1 -1
- package/assets/{index-BTbJkw2h.js → index-DeBofuPQ.js} +1 -1
- package/assets/{index-BWWcY9Ui.js → index-Dex_bJg1.js} +2 -2
- package/assets/index-Df6T9jlW.js +14 -0
- package/assets/{index-BfMUWitg.js → index-Df8IehzX.js} +2 -2
- package/assets/{index-BaVtOO6t.js → index-DfyoH385.js} +1 -1
- package/assets/{index-Cq6p8O8N.js → index-DkIBv-8E.js} +1 -1
- package/assets/{index-DpKiyVfQ.js → index-Dl9lo-Tk.js} +1 -1
- package/assets/{index-BYMSEXnr.js → index-Dp3Py-Ws.js} +1 -1
- package/assets/{index-o6E9IjdT.js → index-Dqw_U4li.js} +1 -1
- package/assets/{index-BEoWhDOy.js → index-DvmI6WZg.js} +1 -1
- package/assets/{index-Cw0X2YFE.js → index-EYxoPD15.js} +1 -1
- package/assets/{index-BdXUoeDl.js → index-EiHJjF_U.js} +1 -1
- package/assets/{index-Ci_h9xYZ.js → index-Iapi1Q6R.js} +1 -1
- package/assets/{index-Bmyk-e0Z.js → index-_heiRLxG.js} +1 -1
- package/assets/{index-DsaI3D4d.js → index-iYlfzQJZ.js} +3 -3
- package/assets/{index-COTqPlSo.js → index-kA7_bUnK.js} +1 -1
- package/assets/{index-BYFbS7nW.js → index-rfcI92-3.js} +1 -1
- package/assets/{index-BPH4bq6L.js → index-sr7QrKQZ.js} +1 -1
- package/assets/{index-BF4WrGCQ.js → index-t67nymVk.js} +1 -1
- package/assets/index.es-BnHkek_2.js +1 -0
- package/assets/{index.es-CCFOZERa.js → index.es-DHouqHFo.js} +1 -1
- package/assets/{index.es-DgJoRPHo.js → index.es-DsvM4XzW.js} +4 -4
- package/assets/{localBatchGatewayRequest-_AoYEiK7.js → localBatchGatewayRequest-Cmn1dfqz.js} +1 -1
- package/assets/{mana-rate-C_85VLuc.js → mana-rate-DObImZN2.js} +1 -1
- package/assets/{native-8V193B3S.js → native-B49T_qnV.js} +1 -1
- package/assets/network-S_CrOtw4.js +1 -0
- package/assets/{networks-Ddls1APy.js → networks-D1cCGfqG.js} +1 -1
- package/assets/{onramp-CbrZeS8x.js → onramp-Dj3OMdJa.js} +1 -1
- package/assets/{openzeppelin-Dc0QLeyv.js → openzeppelin-jmYZOwb-.js} +1 -1
- package/assets/{ownerOf-DCCyyTsB.js → ownerOf-Cg8vrCG0.js} +1 -1
- package/assets/{parseNft-yLNtdVoG.js → parseNft-DQjOfM3E.js} +2 -2
- package/assets/{parseSignature-_XuTQKnp.js → parseSignature-BhGVGyy8.js} +1 -1
- package/assets/{parseSignature-BXcK95O1.js → parseSignature-D-2KGIjo.js} +3 -3
- package/assets/{pay-with-exchange-DnGEPz-9.js → pay-with-exchange-D7uxTE5e.js} +1 -1
- package/assets/{qr-overlay-D1woZopL.js → qr-overlay-ASsJZZn5.js} +3 -3
- package/assets/{react-iAgwec9M.js → react-C51i12iP.js} +1 -1
- package/assets/{receive-DxQFpvBx.js → receive--EqYLwG2.js} +1 -1
- package/assets/{resolveImplementation-BhJMvZcE.js → resolveImplementation-DyRnucGw.js} +1 -1
- package/assets/{rpc-DgEEESUq.js → rpc-CjcTpc0V.js} +1 -1
- package/assets/secp256k1-C3pUvKM8.js +1 -0
- package/assets/secp256k1-CuYcQbK2.js +1 -0
- package/assets/{secp256k1-JL5K1b6W.js → secp256k1-QnclhqY7.js} +1 -1
- package/assets/{send-DTIO_xKD.js → send-CH7qei4t.js} +1 -1
- package/assets/{send-batch-transaction-D_I1HvSE.js → send-batch-transaction-Cr5kGUem.js} +1 -1
- package/assets/{send-eip712-transaction-CB6q4yTz.js → send-eip712-transaction-DNEzCZTW.js} +2 -2
- package/assets/{send-gasless-transaction-BjkKopST.js → send-gasless-transaction-BnwvR3f6.js} +2 -2
- package/assets/{sendRawTransaction-Cl3fTy2r.js → sendRawTransaction-BIHxQG44.js} +3 -3
- package/assets/{serializeTransaction-B5MYVv86.js → serializeTransaction-DbiNVef8.js} +1 -1
- package/assets/session-proposal-DvE_C2Qm.js +1 -0
- package/assets/session-request-DF5W14aH.js +2 -0
- package/assets/{sha256-C4qHsWKZ.js → sha256-DhQnMvgr.js} +1 -1
- package/assets/{signing-CjtnBxxM.js → signing-BChtQR_k.js} +5 -5
- package/assets/{socials-DHKSWRNK.js → socials-ibz-qcug.js} +1 -1
- package/assets/{swaps-oR49jgCz.js → swaps-D5GQ3VUK.js} +1 -1
- package/assets/template-cover-1-BETekfHg.jpeg +0 -0
- package/assets/template-cover-2-Dni9s0i_.jpeg +0 -0
- package/assets/{thirdweb-DLsVRg5B.js → thirdweb-CaDKinrI.js} +3 -3
- package/assets/{totalSupply-BbnfAQRL.js → totalSupply-DaG75TVX.js} +1 -1
- package/assets/{trade-encoding-gNFeXeFL.js → trade-encoding-3-fY1Skv.js} +1 -1
- package/assets/{transactionReceipt-D2SEnNQ1.js → transactionReceipt-DVjUNlv8.js} +1 -1
- package/assets/transactions-DN5Djj2C.js +16 -0
- package/assets/{useInfiniteGrid-BA1C5BmN.js → useInfiniteGrid-BeqyJL-J.js} +1 -1
- package/assets/useStore-BgEatlVS.js +2 -0
- package/assets/{utils-DmMVfaK5.js → utils-rl7KiNyp.js} +1 -1
- package/assets/{verifyHash-ZaW4iQ5U.js → verifyHash-C2MKzB9x.js} +1 -1
- package/assets/{w3m-modal-jjoiIHiM.js → w3m-modal-Bpc7iV--.js} +1 -1
- package/assets/{w3m-modal-C7bXvOf6.js → w3m-modal-JCjAaYVQ.js} +1 -1
- package/assets/{wait-for-tx-receipt-DztajESX.js → wait-for-tx-receipt-4J-SfEVn.js} +1 -1
- package/assets/{wallet-kind-BCHFSy95.js → wallet-kind-DmRQR63L.js} +1 -1
- package/assets/{wallets-CdPPQGkU.js → wallets-CH6ovtsY.js} +6 -6
- package/assets/web-connector-fZY0b-3_.js +9 -0
- package/assets/{writeContract-DNofglus.js → writeContract-D6AcaE27.js} +1 -1
- package/assets/{zora-sepolia-6WiqQMBk.js → zora-sepolia-Cmu9LYjr.js} +1 -1
- package/assets/{zoraTestnet-IteRz7Y6.js → zoraTestnet-CHyjVmWt.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/Assets-DQEUXeMX.js +0 -1
- package/assets/Cart-lN_ulEt9.js +0 -1
- package/assets/Collection-9eLs13RF.js +0 -1
- package/assets/Creator-DkWw07V0.js +0 -1
- package/assets/GetCredits-Cd2MM2_C.js +0 -1
- package/assets/ImportListings-CCqLXiQR.js +0 -1
- package/assets/ItemDetail-kMMoE6GO.js +0 -2
- package/assets/MyAssets-Ds0g4zU7.js +0 -1
- package/assets/SkeletonCards-BhzQlTiQ.js +0 -1
- package/assets/Success-BDL2iZK2.js +0 -1
- package/assets/TradeService-B9iZ5DY4.js +0 -1
- package/assets/browser-ponyfill-B39o65AB.js +0 -2
- package/assets/collection-OLKHFYz-.js +0 -1
- package/assets/controller-CbQsCzNl.js +0 -2
- package/assets/decimals-CTbYR1AE.js +0 -1
- package/assets/emotion-styled.browser.esm-B8upHOUh.js +0 -1
- package/assets/eth_estimateGas-iM3Zr91m.js +0 -1
- package/assets/eth_getTransactionCount-jDyG_Ia6.js +0 -1
- package/assets/get-ecosystem-wallet-info-MdgEA2Qu.js +0 -1
- package/assets/in-app-wallet-calls-D-eIKfO6.js +0 -1
- package/assets/index-BPa10U7S.js +0 -2
- package/assets/index-Bv7abT8U.js +0 -1
- package/assets/index-C3sRipyF.js +0 -1
- package/assets/index-CWJl0T5f.js +0 -1
- package/assets/index-CfKPHln4.js +0 -1
- package/assets/index-Ctf6wteV.css +0 -1
- package/assets/index-D5-hMxEz.js +0 -74
- package/assets/index-DYvtCH-a.js +0 -2
- package/assets/index-pgfSp-jn.js +0 -2
- package/assets/index-wNInR-jL.js +0 -21
- package/assets/index.es-_RJxIHwU.js +0 -1
- package/assets/network-Ce6LZqru.js +0 -1
- package/assets/secp256k1-BRibcqku.js +0 -1
- package/assets/secp256k1-c93U_qwn.js +0 -1
- package/assets/session-proposal-DnoyWdz2.js +0 -1
- package/assets/session-request-83tzrKS9.js +0 -2
- package/assets/transactions-CmcaT-SG.js +0 -16
- package/assets/web-connector-C3v6OgPl.js +0 -9
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var H=Object.defineProperty;var V=(r,t,e)=>t in r?H(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var D=(r,t,e)=>V(r,typeof t!="symbol"?t+"":t,e);import{c as commonjsGlobal}from"./react-C51i12iP.js";import{r as requireCryptoBrowserify,c as commonjsRequire}from"./index-BxFWKJ00.js";var dist={exports:{}};dist.exports;var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(module){var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJS=(r,t)=>function(){return t||(0,r[__getOwnPropNames(r)[0]])((t={exports:{}}).exports,t),t.exports},__export=(r,t)=>{for(var e in t)__defProp(r,e,{get:t[e],enumerable:!0})},__copyProps=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of __getOwnPropNames(t))!__hasOwnProp.call(r,i)&&i!==e&&__defProp(r,i,{get:()=>t[i],enumerable:!(n=__getOwnPropDesc(t,i))||n.enumerable});return r},__toESM=(r,t,e)=>(e=r!=null?__create(__getProtoOf(r)):{},__copyProps(__defProp(e,"default",{value:r,enumerable:!0}),r)),__toCommonJS=r=>__copyProps(__defProp({},"__esModule",{value:!0}),r),require_err_code=__commonJS({"node_modules/err-code/index.js"(r,t){function e(i,o){for(const s in o)Object.defineProperty(i,s,{value:o[s],enumerable:!0,configurable:!0});return i}function n(i,o,s){if(!i||typeof i=="string")throw new TypeError("Please pass an Error to err-code");s||(s={}),typeof o=="object"&&(s=o,o=""),o&&(s.code=o);try{return e(i,s)}catch{s.message=i.message,s.stack=i.stack;const u=function(){};return u.prototype=Object.create(Object.getPrototypeOf(i)),e(new u,s)}}t.exports=n}}),require_aspromise=__commonJS({"node_modules/@protobufjs/aspromise/index.js"(r,t){t.exports=e;function e(n,i){for(var o=new Array(arguments.length-1),s=0,a=2,u=!0;a<arguments.length;)o[s++]=arguments[a++];return new Promise(function(f,g){o[s]=function(y){if(u)if(u=!1,y)g(y);else{for(var l=new Array(arguments.length-1),c=0;c<l.length;)l[c++]=arguments[c];f.apply(null,l)}};try{n.apply(i||null,o)}catch(b){u&&(u=!1,g(b))}})}}}),require_base64=__commonJS({"node_modules/@protobufjs/base64/index.js"(r){var t=r;t.length=function(a){var u=a.length;if(!u)return 0;for(var h=0;--u%4>1&&a.charAt(u)==="=";)++h;return Math.ceil(a.length*3)/4-h};var e=new Array(64),n=new Array(123);for(i=0;i<64;)n[e[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;var i;t.encode=function(a,u,h){for(var f=null,g=[],b=0,y=0,l;u<h;){var c=a[u++];switch(y){case 0:g[b++]=e[c>>2],l=(c&3)<<4,y=1;break;case 1:g[b++]=e[l|c>>4],l=(c&15)<<2,y=2;break;case 2:g[b++]=e[l|c>>6],g[b++]=e[c&63],y=0;break}b>8191&&((f||(f=[])).push(String.fromCharCode.apply(String,g)),b=0)}return y&&(g[b++]=e[l],g[b++]=61,y===1&&(g[b++]=61)),f?(b&&f.push(String.fromCharCode.apply(String,g.slice(0,b))),f.join("")):String.fromCharCode.apply(String,g.slice(0,b))};var o="invalid encoding";t.decode=function(a,u,h){for(var f=h,g=0,b,y=0;y<a.length;){var l=a.charCodeAt(y++);if(l===61&&g>1)break;if((l=n[l])===void 0)throw Error(o);switch(g){case 0:b=l,g=1;break;case 1:u[h++]=b<<2|(l&48)>>4,b=l,g=2;break;case 2:u[h++]=(b&15)<<4|(l&60)>>2,b=l,g=3;break;case 3:u[h++]=(b&3)<<6|l,g=0;break}}if(g===1)throw Error(o);return h-f},t.test=function(a){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a)}}}),require_eventemitter=__commonJS({"node_modules/@protobufjs/eventemitter/index.js"(r,t){t.exports=e;function e(){this._listeners={}}e.prototype.on=function(i,o,s){return(this._listeners[i]||(this._listeners[i]=[])).push({fn:o,ctx:s||this}),this},e.prototype.off=function(i,o){if(i===void 0)this._listeners={};else if(o===void 0)this._listeners[i]=[];else for(var s=this._listeners[i],a=0;a<s.length;)s[a].fn===o?s.splice(a,1):++a;return this},e.prototype.emit=function(i){var o=this._listeners[i];if(o){for(var s=[],a=1;a<arguments.length;)s.push(arguments[a++]);for(a=0;a<o.length;)o[a].fn.apply(o[a++].ctx,s)}return this}}}),require_float=__commonJS({"node_modules/@protobufjs/float/index.js"(r,t){t.exports=e(e);function e(a){return typeof Float32Array<"u"?(function(){var u=new Float32Array([-0]),h=new Uint8Array(u.buffer),f=h[3]===128;function g(c,d,w){u[0]=c,d[w]=h[0],d[w+1]=h[1],d[w+2]=h[2],d[w+3]=h[3]}function b(c,d,w){u[0]=c,d[w]=h[3],d[w+1]=h[2],d[w+2]=h[1],d[w+3]=h[0]}a.writeFloatLE=f?g:b,a.writeFloatBE=f?b:g;function y(c,d){return h[0]=c[d],h[1]=c[d+1],h[2]=c[d+2],h[3]=c[d+3],u[0]}function l(c,d){return h[3]=c[d],h[2]=c[d+1],h[1]=c[d+2],h[0]=c[d+3],u[0]}a.readFloatLE=f?y:l,a.readFloatBE=f?l:y})():(function(){function u(f,g,b,y){var l=g<0?1:0;if(l&&(g=-g),g===0)f(1/g>0?0:2147483648,b,y);else if(isNaN(g))f(2143289344,b,y);else if(g>34028234663852886e22)f((l<<31|2139095040)>>>0,b,y);else if(g<11754943508222875e-54)f((l<<31|Math.round(g/1401298464324817e-60))>>>0,b,y);else{var c=Math.floor(Math.log(g)/Math.LN2),d=Math.round(g*Math.pow(2,-c)*8388608)&8388607;f((l<<31|c+127<<23|d)>>>0,b,y)}}a.writeFloatLE=u.bind(null,n),a.writeFloatBE=u.bind(null,i);function h(f,g,b){var y=f(g,b),l=(y>>31)*2+1,c=y>>>23&255,d=y&8388607;return c===255?d?NaN:l*(1/0):c===0?l*1401298464324817e-60*d:l*Math.pow(2,c-150)*(d+8388608)}a.readFloatLE=h.bind(null,o),a.readFloatBE=h.bind(null,s)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),h=new Uint8Array(u.buffer),f=h[7]===128;function g(c,d,w){u[0]=c,d[w]=h[0],d[w+1]=h[1],d[w+2]=h[2],d[w+3]=h[3],d[w+4]=h[4],d[w+5]=h[5],d[w+6]=h[6],d[w+7]=h[7]}function b(c,d,w){u[0]=c,d[w]=h[7],d[w+1]=h[6],d[w+2]=h[5],d[w+3]=h[4],d[w+4]=h[3],d[w+5]=h[2],d[w+6]=h[1],d[w+7]=h[0]}a.writeDoubleLE=f?g:b,a.writeDoubleBE=f?b:g;function y(c,d){return h[0]=c[d],h[1]=c[d+1],h[2]=c[d+2],h[3]=c[d+3],h[4]=c[d+4],h[5]=c[d+5],h[6]=c[d+6],h[7]=c[d+7],u[0]}function l(c,d){return h[7]=c[d],h[6]=c[d+1],h[5]=c[d+2],h[4]=c[d+3],h[3]=c[d+4],h[2]=c[d+5],h[1]=c[d+6],h[0]=c[d+7],u[0]}a.readDoubleLE=f?y:l,a.readDoubleBE=f?l:y})():(function(){function u(f,g,b,y,l,c){var d=y<0?1:0;if(d&&(y=-y),y===0)f(0,l,c+g),f(1/y>0?0:2147483648,l,c+b);else if(isNaN(y))f(0,l,c+g),f(2146959360,l,c+b);else if(y>17976931348623157e292)f(0,l,c+g),f((d<<31|2146435072)>>>0,l,c+b);else{var w;if(y<22250738585072014e-324)w=y/5e-324,f(w>>>0,l,c+g),f((d<<31|w/4294967296)>>>0,l,c+b);else{var v=Math.floor(Math.log(y)/Math.LN2);v===1024&&(v=1023),w=y*Math.pow(2,-v),f(w*4503599627370496>>>0,l,c+g),f((d<<31|v+1023<<20|w*1048576&1048575)>>>0,l,c+b)}}}a.writeDoubleLE=u.bind(null,n,0,4),a.writeDoubleBE=u.bind(null,i,4,0);function h(f,g,b,y,l){var c=f(y,l+g),d=f(y,l+b),w=(d>>31)*2+1,v=d>>>20&2047,p=4294967296*(d&1048575)+c;return v===2047?p?NaN:w*(1/0):v===0?w*5e-324*p:w*Math.pow(2,v-1075)*(p+4503599627370496)}a.readDoubleLE=h.bind(null,o,0,4),a.readDoubleBE=h.bind(null,s,4,0)})(),a}function n(a,u,h){u[h]=a&255,u[h+1]=a>>>8&255,u[h+2]=a>>>16&255,u[h+3]=a>>>24}function i(a,u,h){u[h]=a>>>24,u[h+1]=a>>>16&255,u[h+2]=a>>>8&255,u[h+3]=a&255}function o(a,u){return(a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24)>>>0}function s(a,u){return(a[u]<<24|a[u+1]<<16|a[u+2]<<8|a[u+3])>>>0}}}),require_inquire=__commonJS({"node_modules/@protobufjs/inquire/index.js"(exports,module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}}}),require_utf8=__commonJS({"node_modules/@protobufjs/utf8/index.js"(r){var t=r;t.length=function(n){for(var i=0,o=0,s=0;s<n.length;++s)o=n.charCodeAt(s),o<128?i+=1:o<2048?i+=2:(o&64512)===55296&&(n.charCodeAt(s+1)&64512)===56320?(++s,i+=4):i+=3;return i},t.read=function(n,i,o){var s=o-i;if(s<1)return"";for(var a=null,u=[],h=0,f;i<o;)f=n[i++],f<128?u[h++]=f:f>191&&f<224?u[h++]=(f&31)<<6|n[i++]&63:f>239&&f<365?(f=((f&7)<<18|(n[i++]&63)<<12|(n[i++]&63)<<6|n[i++]&63)-65536,u[h++]=55296+(f>>10),u[h++]=56320+(f&1023)):u[h++]=(f&15)<<12|(n[i++]&63)<<6|n[i++]&63,h>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,u)),h=0);return a?(h&&a.push(String.fromCharCode.apply(String,u.slice(0,h))),a.join("")):String.fromCharCode.apply(String,u.slice(0,h))},t.write=function(n,i,o){for(var s=o,a,u,h=0;h<n.length;++h)a=n.charCodeAt(h),a<128?i[o++]=a:a<2048?(i[o++]=a>>6|192,i[o++]=a&63|128):(a&64512)===55296&&((u=n.charCodeAt(h+1))&64512)===56320?(a=65536+((a&1023)<<10)+(u&1023),++h,i[o++]=a>>18|240,i[o++]=a>>12&63|128,i[o++]=a>>6&63|128,i[o++]=a&63|128):(i[o++]=a>>12|224,i[o++]=a>>6&63|128,i[o++]=a&63|128);return o-s}}}),require_pool=__commonJS({"node_modules/@protobufjs/pool/index.js"(r,t){t.exports=e;function e(n,i,o){var s=o||8192,a=s>>>1,u=null,h=s;return function(g){if(g<1||g>a)return n(g);h+g>s&&(u=n(s),h=0);var b=i.call(u,h,h+=g);return h&7&&(h=(h|7)+1),b}}}}),require_longbits=__commonJS({"node_modules/protobufjs/src/util/longbits.js"(r,t){t.exports=n;var e=require_minimal();function n(a,u){this.lo=a>>>0,this.hi=u>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(u){if(u===0)return i;var h=u<0;h&&(u=-u);var f=u>>>0,g=(u-f)/4294967296>>>0;return h&&(g=~g>>>0,f=~f>>>0,++f>4294967295&&(f=0,++g>4294967295&&(g=0))),new n(f,g)},n.from=function(u){if(typeof u=="number")return n.fromNumber(u);if(e.isString(u))if(e.Long)u=e.Long.fromString(u);else return n.fromNumber(parseInt(u,10));return u.low||u.high?new n(u.low>>>0,u.high>>>0):i},n.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var h=~this.lo+1>>>0,f=~this.hi>>>0;return h||(f=f+1>>>0),-(h+f*4294967296)}return this.lo+this.hi*4294967296},n.prototype.toLong=function(u){return e.Long?new e.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var s=String.prototype.charCodeAt;n.fromHash=function(u){return u===o?i:new n((s.call(u,0)|s.call(u,1)<<8|s.call(u,2)<<16|s.call(u,3)<<24)>>>0,(s.call(u,4)|s.call(u,5)<<8|s.call(u,6)<<16|s.call(u,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},n.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},n.prototype.length=function(){var u=this.lo,h=(this.lo>>>28|this.hi<<4)>>>0,f=this.hi>>>24;return f===0?h===0?u<16384?u<128?1:2:u<2097152?3:4:h<16384?h<128?5:6:h<2097152?7:8:f<128?9:10}}}),require_minimal=__commonJS({"node_modules/protobufjs/src/util/minimal.js"(r){var t=r;t.asPromise=require_aspromise(),t.base64=require_base64(),t.EventEmitter=require_eventemitter(),t.float=require_float(),t.inquire=require_inquire(),t.utf8=require_utf8(),t.pool=require_pool(),t.LongBits=require_longbits(),t.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||r,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},t.isString=function(o){return typeof o=="string"||o instanceof String},t.isObject=function(o){return o&&typeof o=="object"},t.isset=t.isSet=function(o,s){var a=o[s];return a!=null&&o.hasOwnProperty(s)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1},t.Buffer=(function(){try{var i=t.inquire("buffer").Buffer;return i.prototype.utf8Write?i:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(o){return typeof o=="number"?t.Buffer?t._Buffer_allocUnsafe(o):new t.Array(o):t.Buffer?t._Buffer_from(o):typeof Uint8Array>"u"?o:new Uint8Array(o)},t.Array=typeof Uint8Array<"u"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(o){return o?t.LongBits.from(o).toHash():t.LongBits.zeroHash},t.longFromHash=function(o,s){var a=t.LongBits.fromHash(o);return t.Long?t.Long.fromBits(a.lo,a.hi,s):a.toNumber(!!s)};function e(i,o,s){for(var a=Object.keys(o),u=0;u<a.length;++u)(i[a[u]]===void 0||!s)&&(i[a[u]]=o[a[u]]);return i}t.merge=e,t.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)};function n(i){function o(s,a){if(!(this instanceof o))return new o(s,a);Object.defineProperty(this,"message",{get:function(){return s}}),Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:new Error().stack||""}),a&&e(this,a)}return o.prototype=Object.create(Error.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return i},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),o}t.newError=n,t.ProtocolError=n("ProtocolError"),t.oneOfGetter=function(o){for(var s={},a=0;a<o.length;++a)s[o[a]]=1;return function(){for(var u=Object.keys(this),h=u.length-1;h>-1;--h)if(s[u[h]]===1&&this[u[h]]!==void 0&&this[u[h]]!==null)return u[h]}},t.oneOfSetter=function(o){return function(s){for(var a=0;a<o.length;++a)o[a]!==s&&delete this[o[a]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var i=t.Buffer;if(!i){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=i.from!==Uint8Array.from&&i.from||function(s,a){return new i(s,a)},t._Buffer_allocUnsafe=i.allocUnsafe||function(s){return new i(s)}}}}),require_reader=__commonJS({"node_modules/protobufjs/src/reader.js"(r,t){t.exports=a;var e=require_minimal(),n,i=e.LongBits,o=e.utf8;function s(y,l){return RangeError("index out of range: "+y.pos+" + "+(l||1)+" > "+y.len)}function a(y){this.buf=y,this.pos=0,this.len=y.length}var u=typeof Uint8Array<"u"?function(l){if(l instanceof Uint8Array||Array.isArray(l))return new a(l);throw Error("illegal buffer")}:function(l){if(Array.isArray(l))return new a(l);throw Error("illegal buffer")},h=function(){return e.Buffer?function(c){return(a.create=function(w){return e.Buffer.isBuffer(w)?new n(w):u(w)})(c)}:u};a.create=h(),a.prototype._slice=e.Array.prototype.subarray||e.Array.prototype.slice,a.prototype.uint32=(function(){var l=4294967295;return function(){if(l=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(l=(l|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(l=(l|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(l=(l|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(l=(l|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return l;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return l}})(),a.prototype.int32=function(){return this.uint32()|0},a.prototype.sint32=function(){var l=this.uint32();return l>>>1^-(l&1)|0};function f(){var y=new i(0,0),l=0;if(this.len-this.pos>4){for(;l<4;++l)if(y.lo=(y.lo|(this.buf[this.pos]&127)<<l*7)>>>0,this.buf[this.pos++]<128)return y;if(y.lo=(y.lo|(this.buf[this.pos]&127)<<28)>>>0,y.hi=(y.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return y;l=0}else{for(;l<3;++l){if(this.pos>=this.len)throw s(this);if(y.lo=(y.lo|(this.buf[this.pos]&127)<<l*7)>>>0,this.buf[this.pos++]<128)return y}return y.lo=(y.lo|(this.buf[this.pos++]&127)<<l*7)>>>0,y}if(this.len-this.pos>4){for(;l<5;++l)if(y.hi=(y.hi|(this.buf[this.pos]&127)<<l*7+3)>>>0,this.buf[this.pos++]<128)return y}else for(;l<5;++l){if(this.pos>=this.len)throw s(this);if(y.hi=(y.hi|(this.buf[this.pos]&127)<<l*7+3)>>>0,this.buf[this.pos++]<128)return y}throw Error("invalid varint encoding")}a.prototype.bool=function(){return this.uint32()!==0};function g(y,l){return(y[l-4]|y[l-3]<<8|y[l-2]<<16|y[l-1]<<24)>>>0}a.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return g(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return g(this.buf,this.pos+=4)|0};function b(){if(this.pos+8>this.len)throw s(this,8);return new i(g(this.buf,this.pos+=4),g(this.buf,this.pos+=4))}a.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var l=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,l},a.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var l=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,l},a.prototype.bytes=function(){var l=this.uint32(),c=this.pos,d=this.pos+l;if(d>this.len)throw s(this,l);return this.pos+=l,Array.isArray(this.buf)?this.buf.slice(c,d):c===d?new this.buf.constructor(0):this._slice.call(this.buf,c,d)},a.prototype.string=function(){var l=this.bytes();return o.read(l,0,l.length)},a.prototype.skip=function(l){if(typeof l=="number"){if(this.pos+l>this.len)throw s(this,l);this.pos+=l}else do if(this.pos>=this.len)throw s(this);while(this.buf[this.pos++]&128);return this},a.prototype.skipType=function(y){switch(y){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(y=this.uint32()&7)!==4;)this.skipType(y);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+y+" at offset "+this.pos)}return this},a._configure=function(y){n=y,a.create=h(),n._configure();var l=e.Long?"toLong":"toNumber";e.merge(a.prototype,{int64:function(){return f.call(this)[l](!1)},uint64:function(){return f.call(this)[l](!0)},sint64:function(){return f.call(this).zzDecode()[l](!1)},fixed64:function(){return b.call(this)[l](!0)},sfixed64:function(){return b.call(this)[l](!1)}})}}}),require_reader_buffer=__commonJS({"node_modules/protobufjs/src/reader_buffer.js"(r,t){t.exports=i;var e=require_reader();(i.prototype=Object.create(e.prototype)).constructor=i;var n=require_minimal();function i(o){e.call(this,o)}i._configure=function(){n.Buffer&&(i.prototype._slice=n.Buffer.prototype.slice)},i.prototype.string=function(){var s=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+s,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+s,this.len))},i._configure()}}),require_writer=__commonJS({"node_modules/protobufjs/src/writer.js"(r,t){t.exports=f;var e=require_minimal(),n,i=e.LongBits,o=e.base64,s=e.utf8;function a(v,p,m){this.fn=v,this.len=p,this.next=void 0,this.val=m}function u(){}function h(v){this.head=v.head,this.tail=v.tail,this.len=v.len,this.next=v.states}function f(){this.len=0,this.head=new a(u,0,0),this.tail=this.head,this.states=null}var g=function(){return e.Buffer?function(){return(f.create=function(){return new n})()}:function(){return new f}};f.create=g(),f.alloc=function(p){return new e.Array(p)},e.Array!==Array&&(f.alloc=e.pool(f.alloc,e.Array.prototype.subarray)),f.prototype._push=function(p,m,_){return this.tail=this.tail.next=new a(p,m,_),this.len+=m,this};function b(v,p,m){p[m]=v&255}function y(v,p,m){for(;v>127;)p[m++]=v&127|128,v>>>=7;p[m]=v}function l(v,p){this.len=v,this.next=void 0,this.val=p}l.prototype=Object.create(a.prototype),l.prototype.fn=y,f.prototype.uint32=function(p){return this.len+=(this.tail=this.tail.next=new l((p=p>>>0)<128?1:p<16384?2:p<2097152?3:p<268435456?4:5,p)).len,this},f.prototype.int32=function(p){return p<0?this._push(c,10,i.fromNumber(p)):this.uint32(p)},f.prototype.sint32=function(p){return this.uint32((p<<1^p>>31)>>>0)};function c(v,p,m){for(;v.hi;)p[m++]=v.lo&127|128,v.lo=(v.lo>>>7|v.hi<<25)>>>0,v.hi>>>=7;for(;v.lo>127;)p[m++]=v.lo&127|128,v.lo=v.lo>>>7;p[m++]=v.lo}f.prototype.uint64=function(p){var m=i.from(p);return this._push(c,m.length(),m)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(p){var m=i.from(p).zzEncode();return this._push(c,m.length(),m)},f.prototype.bool=function(p){return this._push(b,1,p?1:0)};function d(v,p,m){p[m]=v&255,p[m+1]=v>>>8&255,p[m+2]=v>>>16&255,p[m+3]=v>>>24}f.prototype.fixed32=function(p){return this._push(d,4,p>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(p){var m=i.from(p);return this._push(d,4,m.lo)._push(d,4,m.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(p){return this._push(e.float.writeFloatLE,4,p)},f.prototype.double=function(p){return this._push(e.float.writeDoubleLE,8,p)};var w=e.Array.prototype.set?function(p,m,_){m.set(p,_)}:function(p,m,_){for(var A=0;A<p.length;++A)m[_+A]=p[A]};f.prototype.bytes=function(p){var m=p.length>>>0;if(!m)return this._push(b,1,0);if(e.isString(p)){var _=f.alloc(m=o.length(p));o.decode(p,_,0),p=_}return this.uint32(m)._push(w,m,p)},f.prototype.string=function(p){var m=s.length(p);return m?this.uint32(m)._push(s.write,m,p):this._push(b,1,0)},f.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new a(u,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new a(u,0,0),this.len=0),this},f.prototype.ldelim=function(){var p=this.head,m=this.tail,_=this.len;return this.reset().uint32(_),_&&(this.tail.next=p.next,this.tail=m,this.len+=_),this},f.prototype.finish=function(){for(var p=this.head.next,m=this.constructor.alloc(this.len),_=0;p;)p.fn(p.val,m,_),_+=p.len,p=p.next;return m},f._configure=function(v){n=v,f.create=g(),n._configure()}}}),require_writer_buffer=__commonJS({"node_modules/protobufjs/src/writer_buffer.js"(r,t){t.exports=i;var e=require_writer();(i.prototype=Object.create(e.prototype)).constructor=i;var n=require_minimal();function i(){e.call(this)}i._configure=function(){i.alloc=n._Buffer_allocUnsafe,i.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&n.Buffer.prototype.set.name==="set"?function(a,u,h){u.set(a,h)}:function(a,u,h){if(a.copy)a.copy(u,h,0,a.length);else for(var f=0;f<a.length;)u[h++]=a[f++]}},i.prototype.bytes=function(a){n.isString(a)&&(a=n._Buffer_from(a,"base64"));var u=a.length>>>0;return this.uint32(u),u&&this._push(i.writeBytesBuffer,u,a),this};function o(s,a,u){s.length<40?n.utf8.write(s,a,u):a.utf8Write?a.utf8Write(s,u):a.write(s,u)}i.prototype.string=function(a){var u=n.Buffer.byteLength(a);return this.uint32(u),u&&this._push(o,u,a),this},i._configure()}}),require_murmurHash3js=__commonJS({"node_modules/murmurhash3js-revisited/lib/murmurHash3js.js"(r,t){(function(e,n){var i={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function o(c){if(!Array.isArray(c)&&!ArrayBuffer.isView(c))return!1;for(var d=0;d<c.length;d++)if(!Number.isInteger(c[d])||c[d]<0||c[d]>255)return!1;return!0}function s(c,d){return(c&65535)*d+(((c>>>16)*d&65535)<<16)}function a(c,d){return c<<d|c>>>32-d}function u(c){return c^=c>>>16,c=s(c,2246822507),c^=c>>>13,c=s(c,3266489909),c^=c>>>16,c}function h(c,d){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535];var w=[0,0,0,0];return w[3]+=c[3]+d[3],w[2]+=w[3]>>>16,w[3]&=65535,w[2]+=c[2]+d[2],w[1]+=w[2]>>>16,w[2]&=65535,w[1]+=c[1]+d[1],w[0]+=w[1]>>>16,w[1]&=65535,w[0]+=c[0]+d[0],w[0]&=65535,[w[0]<<16|w[1],w[2]<<16|w[3]]}function f(c,d){c=[c[0]>>>16,c[0]&65535,c[1]>>>16,c[1]&65535],d=[d[0]>>>16,d[0]&65535,d[1]>>>16,d[1]&65535];var w=[0,0,0,0];return w[3]+=c[3]*d[3],w[2]+=w[3]>>>16,w[3]&=65535,w[2]+=c[2]*d[3],w[1]+=w[2]>>>16,w[2]&=65535,w[2]+=c[3]*d[2],w[1]+=w[2]>>>16,w[2]&=65535,w[1]+=c[1]*d[3],w[0]+=w[1]>>>16,w[1]&=65535,w[1]+=c[2]*d[2],w[0]+=w[1]>>>16,w[1]&=65535,w[1]+=c[3]*d[1],w[0]+=w[1]>>>16,w[1]&=65535,w[0]+=c[0]*d[3]+c[1]*d[2]+c[2]*d[1]+c[3]*d[0],w[0]&=65535,[w[0]<<16|w[1],w[2]<<16|w[3]]}function g(c,d){return d%=64,d===32?[c[1],c[0]]:d<32?[c[0]<<d|c[1]>>>32-d,c[1]<<d|c[0]>>>32-d]:(d-=32,[c[1]<<d|c[0]>>>32-d,c[0]<<d|c[1]>>>32-d])}function b(c,d){return d%=64,d===0?c:d<32?[c[0]<<d|c[1]>>>32-d,c[1]<<d]:[c[1]<<d-32,0]}function y(c,d){return[c[0]^d[0],c[1]^d[1]]}function l(c){return c=y(c,[0,c[0]>>>1]),c=f(c,[4283543511,3981806797]),c=y(c,[0,c[0]>>>1]),c=f(c,[3301882366,444984403]),c=y(c,[0,c[0]>>>1]),c}i.x86.hash32=function(c,d){if(i.inputValidation&&!o(c))return n;d=d||0;for(var w=c.length%4,v=c.length-w,p=d,m=0,_=3432918353,A=461845907,E=0;E<v;E=E+4)m=c[E]|c[E+1]<<8|c[E+2]<<16|c[E+3]<<24,m=s(m,_),m=a(m,15),m=s(m,A),p^=m,p=a(p,13),p=s(p,5)+3864292196;switch(m=0,w){case 3:m^=c[E+2]<<16;case 2:m^=c[E+1]<<8;case 1:m^=c[E],m=s(m,_),m=a(m,15),m=s(m,A),p^=m}return p^=c.length,p=u(p),p>>>0},i.x86.hash128=function(c,d){if(i.inputValidation&&!o(c))return n;d=d||0;for(var w=c.length%16,v=c.length-w,p=d,m=d,_=d,A=d,E=0,S=0,x=0,F=0,T=597399067,N=2869860233,U=951274213,z=2716044179,B=0;B<v;B=B+16)E=c[B]|c[B+1]<<8|c[B+2]<<16|c[B+3]<<24,S=c[B+4]|c[B+5]<<8|c[B+6]<<16|c[B+7]<<24,x=c[B+8]|c[B+9]<<8|c[B+10]<<16|c[B+11]<<24,F=c[B+12]|c[B+13]<<8|c[B+14]<<16|c[B+15]<<24,E=s(E,T),E=a(E,15),E=s(E,N),p^=E,p=a(p,19),p+=m,p=s(p,5)+1444728091,S=s(S,N),S=a(S,16),S=s(S,U),m^=S,m=a(m,17),m+=_,m=s(m,5)+197830471,x=s(x,U),x=a(x,17),x=s(x,z),_^=x,_=a(_,15),_+=A,_=s(_,5)+2530024501,F=s(F,z),F=a(F,18),F=s(F,T),A^=F,A=a(A,13),A+=p,A=s(A,5)+850148119;switch(E=0,S=0,x=0,F=0,w){case 15:F^=c[B+14]<<16;case 14:F^=c[B+13]<<8;case 13:F^=c[B+12],F=s(F,z),F=a(F,18),F=s(F,T),A^=F;case 12:x^=c[B+11]<<24;case 11:x^=c[B+10]<<16;case 10:x^=c[B+9]<<8;case 9:x^=c[B+8],x=s(x,U),x=a(x,17),x=s(x,z),_^=x;case 8:S^=c[B+7]<<24;case 7:S^=c[B+6]<<16;case 6:S^=c[B+5]<<8;case 5:S^=c[B+4],S=s(S,N),S=a(S,16),S=s(S,U),m^=S;case 4:E^=c[B+3]<<24;case 3:E^=c[B+2]<<16;case 2:E^=c[B+1]<<8;case 1:E^=c[B],E=s(E,T),E=a(E,15),E=s(E,N),p^=E}return p^=c.length,m^=c.length,_^=c.length,A^=c.length,p+=m,p+=_,p+=A,m+=p,_+=p,A+=p,p=u(p),m=u(m),_=u(_),A=u(A),p+=m,p+=_,p+=A,m+=p,_+=p,A+=p,("00000000"+(p>>>0).toString(16)).slice(-8)+("00000000"+(m>>>0).toString(16)).slice(-8)+("00000000"+(_>>>0).toString(16)).slice(-8)+("00000000"+(A>>>0).toString(16)).slice(-8)},i.x64.hash128=function(c,d){if(i.inputValidation&&!o(c))return n;d=d||0;for(var w=c.length%16,v=c.length-w,p=[0,d],m=[0,d],_=[0,0],A=[0,0],E=[2277735313,289559509],S=[1291169091,658871167],x=0;x<v;x=x+16)_=[c[x+4]|c[x+5]<<8|c[x+6]<<16|c[x+7]<<24,c[x]|c[x+1]<<8|c[x+2]<<16|c[x+3]<<24],A=[c[x+12]|c[x+13]<<8|c[x+14]<<16|c[x+15]<<24,c[x+8]|c[x+9]<<8|c[x+10]<<16|c[x+11]<<24],_=f(_,E),_=g(_,31),_=f(_,S),p=y(p,_),p=g(p,27),p=h(p,m),p=h(f(p,[0,5]),[0,1390208809]),A=f(A,S),A=g(A,33),A=f(A,E),m=y(m,A),m=g(m,31),m=h(m,p),m=h(f(m,[0,5]),[0,944331445]);switch(_=[0,0],A=[0,0],w){case 15:A=y(A,b([0,c[x+14]],48));case 14:A=y(A,b([0,c[x+13]],40));case 13:A=y(A,b([0,c[x+12]],32));case 12:A=y(A,b([0,c[x+11]],24));case 11:A=y(A,b([0,c[x+10]],16));case 10:A=y(A,b([0,c[x+9]],8));case 9:A=y(A,[0,c[x+8]]),A=f(A,S),A=g(A,33),A=f(A,E),m=y(m,A);case 8:_=y(_,b([0,c[x+7]],56));case 7:_=y(_,b([0,c[x+6]],48));case 6:_=y(_,b([0,c[x+5]],40));case 5:_=y(_,b([0,c[x+4]],32));case 4:_=y(_,b([0,c[x+3]],24));case 3:_=y(_,b([0,c[x+2]],16));case 2:_=y(_,b([0,c[x+1]],8));case 1:_=y(_,[0,c[x]]),_=f(_,E),_=g(_,31),_=f(_,S),p=y(p,_)}return p=y(p,[0,c.length]),m=y(m,[0,c.length]),p=h(p,m),m=h(m,p),p=l(p),m=l(m),p=h(p,m),m=h(m,p),("00000000"+(p[0]>>>0).toString(16)).slice(-8)+("00000000"+(p[1]>>>0).toString(16)).slice(-8)+("00000000"+(m[0]>>>0).toString(16)).slice(-8)+("00000000"+(m[1]>>>0).toString(16)).slice(-8)},typeof r<"u"?(typeof t<"u"&&t.exports&&(r=t.exports=i),r.murmurHash3=i):(i._murmurHash3=e.murmurHash3,i.noConflict=function(){return e.murmurHash3=i._murmurHash3,i._murmurHash3=n,i.noConflict=n,i},e.murmurHash3=i)})(r)}}),require_murmurhash3js_revisited=__commonJS({"node_modules/murmurhash3js-revisited/index.js"(r,t){t.exports=require_murmurHash3js()}}),require_sparse_array=__commonJS({"node_modules/sparse-array/index.js"(r,t){var e=7;t.exports=class{constructor(){this._bitArrays=[],this._data=[],this._length=0,this._changedLength=!1,this._changedData=!1}set(u,h){let f=this._internalPositionFor(u,!1);if(h===void 0)f!==-1&&(this._unsetInternalPos(f),this._unsetBit(u),this._changedLength=!0,this._changedData=!0);else{let g=!1;f===-1?(f=this._data.length,this._setBit(u),this._changedData=!0):g=!0,this._setInternalPos(f,u,h,g),this._changedLength=!0}}unset(u){this.set(u,void 0)}get(u){this._sortData();const h=this._internalPositionFor(u,!0);if(h!==-1)return this._data[h][1]}push(u){return this.set(this.length,u),this.length}get length(){if(this._sortData(),this._changedLength){const u=this._data[this._data.length-1];this._length=u?u[0]+1:0,this._changedLength=!1}return this._length}forEach(u){let h=0;for(;h<this.length;)u(this.get(h),h,this),h++}map(u){let h=0,f=new Array(this.length);for(;h<this.length;)f[h]=u(this.get(h),h,this),h++;return f}reduce(u,h){let f=0,g=h;for(;f<this.length;){const b=this.get(f);g=u(g,b,f),f++}return g}find(u){let h=0,f,g;for(;h<this.length&&!f;)g=this.get(h),f=u(g),h++;return f?g:void 0}_internalPositionFor(u,h){const f=this._bytePosFor(u,h);if(f>=this._bitArrays.length)return-1;const g=this._bitArrays[f],b=u-f*e;if(!((g&1<<b)>0))return-1;const l=this._bitArrays.slice(0,f).reduce(n,0),c=~(4294967295<<b+1),d=i(g&c);return l+d-1}_bytePosFor(u,h){const f=Math.floor(u/e),g=f+1;for(;!h&&this._bitArrays.length<g;)this._bitArrays.push(0);return f}_setBit(u){const h=this._bytePosFor(u,!1);this._bitArrays[h]|=1<<u-h*e}_unsetBit(u){const h=this._bytePosFor(u,!1);this._bitArrays[h]&=~(1<<u-h*e)}_setInternalPos(u,h,f,g){const b=this._data,y=[h,f];if(g)this._sortData(),b[u]=y;else{if(b.length)if(b[b.length-1][0]>=h)b.push(y);else if(b[0][0]<=h)b.unshift(y);else{const l=Math.round(b.length/2);this._data=b.slice(0,l).concat(y).concat(b.slice(l))}else this._data.push(y);this._changedData=!0,this._changedLength=!0}}_unsetInternalPos(u){this._data.splice(u,1)}_sortData(){this._changedData&&this._data.sort(o),this._changedData=!1}bitField(){const u=[];let h=8,f=0,g=0,b;const y=this._bitArrays.slice();for(;y.length||f;){f===0&&(b=y.shift(),f=7);const c=Math.min(f,h),d=~(255<<c),w=b&d;g|=w<<8-h,b=b>>>c,f-=c,h-=c,(!h||!f&&!y.length)&&(u.push(g),g=0,h=8)}for(var l=u.length-1;l>0&&u[l]===0;l--)u.pop();return u}compactArray(){return this._sortData(),this._data.map(s)}};function n(a,u){return a+i(u)}function i(a){let u=a;return u=u-(u>>1&1431655765),u=(u&858993459)+(u>>2&858993459),(u+(u>>4)&252645135)*16843009>>24}function o(a,u){return a[0]-u[0]}function s(a){return a[1]}}}),src_exports2={};__export(src_exports2,{calculateMultipleHashesADR32:()=>calculateMultipleHashesADR32,calculateMultipleHashesADR32LegacyQmHash:()=>calculateMultipleHashesADR32LegacyQmHash,compareStrings:()=>compareStrings,hashV0:()=>hashV0,hashV1:()=>hashV1,keccak256Hash:()=>keccak256Hash,prepareADR32Data:()=>prepareADR32Data,sortKeys:()=>sortKeys}),module.exports=__toCommonJS(src_exports2);var import_crypto3=__toESM(requireCryptoBrowserify()),bytes_exports={};__export(bytes_exports,{coerce:()=>coerce,empty:()=>empty,equals:()=>equals,fromHex:()=>fromHex,fromString:()=>fromString,isBinary:()=>isBinary,toHex:()=>toHex,toString:()=>toString});var empty=new Uint8Array(0),toHex=r=>r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),""),fromHex=r=>{const t=r.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):empty},equals=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},coerce=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},isBinary=r=>r instanceof ArrayBuffer||ArrayBuffer.isView(r),fromString=r=>new TextEncoder().encode(r),toString=r=>new TextDecoder().decode(r),encode_1=encode,MSB=128,MSBALL=-128,INT=Math.pow(2,31);function encode(r,t,e){t=t||[],e=e||0;for(var n=e;r>=INT;)t[e++]=r&255|MSB,r/=128;for(;r&MSBALL;)t[e++]=r&255|MSB,r>>>=7;return t[e]=r|0,encode.bytes=e-n+1,t}var decode=read,MSB$1=128,REST$1=127;function read(r,n){var e=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw read.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&REST$1)<<i:(s&REST$1)*Math.pow(2,i),i+=7}while(s>=MSB$1);return read.bytes=o-n,e}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(r){return r<N1?1:r<N2?2:r<N3?3:r<N4?4:r<N5?5:r<N6?6:r<N7?7:r<N8?8:r<N9?9:10},varint={encode:encode_1,decode,encodingLength:length},_brrp_varint=varint,varint_default=_brrp_varint,decode2=(r,t=0)=>[varint_default.decode(r,t),varint_default.decode.bytes],encodeTo=(r,t,e=0)=>(varint_default.encode(r,t,e),t),encodingLength=r=>varint_default.encodingLength(r),create=(r,t)=>{const e=t.byteLength,n=encodingLength(r),i=n+encodingLength(e),o=new Uint8Array(i+e);return encodeTo(r,o,0),encodeTo(e,o,n),o.set(t,i),new Digest(r,e,t,o)},decode3=r=>{const t=coerce(r),[e,n]=decode2(t),[i,o]=decode2(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Digest(e,i,s,t)},equals2=(r,t)=>{if(r===t)return!0;{const e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&equals(r.bytes,e.bytes)}},Digest=class{constructor(r,t,e,n){this.code=r,this.size=t,this.digest=e,this.bytes=n}};function base(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var a=r.length,u=r.charAt(0),h=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function g(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var c=0,d=0,w=0,v=l.length;w!==v&&l[w]===0;)w++,c++;for(var p=(v-w)*f+1>>>0,m=new Uint8Array(p);w!==v;){for(var _=l[w],A=0,E=p-1;(_!==0||A<d)&&E!==-1;E--,A++)_+=256*m[E]>>>0,m[E]=_%a>>>0,_=_/a>>>0;if(_!==0)throw new Error("Non-zero carry");d=A,w++}for(var S=p-d;S!==p&&m[S]===0;)S++;for(var x=u.repeat(c);S<p;++S)x+=r.charAt(m[S]);return x}function b(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var c=0;if(l[c]!==" "){for(var d=0,w=0;l[c]===u;)d++,c++;for(var v=(l.length-c)*h+1>>>0,p=new Uint8Array(v);l[c];){var m=e[l.charCodeAt(c)];if(m===255)return;for(var _=0,A=v-1;(m!==0||_<w)&&A!==-1;A--,_++)m+=a*p[A]>>>0,p[A]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");w=_,c++}if(l[c]!==" "){for(var E=v-w;E!==v&&p[E]===0;)E++;for(var S=new Uint8Array(d+(v-E)),x=d;E!==v;)S[x++]=p[E++];return S}}}function y(l){var c=b(l);if(c)return c;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:b,decode:y}}var src=base,_brrp__multiformats_scope_baseX=src,base_x_default=_brrp__multiformats_scope_baseX,Encoder=class{constructor(r,t,e){this.name=r,this.prefix=t,this.baseEncode=e}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Decoder=class{constructor(r,t,e){if(this.name=r,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=e}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return or(this,r)}},ComposedDecoder=class{constructor(r){this.decoders=r}or(r){return or(this,r)}decode(r){const t=r[0],e=this.decoders[t];if(e)return e.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or=(r,t)=>new ComposedDecoder({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Codec=class{constructor(r,t,e,n){this.name=r,this.prefix=t,this.baseEncode=e,this.baseDecode=n,this.encoder=new Encoder(r,t,e),this.decoder=new Decoder(r,t,n)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},from=({name:r,prefix:t,encode:e,decode:n})=>new Codec(r,t,e,n),baseX=({prefix:r,name:t,alphabet:e})=>{const{encode:n,decode:i}=base_x_default(e,t);return from({prefix:r,name:t,encode:n,decode:o=>coerce(i(o))})},decode4=(r,t,e,n)=>{const i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;const s=new Uint8Array(o*e/8|0);let a=0,u=0,h=0;for(let f=0;f<o;++f){const g=i[r[f]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<e|g,a+=e,a>=8&&(a-=8,s[h++]=255&u>>a)}if(a>=e||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},encode2=(r,t,e)=>{const n=t[t.length-1]==="=",i=(1<<e)-1;let o="",s=0,a=0;for(let u=0;u<r.length;++u)for(a=a<<8|r[u],s+=8;s>e;)s-=e,o+=t[i&a>>s];if(s&&(o+=t[i&a<<e-s]),n)for(;o.length*e&7;)o+="=";return o},rfc4648=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>from({prefix:t,name:r,encode(i){return encode2(i,n,e)},decode(i){return decode4(i,n,e,r)}}),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format=(r,t)=>{const{bytes:e,version:n}=r;switch(n){case 0:return toStringV0(e,baseCache(r),t||base58btc.encoder);default:return toStringV1(e,baseCache(r),t||base32.encoder)}},cache=new WeakMap,baseCache=r=>{const t=cache.get(r);if(t==null){const e=new Map;return cache.set(r,e),e}return t},CID=class C{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:t,multihash:e}=this;if(t!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return C.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:t,digest:e}=this.multihash,n=create(t,e);return C.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return C.equals(this,t)}static equals(t,e){const n=e;return n&&t.code===n.code&&t.version===n.version&&equals2(t.multihash,n.multihash)}toString(t){return format(this,t)}toJSON(){return{"/":format(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;const e=t;if(e instanceof C)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){const{version:n,code:i,multihash:o,bytes:s}=e;return new C(n,i,o,s||encodeCID(n,i,o.bytes))}else if(e[cidSymbol]===!0){const{version:n,multihash:i,code:o}=e,s=decode3(i);return C.create(n,o,s)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new C(t,e,n,n.bytes)}case 1:{const i=encodeCID(t,e,n.bytes);return new C(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return C.create(0,DAG_PB_CODE,t)}static createV1(t,e){return C.create(1,t,e)}static decode(t){const[e,n]=C.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){const e=C.inspectBytes(t),n=e.size-e.multihashSize,i=coerce(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");const o=i.subarray(e.multihashSize-e.digestSize),s=new Digest(e.multihashCode,e.digestSize,o,i);return[e.version===0?C.createV0(s):C.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0;const n=()=>{const[g,b]=decode2(t.subarray(e));return e+=b,g};let i=n(),o=DAG_PB_CODE;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);const s=e,a=n(),u=n(),h=e+u,f=h-s;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:f,size:h}}static parse(t,e){const[n,i]=parseCIDtoBytes(t,e),o=C.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(o).set(n,t),o}},parseCIDtoBytes=(r,t)=>{switch(r[0]){case"Q":{const e=t||base58btc;return[base58btc.prefix,e.decode(`${base58btc.prefix}${r}`)]}case base58btc.prefix:{const e=t||base58btc;return[base58btc.prefix,e.decode(r)]}case base32.prefix:{const e=t||base32;return[base32.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},toStringV0=(r,t,e)=>{const{prefix:n}=e;if(n!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);const i=t.get(n);if(i==null){const o=e.encode(r).slice(1);return t.set(n,o),o}else return i},toStringV1=(r,t,e)=>{const{prefix:n}=e,i=t.get(n);if(i==null){const o=e.encode(r);return t.set(n,o),o}else return i},DAG_PB_CODE=112,SHA_256_CODE=18,encodeCID=(r,t,e)=>{const n=encodingLength(r),i=n+encodingLength(t),o=new Uint8Array(i+e.byteLength);return encodeTo(r,o,0),encodeTo(t,o,n),o.set(e,i),o},cidSymbol=Symbol.for("@ipld/js-cid/CID");__toESM(require_err_code());function isAsyncIterable(r){return r[Symbol.asyncIterator]!=null}function batch(r,t=1){return t=Number(t),isAsyncIterable(r)?(async function*(){let e=[];if(t<1&&(t=1),t!==Math.round(t))throw new Error("Batch size must be an integer");for await(const n of r)for(e.push(n);e.length>=t;)yield e.slice(0,t),e=e.slice(t);for(;e.length>0;)yield e.slice(0,t),e=e.slice(t)})():(function*(){let e=[];if(t<1&&(t=1),t!==Math.round(t))throw new Error("Batch size must be an integer");for(const n of r)for(e.push(n);e.length>=t;)yield e.slice(0,t),e=e.slice(t);for(;e.length>0;)yield e.slice(0,t),e=e.slice(t)})()}var src_default=batch;async function*parallelBatch(r,t=1){for await(const e of src_default(r,t)){const n=e.map(async i=>i().then(o=>({ok:!0,value:o}),o=>({ok:!1,err:o})));for(let i=0;i<n.length;i++){const o=await n[i];if(o.ok)yield o.value;else throw o.err}}}function asUint8Array(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function alloc(r=0){var t;return((t=globalThis.Buffer)==null?void 0:t.alloc)!=null?asUint8Array(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function allocUnsafe(r=0){var t;return((t=globalThis.Buffer)==null?void 0:t.allocUnsafe)!=null?asUint8Array(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function concat(r,t){t==null&&(t=r.reduce((i,o)=>i+o.length,0));const e=allocUnsafe(t);let n=0;for(const i of r)e.set(i,n),n+=i.length;return asUint8Array(e)}function equals3(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var symbol=Symbol.for("@achingbrain/uint8arraylist");function findBufAndOffset(r,t){if(t==null||t<0)throw new RangeError("index is out of bounds");let e=0;for(const n of r){const i=e+n.byteLength;if(t<i)return{buf:n,index:t-e};e=i}throw new RangeError("index is out of bounds")}function isUint8ArrayList(r){return!!(r!=null&&r[symbol])}var Uint8ArrayList=class M{constructor(...t){Object.defineProperty(this,symbol,{value:!0}),this.bufs=[],this.length=0,t.length>0&&this.appendAll(t)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...t){this.appendAll(t)}appendAll(t){let e=0;for(const n of t)if(n instanceof Uint8Array)e+=n.byteLength,this.bufs.push(n);else if(isUint8ArrayList(n))e+=n.byteLength,this.bufs.push(...n.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=e}prepend(...t){this.prependAll(t)}prependAll(t){let e=0;for(const n of t.reverse())if(n instanceof Uint8Array)e+=n.byteLength,this.bufs.unshift(n);else if(isUint8ArrayList(n))e+=n.byteLength,this.bufs.unshift(...n.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=e}get(t){const e=findBufAndOffset(this.bufs,t);return e.buf[e.index]}set(t,e){const n=findBufAndOffset(this.bufs,t);n.buf[n.index]=e}write(t,e=0){if(t instanceof Uint8Array)for(let n=0;n<t.length;n++)this.set(e+n,t[n]);else if(isUint8ArrayList(t))for(let n=0;n<t.length;n++)this.set(e+n,t.get(n));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(t){if(t=Math.trunc(t),!(Number.isNaN(t)||t<=0)){if(t===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(t>=this.bufs[0].byteLength)t-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(t),this.length-=t;break}}}slice(t,e){const{bufs:n,length:i}=this._subList(t,e);return concat(n,i)}subarray(t,e){const{bufs:n,length:i}=this._subList(t,e);return n.length===1?n[0]:concat(n,i)}sublist(t,e){const{bufs:n,length:i}=this._subList(t,e),o=new M;return o.length=i,o.bufs=n,o}_subList(t,e){if(t=t??0,e=e??this.length,t<0&&(t=this.length+t),e<0&&(e=this.length+e),t<0||e>this.length)throw new RangeError("index is out of bounds");if(t===e)return{bufs:[],length:0};if(t===0&&e===this.length)return{bufs:[...this.bufs],length:this.length};const n=[];let i=0;for(let o=0;o<this.bufs.length;o++){const s=this.bufs[o],a=i,u=a+s.byteLength;if(i=u,t>=u)continue;const h=t>=a&&t<u,f=e>a&&e<=u;if(h&&f){if(t===a&&e===u){n.push(s);break}const g=t-a;n.push(s.subarray(g,g+(e-t)));break}if(h){if(t===0){n.push(s);continue}n.push(s.subarray(t-a));continue}if(f){if(e===u){n.push(s);break}n.push(s.subarray(0,e-a));break}n.push(s)}return{bufs:n,length:e-t}}indexOf(t,e=0){if(!isUint8ArrayList(t)&&!(t instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const n=t instanceof Uint8Array?t:t.subarray();if(e=Number(e??0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;const i=n.byteLength;if(i===0)throw new TypeError("search must be at least 1 byte long");const o=256,s=new Int32Array(o);for(let g=0;g<o;g++)s[g]=-1;for(let g=0;g<i;g++)s[n[g]]=g;const a=s,u=this.byteLength-n.byteLength,h=n.byteLength-1;let f;for(let g=e;g<=u;g+=f){f=0;for(let b=h;b>=0;b--){const y=this.get(g+b);if(n[b]!==y){f=Math.max(1,b-a[y]);break}}if(f===0)return g}return-1}getInt8(t){const e=this.subarray(t,t+1);return new DataView(e.buffer,e.byteOffset,e.byteLength).getInt8(0)}setInt8(t,e){const n=allocUnsafe(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt8(0,e),this.write(n,t)}getInt16(t,e){const n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt16(0,e)}setInt16(t,e,n){const i=alloc(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt16(0,e,n),this.write(i,t)}getInt32(t,e){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getInt32(0,e)}setInt32(t,e,n){const i=alloc(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setInt32(0,e,n),this.write(i,t)}getBigInt64(t,e){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigInt64(0,e)}setBigInt64(t,e,n){const i=alloc(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigInt64(0,e,n),this.write(i,t)}getUint8(t){const e=this.subarray(t,t+1);return new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0)}setUint8(t,e){const n=allocUnsafe(1);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint8(0,e),this.write(n,t)}getUint16(t,e){const n=this.subarray(t,t+2);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint16(0,e)}setUint16(t,e,n){const i=alloc(2);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint16(0,e,n),this.write(i,t)}getUint32(t,e){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getUint32(0,e)}setUint32(t,e,n){const i=alloc(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,e,n),this.write(i,t)}getBigUint64(t,e){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getBigUint64(0,e)}setBigUint64(t,e,n){const i=alloc(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setBigUint64(0,e,n),this.write(i,t)}getFloat32(t,e){const n=this.subarray(t,t+4);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat32(0,e)}setFloat32(t,e,n){const i=alloc(4);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(0,e,n),this.write(i,t)}getFloat64(t,e){const n=this.subarray(t,t+8);return new DataView(n.buffer,n.byteOffset,n.byteLength).getFloat64(0,e)}setFloat64(t,e,n){const i=alloc(8);new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(0,e,n),this.write(i,t)}equals(t){if(t==null||!(t instanceof M)||t.bufs.length!==this.bufs.length)return!1;for(let e=0;e<this.bufs.length;e++)if(!equals3(this.bufs[e],t.bufs[e]))return!1;return!0}static fromUint8Arrays(t,e){const n=new M;return n.bufs=t,e==null&&(e=t.reduce((i,o)=>i+o.byteLength,0)),n.length=e,n}},DEFAULT_CHUNK_SIZE=262144,fixedSize=(r={})=>{const t=r.chunkSize??DEFAULT_CHUNK_SIZE;return async function*(n){let i=new Uint8ArrayList,o=0,s=!1;for await(const a of n)for(i.append(a),o+=a.length;o>=t;)if(yield i.slice(0,t),s=!0,t===i.length)i=new Uint8ArrayList,o=0;else{const u=new Uint8ArrayList;u.append(i.sublist(t)),i=u,o-=t}(!s||o>0)&&(yield i.subarray(0,o))}},src_exports={};__export(src_exports,{code:()=>code,createLink:()=>createLink,createNode:()=>createNode,decode:()=>decode5,encode:()=>encode3,name:()=>name,prepare:()=>prepare,validate:()=>validate});var textDecoder=new TextDecoder;function decodeVarint(r,t){let e=0;for(let n=0;;n+=7){if(n>=64)throw new Error("protobuf: varint overflow");if(t>=r.length)throw new Error("protobuf: unexpected end of data");const i=r[t++];if(e+=n<28?(i&127)<<n:(i&127)*2**n,i<128)break}return[e,t]}function decodeBytes(r,t){let e;[e,t]=decodeVarint(r,t);const n=t+e;if(e<0||n<0)throw new Error("protobuf: invalid length");if(n>r.length)throw new Error("protobuf: unexpected end of data");return[r.subarray(t,n),n]}function decodeKey(r,t){let e;return[e,t]=decodeVarint(r,t),[e&7,e>>3,t]}function decodeLink(r){const t={},e=r.length;let n=0;for(;n<e;){let i,o;if([i,o,n]=decodeKey(r,n),o===1){if(t.Hash)throw new Error("protobuf: (PBLink) duplicate Hash section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Hash`);if(t.Name!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Name before Hash");if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Hash");[t.Hash,n]=decodeBytes(r,n)}else if(o===2){if(t.Name!==void 0)throw new Error("protobuf: (PBLink) duplicate Name section");if(i!==2)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Name`);if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) invalid order, found Tsize before Name");let s;[s,n]=decodeBytes(r,n),t.Name=textDecoder.decode(s)}else if(o===3){if(t.Tsize!==void 0)throw new Error("protobuf: (PBLink) duplicate Tsize section");if(i!==0)throw new Error(`protobuf: (PBLink) wrong wireType (${i}) for Tsize`);[t.Tsize,n]=decodeVarint(r,n)}else throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${o}`)}if(n>e)throw new Error("protobuf: (PBLink) unexpected end of data");return t}function decodeNode(r){const t=r.length;let e=0,n,i=!1,o;for(;e<t;){let a,u;if([a,u,e]=decodeKey(r,e),a!==2)throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${a}`);if(u===1){if(o)throw new Error("protobuf: (PBNode) duplicate Data section");[o,e]=decodeBytes(r,e),n&&(i=!0)}else if(u===2){if(i)throw new Error("protobuf: (PBNode) duplicate Links section");n||(n=[]);let h;[h,e]=decodeBytes(r,e),n.push(decodeLink(h))}else throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${u}`)}if(e>t)throw new Error("protobuf: (PBNode) unexpected end of data");const s={};return o&&(s.Data=o),s.Links=n||[],s}var textEncoder=new TextEncoder,maxInt32=2**32,maxUInt32=2**31;function encodeLink(r,t){let e=t.length;if(typeof r.Tsize=="number"){if(r.Tsize<0)throw new Error("Tsize cannot be negative");if(!Number.isSafeInteger(r.Tsize))throw new Error("Tsize too large for encoding");e=encodeVarint(t,e,r.Tsize)-1,t[e]=24}if(typeof r.Name=="string"){const n=textEncoder.encode(r.Name);e-=n.length,t.set(n,e),e=encodeVarint(t,e,n.length)-1,t[e]=18}return r.Hash&&(e-=r.Hash.length,t.set(r.Hash,e),e=encodeVarint(t,e,r.Hash.length)-1,t[e]=10),t.length-e}function encodeNode(r){const t=sizeNode(r),e=new Uint8Array(t);let n=t;if(r.Data&&(n-=r.Data.length,e.set(r.Data,n),n=encodeVarint(e,n,r.Data.length)-1,e[n]=10),r.Links)for(let i=r.Links.length-1;i>=0;i--){const o=encodeLink(r.Links[i],e.subarray(0,n));n-=o,n=encodeVarint(e,n,o)-1,e[n]=18}return e}function sizeLink(r){let t=0;if(r.Hash){const e=r.Hash.length;t+=1+e+sov(e)}if(typeof r.Name=="string"){const e=textEncoder.encode(r.Name).length;t+=1+e+sov(e)}return typeof r.Tsize=="number"&&(t+=1+sov(r.Tsize)),t}function sizeNode(r){let t=0;if(r.Data){const e=r.Data.length;t+=1+e+sov(e)}if(r.Links)for(const e of r.Links){const n=sizeLink(e);t+=1+n+sov(n)}return t}function encodeVarint(r,t,e){t-=sov(e);const n=t;for(;e>=maxUInt32;)r[t++]=e&127|128,e/=128;for(;e>=128;)r[t++]=e&127|128,e>>>=7;return r[t]=e,n}function sov(r){return r%2===0&&r++,Math.floor((len64(r)+6)/7)}function len64(r){let t=0;return r>=maxInt32&&(r=Math.floor(r/maxInt32),t=32),r>=65536&&(r>>>=16,t+=16),r>=256&&(r>>>=8,t+=8),t+len8tab[r]}var len8tab=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8],pbNodeProperties=["Data","Links"],pbLinkProperties=["Hash","Name","Tsize"],textEncoder2=new TextEncoder;function linkComparator(r,t){if(r===t)return 0;const e=r.Name?textEncoder2.encode(r.Name):[],n=t.Name?textEncoder2.encode(t.Name):[];let i=e.length,o=n.length;for(let s=0,a=Math.min(i,o);s<a;++s)if(e[s]!==n[s]){i=e[s],o=n[s];break}return i<o?-1:o<i?1:0}function hasOnlyProperties(r,t){return!Object.keys(r).some(e=>!t.includes(e))}function asLink(r){if(typeof r.asCID=="object"){const e=CID.asCID(r);if(!e)throw new TypeError("Invalid DAG-PB form");return{Hash:e}}if(typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");const t={};if(r.Hash){let e=CID.asCID(r.Hash);try{e||(typeof r.Hash=="string"?e=CID.parse(r.Hash):r.Hash instanceof Uint8Array&&(e=CID.decode(r.Hash)))}catch(n){throw new TypeError(`Invalid DAG-PB form: ${n.message}`)}e&&(t.Hash=e)}if(!t.Hash)throw new TypeError("Invalid DAG-PB form");return typeof r.Name=="string"&&(t.Name=r.Name),typeof r.Tsize=="number"&&(t.Tsize=r.Tsize),t}function prepare(r){if((r instanceof Uint8Array||typeof r=="string")&&(r={Data:r}),typeof r!="object"||Array.isArray(r))throw new TypeError("Invalid DAG-PB form");const t={};if(r.Data!==void 0)if(typeof r.Data=="string")t.Data=textEncoder2.encode(r.Data);else if(r.Data instanceof Uint8Array)t.Data=r.Data;else throw new TypeError("Invalid DAG-PB form");if(r.Links!==void 0)if(Array.isArray(r.Links))t.Links=r.Links.map(asLink),t.Links.sort(linkComparator);else throw new TypeError("Invalid DAG-PB form");else t.Links=[];return t}function validate(r){if(!r||typeof r!="object"||Array.isArray(r)||r instanceof Uint8Array||r["/"]&&r["/"]===r.bytes)throw new TypeError("Invalid DAG-PB form");if(!hasOnlyProperties(r,pbNodeProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties)");if(r.Data!==void 0&&!(r.Data instanceof Uint8Array))throw new TypeError("Invalid DAG-PB form (Data must be bytes)");if(!Array.isArray(r.Links))throw new TypeError("Invalid DAG-PB form (Links must be a list)");for(let t=0;t<r.Links.length;t++){const e=r.Links[t];if(!e||typeof e!="object"||Array.isArray(e)||e instanceof Uint8Array||e["/"]&&e["/"]===e.bytes)throw new TypeError("Invalid DAG-PB form (bad link)");if(!hasOnlyProperties(e,pbLinkProperties))throw new TypeError("Invalid DAG-PB form (extraneous properties on link)");if(e.Hash===void 0)throw new TypeError("Invalid DAG-PB form (link must have a Hash)");if(e.Hash==null||!e.Hash["/"]||e.Hash["/"]!==e.Hash.bytes)throw new TypeError("Invalid DAG-PB form (link Hash must be a CID)");if(e.Name!==void 0&&typeof e.Name!="string")throw new TypeError("Invalid DAG-PB form (link Name must be a string)");if(e.Tsize!==void 0){if(typeof e.Tsize!="number"||e.Tsize%1!==0)throw new TypeError("Invalid DAG-PB form (link Tsize must be an integer)");if(e.Tsize<0)throw new TypeError("Invalid DAG-PB form (link Tsize cannot be negative)")}if(t>0&&linkComparator(e,r.Links[t-1])===-1)throw new TypeError("Invalid DAG-PB form (links must be sorted by Name bytes)")}}function createNode(r,t=[]){return prepare({Data:r,Links:t})}function createLink(r,t,e){return asLink({Hash:e,Name:r,Tsize:t})}var name="dag-pb",code=112;function encode3(r){validate(r);const t={};return r.Links&&(t.Links=r.Links.map(e=>{const n={};return e.Hash&&(n.Hash=e.Hash.bytes),e.Name!==void 0&&(n.Name=e.Name),e.Tsize!==void 0&&(n.Tsize=e.Tsize),n})),r.Data&&(t.Data=r.Data),encodeNode(t)}function decode5(r){const t=decodeNode(r),e={};return t.Data&&(e.Data=t.Data),t.Links&&(e.Links=t.Links.map(n=>{const i={};try{i.Hash=CID.decode(n.Hash)}catch{}if(!i.Hash)throw new Error("Invalid Hash field found in link, expected CID");return n.Name!==void 0&&(i.Name=n.Name),n.Tsize!==void 0&&(i.Tsize=n.Tsize),i})),e}var import_err_code=__toESM(require_err_code()),import_reader=__toESM(require_reader()),import_reader_buffer=__toESM(require_reader_buffer()),import_minimal=__toESM(require_minimal()),import_writer=__toESM(require_writer()),import_writer_buffer=__toESM(require_writer_buffer());function configure(){import_minimal.default._configure(),import_reader.default._configure(import_reader_buffer.default),import_writer.default._configure(import_writer_buffer.default)}configure();var methods=["uint64","int64","sint64","fixed64","sfixed64"];function patchReader(r){for(const t of methods){if(r[t]==null)continue;const e=r[t];r[t]=function(){return BigInt(e.call(this).toString())}}return r}function reader(r){return patchReader(new import_reader.default(r))}function patchWriter(r){for(const t of methods){if(r[t]==null)continue;const e=r[t];r[t]=function(n){return e.call(this,n.toString())}}return r}function writer(){return patchWriter(import_writer.default.create())}function decodeMessage(r,t){const e=reader(r instanceof Uint8Array?r:r.subarray());return t.decode(e)}function encodeMessage(r,t){const e=writer();return t.encode(r,e,{lengthDelimited:!1}),e.finish()}var CODEC_TYPES;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec(r,t,e,n){return{name:r,type:t,encode:e,decode:n}}function enumeration(r){function t(i){if(r[i.toString()]==null)throw new Error("Invalid enum value");return r[i]}const e=function(o,s){const a=t(o);s.int32(a)},n=function(o){const s=o.int32();return t(s)};return createCodec("enum",CODEC_TYPES.VARINT,e,n)}function message(r,t){return createCodec("message",CODEC_TYPES.LENGTH_DELIMITED,r,t)}var Data;(function(r){(function(n){n.Raw="Raw",n.Directory="Directory",n.File="File",n.Metadata="Metadata",n.Symlink="Symlink",n.HAMTShard="HAMTShard"})(r.DataType||(r.DataType={}));let t;(function(n){n[n.Raw=0]="Raw",n[n.Directory=1]="Directory",n[n.File=2]="File",n[n.Metadata=3]="Metadata",n[n.Symlink=4]="Symlink",n[n.HAMTShard=5]="HAMTShard"})(t||(t={})),(function(n){n.codec=()=>enumeration(t)})(r.DataType||(r.DataType={}));let e;r.codec=()=>(e==null&&(e=message((n,i,o={})=>{if(o.lengthDelimited!==!1&&i.fork(),n.Type!=null&&(i.uint32(8),r.DataType.codec().encode(n.Type,i)),n.Data!=null&&(i.uint32(18),i.bytes(n.Data)),n.filesize!=null&&(i.uint32(24),i.uint64(n.filesize)),n.blocksizes!=null)for(const s of n.blocksizes)i.uint32(32),i.uint64(s);n.hashType!=null&&(i.uint32(40),i.uint64(n.hashType)),n.fanout!=null&&(i.uint32(48),i.uint64(n.fanout)),n.mode!=null&&(i.uint32(56),i.uint32(n.mode)),n.mtime!=null&&(i.uint32(66),UnixTime.codec().encode(n.mtime,i)),o.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{const o={blocksizes:[]},s=i==null?n.len:n.pos+i;for(;n.pos<s;){const a=n.uint32();switch(a>>>3){case 1:o.Type=r.DataType.codec().decode(n);break;case 2:o.Data=n.bytes();break;case 3:o.filesize=n.uint64();break;case 4:o.blocksizes.push(n.uint64());break;case 5:o.hashType=n.uint64();break;case 6:o.fanout=n.uint64();break;case 7:o.mode=n.uint32();break;case 8:o.mtime=UnixTime.codec().decode(n,n.uint32());break;default:n.skipType(a&7);break}}return o})),e),r.encode=n=>encodeMessage(n,r.codec()),r.decode=n=>decodeMessage(n,r.codec())})(Data||(Data={}));var UnixTime;(function(r){let t;r.codec=()=>(t==null&&(t=message((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.Seconds!=null&&(n.uint32(8),n.int64(e.Seconds)),e.FractionalNanoseconds!=null&&(n.uint32(21),n.fixed32(e.FractionalNanoseconds)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{const i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){const s=e.uint32();switch(s>>>3){case 1:i.Seconds=e.int64();break;case 2:i.FractionalNanoseconds=e.fixed32();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>encodeMessage(e,r.codec()),r.decode=e=>decodeMessage(e,r.codec())})(UnixTime||(UnixTime={}));var Metadata;(function(r){let t;r.codec=()=>(t==null&&(t=message((e,n,i={})=>{i.lengthDelimited!==!1&&n.fork(),e.MimeType!=null&&(n.uint32(10),n.string(e.MimeType)),i.lengthDelimited!==!1&&n.ldelim()},(e,n)=>{const i={},o=n==null?e.len:e.pos+n;for(;e.pos<o;){const s=e.uint32();switch(s>>>3){case 1:i.MimeType=e.string();break;default:e.skipType(s&7);break}}return i})),t),r.encode=e=>encodeMessage(e,r.codec()),r.decode=e=>decodeMessage(e,r.codec())})(Metadata||(Metadata={}));var types={Raw:"raw",Directory:"directory",File:"file",Metadata:"metadata",Symlink:"symlink",HAMTShard:"hamt-sharded-directory"},dirTypes=["directory","hamt-sharded-directory"],DEFAULT_FILE_MODE=parseInt("0644",8),DEFAULT_DIRECTORY_MODE=parseInt("0755",8),UnixFS=class P{constructor(t={type:"file"}){D(this,"type");D(this,"data");D(this,"blockSizes");D(this,"hashType");D(this,"fanout");D(this,"mtime");D(this,"_mode");D(this,"_originalMode");const{type:e,data:n,blockSizes:i,hashType:o,fanout:s,mtime:a,mode:u}=t;if(e!=null&&!Object.values(types).includes(e))throw(0,import_err_code.default)(new Error("Type: "+e+" is not valid"),"ERR_INVALID_TYPE");this.type=e??"file",this.data=n,this.hashType=o,this.fanout=s,this.blockSizes=i??[],this._originalMode=0,this.mode=u,this.mtime=a}static unmarshal(t){const e=Data.decode(t),n=new P({type:types[e.Type!=null?e.Type.toString():"File"],data:e.Data,blockSizes:e.blocksizes,mode:e.mode,mtime:e.mtime!=null?{secs:e.mtime.Seconds??0n,nsecs:e.mtime.FractionalNanoseconds}:void 0});return n._originalMode=e.mode??0,n}set mode(t){t==null?this._mode=this.isDirectory()?DEFAULT_DIRECTORY_MODE:DEFAULT_FILE_MODE:this._mode=t&4095}get mode(){return this._mode}isDirectory(){return dirTypes.includes(this.type)}addBlockSize(t){this.blockSizes.push(t)}removeBlockSize(t){this.blockSizes.splice(t,1)}fileSize(){if(this.isDirectory())return 0n;let t=0n;return this.blockSizes.forEach(e=>{t+=e}),this.data!=null&&(t+=BigInt(this.data.length)),t}marshal(){let t;switch(this.type){case"raw":t=Data.DataType.Raw;break;case"directory":t=Data.DataType.Directory;break;case"file":t=Data.DataType.File;break;case"metadata":t=Data.DataType.Metadata;break;case"symlink":t=Data.DataType.Symlink;break;case"hamt-sharded-directory":t=Data.DataType.HAMTShard;break;default:throw(0,import_err_code.default)(new Error(`Type: ${t} is not valid`),"ERR_INVALID_TYPE")}let e=this.data;(this.data==null||this.data.length===0)&&(e=void 0);let n;this.mode!=null&&(n=this._originalMode&4294963200|(this.mode??0),n===DEFAULT_FILE_MODE&&!this.isDirectory()&&(n=void 0),n===DEFAULT_DIRECTORY_MODE&&this.isDirectory()&&(n=void 0));let i;return this.mtime!=null&&(i={Seconds:this.mtime.secs,FractionalNanoseconds:this.mtime.nsecs}),Data.encode({Type:t,Data:e,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:n,mtime:i})}},raw_exports={};__export(raw_exports,{code:()=>code2,decode:()=>decode6,encode:()=>encode4,name:()=>name2});var equals4=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},coerce2=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},name2="raw",code2=85,encode4=r=>coerce2(r),decode6=r=>coerce2(r),CustomProgressEvent=class extends Event{constructor(r,t){super(r),this.detail=t}},encode_12=encode5,MSB2=128,MSBALL2=-128,INT2=Math.pow(2,31);function encode5(r,t,e){t=t||[],e=e||0;for(var n=e;r>=INT2;)t[e++]=r&255|MSB2,r/=128;for(;r&MSBALL2;)t[e++]=r&255|MSB2,r>>>=7;return t[e]=r|0,encode5.bytes=e-n+1,t}var decode7=read2,MSB$12=128,REST$12=127;function read2(r,n){var e=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw read2.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&REST$12)<<i:(s&REST$12)*Math.pow(2,i),i+=7}while(s>=MSB$12);return read2.bytes=o-n,e}var N12=Math.pow(2,7),N22=Math.pow(2,14),N32=Math.pow(2,21),N42=Math.pow(2,28),N52=Math.pow(2,35),N62=Math.pow(2,42),N72=Math.pow(2,49),N82=Math.pow(2,56),N92=Math.pow(2,63),length2=function(r){return r<N12?1:r<N22?2:r<N32?3:r<N42?4:r<N52?5:r<N62?6:r<N72?7:r<N82?8:r<N92?9:10},varint2={encode:encode_12,decode:decode7,encodingLength:length2},_brrp_varint2=varint2,varint_default2=_brrp_varint2,decode8=(r,t=0)=>[varint_default2.decode(r,t),varint_default2.decode.bytes],encodeTo2=(r,t,e=0)=>(varint_default2.encode(r,t,e),t),encodingLength2=r=>varint_default2.encodingLength(r),create2=(r,t)=>{const e=t.byteLength,n=encodingLength2(r),i=n+encodingLength2(e),o=new Uint8Array(i+e);return encodeTo2(r,o,0),encodeTo2(e,o,n),o.set(t,i),new Digest2(r,e,t,o)},decode9=r=>{const t=coerce2(r),[e,n]=decode8(t),[i,o]=decode8(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Digest2(e,i,s,t)},equals5=(r,t)=>{if(r===t)return!0;{const e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&equals4(r.bytes,e.bytes)}},Digest2=class{constructor(r,t,e,n){this.code=r,this.size=t,this.digest=e,this.bytes=n}};function base2(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var a=r.length,u=r.charAt(0),h=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function g(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var c=0,d=0,w=0,v=l.length;w!==v&&l[w]===0;)w++,c++;for(var p=(v-w)*f+1>>>0,m=new Uint8Array(p);w!==v;){for(var _=l[w],A=0,E=p-1;(_!==0||A<d)&&E!==-1;E--,A++)_+=256*m[E]>>>0,m[E]=_%a>>>0,_=_/a>>>0;if(_!==0)throw new Error("Non-zero carry");d=A,w++}for(var S=p-d;S!==p&&m[S]===0;)S++;for(var x=u.repeat(c);S<p;++S)x+=r.charAt(m[S]);return x}function b(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var c=0;if(l[c]!==" "){for(var d=0,w=0;l[c]===u;)d++,c++;for(var v=(l.length-c)*h+1>>>0,p=new Uint8Array(v);l[c];){var m=e[l.charCodeAt(c)];if(m===255)return;for(var _=0,A=v-1;(m!==0||_<w)&&A!==-1;A--,_++)m+=a*p[A]>>>0,p[A]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");w=_,c++}if(l[c]!==" "){for(var E=v-w;E!==v&&p[E]===0;)E++;for(var S=new Uint8Array(d+(v-E)),x=d;E!==v;)S[x++]=p[E++];return S}}}function y(l){var c=b(l);if(c)return c;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:b,decode:y}}var src2=base2,_brrp__multiformats_scope_baseX2=src2,base_x_default2=_brrp__multiformats_scope_baseX2,Encoder2=class{constructor(r,t,e){this.name=r,this.prefix=t,this.baseEncode=e}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Decoder2=class{constructor(r,t,e){if(this.name=r,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=e}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return or2(this,r)}},ComposedDecoder2=class{constructor(r){this.decoders=r}or(r){return or2(this,r)}decode(r){const t=r[0],e=this.decoders[t];if(e)return e.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or2=(r,t)=>new ComposedDecoder2({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Codec2=class{constructor(r,t,e,n){this.name=r,this.prefix=t,this.baseEncode=e,this.baseDecode=n,this.encoder=new Encoder2(r,t,e),this.decoder=new Decoder2(r,t,n)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},from2=({name:r,prefix:t,encode:e,decode:n})=>new Codec2(r,t,e,n),baseX2=({prefix:r,name:t,alphabet:e})=>{const{encode:n,decode:i}=base_x_default2(e,t);return from2({prefix:r,name:t,encode:n,decode:o=>coerce2(i(o))})},decode10=(r,t,e,n)=>{const i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;const s=new Uint8Array(o*e/8|0);let a=0,u=0,h=0;for(let f=0;f<o;++f){const g=i[r[f]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<e|g,a+=e,a>=8&&(a-=8,s[h++]=255&u>>a)}if(a>=e||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},encode6=(r,t,e)=>{const n=t[t.length-1]==="=",i=(1<<e)-1;let o="",s=0,a=0;for(let u=0;u<r.length;++u)for(a=a<<8|r[u],s+=8;s>e;)s-=e,o+=t[i&a>>s];if(s&&(o+=t[i&a<<e-s]),n)for(;o.length*e&7;)o+="=";return o},rfc46482=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>from2({prefix:t,name:r,encode(i){return encode6(i,n,e)},decode(i){return decode10(i,n,e,r)}}),base58btc2=baseX2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var base322=rfc46482({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46482({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46482({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46482({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46482({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46482({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46482({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46482({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46482({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var format2=(r,t)=>{const{bytes:e,version:n}=r;switch(n){case 0:return toStringV02(e,baseCache2(r),t||base58btc2.encoder);default:return toStringV12(e,baseCache2(r),t||base322.encoder)}},cache2=new WeakMap,baseCache2=r=>{const t=cache2.get(r);if(t==null){const e=new Map;return cache2.set(r,e),e}return t},CID2=class k{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:t,multihash:e}=this;if(t!==DAG_PB_CODE2)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==SHA_256_CODE2)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return k.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:t,digest:e}=this.multihash,n=create2(t,e);return k.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return k.equals(this,t)}static equals(t,e){const n=e;return n&&t.code===n.code&&t.version===n.version&&equals5(t.multihash,n.multihash)}toString(t){return format2(this,t)}toJSON(){return{"/":format2(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;const e=t;if(e instanceof k)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){const{version:n,code:i,multihash:o,bytes:s}=e;return new k(n,i,o,s||encodeCID2(n,i,o.bytes))}else if(e[cidSymbol2]===!0){const{version:n,multihash:i,code:o}=e,s=decode9(i);return k.create(n,o,s)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==DAG_PB_CODE2)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE2}) block encoding`);return new k(t,e,n,n.bytes)}case 1:{const i=encodeCID2(t,e,n.bytes);return new k(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return k.create(0,DAG_PB_CODE2,t)}static createV1(t,e){return k.create(1,t,e)}static decode(t){const[e,n]=k.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){const e=k.inspectBytes(t),n=e.size-e.multihashSize,i=coerce2(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");const o=i.subarray(e.multihashSize-e.digestSize),s=new Digest2(e.multihashCode,e.digestSize,o,i);return[e.version===0?k.createV0(s):k.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0;const n=()=>{const[g,b]=decode8(t.subarray(e));return e+=b,g};let i=n(),o=DAG_PB_CODE2;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);const s=e,a=n(),u=n(),h=e+u,f=h-s;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:f,size:h}}static parse(t,e){const[n,i]=parseCIDtoBytes2(t,e),o=k.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache2(o).set(n,t),o}},parseCIDtoBytes2=(r,t)=>{switch(r[0]){case"Q":{const e=t||base58btc2;return[base58btc2.prefix,e.decode(`${base58btc2.prefix}${r}`)]}case base58btc2.prefix:{const e=t||base58btc2;return[base58btc2.prefix,e.decode(r)]}case base322.prefix:{const e=t||base322;return[base322.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},toStringV02=(r,t,e)=>{const{prefix:n}=e;if(n!==base58btc2.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);const i=t.get(n);if(i==null){const o=e.encode(r).slice(1);return t.set(n,o),o}else return i},toStringV12=(r,t,e)=>{const{prefix:n}=e,i=t.get(n);if(i==null){const o=e.encode(r);return t.set(n,o),o}else return i},DAG_PB_CODE2=112,SHA_256_CODE2=18,encodeCID2=(r,t,e)=>{const n=encodingLength2(r),i=n+encodingLength2(t),o=new Uint8Array(i+e.byteLength);return encodeTo2(r,o,0),encodeTo2(t,o,n),o.set(e,i),o},cidSymbol2=Symbol.for("@ipld/js-cid/CID"),import_crypto=__toESM(requireCryptoBrowserify()),from3=({name:r,code:t,encode:e})=>new Hasher(r,t,e),Hasher=class{constructor(r,t,e){this.name=r,this.code=t,this.encode=e}digest(r){if(r instanceof Uint8Array){const t=this.encode(r);return t instanceof Uint8Array?create2(this.code,t):t.then(e=>create2(this.code,e))}else throw Error("Unknown type, must be binary type")}},sha256=from3({name:"sha2-256",code:18,encode:r=>coerce2(import_crypto.default.createHash("sha256").update(r).digest())}),persist=async(r,t,e)=>{e.codec==null&&(e.codec=src_exports);const n=await sha256.digest(r),i=CID2.create(e.cidVersion,e.codec.code,n);return await t.put(i,r,e),i};function defaultBufferImporter(r){return async function*(e,n){let i=0n;for await(let o of e.content)yield async()=>{var h;let s;const a={codec:src_exports,cidVersion:r.cidVersion,onProgress:r.onProgress};r.rawLeaves?(a.codec=raw_exports,a.cidVersion=1):(s=new UnixFS({type:r.leafType,data:o}),o=encode3({Data:s.marshal(),Links:[]}));const u=await persist(o,n,a);return i+=BigInt(o.byteLength),(h=r.onProgress)==null||h.call(r,new CustomProgressEvent("unixfs:importer:progress:file:write",{bytesWritten:i,cid:u,path:e.path})),{cid:u,unixfs:s,size:BigInt(o.length),block:o}}}}var import_err_code2=__toESM(require_err_code()),dirBuilder=async(r,t,e)=>{const n=new UnixFS({type:"directory",mtime:r.mtime,mode:r.mode}),i=encode3(prepare({Data:n.marshal()})),o=await persist(i,t,e),s=r.path;return{cid:o,path:s,unixfs:n,size:BigInt(i.length),originalPath:r.originalPath,block:i}};async function*buildFileBatch(r,t,e){let n=-1,i;for await(const o of parallelBatch(e.bufferImporter(r,t),e.blockWriteConcurrency)){if(n++,n===0){i={...o,single:!0};continue}else n===1&&i!=null&&(yield{...i,block:void 0,single:void 0},i=void 0);yield{...o,block:void 0}}i!=null&&(yield i)}function isSingleBlockImport(r){return r.single===!0}var reduce=(r,t,e)=>async function(i){var f,g;if(i.length===1&&isSingleBlockImport(i[0])&&e.reduceSingleLeafToSelf){const b=i[0];let y=b.block;return isSingleBlockImport(b)&&(r.mtime!==void 0||r.mode!==void 0)&&(b.unixfs=new UnixFS({type:"file",mtime:r.mtime,mode:r.mode,data:b.block}),y={Data:b.unixfs.marshal(),Links:[]},b.block=encode3(prepare(y)),b.cid=await persist(b.block,t,{...e,cidVersion:e.cidVersion}),b.size=BigInt(b.block.length)),(f=e.onProgress)==null||f.call(e,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:b.cid,path:b.originalPath})),{cid:b.cid,path:r.path,unixfs:b.unixfs,size:b.size,originalPath:b.originalPath}}const o=new UnixFS({type:"file",mtime:r.mtime,mode:r.mode}),s=i.filter(b=>{var y,l;return b.cid.code===code2&&b.size>0||b.unixfs!=null&&b.unixfs.data==null&&b.unixfs.fileSize()>0n?!0:!!((l=(y=b.unixfs)==null?void 0:y.data)!=null&&l.length)}).map(b=>{var y;return b.cid.code===code2?(o.addBlockSize(b.size),{Name:"",Tsize:Number(b.size),Hash:b.cid}):(b.unixfs==null||b.unixfs.data==null?o.addBlockSize(((y=b.unixfs)==null?void 0:y.fileSize())??0n):o.addBlockSize(BigInt(b.unixfs.data.length)),{Name:"",Tsize:Number(b.size),Hash:b.cid})}),a={Data:o.marshal(),Links:s},u=encode3(prepare(a)),h=await persist(u,t,e);return(g=e.onProgress)==null||g.call(e,new CustomProgressEvent("unixfs:importer:progress:file:layout",{cid:h,path:r.originalPath})),{cid:h,path:r.path,unixfs:o,size:BigInt(u.length+a.Links.reduce((b,y)=>b+(y.Tsize??0),0)),originalPath:r.originalPath,block:u}},fileBuilder=async(r,t,e)=>e.layout(buildFileBatch(r,t,e),reduce(r,t,e));function isIterable(r){return Symbol.iterator in r}function isAsyncIterable2(r){return Symbol.asyncIterator in r}function contentAsAsyncIterable(r){try{if(r instanceof Uint8Array)return(async function*(){yield r})();if(isIterable(r))return(async function*(){yield*r})();if(isAsyncIterable2(r))return r}catch{throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}throw(0,import_err_code2.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}function defaultDagBuilder(r){return async function*(e,n){for await(const i of e){let o;if(i.path!=null&&(o=i.path,i.path=i.path.split("/").filter(s=>s!=null&&s!==".").join("/")),isFileCandidate(i)){const s={path:i.path,mtime:i.mtime,mode:i.mode,content:(async function*(){var u;let a=0n;for await(const h of r.chunker(r.chunkValidator(contentAsAsyncIterable(i.content)))){const f=BigInt(h.byteLength);a+=f,(u=r.onProgress)==null||u.call(r,new CustomProgressEvent("unixfs:importer:progress:file:read",{bytesRead:a,chunkSize:f,path:i.path})),yield h}})(),originalPath:o};yield async()=>fileBuilder(s,n,r)}else if(i.path!=null){const s={path:i.path,mtime:i.mtime,mode:i.mode,originalPath:o};yield async()=>dirBuilder(s,n,r)}else throw new Error("Import candidate must have content or path or both")}}}function isFileCandidate(r){return r.content!=null}var import_err_code3=__toESM(require_err_code()),identity_exports={};__export(identity_exports,{identity:()=>identity});function base3(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var a=r.length,u=r.charAt(0),h=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function g(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var c=0,d=0,w=0,v=l.length;w!==v&&l[w]===0;)w++,c++;for(var p=(v-w)*f+1>>>0,m=new Uint8Array(p);w!==v;){for(var _=l[w],A=0,E=p-1;(_!==0||A<d)&&E!==-1;E--,A++)_+=256*m[E]>>>0,m[E]=_%a>>>0,_=_/a>>>0;if(_!==0)throw new Error("Non-zero carry");d=A,w++}for(var S=p-d;S!==p&&m[S]===0;)S++;for(var x=u.repeat(c);S<p;++S)x+=r.charAt(m[S]);return x}function b(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var c=0;if(l[c]!==" "){for(var d=0,w=0;l[c]===u;)d++,c++;for(var v=(l.length-c)*h+1>>>0,p=new Uint8Array(v);l[c];){var m=e[l.charCodeAt(c)];if(m===255)return;for(var _=0,A=v-1;(m!==0||_<w)&&A!==-1;A--,_++)m+=a*p[A]>>>0,p[A]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");w=_,c++}if(l[c]!==" "){for(var E=v-w;E!==v&&p[E]===0;)E++;for(var S=new Uint8Array(d+(v-E)),x=d;E!==v;)S[x++]=p[E++];return S}}}function y(l){var c=b(l);if(c)return c;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:b,decode:y}}var src3=base3,_brrp__multiformats_scope_baseX3=src3,base_x_default3=_brrp__multiformats_scope_baseX3,coerce3=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},fromString2=r=>new TextEncoder().encode(r),toString2=r=>new TextDecoder().decode(r),Encoder3=class{constructor(r,t,e){this.name=r,this.prefix=t,this.baseEncode=e}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Decoder3=class{constructor(r,t,e){if(this.name=r,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=e}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return or3(this,r)}},ComposedDecoder3=class{constructor(r){this.decoders=r}or(r){return or3(this,r)}decode(r){const t=r[0],e=this.decoders[t];if(e)return e.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or3=(r,t)=>new ComposedDecoder3({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Codec3=class{constructor(r,t,e,n){this.name=r,this.prefix=t,this.baseEncode=e,this.baseDecode=n,this.encoder=new Encoder3(r,t,e),this.decoder=new Decoder3(r,t,n)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},from4=({name:r,prefix:t,encode:e,decode:n})=>new Codec3(r,t,e,n),baseX3=({prefix:r,name:t,alphabet:e})=>{const{encode:n,decode:i}=base_x_default3(e,t);return from4({prefix:r,name:t,encode:n,decode:o=>coerce3(i(o))})},decode11=(r,t,e,n)=>{const i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;const s=new Uint8Array(o*e/8|0);let a=0,u=0,h=0;for(let f=0;f<o;++f){const g=i[r[f]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<e|g,a+=e,a>=8&&(a-=8,s[h++]=255&u>>a)}if(a>=e||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},encode7=(r,t,e)=>{const n=t[t.length-1]==="=",i=(1<<e)-1;let o="",s=0,a=0;for(let u=0;u<r.length;++u)for(a=a<<8|r[u],s+=8;s>e;)s-=e,o+=t[i&a>>s];if(s&&(o+=t[i&a<<e-s]),n)for(;o.length*e&7;)o+="=";return o},rfc46483=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>from4({prefix:t,name:r,encode(i){return encode7(i,n,e)},decode(i){return decode11(i,n,e,r)}}),identity=from4({prefix:"\0",name:"identity",encode:r=>toString2(r),decode:r=>fromString2(r)}),base2_exports={};__export(base2_exports,{base2:()=>base22});var base22=rfc46483({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base8_exports={};__export(base8_exports,{base8:()=>base8});var base8=rfc46483({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base10_exports={};__export(base10_exports,{base10:()=>base10});var base10=baseX3({prefix:"9",name:"base10",alphabet:"0123456789"}),base16_exports={};__export(base16_exports,{base16:()=>base16,base16upper:()=>base16upper});var base16=rfc46483({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc46483({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base32_exports={};__export(base32_exports,{base32:()=>base323,base32hex:()=>base32hex3,base32hexpad:()=>base32hexpad3,base32hexpadupper:()=>base32hexpadupper3,base32hexupper:()=>base32hexupper3,base32pad:()=>base32pad3,base32padupper:()=>base32padupper3,base32upper:()=>base32upper3,base32z:()=>base32z3});var base323=rfc46483({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper3=rfc46483({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad3=rfc46483({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper3=rfc46483({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex3=rfc46483({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper3=rfc46483({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad3=rfc46483({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper3=rfc46483({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z3=rfc46483({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base36_exports={};__export(base36_exports,{base36:()=>base36,base36upper:()=>base36upper});var base36=baseX3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base58_exports={};__export(base58_exports,{base58btc:()=>base58btc3,base58flickr:()=>base58flickr3});var base58btc3=baseX3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr3=baseX3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base64_exports={};__export(base64_exports,{base64:()=>base64,base64pad:()=>base64pad,base64url:()=>base64url,base64urlpad:()=>base64urlpad});var base64=rfc46483({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc46483({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc46483({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc46483({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base256emoji_exports={};__export(base256emoji_exports,{base256emoji:()=>base256emoji});var alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce((r,t,e)=>(r[e]=t,r),[]),alphabetCharsToBytes=alphabet.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function encode8(r){return r.reduce((t,e)=>(t+=alphabetBytesToChars[e],t),"")}function decode12(r){const t=[];for(const e of r){const n=alphabetCharsToBytes[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var base256emoji=from4({prefix:"🚀",name:"base256emoji",encode:encode8,decode:decode12}),sha2_exports={};__export(sha2_exports,{sha256:()=>sha2562,sha512:()=>sha5122});var import_crypto2=__toESM(requireCryptoBrowserify()),encode_13=encode9,MSB3=128,MSBALL3=-128,INT3=Math.pow(2,31);function encode9(r,t,e){t=t||[],e=e||0;for(var n=e;r>=INT3;)t[e++]=r&255|MSB3,r/=128;for(;r&MSBALL3;)t[e++]=r&255|MSB3,r>>>=7;return t[e]=r|0,encode9.bytes=e-n+1,t}var decode13=read3,MSB$13=128,REST$13=127;function read3(r,n){var e=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw read3.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&REST$13)<<i:(s&REST$13)*Math.pow(2,i),i+=7}while(s>=MSB$13);return read3.bytes=o-n,e}var N13=Math.pow(2,7),N23=Math.pow(2,14),N33=Math.pow(2,21),N43=Math.pow(2,28),N53=Math.pow(2,35),N63=Math.pow(2,42),N73=Math.pow(2,49),N83=Math.pow(2,56),N93=Math.pow(2,63),length3=function(r){return r<N13?1:r<N23?2:r<N33?3:r<N43?4:r<N53?5:r<N63?6:r<N73?7:r<N83?8:r<N93?9:10},varint3={encode:encode_13,decode:decode13,encodingLength:length3},_brrp_varint3=varint3,varint_default3=_brrp_varint3,encodeTo3=(r,t,e=0)=>(varint_default3.encode(r,t,e),t),encodingLength3=r=>varint_default3.encodingLength(r),create3=(r,t)=>{const e=t.byteLength,n=encodingLength3(r),i=n+encodingLength3(e),o=new Uint8Array(i+e);return encodeTo3(r,o,0),encodeTo3(e,o,n),o.set(t,i),new Digest3(r,e,t,o)},Digest3=class{constructor(r,t,e,n){this.code=r,this.size=t,this.digest=e,this.bytes=n}},from5=({name:r,code:t,encode:e})=>new Hasher2(r,t,e),Hasher2=class{constructor(r,t,e){this.name=r,this.code=t,this.encode=e}digest(r){if(r instanceof Uint8Array){const t=this.encode(r);return t instanceof Uint8Array?create3(this.code,t):t.then(e=>create3(this.code,e))}else throw Error("Unknown type, must be binary type")}},sha2562=from5({name:"sha2-256",code:18,encode:r=>coerce3(import_crypto2.default.createHash("sha256").update(r).digest())}),sha5122=from5({name:"sha2-512",code:19,encode:r=>coerce3(import_crypto2.default.createHash("sha512").update(r).digest())}),identity_exports2={};__export(identity_exports2,{identity:()=>identity2});var code3=0,name3="identity",encode10=coerce3,digest=r=>create3(code3,encode10(r)),identity2={code:code3,name:name3,encode:encode10,digest};new TextEncoder,new TextDecoder;var bases={...identity_exports,...base2_exports,...base8_exports,...base10_exports,...base16_exports,...base32_exports,...base36_exports,...base58_exports,...base64_exports,...base256emoji_exports};({...sha2_exports,...identity_exports2});function createCodec2(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var string=createCodec2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),ascii=createCodec2("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);const t=allocUnsafe(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),BASES={utf8:string,"utf-8":string,hex:bases.base16,latin1:ascii,ascii,binary:ascii,...bases},bases_default=BASES;function fromString3(r,t="utf8"){const e=bases_default[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?asUint8Array(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}var defaultChunkValidator=()=>async function*(t){for await(const e of t){if(e.length===void 0)throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT");if(typeof e=="string"||e instanceof String)yield fromString3(e.toString());else if(Array.isArray(e))yield Uint8Array.from(e);else if(e instanceof Uint8Array)yield e;else throw(0,import_err_code3.default)(new Error("Content was invalid"),"ERR_INVALID_CONTENT")}},DEFAULT_MAX_CHILDREN_PER_NODE=174;function balanced(r){const t=DEFAULT_MAX_CHILDREN_PER_NODE;return async function e(n,i){const o=[];for await(const s of src_default(n,t))o.push(await i(s));return o.length>1?e(o,i):o[0]}}var Dir=class{constructor(r,t){D(this,"options");D(this,"root");D(this,"dir");D(this,"path");D(this,"dirty");D(this,"flat");D(this,"parent");D(this,"parentKey");D(this,"unixfs");D(this,"mode");D(this,"mtime");D(this,"cid");D(this,"size");D(this,"nodeSize");this.options=t??{},this.root=r.root,this.dir=r.dir,this.path=r.path,this.dirty=r.dirty,this.flat=r.flat,this.parent=r.parent,this.parentKey=r.parentKey,this.unixfs=r.unixfs,this.mode=r.mode,this.mtime=r.mtime}},CID_V0=CID2.parse("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"),CID_V1=CID2.parse("zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi"),DirFlat=class extends Dir{constructor(t,e){super(t,e);D(this,"_children");this._children=new Map}async put(t,e){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,this._children.set(t,e)}async get(t){return Promise.resolve(this._children.get(t))}childCount(){return this._children.size}directChildrenCount(){return this.childCount()}onlyChild(){return this._children.values().next().value}async*eachChildSeries(){for(const[t,e]of this._children.entries())yield{key:t,child:e}}estimateNodeSize(){if(this.nodeSize!==void 0)return this.nodeSize;this.nodeSize=0;for(const[t,e]of this._children.entries())e.size!=null&&e.cid!=null&&(this.nodeSize+=t.length+(this.options.cidVersion===1?CID_V1.bytes.byteLength:CID_V0.bytes.byteLength));return this.nodeSize}async*flush(t){const e=[];for(const[u,h]of this._children.entries()){let f=h;if(h instanceof Dir)for await(const g of h.flush(t))f=g,yield g;f.size!=null&&f.cid!=null&&e.push({Name:u,Tsize:Number(f.size),Hash:f.cid})}const n=new UnixFS({type:"directory",mtime:this.mtime,mode:this.mode}),i={Data:n.marshal(),Links:e},o=encode3(prepare(i)),s=await persist(o,t,this.options),a=o.length+i.Links.reduce((u,h)=>u+(h.Tsize==null?0:h.Tsize),0);this.cid=s,this.size=a,yield{cid:s,unixfs:n,path:this.path,size:BigInt(a)}}},from6=({name:r,code:t,encode:e})=>new Hasher3(r,t,e),Hasher3=class{constructor(r,t,e){this.name=r,this.code=t,this.encode=e}digest(r){if(r instanceof Uint8Array){const t=this.encode(r);return t instanceof Uint8Array?create(this.code,t):t.then(e=>create(this.code,e))}else throw Error("Unknown type, must be binary type")}},import_murmurhash3js_revisited=__toESM(require_murmurhash3js_revisited()),murmur3128=from6({name:"murmur3-128",code:34,encode:r=>bytes_exports.fromHex(import_murmurhash3js_revisited.default.x64.hash128(r))}),import_sparse_array=__toESM(require_sparse_array()),Bucket=class I{constructor(t,e,n=0){this._options=t,this._popCount=0,this._parent=e,this._posAtParent=n,this._children=new import_sparse_array.default,this.key=null}async put(t,e){const n=await this._findNewBucketAndPos(t);await n.bucket._putAt(n,t,e)}async get(t){const e=await this._findChild(t);if(e!=null)return e.value}async del(t){const e=await this._findPlace(t),n=e.bucket._at(e.pos);n!=null&&n.key===t&&e.bucket._delAt(e.pos)}leafCount(){return this._children.compactArray().reduce((e,n)=>n instanceof I?e+n.leafCount():e+1,0)}childrenCount(){return this._children.length}onlyChild(){return this._children.get(0)}*eachLeafSeries(){const t=this._children.compactArray();for(const e of t)e instanceof I?yield*e.eachLeafSeries():yield e}serialize(t,e){const n=[];return e(this._children.reduce((i,o,s)=>(o!=null&&(o instanceof I?i.push(o.serialize(t,e)):i.push(t(o,s))),i),n))}async asyncTransform(t,e){return await asyncTransformBucket(this,t,e)}toJSON(){return this.serialize(mapNode,reduceNodes)}prettyPrint(){return JSON.stringify(this.toJSON(),null," ")}tableSize(){return Math.pow(2,this._options.bits)}async _findChild(t){const e=await this._findPlace(t),n=e.bucket._at(e.pos);if(!(n instanceof I)&&n!=null&&n.key===t)return n}async _findPlace(t){const e=this._options.hash(typeof t=="string"?fromString3(t):t),n=await e.take(this._options.bits),i=this._children.get(n);return i instanceof I?await i._findPlace(e):{bucket:this,pos:n,hash:e,existingChild:i}}async _findNewBucketAndPos(t){const e=await this._findPlace(t);if(e.existingChild!=null&&e.existingChild.key!==t){const n=new I(this._options,e.bucket,e.pos);e.bucket._putObjectAt(e.pos,n);const i=await n._findPlace(e.existingChild.hash);return i.bucket._putAt(i,e.existingChild.key,e.existingChild.value),await n._findNewBucketAndPos(e.hash)}return e}_putAt(t,e,n){this._putObjectAt(t.pos,{key:e,value:n,hash:t.hash})}_putObjectAt(t,e){this._children.get(t)==null&&this._popCount++,this._children.set(t,e)}_delAt(t){if(t===-1)throw new Error("Invalid position");this._children.get(t)!=null&&this._popCount--,this._children.unset(t),this._level()}_level(){if(this._parent!=null&&this._popCount<=1)if(this._popCount===1){const t=this._children.find(exists);if(t!=null&&!(t instanceof I)){const e=t.hash;e.untake(this._options.bits);const n={pos:this._posAtParent,hash:e,bucket:this._parent};this._parent._putAt(n,t.key,t.value)}}else this._parent._delAt(this._posAtParent)}_at(t){return this._children.get(t)}};function exists(r){return!!r}function mapNode(r,t){return r.key}function reduceNodes(r){return r}async function asyncTransformBucket(r,t,e){const n=[];for(const i of r._children.compactArray())if(i instanceof Bucket)await asyncTransformBucket(i,t,e);else{const o=await t(i);n.push({bitField:r._children.bitField(),children:o})}return await e(n)}var START_MASKS=[255,254,252,248,240,224,192,128],STOP_MASKS=[1,3,7,15,31,63,127,255],ConsumableBuffer=class{constructor(r){this._value=r,this._currentBytePos=r.length-1,this._currentBitPos=7}availableBits(){return this._currentBitPos+1+this._currentBytePos*8}totalBits(){return this._value.length*8}take(r){let t=r,e=0;for(;t>0&&this._haveBits();){const n=this._value[this._currentBytePos],i=this._currentBitPos+1,o=Math.min(i,t),s=byteBitsToInt(n,i-o,o);e=(e<<o)+s,t-=o,this._currentBitPos-=o,this._currentBitPos<0&&(this._currentBitPos=7,this._currentBytePos--)}return e}untake(r){for(this._currentBitPos+=r;this._currentBitPos>7;)this._currentBitPos-=8,this._currentBytePos+=1}_haveBits(){return this._currentBytePos>=0}};function byteBitsToInt(r,t,e){const n=maskFor(t,e);return(r&n)>>>t}function maskFor(r,t){return START_MASKS[r]&STOP_MASKS[Math.min(t+r-1,7)]}function wrapHash(r){function t(e){return e instanceof InfiniteHash?e:new InfiniteHash(e,r)}return t}var InfiniteHash=class{constructor(r,t){if(!(r instanceof Uint8Array))throw new Error("can only hash Uint8Arrays");this._value=r,this._hashFn=t,this._depth=-1,this._availableBits=0,this._currentBufferIndex=0,this._buffers=[]}async take(r){let t=r;for(;this._availableBits<t;)await this._produceMoreBits();let e=0;for(;t>0;){const n=this._buffers[this._currentBufferIndex],i=Math.min(n.availableBits(),t),o=n.take(i);e=(e<<i)+o,t-=i,this._availableBits-=i,n.availableBits()===0&&this._currentBufferIndex++}return e}untake(r){let t=r;for(;t>0;){const e=this._buffers[this._currentBufferIndex],n=Math.min(e.totalBits()-e.availableBits(),t);e.untake(n),t-=n,this._availableBits+=n,this._currentBufferIndex>0&&e.totalBits()===e.availableBits()&&(this._depth--,this._currentBufferIndex--)}}async _produceMoreBits(){this._depth++;const r=this._depth>0?concat([this._value,Uint8Array.from([this._depth])]):this._value,t=await this._hashFn(r),e=new ConsumableBuffer(t);this._buffers.push(e),this._availableBits+=e.availableBits()}};function createHAMT(r){if(r==null||r.hashFn==null)throw new Error("please define an options.hashFn");const t={bits:r.bits??8,hash:wrapHash(r.hashFn)};return new Bucket(t)}async function hamtHashFn(r){return(await murmur3128.encode(r)).slice(0,8).reverse()}var HAMT_HASH_CODE=BigInt(34),DirSharded=class extends Dir{constructor(t,e){super(t,e);D(this,"_bucket");this._bucket=createHAMT({hashFn:hamtHashFn,bits:8})}async put(t,e){this.cid=void 0,this.size=void 0,this.nodeSize=void 0,await this._bucket.put(t,e)}async get(t){return this._bucket.get(t)}childCount(){return this._bucket.leafCount()}directChildrenCount(){return this._bucket.childrenCount()}onlyChild(){return this._bucket.onlyChild()}async*eachChildSeries(){for await(const{key:t,value:e}of this._bucket.eachLeafSeries())yield{key:t,child:e}}estimateNodeSize(){return this.nodeSize!==void 0?this.nodeSize:(this.nodeSize=calculateSize(this._bucket,this,this.options),this.nodeSize)}async*flush(t){for await(const e of flush(this._bucket,t,this,this.options))yield{...e,path:this.path}}},dir_sharded_default=DirSharded;async function*flush(r,t,e,n){const i=r._children,o=[];let s=0n;for(let y=0;y<i.length;y++){const l=i.get(y);if(l==null)continue;const c=y.toString(16).toUpperCase().padStart(2,"0");if(l instanceof Bucket){let d;for await(const w of flush(l,t,null,n))d=w;if(d==null)throw new Error("Could not flush sharded directory, no subshard found");o.push({Name:c,Tsize:Number(d.size),Hash:d.cid}),s+=d.size}else if(isDir(l.value)){const d=l.value;let w;for await(const p of d.flush(t))w=p,yield w;if(w==null)throw new Error("Did not flush dir");const v=c+l.key;o.push({Name:v,Tsize:Number(w.size),Hash:w.cid}),s+=w.size}else{const d=l.value;if(d.cid==null)continue;const w=c+l.key,v=d.size;o.push({Name:w,Tsize:Number(v),Hash:d.cid}),s+=BigInt(v??0)}}const a=Uint8Array.from(i.bitField().reverse()),u=new UnixFS({type:"hamt-sharded-directory",data:a,fanout:BigInt(r.tableSize()),hashType:HAMT_HASH_CODE,mtime:e==null?void 0:e.mtime,mode:e==null?void 0:e.mode}),h={Data:u.marshal(),Links:o},f=encode3(prepare(h)),g=await persist(f,t,n),b=BigInt(f.byteLength)+s;yield{cid:g,unixfs:u,size:b}}function isDir(r){return typeof r.flush=="function"}function calculateSize(r,t,e){const n=r._children,i=[];for(let u=0;u<n.length;u++){const h=n.get(u);if(h==null)continue;const f=u.toString(16).toUpperCase().padStart(2,"0");if(h instanceof Bucket){const g=calculateSize(h,null,e);i.push({Name:f,Tsize:Number(g),Hash:e.cidVersion===0?CID_V0:CID_V1})}else if(typeof h.value.flush=="function"){const b=h.value.nodeSize();i.push({Name:f+h.key,Tsize:Number(b),Hash:e.cidVersion===0?CID_V0:CID_V1})}else{const g=h.value;if(g.cid==null)continue;const b=f+h.key,y=g.size;i.push({Name:b,Tsize:Number(y),Hash:g.cid})}}const o=Uint8Array.from(n.bitField().reverse()),s=new UnixFS({type:"hamt-sharded-directory",data:o,fanout:BigInt(r.tableSize()),hashType:HAMT_HASH_CODE,mtime:t==null?void 0:t.mtime,mode:t==null?void 0:t.mode});return encode3(prepare({Data:s.marshal(),Links:i})).length}async function flatToShard(r,t,e,n){let i=t;t instanceof DirFlat&&t.estimateNodeSize()>e&&(i=await convertToShard(t,n));const o=i.parent;if(o!=null){if(i!==t){if(r!=null&&(r.parent=i),i.parentKey==null)throw new Error("No parent key found");await o.put(i.parentKey,i)}return flatToShard(i,o,e,n)}return i}async function convertToShard(r,t){const e=new dir_sharded_default({root:r.root,dir:!0,parent:r.parent,parentKey:r.parentKey,path:r.path,dirty:r.dirty,flat:!1,mtime:r.mtime,mode:r.mode},t);for await(const{key:n,child:i}of r.eachChildSeries())await e.put(n,i);return e}var toPathComponents=(r="")=>(r.trim().match(/([^\\/]|\\\/)+/g)??[]).filter(Boolean);async function addToTree(r,t,e){var a,u;const n=toPathComponents(r.path??""),i=n.length-1;let o=t,s="";for(let h=0;h<n.length;h++){const f=n[h];s+=`${s!==""?"/":""}${f}`;const g=h===i;if(o.dirty=!0,o.cid=void 0,o.size=void 0,g)await o.put(f,r),t=await flatToShard(null,o,e.shardSplitThresholdBytes,e);else{let b=await o.get(f);(b==null||!(b instanceof Dir))&&(b=new DirFlat({root:!1,dir:!0,parent:o,parentKey:f,path:s,dirty:!0,flat:!0,mtime:(a=b==null?void 0:b.unixfs)==null?void 0:a.mtime,mode:(u=b==null?void 0:b.unixfs)==null?void 0:u.mode},e)),await o.put(f,b),o=b}}return t}async function*flushAndYield(r,t){var e;if(!(r instanceof Dir)){((e=r.unixfs)==null?void 0:e.isDirectory())===!0&&(yield r);return}yield*r.flush(t)}function defaultTreeBuilder(r){return async function*(e,n){let i=new DirFlat({root:!0,dir:!0,path:"",dirty:!0,flat:!0},r),o,s=!1;for await(const a of e){if(a==null)continue;const u=`${a.originalPath??""}`.split("/")[0];u!=null&&u!==""&&(o==null?(o=u,s=!0):o!==u&&(s=!1)),i=await addToTree(a,i,r),(a.unixfs==null||!a.unixfs.isDirectory())&&(yield a)}if(r.wrapWithDirectory||s&&i.childCount()>1)yield*flushAndYield(i,n);else for await(const a of i.eachChildSeries())a!=null&&(yield*flushAndYield(a.child,n))}}async function*importer(r,t,e={}){let n;Symbol.asyncIterator in r||Symbol.iterator in r?n=r:n=[r];const i=e.wrapWithDirectory??!1,o=e.shardSplitThresholdBytes??262144,s=e.cidVersion??1,a=e.rawLeaves??!0,u=e.leafType??"file",h=e.fileImportConcurrency??50,f=e.blockWriteConcurrency??10,g=e.reduceSingleLeafToSelf??!0,b=e.chunker??fixedSize(),y=e.chunkValidator??defaultChunkValidator(),l=e.dagBuilder??defaultDagBuilder({chunker:b,chunkValidator:y,wrapWithDirectory:i,layout:e.layout??balanced(),bufferImporter:e.bufferImporter??defaultBufferImporter({cidVersion:s,rawLeaves:a,leafType:u,onProgress:e.onProgress}),blockWriteConcurrency:f,reduceSingleLeafToSelf:g,cidVersion:s,onProgress:e.onProgress}),c=e.treeBuilder??defaultTreeBuilder({wrapWithDirectory:i,shardSplitThresholdBytes:o,cidVersion:s,onProgress:e.onProgress});for await(const d of c(parallelBatch(l(n,t),h),t))yield{cid:d.cid,path:d.path,unixfs:d.unixfs,size:d.size}}var errors_exports={};__export(errors_exports,{abortedError:()=>abortedError,closeFailedError:()=>closeFailedError,deleteFailedError:()=>deleteFailedError,getFailedError:()=>getFailedError,hasFailedError:()=>hasFailedError,notFoundError:()=>notFoundError,openFailedError:()=>openFailedError,putFailedError:()=>putFailedError});var import_err_code5=__toESM(require_err_code());function openFailedError(r){return r=r??new Error("Open failed"),(0,import_err_code5.default)(r,"ERR_OPEN_FAILED")}function closeFailedError(r){return r=r??new Error("Close failed"),(0,import_err_code5.default)(r,"ERR_CLOSE_FAILED")}function putFailedError(r){return r=r??new Error("Put failed"),(0,import_err_code5.default)(r,"ERR_PUT_FAILED")}function getFailedError(r){return r=r??new Error("Get failed"),(0,import_err_code5.default)(r,"ERR_GET_FAILED")}function deleteFailedError(r){return r=r??new Error("Delete failed"),(0,import_err_code5.default)(r,"ERR_DELETE_FAILED")}function hasFailedError(r){return r=r??new Error("Has failed"),(0,import_err_code5.default)(r,"ERR_HAS_FAILED")}function notFoundError(r){return r=r??new Error("Not Found"),(0,import_err_code5.default)(r,"ERR_NOT_FOUND")}function abortedError(r){return r=r??new Error("Aborted"),(0,import_err_code5.default)(r,"ERR_ABORTED")}var BaseBlockstore=class{has(r,t){return Promise.reject(new Error(".has is not implemented"))}put(r,t,e){return Promise.reject(new Error(".put is not implemented"))}async*putMany(r,t){for await(const{cid:e,block:n}of r)await this.put(e,n,t),yield e}get(r,t){return Promise.reject(new Error(".get is not implemented"))}async*getMany(r,t){for await(const e of r)yield{cid:e,block:await this.get(e,t)}}async delete(r,t){await Promise.reject(new Error(".delete is not implemented"))}async*deleteMany(r,t){for await(const e of r)await this.delete(e,t),yield e}async*getAll(r){throw new Error(".getAll is not implemented")}};function base4(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var o=r.charAt(i),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=i}var a=r.length,u=r.charAt(0),h=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function g(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";for(var c=0,d=0,w=0,v=l.length;w!==v&&l[w]===0;)w++,c++;for(var p=(v-w)*f+1>>>0,m=new Uint8Array(p);w!==v;){for(var _=l[w],A=0,E=p-1;(_!==0||A<d)&&E!==-1;E--,A++)_+=256*m[E]>>>0,m[E]=_%a>>>0,_=_/a>>>0;if(_!==0)throw new Error("Non-zero carry");d=A,w++}for(var S=p-d;S!==p&&m[S]===0;)S++;for(var x=u.repeat(c);S<p;++S)x+=r.charAt(m[S]);return x}function b(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;var c=0;if(l[c]!==" "){for(var d=0,w=0;l[c]===u;)d++,c++;for(var v=(l.length-c)*h+1>>>0,p=new Uint8Array(v);l[c];){var m=e[l.charCodeAt(c)];if(m===255)return;for(var _=0,A=v-1;(m!==0||_<w)&&A!==-1;A--,_++)m+=a*p[A]>>>0,p[A]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");w=_,c++}if(l[c]!==" "){for(var E=v-w;E!==v&&p[E]===0;)E++;for(var S=new Uint8Array(d+(v-E)),x=d;E!==v;)S[x++]=p[E++];return S}}}function y(l){var c=b(l);if(c)return c;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:b,decode:y}}var src4=base4,_brrp__multiformats_scope_baseX4=src4,base_x_default4=_brrp__multiformats_scope_baseX4,equals8=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},coerce4=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},Encoder4=class{constructor(r,t,e){this.name=r,this.prefix=t,this.baseEncode=e}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}},Decoder4=class{constructor(r,t,e){if(this.name=r,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=e}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return or4(this,r)}},ComposedDecoder4=class{constructor(r){this.decoders=r}or(r){return or4(this,r)}decode(r){const t=r[0],e=this.decoders[t];if(e)return e.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},or4=(r,t)=>new ComposedDecoder4({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Codec4=class{constructor(r,t,e,n){this.name=r,this.prefix=t,this.baseEncode=e,this.baseDecode=n,this.encoder=new Encoder4(r,t,e),this.decoder=new Decoder4(r,t,n)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}},from7=({name:r,prefix:t,encode:e,decode:n})=>new Codec4(r,t,e,n),baseX4=({prefix:r,name:t,alphabet:e})=>{const{encode:n,decode:i}=base_x_default4(e,t);return from7({prefix:r,name:t,encode:n,decode:o=>coerce4(i(o))})},decode16=(r,t,e,n)=>{const i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let o=r.length;for(;r[o-1]==="=";)--o;const s=new Uint8Array(o*e/8|0);let a=0,u=0,h=0;for(let f=0;f<o;++f){const g=i[r[f]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<e|g,a+=e,a>=8&&(a-=8,s[h++]=255&u>>a)}if(a>=e||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},encode11=(r,t,e)=>{const n=t[t.length-1]==="=",i=(1<<e)-1;let o="",s=0,a=0;for(let u=0;u<r.length;++u)for(a=a<<8|r[u],s+=8;s>e;)s-=e,o+=t[i&a>>s];if(s&&(o+=t[i&a<<e-s]),n)for(;o.length*e&7;)o+="=";return o},rfc46484=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>from7({prefix:t,name:r,encode(i){return encode11(i,n,e)},decode(i){return decode16(i,n,e,r)}}),base324=rfc46484({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});rfc46484({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),rfc46484({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rfc46484({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),rfc46484({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rfc46484({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rfc46484({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),rfc46484({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),rfc46484({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var encode_14=encode12,MSB4=128,MSBALL4=-128,INT4=Math.pow(2,31);function encode12(r,t,e){t=t||[],e=e||0;for(var n=e;r>=INT4;)t[e++]=r&255|MSB4,r/=128;for(;r&MSBALL4;)t[e++]=r&255|MSB4,r>>>=7;return t[e]=r|0,encode12.bytes=e-n+1,t}var decode17=read4,MSB$14=128,REST$14=127;function read4(r,n){var e=0,n=n||0,i=0,o=n,s,a=r.length;do{if(o>=a)throw read4.bytes=0,new RangeError("Could not decode varint");s=r[o++],e+=i<28?(s&REST$14)<<i:(s&REST$14)*Math.pow(2,i),i+=7}while(s>=MSB$14);return read4.bytes=o-n,e}var N14=Math.pow(2,7),N24=Math.pow(2,14),N34=Math.pow(2,21),N44=Math.pow(2,28),N54=Math.pow(2,35),N64=Math.pow(2,42),N74=Math.pow(2,49),N84=Math.pow(2,56),N94=Math.pow(2,63),length4=function(r){return r<N14?1:r<N24?2:r<N34?3:r<N44?4:r<N54?5:r<N64?6:r<N74?7:r<N84?8:r<N94?9:10},varint4={encode:encode_14,decode:decode17,encodingLength:length4},_brrp_varint4=varint4,varint_default4=_brrp_varint4,decode18=(r,t=0)=>[varint_default4.decode(r,t),varint_default4.decode.bytes],encodeTo4=(r,t,e=0)=>(varint_default4.encode(r,t,e),t),encodingLength4=r=>varint_default4.encodingLength(r),create4=(r,t)=>{const e=t.byteLength,n=encodingLength4(r),i=n+encodingLength4(e),o=new Uint8Array(i+e);return encodeTo4(r,o,0),encodeTo4(e,o,n),o.set(t,i),new Digest4(r,e,t,o)},decode19=r=>{const t=coerce4(r),[e,n]=decode18(t),[i,o]=decode18(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Digest4(e,i,s,t)},equals9=(r,t)=>{if(r===t)return!0;{const e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&equals8(r.bytes,e.bytes)}},Digest4=class{constructor(r,t,e,n){this.code=r,this.size=t,this.digest=e,this.bytes=n}},base58btc4=baseX4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var format4=(r,t)=>{const{bytes:e,version:n}=r;switch(n){case 0:return toStringV04(e,baseCache4(r),t||base58btc4.encoder);default:return toStringV14(e,baseCache4(r),t||base324.encoder)}},cache4=new WeakMap,baseCache4=r=>{const t=cache4.get(r);if(t==null){const e=new Map;return cache4.set(r,e),e}return t},CID4=class L{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:t,multihash:e}=this;if(t!==DAG_PB_CODE4)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==SHA_256_CODE4)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return L.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:t,digest:e}=this.multihash,n=create4(t,e);return L.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return L.equals(this,t)}static equals(t,e){const n=e;return n&&t.code===n.code&&t.version===n.version&&equals9(t.multihash,n.multihash)}toString(t){return format4(this,t)}toJSON(){return{"/":format4(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;const e=t;if(e instanceof L)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){const{version:n,code:i,multihash:o,bytes:s}=e;return new L(n,i,o,s||encodeCID4(n,i,o.bytes))}else if(e[cidSymbol4]===!0){const{version:n,multihash:i,code:o}=e,s=decode19(i);return L.create(n,o,s)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==DAG_PB_CODE4)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE4}) block encoding`);return new L(t,e,n,n.bytes)}case 1:{const i=encodeCID4(t,e,n.bytes);return new L(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return L.create(0,DAG_PB_CODE4,t)}static createV1(t,e){return L.create(1,t,e)}static decode(t){const[e,n]=L.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){const e=L.inspectBytes(t),n=e.size-e.multihashSize,i=coerce4(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");const o=i.subarray(e.multihashSize-e.digestSize),s=new Digest4(e.multihashCode,e.digestSize,o,i);return[e.version===0?L.createV0(s):L.createV1(e.codec,s),t.subarray(e.size)]}static inspectBytes(t){let e=0;const n=()=>{const[g,b]=decode18(t.subarray(e));return e+=b,g};let i=n(),o=DAG_PB_CODE4;if(i===18?(i=0,e=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);const s=e,a=n(),u=n(),h=e+u,f=h-s;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:f,size:h}}static parse(t,e){const[n,i]=parseCIDtoBytes4(t,e),o=L.decode(i);if(o.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache4(o).set(n,t),o}},parseCIDtoBytes4=(r,t)=>{switch(r[0]){case"Q":{const e=t||base58btc4;return[base58btc4.prefix,e.decode(`${base58btc4.prefix}${r}`)]}case base58btc4.prefix:{const e=t||base58btc4;return[base58btc4.prefix,e.decode(r)]}case base324.prefix:{const e=t||base324;return[base324.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},toStringV04=(r,t,e)=>{const{prefix:n}=e;if(n!==base58btc4.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);const i=t.get(n);if(i==null){const o=e.encode(r).slice(1);return t.set(n,o),o}else return i},toStringV14=(r,t,e)=>{const{prefix:n}=e,i=t.get(n);if(i==null){const o=e.encode(r);return t.set(n,o),o}else return i},DAG_PB_CODE4=112,SHA_256_CODE4=18,encodeCID4=(r,t,e)=>{const n=encodingLength4(r),i=n+encodingLength4(t),o=new Uint8Array(i+e.byteLength);return encodeTo4(r,o,0),encodeTo4(t,o,n),o.set(e,i),o},cidSymbol4=Symbol.for("@ipld/js-cid/CID"),code4=85,MemoryBlockstore=class extends BaseBlockstore{constructor(){super();D(this,"data");this.data=new Map}put(t,e){return this.data.set(base324.encode(t.multihash.bytes),e),t}get(t){const e=this.data.get(base324.encode(t.multihash.bytes));if(e==null)throw notFoundError();return e}has(t){return this.data.has(base324.encode(t.multihash.bytes))}async delete(t){this.data.delete(base324.encode(t.multihash.bytes))}async*getAll(){for(const[t,e]of this.data.entries())yield{cid:CID4.createV1(code4,decode19(base324.decode(t))),block:e}}};({...errors_exports});async function hashV0(r){const t=import_crypto3.default.createHash("sha256");if(r instanceof Uint8Array)t.update(r);else if(Symbol.asyncIterator in r)for await(const e of r)t.update(e);else throw new Error("Invalid value provided to hashStreamV0. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return CID.createV0(create(18,t.digest())).toString()}async function hashV1(r){const t=new MemoryBlockstore;let e;async function*n(){yield r}if(r instanceof Uint8Array)for await(const{cid:i}of importer([{content:n()}],t,{cidVersion:1,rawLeaves:!0}))e=i;else if(Symbol.asyncIterator in r)for await(const{cid:i}of importer([{content:r}],t,{cidVersion:1,rawLeaves:!0}))e=i;else throw new Error("Invalid value provided to hashStreamV1. Expected AsyncGenerator<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array");return`${e}`}function sortKeys(r,t){return compareStrings(r.hash,t.hash)||compareStrings(r.file,t.file)||0}function compareStrings(r,t){if(r===t)return 0;for(let e=0;e<Math.max(r.length,t.length);e++){if(r.charAt(e)>t.charAt(e))return 1;if(r.charAt(e)<t.charAt(e))return-1}return r.length>t.length?1:-1}function prepareADR32Data(r,t){return new TextEncoder().encode(JSON.stringify({content:r.sort(sortKeys).map(e=>({key:e.file,hash:e.hash})),metadata:t}))}async function calculateMultipleHashesADR32(r,t){const e=prepareADR32Data(r,t);return{data:e,hash:await hashV1(e)}}async function calculateMultipleHashesADR32LegacyQmHash(r,t){const e=prepareADR32Data(r,t);return{data:e,hash:await hashV0(e)}}function number(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function bool(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function bytes(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function hash(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(r.outputLen),number(r.blockLen)}function exists2(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function output(r,t){bytes(r);const e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var assert={number,bool,bytes,hash,exists:exists2,output},assert_default=assert,U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(r,t=!1){return t?{h:Number(r&U32_MASK64),l:Number(r>>_32n&U32_MASK64)}:{h:Number(r>>_32n&U32_MASK64)|0,l:Number(r&U32_MASK64)|0}}function split(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){const{h:o,l:s}=fromBig(r[i],t);[e[i],n[i]]=[o,s]}return[e,n]}var toBig=(r,t)=>BigInt(r>>>0)<<_32n|BigInt(t>>>0),shrSH=(r,t,e)=>r>>>e,shrSL=(r,t,e)=>r<<32-e|t>>>e,rotrSH=(r,t,e)=>r>>>e|t<<32-e,rotrSL=(r,t,e)=>r<<32-e|t>>>e,rotrBH=(r,t,e)=>r<<64-e|t>>>e-32,rotrBL=(r,t,e)=>r>>>e-32|t<<64-e,rotr32H=(r,t)=>t,rotr32L=(r,t)=>r,rotlSH=(r,t,e)=>r<<e|t>>>32-e,rotlSL=(r,t,e)=>t<<e|r>>>32-e,rotlBH=(r,t,e)=>t<<e-32|r>>>64-e,rotlBL=(r,t,e)=>r<<e-32|t>>>64-e;function add(r,t,e,n){const i=(t>>>0)+(n>>>0);return{h:r+e+(i/2**32|0)|0,l:i|0}}var add3L=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),add3H=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,add4L=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),add4H=(r,t,e,n,i)=>t+e+n+i+(r/2**32|0)|0,add5L=(r,t,e,n,i)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(i>>>0),add5H=(r,t,e,n,i,o)=>t+e+n+i+o+(r/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},u64_default=u64,u8a=r=>r instanceof Uint8Array,u32=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");var hexes=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function bytesToHex(r){if(!u8a(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=hexes[r[e]];return t}function utf8ToBytes(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function toBytes(r){if(typeof r=="string"&&(r=utf8ToBytes(r)),!u8a(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}var Hash=class{clone(){return this._cloneInto()}};function wrapConstructor(r){const t=n=>r().update(toBytes(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function wrapXOFConstructorWithOpts(r){const t=(n,i)=>r(i).update(toBytes(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}var[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]],_0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let r=0,t=_1n,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],SHA3_PI.push(2*(5*n+e)),SHA3_ROTL.push((r+1)*(r+2)/2%64);let i=_0n;for(let o=0;o<7;o++)t=(t<<_1n^(t>>_7n)*_0x71n)%_256n,t&_2n&&(i^=_1n<<(_1n<<BigInt(o))-_1n);_SHA3_IOTA.push(i)}var[SHA3_IOTA_H,SHA3_IOTA_L]=u64_default.split(_SHA3_IOTA,!0),rotlH=(r,t,e)=>e>32?u64_default.rotlBH(r,t,e):u64_default.rotlSH(r,t,e),rotlL=(r,t,e)=>e>32?u64_default.rotlBL(r,t,e):u64_default.rotlSL(r,t,e);function keccakP(r,t=24){const e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)e[s]=r[s]^r[s+10]^r[s+20]^r[s+30]^r[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,u=(s+2)%10,h=e[u],f=e[u+1],g=rotlH(h,f,1)^e[a],b=rotlL(h,f,1)^e[a+1];for(let y=0;y<50;y+=10)r[s+y]^=g,r[s+y+1]^=b}let i=r[2],o=r[3];for(let s=0;s<24;s++){const a=SHA3_ROTL[s],u=rotlH(i,o,a),h=rotlL(i,o,a),f=SHA3_PI[s];i=r[f],o=r[f+1],r[f]=u,r[f+1]=h}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)e[a]=r[s+a];for(let a=0;a<10;a++)r[s+a]^=~e[(a+2)%10]&e[(a+4)%10]}r[0]^=SHA3_IOTA_H[n],r[1]^=SHA3_IOTA_L[n]}e.fill(0)}var Keccak=class O extends Hash{constructor(t,e,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,assert_default.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){assert_default.exists(this);const{blockLen:e,state:n}=this;t=toBytes(t);const i=t.length;for(let o=0;o<i;){const s=Math.min(e-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:i}=this;t[n]^=e,(e&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){assert_default.exists(this,!1),assert_default.bytes(t),this.finish();const e=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,o-i);t.set(e.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return assert_default.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(assert_default.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new O(e,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}},gen=(r,t,e)=>wrapConstructor(()=>new Keccak(t,r,e));gen(6,144,224/8),gen(6,136,256/8),gen(6,104,384/8),gen(6,72,512/8),gen(1,144,224/8);var keccak_256=gen(1,136,256/8);gen(1,104,384/8),gen(1,72,512/8);var genShake=(r,t,e)=>wrapXOFConstructorWithOpts((n={})=>new Keccak(t,r,n.dkLen===void 0?e:n.dkLen,!0));genShake(31,168,128/8),genShake(31,136,256/8);function wrapHash2(r){return t=>(assert_default.bytes(t),r(t))}(()=>{const r=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof commonjsRequire=="function"&&commonjsRequire.bind(module);return{node:t&&!r?t("crypto"):void 0,web:r}})();var keccak256=(()=>{const r=wrapHash2(keccak_256);return r.create=keccak_256.create,r})();function keccak256Hash(r,t){const e=JSON.stringify(pick(r,t)),n=new TextEncoder().encode(e),i=keccak256(n);return bytesToHex(i)}var pick=(r,t)=>Object.fromEntries(t.filter(e=>e in r).map(e=>[e,r[e]]));/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@noble/hashes/esm/utils.js:
|
|
4
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
5
|
+
*/})(dist)),dist.exports}export{requireDist as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as se}from"./ethers-D-4WUfRB.js";import{K as Wr,$ as qr,B as Kr,q as Vr,J as Ye,m as Xr}from"./index-Ba1nPvJW.js";import{g as lt,R as dt,T as vt,k as ht,E as yt,a as pt,V as mt,s as bt,I as gt,A as _t,x as wt,N as It,f as Et,d as St,v as Ot,_ as jt,b as Nt,h as At,O as Bt,y as kt,c as xt,e as Dt,W as Rt,p as Ct,U as Lt,L as Mt,u as Tt,i as zt}from"./index-Ba1nPvJW.js";import"./react-iAgwec9M.js";var Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return(function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P})({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=(function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e})(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=(function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a})();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Vr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Xr()})}},ct=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{lt as DeepLinkPage,dt as DeviceVerificationEventEmit,vt as DeviceVerificationEventOnReceived,ht as EthChainType,yt as Events,pt as Extension,mt as ExtensionError,bt as ExtensionWarning,gt as LoginWithEmailOTPEventEmit,_t as LoginWithEmailOTPEventOnReceived,wt as LoginWithMagicLinkEventEmit,It as LoginWithMagicLinkEventOnReceived,ct as Magic,Et as MagicIncomingWindowMessage,St as MagicOutgoingWindowMessage,Ot as MagicPayloadMethod,jt as RPCError,Nt as RPCErrorCode,At as RecencyCheckEventEmit,Bt as RecencyCheckEventOnReceived,kt as RecoveryMethodType,xt as SDKError,Dt as SDKErrorCode,Rt as SDKWarning,Ct as SDKWarningCode,Lt as UpdateEmailEventEmit,Mt as UpdateEmailEventOnReceived,Tt as Wallets,zt as isPromiEvent};
|
|
1
|
+
import{g as se}from"./ethers-DwWf2RqE.js";import{K as Wr,$ as qr,B as Kr,q as Vr,J as Ye,m as Xr}from"./index-DNGhO1UM.js";import{g as lt,R as dt,T as vt,k as ht,E as yt,a as pt,V as mt,s as bt,I as gt,A as _t,x as wt,N as It,f as Et,d as St,v as Ot,_ as jt,b as Nt,h as At,O as Bt,y as kt,c as xt,e as Dt,W as Rt,p as Ct,U as Lt,L as Mt,u as Tt,i as zt}from"./index-DNGhO1UM.js";import"./react-C51i12iP.js";var Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return(function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P})({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=(function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e})(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=(function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a})();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Vr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Xr()})}},ct=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{lt as DeepLinkPage,dt as DeviceVerificationEventEmit,vt as DeviceVerificationEventOnReceived,ht as EthChainType,yt as Events,pt as Extension,mt as ExtensionError,bt as ExtensionWarning,gt as LoginWithEmailOTPEventEmit,_t as LoginWithEmailOTPEventOnReceived,wt as LoginWithMagicLinkEventEmit,It as LoginWithMagicLinkEventOnReceived,ct as Magic,Et as MagicIncomingWindowMessage,St as MagicOutgoingWindowMessage,Ot as MagicPayloadMethod,jt as RPCError,Nt as RPCErrorCode,At as RecencyCheckEventEmit,Bt as RecencyCheckEventOnReceived,kt as RecoveryMethodType,xt as SDKError,Dt as SDKErrorCode,Rt as SDKWarning,Ct as SDKWarningCode,Lt as UpdateEmailEventEmit,Mt as UpdateEmailEventOnReceived,Tt as Wallets,zt as isPromiEvent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m,i as c,b as d}from"./lit-element-B3y9oplH.js";import{n as u,o as f}from"./class-map-CxwNmq0D.js";import{c as b}from"./index-
|
|
1
|
+
import{a as m,i as c,b as d}from"./lit-element-B3y9oplH.js";import{n as u,o as f}from"./class-map-CxwNmq0D.js";import{c as b}from"./index-CrKpXY-Z.js";import{r as h}from"./index-D4UonDIb.js";import"./index-Iapi1Q6R.js";const v=m`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: inline-block;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-
|
|
1
|
+
import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-D4UonDIb.js";import{c as p,U as F}from"./index-CrKpXY-Z.js";import"./index-BxnBUVzy.js";import"./index-CGecUMNA.js";import"./index-DeBofuPQ.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-BvT93_mb.js";import"./index-DOk2P7Zl.js";import{W as Bs,a as Us}from"./index-kA7_bUnK.js";import"./index-EiHJjF_U.js";import"./index-BiY5ZJ1L.js";import"./index-EYxoPD15.js";import{au as S}from"./NetworkUtil-DInevqnn.js";import{H as Jt}from"./HelpersUtil-BeiA-N3I.js";import{n as Zi}from"./index-CJQuE4Vh.js";import{E as Q}from"./ExchangeController-D4CpJ8kl.js";import"./index-Dqw_U4li.js";import"./index-CYZw7sLz.js";import"./index-Bz7fb3vC.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-Dl9lo-Tk.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-Iapi1Q6R.js";import"./index-DfyoH385.js";import"./index-CUe6g2db.js";import"./index-BtK9ZDTb.js";import{O as bt}from"./index-D2HgI4Mu.js";import{e as en}from"./index-BWmqibNa.js";import"./index-DkIBv-8E.js";import"./index-rfcI92-3.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-CG-dA0rF.js";import"./index-C0kv5kHB.js";import"./react-C51i12iP.js";import"./ethers-DwWf2RqE.js";import"./index-CEeQH9eo.js";import"./events-DQ172AOg.js";import"./index-DT90wIp1.js";import"./index-CjpJ162L.js";import"./index-nibyPLVP.js";import"./index-sr7QrKQZ.js";import"./index.es-DHouqHFo.js";import"./browser-ponyfill-Djb5Py6a.js";import"./browser-ponyfill-DMgE6PM5.js";import"./ConstantsUtil-BTo1-KgH.js";import"./async-directive-BRxn_Py3.js";import"./browser-9oFjBwrz.js";const nn=v`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
@@ -3423,4 +3423,4 @@ import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as
|
|
|
3423
3423
|
${this.isSigning?"Signing...":"Sign"}
|
|
3424
3424
|
</wui-button>
|
|
3425
3425
|
</wui-flex>
|
|
3426
|
-
`}async onSign(){this.isSigning=!0;try{await Bt.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){A.showError({message:"Something went wrong. We need to verify your account again."}),h.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Bt.cancelSignMessage().finally(()=>this.isCancelling=!1)}};li([u()],Tt.prototype,"isCancelling",void 0);li([u()],Tt.prototype,"isSigning",void 0);Tt=li([p("w3m-siwx-sign-message-view")],Tt);export{di as AppKitAccountButton,hi as AppKitButton,wi as AppKitConnectButton,mi as AppKitNetworkButton,ci as W3mAccountButton,be as W3mAccountSettingsView,Ft as W3mAccountView,vt as W3mAllWalletsView,ui as W3mButton,At as W3mChooseAccountNameView,pi as W3mConnectButton,H as W3mConnectView,It as W3mConnectWalletsView,xi as W3mConnectingExternalView,Ct as W3mConnectingMultiChainView,kt as W3mConnectingWcBasicView,we as W3mConnectingWcView,Si as W3mDownloadsView,
|
|
3426
|
+
`}async onSign(){this.isSigning=!0;try{await Bt.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){A.showError({message:"Something went wrong. We need to verify your account again."}),h.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Bt.cancelSignMessage().finally(()=>this.isCancelling=!1)}};li([u()],Tt.prototype,"isCancelling",void 0);li([u()],Tt.prototype,"isSigning",void 0);Tt=li([p("w3m-siwx-sign-message-view")],Tt);export{di as AppKitAccountButton,hi as AppKitButton,wi as AppKitConnectButton,mi as AppKitNetworkButton,ci as W3mAccountButton,be as W3mAccountSettingsView,Ft as W3mAccountView,vt as W3mAllWalletsView,ui as W3mButton,At as W3mChooseAccountNameView,pi as W3mConnectButton,H as W3mConnectView,It as W3mConnectWalletsView,xi as W3mConnectingExternalView,Ct as W3mConnectingMultiChainView,kt as W3mConnectingWcBasicView,we as W3mConnectingWcView,Si as W3mDownloadsView,Bs as W3mFooter,Re as W3mFundWalletView,Ei as W3mGetWalletView,fi as W3mNetworkButton,ot as W3mNetworkSwitchView,Le as W3mNetworksView,B as W3mProfileWalletsView,Us as W3mRouter,Tt as W3mSIWXSignMessageView,_t as W3mSwitchActiveChainView,rt as W3mUnsupportedChainView,Kt as W3mWalletCompatibleNetworksView,Ai as W3mWhatIsANetworkView,ki as W3mWhatIsAWalletView};
|