@dcl/profile-site 0.2.0 → 0.2.1-5588336189.commit-f75e601

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.
@@ -709,7 +709,7 @@ Minimum version required to store current data is: `+Qt+`.
709
709
  margin-bottom: 8px;
710
710
  }
711
711
  `;typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function _catch(Bt,Wt){try{var Gt=Bt()}catch(Yt){return Wt(Yt)}return Gt&&Gt.then?Gt.then(void 0,Wt):Gt}var WALLETCONNECT_LOGO_SVG_URL="data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",WALLETCONNECT_HEADER_TEXT="WalletConnect",ANIMATION_DURATION=300,DEFAULT_BUTTON_COLOR="rgb(64, 153, 255)",WALLETCONNECT_WRAPPER_ID="walletconnect-wrapper",WALLETCONNECT_STYLE_ID="walletconnect-style-sheet",WALLETCONNECT_MODAL_ID="walletconnect-qrcode-modal",WALLETCONNECT_CLOSE_BUTTON_ID="walletconnect-qrcode-close",WALLETCONNECT_CTA_TEXT_ID="walletconnect-qrcode-text",WALLETCONNECT_CONNECT_BUTTON_ID="walletconnect-connect-button";function Header$5(Bt){return React$S.createElement("div",{className:"walletconnect-modal__header"},React$S.createElement("img",{src:WALLETCONNECT_LOGO_SVG_URL,className:"walletconnect-modal__headerLogo"}),React$S.createElement("p",null,WALLETCONNECT_HEADER_TEXT),React$S.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:Bt.onClose},React$S.createElement("div",{id:WALLETCONNECT_CLOSE_BUTTON_ID,className:"walletconnect-modal__close__icon"},React$S.createElement("div",{className:"walletconnect-modal__close__line1"}),React$S.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function ConnectButton(Bt){return React$S.createElement("a",{className:"walletconnect-connect__button",href:Bt.href,id:WALLETCONNECT_CONNECT_BUTTON_ID+"-"+Bt.name,onClick:Bt.onClick,rel:"noopener noreferrer",style:{backgroundColor:Bt.color},target:"_blank"},Bt.name)}var CARET_SVG_URL="data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";function WalletButton(Bt){var Wt=Bt.color,Gt=Bt.href,Yt=Bt.name,Xt=Bt.logo,Jt=Bt.onClick;return React$S.createElement("a",{className:"walletconnect-modal__base__row",href:Gt,onClick:Jt,rel:"noopener noreferrer",target:"_blank"},React$S.createElement("h3",{className:"walletconnect-modal__base__row__h3"},Yt),React$S.createElement("div",{className:"walletconnect-modal__base__row__right"},React$S.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+Xt+"') "+Wt,backgroundSize:"100%"}}),React$S.createElement("img",{src:CARET_SVG_URL,className:"walletconnect-modal__base__row__right__caret"})))}function WalletIcon$3(Bt){var Wt=Bt.color,Gt=Bt.href,Yt=Bt.name,Xt=Bt.logo,Jt=Bt.onClick,Zt=window.innerWidth<768?(Yt.length>8?2.5:2.7)+"vw":"inherit";return React$S.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:Gt,onClick:Jt,rel:"noopener noreferrer",target:"_blank"},React$S.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+Xt+"') "+Wt,backgroundSize:"100%"}}),React$S.createElement("div",{style:{fontSize:Zt},className:"walletconnect-connect__button__text"},Yt))}var GRID_MIN_COUNT=5,LINKS_PER_PAGE=12;function LinkDisplay(Bt){var Wt=browserUtils.isAndroid(),Gt=React$S.useState(""),Yt=Gt[0],Xt=Gt[1],Jt=React$S.useState(""),Zt=Jt[0],Qt=Jt[1],ur=React$S.useState(1),cr=ur[0],$r=ur[1],Ar=Zt?Bt.links.filter(function(Yr){return Yr.name.toLowerCase().includes(Zt.toLowerCase())}):Bt.links,Lr=Bt.errorMessage,qr=Zt||Ar.length>GRID_MIN_COUNT,Fr=Math.ceil(Ar.length/LINKS_PER_PAGE),Hr=[(cr-1)*LINKS_PER_PAGE+1,cr*LINKS_PER_PAGE],Br=Ar.length?Ar.filter(function(Yr,hn){return hn+1>=Hr[0]&&hn+1<=Hr[1]}):[],Wr=!Wt&&Fr>1,Gr=void 0;function Kr(Yr){Xt(Yr.target.value),clearTimeout(Gr),Yr.target.value?Gr=setTimeout(function(){Qt(Yr.target.value),$r(1)},1e3):(Xt(""),Qt(""),$r(1))}return React$S.createElement("div",null,React$S.createElement("p",{id:WALLETCONNECT_CTA_TEXT_ID,className:"walletconnect-qrcode__text"},Wt?Bt.text.connect_mobile_wallet:Bt.text.choose_preferred_wallet),!Wt&&React$S.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:Yt,onChange:Kr}),React$S.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(Wt?"__android":qr&&Ar.length?"__wrap":"")},Wt?React$S.createElement(ConnectButton,{name:Bt.text.connect,color:DEFAULT_BUTTON_COLOR,href:Bt.uri,onClick:React$S.useCallback(function(){browserUtils.saveMobileLinkInfo({name:"Unknown",href:Bt.uri})},[])}):Br.length?Br.map(function(Yr){var hn=Yr.color,Qr=Yr.name,pn=Yr.shortName,En=Yr.logo,ga=browserUtils.formatIOSMobile(Bt.uri,Yr),dn=React$S.useCallback(function(){browserUtils.saveMobileLinkInfo({name:Qr,href:ga})},[Br]);return qr?React$S.createElement(WalletIcon$3,{color:hn,href:ga,name:pn||Qr,logo:En,onClick:dn}):React$S.createElement(WalletButton,{color:hn,href:ga,name:Qr,logo:En,onClick:dn})}):React$S.createElement(React$S.Fragment,null,React$S.createElement("p",null,Lr.length?Bt.errorMessage:Bt.links.length&&!Ar.length?Bt.text.no_wallets_found:Bt.text.loading))),Wr&&React$S.createElement("div",{className:"walletconnect-modal__footer"},Array(Fr).fill(0).map(function(Yr,hn){var Qr=hn+1,pn=cr===Qr;return React$S.createElement("a",{style:{margin:"auto 10px",fontWeight:pn?"bold":"normal"},onClick:function(){return $r(Qr)}},Qr)})))}function Notification(Bt){var Wt=!!Bt.message.trim();return React$S.createElement("div",{className:"walletconnect-qrcode__notification"+(Wt?" notification__show":"")},Bt.message)}var formatQRCodeImage=function(Bt){try{var Wt="";return Promise.resolve(QRCode.toString(Bt,{margin:0,type:"svg"})).then(function(Gt){return typeof Gt=="string"&&(Wt=Gt.replace("<svg",'<svg class="walletconnect-qrcode__image"')),Wt})}catch(Gt){return Promise.reject(Gt)}};function QRCodeDisplay(Bt){var Wt=React$S.useState(""),Gt=Wt[0],Yt=Wt[1],Xt=React$S.useState(""),Jt=Xt[0],Zt=Xt[1];React$S.useEffect(function(){try{return Promise.resolve(formatQRCodeImage(Bt.uri)).then(function(ur){Zt(ur)})}catch(ur){Promise.reject(ur)}},[]);var Qt=function(){var ur=copy$2(Bt.uri);ur?(Yt(Bt.text.copied_to_clipboard),setInterval(function(){return Yt("")},1200)):(Yt("Error"),setInterval(function(){return Yt("")},1200))};return React$S.createElement("div",null,React$S.createElement("p",{id:WALLETCONNECT_CTA_TEXT_ID,className:"walletconnect-qrcode__text"},Bt.text.scan_qrcode_with_wallet),React$S.createElement("div",{dangerouslySetInnerHTML:{__html:Jt}}),React$S.createElement("div",{className:"walletconnect-modal__footer"},React$S.createElement("a",{onClick:Qt},Bt.text.copy_to_clipboard)),React$S.createElement(Notification,{message:Gt}))}function Modal$a(Bt){var Wt=browserUtils.isAndroid(),Gt=browserUtils.isMobile(),Yt=Gt?Bt.qrcodeModalOptions&&Bt.qrcodeModalOptions.mobileLinks?Bt.qrcodeModalOptions.mobileLinks:void 0:Bt.qrcodeModalOptions&&Bt.qrcodeModalOptions.desktopLinks?Bt.qrcodeModalOptions.desktopLinks:void 0,Xt=React$S.useState(!1),Jt=Xt[0],Zt=Xt[1],Qt=React$S.useState(!1),ur=Qt[0],cr=Qt[1],$r=React$S.useState(!Gt),Ar=$r[0],Lr=$r[1],qr={mobile:Gt,text:Bt.text,uri:Bt.uri,qrcodeModalOptions:Bt.qrcodeModalOptions},Fr=React$S.useState(""),Hr=Fr[0],Br=Fr[1],Wr=React$S.useState(!1),Gr=Wr[0],Kr=Wr[1],Yr=React$S.useState([]),hn=Yr[0],Qr=Yr[1],pn=React$S.useState(""),En=pn[0],ga=pn[1],dn=function(){ur||Jt||Yt&&!Yt.length||hn.length>0||React$S.useEffect(function(){var xr=function(){try{if(Wt)return Promise.resolve();Zt(!0);var Mr=_catch(function(){var Nr=Bt.qrcodeModalOptions&&Bt.qrcodeModalOptions.registryUrl?Bt.qrcodeModalOptions.registryUrl:browserUtils.getWalletRegistryUrl();return Promise.resolve(fetch(Nr)).then(function(Ur){return Promise.resolve(Ur.json()).then(function(Vr){var Zr=Vr.listings,Xr=Gt?"mobile":"desktop",Or=browserUtils.getMobileLinkRegistry(browserUtils.formatMobileRegistry(Zr,Xr),Yt);Zt(!1),cr(!0),ga(Or.length?"":Bt.text.no_supported_wallets),Qr(Or);var jr=Or.length===1;jr&&(Br(browserUtils.formatIOSMobile(Bt.uri,Or[0])),Lr(!0)),Kr(jr)})})},function(Nr){Zt(!1),cr(!0),ga(Bt.text.something_went_wrong),console.error(Nr)});return Promise.resolve(Mr&&Mr.then?Mr.then(function(){}):void 0)}catch(Nr){return Promise.reject(Nr)}};xr()})};dn();var Pr=Gt?Ar:!Ar;return React$S.createElement("div",{id:WALLETCONNECT_MODAL_ID,className:"walletconnect-qrcode__base animated fadeIn"},React$S.createElement("div",{className:"walletconnect-modal__base"},React$S.createElement(Header$5,{onClose:Bt.onClose}),Gr&&Ar?React$S.createElement("div",{className:"walletconnect-modal__single_wallet"},React$S.createElement("a",{onClick:function(){return browserUtils.saveMobileLinkInfo({name:hn[0].name,href:Hr})},href:Hr,rel:"noopener noreferrer",target:"_blank"},Bt.text.connect_with+" "+(Gr?hn[0].name:"")+" ›")):Wt||Jt||!Jt&&hn.length?React$S.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(Pr?" right__selected":"")},React$S.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),Gt?React$S.createElement(React$S.Fragment,null,React$S.createElement("a",{onClick:function(){return Lr(!1),dn()}},Bt.text.mobile),React$S.createElement("a",{onClick:function(){return Lr(!0)}},Bt.text.qrcode)):React$S.createElement(React$S.Fragment,null,React$S.createElement("a",{onClick:function(){return Lr(!0)}},Bt.text.qrcode),React$S.createElement("a",{onClick:function(){return Lr(!1),dn()}},Bt.text.desktop))):null,React$S.createElement("div",null,Ar||!Wt&&!Jt&&!hn.length?React$S.createElement(QRCodeDisplay,Object.assign({},qr)):React$S.createElement(LinkDisplay,Object.assign({},qr,{links:hn,errorMessage:En})))))}var de$1={choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},en$5={choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es$5={choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr$2={choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},ko$1={choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},pt$2={choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh$2={choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},fa={choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"},languages={de:de$1,en:en$5,es:es$5,fr:fr$2,ko:ko$1,pt:pt$2,zh:zh$2,fa};function injectStyleSheet(){var Bt=browserUtils.getDocumentOrThrow(),Wt=Bt.getElementById(WALLETCONNECT_STYLE_ID);Wt&&Bt.head.removeChild(Wt);var Gt=Bt.createElement("style");Gt.setAttribute("id",WALLETCONNECT_STYLE_ID),Gt.innerText=WALLETCONNECT_STYLE_SHEET,Bt.head.appendChild(Gt)}function renderWrapper(){var Bt=browserUtils.getDocumentOrThrow(),Wt=Bt.createElement("div");return Wt.setAttribute("id",WALLETCONNECT_WRAPPER_ID),Bt.body.appendChild(Wt),Wt}function triggerCloseAnimation(){var Bt=browserUtils.getDocumentOrThrow(),Wt=Bt.getElementById(WALLETCONNECT_MODAL_ID);Wt&&(Wt.className=Wt.className.replace("fadeIn","fadeOut"),setTimeout(function(){var Gt=Bt.getElementById(WALLETCONNECT_WRAPPER_ID);Gt&&Bt.body.removeChild(Gt)},ANIMATION_DURATION))}function getWrappedCallback(Bt){return function(){triggerCloseAnimation(),Bt&&Bt()}}function getText(){var Bt=browserUtils.getNavigatorOrThrow().language.split("-")[0]||"en";return languages[Bt]||languages.en}function open$1(Bt,Wt,Gt){injectStyleSheet();var Yt=renderWrapper();React$S.render(React$S.createElement(Modal$a,{text:getText(),uri:Bt,onClose:getWrappedCallback(Wt),qrcodeModalOptions:Gt}),Yt)}function close$1(){triggerCloseAnimation()}var isNode=function(){return typeof browser$1$1<"u"&&typeof browser$1$1.versions<"u"&&typeof browser$1$1.versions.node<"u"};function open$2(Bt,Wt,Gt){console.log(Bt),isNode()?open(Bt):open$1(Bt,Wt,Gt)}function close$2(){isNode()||close$1()}var index$5={open:open$2,close:close$2},cjs$6=index$5;const QRCodeModal=getDefaultExportFromCjs(cjs$6);var eventemitter3={exports:{}};(function(Bt){var Wt=Object.prototype.hasOwnProperty,Gt="~";function Yt(){}Object.create&&(Yt.prototype=Object.create(null),new Yt().__proto__||(Gt=!1));function Xt(ur,cr,$r){this.fn=ur,this.context=cr,this.once=$r||!1}function Jt(ur,cr,$r,Ar,Lr){if(typeof $r!="function")throw new TypeError("The listener must be a function");var qr=new Xt($r,Ar||ur,Lr),Fr=Gt?Gt+cr:cr;return ur._events[Fr]?ur._events[Fr].fn?ur._events[Fr]=[ur._events[Fr],qr]:ur._events[Fr].push(qr):(ur._events[Fr]=qr,ur._eventsCount++),ur}function Zt(ur,cr){--ur._eventsCount===0?ur._events=new Yt:delete ur._events[cr]}function Qt(){this._events=new Yt,this._eventsCount=0}Qt.prototype.eventNames=function(){var cr=[],$r,Ar;if(this._eventsCount===0)return cr;for(Ar in $r=this._events)Wt.call($r,Ar)&&cr.push(Gt?Ar.slice(1):Ar);return Object.getOwnPropertySymbols?cr.concat(Object.getOwnPropertySymbols($r)):cr},Qt.prototype.listeners=function(cr){var $r=Gt?Gt+cr:cr,Ar=this._events[$r];if(!Ar)return[];if(Ar.fn)return[Ar.fn];for(var Lr=0,qr=Ar.length,Fr=new Array(qr);Lr<qr;Lr++)Fr[Lr]=Ar[Lr].fn;return Fr},Qt.prototype.listenerCount=function(cr){var $r=Gt?Gt+cr:cr,Ar=this._events[$r];return Ar?Ar.fn?1:Ar.length:0},Qt.prototype.emit=function(cr,$r,Ar,Lr,qr,Fr){var Hr=Gt?Gt+cr:cr;if(!this._events[Hr])return!1;var Br=this._events[Hr],Wr=arguments.length,Gr,Kr;if(Br.fn){switch(Br.once&&this.removeListener(cr,Br.fn,void 0,!0),Wr){case 1:return Br.fn.call(Br.context),!0;case 2:return Br.fn.call(Br.context,$r),!0;case 3:return Br.fn.call(Br.context,$r,Ar),!0;case 4:return Br.fn.call(Br.context,$r,Ar,Lr),!0;case 5:return Br.fn.call(Br.context,$r,Ar,Lr,qr),!0;case 6:return Br.fn.call(Br.context,$r,Ar,Lr,qr,Fr),!0}for(Kr=1,Gr=new Array(Wr-1);Kr<Wr;Kr++)Gr[Kr-1]=arguments[Kr];Br.fn.apply(Br.context,Gr)}else{var Yr=Br.length,hn;for(Kr=0;Kr<Yr;Kr++)switch(Br[Kr].once&&this.removeListener(cr,Br[Kr].fn,void 0,!0),Wr){case 1:Br[Kr].fn.call(Br[Kr].context);break;case 2:Br[Kr].fn.call(Br[Kr].context,$r);break;case 3:Br[Kr].fn.call(Br[Kr].context,$r,Ar);break;case 4:Br[Kr].fn.call(Br[Kr].context,$r,Ar,Lr);break;default:if(!Gr)for(hn=1,Gr=new Array(Wr-1);hn<Wr;hn++)Gr[hn-1]=arguments[hn];Br[Kr].fn.apply(Br[Kr].context,Gr)}}return!0},Qt.prototype.on=function(cr,$r,Ar){return Jt(this,cr,$r,Ar,!1)},Qt.prototype.once=function(cr,$r,Ar){return Jt(this,cr,$r,Ar,!0)},Qt.prototype.removeListener=function(cr,$r,Ar,Lr){var qr=Gt?Gt+cr:cr;if(!this._events[qr])return this;if(!$r)return Zt(this,qr),this;var Fr=this._events[qr];if(Fr.fn)Fr.fn===$r&&(!Lr||Fr.once)&&(!Ar||Fr.context===Ar)&&Zt(this,qr);else{for(var Hr=0,Br=[],Wr=Fr.length;Hr<Wr;Hr++)(Fr[Hr].fn!==$r||Lr&&!Fr[Hr].once||Ar&&Fr[Hr].context!==Ar)&&Br.push(Fr[Hr]);Br.length?this._events[qr]=Br.length===1?Br[0]:Br:Zt(this,qr)}return this},Qt.prototype.removeAllListeners=function(cr){var $r;return cr?($r=Gt?Gt+cr:cr,this._events[$r]&&Zt(this,$r)):(this._events=new Yt,this._eventsCount=0),this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.addListener=Qt.prototype.on,Qt.prefixed=Gt,Qt.EventEmitter=Qt,Bt.exports=Qt})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter$1=getDefaultExportFromCjs(eventemitter3Exports);var dist$g={},xmlHttpRequest={},progressEvent={};Object.defineProperty(progressEvent,"__esModule",{value:!0});var ProgressEvent=function(){function Bt(Wt){this.type=Wt,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}return Bt}();progressEvent.ProgressEvent=ProgressEvent;var errors={},__extends$D=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Wt,Gt){Wt.__proto__=Gt}||function(Wt,Gt){for(var Yt in Gt)Gt.hasOwnProperty(Yt)&&(Wt[Yt]=Gt[Yt])};return function(Wt,Gt){Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}();Object.defineProperty(errors,"__esModule",{value:!0});var SecurityError=function(Bt){__extends$D(Wt,Bt);function Wt(){return Bt!==null&&Bt.apply(this,arguments)||this}return Wt}(Error);errors.SecurityError=SecurityError;var InvalidStateError=function(Bt){__extends$D(Wt,Bt);function Wt(){return Bt!==null&&Bt.apply(this,arguments)||this}return Wt}(Error);errors.InvalidStateError=InvalidStateError;var NetworkError=function(Bt){__extends$D(Wt,Bt);function Wt(){return Bt!==null&&Bt.apply(this,arguments)||this}return Wt}(Error);errors.NetworkError=NetworkError;var SyntaxError$1=function(Bt){__extends$D(Wt,Bt);function Wt(){return Bt!==null&&Bt.apply(this,arguments)||this}return Wt}(Error);errors.SyntaxError=SyntaxError$1;var xmlHttpRequestEventTarget={};Object.defineProperty(xmlHttpRequestEventTarget,"__esModule",{value:!0});var XMLHttpRequestEventTarget=function(){function Bt(){this.listeners={}}return Bt.prototype.addEventListener=function(Wt,Gt){Wt=Wt.toLowerCase(),this.listeners[Wt]=this.listeners[Wt]||[],this.listeners[Wt].push(Gt.handleEvent||Gt)},Bt.prototype.removeEventListener=function(Wt,Gt){if(Wt=Wt.toLowerCase(),!!this.listeners[Wt]){var Yt=this.listeners[Wt].indexOf(Gt.handleEvent||Gt);Yt<0||this.listeners[Wt].splice(Yt,1)}},Bt.prototype.dispatchEvent=function(Wt){var Gt=Wt.type.toLowerCase();if(Wt.target=this,this.listeners[Gt])for(var Yt=0,Xt=this.listeners[Gt];Yt<Xt.length;Yt++){var Jt=Xt[Yt];Jt.call(this,Wt)}var Zt=this["on"+Gt];return Zt&&Zt.call(this,Wt),!0},Bt}();xmlHttpRequestEventTarget.XMLHttpRequestEventTarget=XMLHttpRequestEventTarget;var xmlHttpRequestUpload={},__extends$C=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Wt,Gt){Wt.__proto__=Gt}||function(Wt,Gt){for(var Yt in Gt)Gt.hasOwnProperty(Yt)&&(Wt[Yt]=Gt[Yt])};return function(Wt,Gt){Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}();Object.defineProperty(xmlHttpRequestUpload,"__esModule",{value:!0});var xml_http_request_event_target_1$1=xmlHttpRequestEventTarget,XMLHttpRequestUpload=function(Bt){__extends$C(Wt,Bt);function Wt(){var Gt=Bt.call(this)||this;return Gt._contentType=null,Gt._body=null,Gt._reset(),Gt}return Wt.prototype._reset=function(){this._contentType=null,this._body=null},Wt.prototype._setData=function(Gt){if(Gt!=null)if(typeof Gt=="string")Gt.length!==0&&(this._contentType="text/plain;charset=UTF-8"),this._body=new Buffer$g(Gt,"utf-8");else if(Buffer$g.isBuffer(Gt))this._body=Gt;else if(Gt instanceof ArrayBuffer){for(var Yt=new Buffer$g(Gt.byteLength),Xt=new Uint8Array(Gt),Jt=0;Jt<Gt.byteLength;Jt++)Yt[Jt]=Xt[Jt];this._body=Yt}else if(Gt.buffer&&Gt.buffer instanceof ArrayBuffer){for(var Yt=new Buffer$g(Gt.byteLength),Zt=Gt.byteOffset,Xt=new Uint8Array(Gt.buffer),Jt=0;Jt<Gt.byteLength;Jt++)Yt[Jt]=Xt[Jt+Zt];this._body=Yt}else throw new Error("Unsupported send() data "+Gt)},Wt.prototype._finalizeHeaders=function(Gt,Yt){this._contentType&&!Yt["content-type"]&&(Gt["Content-Type"]=this._contentType),this._body&&(Gt["Content-Length"]=this._body.length.toString())},Wt.prototype._startUpload=function(Gt){this._body&&Gt.write(this._body),Gt.end()},Wt}(xml_http_request_event_target_1$1.XMLHttpRequestEventTarget);xmlHttpRequestUpload.XMLHttpRequestUpload=XMLHttpRequestUpload;var cookiejar={};(function(){function Bt(Xt,Jt,Zt,Qt){return this instanceof Bt?(this.domain=Xt||void 0,this.path=Jt||"/",this.secure=!!Zt,this.script=!!Qt,this):new Bt(Xt,Jt,Zt,Qt)}Bt.All=Object.freeze(Object.create(null)),cookiejar.CookieAccessInfo=Bt;function Wt(Xt,Jt,Zt){return Xt instanceof Wt?Xt:this instanceof Wt?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(Zt||"/"),this.explicit_path=!1,this.domain=Jt||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,Xt&&this.parse(Xt,Jt,Zt),this):new Wt(Xt,Jt,Zt)}cookiejar.Cookie=Wt,Wt.prototype.toString=function(){var Jt=[this.name+"="+this.value];return this.expiration_date!==1/0&&Jt.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&Jt.push("domain="+this.domain),this.path&&Jt.push("path="+this.path),this.secure&&Jt.push("secure"),this.noscript&&Jt.push("httponly"),Jt.join("; ")},Wt.prototype.toValueString=function(){return this.name+"="+this.value};var Gt=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;Wt.prototype.parse=function(Jt,Zt,Qt){if(this instanceof Wt){if(Jt.length>32768){console.warn("Cookie too long for parsing (>32768 characters)");return}var ur=Jt.split(";").filter(function(qr){return!!qr}),cr,$r=ur[0].match(/([^=]+)=([\s\S]*)/);if(!$r){console.warn("Invalid cookie header encountered. Header: '"+Jt+"'");return}var Ar=$r[1],Lr=$r[2];if(typeof Ar!="string"||Ar.length===0||typeof Lr!="string"){console.warn("Unable to extract values from cookie header. Cookie: '"+Jt+"'");return}for(this.name=Ar,this.value=Lr,cr=1;cr<ur.length;cr+=1)switch($r=ur[cr].match(/([^=]+)(?:=([\s\S]*))?/),Ar=$r[1].trim().toLowerCase(),Lr=$r[2],Ar){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=Lr?Number(Date.parse(Lr)):1/0;break;case"path":this.path=Lr?Lr.trim():"",this.explicit_path=!0;break;case"domain":this.domain=Lr?Lr.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0;break}return this.explicit_path||(this.path=Qt||"/"),this.explicit_domain||(this.domain=Zt),this}return new Wt().parse(Jt,Zt,Qt)},Wt.prototype.matches=function(Jt){return Jt===Bt.All?!0:!(this.noscript&&Jt.script||this.secure&&!Jt.secure||!this.collidesWith(Jt))},Wt.prototype.collidesWith=function(Jt){if(this.path&&!Jt.path||this.domain&&!Jt.domain||this.path&&Jt.path.indexOf(this.path)!==0||this.explicit_path&&Jt.path.indexOf(this.path)!==0)return!1;var Zt=Jt.domain&&Jt.domain.replace(/^[\.]/,""),Qt=this.domain&&this.domain.replace(/^[\.]/,"");if(Qt===Zt)return!0;if(Qt){if(!this.explicit_domain)return!1;var ur=Zt.indexOf(Qt);return!(ur===-1||ur!==Zt.length-Qt.length)}return!0};function Yt(){var Xt,Jt,Zt;return this instanceof Yt?(Xt=Object.create(null),this.setCookie=function(ur,cr,$r){var Ar,Lr;if(ur=new Wt(ur,cr,$r),Ar=ur.expiration_date<=Date.now(),Xt[ur.name]!==void 0){for(Jt=Xt[ur.name],Lr=0;Lr<Jt.length;Lr+=1)if(Zt=Jt[Lr],Zt.collidesWith(ur))return Ar?(Jt.splice(Lr,1),Jt.length===0&&delete Xt[ur.name],!1):(Jt[Lr]=ur,ur);return Ar?!1:(Jt.push(ur),ur)}return Ar?!1:(Xt[ur.name]=[ur],Xt[ur.name])},this.getCookie=function(ur,cr){var $r,Ar;if(Jt=Xt[ur],!!Jt)for(Ar=0;Ar<Jt.length;Ar+=1){if($r=Jt[Ar],$r.expiration_date<=Date.now()){Jt.length===0&&delete Xt[$r.name];continue}if($r.matches(cr))return $r}},this.getCookies=function(ur){var cr=[],$r,Ar;for($r in Xt)Ar=this.getCookie($r,ur),Ar&&cr.push(Ar);return cr.toString=function(){return cr.join(":")},cr.toValueString=function(){return cr.map(function(qr){return qr.toValueString()}).join("; ")},cr},this):new Yt}cookiejar.CookieJar=Yt,Yt.prototype.setCookies=function(Jt,Zt,Qt){Jt=Array.isArray(Jt)?Jt:Jt.split(Gt);var ur=[],cr,$r;for(Jt=Jt.map(function(Ar){return new Wt(Ar,Zt,Qt)}),cr=0;cr<Jt.length;cr+=1)$r=Jt[cr],this.setCookie($r,Zt,Qt)&&ur.push($r);return ur}})();var __extends$B=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Wt,Gt){Wt.__proto__=Gt}||function(Wt,Gt){for(var Yt in Gt)Gt.hasOwnProperty(Yt)&&(Wt[Yt]=Gt[Yt])};return function(Wt,Gt){Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__assign$d=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(Bt){for(var Wt,Gt=1,Yt=arguments.length;Gt<Yt;Gt++){Wt=arguments[Gt];for(var Xt in Wt)Object.prototype.hasOwnProperty.call(Wt,Xt)&&(Bt[Xt]=Wt[Xt])}return Bt};Object.defineProperty(xmlHttpRequest,"__esModule",{value:!0});var http=require$$0$a,https=require$$0$a,os$2=require$$0$a,url=require$$0$a,progress_event_1=progressEvent,errors_1=errors,xml_http_request_event_target_1=xmlHttpRequestEventTarget,xml_http_request_upload_1=xmlHttpRequestUpload,Cookie=cookiejar,XMLHttpRequest$1=function(Bt){__extends$B(Wt,Bt);function Wt(Gt){Gt===void 0&&(Gt={});var Yt=Bt.call(this)||this;return Yt.UNSENT=Wt.UNSENT,Yt.OPENED=Wt.OPENED,Yt.HEADERS_RECEIVED=Wt.HEADERS_RECEIVED,Yt.LOADING=Wt.LOADING,Yt.DONE=Wt.DONE,Yt.onreadystatechange=null,Yt.readyState=Wt.UNSENT,Yt.response=null,Yt.responseText="",Yt.responseType="",Yt.status=0,Yt.statusText="",Yt.timeout=0,Yt.upload=new xml_http_request_upload_1.XMLHttpRequestUpload,Yt.responseUrl="",Yt.withCredentials=!1,Yt._method=null,Yt._url=null,Yt._sync=!1,Yt._headers={},Yt._loweredHeaders={},Yt._mimeOverride=null,Yt._request=null,Yt._response=null,Yt._responseParts=null,Yt._responseHeaders=null,Yt._aborting=null,Yt._error=null,Yt._loadedBytes=0,Yt._totalBytes=0,Yt._lengthComputable=!1,Yt._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},Yt._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},Yt._privateHeaders={"set-cookie":!0,"set-cookie2":!0},Yt._userAgent="Mozilla/5.0 ("+os$2.type()+" "+os$2.arch()+") node.js/"+browser$1$1.versions.node+" v8/"+browser$1$1.versions.v8,Yt._anonymous=Gt.anon||!1,Yt}return Wt.prototype.open=function(Gt,Yt,Xt,Jt,Zt){if(Xt===void 0&&(Xt=!0),Gt=Gt.toUpperCase(),this._restrictedMethods[Gt])throw new Wt.SecurityError("HTTP method "+Gt+" is not allowed in XHR");var Qt=this._parseUrl(Yt,Jt,Zt);this.readyState===Wt.HEADERS_RECEIVED||(this.readyState,Wt.LOADING),this._method=Gt,this._url=Qt,this._sync=!Xt,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(Wt.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},Wt.prototype.setRequestHeader=function(Gt,Yt){if(this.readyState!==Wt.OPENED)throw new Wt.InvalidStateError("XHR readyState must be OPENED");var Xt=Gt.toLowerCase();if(this._restrictedHeaders[Xt]||/^sec-/.test(Xt)||/^proxy-/.test(Xt)){console.warn('Refused to set unsafe header "'+Gt+'"');return}Yt=Yt.toString(),this._loweredHeaders[Xt]!=null?(Gt=this._loweredHeaders[Xt],this._headers[Gt]=this._headers[Gt]+", "+Yt):(this._loweredHeaders[Xt]=Gt,this._headers[Gt]=Yt)},Wt.prototype.send=function(Gt){if(this.readyState!==Wt.OPENED)throw new Wt.InvalidStateError("XHR readyState must be OPENED");if(this._request)throw new Wt.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":return this._sendFile(Gt);case"http:":case"https:":return this._sendHttp(Gt);default:throw new Wt.NetworkError("Unsupported protocol "+this._url.protocol)}},Wt.prototype.abort=function(){this._request!=null&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},Wt.prototype.getResponseHeader=function(Gt){if(this._responseHeaders==null||Gt==null)return null;var Yt=Gt.toLowerCase();return this._responseHeaders.hasOwnProperty(Yt)?this._responseHeaders[Gt.toLowerCase()]:null},Wt.prototype.getAllResponseHeaders=function(){var Gt=this;return this._responseHeaders==null?"":Object.keys(this._responseHeaders).map(function(Yt){return Yt+": "+Gt._responseHeaders[Yt]}).join(`\r
712
- `)},Wt.prototype.overrideMimeType=function(Gt){if(this.readyState===Wt.LOADING||this.readyState===Wt.DONE)throw new Wt.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=Gt.toLowerCase()},Wt.prototype.nodejsSet=function(Gt){if(this.nodejsHttpAgent=Gt.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=Gt.httpsAgent||this.nodejsHttpsAgent,Gt.hasOwnProperty("baseUrl")){if(Gt.baseUrl!=null){var Yt=url.parse(Gt.baseUrl,!1,!0);if(!Yt.protocol)throw new Wt.SyntaxError("baseUrl must be an absolute URL")}this.nodejsBaseUrl=Gt.baseUrl}},Wt.nodejsSet=function(Gt){Wt.prototype.nodejsSet(Gt)},Wt.prototype._setReadyState=function(Gt){this.readyState=Gt,this.dispatchEvent(new progress_event_1.ProgressEvent("readystatechange"))},Wt.prototype._sendFile=function(Gt){throw new Error("Protocol file: not implemented")},Wt.prototype._sendHttp=function(Gt){if(this._sync)throw new Error("Synchronous XHR processing not implemented");Gt&&(this._method==="GET"||this._method==="HEAD")?(console.warn("Discarding entity body for "+this._method+" requests"),Gt=null):Gt=Gt||"",this.upload._setData(Gt),this._finalizeHeaders(),this._sendHxxpRequest()},Wt.prototype._sendHxxpRequest=function(){var Gt=this;if(this.withCredentials){var Yt=Wt.cookieJar.getCookies(Cookie.CookieAccessInfo(this._url.hostname,this._url.pathname,this._url.protocol==="https:")).toValueString();this._headers.cookie=this._headers.cookie2=Yt}var Xt=this._url.protocol==="http:"?[http,this.nodejsHttpAgent]:[https,this.nodejsHttpsAgent],Jt=Xt[0],Zt=Xt[1],Qt=Jt.request.bind(Jt),ur=Qt({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:Zt});this._request=ur,this.timeout&&ur.setTimeout(this.timeout,function(){return Gt._onHttpTimeout(ur)}),ur.on("response",function(cr){return Gt._onHttpResponse(ur,cr)}),ur.on("error",function(cr){return Gt._onHttpRequestError(ur,cr)}),this.upload._startUpload(ur),this._request===ur&&this._dispatchProgress("loadstart")},Wt.prototype._finalizeHeaders=function(){this._headers=__assign$d({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},Wt.prototype._onHttpResponse=function(Gt,Yt){var Xt=this;if(this._request===Gt){if(this.withCredentials&&(Yt.headers["set-cookie"]||Yt.headers["set-cookie2"])&&Wt.cookieJar.setCookies(Yt.headers["set-cookie"]||Yt.headers["set-cookie2"]),[301,302,303,307,308].indexOf(Yt.statusCode)>=0){this._url=this._parseUrl(Yt.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),this._headers["Content-Type"]!=null&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),this._sendHxxpRequest();return}this._response=Yt,this._response.on("data",function(Zt){return Xt._onHttpResponseData(Yt,Zt)}),this._response.on("end",function(){return Xt._onHttpResponseEnd(Yt)}),this._response.on("close",function(){return Xt._onHttpResponseClose(Yt)}),this.responseUrl=this._url.href.split("#")[0],this.status=Yt.statusCode,this.statusText=http.STATUS_CODES[this.status],this._parseResponseHeaders(Yt);var Jt=this._responseHeaders["content-length"]||"";this._totalBytes=+Jt,this._lengthComputable=!!Jt,this._setReadyState(Wt.HEADERS_RECEIVED)}},Wt.prototype._onHttpResponseData=function(Gt,Yt){this._response===Gt&&(this._responseParts.push(new Buffer$g(Yt)),this._loadedBytes+=Yt.length,this.readyState!==Wt.LOADING&&this._setReadyState(Wt.LOADING),this._dispatchProgress("progress"))},Wt.prototype._onHttpResponseEnd=function(Gt){this._response===Gt&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(Wt.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},Wt.prototype._onHttpResponseClose=function(Gt){if(this._response===Gt){var Yt=this._request;this._setError(),Yt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},Wt.prototype._onHttpTimeout=function(Gt){this._request===Gt&&(this._setError(),Gt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},Wt.prototype._onHttpRequestError=function(Gt,Yt){this._request===Gt&&(this._setError(),Gt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},Wt.prototype._dispatchProgress=function(Gt){var Yt=new Wt.ProgressEvent(Gt);Yt.lengthComputable=this._lengthComputable,Yt.loaded=this._loadedBytes,Yt.total=this._totalBytes,this.dispatchEvent(Yt)},Wt.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},Wt.prototype._parseUrl=function(Gt,Yt,Xt){var Jt=this.nodejsBaseUrl==null?Gt:url.resolve(this.nodejsBaseUrl,Gt),Zt=url.parse(Jt,!1,!0);Zt.hash=null;var Qt=(Zt.auth||"").split(":"),ur=Qt[0],cr=Qt[1];return(ur||cr||Yt||Xt)&&(Zt.auth=(Yt||ur||"")+":"+(Xt||cr||"")),Zt},Wt.prototype._parseResponseHeaders=function(Gt){this._responseHeaders={};for(var Yt in Gt.headers){var Xt=Yt.toLowerCase();this._privateHeaders[Xt]||(this._responseHeaders[Xt]=Gt.headers[Yt])}this._mimeOverride!=null&&(this._responseHeaders["content-type"]=this._mimeOverride)},Wt.prototype._parseResponse=function(){var Gt=Buffer$g.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(Gt.toString("utf-8"))}catch{this.response=null}return;case"buffer":this.responseText=null,this.response=Gt;return;case"arraybuffer":this.responseText=null;for(var Yt=new ArrayBuffer(Gt.length),Xt=new Uint8Array(Yt),Jt=0;Jt<Gt.length;Jt++)Xt[Jt]=Gt[Jt];this.response=Yt;return;case"text":default:try{this.responseText=Gt.toString(this._parseResponseEncoding())}catch{this.responseText=Gt.toString("binary")}this.response=this.responseText}},Wt.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},Wt.ProgressEvent=progress_event_1.ProgressEvent,Wt.InvalidStateError=errors_1.InvalidStateError,Wt.NetworkError=errors_1.NetworkError,Wt.SecurityError=errors_1.SecurityError,Wt.SyntaxError=errors_1.SyntaxError,Wt.XMLHttpRequestUpload=xml_http_request_upload_1.XMLHttpRequestUpload,Wt.UNSENT=0,Wt.OPENED=1,Wt.HEADERS_RECEIVED=2,Wt.LOADING=3,Wt.DONE=4,Wt.cookieJar=Cookie.CookieJar(),Wt}(xml_http_request_event_target_1.XMLHttpRequestEventTarget);xmlHttpRequest.XMLHttpRequest=XMLHttpRequest$1;XMLHttpRequest$1.prototype.nodejsHttpAgent=http.globalAgent;XMLHttpRequest$1.prototype.nodejsHttpsAgent=https.globalAgent;XMLHttpRequest$1.prototype.nodejsBaseUrl=null;(function(Bt){function Wt(Yt){for(var Xt in Yt)Bt.hasOwnProperty(Xt)||(Bt[Xt]=Yt[Xt])}Object.defineProperty(Bt,"__esModule",{value:!0}),Wt(xmlHttpRequest);var Gt=xmlHttpRequestEventTarget;Bt.XMLHttpRequestEventTarget=Gt.XMLHttpRequestEventTarget})(dist$g);var bn$2={exports:{}};bn$2.exports;(function(Bt){(function(Wt,Gt){function Yt(dn,Pr){if(!dn)throw new Error(Pr||"Assertion failed")}function Xt(dn,Pr){dn.super_=Pr;var xr=function(){};xr.prototype=Pr.prototype,dn.prototype=new xr,dn.prototype.constructor=dn}function Jt(dn,Pr,xr){if(Jt.isBN(dn))return dn;this.negative=0,this.words=null,this.length=0,this.red=null,dn!==null&&((Pr==="le"||Pr==="be")&&(xr=Pr,Pr=10),this._init(dn||0,Pr||10,xr||"be"))}typeof Wt=="object"?Wt.exports=Jt:Gt.BN=Jt,Jt.BN=Jt,Jt.wordSize=26;var Zt;try{Zt=require$$0$a.Buffer}catch{}Jt.isBN=function(Pr){return Pr instanceof Jt?!0:Pr!==null&&typeof Pr=="object"&&Pr.constructor.wordSize===Jt.wordSize&&Array.isArray(Pr.words)},Jt.max=function(Pr,xr){return Pr.cmp(xr)>0?Pr:xr},Jt.min=function(Pr,xr){return Pr.cmp(xr)<0?Pr:xr},Jt.prototype._init=function(Pr,xr,Mr){if(typeof Pr=="number")return this._initNumber(Pr,xr,Mr);if(typeof Pr=="object")return this._initArray(Pr,xr,Mr);xr==="hex"&&(xr=16),Yt(xr===(xr|0)&&xr>=2&&xr<=36),Pr=Pr.toString().replace(/\s+/g,"");var Nr=0;Pr[0]==="-"&&Nr++,xr===16?this._parseHex(Pr,Nr):this._parseBase(Pr,xr,Nr),Pr[0]==="-"&&(this.negative=1),this.strip(),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initNumber=function(Pr,xr,Mr){Pr<0&&(this.negative=1,Pr=-Pr),Pr<67108864?(this.words=[Pr&67108863],this.length=1):Pr<4503599627370496?(this.words=[Pr&67108863,Pr/67108864&67108863],this.length=2):(Yt(Pr<9007199254740992),this.words=[Pr&67108863,Pr/67108864&67108863,1],this.length=3),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initArray=function(Pr,xr,Mr){if(Yt(typeof Pr.length=="number"),Pr.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Pr.length/3),this.words=new Array(this.length);for(var Nr=0;Nr<this.length;Nr++)this.words[Nr]=0;var Ur,Vr,Zr=0;if(Mr==="be")for(Nr=Pr.length-1,Ur=0;Nr>=0;Nr-=3)Vr=Pr[Nr]|Pr[Nr-1]<<8|Pr[Nr-2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);else if(Mr==="le")for(Nr=0,Ur=0;Nr<Pr.length;Nr+=3)Vr=Pr[Nr]|Pr[Nr+1]<<8|Pr[Nr+2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);return this.strip()};function Qt(dn,Pr,xr){for(var Mr=0,Nr=Math.min(dn.length,xr),Ur=Pr;Ur<Nr;Ur++){var Vr=dn.charCodeAt(Ur)-48;Mr<<=4,Vr>=49&&Vr<=54?Mr|=Vr-49+10:Vr>=17&&Vr<=22?Mr|=Vr-17+10:Mr|=Vr&15}return Mr}Jt.prototype._parseHex=function(Pr,xr){this.length=Math.ceil((Pr.length-xr)/6),this.words=new Array(this.length);for(var Mr=0;Mr<this.length;Mr++)this.words[Mr]=0;var Nr,Ur,Vr=0;for(Mr=Pr.length-6,Nr=0;Mr>=xr;Mr-=6)Ur=Qt(Pr,Mr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303,Vr+=24,Vr>=26&&(Vr-=26,Nr++);Mr+6!==xr&&(Ur=Qt(Pr,xr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303),this.strip()};function ur(dn,Pr,xr,Mr){for(var Nr=0,Ur=Math.min(dn.length,xr),Vr=Pr;Vr<Ur;Vr++){var Zr=dn.charCodeAt(Vr)-48;Nr*=Mr,Zr>=49?Nr+=Zr-49+10:Zr>=17?Nr+=Zr-17+10:Nr+=Zr}return Nr}Jt.prototype._parseBase=function(Pr,xr,Mr){this.words=[0],this.length=1;for(var Nr=0,Ur=1;Ur<=67108863;Ur*=xr)Nr++;Nr--,Ur=Ur/xr|0;for(var Vr=Pr.length-Mr,Zr=Vr%Nr,Xr=Math.min(Vr,Vr-Zr)+Mr,Or=0,jr=Mr;jr<Xr;jr+=Nr)Or=ur(Pr,jr,jr+Nr,xr),this.imuln(Ur),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or);if(Zr!==0){var Jr=1;for(Or=ur(Pr,jr,Pr.length,xr),jr=0;jr<Zr;jr++)Jr*=xr;this.imuln(Jr),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or)}},Jt.prototype.copy=function(Pr){Pr.words=new Array(this.length);for(var xr=0;xr<this.length;xr++)Pr.words[xr]=this.words[xr];Pr.length=this.length,Pr.negative=this.negative,Pr.red=this.red},Jt.prototype.clone=function(){var Pr=new Jt(null);return this.copy(Pr),Pr},Jt.prototype._expand=function(Pr){for(;this.length<Pr;)this.words[this.length++]=0;return this},Jt.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Jt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Jt.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var cr=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],$r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ar=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Jt.prototype.toString=function(Pr,xr){Pr=Pr||10,xr=xr|0||1;var Mr;if(Pr===16||Pr==="hex"){Mr="";for(var Nr=0,Ur=0,Vr=0;Vr<this.length;Vr++){var Zr=this.words[Vr],Xr=((Zr<<Nr|Ur)&16777215).toString(16);Ur=Zr>>>24-Nr&16777215,Ur!==0||Vr!==this.length-1?Mr=cr[6-Xr.length]+Xr+Mr:Mr=Xr+Mr,Nr+=2,Nr>=26&&(Nr-=26,Vr--)}for(Ur!==0&&(Mr=Ur.toString(16)+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}if(Pr===(Pr|0)&&Pr>=2&&Pr<=36){var Or=$r[Pr],jr=Ar[Pr];Mr="";var Jr=this.clone();for(Jr.negative=0;!Jr.isZero();){var mn=Jr.modn(jr).toString(Pr);Jr=Jr.idivn(jr),Jr.isZero()?Mr=mn+Mr:Mr=cr[Or-mn.length]+mn+Mr}for(this.isZero()&&(Mr="0"+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}Yt(!1,"Base should be between 2 and 36")},Jt.prototype.toNumber=function(){var Pr=this.words[0];return this.length===2?Pr+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Pr+=4503599627370496+this.words[1]*67108864:this.length>2&&Yt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Pr:Pr},Jt.prototype.toJSON=function(){return this.toString(16)},Jt.prototype.toBuffer=function(Pr,xr){return Yt(typeof Zt<"u"),this.toArrayLike(Zt,Pr,xr)},Jt.prototype.toArray=function(Pr,xr){return this.toArrayLike(Array,Pr,xr)},Jt.prototype.toArrayLike=function(Pr,xr,Mr){var Nr=this.byteLength(),Ur=Mr||Math.max(1,Nr);Yt(Nr<=Ur,"byte array longer than desired length"),Yt(Ur>0,"Requested array length <= 0"),this.strip();var Vr=xr==="le",Zr=new Pr(Ur),Xr,Or,jr=this.clone();if(Vr){for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Or]=Xr;for(;Or<Ur;Or++)Zr[Or]=0}else{for(Or=0;Or<Ur-Nr;Or++)Zr[Or]=0;for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Ur-Or-1]=Xr}return Zr},Math.clz32?Jt.prototype._countBits=function(Pr){return 32-Math.clz32(Pr)}:Jt.prototype._countBits=function(Pr){var xr=Pr,Mr=0;return xr>=4096&&(Mr+=13,xr>>>=13),xr>=64&&(Mr+=7,xr>>>=7),xr>=8&&(Mr+=4,xr>>>=4),xr>=2&&(Mr+=2,xr>>>=2),Mr+xr},Jt.prototype._zeroBits=function(Pr){if(Pr===0)return 26;var xr=Pr,Mr=0;return xr&8191||(Mr+=13,xr>>>=13),xr&127||(Mr+=7,xr>>>=7),xr&15||(Mr+=4,xr>>>=4),xr&3||(Mr+=2,xr>>>=2),xr&1||Mr++,Mr},Jt.prototype.bitLength=function(){var Pr=this.words[this.length-1],xr=this._countBits(Pr);return(this.length-1)*26+xr};function Lr(dn){for(var Pr=new Array(dn.bitLength()),xr=0;xr<Pr.length;xr++){var Mr=xr/26|0,Nr=xr%26;Pr[xr]=(dn.words[Mr]&1<<Nr)>>>Nr}return Pr}Jt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Pr=0,xr=0;xr<this.length;xr++){var Mr=this._zeroBits(this.words[xr]);if(Pr+=Mr,Mr!==26)break}return Pr},Jt.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Jt.prototype.toTwos=function(Pr){return this.negative!==0?this.abs().inotn(Pr).iaddn(1):this.clone()},Jt.prototype.fromTwos=function(Pr){return this.testn(Pr-1)?this.notn(Pr).iaddn(1).ineg():this.clone()},Jt.prototype.isNeg=function(){return this.negative!==0},Jt.prototype.neg=function(){return this.clone().ineg()},Jt.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Jt.prototype.iuor=function(Pr){for(;this.length<Pr.length;)this.words[this.length++]=0;for(var xr=0;xr<Pr.length;xr++)this.words[xr]=this.words[xr]|Pr.words[xr];return this.strip()},Jt.prototype.ior=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuor(Pr)},Jt.prototype.or=function(Pr){return this.length>Pr.length?this.clone().ior(Pr):Pr.clone().ior(this)},Jt.prototype.uor=function(Pr){return this.length>Pr.length?this.clone().iuor(Pr):Pr.clone().iuor(this)},Jt.prototype.iuand=function(Pr){var xr;this.length>Pr.length?xr=Pr:xr=this;for(var Mr=0;Mr<xr.length;Mr++)this.words[Mr]=this.words[Mr]&Pr.words[Mr];return this.length=xr.length,this.strip()},Jt.prototype.iand=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuand(Pr)},Jt.prototype.and=function(Pr){return this.length>Pr.length?this.clone().iand(Pr):Pr.clone().iand(this)},Jt.prototype.uand=function(Pr){return this.length>Pr.length?this.clone().iuand(Pr):Pr.clone().iuand(this)},Jt.prototype.iuxor=function(Pr){var xr,Mr;this.length>Pr.length?(xr=this,Mr=Pr):(xr=Pr,Mr=this);for(var Nr=0;Nr<Mr.length;Nr++)this.words[Nr]=xr.words[Nr]^Mr.words[Nr];if(this!==xr)for(;Nr<xr.length;Nr++)this.words[Nr]=xr.words[Nr];return this.length=xr.length,this.strip()},Jt.prototype.ixor=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuxor(Pr)},Jt.prototype.xor=function(Pr){return this.length>Pr.length?this.clone().ixor(Pr):Pr.clone().ixor(this)},Jt.prototype.uxor=function(Pr){return this.length>Pr.length?this.clone().iuxor(Pr):Pr.clone().iuxor(this)},Jt.prototype.inotn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Math.ceil(Pr/26)|0,Mr=Pr%26;this._expand(xr),Mr>0&&xr--;for(var Nr=0;Nr<xr;Nr++)this.words[Nr]=~this.words[Nr]&67108863;return Mr>0&&(this.words[Nr]=~this.words[Nr]&67108863>>26-Mr),this.strip()},Jt.prototype.notn=function(Pr){return this.clone().inotn(Pr)},Jt.prototype.setn=function(Pr,xr){Yt(typeof Pr=="number"&&Pr>=0);var Mr=Pr/26|0,Nr=Pr%26;return this._expand(Mr+1),xr?this.words[Mr]=this.words[Mr]|1<<Nr:this.words[Mr]=this.words[Mr]&~(1<<Nr),this.strip()},Jt.prototype.iadd=function(Pr){var xr;if(this.negative!==0&&Pr.negative===0)return this.negative=0,xr=this.isub(Pr),this.negative^=1,this._normSign();if(this.negative===0&&Pr.negative!==0)return Pr.negative=0,xr=this.isub(Pr),Pr.negative=1,xr._normSign();var Mr,Nr;this.length>Pr.length?(Mr=this,Nr=Pr):(Mr=Pr,Nr=this);for(var Ur=0,Vr=0;Vr<Nr.length;Vr++)xr=(Mr.words[Vr]|0)+(Nr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;for(;Ur!==0&&Vr<Mr.length;Vr++)xr=(Mr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;if(this.length=Mr.length,Ur!==0)this.words[this.length]=Ur,this.length++;else if(Mr!==this)for(;Vr<Mr.length;Vr++)this.words[Vr]=Mr.words[Vr];return this},Jt.prototype.add=function(Pr){var xr;return Pr.negative!==0&&this.negative===0?(Pr.negative=0,xr=this.sub(Pr),Pr.negative^=1,xr):Pr.negative===0&&this.negative!==0?(this.negative=0,xr=Pr.sub(this),this.negative=1,xr):this.length>Pr.length?this.clone().iadd(Pr):Pr.clone().iadd(this)},Jt.prototype.isub=function(Pr){if(Pr.negative!==0){Pr.negative=0;var xr=this.iadd(Pr);return Pr.negative=1,xr._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Pr),this.negative=1,this._normSign();var Mr=this.cmp(Pr);if(Mr===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Nr,Ur;Mr>0?(Nr=this,Ur=Pr):(Nr=Pr,Ur=this);for(var Vr=0,Zr=0;Zr<Ur.length;Zr++)xr=(Nr.words[Zr]|0)-(Ur.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;for(;Vr!==0&&Zr<Nr.length;Zr++)xr=(Nr.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;if(Vr===0&&Zr<Nr.length&&Nr!==this)for(;Zr<Nr.length;Zr++)this.words[Zr]=Nr.words[Zr];return this.length=Math.max(this.length,Zr),Nr!==this&&(this.negative=1),this.strip()},Jt.prototype.sub=function(Pr){return this.clone().isub(Pr)};function qr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative;var Mr=dn.length+Pr.length|0;xr.length=Mr,Mr=Mr-1|0;var Nr=dn.words[0]|0,Ur=Pr.words[0]|0,Vr=Nr*Ur,Zr=Vr&67108863,Xr=Vr/67108864|0;xr.words[0]=Zr;for(var Or=1;Or<Mr;Or++){for(var jr=Xr>>>26,Jr=Xr&67108863,mn=Math.min(Or,Pr.length-1),gn=Math.max(0,Or-dn.length+1);gn<=mn;gn++){var eo=Or-gn|0;Nr=dn.words[eo]|0,Ur=Pr.words[gn]|0,Vr=Nr*Ur+Jr,jr+=Vr/67108864|0,Jr=Vr&67108863}xr.words[Or]=Jr|0,Xr=jr|0}return Xr!==0?xr.words[Or]=Xr|0:xr.length--,xr.strip()}var Fr=function(Pr,xr,Mr){var Nr=Pr.words,Ur=xr.words,Vr=Mr.words,Zr=0,Xr,Or,jr,Jr=Nr[0]|0,mn=Jr&8191,gn=Jr>>>13,eo=Nr[1]|0,_i=eo&8191,ro=eo>>>13,io=Nr[2]|0,ao=io&8191,oo=io>>>13,to=Nr[3]|0,so=to&8191,lo=to>>>13,Ro=Nr[4]|0,Io=Ro&8191,Fo=Ro>>>13,xo=Nr[5]|0,ho=xo&8191,po=xo>>>13,Ao=Nr[6]|0,Bo=Ao&8191,Mo=Ao>>>13,bo=Nr[7]|0,yo=bo&8191,Do=bo>>>13,Tu=Nr[8]|0,wu=Tu&8191,$o=Tu>>>13,mo=Nr[9]|0,_o=mo&8191,To=mo>>>13,iu=Ur[0]|0,nu=iu&8191,Jo=iu>>>13,cu=Ur[1]|0,au=cu&8191,tu=cu>>>13,Iu=Ur[2]|0,Ru=Iu&8191,$u=Iu>>>13,Yu=Ur[3]|0,qu=Yu&8191,fu=Yu>>>13,Xu=Ur[4]|0,Nu=Xu&8191,jo=Xu>>>13,qo=Ur[5]|0,Vo=qo&8191,zo=qo>>>13,Au=Ur[6]|0,_u=Au&8191,hu=Au>>>13,vu=Ur[7]|0,ju=vu&8191,Co=vu>>>13,Ho=Ur[8]|0,Ko=Ho&8191,Go=Ho>>>13,du=Ur[9]|0,Cu=du&8191,gu=du>>>13;Mr.negative=Pr.negative^xr.negative,Mr.length=19,Xr=Math.imul(mn,nu),Or=Math.imul(mn,Jo),Or=Or+Math.imul(gn,nu)|0,jr=Math.imul(gn,Jo);var el=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(el>>>26)|0,el&=67108863,Xr=Math.imul(_i,nu),Or=Math.imul(_i,Jo),Or=Or+Math.imul(ro,nu)|0,jr=Math.imul(ro,Jo),Xr=Xr+Math.imul(mn,au)|0,Or=Or+Math.imul(mn,tu)|0,Or=Or+Math.imul(gn,au)|0,jr=jr+Math.imul(gn,tu)|0;var wl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(wl>>>26)|0,wl&=67108863,Xr=Math.imul(ao,nu),Or=Math.imul(ao,Jo),Or=Or+Math.imul(oo,nu)|0,jr=Math.imul(oo,Jo),Xr=Xr+Math.imul(_i,au)|0,Or=Or+Math.imul(_i,tu)|0,Or=Or+Math.imul(ro,au)|0,jr=jr+Math.imul(ro,tu)|0,Xr=Xr+Math.imul(mn,Ru)|0,Or=Or+Math.imul(mn,$u)|0,Or=Or+Math.imul(gn,Ru)|0,jr=jr+Math.imul(gn,$u)|0;var Pl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Pl>>>26)|0,Pl&=67108863,Xr=Math.imul(so,nu),Or=Math.imul(so,Jo),Or=Or+Math.imul(lo,nu)|0,jr=Math.imul(lo,Jo),Xr=Xr+Math.imul(ao,au)|0,Or=Or+Math.imul(ao,tu)|0,Or=Or+Math.imul(oo,au)|0,jr=jr+Math.imul(oo,tu)|0,Xr=Xr+Math.imul(_i,Ru)|0,Or=Or+Math.imul(_i,$u)|0,Or=Or+Math.imul(ro,Ru)|0,jr=jr+Math.imul(ro,$u)|0,Xr=Xr+Math.imul(mn,qu)|0,Or=Or+Math.imul(mn,fu)|0,Or=Or+Math.imul(gn,qu)|0,jr=jr+Math.imul(gn,fu)|0;var kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(kl>>>26)|0,kl&=67108863,Xr=Math.imul(Io,nu),Or=Math.imul(Io,Jo),Or=Or+Math.imul(Fo,nu)|0,jr=Math.imul(Fo,Jo),Xr=Xr+Math.imul(so,au)|0,Or=Or+Math.imul(so,tu)|0,Or=Or+Math.imul(lo,au)|0,jr=jr+Math.imul(lo,tu)|0,Xr=Xr+Math.imul(ao,Ru)|0,Or=Or+Math.imul(ao,$u)|0,Or=Or+Math.imul(oo,Ru)|0,jr=jr+Math.imul(oo,$u)|0,Xr=Xr+Math.imul(_i,qu)|0,Or=Or+Math.imul(_i,fu)|0,Or=Or+Math.imul(ro,qu)|0,jr=jr+Math.imul(ro,fu)|0,Xr=Xr+Math.imul(mn,Nu)|0,Or=Or+Math.imul(mn,jo)|0,Or=Or+Math.imul(gn,Nu)|0,jr=jr+Math.imul(gn,jo)|0;var Ll=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,Xr=Math.imul(ho,nu),Or=Math.imul(ho,Jo),Or=Or+Math.imul(po,nu)|0,jr=Math.imul(po,Jo),Xr=Xr+Math.imul(Io,au)|0,Or=Or+Math.imul(Io,tu)|0,Or=Or+Math.imul(Fo,au)|0,jr=jr+Math.imul(Fo,tu)|0,Xr=Xr+Math.imul(so,Ru)|0,Or=Or+Math.imul(so,$u)|0,Or=Or+Math.imul(lo,Ru)|0,jr=jr+Math.imul(lo,$u)|0,Xr=Xr+Math.imul(ao,qu)|0,Or=Or+Math.imul(ao,fu)|0,Or=Or+Math.imul(oo,qu)|0,jr=jr+Math.imul(oo,fu)|0,Xr=Xr+Math.imul(_i,Nu)|0,Or=Or+Math.imul(_i,jo)|0,Or=Or+Math.imul(ro,Nu)|0,jr=jr+Math.imul(ro,jo)|0,Xr=Xr+Math.imul(mn,Vo)|0,Or=Or+Math.imul(mn,zo)|0,Or=Or+Math.imul(gn,Vo)|0,jr=jr+Math.imul(gn,zo)|0;var Hl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Hl>>>26)|0,Hl&=67108863,Xr=Math.imul(Bo,nu),Or=Math.imul(Bo,Jo),Or=Or+Math.imul(Mo,nu)|0,jr=Math.imul(Mo,Jo),Xr=Xr+Math.imul(ho,au)|0,Or=Or+Math.imul(ho,tu)|0,Or=Or+Math.imul(po,au)|0,jr=jr+Math.imul(po,tu)|0,Xr=Xr+Math.imul(Io,Ru)|0,Or=Or+Math.imul(Io,$u)|0,Or=Or+Math.imul(Fo,Ru)|0,jr=jr+Math.imul(Fo,$u)|0,Xr=Xr+Math.imul(so,qu)|0,Or=Or+Math.imul(so,fu)|0,Or=Or+Math.imul(lo,qu)|0,jr=jr+Math.imul(lo,fu)|0,Xr=Xr+Math.imul(ao,Nu)|0,Or=Or+Math.imul(ao,jo)|0,Or=Or+Math.imul(oo,Nu)|0,jr=jr+Math.imul(oo,jo)|0,Xr=Xr+Math.imul(_i,Vo)|0,Or=Or+Math.imul(_i,zo)|0,Or=Or+Math.imul(ro,Vo)|0,jr=jr+Math.imul(ro,zo)|0,Xr=Xr+Math.imul(mn,_u)|0,Or=Or+Math.imul(mn,hu)|0,Or=Or+Math.imul(gn,_u)|0,jr=jr+Math.imul(gn,hu)|0;var Nl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,Xr=Math.imul(yo,nu),Or=Math.imul(yo,Jo),Or=Or+Math.imul(Do,nu)|0,jr=Math.imul(Do,Jo),Xr=Xr+Math.imul(Bo,au)|0,Or=Or+Math.imul(Bo,tu)|0,Or=Or+Math.imul(Mo,au)|0,jr=jr+Math.imul(Mo,tu)|0,Xr=Xr+Math.imul(ho,Ru)|0,Or=Or+Math.imul(ho,$u)|0,Or=Or+Math.imul(po,Ru)|0,jr=jr+Math.imul(po,$u)|0,Xr=Xr+Math.imul(Io,qu)|0,Or=Or+Math.imul(Io,fu)|0,Or=Or+Math.imul(Fo,qu)|0,jr=jr+Math.imul(Fo,fu)|0,Xr=Xr+Math.imul(so,Nu)|0,Or=Or+Math.imul(so,jo)|0,Or=Or+Math.imul(lo,Nu)|0,jr=jr+Math.imul(lo,jo)|0,Xr=Xr+Math.imul(ao,Vo)|0,Or=Or+Math.imul(ao,zo)|0,Or=Or+Math.imul(oo,Vo)|0,jr=jr+Math.imul(oo,zo)|0,Xr=Xr+Math.imul(_i,_u)|0,Or=Or+Math.imul(_i,hu)|0,Or=Or+Math.imul(ro,_u)|0,jr=jr+Math.imul(ro,hu)|0,Xr=Xr+Math.imul(mn,ju)|0,Or=Or+Math.imul(mn,Co)|0,Or=Or+Math.imul(gn,ju)|0,jr=jr+Math.imul(gn,Co)|0;var Dl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Dl>>>26)|0,Dl&=67108863,Xr=Math.imul(wu,nu),Or=Math.imul(wu,Jo),Or=Or+Math.imul($o,nu)|0,jr=Math.imul($o,Jo),Xr=Xr+Math.imul(yo,au)|0,Or=Or+Math.imul(yo,tu)|0,Or=Or+Math.imul(Do,au)|0,jr=jr+Math.imul(Do,tu)|0,Xr=Xr+Math.imul(Bo,Ru)|0,Or=Or+Math.imul(Bo,$u)|0,Or=Or+Math.imul(Mo,Ru)|0,jr=jr+Math.imul(Mo,$u)|0,Xr=Xr+Math.imul(ho,qu)|0,Or=Or+Math.imul(ho,fu)|0,Or=Or+Math.imul(po,qu)|0,jr=jr+Math.imul(po,fu)|0,Xr=Xr+Math.imul(Io,Nu)|0,Or=Or+Math.imul(Io,jo)|0,Or=Or+Math.imul(Fo,Nu)|0,jr=jr+Math.imul(Fo,jo)|0,Xr=Xr+Math.imul(so,Vo)|0,Or=Or+Math.imul(so,zo)|0,Or=Or+Math.imul(lo,Vo)|0,jr=jr+Math.imul(lo,zo)|0,Xr=Xr+Math.imul(ao,_u)|0,Or=Or+Math.imul(ao,hu)|0,Or=Or+Math.imul(oo,_u)|0,jr=jr+Math.imul(oo,hu)|0,Xr=Xr+Math.imul(_i,ju)|0,Or=Or+Math.imul(_i,Co)|0,Or=Or+Math.imul(ro,ju)|0,jr=jr+Math.imul(ro,Co)|0,Xr=Xr+Math.imul(mn,Ko)|0,Or=Or+Math.imul(mn,Go)|0,Or=Or+Math.imul(gn,Ko)|0,jr=jr+Math.imul(gn,Go)|0;var Ju=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,Xr=Math.imul(_o,nu),Or=Math.imul(_o,Jo),Or=Or+Math.imul(To,nu)|0,jr=Math.imul(To,Jo),Xr=Xr+Math.imul(wu,au)|0,Or=Or+Math.imul(wu,tu)|0,Or=Or+Math.imul($o,au)|0,jr=jr+Math.imul($o,tu)|0,Xr=Xr+Math.imul(yo,Ru)|0,Or=Or+Math.imul(yo,$u)|0,Or=Or+Math.imul(Do,Ru)|0,jr=jr+Math.imul(Do,$u)|0,Xr=Xr+Math.imul(Bo,qu)|0,Or=Or+Math.imul(Bo,fu)|0,Or=Or+Math.imul(Mo,qu)|0,jr=jr+Math.imul(Mo,fu)|0,Xr=Xr+Math.imul(ho,Nu)|0,Or=Or+Math.imul(ho,jo)|0,Or=Or+Math.imul(po,Nu)|0,jr=jr+Math.imul(po,jo)|0,Xr=Xr+Math.imul(Io,Vo)|0,Or=Or+Math.imul(Io,zo)|0,Or=Or+Math.imul(Fo,Vo)|0,jr=jr+Math.imul(Fo,zo)|0,Xr=Xr+Math.imul(so,_u)|0,Or=Or+Math.imul(so,hu)|0,Or=Or+Math.imul(lo,_u)|0,jr=jr+Math.imul(lo,hu)|0,Xr=Xr+Math.imul(ao,ju)|0,Or=Or+Math.imul(ao,Co)|0,Or=Or+Math.imul(oo,ju)|0,jr=jr+Math.imul(oo,Co)|0,Xr=Xr+Math.imul(_i,Ko)|0,Or=Or+Math.imul(_i,Go)|0,Or=Or+Math.imul(ro,Ko)|0,jr=jr+Math.imul(ro,Go)|0,Xr=Xr+Math.imul(mn,Cu)|0,Or=Or+Math.imul(mn,gu)|0,Or=Or+Math.imul(gn,Cu)|0,jr=jr+Math.imul(gn,gu)|0;var Kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Kl>>>26)|0,Kl&=67108863,Xr=Math.imul(_o,au),Or=Math.imul(_o,tu),Or=Or+Math.imul(To,au)|0,jr=Math.imul(To,tu),Xr=Xr+Math.imul(wu,Ru)|0,Or=Or+Math.imul(wu,$u)|0,Or=Or+Math.imul($o,Ru)|0,jr=jr+Math.imul($o,$u)|0,Xr=Xr+Math.imul(yo,qu)|0,Or=Or+Math.imul(yo,fu)|0,Or=Or+Math.imul(Do,qu)|0,jr=jr+Math.imul(Do,fu)|0,Xr=Xr+Math.imul(Bo,Nu)|0,Or=Or+Math.imul(Bo,jo)|0,Or=Or+Math.imul(Mo,Nu)|0,jr=jr+Math.imul(Mo,jo)|0,Xr=Xr+Math.imul(ho,Vo)|0,Or=Or+Math.imul(ho,zo)|0,Or=Or+Math.imul(po,Vo)|0,jr=jr+Math.imul(po,zo)|0,Xr=Xr+Math.imul(Io,_u)|0,Or=Or+Math.imul(Io,hu)|0,Or=Or+Math.imul(Fo,_u)|0,jr=jr+Math.imul(Fo,hu)|0,Xr=Xr+Math.imul(so,ju)|0,Or=Or+Math.imul(so,Co)|0,Or=Or+Math.imul(lo,ju)|0,jr=jr+Math.imul(lo,Co)|0,Xr=Xr+Math.imul(ao,Ko)|0,Or=Or+Math.imul(ao,Go)|0,Or=Or+Math.imul(oo,Ko)|0,jr=jr+Math.imul(oo,Go)|0,Xr=Xr+Math.imul(_i,Cu)|0,Or=Or+Math.imul(_i,gu)|0,Or=Or+Math.imul(ro,Cu)|0,jr=jr+Math.imul(ro,gu)|0;var ep=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ep>>>26)|0,ep&=67108863,Xr=Math.imul(_o,Ru),Or=Math.imul(_o,$u),Or=Or+Math.imul(To,Ru)|0,jr=Math.imul(To,$u),Xr=Xr+Math.imul(wu,qu)|0,Or=Or+Math.imul(wu,fu)|0,Or=Or+Math.imul($o,qu)|0,jr=jr+Math.imul($o,fu)|0,Xr=Xr+Math.imul(yo,Nu)|0,Or=Or+Math.imul(yo,jo)|0,Or=Or+Math.imul(Do,Nu)|0,jr=jr+Math.imul(Do,jo)|0,Xr=Xr+Math.imul(Bo,Vo)|0,Or=Or+Math.imul(Bo,zo)|0,Or=Or+Math.imul(Mo,Vo)|0,jr=jr+Math.imul(Mo,zo)|0,Xr=Xr+Math.imul(ho,_u)|0,Or=Or+Math.imul(ho,hu)|0,Or=Or+Math.imul(po,_u)|0,jr=jr+Math.imul(po,hu)|0,Xr=Xr+Math.imul(Io,ju)|0,Or=Or+Math.imul(Io,Co)|0,Or=Or+Math.imul(Fo,ju)|0,jr=jr+Math.imul(Fo,Co)|0,Xr=Xr+Math.imul(so,Ko)|0,Or=Or+Math.imul(so,Go)|0,Or=Or+Math.imul(lo,Ko)|0,jr=jr+Math.imul(lo,Go)|0,Xr=Xr+Math.imul(ao,Cu)|0,Or=Or+Math.imul(ao,gu)|0,Or=Or+Math.imul(oo,Cu)|0,jr=jr+Math.imul(oo,gu)|0;var ap=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ap>>>26)|0,ap&=67108863,Xr=Math.imul(_o,qu),Or=Math.imul(_o,fu),Or=Or+Math.imul(To,qu)|0,jr=Math.imul(To,fu),Xr=Xr+Math.imul(wu,Nu)|0,Or=Or+Math.imul(wu,jo)|0,Or=Or+Math.imul($o,Nu)|0,jr=jr+Math.imul($o,jo)|0,Xr=Xr+Math.imul(yo,Vo)|0,Or=Or+Math.imul(yo,zo)|0,Or=Or+Math.imul(Do,Vo)|0,jr=jr+Math.imul(Do,zo)|0,Xr=Xr+Math.imul(Bo,_u)|0,Or=Or+Math.imul(Bo,hu)|0,Or=Or+Math.imul(Mo,_u)|0,jr=jr+Math.imul(Mo,hu)|0,Xr=Xr+Math.imul(ho,ju)|0,Or=Or+Math.imul(ho,Co)|0,Or=Or+Math.imul(po,ju)|0,jr=jr+Math.imul(po,Co)|0,Xr=Xr+Math.imul(Io,Ko)|0,Or=Or+Math.imul(Io,Go)|0,Or=Or+Math.imul(Fo,Ko)|0,jr=jr+Math.imul(Fo,Go)|0,Xr=Xr+Math.imul(so,Cu)|0,Or=Or+Math.imul(so,gu)|0,Or=Or+Math.imul(lo,Cu)|0,jr=jr+Math.imul(lo,gu)|0;var fp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(fp>>>26)|0,fp&=67108863,Xr=Math.imul(_o,Nu),Or=Math.imul(_o,jo),Or=Or+Math.imul(To,Nu)|0,jr=Math.imul(To,jo),Xr=Xr+Math.imul(wu,Vo)|0,Or=Or+Math.imul(wu,zo)|0,Or=Or+Math.imul($o,Vo)|0,jr=jr+Math.imul($o,zo)|0,Xr=Xr+Math.imul(yo,_u)|0,Or=Or+Math.imul(yo,hu)|0,Or=Or+Math.imul(Do,_u)|0,jr=jr+Math.imul(Do,hu)|0,Xr=Xr+Math.imul(Bo,ju)|0,Or=Or+Math.imul(Bo,Co)|0,Or=Or+Math.imul(Mo,ju)|0,jr=jr+Math.imul(Mo,Co)|0,Xr=Xr+Math.imul(ho,Ko)|0,Or=Or+Math.imul(ho,Go)|0,Or=Or+Math.imul(po,Ko)|0,jr=jr+Math.imul(po,Go)|0,Xr=Xr+Math.imul(Io,Cu)|0,Or=Or+Math.imul(Io,gu)|0,Or=Or+Math.imul(Fo,Cu)|0,jr=jr+Math.imul(Fo,gu)|0;var _f=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(_f>>>26)|0,_f&=67108863,Xr=Math.imul(_o,Vo),Or=Math.imul(_o,zo),Or=Or+Math.imul(To,Vo)|0,jr=Math.imul(To,zo),Xr=Xr+Math.imul(wu,_u)|0,Or=Or+Math.imul(wu,hu)|0,Or=Or+Math.imul($o,_u)|0,jr=jr+Math.imul($o,hu)|0,Xr=Xr+Math.imul(yo,ju)|0,Or=Or+Math.imul(yo,Co)|0,Or=Or+Math.imul(Do,ju)|0,jr=jr+Math.imul(Do,Co)|0,Xr=Xr+Math.imul(Bo,Ko)|0,Or=Or+Math.imul(Bo,Go)|0,Or=Or+Math.imul(Mo,Ko)|0,jr=jr+Math.imul(Mo,Go)|0,Xr=Xr+Math.imul(ho,Cu)|0,Or=Or+Math.imul(ho,gu)|0,Or=Or+Math.imul(po,Cu)|0,jr=jr+Math.imul(po,gu)|0;var rp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(rp>>>26)|0,rp&=67108863,Xr=Math.imul(_o,_u),Or=Math.imul(_o,hu),Or=Or+Math.imul(To,_u)|0,jr=Math.imul(To,hu),Xr=Xr+Math.imul(wu,ju)|0,Or=Or+Math.imul(wu,Co)|0,Or=Or+Math.imul($o,ju)|0,jr=jr+Math.imul($o,Co)|0,Xr=Xr+Math.imul(yo,Ko)|0,Or=Or+Math.imul(yo,Go)|0,Or=Or+Math.imul(Do,Ko)|0,jr=jr+Math.imul(Do,Go)|0,Xr=Xr+Math.imul(Bo,Cu)|0,Or=Or+Math.imul(Bo,gu)|0,Or=Or+Math.imul(Mo,Cu)|0,jr=jr+Math.imul(Mo,gu)|0;var dp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(dp>>>26)|0,dp&=67108863,Xr=Math.imul(_o,ju),Or=Math.imul(_o,Co),Or=Or+Math.imul(To,ju)|0,jr=Math.imul(To,Co),Xr=Xr+Math.imul(wu,Ko)|0,Or=Or+Math.imul(wu,Go)|0,Or=Or+Math.imul($o,Ko)|0,jr=jr+Math.imul($o,Go)|0,Xr=Xr+Math.imul(yo,Cu)|0,Or=Or+Math.imul(yo,gu)|0,Or=Or+Math.imul(Do,Cu)|0,jr=jr+Math.imul(Do,gu)|0;var np=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(np>>>26)|0,np&=67108863,Xr=Math.imul(_o,Ko),Or=Math.imul(_o,Go),Or=Or+Math.imul(To,Ko)|0,jr=Math.imul(To,Go),Xr=Xr+Math.imul(wu,Cu)|0,Or=Or+Math.imul(wu,gu)|0,Or=Or+Math.imul($o,Cu)|0,jr=jr+Math.imul($o,gu)|0;var Jl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Jl>>>26)|0,Jl&=67108863,Xr=Math.imul(_o,Cu),Or=Math.imul(_o,gu),Or=Or+Math.imul(To,Cu)|0,jr=Math.imul(To,gu);var mp=(Zr+Xr|0)+((Or&8191)<<13)|0;return Zr=(jr+(Or>>>13)|0)+(mp>>>26)|0,mp&=67108863,Vr[0]=el,Vr[1]=wl,Vr[2]=Pl,Vr[3]=kl,Vr[4]=Ll,Vr[5]=Hl,Vr[6]=Nl,Vr[7]=Dl,Vr[8]=Ju,Vr[9]=Kl,Vr[10]=ep,Vr[11]=ap,Vr[12]=fp,Vr[13]=_f,Vr[14]=rp,Vr[15]=dp,Vr[16]=np,Vr[17]=Jl,Vr[18]=mp,Zr!==0&&(Vr[19]=Zr,Mr.length++),Mr};Math.imul||(Fr=qr);function Hr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative,xr.length=dn.length+Pr.length;for(var Mr=0,Nr=0,Ur=0;Ur<xr.length-1;Ur++){var Vr=Nr;Nr=0;for(var Zr=Mr&67108863,Xr=Math.min(Ur,Pr.length-1),Or=Math.max(0,Ur-dn.length+1);Or<=Xr;Or++){var jr=Ur-Or,Jr=dn.words[jr]|0,mn=Pr.words[Or]|0,gn=Jr*mn,eo=gn&67108863;Vr=Vr+(gn/67108864|0)|0,eo=eo+Zr|0,Zr=eo&67108863,Vr=Vr+(eo>>>26)|0,Nr+=Vr>>>26,Vr&=67108863}xr.words[Ur]=Zr,Mr=Vr,Vr=Nr}return Mr!==0?xr.words[Ur]=Mr:xr.length--,xr.strip()}function Br(dn,Pr,xr){var Mr=new Wr;return Mr.mulp(dn,Pr,xr)}Jt.prototype.mulTo=function(Pr,xr){var Mr,Nr=this.length+Pr.length;return this.length===10&&Pr.length===10?Mr=Fr(this,Pr,xr):Nr<63?Mr=qr(this,Pr,xr):Nr<1024?Mr=Hr(this,Pr,xr):Mr=Br(this,Pr,xr),Mr};function Wr(dn,Pr){this.x=dn,this.y=Pr}Wr.prototype.makeRBT=function(Pr){for(var xr=new Array(Pr),Mr=Jt.prototype._countBits(Pr)-1,Nr=0;Nr<Pr;Nr++)xr[Nr]=this.revBin(Nr,Mr,Pr);return xr},Wr.prototype.revBin=function(Pr,xr,Mr){if(Pr===0||Pr===Mr-1)return Pr;for(var Nr=0,Ur=0;Ur<xr;Ur++)Nr|=(Pr&1)<<xr-Ur-1,Pr>>=1;return Nr},Wr.prototype.permute=function(Pr,xr,Mr,Nr,Ur,Vr){for(var Zr=0;Zr<Vr;Zr++)Nr[Zr]=xr[Pr[Zr]],Ur[Zr]=Mr[Pr[Zr]]},Wr.prototype.transform=function(Pr,xr,Mr,Nr,Ur,Vr){this.permute(Vr,Pr,xr,Mr,Nr,Ur);for(var Zr=1;Zr<Ur;Zr<<=1)for(var Xr=Zr<<1,Or=Math.cos(2*Math.PI/Xr),jr=Math.sin(2*Math.PI/Xr),Jr=0;Jr<Ur;Jr+=Xr)for(var mn=Or,gn=jr,eo=0;eo<Zr;eo++){var _i=Mr[Jr+eo],ro=Nr[Jr+eo],io=Mr[Jr+eo+Zr],ao=Nr[Jr+eo+Zr],oo=mn*io-gn*ao;ao=mn*ao+gn*io,io=oo,Mr[Jr+eo]=_i+io,Nr[Jr+eo]=ro+ao,Mr[Jr+eo+Zr]=_i-io,Nr[Jr+eo+Zr]=ro-ao,eo!==Xr&&(oo=Or*mn-jr*gn,gn=Or*gn+jr*mn,mn=oo)}},Wr.prototype.guessLen13b=function(Pr,xr){var Mr=Math.max(xr,Pr)|1,Nr=Mr&1,Ur=0;for(Mr=Mr/2|0;Mr;Mr=Mr>>>1)Ur++;return 1<<Ur+1+Nr},Wr.prototype.conjugate=function(Pr,xr,Mr){if(!(Mr<=1))for(var Nr=0;Nr<Mr/2;Nr++){var Ur=Pr[Nr];Pr[Nr]=Pr[Mr-Nr-1],Pr[Mr-Nr-1]=Ur,Ur=xr[Nr],xr[Nr]=-xr[Mr-Nr-1],xr[Mr-Nr-1]=-Ur}},Wr.prototype.normalize13b=function(Pr,xr){for(var Mr=0,Nr=0;Nr<xr/2;Nr++){var Ur=Math.round(Pr[2*Nr+1]/xr)*8192+Math.round(Pr[2*Nr]/xr)+Mr;Pr[Nr]=Ur&67108863,Ur<67108864?Mr=0:Mr=Ur/67108864|0}return Pr},Wr.prototype.convert13b=function(Pr,xr,Mr,Nr){for(var Ur=0,Vr=0;Vr<xr;Vr++)Ur=Ur+(Pr[Vr]|0),Mr[2*Vr]=Ur&8191,Ur=Ur>>>13,Mr[2*Vr+1]=Ur&8191,Ur=Ur>>>13;for(Vr=2*xr;Vr<Nr;++Vr)Mr[Vr]=0;Yt(Ur===0),Yt((Ur&-8192)===0)},Wr.prototype.stub=function(Pr){for(var xr=new Array(Pr),Mr=0;Mr<Pr;Mr++)xr[Mr]=0;return xr},Wr.prototype.mulp=function(Pr,xr,Mr){var Nr=2*this.guessLen13b(Pr.length,xr.length),Ur=this.makeRBT(Nr),Vr=this.stub(Nr),Zr=new Array(Nr),Xr=new Array(Nr),Or=new Array(Nr),jr=new Array(Nr),Jr=new Array(Nr),mn=new Array(Nr),gn=Mr.words;gn.length=Nr,this.convert13b(Pr.words,Pr.length,Zr,Nr),this.convert13b(xr.words,xr.length,jr,Nr),this.transform(Zr,Vr,Xr,Or,Nr,Ur),this.transform(jr,Vr,Jr,mn,Nr,Ur);for(var eo=0;eo<Nr;eo++){var _i=Xr[eo]*Jr[eo]-Or[eo]*mn[eo];Or[eo]=Xr[eo]*mn[eo]+Or[eo]*Jr[eo],Xr[eo]=_i}return this.conjugate(Xr,Or,Nr),this.transform(Xr,Or,gn,Vr,Nr,Ur),this.conjugate(gn,Vr,Nr),this.normalize13b(gn,Nr),Mr.negative=Pr.negative^xr.negative,Mr.length=Pr.length+xr.length,Mr.strip()},Jt.prototype.mul=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),this.mulTo(Pr,xr)},Jt.prototype.mulf=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),Br(this,Pr,xr)},Jt.prototype.imul=function(Pr){return this.clone().mulTo(Pr,this)},Jt.prototype.imuln=function(Pr){Yt(typeof Pr=="number"),Yt(Pr<67108864);for(var xr=0,Mr=0;Mr<this.length;Mr++){var Nr=(this.words[Mr]|0)*Pr,Ur=(Nr&67108863)+(xr&67108863);xr>>=26,xr+=Nr/67108864|0,xr+=Ur>>>26,this.words[Mr]=Ur&67108863}return xr!==0&&(this.words[Mr]=xr,this.length++),this},Jt.prototype.muln=function(Pr){return this.clone().imuln(Pr)},Jt.prototype.sqr=function(){return this.mul(this)},Jt.prototype.isqr=function(){return this.imul(this.clone())},Jt.prototype.pow=function(Pr){var xr=Lr(Pr);if(xr.length===0)return new Jt(1);for(var Mr=this,Nr=0;Nr<xr.length&&xr[Nr]===0;Nr++,Mr=Mr.sqr());if(++Nr<xr.length)for(var Ur=Mr.sqr();Nr<xr.length;Nr++,Ur=Ur.sqr())xr[Nr]!==0&&(Mr=Mr.mul(Ur));return Mr},Jt.prototype.iushln=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=67108863>>>26-xr<<26-xr,Ur;if(xr!==0){var Vr=0;for(Ur=0;Ur<this.length;Ur++){var Zr=this.words[Ur]&Nr,Xr=(this.words[Ur]|0)-Zr<<xr;this.words[Ur]=Xr|Vr,Vr=Zr>>>26-xr}Vr&&(this.words[Ur]=Vr,this.length++)}if(Mr!==0){for(Ur=this.length-1;Ur>=0;Ur--)this.words[Ur+Mr]=this.words[Ur];for(Ur=0;Ur<Mr;Ur++)this.words[Ur]=0;this.length+=Mr}return this.strip()},Jt.prototype.ishln=function(Pr){return Yt(this.negative===0),this.iushln(Pr)},Jt.prototype.iushrn=function(Pr,xr,Mr){Yt(typeof Pr=="number"&&Pr>=0);var Nr;xr?Nr=(xr-xr%26)/26:Nr=0;var Ur=Pr%26,Vr=Math.min((Pr-Ur)/26,this.length),Zr=67108863^67108863>>>Ur<<Ur,Xr=Mr;if(Nr-=Vr,Nr=Math.max(0,Nr),Xr){for(var Or=0;Or<Vr;Or++)Xr.words[Or]=this.words[Or];Xr.length=Vr}if(Vr!==0)if(this.length>Vr)for(this.length-=Vr,Or=0;Or<this.length;Or++)this.words[Or]=this.words[Or+Vr];else this.words[0]=0,this.length=1;var jr=0;for(Or=this.length-1;Or>=0&&(jr!==0||Or>=Nr);Or--){var Jr=this.words[Or]|0;this.words[Or]=jr<<26-Ur|Jr>>>Ur,jr=Jr&Zr}return Xr&&jr!==0&&(Xr.words[Xr.length++]=jr),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Jt.prototype.ishrn=function(Pr,xr,Mr){return Yt(this.negative===0),this.iushrn(Pr,xr,Mr)},Jt.prototype.shln=function(Pr){return this.clone().ishln(Pr)},Jt.prototype.ushln=function(Pr){return this.clone().iushln(Pr)},Jt.prototype.shrn=function(Pr){return this.clone().ishrn(Pr)},Jt.prototype.ushrn=function(Pr){return this.clone().iushrn(Pr)},Jt.prototype.testn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return!1;var Ur=this.words[Mr];return!!(Ur&Nr)},Jt.prototype.imaskn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26;if(Yt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Mr)return this;if(xr!==0&&Mr++,this.length=Math.min(Mr,this.length),xr!==0){var Nr=67108863^67108863>>>xr<<xr;this.words[this.length-1]&=Nr}return this.strip()},Jt.prototype.maskn=function(Pr){return this.clone().imaskn(Pr)},Jt.prototype.iaddn=function(Pr){return Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0?this.isubn(-Pr):this.negative!==0?this.length===1&&(this.words[0]|0)<Pr?(this.words[0]=Pr-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Pr),this.negative=1,this):this._iaddn(Pr)},Jt.prototype._iaddn=function(Pr){this.words[0]+=Pr;for(var xr=0;xr<this.length&&this.words[xr]>=67108864;xr++)this.words[xr]-=67108864,xr===this.length-1?this.words[xr+1]=1:this.words[xr+1]++;return this.length=Math.max(this.length,xr+1),this},Jt.prototype.isubn=function(Pr){if(Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0)return this.iaddn(-Pr);if(this.negative!==0)return this.negative=0,this.iaddn(Pr),this.negative=1,this;if(this.words[0]-=Pr,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xr=0;xr<this.length&&this.words[xr]<0;xr++)this.words[xr]+=67108864,this.words[xr+1]-=1;return this.strip()},Jt.prototype.addn=function(Pr){return this.clone().iaddn(Pr)},Jt.prototype.subn=function(Pr){return this.clone().isubn(Pr)},Jt.prototype.iabs=function(){return this.negative=0,this},Jt.prototype.abs=function(){return this.clone().iabs()},Jt.prototype._ishlnsubmul=function(Pr,xr,Mr){var Nr=Pr.length+Mr,Ur;this._expand(Nr);var Vr,Zr=0;for(Ur=0;Ur<Pr.length;Ur++){Vr=(this.words[Ur+Mr]|0)+Zr;var Xr=(Pr.words[Ur]|0)*xr;Vr-=Xr&67108863,Zr=(Vr>>26)-(Xr/67108864|0),this.words[Ur+Mr]=Vr&67108863}for(;Ur<this.length-Mr;Ur++)Vr=(this.words[Ur+Mr]|0)+Zr,Zr=Vr>>26,this.words[Ur+Mr]=Vr&67108863;if(Zr===0)return this.strip();for(Yt(Zr===-1),Zr=0,Ur=0;Ur<this.length;Ur++)Vr=-(this.words[Ur]|0)+Zr,Zr=Vr>>26,this.words[Ur]=Vr&67108863;return this.negative=1,this.strip()},Jt.prototype._wordDiv=function(Pr,xr){var Mr=this.length-Pr.length,Nr=this.clone(),Ur=Pr,Vr=Ur.words[Ur.length-1]|0,Zr=this._countBits(Vr);Mr=26-Zr,Mr!==0&&(Ur=Ur.ushln(Mr),Nr.iushln(Mr),Vr=Ur.words[Ur.length-1]|0);var Xr=Nr.length-Ur.length,Or;if(xr!=="mod"){Or=new Jt(null),Or.length=Xr+1,Or.words=new Array(Or.length);for(var jr=0;jr<Or.length;jr++)Or.words[jr]=0}var Jr=Nr.clone()._ishlnsubmul(Ur,1,Xr);Jr.negative===0&&(Nr=Jr,Or&&(Or.words[Xr]=1));for(var mn=Xr-1;mn>=0;mn--){var gn=(Nr.words[Ur.length+mn]|0)*67108864+(Nr.words[Ur.length+mn-1]|0);for(gn=Math.min(gn/Vr|0,67108863),Nr._ishlnsubmul(Ur,gn,mn);Nr.negative!==0;)gn--,Nr.negative=0,Nr._ishlnsubmul(Ur,1,mn),Nr.isZero()||(Nr.negative^=1);Or&&(Or.words[mn]=gn)}return Or&&Or.strip(),Nr.strip(),xr!=="div"&&Mr!==0&&Nr.iushrn(Mr),{div:Or||null,mod:Nr}},Jt.prototype.divmod=function(Pr,xr,Mr){if(Yt(!Pr.isZero()),this.isZero())return{div:new Jt(0),mod:new Jt(0)};var Nr,Ur,Vr;return this.negative!==0&&Pr.negative===0?(Vr=this.neg().divmod(Pr,xr),xr!=="mod"&&(Nr=Vr.div.neg()),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.iadd(Pr)),{div:Nr,mod:Ur}):this.negative===0&&Pr.negative!==0?(Vr=this.divmod(Pr.neg(),xr),xr!=="mod"&&(Nr=Vr.div.neg()),{div:Nr,mod:Vr.mod}):this.negative&Pr.negative?(Vr=this.neg().divmod(Pr.neg(),xr),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.isub(Pr)),{div:Vr.div,mod:Ur}):Pr.length>this.length||this.cmp(Pr)<0?{div:new Jt(0),mod:this}:Pr.length===1?xr==="div"?{div:this.divn(Pr.words[0]),mod:null}:xr==="mod"?{div:null,mod:new Jt(this.modn(Pr.words[0]))}:{div:this.divn(Pr.words[0]),mod:new Jt(this.modn(Pr.words[0]))}:this._wordDiv(Pr,xr)},Jt.prototype.div=function(Pr){return this.divmod(Pr,"div",!1).div},Jt.prototype.mod=function(Pr){return this.divmod(Pr,"mod",!1).mod},Jt.prototype.umod=function(Pr){return this.divmod(Pr,"mod",!0).mod},Jt.prototype.divRound=function(Pr){var xr=this.divmod(Pr);if(xr.mod.isZero())return xr.div;var Mr=xr.div.negative!==0?xr.mod.isub(Pr):xr.mod,Nr=Pr.ushrn(1),Ur=Pr.andln(1),Vr=Mr.cmp(Nr);return Vr<0||Ur===1&&Vr===0?xr.div:xr.div.negative!==0?xr.div.isubn(1):xr.div.iaddn(1)},Jt.prototype.modn=function(Pr){Yt(Pr<=67108863);for(var xr=(1<<26)%Pr,Mr=0,Nr=this.length-1;Nr>=0;Nr--)Mr=(xr*Mr+(this.words[Nr]|0))%Pr;return Mr},Jt.prototype.idivn=function(Pr){Yt(Pr<=67108863);for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=(this.words[Mr]|0)+xr*67108864;this.words[Mr]=Nr/Pr|0,xr=Nr%Pr}return this.strip()},Jt.prototype.divn=function(Pr){return this.clone().idivn(Pr)},Jt.prototype.egcd=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=new Jt(0),Zr=new Jt(1),Xr=0;xr.isEven()&&Mr.isEven();)xr.iushrn(1),Mr.iushrn(1),++Xr;for(var Or=Mr.clone(),jr=xr.clone();!xr.isZero();){for(var Jr=0,mn=1;!(xr.words[0]&mn)&&Jr<26;++Jr,mn<<=1);if(Jr>0)for(xr.iushrn(Jr);Jr-- >0;)(Nr.isOdd()||Ur.isOdd())&&(Nr.iadd(Or),Ur.isub(jr)),Nr.iushrn(1),Ur.iushrn(1);for(var gn=0,eo=1;!(Mr.words[0]&eo)&&gn<26;++gn,eo<<=1);if(gn>0)for(Mr.iushrn(gn);gn-- >0;)(Vr.isOdd()||Zr.isOdd())&&(Vr.iadd(Or),Zr.isub(jr)),Vr.iushrn(1),Zr.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Vr),Ur.isub(Zr)):(Mr.isub(xr),Vr.isub(Nr),Zr.isub(Ur))}return{a:Vr,b:Zr,gcd:Mr.iushln(Xr)}},Jt.prototype._invmp=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=Mr.clone();xr.cmpn(1)>0&&Mr.cmpn(1)>0;){for(var Zr=0,Xr=1;!(xr.words[0]&Xr)&&Zr<26;++Zr,Xr<<=1);if(Zr>0)for(xr.iushrn(Zr);Zr-- >0;)Nr.isOdd()&&Nr.iadd(Vr),Nr.iushrn(1);for(var Or=0,jr=1;!(Mr.words[0]&jr)&&Or<26;++Or,jr<<=1);if(Or>0)for(Mr.iushrn(Or);Or-- >0;)Ur.isOdd()&&Ur.iadd(Vr),Ur.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Ur)):(Mr.isub(xr),Ur.isub(Nr))}var Jr;return xr.cmpn(1)===0?Jr=Nr:Jr=Ur,Jr.cmpn(0)<0&&Jr.iadd(Pr),Jr},Jt.prototype.gcd=function(Pr){if(this.isZero())return Pr.abs();if(Pr.isZero())return this.abs();var xr=this.clone(),Mr=Pr.clone();xr.negative=0,Mr.negative=0;for(var Nr=0;xr.isEven()&&Mr.isEven();Nr++)xr.iushrn(1),Mr.iushrn(1);do{for(;xr.isEven();)xr.iushrn(1);for(;Mr.isEven();)Mr.iushrn(1);var Ur=xr.cmp(Mr);if(Ur<0){var Vr=xr;xr=Mr,Mr=Vr}else if(Ur===0||Mr.cmpn(1)===0)break;xr.isub(Mr)}while(!0);return Mr.iushln(Nr)},Jt.prototype.invm=function(Pr){return this.egcd(Pr).a.umod(Pr)},Jt.prototype.isEven=function(){return(this.words[0]&1)===0},Jt.prototype.isOdd=function(){return(this.words[0]&1)===1},Jt.prototype.andln=function(Pr){return this.words[0]&Pr},Jt.prototype.bincn=function(Pr){Yt(typeof Pr=="number");var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return this._expand(Mr+1),this.words[Mr]|=Nr,this;for(var Ur=Nr,Vr=Mr;Ur!==0&&Vr<this.length;Vr++){var Zr=this.words[Vr]|0;Zr+=Ur,Ur=Zr>>>26,Zr&=67108863,this.words[Vr]=Zr}return Ur!==0&&(this.words[Vr]=Ur,this.length++),this},Jt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Jt.prototype.cmpn=function(Pr){var xr=Pr<0;if(this.negative!==0&&!xr)return-1;if(this.negative===0&&xr)return 1;this.strip();var Mr;if(this.length>1)Mr=1;else{xr&&(Pr=-Pr),Yt(Pr<=67108863,"Number is too big");var Nr=this.words[0]|0;Mr=Nr===Pr?0:Nr<Pr?-1:1}return this.negative!==0?-Mr|0:Mr},Jt.prototype.cmp=function(Pr){if(this.negative!==0&&Pr.negative===0)return-1;if(this.negative===0&&Pr.negative!==0)return 1;var xr=this.ucmp(Pr);return this.negative!==0?-xr|0:xr},Jt.prototype.ucmp=function(Pr){if(this.length>Pr.length)return 1;if(this.length<Pr.length)return-1;for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=this.words[Mr]|0,Ur=Pr.words[Mr]|0;if(Nr!==Ur){Nr<Ur?xr=-1:Nr>Ur&&(xr=1);break}}return xr},Jt.prototype.gtn=function(Pr){return this.cmpn(Pr)===1},Jt.prototype.gt=function(Pr){return this.cmp(Pr)===1},Jt.prototype.gten=function(Pr){return this.cmpn(Pr)>=0},Jt.prototype.gte=function(Pr){return this.cmp(Pr)>=0},Jt.prototype.ltn=function(Pr){return this.cmpn(Pr)===-1},Jt.prototype.lt=function(Pr){return this.cmp(Pr)===-1},Jt.prototype.lten=function(Pr){return this.cmpn(Pr)<=0},Jt.prototype.lte=function(Pr){return this.cmp(Pr)<=0},Jt.prototype.eqn=function(Pr){return this.cmpn(Pr)===0},Jt.prototype.eq=function(Pr){return this.cmp(Pr)===0},Jt.red=function(Pr){return new En(Pr)},Jt.prototype.toRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),Yt(this.negative===0,"red works only with positives"),Pr.convertTo(this)._forceRed(Pr)},Jt.prototype.fromRed=function(){return Yt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Jt.prototype._forceRed=function(Pr){return this.red=Pr,this},Jt.prototype.forceRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),this._forceRed(Pr)},Jt.prototype.redAdd=function(Pr){return Yt(this.red,"redAdd works only with red numbers"),this.red.add(this,Pr)},Jt.prototype.redIAdd=function(Pr){return Yt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Pr)},Jt.prototype.redSub=function(Pr){return Yt(this.red,"redSub works only with red numbers"),this.red.sub(this,Pr)},Jt.prototype.redISub=function(Pr){return Yt(this.red,"redISub works only with red numbers"),this.red.isub(this,Pr)},Jt.prototype.redShl=function(Pr){return Yt(this.red,"redShl works only with red numbers"),this.red.shl(this,Pr)},Jt.prototype.redMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.mul(this,Pr)},Jt.prototype.redIMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.imul(this,Pr)},Jt.prototype.redSqr=function(){return Yt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Jt.prototype.redISqr=function(){return Yt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Jt.prototype.redSqrt=function(){return Yt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Jt.prototype.redInvm=function(){return Yt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Jt.prototype.redNeg=function(){return Yt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Jt.prototype.redPow=function(Pr){return Yt(this.red&&!Pr.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Pr)};var Gr={k256:null,p224:null,p192:null,p25519:null};function Kr(dn,Pr){this.name=dn,this.p=new Jt(Pr,16),this.n=this.p.bitLength(),this.k=new Jt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Kr.prototype._tmp=function(){var Pr=new Jt(null);return Pr.words=new Array(Math.ceil(this.n/13)),Pr},Kr.prototype.ireduce=function(Pr){var xr=Pr,Mr;do this.split(xr,this.tmp),xr=this.imulK(xr),xr=xr.iadd(this.tmp),Mr=xr.bitLength();while(Mr>this.n);var Nr=Mr<this.n?-1:xr.ucmp(this.p);return Nr===0?(xr.words[0]=0,xr.length=1):Nr>0?xr.isub(this.p):xr.strip(),xr},Kr.prototype.split=function(Pr,xr){Pr.iushrn(this.n,0,xr)},Kr.prototype.imulK=function(Pr){return Pr.imul(this.k)};function Yr(){Kr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Xt(Yr,Kr),Yr.prototype.split=function(Pr,xr){for(var Mr=4194303,Nr=Math.min(Pr.length,9),Ur=0;Ur<Nr;Ur++)xr.words[Ur]=Pr.words[Ur];if(xr.length=Nr,Pr.length<=9){Pr.words[0]=0,Pr.length=1;return}var Vr=Pr.words[9];for(xr.words[xr.length++]=Vr&Mr,Ur=10;Ur<Pr.length;Ur++){var Zr=Pr.words[Ur]|0;Pr.words[Ur-10]=(Zr&Mr)<<4|Vr>>>22,Vr=Zr}Vr>>>=22,Pr.words[Ur-10]=Vr,Vr===0&&Pr.length>10?Pr.length-=10:Pr.length-=9},Yr.prototype.imulK=function(Pr){Pr.words[Pr.length]=0,Pr.words[Pr.length+1]=0,Pr.length+=2;for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=Pr.words[Mr]|0;xr+=Nr*977,Pr.words[Mr]=xr&67108863,xr=Nr*64+(xr/67108864|0)}return Pr.words[Pr.length-1]===0&&(Pr.length--,Pr.words[Pr.length-1]===0&&Pr.length--),Pr};function hn(){Kr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Xt(hn,Kr);function Qr(){Kr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Xt(Qr,Kr);function pn(){Kr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Xt(pn,Kr),pn.prototype.imulK=function(Pr){for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=(Pr.words[Mr]|0)*19+xr,Ur=Nr&67108863;Nr>>>=26,Pr.words[Mr]=Ur,xr=Nr}return xr!==0&&(Pr.words[Pr.length++]=xr),Pr},Jt._prime=function(Pr){if(Gr[Pr])return Gr[Pr];var xr;if(Pr==="k256")xr=new Yr;else if(Pr==="p224")xr=new hn;else if(Pr==="p192")xr=new Qr;else if(Pr==="p25519")xr=new pn;else throw new Error("Unknown prime "+Pr);return Gr[Pr]=xr,xr};function En(dn){if(typeof dn=="string"){var Pr=Jt._prime(dn);this.m=Pr.p,this.prime=Pr}else Yt(dn.gtn(1),"modulus must be greater than 1"),this.m=dn,this.prime=null}En.prototype._verify1=function(Pr){Yt(Pr.negative===0,"red works only with positives"),Yt(Pr.red,"red works only with red numbers")},En.prototype._verify2=function(Pr,xr){Yt((Pr.negative|xr.negative)===0,"red works only with positives"),Yt(Pr.red&&Pr.red===xr.red,"red works only with red numbers")},En.prototype.imod=function(Pr){return this.prime?this.prime.ireduce(Pr)._forceRed(this):Pr.umod(this.m)._forceRed(this)},En.prototype.neg=function(Pr){return Pr.isZero()?Pr.clone():this.m.sub(Pr)._forceRed(this)},En.prototype.add=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.add(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr._forceRed(this)},En.prototype.iadd=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.iadd(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr},En.prototype.sub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.sub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr._forceRed(this)},En.prototype.isub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.isub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr},En.prototype.shl=function(Pr,xr){return this._verify1(Pr),this.imod(Pr.ushln(xr))},En.prototype.imul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.imul(xr))},En.prototype.mul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.mul(xr))},En.prototype.isqr=function(Pr){return this.imul(Pr,Pr.clone())},En.prototype.sqr=function(Pr){return this.mul(Pr,Pr)},En.prototype.sqrt=function(Pr){if(Pr.isZero())return Pr.clone();var xr=this.m.andln(3);if(Yt(xr%2===1),xr===3){var Mr=this.m.add(new Jt(1)).iushrn(2);return this.pow(Pr,Mr)}for(var Nr=this.m.subn(1),Ur=0;!Nr.isZero()&&Nr.andln(1)===0;)Ur++,Nr.iushrn(1);Yt(!Nr.isZero());var Vr=new Jt(1).toRed(this),Zr=Vr.redNeg(),Xr=this.m.subn(1).iushrn(1),Or=this.m.bitLength();for(Or=new Jt(2*Or*Or).toRed(this);this.pow(Or,Xr).cmp(Zr)!==0;)Or.redIAdd(Zr);for(var jr=this.pow(Or,Nr),Jr=this.pow(Pr,Nr.addn(1).iushrn(1)),mn=this.pow(Pr,Nr),gn=Ur;mn.cmp(Vr)!==0;){for(var eo=mn,_i=0;eo.cmp(Vr)!==0;_i++)eo=eo.redSqr();Yt(_i<gn);var ro=this.pow(jr,new Jt(1).iushln(gn-_i-1));Jr=Jr.redMul(ro),jr=ro.redSqr(),mn=mn.redMul(jr),gn=_i}return Jr},En.prototype.invm=function(Pr){var xr=Pr._invmp(this.m);return xr.negative!==0?(xr.negative=0,this.imod(xr).redNeg()):this.imod(xr)},En.prototype.pow=function(Pr,xr){if(xr.isZero())return new Jt(1).toRed(this);if(xr.cmpn(1)===0)return Pr.clone();var Mr=4,Nr=new Array(1<<Mr);Nr[0]=new Jt(1).toRed(this),Nr[1]=Pr;for(var Ur=2;Ur<Nr.length;Ur++)Nr[Ur]=this.mul(Nr[Ur-1],Pr);var Vr=Nr[0],Zr=0,Xr=0,Or=xr.bitLength()%26;for(Or===0&&(Or=26),Ur=xr.length-1;Ur>=0;Ur--){for(var jr=xr.words[Ur],Jr=Or-1;Jr>=0;Jr--){var mn=jr>>Jr&1;if(Vr!==Nr[0]&&(Vr=this.sqr(Vr)),mn===0&&Zr===0){Xr=0;continue}Zr<<=1,Zr|=mn,Xr++,!(Xr!==Mr&&(Ur!==0||Jr!==0))&&(Vr=this.mul(Vr,Nr[Zr]),Xr=0,Zr=0)}Or=26}return Vr},En.prototype.convertTo=function(Pr){var xr=Pr.umod(this.m);return xr===Pr?xr.clone():xr},En.prototype.convertFrom=function(Pr){var xr=Pr.clone();return xr.red=null,xr},Jt.mont=function(Pr){return new ga(Pr)};function ga(dn){En.call(this,dn),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Jt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Xt(ga,En),ga.prototype.convertTo=function(Pr){return this.imod(Pr.ushln(this.shift))},ga.prototype.convertFrom=function(Pr){var xr=this.imod(Pr.mul(this.rinv));return xr.red=null,xr},ga.prototype.imul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return Pr.words[0]=0,Pr.length=1,Pr;var Mr=Pr.imul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.mul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return new Jt(0)._forceRed(this);var Mr=Pr.mul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.invm=function(Pr){var xr=this.imod(Pr._invmp(this.m).mul(this.r2));return xr._forceRed(this)}})(Bt,commonjsGlobal)})(bn$2);bn$2.exports;var queryString$2={};(function(Bt){const Wt=strictUriEncode,Gt=decodeUriComponent,Yt=splitOnFirst,Xt=Br=>Br==null;function Jt(Br){switch(Br.arrayFormat){case"index":return Wr=>(Gr,Kr)=>{const Yr=Gr.length;return Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[",Yr,"]"].join("")]:[...Gr,[ur(Wr,Br),"[",ur(Yr,Br),"]=",ur(Kr,Br)].join("")]};case"bracket":return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[]"].join("")]:[...Gr,[ur(Wr,Br),"[]=",ur(Kr,Br)].join("")];case"comma":case"separator":return Wr=>(Gr,Kr)=>Kr==null||Kr.length===0?Gr:Gr.length===0?[[ur(Wr,Br),"=",ur(Kr,Br)].join("")]:[[Gr,ur(Kr,Br)].join(Br.arrayFormatSeparator)];default:return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,ur(Wr,Br)]:[...Gr,[ur(Wr,Br),"=",ur(Kr,Br)].join("")]}}function Zt(Br){let Wr;switch(Br.arrayFormat){case"index":return(Gr,Kr,Yr)=>{if(Wr=/\[(\d*)\]$/.exec(Gr),Gr=Gr.replace(/\[\d*\]$/,""),!Wr){Yr[Gr]=Kr;return}Yr[Gr]===void 0&&(Yr[Gr]={}),Yr[Gr][Wr[1]]=Kr};case"bracket":return(Gr,Kr,Yr)=>{if(Wr=/(\[\])$/.exec(Gr),Gr=Gr.replace(/\[\]$/,""),!Wr){Yr[Gr]=Kr;return}if(Yr[Gr]===void 0){Yr[Gr]=[Kr];return}Yr[Gr]=[].concat(Yr[Gr],Kr)};case"comma":case"separator":return(Gr,Kr,Yr)=>{const Qr=typeof Kr=="string"&&Kr.split("").indexOf(Br.arrayFormatSeparator)>-1?Kr.split(Br.arrayFormatSeparator).map(pn=>cr(pn,Br)):Kr===null?Kr:cr(Kr,Br);Yr[Gr]=Qr};default:return(Gr,Kr,Yr)=>{if(Yr[Gr]===void 0){Yr[Gr]=Kr;return}Yr[Gr]=[].concat(Yr[Gr],Kr)}}}function Qt(Br){if(typeof Br!="string"||Br.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ur(Br,Wr){return Wr.encode?Wr.strict?Wt(Br):encodeURIComponent(Br):Br}function cr(Br,Wr){return Wr.decode?Gt(Br):Br}function $r(Br){return Array.isArray(Br)?Br.sort():typeof Br=="object"?$r(Object.keys(Br)).sort((Wr,Gr)=>Number(Wr)-Number(Gr)).map(Wr=>Br[Wr]):Br}function Ar(Br){const Wr=Br.indexOf("#");return Wr!==-1&&(Br=Br.slice(0,Wr)),Br}function Lr(Br){let Wr="";const Gr=Br.indexOf("#");return Gr!==-1&&(Wr=Br.slice(Gr)),Wr}function qr(Br){Br=Ar(Br);const Wr=Br.indexOf("?");return Wr===-1?"":Br.slice(Wr+1)}function Fr(Br,Wr){return Wr.parseNumbers&&!Number.isNaN(Number(Br))&&typeof Br=="string"&&Br.trim()!==""?Br=Number(Br):Wr.parseBooleans&&Br!==null&&(Br.toLowerCase()==="true"||Br.toLowerCase()==="false")&&(Br=Br.toLowerCase()==="true"),Br}function Hr(Br,Wr){Wr=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Zt(Wr),Kr=Object.create(null);if(typeof Br!="string"||(Br=Br.trim().replace(/^[?#&]/,""),!Br))return Kr;for(const Yr of Br.split("&")){let[hn,Qr]=Yt(Wr.decode?Yr.replace(/\+/g," "):Yr,"=");Qr=Qr===void 0?null:["comma","separator"].includes(Wr.arrayFormat)?Qr:cr(Qr,Wr),Gr(cr(hn,Wr),Qr,Kr)}for(const Yr of Object.keys(Kr)){const hn=Kr[Yr];if(typeof hn=="object"&&hn!==null)for(const Qr of Object.keys(hn))hn[Qr]=Fr(hn[Qr],Wr);else Kr[Yr]=Fr(hn,Wr)}return Wr.sort===!1?Kr:(Wr.sort===!0?Object.keys(Kr).sort():Object.keys(Kr).sort(Wr.sort)).reduce((Yr,hn)=>{const Qr=Kr[hn];return Qr&&typeof Qr=="object"&&!Array.isArray(Qr)?Yr[hn]=$r(Qr):Yr[hn]=Qr,Yr},Object.create(null))}Bt.extract=qr,Bt.parse=Hr,Bt.stringify=(Br,Wr)=>{if(!Br)return"";Wr=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Qr=>Wr.skipNull&&Xt(Br[Qr])||Wr.skipEmptyString&&Br[Qr]==="",Kr=Jt(Wr),Yr={};for(const Qr of Object.keys(Br))Gr(Qr)||(Yr[Qr]=Br[Qr]);const hn=Object.keys(Yr);return Wr.sort!==!1&&hn.sort(Wr.sort),hn.map(Qr=>{const pn=Br[Qr];return pn===void 0?"":pn===null?ur(Qr,Wr):Array.isArray(pn)?pn.reduce(Kr(Qr),[]).join("&"):ur(Qr,Wr)+"="+ur(pn,Wr)}).filter(Qr=>Qr.length>0).join("&")},Bt.parseUrl=(Br,Wr)=>{Wr=Object.assign({decode:!0},Wr);const[Gr,Kr]=Yt(Br,"#");return Object.assign({url:Gr.split("?")[0]||"",query:Hr(qr(Br),Wr)},Wr&&Wr.parseFragmentIdentifier&&Kr?{fragmentIdentifier:cr(Kr,Wr)}:{})},Bt.stringifyUrl=(Br,Wr)=>{Wr=Object.assign({encode:!0,strict:!0},Wr);const Gr=Ar(Br.url).split("?")[0]||"",Kr=Bt.extract(Br.url),Yr=Bt.parse(Kr,{sort:!1}),hn=Object.assign(Yr,Br.query);let Qr=Bt.stringify(hn,Wr);Qr&&(Qr=`?${Qr}`);let pn=Lr(Br.url);return Br.fragmentIdentifier&&(pn=`#${ur(Br.fragmentIdentifier,Wr)}`),`${Gr}${Qr}${pn}`}})(queryString$2);const XHR=getFromWindow$1("XMLHttpRequest")||dist$g.XMLHttpRequest;class HTTPConnection extends EventEmitter$1{constructor(Wt){super(),this.url=Wt}formatError(Wt,Gt,Yt=-1){return{error:{message:Gt,code:Yt},id:Wt.id,jsonrpc:Wt.jsonrpc}}send(Wt,Gt){return new Promise(Yt=>{if(Wt.method==="eth_subscribe"){const Qt=this.formatError(Wt,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",Qt),Yt(Qt)}const Xt=new XHR;let Jt=!1;const Zt=(Qt,ur)=>{if(!Jt)if(Xt.abort(),Jt=!0,Gt)Gt(Qt,ur);else{const{id:cr,jsonrpc:$r}=Wt,Ar=Qt?{id:cr,jsonrpc:$r,error:{message:Qt.message,code:Qt.code}}:{id:cr,jsonrpc:$r,result:ur};this.emit("payload",Ar),Yt(Ar)}};Xt.open("POST",this.url,!0),Xt.setRequestHeader("Content-Type","application/json"),Xt.timeout=60*1e3,Xt.onerror=Zt,Xt.ontimeout=Zt,Xt.onreadystatechange=()=>{if(Xt.readyState===4)try{const Qt=JSON.parse(Xt.responseText);Zt(Qt.error,Qt.result)}catch(Qt){Zt(Qt)}},Xt.send(JSON.stringify(Wt))})}}const signingMethods=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],infuraNetworks={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var bn$1={exports:{}};bn$1.exports;(function(Bt){(function(Wt,Gt){function Yt(dn,Pr){if(!dn)throw new Error(Pr||"Assertion failed")}function Xt(dn,Pr){dn.super_=Pr;var xr=function(){};xr.prototype=Pr.prototype,dn.prototype=new xr,dn.prototype.constructor=dn}function Jt(dn,Pr,xr){if(Jt.isBN(dn))return dn;this.negative=0,this.words=null,this.length=0,this.red=null,dn!==null&&((Pr==="le"||Pr==="be")&&(xr=Pr,Pr=10),this._init(dn||0,Pr||10,xr||"be"))}typeof Wt=="object"?Wt.exports=Jt:Gt.BN=Jt,Jt.BN=Jt,Jt.wordSize=26;var Zt;try{Zt=require$$0$a.Buffer}catch{}Jt.isBN=function(Pr){return Pr instanceof Jt?!0:Pr!==null&&typeof Pr=="object"&&Pr.constructor.wordSize===Jt.wordSize&&Array.isArray(Pr.words)},Jt.max=function(Pr,xr){return Pr.cmp(xr)>0?Pr:xr},Jt.min=function(Pr,xr){return Pr.cmp(xr)<0?Pr:xr},Jt.prototype._init=function(Pr,xr,Mr){if(typeof Pr=="number")return this._initNumber(Pr,xr,Mr);if(typeof Pr=="object")return this._initArray(Pr,xr,Mr);xr==="hex"&&(xr=16),Yt(xr===(xr|0)&&xr>=2&&xr<=36),Pr=Pr.toString().replace(/\s+/g,"");var Nr=0;Pr[0]==="-"&&Nr++,xr===16?this._parseHex(Pr,Nr):this._parseBase(Pr,xr,Nr),Pr[0]==="-"&&(this.negative=1),this.strip(),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initNumber=function(Pr,xr,Mr){Pr<0&&(this.negative=1,Pr=-Pr),Pr<67108864?(this.words=[Pr&67108863],this.length=1):Pr<4503599627370496?(this.words=[Pr&67108863,Pr/67108864&67108863],this.length=2):(Yt(Pr<9007199254740992),this.words=[Pr&67108863,Pr/67108864&67108863,1],this.length=3),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initArray=function(Pr,xr,Mr){if(Yt(typeof Pr.length=="number"),Pr.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Pr.length/3),this.words=new Array(this.length);for(var Nr=0;Nr<this.length;Nr++)this.words[Nr]=0;var Ur,Vr,Zr=0;if(Mr==="be")for(Nr=Pr.length-1,Ur=0;Nr>=0;Nr-=3)Vr=Pr[Nr]|Pr[Nr-1]<<8|Pr[Nr-2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);else if(Mr==="le")for(Nr=0,Ur=0;Nr<Pr.length;Nr+=3)Vr=Pr[Nr]|Pr[Nr+1]<<8|Pr[Nr+2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);return this.strip()};function Qt(dn,Pr,xr){for(var Mr=0,Nr=Math.min(dn.length,xr),Ur=Pr;Ur<Nr;Ur++){var Vr=dn.charCodeAt(Ur)-48;Mr<<=4,Vr>=49&&Vr<=54?Mr|=Vr-49+10:Vr>=17&&Vr<=22?Mr|=Vr-17+10:Mr|=Vr&15}return Mr}Jt.prototype._parseHex=function(Pr,xr){this.length=Math.ceil((Pr.length-xr)/6),this.words=new Array(this.length);for(var Mr=0;Mr<this.length;Mr++)this.words[Mr]=0;var Nr,Ur,Vr=0;for(Mr=Pr.length-6,Nr=0;Mr>=xr;Mr-=6)Ur=Qt(Pr,Mr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303,Vr+=24,Vr>=26&&(Vr-=26,Nr++);Mr+6!==xr&&(Ur=Qt(Pr,xr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303),this.strip()};function ur(dn,Pr,xr,Mr){for(var Nr=0,Ur=Math.min(dn.length,xr),Vr=Pr;Vr<Ur;Vr++){var Zr=dn.charCodeAt(Vr)-48;Nr*=Mr,Zr>=49?Nr+=Zr-49+10:Zr>=17?Nr+=Zr-17+10:Nr+=Zr}return Nr}Jt.prototype._parseBase=function(Pr,xr,Mr){this.words=[0],this.length=1;for(var Nr=0,Ur=1;Ur<=67108863;Ur*=xr)Nr++;Nr--,Ur=Ur/xr|0;for(var Vr=Pr.length-Mr,Zr=Vr%Nr,Xr=Math.min(Vr,Vr-Zr)+Mr,Or=0,jr=Mr;jr<Xr;jr+=Nr)Or=ur(Pr,jr,jr+Nr,xr),this.imuln(Ur),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or);if(Zr!==0){var Jr=1;for(Or=ur(Pr,jr,Pr.length,xr),jr=0;jr<Zr;jr++)Jr*=xr;this.imuln(Jr),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or)}},Jt.prototype.copy=function(Pr){Pr.words=new Array(this.length);for(var xr=0;xr<this.length;xr++)Pr.words[xr]=this.words[xr];Pr.length=this.length,Pr.negative=this.negative,Pr.red=this.red},Jt.prototype.clone=function(){var Pr=new Jt(null);return this.copy(Pr),Pr},Jt.prototype._expand=function(Pr){for(;this.length<Pr;)this.words[this.length++]=0;return this},Jt.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Jt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Jt.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var cr=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],$r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ar=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Jt.prototype.toString=function(Pr,xr){Pr=Pr||10,xr=xr|0||1;var Mr;if(Pr===16||Pr==="hex"){Mr="";for(var Nr=0,Ur=0,Vr=0;Vr<this.length;Vr++){var Zr=this.words[Vr],Xr=((Zr<<Nr|Ur)&16777215).toString(16);Ur=Zr>>>24-Nr&16777215,Ur!==0||Vr!==this.length-1?Mr=cr[6-Xr.length]+Xr+Mr:Mr=Xr+Mr,Nr+=2,Nr>=26&&(Nr-=26,Vr--)}for(Ur!==0&&(Mr=Ur.toString(16)+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}if(Pr===(Pr|0)&&Pr>=2&&Pr<=36){var Or=$r[Pr],jr=Ar[Pr];Mr="";var Jr=this.clone();for(Jr.negative=0;!Jr.isZero();){var mn=Jr.modn(jr).toString(Pr);Jr=Jr.idivn(jr),Jr.isZero()?Mr=mn+Mr:Mr=cr[Or-mn.length]+mn+Mr}for(this.isZero()&&(Mr="0"+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}Yt(!1,"Base should be between 2 and 36")},Jt.prototype.toNumber=function(){var Pr=this.words[0];return this.length===2?Pr+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Pr+=4503599627370496+this.words[1]*67108864:this.length>2&&Yt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Pr:Pr},Jt.prototype.toJSON=function(){return this.toString(16)},Jt.prototype.toBuffer=function(Pr,xr){return Yt(typeof Zt<"u"),this.toArrayLike(Zt,Pr,xr)},Jt.prototype.toArray=function(Pr,xr){return this.toArrayLike(Array,Pr,xr)},Jt.prototype.toArrayLike=function(Pr,xr,Mr){var Nr=this.byteLength(),Ur=Mr||Math.max(1,Nr);Yt(Nr<=Ur,"byte array longer than desired length"),Yt(Ur>0,"Requested array length <= 0"),this.strip();var Vr=xr==="le",Zr=new Pr(Ur),Xr,Or,jr=this.clone();if(Vr){for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Or]=Xr;for(;Or<Ur;Or++)Zr[Or]=0}else{for(Or=0;Or<Ur-Nr;Or++)Zr[Or]=0;for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Ur-Or-1]=Xr}return Zr},Math.clz32?Jt.prototype._countBits=function(Pr){return 32-Math.clz32(Pr)}:Jt.prototype._countBits=function(Pr){var xr=Pr,Mr=0;return xr>=4096&&(Mr+=13,xr>>>=13),xr>=64&&(Mr+=7,xr>>>=7),xr>=8&&(Mr+=4,xr>>>=4),xr>=2&&(Mr+=2,xr>>>=2),Mr+xr},Jt.prototype._zeroBits=function(Pr){if(Pr===0)return 26;var xr=Pr,Mr=0;return xr&8191||(Mr+=13,xr>>>=13),xr&127||(Mr+=7,xr>>>=7),xr&15||(Mr+=4,xr>>>=4),xr&3||(Mr+=2,xr>>>=2),xr&1||Mr++,Mr},Jt.prototype.bitLength=function(){var Pr=this.words[this.length-1],xr=this._countBits(Pr);return(this.length-1)*26+xr};function Lr(dn){for(var Pr=new Array(dn.bitLength()),xr=0;xr<Pr.length;xr++){var Mr=xr/26|0,Nr=xr%26;Pr[xr]=(dn.words[Mr]&1<<Nr)>>>Nr}return Pr}Jt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Pr=0,xr=0;xr<this.length;xr++){var Mr=this._zeroBits(this.words[xr]);if(Pr+=Mr,Mr!==26)break}return Pr},Jt.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Jt.prototype.toTwos=function(Pr){return this.negative!==0?this.abs().inotn(Pr).iaddn(1):this.clone()},Jt.prototype.fromTwos=function(Pr){return this.testn(Pr-1)?this.notn(Pr).iaddn(1).ineg():this.clone()},Jt.prototype.isNeg=function(){return this.negative!==0},Jt.prototype.neg=function(){return this.clone().ineg()},Jt.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Jt.prototype.iuor=function(Pr){for(;this.length<Pr.length;)this.words[this.length++]=0;for(var xr=0;xr<Pr.length;xr++)this.words[xr]=this.words[xr]|Pr.words[xr];return this.strip()},Jt.prototype.ior=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuor(Pr)},Jt.prototype.or=function(Pr){return this.length>Pr.length?this.clone().ior(Pr):Pr.clone().ior(this)},Jt.prototype.uor=function(Pr){return this.length>Pr.length?this.clone().iuor(Pr):Pr.clone().iuor(this)},Jt.prototype.iuand=function(Pr){var xr;this.length>Pr.length?xr=Pr:xr=this;for(var Mr=0;Mr<xr.length;Mr++)this.words[Mr]=this.words[Mr]&Pr.words[Mr];return this.length=xr.length,this.strip()},Jt.prototype.iand=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuand(Pr)},Jt.prototype.and=function(Pr){return this.length>Pr.length?this.clone().iand(Pr):Pr.clone().iand(this)},Jt.prototype.uand=function(Pr){return this.length>Pr.length?this.clone().iuand(Pr):Pr.clone().iuand(this)},Jt.prototype.iuxor=function(Pr){var xr,Mr;this.length>Pr.length?(xr=this,Mr=Pr):(xr=Pr,Mr=this);for(var Nr=0;Nr<Mr.length;Nr++)this.words[Nr]=xr.words[Nr]^Mr.words[Nr];if(this!==xr)for(;Nr<xr.length;Nr++)this.words[Nr]=xr.words[Nr];return this.length=xr.length,this.strip()},Jt.prototype.ixor=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuxor(Pr)},Jt.prototype.xor=function(Pr){return this.length>Pr.length?this.clone().ixor(Pr):Pr.clone().ixor(this)},Jt.prototype.uxor=function(Pr){return this.length>Pr.length?this.clone().iuxor(Pr):Pr.clone().iuxor(this)},Jt.prototype.inotn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Math.ceil(Pr/26)|0,Mr=Pr%26;this._expand(xr),Mr>0&&xr--;for(var Nr=0;Nr<xr;Nr++)this.words[Nr]=~this.words[Nr]&67108863;return Mr>0&&(this.words[Nr]=~this.words[Nr]&67108863>>26-Mr),this.strip()},Jt.prototype.notn=function(Pr){return this.clone().inotn(Pr)},Jt.prototype.setn=function(Pr,xr){Yt(typeof Pr=="number"&&Pr>=0);var Mr=Pr/26|0,Nr=Pr%26;return this._expand(Mr+1),xr?this.words[Mr]=this.words[Mr]|1<<Nr:this.words[Mr]=this.words[Mr]&~(1<<Nr),this.strip()},Jt.prototype.iadd=function(Pr){var xr;if(this.negative!==0&&Pr.negative===0)return this.negative=0,xr=this.isub(Pr),this.negative^=1,this._normSign();if(this.negative===0&&Pr.negative!==0)return Pr.negative=0,xr=this.isub(Pr),Pr.negative=1,xr._normSign();var Mr,Nr;this.length>Pr.length?(Mr=this,Nr=Pr):(Mr=Pr,Nr=this);for(var Ur=0,Vr=0;Vr<Nr.length;Vr++)xr=(Mr.words[Vr]|0)+(Nr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;for(;Ur!==0&&Vr<Mr.length;Vr++)xr=(Mr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;if(this.length=Mr.length,Ur!==0)this.words[this.length]=Ur,this.length++;else if(Mr!==this)for(;Vr<Mr.length;Vr++)this.words[Vr]=Mr.words[Vr];return this},Jt.prototype.add=function(Pr){var xr;return Pr.negative!==0&&this.negative===0?(Pr.negative=0,xr=this.sub(Pr),Pr.negative^=1,xr):Pr.negative===0&&this.negative!==0?(this.negative=0,xr=Pr.sub(this),this.negative=1,xr):this.length>Pr.length?this.clone().iadd(Pr):Pr.clone().iadd(this)},Jt.prototype.isub=function(Pr){if(Pr.negative!==0){Pr.negative=0;var xr=this.iadd(Pr);return Pr.negative=1,xr._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Pr),this.negative=1,this._normSign();var Mr=this.cmp(Pr);if(Mr===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Nr,Ur;Mr>0?(Nr=this,Ur=Pr):(Nr=Pr,Ur=this);for(var Vr=0,Zr=0;Zr<Ur.length;Zr++)xr=(Nr.words[Zr]|0)-(Ur.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;for(;Vr!==0&&Zr<Nr.length;Zr++)xr=(Nr.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;if(Vr===0&&Zr<Nr.length&&Nr!==this)for(;Zr<Nr.length;Zr++)this.words[Zr]=Nr.words[Zr];return this.length=Math.max(this.length,Zr),Nr!==this&&(this.negative=1),this.strip()},Jt.prototype.sub=function(Pr){return this.clone().isub(Pr)};function qr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative;var Mr=dn.length+Pr.length|0;xr.length=Mr,Mr=Mr-1|0;var Nr=dn.words[0]|0,Ur=Pr.words[0]|0,Vr=Nr*Ur,Zr=Vr&67108863,Xr=Vr/67108864|0;xr.words[0]=Zr;for(var Or=1;Or<Mr;Or++){for(var jr=Xr>>>26,Jr=Xr&67108863,mn=Math.min(Or,Pr.length-1),gn=Math.max(0,Or-dn.length+1);gn<=mn;gn++){var eo=Or-gn|0;Nr=dn.words[eo]|0,Ur=Pr.words[gn]|0,Vr=Nr*Ur+Jr,jr+=Vr/67108864|0,Jr=Vr&67108863}xr.words[Or]=Jr|0,Xr=jr|0}return Xr!==0?xr.words[Or]=Xr|0:xr.length--,xr.strip()}var Fr=function(Pr,xr,Mr){var Nr=Pr.words,Ur=xr.words,Vr=Mr.words,Zr=0,Xr,Or,jr,Jr=Nr[0]|0,mn=Jr&8191,gn=Jr>>>13,eo=Nr[1]|0,_i=eo&8191,ro=eo>>>13,io=Nr[2]|0,ao=io&8191,oo=io>>>13,to=Nr[3]|0,so=to&8191,lo=to>>>13,Ro=Nr[4]|0,Io=Ro&8191,Fo=Ro>>>13,xo=Nr[5]|0,ho=xo&8191,po=xo>>>13,Ao=Nr[6]|0,Bo=Ao&8191,Mo=Ao>>>13,bo=Nr[7]|0,yo=bo&8191,Do=bo>>>13,Tu=Nr[8]|0,wu=Tu&8191,$o=Tu>>>13,mo=Nr[9]|0,_o=mo&8191,To=mo>>>13,iu=Ur[0]|0,nu=iu&8191,Jo=iu>>>13,cu=Ur[1]|0,au=cu&8191,tu=cu>>>13,Iu=Ur[2]|0,Ru=Iu&8191,$u=Iu>>>13,Yu=Ur[3]|0,qu=Yu&8191,fu=Yu>>>13,Xu=Ur[4]|0,Nu=Xu&8191,jo=Xu>>>13,qo=Ur[5]|0,Vo=qo&8191,zo=qo>>>13,Au=Ur[6]|0,_u=Au&8191,hu=Au>>>13,vu=Ur[7]|0,ju=vu&8191,Co=vu>>>13,Ho=Ur[8]|0,Ko=Ho&8191,Go=Ho>>>13,du=Ur[9]|0,Cu=du&8191,gu=du>>>13;Mr.negative=Pr.negative^xr.negative,Mr.length=19,Xr=Math.imul(mn,nu),Or=Math.imul(mn,Jo),Or=Or+Math.imul(gn,nu)|0,jr=Math.imul(gn,Jo);var el=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(el>>>26)|0,el&=67108863,Xr=Math.imul(_i,nu),Or=Math.imul(_i,Jo),Or=Or+Math.imul(ro,nu)|0,jr=Math.imul(ro,Jo),Xr=Xr+Math.imul(mn,au)|0,Or=Or+Math.imul(mn,tu)|0,Or=Or+Math.imul(gn,au)|0,jr=jr+Math.imul(gn,tu)|0;var wl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(wl>>>26)|0,wl&=67108863,Xr=Math.imul(ao,nu),Or=Math.imul(ao,Jo),Or=Or+Math.imul(oo,nu)|0,jr=Math.imul(oo,Jo),Xr=Xr+Math.imul(_i,au)|0,Or=Or+Math.imul(_i,tu)|0,Or=Or+Math.imul(ro,au)|0,jr=jr+Math.imul(ro,tu)|0,Xr=Xr+Math.imul(mn,Ru)|0,Or=Or+Math.imul(mn,$u)|0,Or=Or+Math.imul(gn,Ru)|0,jr=jr+Math.imul(gn,$u)|0;var Pl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Pl>>>26)|0,Pl&=67108863,Xr=Math.imul(so,nu),Or=Math.imul(so,Jo),Or=Or+Math.imul(lo,nu)|0,jr=Math.imul(lo,Jo),Xr=Xr+Math.imul(ao,au)|0,Or=Or+Math.imul(ao,tu)|0,Or=Or+Math.imul(oo,au)|0,jr=jr+Math.imul(oo,tu)|0,Xr=Xr+Math.imul(_i,Ru)|0,Or=Or+Math.imul(_i,$u)|0,Or=Or+Math.imul(ro,Ru)|0,jr=jr+Math.imul(ro,$u)|0,Xr=Xr+Math.imul(mn,qu)|0,Or=Or+Math.imul(mn,fu)|0,Or=Or+Math.imul(gn,qu)|0,jr=jr+Math.imul(gn,fu)|0;var kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(kl>>>26)|0,kl&=67108863,Xr=Math.imul(Io,nu),Or=Math.imul(Io,Jo),Or=Or+Math.imul(Fo,nu)|0,jr=Math.imul(Fo,Jo),Xr=Xr+Math.imul(so,au)|0,Or=Or+Math.imul(so,tu)|0,Or=Or+Math.imul(lo,au)|0,jr=jr+Math.imul(lo,tu)|0,Xr=Xr+Math.imul(ao,Ru)|0,Or=Or+Math.imul(ao,$u)|0,Or=Or+Math.imul(oo,Ru)|0,jr=jr+Math.imul(oo,$u)|0,Xr=Xr+Math.imul(_i,qu)|0,Or=Or+Math.imul(_i,fu)|0,Or=Or+Math.imul(ro,qu)|0,jr=jr+Math.imul(ro,fu)|0,Xr=Xr+Math.imul(mn,Nu)|0,Or=Or+Math.imul(mn,jo)|0,Or=Or+Math.imul(gn,Nu)|0,jr=jr+Math.imul(gn,jo)|0;var Ll=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,Xr=Math.imul(ho,nu),Or=Math.imul(ho,Jo),Or=Or+Math.imul(po,nu)|0,jr=Math.imul(po,Jo),Xr=Xr+Math.imul(Io,au)|0,Or=Or+Math.imul(Io,tu)|0,Or=Or+Math.imul(Fo,au)|0,jr=jr+Math.imul(Fo,tu)|0,Xr=Xr+Math.imul(so,Ru)|0,Or=Or+Math.imul(so,$u)|0,Or=Or+Math.imul(lo,Ru)|0,jr=jr+Math.imul(lo,$u)|0,Xr=Xr+Math.imul(ao,qu)|0,Or=Or+Math.imul(ao,fu)|0,Or=Or+Math.imul(oo,qu)|0,jr=jr+Math.imul(oo,fu)|0,Xr=Xr+Math.imul(_i,Nu)|0,Or=Or+Math.imul(_i,jo)|0,Or=Or+Math.imul(ro,Nu)|0,jr=jr+Math.imul(ro,jo)|0,Xr=Xr+Math.imul(mn,Vo)|0,Or=Or+Math.imul(mn,zo)|0,Or=Or+Math.imul(gn,Vo)|0,jr=jr+Math.imul(gn,zo)|0;var Hl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Hl>>>26)|0,Hl&=67108863,Xr=Math.imul(Bo,nu),Or=Math.imul(Bo,Jo),Or=Or+Math.imul(Mo,nu)|0,jr=Math.imul(Mo,Jo),Xr=Xr+Math.imul(ho,au)|0,Or=Or+Math.imul(ho,tu)|0,Or=Or+Math.imul(po,au)|0,jr=jr+Math.imul(po,tu)|0,Xr=Xr+Math.imul(Io,Ru)|0,Or=Or+Math.imul(Io,$u)|0,Or=Or+Math.imul(Fo,Ru)|0,jr=jr+Math.imul(Fo,$u)|0,Xr=Xr+Math.imul(so,qu)|0,Or=Or+Math.imul(so,fu)|0,Or=Or+Math.imul(lo,qu)|0,jr=jr+Math.imul(lo,fu)|0,Xr=Xr+Math.imul(ao,Nu)|0,Or=Or+Math.imul(ao,jo)|0,Or=Or+Math.imul(oo,Nu)|0,jr=jr+Math.imul(oo,jo)|0,Xr=Xr+Math.imul(_i,Vo)|0,Or=Or+Math.imul(_i,zo)|0,Or=Or+Math.imul(ro,Vo)|0,jr=jr+Math.imul(ro,zo)|0,Xr=Xr+Math.imul(mn,_u)|0,Or=Or+Math.imul(mn,hu)|0,Or=Or+Math.imul(gn,_u)|0,jr=jr+Math.imul(gn,hu)|0;var Nl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,Xr=Math.imul(yo,nu),Or=Math.imul(yo,Jo),Or=Or+Math.imul(Do,nu)|0,jr=Math.imul(Do,Jo),Xr=Xr+Math.imul(Bo,au)|0,Or=Or+Math.imul(Bo,tu)|0,Or=Or+Math.imul(Mo,au)|0,jr=jr+Math.imul(Mo,tu)|0,Xr=Xr+Math.imul(ho,Ru)|0,Or=Or+Math.imul(ho,$u)|0,Or=Or+Math.imul(po,Ru)|0,jr=jr+Math.imul(po,$u)|0,Xr=Xr+Math.imul(Io,qu)|0,Or=Or+Math.imul(Io,fu)|0,Or=Or+Math.imul(Fo,qu)|0,jr=jr+Math.imul(Fo,fu)|0,Xr=Xr+Math.imul(so,Nu)|0,Or=Or+Math.imul(so,jo)|0,Or=Or+Math.imul(lo,Nu)|0,jr=jr+Math.imul(lo,jo)|0,Xr=Xr+Math.imul(ao,Vo)|0,Or=Or+Math.imul(ao,zo)|0,Or=Or+Math.imul(oo,Vo)|0,jr=jr+Math.imul(oo,zo)|0,Xr=Xr+Math.imul(_i,_u)|0,Or=Or+Math.imul(_i,hu)|0,Or=Or+Math.imul(ro,_u)|0,jr=jr+Math.imul(ro,hu)|0,Xr=Xr+Math.imul(mn,ju)|0,Or=Or+Math.imul(mn,Co)|0,Or=Or+Math.imul(gn,ju)|0,jr=jr+Math.imul(gn,Co)|0;var Dl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Dl>>>26)|0,Dl&=67108863,Xr=Math.imul(wu,nu),Or=Math.imul(wu,Jo),Or=Or+Math.imul($o,nu)|0,jr=Math.imul($o,Jo),Xr=Xr+Math.imul(yo,au)|0,Or=Or+Math.imul(yo,tu)|0,Or=Or+Math.imul(Do,au)|0,jr=jr+Math.imul(Do,tu)|0,Xr=Xr+Math.imul(Bo,Ru)|0,Or=Or+Math.imul(Bo,$u)|0,Or=Or+Math.imul(Mo,Ru)|0,jr=jr+Math.imul(Mo,$u)|0,Xr=Xr+Math.imul(ho,qu)|0,Or=Or+Math.imul(ho,fu)|0,Or=Or+Math.imul(po,qu)|0,jr=jr+Math.imul(po,fu)|0,Xr=Xr+Math.imul(Io,Nu)|0,Or=Or+Math.imul(Io,jo)|0,Or=Or+Math.imul(Fo,Nu)|0,jr=jr+Math.imul(Fo,jo)|0,Xr=Xr+Math.imul(so,Vo)|0,Or=Or+Math.imul(so,zo)|0,Or=Or+Math.imul(lo,Vo)|0,jr=jr+Math.imul(lo,zo)|0,Xr=Xr+Math.imul(ao,_u)|0,Or=Or+Math.imul(ao,hu)|0,Or=Or+Math.imul(oo,_u)|0,jr=jr+Math.imul(oo,hu)|0,Xr=Xr+Math.imul(_i,ju)|0,Or=Or+Math.imul(_i,Co)|0,Or=Or+Math.imul(ro,ju)|0,jr=jr+Math.imul(ro,Co)|0,Xr=Xr+Math.imul(mn,Ko)|0,Or=Or+Math.imul(mn,Go)|0,Or=Or+Math.imul(gn,Ko)|0,jr=jr+Math.imul(gn,Go)|0;var Ju=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,Xr=Math.imul(_o,nu),Or=Math.imul(_o,Jo),Or=Or+Math.imul(To,nu)|0,jr=Math.imul(To,Jo),Xr=Xr+Math.imul(wu,au)|0,Or=Or+Math.imul(wu,tu)|0,Or=Or+Math.imul($o,au)|0,jr=jr+Math.imul($o,tu)|0,Xr=Xr+Math.imul(yo,Ru)|0,Or=Or+Math.imul(yo,$u)|0,Or=Or+Math.imul(Do,Ru)|0,jr=jr+Math.imul(Do,$u)|0,Xr=Xr+Math.imul(Bo,qu)|0,Or=Or+Math.imul(Bo,fu)|0,Or=Or+Math.imul(Mo,qu)|0,jr=jr+Math.imul(Mo,fu)|0,Xr=Xr+Math.imul(ho,Nu)|0,Or=Or+Math.imul(ho,jo)|0,Or=Or+Math.imul(po,Nu)|0,jr=jr+Math.imul(po,jo)|0,Xr=Xr+Math.imul(Io,Vo)|0,Or=Or+Math.imul(Io,zo)|0,Or=Or+Math.imul(Fo,Vo)|0,jr=jr+Math.imul(Fo,zo)|0,Xr=Xr+Math.imul(so,_u)|0,Or=Or+Math.imul(so,hu)|0,Or=Or+Math.imul(lo,_u)|0,jr=jr+Math.imul(lo,hu)|0,Xr=Xr+Math.imul(ao,ju)|0,Or=Or+Math.imul(ao,Co)|0,Or=Or+Math.imul(oo,ju)|0,jr=jr+Math.imul(oo,Co)|0,Xr=Xr+Math.imul(_i,Ko)|0,Or=Or+Math.imul(_i,Go)|0,Or=Or+Math.imul(ro,Ko)|0,jr=jr+Math.imul(ro,Go)|0,Xr=Xr+Math.imul(mn,Cu)|0,Or=Or+Math.imul(mn,gu)|0,Or=Or+Math.imul(gn,Cu)|0,jr=jr+Math.imul(gn,gu)|0;var Kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Kl>>>26)|0,Kl&=67108863,Xr=Math.imul(_o,au),Or=Math.imul(_o,tu),Or=Or+Math.imul(To,au)|0,jr=Math.imul(To,tu),Xr=Xr+Math.imul(wu,Ru)|0,Or=Or+Math.imul(wu,$u)|0,Or=Or+Math.imul($o,Ru)|0,jr=jr+Math.imul($o,$u)|0,Xr=Xr+Math.imul(yo,qu)|0,Or=Or+Math.imul(yo,fu)|0,Or=Or+Math.imul(Do,qu)|0,jr=jr+Math.imul(Do,fu)|0,Xr=Xr+Math.imul(Bo,Nu)|0,Or=Or+Math.imul(Bo,jo)|0,Or=Or+Math.imul(Mo,Nu)|0,jr=jr+Math.imul(Mo,jo)|0,Xr=Xr+Math.imul(ho,Vo)|0,Or=Or+Math.imul(ho,zo)|0,Or=Or+Math.imul(po,Vo)|0,jr=jr+Math.imul(po,zo)|0,Xr=Xr+Math.imul(Io,_u)|0,Or=Or+Math.imul(Io,hu)|0,Or=Or+Math.imul(Fo,_u)|0,jr=jr+Math.imul(Fo,hu)|0,Xr=Xr+Math.imul(so,ju)|0,Or=Or+Math.imul(so,Co)|0,Or=Or+Math.imul(lo,ju)|0,jr=jr+Math.imul(lo,Co)|0,Xr=Xr+Math.imul(ao,Ko)|0,Or=Or+Math.imul(ao,Go)|0,Or=Or+Math.imul(oo,Ko)|0,jr=jr+Math.imul(oo,Go)|0,Xr=Xr+Math.imul(_i,Cu)|0,Or=Or+Math.imul(_i,gu)|0,Or=Or+Math.imul(ro,Cu)|0,jr=jr+Math.imul(ro,gu)|0;var ep=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ep>>>26)|0,ep&=67108863,Xr=Math.imul(_o,Ru),Or=Math.imul(_o,$u),Or=Or+Math.imul(To,Ru)|0,jr=Math.imul(To,$u),Xr=Xr+Math.imul(wu,qu)|0,Or=Or+Math.imul(wu,fu)|0,Or=Or+Math.imul($o,qu)|0,jr=jr+Math.imul($o,fu)|0,Xr=Xr+Math.imul(yo,Nu)|0,Or=Or+Math.imul(yo,jo)|0,Or=Or+Math.imul(Do,Nu)|0,jr=jr+Math.imul(Do,jo)|0,Xr=Xr+Math.imul(Bo,Vo)|0,Or=Or+Math.imul(Bo,zo)|0,Or=Or+Math.imul(Mo,Vo)|0,jr=jr+Math.imul(Mo,zo)|0,Xr=Xr+Math.imul(ho,_u)|0,Or=Or+Math.imul(ho,hu)|0,Or=Or+Math.imul(po,_u)|0,jr=jr+Math.imul(po,hu)|0,Xr=Xr+Math.imul(Io,ju)|0,Or=Or+Math.imul(Io,Co)|0,Or=Or+Math.imul(Fo,ju)|0,jr=jr+Math.imul(Fo,Co)|0,Xr=Xr+Math.imul(so,Ko)|0,Or=Or+Math.imul(so,Go)|0,Or=Or+Math.imul(lo,Ko)|0,jr=jr+Math.imul(lo,Go)|0,Xr=Xr+Math.imul(ao,Cu)|0,Or=Or+Math.imul(ao,gu)|0,Or=Or+Math.imul(oo,Cu)|0,jr=jr+Math.imul(oo,gu)|0;var ap=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ap>>>26)|0,ap&=67108863,Xr=Math.imul(_o,qu),Or=Math.imul(_o,fu),Or=Or+Math.imul(To,qu)|0,jr=Math.imul(To,fu),Xr=Xr+Math.imul(wu,Nu)|0,Or=Or+Math.imul(wu,jo)|0,Or=Or+Math.imul($o,Nu)|0,jr=jr+Math.imul($o,jo)|0,Xr=Xr+Math.imul(yo,Vo)|0,Or=Or+Math.imul(yo,zo)|0,Or=Or+Math.imul(Do,Vo)|0,jr=jr+Math.imul(Do,zo)|0,Xr=Xr+Math.imul(Bo,_u)|0,Or=Or+Math.imul(Bo,hu)|0,Or=Or+Math.imul(Mo,_u)|0,jr=jr+Math.imul(Mo,hu)|0,Xr=Xr+Math.imul(ho,ju)|0,Or=Or+Math.imul(ho,Co)|0,Or=Or+Math.imul(po,ju)|0,jr=jr+Math.imul(po,Co)|0,Xr=Xr+Math.imul(Io,Ko)|0,Or=Or+Math.imul(Io,Go)|0,Or=Or+Math.imul(Fo,Ko)|0,jr=jr+Math.imul(Fo,Go)|0,Xr=Xr+Math.imul(so,Cu)|0,Or=Or+Math.imul(so,gu)|0,Or=Or+Math.imul(lo,Cu)|0,jr=jr+Math.imul(lo,gu)|0;var fp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(fp>>>26)|0,fp&=67108863,Xr=Math.imul(_o,Nu),Or=Math.imul(_o,jo),Or=Or+Math.imul(To,Nu)|0,jr=Math.imul(To,jo),Xr=Xr+Math.imul(wu,Vo)|0,Or=Or+Math.imul(wu,zo)|0,Or=Or+Math.imul($o,Vo)|0,jr=jr+Math.imul($o,zo)|0,Xr=Xr+Math.imul(yo,_u)|0,Or=Or+Math.imul(yo,hu)|0,Or=Or+Math.imul(Do,_u)|0,jr=jr+Math.imul(Do,hu)|0,Xr=Xr+Math.imul(Bo,ju)|0,Or=Or+Math.imul(Bo,Co)|0,Or=Or+Math.imul(Mo,ju)|0,jr=jr+Math.imul(Mo,Co)|0,Xr=Xr+Math.imul(ho,Ko)|0,Or=Or+Math.imul(ho,Go)|0,Or=Or+Math.imul(po,Ko)|0,jr=jr+Math.imul(po,Go)|0,Xr=Xr+Math.imul(Io,Cu)|0,Or=Or+Math.imul(Io,gu)|0,Or=Or+Math.imul(Fo,Cu)|0,jr=jr+Math.imul(Fo,gu)|0;var _f=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(_f>>>26)|0,_f&=67108863,Xr=Math.imul(_o,Vo),Or=Math.imul(_o,zo),Or=Or+Math.imul(To,Vo)|0,jr=Math.imul(To,zo),Xr=Xr+Math.imul(wu,_u)|0,Or=Or+Math.imul(wu,hu)|0,Or=Or+Math.imul($o,_u)|0,jr=jr+Math.imul($o,hu)|0,Xr=Xr+Math.imul(yo,ju)|0,Or=Or+Math.imul(yo,Co)|0,Or=Or+Math.imul(Do,ju)|0,jr=jr+Math.imul(Do,Co)|0,Xr=Xr+Math.imul(Bo,Ko)|0,Or=Or+Math.imul(Bo,Go)|0,Or=Or+Math.imul(Mo,Ko)|0,jr=jr+Math.imul(Mo,Go)|0,Xr=Xr+Math.imul(ho,Cu)|0,Or=Or+Math.imul(ho,gu)|0,Or=Or+Math.imul(po,Cu)|0,jr=jr+Math.imul(po,gu)|0;var rp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(rp>>>26)|0,rp&=67108863,Xr=Math.imul(_o,_u),Or=Math.imul(_o,hu),Or=Or+Math.imul(To,_u)|0,jr=Math.imul(To,hu),Xr=Xr+Math.imul(wu,ju)|0,Or=Or+Math.imul(wu,Co)|0,Or=Or+Math.imul($o,ju)|0,jr=jr+Math.imul($o,Co)|0,Xr=Xr+Math.imul(yo,Ko)|0,Or=Or+Math.imul(yo,Go)|0,Or=Or+Math.imul(Do,Ko)|0,jr=jr+Math.imul(Do,Go)|0,Xr=Xr+Math.imul(Bo,Cu)|0,Or=Or+Math.imul(Bo,gu)|0,Or=Or+Math.imul(Mo,Cu)|0,jr=jr+Math.imul(Mo,gu)|0;var dp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(dp>>>26)|0,dp&=67108863,Xr=Math.imul(_o,ju),Or=Math.imul(_o,Co),Or=Or+Math.imul(To,ju)|0,jr=Math.imul(To,Co),Xr=Xr+Math.imul(wu,Ko)|0,Or=Or+Math.imul(wu,Go)|0,Or=Or+Math.imul($o,Ko)|0,jr=jr+Math.imul($o,Go)|0,Xr=Xr+Math.imul(yo,Cu)|0,Or=Or+Math.imul(yo,gu)|0,Or=Or+Math.imul(Do,Cu)|0,jr=jr+Math.imul(Do,gu)|0;var np=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(np>>>26)|0,np&=67108863,Xr=Math.imul(_o,Ko),Or=Math.imul(_o,Go),Or=Or+Math.imul(To,Ko)|0,jr=Math.imul(To,Go),Xr=Xr+Math.imul(wu,Cu)|0,Or=Or+Math.imul(wu,gu)|0,Or=Or+Math.imul($o,Cu)|0,jr=jr+Math.imul($o,gu)|0;var Jl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Jl>>>26)|0,Jl&=67108863,Xr=Math.imul(_o,Cu),Or=Math.imul(_o,gu),Or=Or+Math.imul(To,Cu)|0,jr=Math.imul(To,gu);var mp=(Zr+Xr|0)+((Or&8191)<<13)|0;return Zr=(jr+(Or>>>13)|0)+(mp>>>26)|0,mp&=67108863,Vr[0]=el,Vr[1]=wl,Vr[2]=Pl,Vr[3]=kl,Vr[4]=Ll,Vr[5]=Hl,Vr[6]=Nl,Vr[7]=Dl,Vr[8]=Ju,Vr[9]=Kl,Vr[10]=ep,Vr[11]=ap,Vr[12]=fp,Vr[13]=_f,Vr[14]=rp,Vr[15]=dp,Vr[16]=np,Vr[17]=Jl,Vr[18]=mp,Zr!==0&&(Vr[19]=Zr,Mr.length++),Mr};Math.imul||(Fr=qr);function Hr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative,xr.length=dn.length+Pr.length;for(var Mr=0,Nr=0,Ur=0;Ur<xr.length-1;Ur++){var Vr=Nr;Nr=0;for(var Zr=Mr&67108863,Xr=Math.min(Ur,Pr.length-1),Or=Math.max(0,Ur-dn.length+1);Or<=Xr;Or++){var jr=Ur-Or,Jr=dn.words[jr]|0,mn=Pr.words[Or]|0,gn=Jr*mn,eo=gn&67108863;Vr=Vr+(gn/67108864|0)|0,eo=eo+Zr|0,Zr=eo&67108863,Vr=Vr+(eo>>>26)|0,Nr+=Vr>>>26,Vr&=67108863}xr.words[Ur]=Zr,Mr=Vr,Vr=Nr}return Mr!==0?xr.words[Ur]=Mr:xr.length--,xr.strip()}function Br(dn,Pr,xr){var Mr=new Wr;return Mr.mulp(dn,Pr,xr)}Jt.prototype.mulTo=function(Pr,xr){var Mr,Nr=this.length+Pr.length;return this.length===10&&Pr.length===10?Mr=Fr(this,Pr,xr):Nr<63?Mr=qr(this,Pr,xr):Nr<1024?Mr=Hr(this,Pr,xr):Mr=Br(this,Pr,xr),Mr};function Wr(dn,Pr){this.x=dn,this.y=Pr}Wr.prototype.makeRBT=function(Pr){for(var xr=new Array(Pr),Mr=Jt.prototype._countBits(Pr)-1,Nr=0;Nr<Pr;Nr++)xr[Nr]=this.revBin(Nr,Mr,Pr);return xr},Wr.prototype.revBin=function(Pr,xr,Mr){if(Pr===0||Pr===Mr-1)return Pr;for(var Nr=0,Ur=0;Ur<xr;Ur++)Nr|=(Pr&1)<<xr-Ur-1,Pr>>=1;return Nr},Wr.prototype.permute=function(Pr,xr,Mr,Nr,Ur,Vr){for(var Zr=0;Zr<Vr;Zr++)Nr[Zr]=xr[Pr[Zr]],Ur[Zr]=Mr[Pr[Zr]]},Wr.prototype.transform=function(Pr,xr,Mr,Nr,Ur,Vr){this.permute(Vr,Pr,xr,Mr,Nr,Ur);for(var Zr=1;Zr<Ur;Zr<<=1)for(var Xr=Zr<<1,Or=Math.cos(2*Math.PI/Xr),jr=Math.sin(2*Math.PI/Xr),Jr=0;Jr<Ur;Jr+=Xr)for(var mn=Or,gn=jr,eo=0;eo<Zr;eo++){var _i=Mr[Jr+eo],ro=Nr[Jr+eo],io=Mr[Jr+eo+Zr],ao=Nr[Jr+eo+Zr],oo=mn*io-gn*ao;ao=mn*ao+gn*io,io=oo,Mr[Jr+eo]=_i+io,Nr[Jr+eo]=ro+ao,Mr[Jr+eo+Zr]=_i-io,Nr[Jr+eo+Zr]=ro-ao,eo!==Xr&&(oo=Or*mn-jr*gn,gn=Or*gn+jr*mn,mn=oo)}},Wr.prototype.guessLen13b=function(Pr,xr){var Mr=Math.max(xr,Pr)|1,Nr=Mr&1,Ur=0;for(Mr=Mr/2|0;Mr;Mr=Mr>>>1)Ur++;return 1<<Ur+1+Nr},Wr.prototype.conjugate=function(Pr,xr,Mr){if(!(Mr<=1))for(var Nr=0;Nr<Mr/2;Nr++){var Ur=Pr[Nr];Pr[Nr]=Pr[Mr-Nr-1],Pr[Mr-Nr-1]=Ur,Ur=xr[Nr],xr[Nr]=-xr[Mr-Nr-1],xr[Mr-Nr-1]=-Ur}},Wr.prototype.normalize13b=function(Pr,xr){for(var Mr=0,Nr=0;Nr<xr/2;Nr++){var Ur=Math.round(Pr[2*Nr+1]/xr)*8192+Math.round(Pr[2*Nr]/xr)+Mr;Pr[Nr]=Ur&67108863,Ur<67108864?Mr=0:Mr=Ur/67108864|0}return Pr},Wr.prototype.convert13b=function(Pr,xr,Mr,Nr){for(var Ur=0,Vr=0;Vr<xr;Vr++)Ur=Ur+(Pr[Vr]|0),Mr[2*Vr]=Ur&8191,Ur=Ur>>>13,Mr[2*Vr+1]=Ur&8191,Ur=Ur>>>13;for(Vr=2*xr;Vr<Nr;++Vr)Mr[Vr]=0;Yt(Ur===0),Yt((Ur&-8192)===0)},Wr.prototype.stub=function(Pr){for(var xr=new Array(Pr),Mr=0;Mr<Pr;Mr++)xr[Mr]=0;return xr},Wr.prototype.mulp=function(Pr,xr,Mr){var Nr=2*this.guessLen13b(Pr.length,xr.length),Ur=this.makeRBT(Nr),Vr=this.stub(Nr),Zr=new Array(Nr),Xr=new Array(Nr),Or=new Array(Nr),jr=new Array(Nr),Jr=new Array(Nr),mn=new Array(Nr),gn=Mr.words;gn.length=Nr,this.convert13b(Pr.words,Pr.length,Zr,Nr),this.convert13b(xr.words,xr.length,jr,Nr),this.transform(Zr,Vr,Xr,Or,Nr,Ur),this.transform(jr,Vr,Jr,mn,Nr,Ur);for(var eo=0;eo<Nr;eo++){var _i=Xr[eo]*Jr[eo]-Or[eo]*mn[eo];Or[eo]=Xr[eo]*mn[eo]+Or[eo]*Jr[eo],Xr[eo]=_i}return this.conjugate(Xr,Or,Nr),this.transform(Xr,Or,gn,Vr,Nr,Ur),this.conjugate(gn,Vr,Nr),this.normalize13b(gn,Nr),Mr.negative=Pr.negative^xr.negative,Mr.length=Pr.length+xr.length,Mr.strip()},Jt.prototype.mul=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),this.mulTo(Pr,xr)},Jt.prototype.mulf=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),Br(this,Pr,xr)},Jt.prototype.imul=function(Pr){return this.clone().mulTo(Pr,this)},Jt.prototype.imuln=function(Pr){Yt(typeof Pr=="number"),Yt(Pr<67108864);for(var xr=0,Mr=0;Mr<this.length;Mr++){var Nr=(this.words[Mr]|0)*Pr,Ur=(Nr&67108863)+(xr&67108863);xr>>=26,xr+=Nr/67108864|0,xr+=Ur>>>26,this.words[Mr]=Ur&67108863}return xr!==0&&(this.words[Mr]=xr,this.length++),this},Jt.prototype.muln=function(Pr){return this.clone().imuln(Pr)},Jt.prototype.sqr=function(){return this.mul(this)},Jt.prototype.isqr=function(){return this.imul(this.clone())},Jt.prototype.pow=function(Pr){var xr=Lr(Pr);if(xr.length===0)return new Jt(1);for(var Mr=this,Nr=0;Nr<xr.length&&xr[Nr]===0;Nr++,Mr=Mr.sqr());if(++Nr<xr.length)for(var Ur=Mr.sqr();Nr<xr.length;Nr++,Ur=Ur.sqr())xr[Nr]!==0&&(Mr=Mr.mul(Ur));return Mr},Jt.prototype.iushln=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=67108863>>>26-xr<<26-xr,Ur;if(xr!==0){var Vr=0;for(Ur=0;Ur<this.length;Ur++){var Zr=this.words[Ur]&Nr,Xr=(this.words[Ur]|0)-Zr<<xr;this.words[Ur]=Xr|Vr,Vr=Zr>>>26-xr}Vr&&(this.words[Ur]=Vr,this.length++)}if(Mr!==0){for(Ur=this.length-1;Ur>=0;Ur--)this.words[Ur+Mr]=this.words[Ur];for(Ur=0;Ur<Mr;Ur++)this.words[Ur]=0;this.length+=Mr}return this.strip()},Jt.prototype.ishln=function(Pr){return Yt(this.negative===0),this.iushln(Pr)},Jt.prototype.iushrn=function(Pr,xr,Mr){Yt(typeof Pr=="number"&&Pr>=0);var Nr;xr?Nr=(xr-xr%26)/26:Nr=0;var Ur=Pr%26,Vr=Math.min((Pr-Ur)/26,this.length),Zr=67108863^67108863>>>Ur<<Ur,Xr=Mr;if(Nr-=Vr,Nr=Math.max(0,Nr),Xr){for(var Or=0;Or<Vr;Or++)Xr.words[Or]=this.words[Or];Xr.length=Vr}if(Vr!==0)if(this.length>Vr)for(this.length-=Vr,Or=0;Or<this.length;Or++)this.words[Or]=this.words[Or+Vr];else this.words[0]=0,this.length=1;var jr=0;for(Or=this.length-1;Or>=0&&(jr!==0||Or>=Nr);Or--){var Jr=this.words[Or]|0;this.words[Or]=jr<<26-Ur|Jr>>>Ur,jr=Jr&Zr}return Xr&&jr!==0&&(Xr.words[Xr.length++]=jr),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Jt.prototype.ishrn=function(Pr,xr,Mr){return Yt(this.negative===0),this.iushrn(Pr,xr,Mr)},Jt.prototype.shln=function(Pr){return this.clone().ishln(Pr)},Jt.prototype.ushln=function(Pr){return this.clone().iushln(Pr)},Jt.prototype.shrn=function(Pr){return this.clone().ishrn(Pr)},Jt.prototype.ushrn=function(Pr){return this.clone().iushrn(Pr)},Jt.prototype.testn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return!1;var Ur=this.words[Mr];return!!(Ur&Nr)},Jt.prototype.imaskn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26;if(Yt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Mr)return this;if(xr!==0&&Mr++,this.length=Math.min(Mr,this.length),xr!==0){var Nr=67108863^67108863>>>xr<<xr;this.words[this.length-1]&=Nr}return this.strip()},Jt.prototype.maskn=function(Pr){return this.clone().imaskn(Pr)},Jt.prototype.iaddn=function(Pr){return Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0?this.isubn(-Pr):this.negative!==0?this.length===1&&(this.words[0]|0)<Pr?(this.words[0]=Pr-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Pr),this.negative=1,this):this._iaddn(Pr)},Jt.prototype._iaddn=function(Pr){this.words[0]+=Pr;for(var xr=0;xr<this.length&&this.words[xr]>=67108864;xr++)this.words[xr]-=67108864,xr===this.length-1?this.words[xr+1]=1:this.words[xr+1]++;return this.length=Math.max(this.length,xr+1),this},Jt.prototype.isubn=function(Pr){if(Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0)return this.iaddn(-Pr);if(this.negative!==0)return this.negative=0,this.iaddn(Pr),this.negative=1,this;if(this.words[0]-=Pr,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xr=0;xr<this.length&&this.words[xr]<0;xr++)this.words[xr]+=67108864,this.words[xr+1]-=1;return this.strip()},Jt.prototype.addn=function(Pr){return this.clone().iaddn(Pr)},Jt.prototype.subn=function(Pr){return this.clone().isubn(Pr)},Jt.prototype.iabs=function(){return this.negative=0,this},Jt.prototype.abs=function(){return this.clone().iabs()},Jt.prototype._ishlnsubmul=function(Pr,xr,Mr){var Nr=Pr.length+Mr,Ur;this._expand(Nr);var Vr,Zr=0;for(Ur=0;Ur<Pr.length;Ur++){Vr=(this.words[Ur+Mr]|0)+Zr;var Xr=(Pr.words[Ur]|0)*xr;Vr-=Xr&67108863,Zr=(Vr>>26)-(Xr/67108864|0),this.words[Ur+Mr]=Vr&67108863}for(;Ur<this.length-Mr;Ur++)Vr=(this.words[Ur+Mr]|0)+Zr,Zr=Vr>>26,this.words[Ur+Mr]=Vr&67108863;if(Zr===0)return this.strip();for(Yt(Zr===-1),Zr=0,Ur=0;Ur<this.length;Ur++)Vr=-(this.words[Ur]|0)+Zr,Zr=Vr>>26,this.words[Ur]=Vr&67108863;return this.negative=1,this.strip()},Jt.prototype._wordDiv=function(Pr,xr){var Mr=this.length-Pr.length,Nr=this.clone(),Ur=Pr,Vr=Ur.words[Ur.length-1]|0,Zr=this._countBits(Vr);Mr=26-Zr,Mr!==0&&(Ur=Ur.ushln(Mr),Nr.iushln(Mr),Vr=Ur.words[Ur.length-1]|0);var Xr=Nr.length-Ur.length,Or;if(xr!=="mod"){Or=new Jt(null),Or.length=Xr+1,Or.words=new Array(Or.length);for(var jr=0;jr<Or.length;jr++)Or.words[jr]=0}var Jr=Nr.clone()._ishlnsubmul(Ur,1,Xr);Jr.negative===0&&(Nr=Jr,Or&&(Or.words[Xr]=1));for(var mn=Xr-1;mn>=0;mn--){var gn=(Nr.words[Ur.length+mn]|0)*67108864+(Nr.words[Ur.length+mn-1]|0);for(gn=Math.min(gn/Vr|0,67108863),Nr._ishlnsubmul(Ur,gn,mn);Nr.negative!==0;)gn--,Nr.negative=0,Nr._ishlnsubmul(Ur,1,mn),Nr.isZero()||(Nr.negative^=1);Or&&(Or.words[mn]=gn)}return Or&&Or.strip(),Nr.strip(),xr!=="div"&&Mr!==0&&Nr.iushrn(Mr),{div:Or||null,mod:Nr}},Jt.prototype.divmod=function(Pr,xr,Mr){if(Yt(!Pr.isZero()),this.isZero())return{div:new Jt(0),mod:new Jt(0)};var Nr,Ur,Vr;return this.negative!==0&&Pr.negative===0?(Vr=this.neg().divmod(Pr,xr),xr!=="mod"&&(Nr=Vr.div.neg()),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.iadd(Pr)),{div:Nr,mod:Ur}):this.negative===0&&Pr.negative!==0?(Vr=this.divmod(Pr.neg(),xr),xr!=="mod"&&(Nr=Vr.div.neg()),{div:Nr,mod:Vr.mod}):this.negative&Pr.negative?(Vr=this.neg().divmod(Pr.neg(),xr),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.isub(Pr)),{div:Vr.div,mod:Ur}):Pr.length>this.length||this.cmp(Pr)<0?{div:new Jt(0),mod:this}:Pr.length===1?xr==="div"?{div:this.divn(Pr.words[0]),mod:null}:xr==="mod"?{div:null,mod:new Jt(this.modn(Pr.words[0]))}:{div:this.divn(Pr.words[0]),mod:new Jt(this.modn(Pr.words[0]))}:this._wordDiv(Pr,xr)},Jt.prototype.div=function(Pr){return this.divmod(Pr,"div",!1).div},Jt.prototype.mod=function(Pr){return this.divmod(Pr,"mod",!1).mod},Jt.prototype.umod=function(Pr){return this.divmod(Pr,"mod",!0).mod},Jt.prototype.divRound=function(Pr){var xr=this.divmod(Pr);if(xr.mod.isZero())return xr.div;var Mr=xr.div.negative!==0?xr.mod.isub(Pr):xr.mod,Nr=Pr.ushrn(1),Ur=Pr.andln(1),Vr=Mr.cmp(Nr);return Vr<0||Ur===1&&Vr===0?xr.div:xr.div.negative!==0?xr.div.isubn(1):xr.div.iaddn(1)},Jt.prototype.modn=function(Pr){Yt(Pr<=67108863);for(var xr=(1<<26)%Pr,Mr=0,Nr=this.length-1;Nr>=0;Nr--)Mr=(xr*Mr+(this.words[Nr]|0))%Pr;return Mr},Jt.prototype.idivn=function(Pr){Yt(Pr<=67108863);for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=(this.words[Mr]|0)+xr*67108864;this.words[Mr]=Nr/Pr|0,xr=Nr%Pr}return this.strip()},Jt.prototype.divn=function(Pr){return this.clone().idivn(Pr)},Jt.prototype.egcd=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=new Jt(0),Zr=new Jt(1),Xr=0;xr.isEven()&&Mr.isEven();)xr.iushrn(1),Mr.iushrn(1),++Xr;for(var Or=Mr.clone(),jr=xr.clone();!xr.isZero();){for(var Jr=0,mn=1;!(xr.words[0]&mn)&&Jr<26;++Jr,mn<<=1);if(Jr>0)for(xr.iushrn(Jr);Jr-- >0;)(Nr.isOdd()||Ur.isOdd())&&(Nr.iadd(Or),Ur.isub(jr)),Nr.iushrn(1),Ur.iushrn(1);for(var gn=0,eo=1;!(Mr.words[0]&eo)&&gn<26;++gn,eo<<=1);if(gn>0)for(Mr.iushrn(gn);gn-- >0;)(Vr.isOdd()||Zr.isOdd())&&(Vr.iadd(Or),Zr.isub(jr)),Vr.iushrn(1),Zr.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Vr),Ur.isub(Zr)):(Mr.isub(xr),Vr.isub(Nr),Zr.isub(Ur))}return{a:Vr,b:Zr,gcd:Mr.iushln(Xr)}},Jt.prototype._invmp=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=Mr.clone();xr.cmpn(1)>0&&Mr.cmpn(1)>0;){for(var Zr=0,Xr=1;!(xr.words[0]&Xr)&&Zr<26;++Zr,Xr<<=1);if(Zr>0)for(xr.iushrn(Zr);Zr-- >0;)Nr.isOdd()&&Nr.iadd(Vr),Nr.iushrn(1);for(var Or=0,jr=1;!(Mr.words[0]&jr)&&Or<26;++Or,jr<<=1);if(Or>0)for(Mr.iushrn(Or);Or-- >0;)Ur.isOdd()&&Ur.iadd(Vr),Ur.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Ur)):(Mr.isub(xr),Ur.isub(Nr))}var Jr;return xr.cmpn(1)===0?Jr=Nr:Jr=Ur,Jr.cmpn(0)<0&&Jr.iadd(Pr),Jr},Jt.prototype.gcd=function(Pr){if(this.isZero())return Pr.abs();if(Pr.isZero())return this.abs();var xr=this.clone(),Mr=Pr.clone();xr.negative=0,Mr.negative=0;for(var Nr=0;xr.isEven()&&Mr.isEven();Nr++)xr.iushrn(1),Mr.iushrn(1);do{for(;xr.isEven();)xr.iushrn(1);for(;Mr.isEven();)Mr.iushrn(1);var Ur=xr.cmp(Mr);if(Ur<0){var Vr=xr;xr=Mr,Mr=Vr}else if(Ur===0||Mr.cmpn(1)===0)break;xr.isub(Mr)}while(!0);return Mr.iushln(Nr)},Jt.prototype.invm=function(Pr){return this.egcd(Pr).a.umod(Pr)},Jt.prototype.isEven=function(){return(this.words[0]&1)===0},Jt.prototype.isOdd=function(){return(this.words[0]&1)===1},Jt.prototype.andln=function(Pr){return this.words[0]&Pr},Jt.prototype.bincn=function(Pr){Yt(typeof Pr=="number");var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return this._expand(Mr+1),this.words[Mr]|=Nr,this;for(var Ur=Nr,Vr=Mr;Ur!==0&&Vr<this.length;Vr++){var Zr=this.words[Vr]|0;Zr+=Ur,Ur=Zr>>>26,Zr&=67108863,this.words[Vr]=Zr}return Ur!==0&&(this.words[Vr]=Ur,this.length++),this},Jt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Jt.prototype.cmpn=function(Pr){var xr=Pr<0;if(this.negative!==0&&!xr)return-1;if(this.negative===0&&xr)return 1;this.strip();var Mr;if(this.length>1)Mr=1;else{xr&&(Pr=-Pr),Yt(Pr<=67108863,"Number is too big");var Nr=this.words[0]|0;Mr=Nr===Pr?0:Nr<Pr?-1:1}return this.negative!==0?-Mr|0:Mr},Jt.prototype.cmp=function(Pr){if(this.negative!==0&&Pr.negative===0)return-1;if(this.negative===0&&Pr.negative!==0)return 1;var xr=this.ucmp(Pr);return this.negative!==0?-xr|0:xr},Jt.prototype.ucmp=function(Pr){if(this.length>Pr.length)return 1;if(this.length<Pr.length)return-1;for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=this.words[Mr]|0,Ur=Pr.words[Mr]|0;if(Nr!==Ur){Nr<Ur?xr=-1:Nr>Ur&&(xr=1);break}}return xr},Jt.prototype.gtn=function(Pr){return this.cmpn(Pr)===1},Jt.prototype.gt=function(Pr){return this.cmp(Pr)===1},Jt.prototype.gten=function(Pr){return this.cmpn(Pr)>=0},Jt.prototype.gte=function(Pr){return this.cmp(Pr)>=0},Jt.prototype.ltn=function(Pr){return this.cmpn(Pr)===-1},Jt.prototype.lt=function(Pr){return this.cmp(Pr)===-1},Jt.prototype.lten=function(Pr){return this.cmpn(Pr)<=0},Jt.prototype.lte=function(Pr){return this.cmp(Pr)<=0},Jt.prototype.eqn=function(Pr){return this.cmpn(Pr)===0},Jt.prototype.eq=function(Pr){return this.cmp(Pr)===0},Jt.red=function(Pr){return new En(Pr)},Jt.prototype.toRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),Yt(this.negative===0,"red works only with positives"),Pr.convertTo(this)._forceRed(Pr)},Jt.prototype.fromRed=function(){return Yt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Jt.prototype._forceRed=function(Pr){return this.red=Pr,this},Jt.prototype.forceRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),this._forceRed(Pr)},Jt.prototype.redAdd=function(Pr){return Yt(this.red,"redAdd works only with red numbers"),this.red.add(this,Pr)},Jt.prototype.redIAdd=function(Pr){return Yt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Pr)},Jt.prototype.redSub=function(Pr){return Yt(this.red,"redSub works only with red numbers"),this.red.sub(this,Pr)},Jt.prototype.redISub=function(Pr){return Yt(this.red,"redISub works only with red numbers"),this.red.isub(this,Pr)},Jt.prototype.redShl=function(Pr){return Yt(this.red,"redShl works only with red numbers"),this.red.shl(this,Pr)},Jt.prototype.redMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.mul(this,Pr)},Jt.prototype.redIMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.imul(this,Pr)},Jt.prototype.redSqr=function(){return Yt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Jt.prototype.redISqr=function(){return Yt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Jt.prototype.redSqrt=function(){return Yt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Jt.prototype.redInvm=function(){return Yt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Jt.prototype.redNeg=function(){return Yt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Jt.prototype.redPow=function(Pr){return Yt(this.red&&!Pr.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Pr)};var Gr={k256:null,p224:null,p192:null,p25519:null};function Kr(dn,Pr){this.name=dn,this.p=new Jt(Pr,16),this.n=this.p.bitLength(),this.k=new Jt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Kr.prototype._tmp=function(){var Pr=new Jt(null);return Pr.words=new Array(Math.ceil(this.n/13)),Pr},Kr.prototype.ireduce=function(Pr){var xr=Pr,Mr;do this.split(xr,this.tmp),xr=this.imulK(xr),xr=xr.iadd(this.tmp),Mr=xr.bitLength();while(Mr>this.n);var Nr=Mr<this.n?-1:xr.ucmp(this.p);return Nr===0?(xr.words[0]=0,xr.length=1):Nr>0?xr.isub(this.p):xr.strip(),xr},Kr.prototype.split=function(Pr,xr){Pr.iushrn(this.n,0,xr)},Kr.prototype.imulK=function(Pr){return Pr.imul(this.k)};function Yr(){Kr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Xt(Yr,Kr),Yr.prototype.split=function(Pr,xr){for(var Mr=4194303,Nr=Math.min(Pr.length,9),Ur=0;Ur<Nr;Ur++)xr.words[Ur]=Pr.words[Ur];if(xr.length=Nr,Pr.length<=9){Pr.words[0]=0,Pr.length=1;return}var Vr=Pr.words[9];for(xr.words[xr.length++]=Vr&Mr,Ur=10;Ur<Pr.length;Ur++){var Zr=Pr.words[Ur]|0;Pr.words[Ur-10]=(Zr&Mr)<<4|Vr>>>22,Vr=Zr}Vr>>>=22,Pr.words[Ur-10]=Vr,Vr===0&&Pr.length>10?Pr.length-=10:Pr.length-=9},Yr.prototype.imulK=function(Pr){Pr.words[Pr.length]=0,Pr.words[Pr.length+1]=0,Pr.length+=2;for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=Pr.words[Mr]|0;xr+=Nr*977,Pr.words[Mr]=xr&67108863,xr=Nr*64+(xr/67108864|0)}return Pr.words[Pr.length-1]===0&&(Pr.length--,Pr.words[Pr.length-1]===0&&Pr.length--),Pr};function hn(){Kr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Xt(hn,Kr);function Qr(){Kr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Xt(Qr,Kr);function pn(){Kr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Xt(pn,Kr),pn.prototype.imulK=function(Pr){for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=(Pr.words[Mr]|0)*19+xr,Ur=Nr&67108863;Nr>>>=26,Pr.words[Mr]=Ur,xr=Nr}return xr!==0&&(Pr.words[Pr.length++]=xr),Pr},Jt._prime=function(Pr){if(Gr[Pr])return Gr[Pr];var xr;if(Pr==="k256")xr=new Yr;else if(Pr==="p224")xr=new hn;else if(Pr==="p192")xr=new Qr;else if(Pr==="p25519")xr=new pn;else throw new Error("Unknown prime "+Pr);return Gr[Pr]=xr,xr};function En(dn){if(typeof dn=="string"){var Pr=Jt._prime(dn);this.m=Pr.p,this.prime=Pr}else Yt(dn.gtn(1),"modulus must be greater than 1"),this.m=dn,this.prime=null}En.prototype._verify1=function(Pr){Yt(Pr.negative===0,"red works only with positives"),Yt(Pr.red,"red works only with red numbers")},En.prototype._verify2=function(Pr,xr){Yt((Pr.negative|xr.negative)===0,"red works only with positives"),Yt(Pr.red&&Pr.red===xr.red,"red works only with red numbers")},En.prototype.imod=function(Pr){return this.prime?this.prime.ireduce(Pr)._forceRed(this):Pr.umod(this.m)._forceRed(this)},En.prototype.neg=function(Pr){return Pr.isZero()?Pr.clone():this.m.sub(Pr)._forceRed(this)},En.prototype.add=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.add(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr._forceRed(this)},En.prototype.iadd=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.iadd(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr},En.prototype.sub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.sub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr._forceRed(this)},En.prototype.isub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.isub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr},En.prototype.shl=function(Pr,xr){return this._verify1(Pr),this.imod(Pr.ushln(xr))},En.prototype.imul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.imul(xr))},En.prototype.mul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.mul(xr))},En.prototype.isqr=function(Pr){return this.imul(Pr,Pr.clone())},En.prototype.sqr=function(Pr){return this.mul(Pr,Pr)},En.prototype.sqrt=function(Pr){if(Pr.isZero())return Pr.clone();var xr=this.m.andln(3);if(Yt(xr%2===1),xr===3){var Mr=this.m.add(new Jt(1)).iushrn(2);return this.pow(Pr,Mr)}for(var Nr=this.m.subn(1),Ur=0;!Nr.isZero()&&Nr.andln(1)===0;)Ur++,Nr.iushrn(1);Yt(!Nr.isZero());var Vr=new Jt(1).toRed(this),Zr=Vr.redNeg(),Xr=this.m.subn(1).iushrn(1),Or=this.m.bitLength();for(Or=new Jt(2*Or*Or).toRed(this);this.pow(Or,Xr).cmp(Zr)!==0;)Or.redIAdd(Zr);for(var jr=this.pow(Or,Nr),Jr=this.pow(Pr,Nr.addn(1).iushrn(1)),mn=this.pow(Pr,Nr),gn=Ur;mn.cmp(Vr)!==0;){for(var eo=mn,_i=0;eo.cmp(Vr)!==0;_i++)eo=eo.redSqr();Yt(_i<gn);var ro=this.pow(jr,new Jt(1).iushln(gn-_i-1));Jr=Jr.redMul(ro),jr=ro.redSqr(),mn=mn.redMul(jr),gn=_i}return Jr},En.prototype.invm=function(Pr){var xr=Pr._invmp(this.m);return xr.negative!==0?(xr.negative=0,this.imod(xr).redNeg()):this.imod(xr)},En.prototype.pow=function(Pr,xr){if(xr.isZero())return new Jt(1).toRed(this);if(xr.cmpn(1)===0)return Pr.clone();var Mr=4,Nr=new Array(1<<Mr);Nr[0]=new Jt(1).toRed(this),Nr[1]=Pr;for(var Ur=2;Ur<Nr.length;Ur++)Nr[Ur]=this.mul(Nr[Ur-1],Pr);var Vr=Nr[0],Zr=0,Xr=0,Or=xr.bitLength()%26;for(Or===0&&(Or=26),Ur=xr.length-1;Ur>=0;Ur--){for(var jr=xr.words[Ur],Jr=Or-1;Jr>=0;Jr--){var mn=jr>>Jr&1;if(Vr!==Nr[0]&&(Vr=this.sqr(Vr)),mn===0&&Zr===0){Xr=0;continue}Zr<<=1,Zr|=mn,Xr++,!(Xr!==Mr&&(Ur!==0||Jr!==0))&&(Vr=this.mul(Vr,Nr[Zr]),Xr=0,Zr=0)}Or=26}return Vr},En.prototype.convertTo=function(Pr){var xr=Pr.umod(this.m);return xr===Pr?xr.clone():xr},En.prototype.convertFrom=function(Pr){var xr=Pr.clone();return xr.red=null,xr},Jt.mont=function(Pr){return new ga(Pr)};function ga(dn){En.call(this,dn),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Jt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Xt(ga,En),ga.prototype.convertTo=function(Pr){return this.imod(Pr.ushln(this.shift))},ga.prototype.convertFrom=function(Pr){var xr=this.imod(Pr.mul(this.rinv));return xr.red=null,xr},ga.prototype.imul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return Pr.words[0]=0,Pr.length=1,Pr;var Mr=Pr.imul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.mul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return new Jt(0)._forceRed(this);var Mr=Pr.mul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.invm=function(Pr){var xr=this.imod(Pr._invmp(this.m).mul(this.r2));return xr._forceRed(this)}})(Bt,commonjsGlobal)})(bn$1);bn$1.exports;function convertUtf8ToHex(Bt,Wt){return utf8ToHex(Bt,!Wt)}const payloadId=payloadId$2;function getInfuraRpcUrl(Bt,Wt){let Gt;const Yt=infuraNetworks[Bt];return Yt&&(Gt=`https://${Yt}.infura.io/v3/${Wt}`),Gt}function getRpcUrl(Bt,Wt){let Gt;const Yt=getInfuraRpcUrl(Bt,Wt.infuraId);return Wt.custom&&Wt.custom[Bt]?Gt=Wt.custom[Bt]:Yt&&(Gt=Yt),Gt}function isEmptyArray(Bt){return!(Bt&&Bt.length)}function isHexString$1(Bt,Wt){return isHexString$3(Bt,Wt)}function parsePersonalSign(Bt){return!isEmptyArray(Bt)&&!isHexString$1(Bt[0])&&(Bt[0]=convertUtf8ToHex(Bt[0])),Bt}var queryString$1={};(function(Bt){const Wt=strictUriEncode,Gt=decodeUriComponent,Yt=splitOnFirst,Xt=Br=>Br==null;function Jt(Br){switch(Br.arrayFormat){case"index":return Wr=>(Gr,Kr)=>{const Yr=Gr.length;return Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[",Yr,"]"].join("")]:[...Gr,[ur(Wr,Br),"[",ur(Yr,Br),"]=",ur(Kr,Br)].join("")]};case"bracket":return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[]"].join("")]:[...Gr,[ur(Wr,Br),"[]=",ur(Kr,Br)].join("")];case"comma":case"separator":return Wr=>(Gr,Kr)=>Kr==null||Kr.length===0?Gr:Gr.length===0?[[ur(Wr,Br),"=",ur(Kr,Br)].join("")]:[[Gr,ur(Kr,Br)].join(Br.arrayFormatSeparator)];default:return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,ur(Wr,Br)]:[...Gr,[ur(Wr,Br),"=",ur(Kr,Br)].join("")]}}function Zt(Br){let Wr;switch(Br.arrayFormat){case"index":return(Gr,Kr,Yr)=>{if(Wr=/\[(\d*)\]$/.exec(Gr),Gr=Gr.replace(/\[\d*\]$/,""),!Wr){Yr[Gr]=Kr;return}Yr[Gr]===void 0&&(Yr[Gr]={}),Yr[Gr][Wr[1]]=Kr};case"bracket":return(Gr,Kr,Yr)=>{if(Wr=/(\[\])$/.exec(Gr),Gr=Gr.replace(/\[\]$/,""),!Wr){Yr[Gr]=Kr;return}if(Yr[Gr]===void 0){Yr[Gr]=[Kr];return}Yr[Gr]=[].concat(Yr[Gr],Kr)};case"comma":case"separator":return(Gr,Kr,Yr)=>{const Qr=typeof Kr=="string"&&Kr.split("").indexOf(Br.arrayFormatSeparator)>-1?Kr.split(Br.arrayFormatSeparator).map(pn=>cr(pn,Br)):Kr===null?Kr:cr(Kr,Br);Yr[Gr]=Qr};default:return(Gr,Kr,Yr)=>{if(Yr[Gr]===void 0){Yr[Gr]=Kr;return}Yr[Gr]=[].concat(Yr[Gr],Kr)}}}function Qt(Br){if(typeof Br!="string"||Br.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ur(Br,Wr){return Wr.encode?Wr.strict?Wt(Br):encodeURIComponent(Br):Br}function cr(Br,Wr){return Wr.decode?Gt(Br):Br}function $r(Br){return Array.isArray(Br)?Br.sort():typeof Br=="object"?$r(Object.keys(Br)).sort((Wr,Gr)=>Number(Wr)-Number(Gr)).map(Wr=>Br[Wr]):Br}function Ar(Br){const Wr=Br.indexOf("#");return Wr!==-1&&(Br=Br.slice(0,Wr)),Br}function Lr(Br){let Wr="";const Gr=Br.indexOf("#");return Gr!==-1&&(Wr=Br.slice(Gr)),Wr}function qr(Br){Br=Ar(Br);const Wr=Br.indexOf("?");return Wr===-1?"":Br.slice(Wr+1)}function Fr(Br,Wr){return Wr.parseNumbers&&!Number.isNaN(Number(Br))&&typeof Br=="string"&&Br.trim()!==""?Br=Number(Br):Wr.parseBooleans&&Br!==null&&(Br.toLowerCase()==="true"||Br.toLowerCase()==="false")&&(Br=Br.toLowerCase()==="true"),Br}function Hr(Br,Wr){Wr=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Zt(Wr),Kr=Object.create(null);if(typeof Br!="string"||(Br=Br.trim().replace(/^[?#&]/,""),!Br))return Kr;for(const Yr of Br.split("&")){let[hn,Qr]=Yt(Wr.decode?Yr.replace(/\+/g," "):Yr,"=");Qr=Qr===void 0?null:["comma","separator"].includes(Wr.arrayFormat)?Qr:cr(Qr,Wr),Gr(cr(hn,Wr),Qr,Kr)}for(const Yr of Object.keys(Kr)){const hn=Kr[Yr];if(typeof hn=="object"&&hn!==null)for(const Qr of Object.keys(hn))hn[Qr]=Fr(hn[Qr],Wr);else Kr[Yr]=Fr(hn,Wr)}return Wr.sort===!1?Kr:(Wr.sort===!0?Object.keys(Kr).sort():Object.keys(Kr).sort(Wr.sort)).reduce((Yr,hn)=>{const Qr=Kr[hn];return Qr&&typeof Qr=="object"&&!Array.isArray(Qr)?Yr[hn]=$r(Qr):Yr[hn]=Qr,Yr},Object.create(null))}Bt.extract=qr,Bt.parse=Hr,Bt.stringify=(Br,Wr)=>{if(!Br)return"";Wr=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Qr=>Wr.skipNull&&Xt(Br[Qr])||Wr.skipEmptyString&&Br[Qr]==="",Kr=Jt(Wr),Yr={};for(const Qr of Object.keys(Br))Gr(Qr)||(Yr[Qr]=Br[Qr]);const hn=Object.keys(Yr);return Wr.sort!==!1&&hn.sort(Wr.sort),hn.map(Qr=>{const pn=Br[Qr];return pn===void 0?"":pn===null?ur(Qr,Wr):Array.isArray(pn)?pn.reduce(Kr(Qr),[]).join("&"):ur(Qr,Wr)+"="+ur(pn,Wr)}).filter(Qr=>Qr.length>0).join("&")},Bt.parseUrl=(Br,Wr)=>{Wr=Object.assign({decode:!0},Wr);const[Gr,Kr]=Yt(Br,"#");return Object.assign({url:Gr.split("?")[0]||"",query:Hr(qr(Br),Wr)},Wr&&Wr.parseFragmentIdentifier&&Kr?{fragmentIdentifier:cr(Kr,Wr)}:{})},Bt.stringifyUrl=(Br,Wr)=>{Wr=Object.assign({encode:!0,strict:!0},Wr);const Gr=Ar(Br.url).split("?")[0]||"",Kr=Bt.extract(Br.url),Yr=Bt.parse(Kr,{sort:!1}),hn=Object.assign(Yr,Br.query);let Qr=Bt.stringify(hn,Wr);Qr&&(Qr=`?${Qr}`);let pn=Lr(Br.url);return Br.fragmentIdentifier&&(pn=`#${ur(Br.fragmentIdentifier,Wr)}`),`${Gr}${Qr}${pn}`}})(queryString$1);const ProviderEngine=web3ProviderEngine,CacheSubprovider=cache,FixtureSubprovider=fixture,FilterSubprovider=filters,HookedWalletSubprovider=hookedWallet,NonceSubprovider=nonceTracker,SubscriptionsSubprovider=subscriptions;class WalletConnectProvider extends ProviderEngine{constructor(Wt){if(super({pollingInterval:Wt.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=QRCodeModal,this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{const Gt=await this.getWalletConnector();if(Gt)return this.start(),this.subscribeWalletConnector(),Gt.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async Gt=>this.send(Gt),this.send=async(Gt,Yt)=>{var Xt;if(typeof Gt=="string"){const Jt=Gt;let Zt=Yt;return Jt==="personal_sign"&&(Zt=parsePersonalSign(Zt)),this.sendAsyncPromise(Jt,Zt)}if(Gt=Object.assign({id:payloadId(),jsonrpc:"2.0"},Gt),Gt.method==="personal_sign"&&(Gt.params=parsePersonalSign(Gt.params)),Yt){this.sendAsync(Gt,Yt);return}if(Gt.method==="eth_signTypedData_v4"&&((Xt=this.walletMeta)===null||Xt===void 0?void 0:Xt.name)==="MetaMask"){const{result:Jt}=await this.handleOtherRequests(Gt);return Jt}else return this.sendAsyncPromise(Gt.method,Gt.params)},this.onConnect=Gt=>{this.connectCallbacks.push(Gt)},this.triggerConnect=Gt=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(Yt=>Yt(Gt))},this.bridge=Wt.connector?Wt.connector.bridge:Wt.bridge||"https://bridge.walletconnect.org",this.qrcode=typeof Wt.qrcode>"u"||Wt.qrcode!==!1,this.qrcodeModal=Wt.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=Wt.qrcodeModalOptions,this.wc=Wt.connector||new WalletConnect({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:Wt==null?void 0:Wt.storageId,signingMethods:Wt==null?void 0:Wt.signingMethods,clientMeta:Wt==null?void 0:Wt.clientMeta}),this.rpc=Wt.rpc||null,!this.rpc&&(!Wt.infuraId||typeof Wt.infuraId!="string"||!Wt.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=Wt.infuraId||"",this.chainId=(Wt==null?void 0:Wt.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){await(await this.getWalletConnector({disableSessionCreation:!0})).killSession(),await this.onDisconnect()}async handleRequest(Wt){try{let Gt,Yt=null;const Xt=await this.getWalletConnector();switch(Wt.method){case"wc_killSession":await this.close(),Yt=null;break;case"eth_accounts":Yt=Xt.accounts;break;case"eth_coinbase":Yt=Xt.accounts[0];break;case"eth_chainId":Yt=Xt.chainId;break;case"net_version":Yt=Xt.chainId;break;case"eth_uninstallFilter":this.sendAsync(Wt,Jt=>Jt),Yt=!0;break;default:Gt=await this.handleOtherRequests(Wt)}return Gt||this.formatResponse(Wt,Yt)}catch(Gt){throw this.emit("error",Gt),Gt}}async handleOtherRequests(Wt){if(!signingMethods.includes(Wt.method)&&Wt.method.startsWith("eth_"))return this.handleReadRequests(Wt);const Yt=await(await this.getWalletConnector()).sendCustomRequest(Wt);return this.formatResponse(Wt,Yt)}async handleReadRequests(Wt){if(!this.http){const Gt=new Error("HTTP Connection not available");throw this.emit("error",Gt),Gt}return this.http.send(Wt)}formatResponse(Wt,Gt){return{id:Wt.id,jsonrpc:Wt.jsonrpc,result:Gt}}getWalletConnector(Wt={}){const{disableSessionCreation:Gt=!1}=Wt;return new Promise((Yt,Xt)=>{const Jt=this.wc;this.isConnecting?this.onConnect(Zt=>Yt(Zt)):!Jt.connected&&!Gt?(this.isConnecting=!0,Jt.on("modal_closed",()=>{Xt(new Error("User closed modal"))}),Jt.createSession({chainId:this.chainId}).then(()=>{Jt.on("connect",(Zt,Qt)=>{if(Zt)return this.isConnecting=!1,Xt(Zt);this.isConnecting=!1,this.connected=!0,Qt&&this.updateState(Qt.params[0]),this.emit("connect"),this.triggerConnect(Jt),Yt(Jt)})}).catch(Zt=>{this.isConnecting=!1,Xt(Zt)})):(this.connected||(this.connected=!0,this.updateState(Jt.session)),Yt(Jt))})}async subscribeWalletConnector(){const Wt=await this.getWalletConnector();Wt.on("disconnect",Gt=>{if(Gt){this.emit("error",Gt);return}this.onDisconnect()}),Wt.on("session_update",(Gt,Yt)=>{if(Gt){this.emit("error",Gt);return}this.updateState(Yt.params[0])})}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(Wt){const{accounts:Gt,chainId:Yt,networkId:Xt,rpcUrl:Jt}=Wt;(!this.accounts||Gt&&this.accounts!==Gt)&&(this.accounts=Gt,this.emit("accountsChanged",Gt)),(!this.chainId||Yt&&this.chainId!==Yt)&&(this.chainId=Yt,this.emit("chainChanged",Yt)),(!this.networkId||Xt&&this.networkId!==Xt)&&(this.networkId=Xt,this.emit("networkChanged",Xt)),this.updateRpcUrl(this.chainId,Jt||"")}updateRpcUrl(Wt,Gt=""){const Yt={infuraId:this.infuraId,custom:this.rpc||void 0};Gt=Gt||getRpcUrl(Wt,Yt),Gt?(this.rpcUrl=Gt,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${Wt}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new HTTPConnection(this.rpcUrl),this.http.on("payload",Wt=>this.emit("payload",Wt)),this.http.on("error",Wt=>this.emit("error",Wt)))}sendAsyncPromise(Wt,Gt){return new Promise((Yt,Xt)=>{this.sendAsync({id:payloadId(),jsonrpc:"2.0",method:Wt,params:Gt||[]},(Jt,Zt)=>{if(Jt){Xt(Jt);return}Yt(Zt.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new FixtureSubprovider({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new CacheSubprovider),this.addProvider(new SubscriptionsSubprovider),this.addProvider(new FilterSubprovider),this.addProvider(new NonceSubprovider),this.addProvider(new HookedWalletSubprovider(this.configWallet())),this.addProvider({handleRequest:async(Wt,Gt,Yt)=>{try{const{error:Xt,result:Jt}=await this.handleRequest(Wt);Yt(Xt,Jt)}catch(Xt){Yt(Xt)}},setEngine:Wt=>Wt})}configWallet(){return{getAccounts:async Wt=>{try{const Yt=(await this.getWalletConnector()).accounts;Yt&&Yt.length?Wt(null,Yt):Wt(new Error("Failed to get accounts"))}catch(Gt){Wt(Gt)}},processMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signMessage([Wt.from,Wt.data]);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processPersonalMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signPersonalMessage([Wt.data,Wt.from]);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processSignTransaction:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signTransaction(Wt);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processTransaction:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).sendTransaction(Wt);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processTypedMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signTypedData([Wt.from,Wt.data]);Gt(null,Xt)}catch(Yt){Gt(Yt)}}}}}const esm$4=Object.freeze(Object.defineProperty({__proto__:null,default:WalletConnectProvider},Symbol.toStringTag,{value:"Module"})),require$$4$2=getAugmentedNamespace(esm$4);var __createBinding$_=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Object.defineProperty(Bt,Yt,{enumerable:!0,get:function(){return Wt[Gt]}})}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$_=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$_=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$_(Wt,Bt,Gt);return __setModuleDefault$_(Wt,Bt),Wt},__awaiter$E=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(WalletConnectConnector$1,"__esModule",{value:!0});WalletConnectConnector$1.WalletConnectConnector=WalletConnectConnector$1.BaseWalletConnectConnector=WalletConnectConnector$1.UserRejectedRequestError=WalletConnectConnector$1.URI_AVAILABLE=void 0;const chain_id_1$6=requireChainId$4(),provider_type_1$3=providerType$4,abstract_connector_1=require$$2$3,configuration_1$3=configuration$1;WalletConnectConnector$1.URI_AVAILABLE="URI_AVAILABLE";class UserRejectedRequestError extends Error{constructor(){super(),this.name=this.constructor.name,this.message="The user rejected the request."}}WalletConnectConnector$1.UserRejectedRequestError=UserRejectedRequestError;function getSupportedChains({supportedChainIds:Bt,rpc:Wt}){return Bt||(Wt?Object.keys(Wt).map(Gt=>Number(Gt)):void 0)}class BaseWalletConnectConnector extends abstract_connector_1.AbstractConnector{constructor(Wt){super({supportedChainIds:getSupportedChains(Wt)}),this.config=Wt,this.handleChainChanged=this.handleChainChanged.bind(this),this.handleAccountsChanged=this.handleAccountsChanged.bind(this),this.handleDisconnect=this.handleDisconnect.bind(this)}activate(){return __awaiter$E(this,void 0,void 0,function*(){if(!this.walletConnectProvider){const Gt=yield Promise.resolve().then(()=>__importStar$_(require$$4$2)).then(Yt=>{var Xt;return(Xt=Yt==null?void 0:Yt.default)!==null&&Xt!==void 0?Xt:Yt});this.walletConnectProvider=new Gt(Object.assign(Object.assign({},this.config),{chainId:this.config.defaultChainId||chain_id_1$6.ChainId.ETHEREUM_MAINNET}))}let Wt="";return BaseWalletConnectConnector.isEnabling||(BaseWalletConnectConnector.isEnabling=!0,Wt=yield this.walletConnectProvider.enable().then(Gt=>Gt[0]).catch(Gt=>{throw Gt.message==="User closed modal"?new UserRejectedRequestError:Gt}).finally(()=>{BaseWalletConnectConnector.isEnabling=!1})),this.walletConnectProvider.on("disconnect",this.handleDisconnect),this.walletConnectProvider.on("chainChanged",this.handleChainChanged),this.walletConnectProvider.on("accountsChanged",this.handleAccountsChanged),{provider:this.walletConnectProvider,account:Wt}})}getProvider(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider})}getChainId(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider.send("eth_chainId")})}getAccount(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider.send("eth_accounts").then(Wt=>Wt[0])})}deactivate(){this.walletConnectProvider&&(this.walletConnectProvider.stop(),this.walletConnectProvider.removeListener("disconnect",this.handleDisconnect),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged))}close(){var Wt;return __awaiter$E(this,void 0,void 0,function*(){yield(Wt=this.walletConnectProvider)===null||Wt===void 0?void 0:Wt.close()})}handleChainChanged(Wt){this.emitUpdate({chainId:Wt})}handleAccountsChanged(Wt){this.emitUpdate({account:Wt[0]})}handleDisconnect(){this.emitDeactivate(),this.walletConnectProvider&&(this.walletConnectProvider.stop(),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider=void 0),this.emitDeactivate()}}WalletConnectConnector$1.BaseWalletConnectConnector=BaseWalletConnectConnector;BaseWalletConnectConnector.isEnabling=!1;class WalletConnectConnector extends BaseWalletConnectConnector{constructor(Wt=chain_id_1$6.ChainId.ETHEREUM_MAINNET){const{urls:Gt}=configuration_1$3.getConfiguration()[provider_type_1$3.ProviderType.WALLET_CONNECT],Yt={rpc:Gt,qrcode:!0,pollingInterval:15e4,defaultChainId:Wt};super(Yt),this.params=Yt}getRpc(){return __awaiter$E(this,void 0,void 0,function*(){const Wt=yield this.getChainId();return this.params.rpc[Wt]})}getQrCode(){return this.params.qrcode}getPollingInterval(){return this.params.pollingInterval}}WalletConnectConnector$1.WalletConnectConnector=WalletConnectConnector;WalletConnectConnector.clearStorage=Bt=>{Bt.removeRegExp(new RegExp("\\bwalletconnect\\b"))};var WalletLinkConnector$2={};const scriptRel="modulepreload",assetsURL=function(Bt){return"/"+Bt},seen={},__vitePreload=function(Wt,Gt,Yt){if(!Gt||Gt.length===0)return Wt();const Xt=document.getElementsByTagName("link");return Promise.all(Gt.map(Jt=>{if(Jt=assetsURL(Jt),Jt in seen)return;seen[Jt]=!0;const Zt=Jt.endsWith(".css"),Qt=Zt?'[rel="stylesheet"]':"";if(!!Yt)for(let $r=Xt.length-1;$r>=0;$r--){const Ar=Xt[$r];if(Ar.href===Jt&&(!Zt||Ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Jt}"]${Qt}`))return;const cr=document.createElement("link");if(cr.rel=Zt?"stylesheet":scriptRel,Zt||(cr.as="script",cr.crossOrigin=""),cr.href=Jt,document.head.appendChild(cr),Zt)return new Promise(($r,Ar)=>{cr.addEventListener("load",$r),cr.addEventListener("error",()=>Ar(new Error(`Unable to preload CSS for ${Jt}`)))})})).then(()=>Wt())};function _extends$B(){return _extends$B=Object.assign||function(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt];for(var Yt in Gt)Object.prototype.hasOwnProperty.call(Gt,Yt)&&(Bt[Yt]=Gt[Yt])}return Bt},_extends$B.apply(this,arguments)}function _inheritsLoose$1(Bt,Wt){Bt.prototype=Object.create(Wt.prototype),Bt.prototype.constructor=Bt,_setPrototypeOf$Q(Bt,Wt)}function _setPrototypeOf$Q(Bt,Wt){return _setPrototypeOf$Q=Object.setPrototypeOf||function(Yt,Xt){return Yt.__proto__=Xt,Yt},_setPrototypeOf$Q(Bt,Wt)}function _assertThisInitialized$Q(Bt){if(Bt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt}var CHAIN_ID$3=1,WalletLinkConnector$1=function(Bt){_inheritsLoose$1(Wt,Bt);function Wt(Yt){var Xt,Jt=Yt.url,Zt=Yt.appName,Qt=Yt.appLogoUrl,ur=Yt.darkMode,cr=Yt.supportedChainIds;return Xt=Bt.call(this,{supportedChainIds:cr})||this,Xt.url=Jt,Xt.appName=Zt,Xt.appLogoUrl=Qt,Xt.darkMode=ur||!1,Xt.handleChainChanged=Xt.handleChainChanged.bind(_assertThisInitialized$Q(Xt)),Xt.handleAccountsChanged=Xt.handleAccountsChanged.bind(_assertThisInitialized$Q(Xt)),Xt}var Gt=Wt.prototype;return Gt.activate=function(){try{var Xt=this,Jt=function(){return Promise.resolve(Xt.provider.request({method:"eth_requestAccounts"})).then(function(ur){var cr=ur[0];return Xt.provider.on("chainChanged",Xt.handleChainChanged),Xt.provider.on("accountsChanged",Xt.handleAccountsChanged),{provider:Xt.provider,account:cr}})},Zt=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)Xt.provider=window.ethereum;else{var Qt=function(){if(!Xt.walletLink)return Promise.resolve(__vitePreload(()=>import("./index-fd83212b.js").then(ur=>ur.i),[]).then(function(ur){var cr;return(cr=ur==null?void 0:ur.default)!=null?cr:ur})).then(function(ur){Xt.walletLink=new ur(_extends$B({appName:Xt.appName,darkMode:Xt.darkMode},Xt.appLogoUrl?{appLogoUrl:Xt.appLogoUrl}:{})),Xt.provider=Xt.walletLink.makeWeb3Provider(Xt.url,CHAIN_ID$3)})}();if(Qt&&Qt.then)return Qt.then(function(){})}}();return Promise.resolve(Zt&&Zt.then?Zt.then(Jt):Jt(Zt))}catch(Qt){return Promise.reject(Qt)}},Gt.getProvider=function(){try{var Xt=this;return Promise.resolve(Xt.provider)}catch(Jt){return Promise.reject(Jt)}},Gt.getChainId=function(){try{var Xt=this;return Promise.resolve(Xt.provider.chainId)}catch(Jt){return Promise.reject(Jt)}},Gt.getAccount=function(){try{var Xt=this;return Promise.resolve(Xt.provider.request({method:"eth_requestAccounts"})).then(function(Jt){return Jt[0]})}catch(Jt){return Promise.reject(Jt)}},Gt.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},Gt.close=function(){try{var Xt=this;return Xt.provider.close(),Xt.emitDeactivate(),Promise.resolve()}catch(Jt){return Promise.reject(Jt)}},Gt.handleChainChanged=function(Xt){this.emitUpdate({chainId:Xt})},Gt.handleAccountsChanged=function(Xt){this.emitUpdate({account:Xt[0]})},Wt}(AbstractConnector);const walletlinkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:WalletLinkConnector$1},Symbol.toStringTag,{value:"Module"})),require$$1$8=getAugmentedNamespace(walletlinkConnector_esm);Object.defineProperty(WalletLinkConnector$2,"__esModule",{value:!0});WalletLinkConnector$2.WalletLinkConnector=void 0;const schemas_1$4=dist$m,walletlink_connector_1=require$$1$8,configuration_1$2=configuration$1;class WalletLinkConnector extends walletlink_connector_1.WalletLinkConnector{constructor(Wt){const Gt=configuration_1$2.getConfiguration()[schemas_1$4.ProviderType.WALLET_LINK];super({url:Gt.urls[Wt],appName:Gt.appName,supportedChainIds:[Wt]})}}WalletLinkConnector$2.WalletLinkConnector=WalletLinkConnector;var WalletConnectV2Connector$1={},index_cjs$1={},chacha20poly1305={},chacha={},binary={},int={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});function Wt(Qt,ur){var cr=Qt>>>16&65535,$r=Qt&65535,Ar=ur>>>16&65535,Lr=ur&65535;return $r*Lr+(cr*Lr+$r*Ar<<16>>>0)|0}Bt.mul=Math.imul||Wt;function Gt(Qt,ur){return Qt+ur|0}Bt.add=Gt;function Yt(Qt,ur){return Qt-ur|0}Bt.sub=Yt;function Xt(Qt,ur){return Qt<<ur|Qt>>>32-ur}Bt.rotl=Xt;function Jt(Qt,ur){return Qt<<32-ur|Qt>>>ur}Bt.rotr=Jt;function Zt(Qt){return typeof Qt=="number"&&isFinite(Qt)&&Math.floor(Qt)===Qt}Bt.isInteger=Number.isInteger||Zt,Bt.MAX_SAFE_INTEGER=9007199254740991,Bt.isSafeInteger=function(Qt){return Bt.isInteger(Qt)&&Qt>=-Bt.MAX_SAFE_INTEGER&&Qt<=Bt.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+0]<<8|Bt[Wt+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+0]<<8|Bt[Wt+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+1]<<8|Bt[Wt])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+1]<<8|Bt[Wt])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(2)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>8,Wt[Gt+1]=Bt>>>0,Wt}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(2)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>0,Wt[Gt+1]=Bt>>>8,Wt}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(Bt,Wt){return Wt===void 0&&(Wt=0),Bt[Wt]<<24|Bt[Wt+1]<<16|Bt[Wt+2]<<8|Bt[Wt+3]}binary.readInt32BE=readInt32BE;function readUint32BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt]<<24|Bt[Wt+1]<<16|Bt[Wt+2]<<8|Bt[Wt+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(Bt,Wt){return Wt===void 0&&(Wt=0),Bt[Wt+3]<<24|Bt[Wt+2]<<16|Bt[Wt+1]<<8|Bt[Wt]}binary.readInt32LE=readInt32LE;function readUint32LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+3]<<24|Bt[Wt+2]<<16|Bt[Wt+1]<<8|Bt[Wt])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>24,Wt[Gt+1]=Bt>>>16,Wt[Gt+2]=Bt>>>8,Wt[Gt+3]=Bt>>>0,Wt}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>0,Wt[Gt+1]=Bt>>>8,Wt[Gt+2]=Bt>>>16,Wt[Gt+3]=Bt>>>24,Wt}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readInt32BE(Bt,Wt),Yt=readInt32BE(Bt,Wt+4);return Gt*4294967296+Yt-(Yt>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readUint32BE(Bt,Wt),Yt=readUint32BE(Bt,Wt+4);return Gt*4294967296+Yt}binary.readUint64BE=readUint64BE;function readInt64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readInt32LE(Bt,Wt),Yt=readInt32LE(Bt,Wt+4);return Yt*4294967296+Gt-(Gt>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readUint32LE(Bt,Wt),Yt=readUint32LE(Bt,Wt+4);return Yt*4294967296+Gt}binary.readUint64LE=readUint64LE;function writeUint64BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0),writeUint32BE(Bt/4294967296>>>0,Wt,Gt),writeUint32BE(Bt>>>0,Wt,Gt+4),Wt}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0),writeUint32LE(Bt>>>0,Wt,Gt),writeUint32LE(Bt/4294967296>>>0,Wt,Gt+4),Wt}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(Bt,Wt,Gt){if(Gt===void 0&&(Gt=0),Bt%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(Bt/8>Wt.length-Gt)throw new Error("readUintBE: array is too short for the given bitLength");for(var Yt=0,Xt=1,Jt=Bt/8+Gt-1;Jt>=Gt;Jt--)Yt+=Wt[Jt]*Xt,Xt*=256;return Yt}binary.readUintBE=readUintBE;function readUintLE(Bt,Wt,Gt){if(Gt===void 0&&(Gt=0),Bt%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(Bt/8>Wt.length-Gt)throw new Error("readUintLE: array is too short for the given bitLength");for(var Yt=0,Xt=1,Jt=Gt;Jt<Gt+Bt/8;Jt++)Yt+=Wt[Jt]*Xt,Xt*=256;return Yt}binary.readUintLE=readUintLE;function writeUintBE(Bt,Wt,Gt,Yt){if(Gt===void 0&&(Gt=new Uint8Array(Bt/8)),Yt===void 0&&(Yt=0),Bt%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Wt))throw new Error("writeUintBE value must be an integer");for(var Xt=1,Jt=Bt/8+Yt-1;Jt>=Yt;Jt--)Gt[Jt]=Wt/Xt&255,Xt*=256;return Gt}binary.writeUintBE=writeUintBE;function writeUintLE(Bt,Wt,Gt,Yt){if(Gt===void 0&&(Gt=new Uint8Array(Bt/8)),Yt===void 0&&(Yt=0),Bt%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Wt))throw new Error("writeUintLE value must be an integer");for(var Xt=1,Jt=Yt;Jt<Yt+Bt/8;Jt++)Gt[Jt]=Wt/Xt&255,Xt*=256;return Gt}binary.writeUintLE=writeUintLE;function readFloat32BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat32(Wt)}binary.readFloat32BE=readFloat32BE;function readFloat32LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat32(Wt,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat64(Wt)}binary.readFloat64BE=readFloat64BE;function readFloat64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat64(Wt,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat32(Gt,Bt),Wt}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat32(Gt,Bt,!0),Wt}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat64(Gt,Bt),Wt}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat64(Gt,Bt,!0),Wt}binary.writeFloat64LE=writeFloat64LE;var wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(Bt){for(var Wt=0;Wt<Bt.length;Wt++)Bt[Wt]=0;return Bt}wipe$1.wipe=wipe;Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$3=wipe$1,ROUNDS=20;function core(Bt,Wt,Gt){for(var Yt=1634760805,Xt=857760878,Jt=2036477234,Zt=1797285236,Qt=Gt[3]<<24|Gt[2]<<16|Gt[1]<<8|Gt[0],ur=Gt[7]<<24|Gt[6]<<16|Gt[5]<<8|Gt[4],cr=Gt[11]<<24|Gt[10]<<16|Gt[9]<<8|Gt[8],$r=Gt[15]<<24|Gt[14]<<16|Gt[13]<<8|Gt[12],Ar=Gt[19]<<24|Gt[18]<<16|Gt[17]<<8|Gt[16],Lr=Gt[23]<<24|Gt[22]<<16|Gt[21]<<8|Gt[20],qr=Gt[27]<<24|Gt[26]<<16|Gt[25]<<8|Gt[24],Fr=Gt[31]<<24|Gt[30]<<16|Gt[29]<<8|Gt[28],Hr=Wt[3]<<24|Wt[2]<<16|Wt[1]<<8|Wt[0],Br=Wt[7]<<24|Wt[6]<<16|Wt[5]<<8|Wt[4],Wr=Wt[11]<<24|Wt[10]<<16|Wt[9]<<8|Wt[8],Gr=Wt[15]<<24|Wt[14]<<16|Wt[13]<<8|Wt[12],Kr=Yt,Yr=Xt,hn=Jt,Qr=Zt,pn=Qt,En=ur,ga=cr,dn=$r,Pr=Ar,xr=Lr,Mr=qr,Nr=Fr,Ur=Hr,Vr=Br,Zr=Wr,Xr=Gr,Or=0;Or<ROUNDS;Or+=2)Kr=Kr+pn|0,Ur^=Kr,Ur=Ur>>>32-16|Ur<<16,Pr=Pr+Ur|0,pn^=Pr,pn=pn>>>32-12|pn<<12,Yr=Yr+En|0,Vr^=Yr,Vr=Vr>>>32-16|Vr<<16,xr=xr+Vr|0,En^=xr,En=En>>>32-12|En<<12,hn=hn+ga|0,Zr^=hn,Zr=Zr>>>32-16|Zr<<16,Mr=Mr+Zr|0,ga^=Mr,ga=ga>>>32-12|ga<<12,Qr=Qr+dn|0,Xr^=Qr,Xr=Xr>>>32-16|Xr<<16,Nr=Nr+Xr|0,dn^=Nr,dn=dn>>>32-12|dn<<12,hn=hn+ga|0,Zr^=hn,Zr=Zr>>>32-8|Zr<<8,Mr=Mr+Zr|0,ga^=Mr,ga=ga>>>32-7|ga<<7,Qr=Qr+dn|0,Xr^=Qr,Xr=Xr>>>32-8|Xr<<8,Nr=Nr+Xr|0,dn^=Nr,dn=dn>>>32-7|dn<<7,Yr=Yr+En|0,Vr^=Yr,Vr=Vr>>>32-8|Vr<<8,xr=xr+Vr|0,En^=xr,En=En>>>32-7|En<<7,Kr=Kr+pn|0,Ur^=Kr,Ur=Ur>>>32-8|Ur<<8,Pr=Pr+Ur|0,pn^=Pr,pn=pn>>>32-7|pn<<7,Kr=Kr+En|0,Xr^=Kr,Xr=Xr>>>32-16|Xr<<16,Mr=Mr+Xr|0,En^=Mr,En=En>>>32-12|En<<12,Yr=Yr+ga|0,Ur^=Yr,Ur=Ur>>>32-16|Ur<<16,Nr=Nr+Ur|0,ga^=Nr,ga=ga>>>32-12|ga<<12,hn=hn+dn|0,Vr^=hn,Vr=Vr>>>32-16|Vr<<16,Pr=Pr+Vr|0,dn^=Pr,dn=dn>>>32-12|dn<<12,Qr=Qr+pn|0,Zr^=Qr,Zr=Zr>>>32-16|Zr<<16,xr=xr+Zr|0,pn^=xr,pn=pn>>>32-12|pn<<12,hn=hn+dn|0,Vr^=hn,Vr=Vr>>>32-8|Vr<<8,Pr=Pr+Vr|0,dn^=Pr,dn=dn>>>32-7|dn<<7,Qr=Qr+pn|0,Zr^=Qr,Zr=Zr>>>32-8|Zr<<8,xr=xr+Zr|0,pn^=xr,pn=pn>>>32-7|pn<<7,Yr=Yr+ga|0,Ur^=Yr,Ur=Ur>>>32-8|Ur<<8,Nr=Nr+Ur|0,ga^=Nr,ga=ga>>>32-7|ga<<7,Kr=Kr+En|0,Xr^=Kr,Xr=Xr>>>32-8|Xr<<8,Mr=Mr+Xr|0,En^=Mr,En=En>>>32-7|En<<7;binary_1.writeUint32LE(Kr+Yt|0,Bt,0),binary_1.writeUint32LE(Yr+Xt|0,Bt,4),binary_1.writeUint32LE(hn+Jt|0,Bt,8),binary_1.writeUint32LE(Qr+Zt|0,Bt,12),binary_1.writeUint32LE(pn+Qt|0,Bt,16),binary_1.writeUint32LE(En+ur|0,Bt,20),binary_1.writeUint32LE(ga+cr|0,Bt,24),binary_1.writeUint32LE(dn+$r|0,Bt,28),binary_1.writeUint32LE(Pr+Ar|0,Bt,32),binary_1.writeUint32LE(xr+Lr|0,Bt,36),binary_1.writeUint32LE(Mr+qr|0,Bt,40),binary_1.writeUint32LE(Nr+Fr|0,Bt,44),binary_1.writeUint32LE(Ur+Hr|0,Bt,48),binary_1.writeUint32LE(Vr+Br|0,Bt,52),binary_1.writeUint32LE(Zr+Wr|0,Bt,56),binary_1.writeUint32LE(Xr+Gr|0,Bt,60)}function streamXOR(Bt,Wt,Gt,Yt,Xt){if(Xt===void 0&&(Xt=0),Bt.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(Yt.length<Gt.length)throw new Error("ChaCha: destination is shorter than source");var Jt,Zt;if(Xt===0){if(Wt.length!==8&&Wt.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");Jt=new Uint8Array(16),Zt=Jt.length-Wt.length,Jt.set(Wt,Zt)}else{if(Wt.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");Jt=Wt,Zt=Xt}for(var Qt=new Uint8Array(64),ur=0;ur<Gt.length;ur+=64){core(Qt,Jt,Bt);for(var cr=ur;cr<ur+64&&cr<Gt.length;cr++)Yt[cr]=Gt[cr]^Qt[cr-ur];incrementCounter(Jt,0,Zt)}return wipe_1$3.wipe(Qt),Xt===0&&wipe_1$3.wipe(Jt),Yt}chacha.streamXOR=streamXOR;function stream(Bt,Wt,Gt,Yt){return Yt===void 0&&(Yt=0),wipe_1$3.wipe(Gt),streamXOR(Bt,Wt,Gt,Gt,Yt)}chacha.stream=stream;function incrementCounter(Bt,Wt,Gt){for(var Yt=1;Gt--;)Yt=Yt+(Bt[Wt]&255)|0,Bt[Wt]=Yt&255,Yt>>>=8,Wt++;if(Yt>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select$1(Bt,Wt,Gt){return~(Bt-1)&Wt|Bt-1&Gt}constantTime.select=select$1;function lessOrEqual(Bt,Wt){return(Bt|0)-(Wt|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare(Bt,Wt){if(Bt.length!==Wt.length)return 0;for(var Gt=0,Yt=0;Yt<Bt.length;Yt++)Gt|=Bt[Yt]^Wt[Yt];return 1&Gt-1>>>8}constantTime.compare=compare;function equal$1(Bt,Wt){return Bt.length===0||Wt.length===0?!1:compare(Bt,Wt)!==0}constantTime.equal=equal$1;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=constantTime,Gt=wipe$1;Bt.DIGEST_LENGTH=16;var Yt=function(){function Zt(Qt){this.digestLength=Bt.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var ur=Qt[0]|Qt[1]<<8;this._r[0]=ur&8191;var cr=Qt[2]|Qt[3]<<8;this._r[1]=(ur>>>13|cr<<3)&8191;var $r=Qt[4]|Qt[5]<<8;this._r[2]=(cr>>>10|$r<<6)&7939;var Ar=Qt[6]|Qt[7]<<8;this._r[3]=($r>>>7|Ar<<9)&8191;var Lr=Qt[8]|Qt[9]<<8;this._r[4]=(Ar>>>4|Lr<<12)&255,this._r[5]=Lr>>>1&8190;var qr=Qt[10]|Qt[11]<<8;this._r[6]=(Lr>>>14|qr<<2)&8191;var Fr=Qt[12]|Qt[13]<<8;this._r[7]=(qr>>>11|Fr<<5)&8065;var Hr=Qt[14]|Qt[15]<<8;this._r[8]=(Fr>>>8|Hr<<8)&8191,this._r[9]=Hr>>>5&127,this._pad[0]=Qt[16]|Qt[17]<<8,this._pad[1]=Qt[18]|Qt[19]<<8,this._pad[2]=Qt[20]|Qt[21]<<8,this._pad[3]=Qt[22]|Qt[23]<<8,this._pad[4]=Qt[24]|Qt[25]<<8,this._pad[5]=Qt[26]|Qt[27]<<8,this._pad[6]=Qt[28]|Qt[29]<<8,this._pad[7]=Qt[30]|Qt[31]<<8}return Zt.prototype._blocks=function(Qt,ur,cr){for(var $r=this._fin?0:2048,Ar=this._h[0],Lr=this._h[1],qr=this._h[2],Fr=this._h[3],Hr=this._h[4],Br=this._h[5],Wr=this._h[6],Gr=this._h[7],Kr=this._h[8],Yr=this._h[9],hn=this._r[0],Qr=this._r[1],pn=this._r[2],En=this._r[3],ga=this._r[4],dn=this._r[5],Pr=this._r[6],xr=this._r[7],Mr=this._r[8],Nr=this._r[9];cr>=16;){var Ur=Qt[ur+0]|Qt[ur+1]<<8;Ar+=Ur&8191;var Vr=Qt[ur+2]|Qt[ur+3]<<8;Lr+=(Ur>>>13|Vr<<3)&8191;var Zr=Qt[ur+4]|Qt[ur+5]<<8;qr+=(Vr>>>10|Zr<<6)&8191;var Xr=Qt[ur+6]|Qt[ur+7]<<8;Fr+=(Zr>>>7|Xr<<9)&8191;var Or=Qt[ur+8]|Qt[ur+9]<<8;Hr+=(Xr>>>4|Or<<12)&8191,Br+=Or>>>1&8191;var jr=Qt[ur+10]|Qt[ur+11]<<8;Wr+=(Or>>>14|jr<<2)&8191;var Jr=Qt[ur+12]|Qt[ur+13]<<8;Gr+=(jr>>>11|Jr<<5)&8191;var mn=Qt[ur+14]|Qt[ur+15]<<8;Kr+=(Jr>>>8|mn<<8)&8191,Yr+=mn>>>5|$r;var gn=0,eo=gn;eo+=Ar*hn,eo+=Lr*(5*Nr),eo+=qr*(5*Mr),eo+=Fr*(5*xr),eo+=Hr*(5*Pr),gn=eo>>>13,eo&=8191,eo+=Br*(5*dn),eo+=Wr*(5*ga),eo+=Gr*(5*En),eo+=Kr*(5*pn),eo+=Yr*(5*Qr),gn+=eo>>>13,eo&=8191;var _i=gn;_i+=Ar*Qr,_i+=Lr*hn,_i+=qr*(5*Nr),_i+=Fr*(5*Mr),_i+=Hr*(5*xr),gn=_i>>>13,_i&=8191,_i+=Br*(5*Pr),_i+=Wr*(5*dn),_i+=Gr*(5*ga),_i+=Kr*(5*En),_i+=Yr*(5*pn),gn+=_i>>>13,_i&=8191;var ro=gn;ro+=Ar*pn,ro+=Lr*Qr,ro+=qr*hn,ro+=Fr*(5*Nr),ro+=Hr*(5*Mr),gn=ro>>>13,ro&=8191,ro+=Br*(5*xr),ro+=Wr*(5*Pr),ro+=Gr*(5*dn),ro+=Kr*(5*ga),ro+=Yr*(5*En),gn+=ro>>>13,ro&=8191;var io=gn;io+=Ar*En,io+=Lr*pn,io+=qr*Qr,io+=Fr*hn,io+=Hr*(5*Nr),gn=io>>>13,io&=8191,io+=Br*(5*Mr),io+=Wr*(5*xr),io+=Gr*(5*Pr),io+=Kr*(5*dn),io+=Yr*(5*ga),gn+=io>>>13,io&=8191;var ao=gn;ao+=Ar*ga,ao+=Lr*En,ao+=qr*pn,ao+=Fr*Qr,ao+=Hr*hn,gn=ao>>>13,ao&=8191,ao+=Br*(5*Nr),ao+=Wr*(5*Mr),ao+=Gr*(5*xr),ao+=Kr*(5*Pr),ao+=Yr*(5*dn),gn+=ao>>>13,ao&=8191;var oo=gn;oo+=Ar*dn,oo+=Lr*ga,oo+=qr*En,oo+=Fr*pn,oo+=Hr*Qr,gn=oo>>>13,oo&=8191,oo+=Br*hn,oo+=Wr*(5*Nr),oo+=Gr*(5*Mr),oo+=Kr*(5*xr),oo+=Yr*(5*Pr),gn+=oo>>>13,oo&=8191;var to=gn;to+=Ar*Pr,to+=Lr*dn,to+=qr*ga,to+=Fr*En,to+=Hr*pn,gn=to>>>13,to&=8191,to+=Br*Qr,to+=Wr*hn,to+=Gr*(5*Nr),to+=Kr*(5*Mr),to+=Yr*(5*xr),gn+=to>>>13,to&=8191;var so=gn;so+=Ar*xr,so+=Lr*Pr,so+=qr*dn,so+=Fr*ga,so+=Hr*En,gn=so>>>13,so&=8191,so+=Br*pn,so+=Wr*Qr,so+=Gr*hn,so+=Kr*(5*Nr),so+=Yr*(5*Mr),gn+=so>>>13,so&=8191;var lo=gn;lo+=Ar*Mr,lo+=Lr*xr,lo+=qr*Pr,lo+=Fr*dn,lo+=Hr*ga,gn=lo>>>13,lo&=8191,lo+=Br*En,lo+=Wr*pn,lo+=Gr*Qr,lo+=Kr*hn,lo+=Yr*(5*Nr),gn+=lo>>>13,lo&=8191;var Ro=gn;Ro+=Ar*Nr,Ro+=Lr*Mr,Ro+=qr*xr,Ro+=Fr*Pr,Ro+=Hr*dn,gn=Ro>>>13,Ro&=8191,Ro+=Br*ga,Ro+=Wr*En,Ro+=Gr*pn,Ro+=Kr*Qr,Ro+=Yr*hn,gn+=Ro>>>13,Ro&=8191,gn=(gn<<2)+gn|0,gn=gn+eo|0,eo=gn&8191,gn=gn>>>13,_i+=gn,Ar=eo,Lr=_i,qr=ro,Fr=io,Hr=ao,Br=oo,Wr=to,Gr=so,Kr=lo,Yr=Ro,ur+=16,cr-=16}this._h[0]=Ar,this._h[1]=Lr,this._h[2]=qr,this._h[3]=Fr,this._h[4]=Hr,this._h[5]=Br,this._h[6]=Wr,this._h[7]=Gr,this._h[8]=Kr,this._h[9]=Yr},Zt.prototype.finish=function(Qt,ur){ur===void 0&&(ur=0);var cr=new Uint16Array(10),$r,Ar,Lr,qr;if(this._leftover){for(qr=this._leftover,this._buffer[qr++]=1;qr<16;qr++)this._buffer[qr]=0;this._fin=1,this._blocks(this._buffer,0,16)}for($r=this._h[1]>>>13,this._h[1]&=8191,qr=2;qr<10;qr++)this._h[qr]+=$r,$r=this._h[qr]>>>13,this._h[qr]&=8191;for(this._h[0]+=$r*5,$r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=$r,$r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=$r,cr[0]=this._h[0]+5,$r=cr[0]>>>13,cr[0]&=8191,qr=1;qr<10;qr++)cr[qr]=this._h[qr]+$r,$r=cr[qr]>>>13,cr[qr]&=8191;for(cr[9]-=8192,Ar=($r^1)-1,qr=0;qr<10;qr++)cr[qr]&=Ar;for(Ar=~Ar,qr=0;qr<10;qr++)this._h[qr]=this._h[qr]&Ar|cr[qr];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,Lr=this._h[0]+this._pad[0],this._h[0]=Lr&65535,qr=1;qr<8;qr++)Lr=(this._h[qr]+this._pad[qr]|0)+(Lr>>>16)|0,this._h[qr]=Lr&65535;return Qt[ur+0]=this._h[0]>>>0,Qt[ur+1]=this._h[0]>>>8,Qt[ur+2]=this._h[1]>>>0,Qt[ur+3]=this._h[1]>>>8,Qt[ur+4]=this._h[2]>>>0,Qt[ur+5]=this._h[2]>>>8,Qt[ur+6]=this._h[3]>>>0,Qt[ur+7]=this._h[3]>>>8,Qt[ur+8]=this._h[4]>>>0,Qt[ur+9]=this._h[4]>>>8,Qt[ur+10]=this._h[5]>>>0,Qt[ur+11]=this._h[5]>>>8,Qt[ur+12]=this._h[6]>>>0,Qt[ur+13]=this._h[6]>>>8,Qt[ur+14]=this._h[7]>>>0,Qt[ur+15]=this._h[7]>>>8,this._finished=!0,this},Zt.prototype.update=function(Qt){var ur=0,cr=Qt.length,$r;if(this._leftover){$r=16-this._leftover,$r>cr&&($r=cr);for(var Ar=0;Ar<$r;Ar++)this._buffer[this._leftover+Ar]=Qt[ur+Ar];if(cr-=$r,ur+=$r,this._leftover+=$r,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(cr>=16&&($r=cr-cr%16,this._blocks(Qt,ur,$r),ur+=$r,cr-=$r),cr){for(var Ar=0;Ar<cr;Ar++)this._buffer[this._leftover+Ar]=Qt[ur+Ar];this._leftover+=cr}return this},Zt.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var Qt=new Uint8Array(16);return this.finish(Qt),Qt},Zt.prototype.clean=function(){return Gt.wipe(this._buffer),Gt.wipe(this._r),Gt.wipe(this._h),Gt.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},Zt}();Bt.Poly1305=Yt;function Xt(Zt,Qt){var ur=new Yt(Zt);ur.update(Qt);var cr=ur.digest();return ur.clean(),cr}Bt.oneTimeAuth=Xt;function Jt(Zt,Qt){return Zt.length!==Bt.DIGEST_LENGTH||Qt.length!==Bt.DIGEST_LENGTH?!1:Wt.equal(Zt,Qt)}Bt.equal=Jt})(poly1305);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=chacha,Gt=poly1305,Yt=wipe$1,Xt=binary,Jt=constantTime;Bt.KEY_LENGTH=32,Bt.NONCE_LENGTH=12,Bt.TAG_LENGTH=16;var Zt=new Uint8Array(16),Qt=function(){function ur(cr){if(this.nonceLength=Bt.NONCE_LENGTH,this.tagLength=Bt.TAG_LENGTH,cr.length!==Bt.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(cr)}return ur.prototype.seal=function(cr,$r,Ar,Lr){if(cr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var qr=new Uint8Array(16);qr.set(cr,qr.length-cr.length);var Fr=new Uint8Array(32);Wt.stream(this._key,qr,Fr,4);var Hr=$r.length+this.tagLength,Br;if(Lr){if(Lr.length!==Hr)throw new Error("ChaCha20Poly1305: incorrect destination length");Br=Lr}else Br=new Uint8Array(Hr);return Wt.streamXOR(this._key,qr,$r,Br,4),this._authenticate(Br.subarray(Br.length-this.tagLength,Br.length),Fr,Br.subarray(0,Br.length-this.tagLength),Ar),Yt.wipe(qr),Br},ur.prototype.open=function(cr,$r,Ar,Lr){if(cr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if($r.length<this.tagLength)return null;var qr=new Uint8Array(16);qr.set(cr,qr.length-cr.length);var Fr=new Uint8Array(32);Wt.stream(this._key,qr,Fr,4);var Hr=new Uint8Array(this.tagLength);if(this._authenticate(Hr,Fr,$r.subarray(0,$r.length-this.tagLength),Ar),!Jt.equal(Hr,$r.subarray($r.length-this.tagLength,$r.length)))return null;var Br=$r.length-this.tagLength,Wr;if(Lr){if(Lr.length!==Br)throw new Error("ChaCha20Poly1305: incorrect destination length");Wr=Lr}else Wr=new Uint8Array(Br);return Wt.streamXOR(this._key,qr,$r.subarray(0,$r.length-this.tagLength),Wr,4),Yt.wipe(qr),Wr},ur.prototype.clean=function(){return Yt.wipe(this._key),this},ur.prototype._authenticate=function(cr,$r,Ar,Lr){var qr=new Gt.Poly1305($r);Lr&&(qr.update(Lr),Lr.length%16>0&&qr.update(Zt.subarray(Lr.length%16))),qr.update(Ar),Ar.length%16>0&&qr.update(Zt.subarray(Ar.length%16));var Fr=new Uint8Array(8);Lr&&Xt.writeUint64LE(Lr.length,Fr),qr.update(Fr),Xt.writeUint64LE(Ar.length,Fr),qr.update(Fr);for(var Hr=qr.digest(),Br=0;Br<Hr.length;Br++)cr[Br]=Hr[Br];qr.clean(),Yt.wipe(Hr),Yt.wipe(Fr)},ur}();Bt.ChaCha20Poly1305=Qt})(chacha20poly1305);var hkdf={},hmac$2={},hash$4={};Object.defineProperty(hash$4,"__esModule",{value:!0});function isSerializableHash(Bt){return typeof Bt.saveState<"u"&&typeof Bt.restoreState<"u"&&typeof Bt.cleanSavedState<"u"}hash$4.isSerializableHash=isSerializableHash;Object.defineProperty(hmac$2,"__esModule",{value:!0});var hash_1=hash$4,constant_time_1=constantTime,wipe_1$2=wipe$1,HMAC=function(){function Bt(Wt,Gt){this._finished=!1,this._inner=new Wt,this._outer=new Wt,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var Yt=new Uint8Array(this.blockSize);Gt.length>this.blockSize?this._inner.update(Gt).finish(Yt).clean():Yt.set(Gt);for(var Xt=0;Xt<Yt.length;Xt++)Yt[Xt]^=54;this._inner.update(Yt);for(var Xt=0;Xt<Yt.length;Xt++)Yt[Xt]^=106;this._outer.update(Yt),hash_1.isSerializableHash(this._inner)&&hash_1.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),wipe_1$2.wipe(Yt)}return Bt.prototype.reset=function(){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Bt.prototype.clean=function(){hash_1.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hash_1.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},Bt.prototype.update=function(Wt){return this._inner.update(Wt),this},Bt.prototype.finish=function(Wt){return this._finished?(this._outer.finish(Wt),this):(this._inner.finish(Wt),this._outer.update(Wt.subarray(0,this.digestLength)).finish(Wt),this._finished=!0,this)},Bt.prototype.digest=function(){var Wt=new Uint8Array(this.digestLength);return this.finish(Wt),Wt},Bt.prototype.saveState=function(){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},Bt.prototype.restoreState=function(Wt){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(Wt),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Bt.prototype.cleanSavedState=function(Wt){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(Wt)},Bt}();hmac$2.HMAC=HMAC;function hmac$1(Bt,Wt,Gt){var Yt=new HMAC(Bt,Wt);Yt.update(Gt);var Xt=Yt.digest();return Yt.clean(),Xt}hmac$2.hmac=hmac$1;hmac$2.equal=constant_time_1.equal;Object.defineProperty(hkdf,"__esModule",{value:!0});var hmac_1=hmac$2,wipe_1$1=wipe$1,HKDF=function(){function Bt(Wt,Gt,Yt,Xt){Yt===void 0&&(Yt=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=Wt,this._info=Xt;var Jt=hmac_1.hmac(this._hash,Yt,Gt);this._hmac=new hmac_1.HMAC(Wt,Jt),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return Bt.prototype._fillBuffer=function(){this._counter[0]++;var Wt=this._counter[0];if(Wt===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),Wt>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},Bt.prototype.expand=function(Wt){for(var Gt=new Uint8Array(Wt),Yt=0;Yt<Gt.length;Yt++)this._bufpos===this._buffer.length&&this._fillBuffer(),Gt[Yt]=this._buffer[this._bufpos++];return Gt},Bt.prototype.clean=function(){this._hmac.clean(),wipe_1$1.wipe(this._buffer),wipe_1$1.wipe(this._counter),this._bufpos=0},Bt}(),HKDF_1=hkdf.HKDF=HKDF,random={},system={},browser$5={};Object.defineProperty(browser$5,"__esModule",{value:!0});browser$5.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const Wt=typeof self<"u"?self.crypto||self.msCrypto:null;Wt&&Wt.getRandomValues!==void 0&&(this._crypto=Wt,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(Wt){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const Gt=new Uint8Array(Wt);for(let Yt=0;Yt<Gt.length;Yt+=QUOTA)this._crypto.getRandomValues(Gt.subarray(Yt,Yt+Math.min(Gt.length-Yt,QUOTA)));return Gt}}browser$5.BrowserRandomSource=BrowserRandomSource;function commonjsRequire$1(Bt){throw new Error('Could not dynamically require "'+Bt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$1={};Object.defineProperty(node$1,"__esModule",{value:!0});node$1.NodeRandomSource=void 0;const wipe_1=wipe$1;class NodeRandomSource{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire$1<"u"){const Wt=require$$0$a;Wt&&Wt.randomBytes&&(this._crypto=Wt,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(Wt){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let Gt=this._crypto.randomBytes(Wt);if(Gt.length!==Wt)throw new Error("NodeRandomSource: got fewer bytes than requested");const Yt=new Uint8Array(Wt);for(let Xt=0;Xt<Yt.length;Xt++)Yt[Xt]=Gt[Xt];return(0,wipe_1.wipe)(Gt),Yt}}node$1.NodeRandomSource=NodeRandomSource;Object.defineProperty(system,"__esModule",{value:!0});system.SystemRandomSource=void 0;const browser_1=browser$5,node_1$1=node$1;class SystemRandomSource{constructor(){if(this.isAvailable=!1,this.name="",this._source=new browser_1.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new node_1$1.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(Wt){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(Wt)}}system.SystemRandomSource=SystemRandomSource;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.randomStringForEntropy=Bt.randomString=Bt.randomUint32=Bt.randomBytes=Bt.defaultRandomSource=void 0;const Wt=system,Gt=binary,Yt=wipe$1;Bt.defaultRandomSource=new Wt.SystemRandomSource;function Xt(cr,$r=Bt.defaultRandomSource){return $r.randomBytes(cr)}Bt.randomBytes=Xt;function Jt(cr=Bt.defaultRandomSource){const $r=Xt(4,cr),Ar=(0,Gt.readUint32LE)($r);return(0,Yt.wipe)($r),Ar}Bt.randomUint32=Jt;const Zt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Qt(cr,$r=Zt,Ar=Bt.defaultRandomSource){if($r.length<2)throw new Error("randomString charset is too short");if($r.length>256)throw new Error("randomString charset is too long");let Lr="";const qr=$r.length,Fr=256-256%qr;for(;cr>0;){const Hr=Xt(Math.ceil(cr*256/Fr),Ar);for(let Br=0;Br<Hr.length&&cr>0;Br++){const Wr=Hr[Br];Wr<Fr&&(Lr+=$r.charAt(Wr%qr),cr--)}(0,Yt.wipe)(Hr)}return Lr}Bt.randomString=Qt;function ur(cr,$r=Zt,Ar=Bt.defaultRandomSource){const Lr=Math.ceil(cr/(Math.log($r.length)/Math.LN2));return Qt(Lr,$r,Ar)}Bt.randomStringForEntropy=ur})(random);var sha256$4={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=binary,Gt=wipe$1;Bt.DIGEST_LENGTH=32,Bt.BLOCK_SIZE=64;var Yt=function(){function Qt(){this.digestLength=Bt.DIGEST_LENGTH,this.blockSize=Bt.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return Qt.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},Qt.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},Qt.prototype.clean=function(){Gt.wipe(this._buffer),Gt.wipe(this._temp),this.reset()},Qt.prototype.update=function(ur,cr){if(cr===void 0&&(cr=ur.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var $r=0;if(this._bytesHashed+=cr,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&cr>0;)this._buffer[this._bufferLength++]=ur[$r++],cr--;this._bufferLength===this.blockSize&&(Jt(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(cr>=this.blockSize&&($r=Jt(this._temp,this._state,ur,$r,cr),cr%=this.blockSize);cr>0;)this._buffer[this._bufferLength++]=ur[$r++],cr--;return this},Qt.prototype.finish=function(ur){if(!this._finished){var cr=this._bytesHashed,$r=this._bufferLength,Ar=cr/536870912|0,Lr=cr<<3,qr=cr%64<56?64:128;this._buffer[$r]=128;for(var Fr=$r+1;Fr<qr-8;Fr++)this._buffer[Fr]=0;Wt.writeUint32BE(Ar,this._buffer,qr-8),Wt.writeUint32BE(Lr,this._buffer,qr-4),Jt(this._temp,this._state,this._buffer,0,qr),this._finished=!0}for(var Fr=0;Fr<this.digestLength/4;Fr++)Wt.writeUint32BE(this._state[Fr],ur,Fr*4);return this},Qt.prototype.digest=function(){var ur=new Uint8Array(this.digestLength);return this.finish(ur),ur},Qt.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},Qt.prototype.restoreState=function(ur){return this._state.set(ur.state),this._bufferLength=ur.bufferLength,ur.buffer&&this._buffer.set(ur.buffer),this._bytesHashed=ur.bytesHashed,this._finished=!1,this},Qt.prototype.cleanSavedState=function(ur){Gt.wipe(ur.state),ur.buffer&&Gt.wipe(ur.buffer),ur.bufferLength=0,ur.bytesHashed=0},Qt}();Bt.SHA256=Yt;var Xt=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Jt(Qt,ur,cr,$r,Ar){for(;Ar>=64;){for(var Lr=ur[0],qr=ur[1],Fr=ur[2],Hr=ur[3],Br=ur[4],Wr=ur[5],Gr=ur[6],Kr=ur[7],Yr=0;Yr<16;Yr++){var hn=$r+Yr*4;Qt[Yr]=Wt.readUint32BE(cr,hn)}for(var Yr=16;Yr<64;Yr++){var Qr=Qt[Yr-2],pn=(Qr>>>17|Qr<<32-17)^(Qr>>>19|Qr<<32-19)^Qr>>>10;Qr=Qt[Yr-15];var En=(Qr>>>7|Qr<<32-7)^(Qr>>>18|Qr<<32-18)^Qr>>>3;Qt[Yr]=(pn+Qt[Yr-7]|0)+(En+Qt[Yr-16]|0)}for(var Yr=0;Yr<64;Yr++){var pn=(((Br>>>6|Br<<26)^(Br>>>11|Br<<21)^(Br>>>25|Br<<7))+(Br&Wr^~Br&Gr)|0)+(Kr+(Xt[Yr]+Qt[Yr]|0)|0)|0,En=((Lr>>>2|Lr<<32-2)^(Lr>>>13|Lr<<32-13)^(Lr>>>22|Lr<<32-22))+(Lr&qr^Lr&Fr^qr&Fr)|0;Kr=Gr,Gr=Wr,Wr=Br,Br=Hr+pn|0,Hr=Fr,Fr=qr,qr=Lr,Lr=pn+En|0}ur[0]+=Lr,ur[1]+=qr,ur[2]+=Fr,ur[3]+=Hr,ur[4]+=Br,ur[5]+=Wr,ur[6]+=Gr,ur[7]+=Kr,$r+=64,Ar-=64}return $r}function Zt(Qt){var ur=new Yt;ur.update(Qt);var cr=ur.digest();return ur.clean(),cr}Bt.hash=Zt})(sha256$4);var x25519={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sharedKey=Bt.generateKeyPair=Bt.generateKeyPairFromSeed=Bt.scalarMultBase=Bt.scalarMult=Bt.SHARED_KEY_LENGTH=Bt.SECRET_KEY_LENGTH=Bt.PUBLIC_KEY_LENGTH=void 0;const Wt=random,Gt=wipe$1;Bt.PUBLIC_KEY_LENGTH=32,Bt.SECRET_KEY_LENGTH=32,Bt.SHARED_KEY_LENGTH=32;function Yt(Yr){const hn=new Float64Array(16);if(Yr)for(let Qr=0;Qr<Yr.length;Qr++)hn[Qr]=Yr[Qr];return hn}const Xt=new Uint8Array(32);Xt[0]=9;const Jt=Yt([56129,1]);function Zt(Yr){let hn=1;for(let Qr=0;Qr<16;Qr++){let pn=Yr[Qr]+hn+65535;hn=Math.floor(pn/65536),Yr[Qr]=pn-hn*65536}Yr[0]+=hn-1+37*(hn-1)}function Qt(Yr,hn,Qr){const pn=~(Qr-1);for(let En=0;En<16;En++){const ga=pn&(Yr[En]^hn[En]);Yr[En]^=ga,hn[En]^=ga}}function ur(Yr,hn){const Qr=Yt(),pn=Yt();for(let En=0;En<16;En++)pn[En]=hn[En];Zt(pn),Zt(pn),Zt(pn);for(let En=0;En<2;En++){Qr[0]=pn[0]-65517;for(let dn=1;dn<15;dn++)Qr[dn]=pn[dn]-65535-(Qr[dn-1]>>16&1),Qr[dn-1]&=65535;Qr[15]=pn[15]-32767-(Qr[14]>>16&1);const ga=Qr[15]>>16&1;Qr[14]&=65535,Qt(pn,Qr,1-ga)}for(let En=0;En<16;En++)Yr[2*En]=pn[En]&255,Yr[2*En+1]=pn[En]>>8}function cr(Yr,hn){for(let Qr=0;Qr<16;Qr++)Yr[Qr]=hn[2*Qr]+(hn[2*Qr+1]<<8);Yr[15]&=32767}function $r(Yr,hn,Qr){for(let pn=0;pn<16;pn++)Yr[pn]=hn[pn]+Qr[pn]}function Ar(Yr,hn,Qr){for(let pn=0;pn<16;pn++)Yr[pn]=hn[pn]-Qr[pn]}function Lr(Yr,hn,Qr){let pn,En,ga=0,dn=0,Pr=0,xr=0,Mr=0,Nr=0,Ur=0,Vr=0,Zr=0,Xr=0,Or=0,jr=0,Jr=0,mn=0,gn=0,eo=0,_i=0,ro=0,io=0,ao=0,oo=0,to=0,so=0,lo=0,Ro=0,Io=0,Fo=0,xo=0,ho=0,po=0,Ao=0,Bo=Qr[0],Mo=Qr[1],bo=Qr[2],yo=Qr[3],Do=Qr[4],Tu=Qr[5],wu=Qr[6],$o=Qr[7],mo=Qr[8],_o=Qr[9],To=Qr[10],iu=Qr[11],nu=Qr[12],Jo=Qr[13],cu=Qr[14],au=Qr[15];pn=hn[0],ga+=pn*Bo,dn+=pn*Mo,Pr+=pn*bo,xr+=pn*yo,Mr+=pn*Do,Nr+=pn*Tu,Ur+=pn*wu,Vr+=pn*$o,Zr+=pn*mo,Xr+=pn*_o,Or+=pn*To,jr+=pn*iu,Jr+=pn*nu,mn+=pn*Jo,gn+=pn*cu,eo+=pn*au,pn=hn[1],dn+=pn*Bo,Pr+=pn*Mo,xr+=pn*bo,Mr+=pn*yo,Nr+=pn*Do,Ur+=pn*Tu,Vr+=pn*wu,Zr+=pn*$o,Xr+=pn*mo,Or+=pn*_o,jr+=pn*To,Jr+=pn*iu,mn+=pn*nu,gn+=pn*Jo,eo+=pn*cu,_i+=pn*au,pn=hn[2],Pr+=pn*Bo,xr+=pn*Mo,Mr+=pn*bo,Nr+=pn*yo,Ur+=pn*Do,Vr+=pn*Tu,Zr+=pn*wu,Xr+=pn*$o,Or+=pn*mo,jr+=pn*_o,Jr+=pn*To,mn+=pn*iu,gn+=pn*nu,eo+=pn*Jo,_i+=pn*cu,ro+=pn*au,pn=hn[3],xr+=pn*Bo,Mr+=pn*Mo,Nr+=pn*bo,Ur+=pn*yo,Vr+=pn*Do,Zr+=pn*Tu,Xr+=pn*wu,Or+=pn*$o,jr+=pn*mo,Jr+=pn*_o,mn+=pn*To,gn+=pn*iu,eo+=pn*nu,_i+=pn*Jo,ro+=pn*cu,io+=pn*au,pn=hn[4],Mr+=pn*Bo,Nr+=pn*Mo,Ur+=pn*bo,Vr+=pn*yo,Zr+=pn*Do,Xr+=pn*Tu,Or+=pn*wu,jr+=pn*$o,Jr+=pn*mo,mn+=pn*_o,gn+=pn*To,eo+=pn*iu,_i+=pn*nu,ro+=pn*Jo,io+=pn*cu,ao+=pn*au,pn=hn[5],Nr+=pn*Bo,Ur+=pn*Mo,Vr+=pn*bo,Zr+=pn*yo,Xr+=pn*Do,Or+=pn*Tu,jr+=pn*wu,Jr+=pn*$o,mn+=pn*mo,gn+=pn*_o,eo+=pn*To,_i+=pn*iu,ro+=pn*nu,io+=pn*Jo,ao+=pn*cu,oo+=pn*au,pn=hn[6],Ur+=pn*Bo,Vr+=pn*Mo,Zr+=pn*bo,Xr+=pn*yo,Or+=pn*Do,jr+=pn*Tu,Jr+=pn*wu,mn+=pn*$o,gn+=pn*mo,eo+=pn*_o,_i+=pn*To,ro+=pn*iu,io+=pn*nu,ao+=pn*Jo,oo+=pn*cu,to+=pn*au,pn=hn[7],Vr+=pn*Bo,Zr+=pn*Mo,Xr+=pn*bo,Or+=pn*yo,jr+=pn*Do,Jr+=pn*Tu,mn+=pn*wu,gn+=pn*$o,eo+=pn*mo,_i+=pn*_o,ro+=pn*To,io+=pn*iu,ao+=pn*nu,oo+=pn*Jo,to+=pn*cu,so+=pn*au,pn=hn[8],Zr+=pn*Bo,Xr+=pn*Mo,Or+=pn*bo,jr+=pn*yo,Jr+=pn*Do,mn+=pn*Tu,gn+=pn*wu,eo+=pn*$o,_i+=pn*mo,ro+=pn*_o,io+=pn*To,ao+=pn*iu,oo+=pn*nu,to+=pn*Jo,so+=pn*cu,lo+=pn*au,pn=hn[9],Xr+=pn*Bo,Or+=pn*Mo,jr+=pn*bo,Jr+=pn*yo,mn+=pn*Do,gn+=pn*Tu,eo+=pn*wu,_i+=pn*$o,ro+=pn*mo,io+=pn*_o,ao+=pn*To,oo+=pn*iu,to+=pn*nu,so+=pn*Jo,lo+=pn*cu,Ro+=pn*au,pn=hn[10],Or+=pn*Bo,jr+=pn*Mo,Jr+=pn*bo,mn+=pn*yo,gn+=pn*Do,eo+=pn*Tu,_i+=pn*wu,ro+=pn*$o,io+=pn*mo,ao+=pn*_o,oo+=pn*To,to+=pn*iu,so+=pn*nu,lo+=pn*Jo,Ro+=pn*cu,Io+=pn*au,pn=hn[11],jr+=pn*Bo,Jr+=pn*Mo,mn+=pn*bo,gn+=pn*yo,eo+=pn*Do,_i+=pn*Tu,ro+=pn*wu,io+=pn*$o,ao+=pn*mo,oo+=pn*_o,to+=pn*To,so+=pn*iu,lo+=pn*nu,Ro+=pn*Jo,Io+=pn*cu,Fo+=pn*au,pn=hn[12],Jr+=pn*Bo,mn+=pn*Mo,gn+=pn*bo,eo+=pn*yo,_i+=pn*Do,ro+=pn*Tu,io+=pn*wu,ao+=pn*$o,oo+=pn*mo,to+=pn*_o,so+=pn*To,lo+=pn*iu,Ro+=pn*nu,Io+=pn*Jo,Fo+=pn*cu,xo+=pn*au,pn=hn[13],mn+=pn*Bo,gn+=pn*Mo,eo+=pn*bo,_i+=pn*yo,ro+=pn*Do,io+=pn*Tu,ao+=pn*wu,oo+=pn*$o,to+=pn*mo,so+=pn*_o,lo+=pn*To,Ro+=pn*iu,Io+=pn*nu,Fo+=pn*Jo,xo+=pn*cu,ho+=pn*au,pn=hn[14],gn+=pn*Bo,eo+=pn*Mo,_i+=pn*bo,ro+=pn*yo,io+=pn*Do,ao+=pn*Tu,oo+=pn*wu,to+=pn*$o,so+=pn*mo,lo+=pn*_o,Ro+=pn*To,Io+=pn*iu,Fo+=pn*nu,xo+=pn*Jo,ho+=pn*cu,po+=pn*au,pn=hn[15],eo+=pn*Bo,_i+=pn*Mo,ro+=pn*bo,io+=pn*yo,ao+=pn*Do,oo+=pn*Tu,to+=pn*wu,so+=pn*$o,lo+=pn*mo,Ro+=pn*_o,Io+=pn*To,Fo+=pn*iu,xo+=pn*nu,ho+=pn*Jo,po+=pn*cu,Ao+=pn*au,ga+=38*_i,dn+=38*ro,Pr+=38*io,xr+=38*ao,Mr+=38*oo,Nr+=38*to,Ur+=38*so,Vr+=38*lo,Zr+=38*Ro,Xr+=38*Io,Or+=38*Fo,jr+=38*xo,Jr+=38*ho,mn+=38*po,gn+=38*Ao,En=1,pn=ga+En+65535,En=Math.floor(pn/65536),ga=pn-En*65536,pn=dn+En+65535,En=Math.floor(pn/65536),dn=pn-En*65536,pn=Pr+En+65535,En=Math.floor(pn/65536),Pr=pn-En*65536,pn=xr+En+65535,En=Math.floor(pn/65536),xr=pn-En*65536,pn=Mr+En+65535,En=Math.floor(pn/65536),Mr=pn-En*65536,pn=Nr+En+65535,En=Math.floor(pn/65536),Nr=pn-En*65536,pn=Ur+En+65535,En=Math.floor(pn/65536),Ur=pn-En*65536,pn=Vr+En+65535,En=Math.floor(pn/65536),Vr=pn-En*65536,pn=Zr+En+65535,En=Math.floor(pn/65536),Zr=pn-En*65536,pn=Xr+En+65535,En=Math.floor(pn/65536),Xr=pn-En*65536,pn=Or+En+65535,En=Math.floor(pn/65536),Or=pn-En*65536,pn=jr+En+65535,En=Math.floor(pn/65536),jr=pn-En*65536,pn=Jr+En+65535,En=Math.floor(pn/65536),Jr=pn-En*65536,pn=mn+En+65535,En=Math.floor(pn/65536),mn=pn-En*65536,pn=gn+En+65535,En=Math.floor(pn/65536),gn=pn-En*65536,pn=eo+En+65535,En=Math.floor(pn/65536),eo=pn-En*65536,ga+=En-1+37*(En-1),En=1,pn=ga+En+65535,En=Math.floor(pn/65536),ga=pn-En*65536,pn=dn+En+65535,En=Math.floor(pn/65536),dn=pn-En*65536,pn=Pr+En+65535,En=Math.floor(pn/65536),Pr=pn-En*65536,pn=xr+En+65535,En=Math.floor(pn/65536),xr=pn-En*65536,pn=Mr+En+65535,En=Math.floor(pn/65536),Mr=pn-En*65536,pn=Nr+En+65535,En=Math.floor(pn/65536),Nr=pn-En*65536,pn=Ur+En+65535,En=Math.floor(pn/65536),Ur=pn-En*65536,pn=Vr+En+65535,En=Math.floor(pn/65536),Vr=pn-En*65536,pn=Zr+En+65535,En=Math.floor(pn/65536),Zr=pn-En*65536,pn=Xr+En+65535,En=Math.floor(pn/65536),Xr=pn-En*65536,pn=Or+En+65535,En=Math.floor(pn/65536),Or=pn-En*65536,pn=jr+En+65535,En=Math.floor(pn/65536),jr=pn-En*65536,pn=Jr+En+65535,En=Math.floor(pn/65536),Jr=pn-En*65536,pn=mn+En+65535,En=Math.floor(pn/65536),mn=pn-En*65536,pn=gn+En+65535,En=Math.floor(pn/65536),gn=pn-En*65536,pn=eo+En+65535,En=Math.floor(pn/65536),eo=pn-En*65536,ga+=En-1+37*(En-1),Yr[0]=ga,Yr[1]=dn,Yr[2]=Pr,Yr[3]=xr,Yr[4]=Mr,Yr[5]=Nr,Yr[6]=Ur,Yr[7]=Vr,Yr[8]=Zr,Yr[9]=Xr,Yr[10]=Or,Yr[11]=jr,Yr[12]=Jr,Yr[13]=mn,Yr[14]=gn,Yr[15]=eo}function qr(Yr,hn){Lr(Yr,hn,hn)}function Fr(Yr,hn){const Qr=Yt();for(let pn=0;pn<16;pn++)Qr[pn]=hn[pn];for(let pn=253;pn>=0;pn--)qr(Qr,Qr),pn!==2&&pn!==4&&Lr(Qr,Qr,hn);for(let pn=0;pn<16;pn++)Yr[pn]=Qr[pn]}function Hr(Yr,hn){const Qr=new Uint8Array(32),pn=new Float64Array(80),En=Yt(),ga=Yt(),dn=Yt(),Pr=Yt(),xr=Yt(),Mr=Yt();for(let Zr=0;Zr<31;Zr++)Qr[Zr]=Yr[Zr];Qr[31]=Yr[31]&127|64,Qr[0]&=248,cr(pn,hn);for(let Zr=0;Zr<16;Zr++)ga[Zr]=pn[Zr];En[0]=Pr[0]=1;for(let Zr=254;Zr>=0;--Zr){const Xr=Qr[Zr>>>3]>>>(Zr&7)&1;Qt(En,ga,Xr),Qt(dn,Pr,Xr),$r(xr,En,dn),Ar(En,En,dn),$r(dn,ga,Pr),Ar(ga,ga,Pr),qr(Pr,xr),qr(Mr,En),Lr(En,dn,En),Lr(dn,ga,xr),$r(xr,En,dn),Ar(En,En,dn),qr(ga,En),Ar(dn,Pr,Mr),Lr(En,dn,Jt),$r(En,En,Pr),Lr(dn,dn,En),Lr(En,Pr,Mr),Lr(Pr,ga,pn),qr(ga,xr),Qt(En,ga,Xr),Qt(dn,Pr,Xr)}for(let Zr=0;Zr<16;Zr++)pn[Zr+16]=En[Zr],pn[Zr+32]=dn[Zr],pn[Zr+48]=ga[Zr],pn[Zr+64]=Pr[Zr];const Nr=pn.subarray(32),Ur=pn.subarray(16);Fr(Nr,Nr),Lr(Ur,Ur,Nr);const Vr=new Uint8Array(32);return ur(Vr,Ur),Vr}Bt.scalarMult=Hr;function Br(Yr){return Hr(Yr,Xt)}Bt.scalarMultBase=Br;function Wr(Yr){if(Yr.length!==Bt.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${Bt.SECRET_KEY_LENGTH} bytes`);const hn=new Uint8Array(Yr);return{publicKey:Br(hn),secretKey:hn}}Bt.generateKeyPairFromSeed=Wr;function Gr(Yr){const hn=(0,Wt.randomBytes)(32,Yr),Qr=Wr(hn);return(0,Gt.wipe)(hn),Qr}Bt.generateKeyPair=Gr;function Kr(Yr,hn,Qr=!1){if(Yr.length!==Bt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(hn.length!==Bt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const pn=Hr(Yr,hn);if(Qr){let En=0;for(let ga=0;ga<pn.length;ga++)En|=pn[ga];if(En===0)throw new Error("X25519: invalid shared key")}return pn}Bt.sharedKey=Kr})(x25519);function asUint8Array(Bt){return globalThis.Buffer!=null?new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength):Bt}function allocUnsafe(Bt=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?asUint8Array(globalThis.Buffer.allocUnsafe(Bt)):new Uint8Array(Bt)}function concat$3(Bt,Wt){Wt||(Wt=Bt.reduce((Xt,Jt)=>Xt+Jt.length,0));const Gt=allocUnsafe(Wt);let Yt=0;for(const Xt of Bt)Gt.set(Xt,Yt),Yt+=Xt.length;return asUint8Array(Gt)}const concat$4=Object.freeze(Object.defineProperty({__proto__:null,concat:concat$3},Symbol.toStringTag,{value:"Module"}));function equals$3(Bt,Wt){if(Bt===Wt)return!0;if(Bt.byteLength!==Wt.byteLength)return!1;for(let Gt=0;Gt<Bt.byteLength;Gt++)if(Bt[Gt]!==Wt[Gt])return!1;return!0}const equals$4=Object.freeze(Object.defineProperty({__proto__:null,equals:equals$3},Symbol.toStringTag,{value:"Module"}));function base$3(Bt,Wt){if(Bt.length>=255)throw new TypeError("Alphabet too long");for(var Gt=new Uint8Array(256),Yt=0;Yt<Gt.length;Yt++)Gt[Yt]=255;for(var Xt=0;Xt<Bt.length;Xt++){var Jt=Bt.charAt(Xt),Zt=Jt.charCodeAt(0);if(Gt[Zt]!==255)throw new TypeError(Jt+" is ambiguous");Gt[Zt]=Xt}var Qt=Bt.length,ur=Bt.charAt(0),cr=Math.log(Qt)/Math.log(256),$r=Math.log(256)/Math.log(Qt);function Ar(Fr){if(Fr instanceof Uint8Array||(ArrayBuffer.isView(Fr)?Fr=new Uint8Array(Fr.buffer,Fr.byteOffset,Fr.byteLength):Array.isArray(Fr)&&(Fr=Uint8Array.from(Fr))),!(Fr instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(Fr.length===0)return"";for(var Hr=0,Br=0,Wr=0,Gr=Fr.length;Wr!==Gr&&Fr[Wr]===0;)Wr++,Hr++;for(var Kr=(Gr-Wr)*$r+1>>>0,Yr=new Uint8Array(Kr);Wr!==Gr;){for(var hn=Fr[Wr],Qr=0,pn=Kr-1;(hn!==0||Qr<Br)&&pn!==-1;pn--,Qr++)hn+=256*Yr[pn]>>>0,Yr[pn]=hn%Qt>>>0,hn=hn/Qt>>>0;if(hn!==0)throw new Error("Non-zero carry");Br=Qr,Wr++}for(var En=Kr-Br;En!==Kr&&Yr[En]===0;)En++;for(var ga=ur.repeat(Hr);En<Kr;++En)ga+=Bt.charAt(Yr[En]);return ga}function Lr(Fr){if(typeof Fr!="string")throw new TypeError("Expected String");if(Fr.length===0)return new Uint8Array;var Hr=0;if(Fr[Hr]!==" "){for(var Br=0,Wr=0;Fr[Hr]===ur;)Br++,Hr++;for(var Gr=(Fr.length-Hr)*cr+1>>>0,Kr=new Uint8Array(Gr);Fr[Hr];){var Yr=Gt[Fr.charCodeAt(Hr)];if(Yr===255)return;for(var hn=0,Qr=Gr-1;(Yr!==0||hn<Wr)&&Qr!==-1;Qr--,hn++)Yr+=Qt*Kr[Qr]>>>0,Kr[Qr]=Yr%256>>>0,Yr=Yr/256>>>0;if(Yr!==0)throw new Error("Non-zero carry");Wr=hn,Hr++}if(Fr[Hr]!==" "){for(var pn=Gr-Wr;pn!==Gr&&Kr[pn]===0;)pn++;for(var En=new Uint8Array(Br+(Gr-pn)),ga=Br;pn!==Gr;)En[ga++]=Kr[pn++];return En}}}function qr(Fr){var Hr=Lr(Fr);if(Hr)return Hr;throw new Error(`Non-${Wt} character`)}return{encode:Ar,decodeUnsafe:Lr,decode:qr}}var src$c=base$3,_brrp__multiformats_scope_baseX=src$c;const empty$1=new Uint8Array(0),toHex$1=Bt=>Bt.reduce((Wt,Gt)=>Wt+Gt.toString(16).padStart(2,"0"),""),fromHex=Bt=>{const Wt=Bt.match(/../g);return Wt?new Uint8Array(Wt.map(Gt=>parseInt(Gt,16))):empty$1},equals$2=(Bt,Wt)=>{if(Bt===Wt)return!0;if(Bt.byteLength!==Wt.byteLength)return!1;for(let Gt=0;Gt<Bt.byteLength;Gt++)if(Bt[Gt]!==Wt[Gt])return!1;return!0},coerce=Bt=>{if(Bt instanceof Uint8Array&&Bt.constructor.name==="Uint8Array")return Bt;if(Bt instanceof ArrayBuffer)return new Uint8Array(Bt);if(ArrayBuffer.isView(Bt))return new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength);throw new Error("Unknown type, must be binary type")},isBinary=Bt=>Bt instanceof ArrayBuffer||ArrayBuffer.isView(Bt),fromString$2=Bt=>new TextEncoder().encode(Bt),toString$b=Bt=>new TextDecoder().decode(Bt),bytes$1=Object.freeze(Object.defineProperty({__proto__:null,coerce,empty:empty$1,equals:equals$2,fromHex,fromString:fromString$2,isBinary,toHex:toHex$1,toString:toString$b},Symbol.toStringTag,{value:"Module"}));class Encoder{constructor(Wt,Gt,Yt){this.name=Wt,this.prefix=Gt,this.baseEncode=Yt}encode(Wt){if(Wt instanceof Uint8Array)return`${this.prefix}${this.baseEncode(Wt)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(Wt,Gt,Yt){if(this.name=Wt,this.prefix=Gt,Gt.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=Gt.codePointAt(0),this.baseDecode=Yt}decode(Wt){if(typeof Wt=="string"){if(Wt.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(Wt)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(Wt.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(Wt){return or(this,Wt)}}class ComposedDecoder{constructor(Wt){this.decoders=Wt}or(Wt){return or(this,Wt)}decode(Wt){const Gt=Wt[0],Yt=this.decoders[Gt];if(Yt)return Yt.decode(Wt);throw RangeError(`Unable to decode multibase string ${JSON.stringify(Wt)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const or=(Bt,Wt)=>new ComposedDecoder({...Bt.decoders||{[Bt.prefix]:Bt},...Wt.decoders||{[Wt.prefix]:Wt}});class Codec{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.prefix=Gt,this.baseEncode=Yt,this.baseDecode=Xt,this.encoder=new Encoder(Wt,Gt,Yt),this.decoder=new Decoder(Wt,Gt,Xt)}encode(Wt){return this.encoder.encode(Wt)}decode(Wt){return this.decoder.decode(Wt)}}const from$1=({name:Bt,prefix:Wt,encode:Gt,decode:Yt})=>new Codec(Bt,Wt,Gt,Yt),baseX$1=({prefix:Bt,name:Wt,alphabet:Gt})=>{const{encode:Yt,decode:Xt}=_brrp__multiformats_scope_baseX(Gt,Wt);return from$1({prefix:Bt,name:Wt,encode:Yt,decode:Jt=>coerce(Xt(Jt))})},decode$d=(Bt,Wt,Gt,Yt)=>{const Xt={};for(let $r=0;$r<Wt.length;++$r)Xt[Wt[$r]]=$r;let Jt=Bt.length;for(;Bt[Jt-1]==="=";)--Jt;const Zt=new Uint8Array(Jt*Gt/8|0);let Qt=0,ur=0,cr=0;for(let $r=0;$r<Jt;++$r){const Ar=Xt[Bt[$r]];if(Ar===void 0)throw new SyntaxError(`Non-${Yt} character`);ur=ur<<Gt|Ar,Qt+=Gt,Qt>=8&&(Qt-=8,Zt[cr++]=255&ur>>Qt)}if(Qt>=Gt||255&ur<<8-Qt)throw new SyntaxError("Unexpected end of data");return Zt},encode$c=(Bt,Wt,Gt)=>{const Yt=Wt[Wt.length-1]==="=",Xt=(1<<Gt)-1;let Jt="",Zt=0,Qt=0;for(let ur=0;ur<Bt.length;++ur)for(Qt=Qt<<8|Bt[ur],Zt+=8;Zt>Gt;)Zt-=Gt,Jt+=Wt[Xt&Qt>>Zt];if(Zt&&(Jt+=Wt[Xt&Qt<<Gt-Zt]),Yt)for(;Jt.length*Gt&7;)Jt+="=";return Jt},rfc4648$2=({name:Bt,prefix:Wt,bitsPerChar:Gt,alphabet:Yt})=>from$1({prefix:Wt,name:Bt,encode(Xt){return encode$c(Xt,Yt,Gt)},decode(Xt){return decode$d(Xt,Yt,Gt,Bt)}}),identity$d=from$1({prefix:"\0",name:"identity",encode:Bt=>toString$b(Bt),decode:Bt=>fromString$2(Bt)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$d},Symbol.toStringTag,{value:"Module"})),base2=rfc4648$2({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$1=Object.freeze(Object.defineProperty({__proto__:null,base2},Symbol.toStringTag,{value:"Module"})),base8=rfc4648$2({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),base10=baseX$1({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$1=Object.freeze(Object.defineProperty({__proto__:null,base10},Symbol.toStringTag,{value:"Module"})),base16=rfc4648$2({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc4648$2({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$1=Object.freeze(Object.defineProperty({__proto__:null,base16,base16upper},Symbol.toStringTag,{value:"Module"})),base32=rfc4648$2({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648$2({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648$2({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648$2({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648$2({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648$2({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648$2({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648$2({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648$2({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$1=Object.freeze(Object.defineProperty({__proto__:null,base32,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64$1=rfc4648$2({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648$2({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648$2({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648$2({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$2=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$1,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce((Bt,Wt,Gt)=>(Bt[Gt]=Wt,Bt),[]),alphabetCharsToBytes=alphabet.reduce((Bt,Wt,Gt)=>(Bt[Wt.codePointAt(0)]=Gt,Bt),[]);function encode$b(Bt){return Bt.reduce((Wt,Gt)=>(Wt+=alphabetBytesToChars[Gt],Wt),"")}function decode$c(Bt){const Wt=[];for(const Gt of Bt){const Yt=alphabetCharsToBytes[Gt.codePointAt(0)];if(Yt===void 0)throw new Error(`Non-base256emoji character: ${Gt}`);Wt.push(Yt)}return new Uint8Array(Wt)}const base256emoji=from$1({prefix:"🚀",name:"base256emoji",encode:encode$b,decode:decode$c}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"}));var encode_1$2=encode$a,MSB$2=128,REST$2=127,MSBALL$1=~REST$2,INT$1=Math.pow(2,31);function encode$a(Bt,Wt,Gt){Wt=Wt||[],Gt=Gt||0;for(var Yt=Gt;Bt>=INT$1;)Wt[Gt++]=Bt&255|MSB$2,Bt/=128;for(;Bt&MSBALL$1;)Wt[Gt++]=Bt&255|MSB$2,Bt>>>=7;return Wt[Gt]=Bt|0,encode$a.bytes=Gt-Yt+1,Wt}var decode$b=read$2,MSB$1$1=128,REST$1$1=127;function read$2(Bt,Yt){var Gt=0,Yt=Yt||0,Xt=0,Jt=Yt,Zt,Qt=Bt.length;do{if(Jt>=Qt)throw read$2.bytes=0,new RangeError("Could not decode varint");Zt=Bt[Jt++],Gt+=Xt<28?(Zt&REST$1$1)<<Xt:(Zt&REST$1$1)*Math.pow(2,Xt),Xt+=7}while(Zt>=MSB$1$1);return read$2.bytes=Jt-Yt,Gt}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$2=function(Bt){return Bt<N1$1?1:Bt<N2$1?2:Bt<N3$1?3:Bt<N4$1?4:Bt<N5$1?5:Bt<N6$1?6:Bt<N7$1?7:Bt<N8$1?8:Bt<N9$1?9:10},varint$4={encode:encode_1$2,decode:decode$b,encodingLength:length$2},_brrp_varint=varint$4;const decode$a=(Bt,Wt=0)=>[_brrp_varint.decode(Bt,Wt),_brrp_varint.decode.bytes],encodeTo=(Bt,Wt,Gt=0)=>(_brrp_varint.encode(Bt,Wt,Gt),Wt),encodingLength=Bt=>_brrp_varint.encodingLength(Bt),varint$3=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$a,encodeTo,encodingLength},Symbol.toStringTag,{value:"Module"})),create=(Bt,Wt)=>{const Gt=Wt.byteLength,Yt=encodingLength(Bt),Xt=Yt+encodingLength(Gt),Jt=new Uint8Array(Xt+Gt);return encodeTo(Bt,Jt,0),encodeTo(Gt,Jt,Yt),Jt.set(Wt,Xt),new Digest(Bt,Gt,Wt,Jt)},decode$9=Bt=>{const Wt=coerce(Bt),[Gt,Yt]=decode$a(Wt),[Xt,Jt]=decode$a(Wt.subarray(Yt)),Zt=Wt.subarray(Yt+Jt);if(Zt.byteLength!==Xt)throw new Error("Incorrect length");return new Digest(Gt,Xt,Zt,Wt)},equals$1=(Bt,Wt)=>Bt===Wt?!0:Bt.code===Wt.code&&Bt.size===Wt.size&&equals$2(Bt.bytes,Wt.bytes);class Digest{constructor(Wt,Gt,Yt,Xt){this.code=Wt,this.size=Gt,this.digest=Yt,this.bytes=Xt}}const digest$2=Object.freeze(Object.defineProperty({__proto__:null,Digest,create,decode:decode$9,equals:equals$1},Symbol.toStringTag,{value:"Module"})),from=({name:Bt,code:Wt,encode:Gt})=>new Hasher(Bt,Wt,Gt);class Hasher{constructor(Wt,Gt,Yt){this.name=Wt,this.code=Gt,this.encode=Yt}digest(Wt){if(Wt instanceof Uint8Array){const Gt=this.encode(Wt);return Gt instanceof Uint8Array?create(this.code,Gt):Gt.then(Yt=>create(this.code,Yt))}else throw Error("Unknown type, must be binary type")}}const hasher=Object.freeze(Object.defineProperty({__proto__:null,Hasher,from},Symbol.toStringTag,{value:"Module"})),sha$1=Bt=>async Wt=>new Uint8Array(await crypto.subtle.digest(Bt,Wt)),sha256$3=from({name:"sha2-256",code:18,encode:sha$1("SHA-256")}),sha512$2=from({name:"sha2-512",code:19,encode:sha$1("SHA-512")}),sha2=Object.freeze(Object.defineProperty({__proto__:null,sha256:sha256$3,sha512:sha512$2},Symbol.toStringTag,{value:"Module"})),code$2=0,name$4="identity",encode$9=coerce,digest$1=Bt=>create(code$2,encode$9(Bt)),identity$b={code:code$2,name:name$4,encode:encode$9,digest:digest$1},identity$c=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$b},Symbol.toStringTag,{value:"Module"})),name$3="raw",code$1=85,encode$8=Bt=>coerce(Bt),decode$8=Bt=>coerce(Bt),raw=Object.freeze(Object.defineProperty({__proto__:null,code:code$1,decode:decode$8,encode:encode$8,name:name$3},Symbol.toStringTag,{value:"Module"})),textEncoder$1=new TextEncoder,textDecoder$1=new TextDecoder,name$2="json",code=512,encode$7=Bt=>textEncoder$1.encode(JSON.stringify(Bt)),decode$7=Bt=>JSON.parse(textDecoder$1.decode(Bt)),json=Object.freeze(Object.defineProperty({__proto__:null,code,decode:decode$7,encode:encode$7,name:name$2},Symbol.toStringTag,{value:"Module"}));class CID{constructor(Wt,Gt,Yt,Xt){this.code=Gt,this.version=Wt,this.multihash=Yt,this.bytes=Xt,this.byteOffset=Xt.byteOffset,this.byteLength=Xt.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:hidden,byteLength:hidden,code:readonly,version:readonly,multihash:readonly,bytes:readonly,_baseCache:hidden,asCID:hidden})}toV0(){switch(this.version){case 0:return this;default:{const{code:Wt,multihash:Gt}=this;if(Wt!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Gt.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(Gt)}}}toV1(){switch(this.version){case 0:{const{code:Wt,digest:Gt}=this.multihash,Yt=create(Wt,Gt);return CID.createV1(this.code,Yt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(Wt){return Wt&&this.code===Wt.code&&this.version===Wt.version&&equals$1(this.multihash,Wt.multihash)}toString(Wt){const{bytes:Gt,version:Yt,_baseCache:Xt}=this;switch(Yt){case 0:return toStringV0(Gt,Xt,Wt||base58btc.encoder);default:return toStringV1(Gt,Xt,Wt||base32.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(Wt){return deprecate(/^0\.0/,IS_CID_DEPRECATION),!!(Wt&&(Wt[cidSymbol]||Wt.asCID===Wt))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(Wt){if(Wt instanceof CID)return Wt;if(Wt!=null&&Wt.asCID===Wt){const{version:Gt,code:Yt,multihash:Xt,bytes:Jt}=Wt;return new CID(Gt,Yt,Xt,Jt||encodeCID(Gt,Yt,Xt.bytes))}else if(Wt!=null&&Wt[cidSymbol]===!0){const{version:Gt,multihash:Yt,code:Xt}=Wt,Jt=decode$9(Yt);return CID.create(Gt,Xt,Jt)}else return null}static create(Wt,Gt,Yt){if(typeof Gt!="number")throw new Error("String codecs are no longer supported");switch(Wt){case 0:{if(Gt!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(Wt,Gt,Yt,Yt.bytes)}case 1:{const Xt=encodeCID(Wt,Gt,Yt.bytes);return new CID(Wt,Gt,Yt,Xt)}default:throw new Error("Invalid version")}}static createV0(Wt){return CID.create(0,DAG_PB_CODE,Wt)}static createV1(Wt,Gt){return CID.create(1,Wt,Gt)}static decode(Wt){const[Gt,Yt]=CID.decodeFirst(Wt);if(Yt.length)throw new Error("Incorrect length");return Gt}static decodeFirst(Wt){const Gt=CID.inspectBytes(Wt),Yt=Gt.size-Gt.multihashSize,Xt=coerce(Wt.subarray(Yt,Yt+Gt.multihashSize));if(Xt.byteLength!==Gt.multihashSize)throw new Error("Incorrect length");const Jt=Xt.subarray(Gt.multihashSize-Gt.digestSize),Zt=new Digest(Gt.multihashCode,Gt.digestSize,Jt,Xt);return[Gt.version===0?CID.createV0(Zt):CID.createV1(Gt.codec,Zt),Wt.subarray(Gt.size)]}static inspectBytes(Wt){let Gt=0;const Yt=()=>{const[Ar,Lr]=decode$a(Wt.subarray(Gt));return Gt+=Lr,Ar};let Xt=Yt(),Jt=DAG_PB_CODE;if(Xt===18?(Xt=0,Gt=0):Xt===1&&(Jt=Yt()),Xt!==0&&Xt!==1)throw new RangeError(`Invalid CID version ${Xt}`);const Zt=Gt,Qt=Yt(),ur=Yt(),cr=Gt+ur,$r=cr-Zt;return{version:Xt,codec:Jt,multihashCode:Qt,digestSize:ur,multihashSize:$r,size:cr}}static parse(Wt,Gt){const[Yt,Xt]=parseCIDtoBytes(Wt,Gt),Jt=CID.decode(Xt);return Jt._baseCache.set(Yt,Wt),Jt}}const parseCIDtoBytes=(Bt,Wt)=>{switch(Bt[0]){case"Q":{const Gt=Wt||base58btc;return[base58btc.prefix,Gt.decode(`${base58btc.prefix}${Bt}`)]}case base58btc.prefix:{const Gt=Wt||base58btc;return[base58btc.prefix,Gt.decode(Bt)]}case base32.prefix:{const Gt=Wt||base32;return[base32.prefix,Gt.decode(Bt)]}default:{if(Wt==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[Bt[0],Wt.decode(Bt)]}}},toStringV0=(Bt,Wt,Gt)=>{const{prefix:Yt}=Gt;if(Yt!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${Gt.name} encoding`);const Xt=Wt.get(Yt);if(Xt==null){const Jt=Gt.encode(Bt).slice(1);return Wt.set(Yt,Jt),Jt}else return Xt},toStringV1=(Bt,Wt,Gt)=>{const{prefix:Yt}=Gt,Xt=Wt.get(Yt);if(Xt==null){const Jt=Gt.encode(Bt);return Wt.set(Yt,Jt),Jt}else return Xt},DAG_PB_CODE=112,SHA_256_CODE=18,encodeCID=(Bt,Wt,Gt)=>{const Yt=encodingLength(Bt),Xt=Yt+encodingLength(Wt),Jt=new Uint8Array(Xt+Gt.byteLength);return encodeTo(Bt,Jt,0),encodeTo(Wt,Jt,Yt),Jt.set(Gt,Xt),Jt},cidSymbol=Symbol.for("@ipld/js-cid/CID"),readonly={writable:!1,configurable:!1,enumerable:!0},hidden={writable:!1,enumerable:!1,configurable:!1},version$w="0.0.0-dev",deprecate=(Bt,Wt)=>{if(Bt.test(version$w))console.warn(Wt);else throw new Error(Wt)},IS_CID_DEPRECATION=`CID.isCID(v) is deprecated and will be removed in the next major release.
712
+ `)},Wt.prototype.overrideMimeType=function(Gt){if(this.readyState===Wt.LOADING||this.readyState===Wt.DONE)throw new Wt.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=Gt.toLowerCase()},Wt.prototype.nodejsSet=function(Gt){if(this.nodejsHttpAgent=Gt.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=Gt.httpsAgent||this.nodejsHttpsAgent,Gt.hasOwnProperty("baseUrl")){if(Gt.baseUrl!=null){var Yt=url.parse(Gt.baseUrl,!1,!0);if(!Yt.protocol)throw new Wt.SyntaxError("baseUrl must be an absolute URL")}this.nodejsBaseUrl=Gt.baseUrl}},Wt.nodejsSet=function(Gt){Wt.prototype.nodejsSet(Gt)},Wt.prototype._setReadyState=function(Gt){this.readyState=Gt,this.dispatchEvent(new progress_event_1.ProgressEvent("readystatechange"))},Wt.prototype._sendFile=function(Gt){throw new Error("Protocol file: not implemented")},Wt.prototype._sendHttp=function(Gt){if(this._sync)throw new Error("Synchronous XHR processing not implemented");Gt&&(this._method==="GET"||this._method==="HEAD")?(console.warn("Discarding entity body for "+this._method+" requests"),Gt=null):Gt=Gt||"",this.upload._setData(Gt),this._finalizeHeaders(),this._sendHxxpRequest()},Wt.prototype._sendHxxpRequest=function(){var Gt=this;if(this.withCredentials){var Yt=Wt.cookieJar.getCookies(Cookie.CookieAccessInfo(this._url.hostname,this._url.pathname,this._url.protocol==="https:")).toValueString();this._headers.cookie=this._headers.cookie2=Yt}var Xt=this._url.protocol==="http:"?[http,this.nodejsHttpAgent]:[https,this.nodejsHttpsAgent],Jt=Xt[0],Zt=Xt[1],Qt=Jt.request.bind(Jt),ur=Qt({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:Zt});this._request=ur,this.timeout&&ur.setTimeout(this.timeout,function(){return Gt._onHttpTimeout(ur)}),ur.on("response",function(cr){return Gt._onHttpResponse(ur,cr)}),ur.on("error",function(cr){return Gt._onHttpRequestError(ur,cr)}),this.upload._startUpload(ur),this._request===ur&&this._dispatchProgress("loadstart")},Wt.prototype._finalizeHeaders=function(){this._headers=__assign$d({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},Wt.prototype._onHttpResponse=function(Gt,Yt){var Xt=this;if(this._request===Gt){if(this.withCredentials&&(Yt.headers["set-cookie"]||Yt.headers["set-cookie2"])&&Wt.cookieJar.setCookies(Yt.headers["set-cookie"]||Yt.headers["set-cookie2"]),[301,302,303,307,308].indexOf(Yt.statusCode)>=0){this._url=this._parseUrl(Yt.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),this._headers["Content-Type"]!=null&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),this._sendHxxpRequest();return}this._response=Yt,this._response.on("data",function(Zt){return Xt._onHttpResponseData(Yt,Zt)}),this._response.on("end",function(){return Xt._onHttpResponseEnd(Yt)}),this._response.on("close",function(){return Xt._onHttpResponseClose(Yt)}),this.responseUrl=this._url.href.split("#")[0],this.status=Yt.statusCode,this.statusText=http.STATUS_CODES[this.status],this._parseResponseHeaders(Yt);var Jt=this._responseHeaders["content-length"]||"";this._totalBytes=+Jt,this._lengthComputable=!!Jt,this._setReadyState(Wt.HEADERS_RECEIVED)}},Wt.prototype._onHttpResponseData=function(Gt,Yt){this._response===Gt&&(this._responseParts.push(new Buffer$g(Yt)),this._loadedBytes+=Yt.length,this.readyState!==Wt.LOADING&&this._setReadyState(Wt.LOADING),this._dispatchProgress("progress"))},Wt.prototype._onHttpResponseEnd=function(Gt){this._response===Gt&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(Wt.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},Wt.prototype._onHttpResponseClose=function(Gt){if(this._response===Gt){var Yt=this._request;this._setError(),Yt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},Wt.prototype._onHttpTimeout=function(Gt){this._request===Gt&&(this._setError(),Gt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},Wt.prototype._onHttpRequestError=function(Gt,Yt){this._request===Gt&&(this._setError(),Gt.abort(),this._setReadyState(Wt.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},Wt.prototype._dispatchProgress=function(Gt){var Yt=new Wt.ProgressEvent(Gt);Yt.lengthComputable=this._lengthComputable,Yt.loaded=this._loadedBytes,Yt.total=this._totalBytes,this.dispatchEvent(Yt)},Wt.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},Wt.prototype._parseUrl=function(Gt,Yt,Xt){var Jt=this.nodejsBaseUrl==null?Gt:url.resolve(this.nodejsBaseUrl,Gt),Zt=url.parse(Jt,!1,!0);Zt.hash=null;var Qt=(Zt.auth||"").split(":"),ur=Qt[0],cr=Qt[1];return(ur||cr||Yt||Xt)&&(Zt.auth=(Yt||ur||"")+":"+(Xt||cr||"")),Zt},Wt.prototype._parseResponseHeaders=function(Gt){this._responseHeaders={};for(var Yt in Gt.headers){var Xt=Yt.toLowerCase();this._privateHeaders[Xt]||(this._responseHeaders[Xt]=Gt.headers[Yt])}this._mimeOverride!=null&&(this._responseHeaders["content-type"]=this._mimeOverride)},Wt.prototype._parseResponse=function(){var Gt=Buffer$g.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(Gt.toString("utf-8"))}catch{this.response=null}return;case"buffer":this.responseText=null,this.response=Gt;return;case"arraybuffer":this.responseText=null;for(var Yt=new ArrayBuffer(Gt.length),Xt=new Uint8Array(Yt),Jt=0;Jt<Gt.length;Jt++)Xt[Jt]=Gt[Jt];this.response=Yt;return;case"text":default:try{this.responseText=Gt.toString(this._parseResponseEncoding())}catch{this.responseText=Gt.toString("binary")}this.response=this.responseText}},Wt.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},Wt.ProgressEvent=progress_event_1.ProgressEvent,Wt.InvalidStateError=errors_1.InvalidStateError,Wt.NetworkError=errors_1.NetworkError,Wt.SecurityError=errors_1.SecurityError,Wt.SyntaxError=errors_1.SyntaxError,Wt.XMLHttpRequestUpload=xml_http_request_upload_1.XMLHttpRequestUpload,Wt.UNSENT=0,Wt.OPENED=1,Wt.HEADERS_RECEIVED=2,Wt.LOADING=3,Wt.DONE=4,Wt.cookieJar=Cookie.CookieJar(),Wt}(xml_http_request_event_target_1.XMLHttpRequestEventTarget);xmlHttpRequest.XMLHttpRequest=XMLHttpRequest$1;XMLHttpRequest$1.prototype.nodejsHttpAgent=http.globalAgent;XMLHttpRequest$1.prototype.nodejsHttpsAgent=https.globalAgent;XMLHttpRequest$1.prototype.nodejsBaseUrl=null;(function(Bt){function Wt(Yt){for(var Xt in Yt)Bt.hasOwnProperty(Xt)||(Bt[Xt]=Yt[Xt])}Object.defineProperty(Bt,"__esModule",{value:!0}),Wt(xmlHttpRequest);var Gt=xmlHttpRequestEventTarget;Bt.XMLHttpRequestEventTarget=Gt.XMLHttpRequestEventTarget})(dist$g);var bn$2={exports:{}};bn$2.exports;(function(Bt){(function(Wt,Gt){function Yt(dn,Pr){if(!dn)throw new Error(Pr||"Assertion failed")}function Xt(dn,Pr){dn.super_=Pr;var xr=function(){};xr.prototype=Pr.prototype,dn.prototype=new xr,dn.prototype.constructor=dn}function Jt(dn,Pr,xr){if(Jt.isBN(dn))return dn;this.negative=0,this.words=null,this.length=0,this.red=null,dn!==null&&((Pr==="le"||Pr==="be")&&(xr=Pr,Pr=10),this._init(dn||0,Pr||10,xr||"be"))}typeof Wt=="object"?Wt.exports=Jt:Gt.BN=Jt,Jt.BN=Jt,Jt.wordSize=26;var Zt;try{Zt=require$$0$a.Buffer}catch{}Jt.isBN=function(Pr){return Pr instanceof Jt?!0:Pr!==null&&typeof Pr=="object"&&Pr.constructor.wordSize===Jt.wordSize&&Array.isArray(Pr.words)},Jt.max=function(Pr,xr){return Pr.cmp(xr)>0?Pr:xr},Jt.min=function(Pr,xr){return Pr.cmp(xr)<0?Pr:xr},Jt.prototype._init=function(Pr,xr,Mr){if(typeof Pr=="number")return this._initNumber(Pr,xr,Mr);if(typeof Pr=="object")return this._initArray(Pr,xr,Mr);xr==="hex"&&(xr=16),Yt(xr===(xr|0)&&xr>=2&&xr<=36),Pr=Pr.toString().replace(/\s+/g,"");var Nr=0;Pr[0]==="-"&&Nr++,xr===16?this._parseHex(Pr,Nr):this._parseBase(Pr,xr,Nr),Pr[0]==="-"&&(this.negative=1),this.strip(),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initNumber=function(Pr,xr,Mr){Pr<0&&(this.negative=1,Pr=-Pr),Pr<67108864?(this.words=[Pr&67108863],this.length=1):Pr<4503599627370496?(this.words=[Pr&67108863,Pr/67108864&67108863],this.length=2):(Yt(Pr<9007199254740992),this.words=[Pr&67108863,Pr/67108864&67108863,1],this.length=3),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initArray=function(Pr,xr,Mr){if(Yt(typeof Pr.length=="number"),Pr.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Pr.length/3),this.words=new Array(this.length);for(var Nr=0;Nr<this.length;Nr++)this.words[Nr]=0;var Ur,Vr,Zr=0;if(Mr==="be")for(Nr=Pr.length-1,Ur=0;Nr>=0;Nr-=3)Vr=Pr[Nr]|Pr[Nr-1]<<8|Pr[Nr-2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);else if(Mr==="le")for(Nr=0,Ur=0;Nr<Pr.length;Nr+=3)Vr=Pr[Nr]|Pr[Nr+1]<<8|Pr[Nr+2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);return this.strip()};function Qt(dn,Pr,xr){for(var Mr=0,Nr=Math.min(dn.length,xr),Ur=Pr;Ur<Nr;Ur++){var Vr=dn.charCodeAt(Ur)-48;Mr<<=4,Vr>=49&&Vr<=54?Mr|=Vr-49+10:Vr>=17&&Vr<=22?Mr|=Vr-17+10:Mr|=Vr&15}return Mr}Jt.prototype._parseHex=function(Pr,xr){this.length=Math.ceil((Pr.length-xr)/6),this.words=new Array(this.length);for(var Mr=0;Mr<this.length;Mr++)this.words[Mr]=0;var Nr,Ur,Vr=0;for(Mr=Pr.length-6,Nr=0;Mr>=xr;Mr-=6)Ur=Qt(Pr,Mr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303,Vr+=24,Vr>=26&&(Vr-=26,Nr++);Mr+6!==xr&&(Ur=Qt(Pr,xr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303),this.strip()};function ur(dn,Pr,xr,Mr){for(var Nr=0,Ur=Math.min(dn.length,xr),Vr=Pr;Vr<Ur;Vr++){var Zr=dn.charCodeAt(Vr)-48;Nr*=Mr,Zr>=49?Nr+=Zr-49+10:Zr>=17?Nr+=Zr-17+10:Nr+=Zr}return Nr}Jt.prototype._parseBase=function(Pr,xr,Mr){this.words=[0],this.length=1;for(var Nr=0,Ur=1;Ur<=67108863;Ur*=xr)Nr++;Nr--,Ur=Ur/xr|0;for(var Vr=Pr.length-Mr,Zr=Vr%Nr,Xr=Math.min(Vr,Vr-Zr)+Mr,Or=0,jr=Mr;jr<Xr;jr+=Nr)Or=ur(Pr,jr,jr+Nr,xr),this.imuln(Ur),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or);if(Zr!==0){var Jr=1;for(Or=ur(Pr,jr,Pr.length,xr),jr=0;jr<Zr;jr++)Jr*=xr;this.imuln(Jr),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or)}},Jt.prototype.copy=function(Pr){Pr.words=new Array(this.length);for(var xr=0;xr<this.length;xr++)Pr.words[xr]=this.words[xr];Pr.length=this.length,Pr.negative=this.negative,Pr.red=this.red},Jt.prototype.clone=function(){var Pr=new Jt(null);return this.copy(Pr),Pr},Jt.prototype._expand=function(Pr){for(;this.length<Pr;)this.words[this.length++]=0;return this},Jt.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Jt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Jt.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var cr=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],$r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ar=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Jt.prototype.toString=function(Pr,xr){Pr=Pr||10,xr=xr|0||1;var Mr;if(Pr===16||Pr==="hex"){Mr="";for(var Nr=0,Ur=0,Vr=0;Vr<this.length;Vr++){var Zr=this.words[Vr],Xr=((Zr<<Nr|Ur)&16777215).toString(16);Ur=Zr>>>24-Nr&16777215,Ur!==0||Vr!==this.length-1?Mr=cr[6-Xr.length]+Xr+Mr:Mr=Xr+Mr,Nr+=2,Nr>=26&&(Nr-=26,Vr--)}for(Ur!==0&&(Mr=Ur.toString(16)+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}if(Pr===(Pr|0)&&Pr>=2&&Pr<=36){var Or=$r[Pr],jr=Ar[Pr];Mr="";var Jr=this.clone();for(Jr.negative=0;!Jr.isZero();){var mn=Jr.modn(jr).toString(Pr);Jr=Jr.idivn(jr),Jr.isZero()?Mr=mn+Mr:Mr=cr[Or-mn.length]+mn+Mr}for(this.isZero()&&(Mr="0"+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}Yt(!1,"Base should be between 2 and 36")},Jt.prototype.toNumber=function(){var Pr=this.words[0];return this.length===2?Pr+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Pr+=4503599627370496+this.words[1]*67108864:this.length>2&&Yt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Pr:Pr},Jt.prototype.toJSON=function(){return this.toString(16)},Jt.prototype.toBuffer=function(Pr,xr){return Yt(typeof Zt<"u"),this.toArrayLike(Zt,Pr,xr)},Jt.prototype.toArray=function(Pr,xr){return this.toArrayLike(Array,Pr,xr)},Jt.prototype.toArrayLike=function(Pr,xr,Mr){var Nr=this.byteLength(),Ur=Mr||Math.max(1,Nr);Yt(Nr<=Ur,"byte array longer than desired length"),Yt(Ur>0,"Requested array length <= 0"),this.strip();var Vr=xr==="le",Zr=new Pr(Ur),Xr,Or,jr=this.clone();if(Vr){for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Or]=Xr;for(;Or<Ur;Or++)Zr[Or]=0}else{for(Or=0;Or<Ur-Nr;Or++)Zr[Or]=0;for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Ur-Or-1]=Xr}return Zr},Math.clz32?Jt.prototype._countBits=function(Pr){return 32-Math.clz32(Pr)}:Jt.prototype._countBits=function(Pr){var xr=Pr,Mr=0;return xr>=4096&&(Mr+=13,xr>>>=13),xr>=64&&(Mr+=7,xr>>>=7),xr>=8&&(Mr+=4,xr>>>=4),xr>=2&&(Mr+=2,xr>>>=2),Mr+xr},Jt.prototype._zeroBits=function(Pr){if(Pr===0)return 26;var xr=Pr,Mr=0;return xr&8191||(Mr+=13,xr>>>=13),xr&127||(Mr+=7,xr>>>=7),xr&15||(Mr+=4,xr>>>=4),xr&3||(Mr+=2,xr>>>=2),xr&1||Mr++,Mr},Jt.prototype.bitLength=function(){var Pr=this.words[this.length-1],xr=this._countBits(Pr);return(this.length-1)*26+xr};function Lr(dn){for(var Pr=new Array(dn.bitLength()),xr=0;xr<Pr.length;xr++){var Mr=xr/26|0,Nr=xr%26;Pr[xr]=(dn.words[Mr]&1<<Nr)>>>Nr}return Pr}Jt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Pr=0,xr=0;xr<this.length;xr++){var Mr=this._zeroBits(this.words[xr]);if(Pr+=Mr,Mr!==26)break}return Pr},Jt.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Jt.prototype.toTwos=function(Pr){return this.negative!==0?this.abs().inotn(Pr).iaddn(1):this.clone()},Jt.prototype.fromTwos=function(Pr){return this.testn(Pr-1)?this.notn(Pr).iaddn(1).ineg():this.clone()},Jt.prototype.isNeg=function(){return this.negative!==0},Jt.prototype.neg=function(){return this.clone().ineg()},Jt.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Jt.prototype.iuor=function(Pr){for(;this.length<Pr.length;)this.words[this.length++]=0;for(var xr=0;xr<Pr.length;xr++)this.words[xr]=this.words[xr]|Pr.words[xr];return this.strip()},Jt.prototype.ior=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuor(Pr)},Jt.prototype.or=function(Pr){return this.length>Pr.length?this.clone().ior(Pr):Pr.clone().ior(this)},Jt.prototype.uor=function(Pr){return this.length>Pr.length?this.clone().iuor(Pr):Pr.clone().iuor(this)},Jt.prototype.iuand=function(Pr){var xr;this.length>Pr.length?xr=Pr:xr=this;for(var Mr=0;Mr<xr.length;Mr++)this.words[Mr]=this.words[Mr]&Pr.words[Mr];return this.length=xr.length,this.strip()},Jt.prototype.iand=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuand(Pr)},Jt.prototype.and=function(Pr){return this.length>Pr.length?this.clone().iand(Pr):Pr.clone().iand(this)},Jt.prototype.uand=function(Pr){return this.length>Pr.length?this.clone().iuand(Pr):Pr.clone().iuand(this)},Jt.prototype.iuxor=function(Pr){var xr,Mr;this.length>Pr.length?(xr=this,Mr=Pr):(xr=Pr,Mr=this);for(var Nr=0;Nr<Mr.length;Nr++)this.words[Nr]=xr.words[Nr]^Mr.words[Nr];if(this!==xr)for(;Nr<xr.length;Nr++)this.words[Nr]=xr.words[Nr];return this.length=xr.length,this.strip()},Jt.prototype.ixor=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuxor(Pr)},Jt.prototype.xor=function(Pr){return this.length>Pr.length?this.clone().ixor(Pr):Pr.clone().ixor(this)},Jt.prototype.uxor=function(Pr){return this.length>Pr.length?this.clone().iuxor(Pr):Pr.clone().iuxor(this)},Jt.prototype.inotn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Math.ceil(Pr/26)|0,Mr=Pr%26;this._expand(xr),Mr>0&&xr--;for(var Nr=0;Nr<xr;Nr++)this.words[Nr]=~this.words[Nr]&67108863;return Mr>0&&(this.words[Nr]=~this.words[Nr]&67108863>>26-Mr),this.strip()},Jt.prototype.notn=function(Pr){return this.clone().inotn(Pr)},Jt.prototype.setn=function(Pr,xr){Yt(typeof Pr=="number"&&Pr>=0);var Mr=Pr/26|0,Nr=Pr%26;return this._expand(Mr+1),xr?this.words[Mr]=this.words[Mr]|1<<Nr:this.words[Mr]=this.words[Mr]&~(1<<Nr),this.strip()},Jt.prototype.iadd=function(Pr){var xr;if(this.negative!==0&&Pr.negative===0)return this.negative=0,xr=this.isub(Pr),this.negative^=1,this._normSign();if(this.negative===0&&Pr.negative!==0)return Pr.negative=0,xr=this.isub(Pr),Pr.negative=1,xr._normSign();var Mr,Nr;this.length>Pr.length?(Mr=this,Nr=Pr):(Mr=Pr,Nr=this);for(var Ur=0,Vr=0;Vr<Nr.length;Vr++)xr=(Mr.words[Vr]|0)+(Nr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;for(;Ur!==0&&Vr<Mr.length;Vr++)xr=(Mr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;if(this.length=Mr.length,Ur!==0)this.words[this.length]=Ur,this.length++;else if(Mr!==this)for(;Vr<Mr.length;Vr++)this.words[Vr]=Mr.words[Vr];return this},Jt.prototype.add=function(Pr){var xr;return Pr.negative!==0&&this.negative===0?(Pr.negative=0,xr=this.sub(Pr),Pr.negative^=1,xr):Pr.negative===0&&this.negative!==0?(this.negative=0,xr=Pr.sub(this),this.negative=1,xr):this.length>Pr.length?this.clone().iadd(Pr):Pr.clone().iadd(this)},Jt.prototype.isub=function(Pr){if(Pr.negative!==0){Pr.negative=0;var xr=this.iadd(Pr);return Pr.negative=1,xr._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Pr),this.negative=1,this._normSign();var Mr=this.cmp(Pr);if(Mr===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Nr,Ur;Mr>0?(Nr=this,Ur=Pr):(Nr=Pr,Ur=this);for(var Vr=0,Zr=0;Zr<Ur.length;Zr++)xr=(Nr.words[Zr]|0)-(Ur.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;for(;Vr!==0&&Zr<Nr.length;Zr++)xr=(Nr.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;if(Vr===0&&Zr<Nr.length&&Nr!==this)for(;Zr<Nr.length;Zr++)this.words[Zr]=Nr.words[Zr];return this.length=Math.max(this.length,Zr),Nr!==this&&(this.negative=1),this.strip()},Jt.prototype.sub=function(Pr){return this.clone().isub(Pr)};function qr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative;var Mr=dn.length+Pr.length|0;xr.length=Mr,Mr=Mr-1|0;var Nr=dn.words[0]|0,Ur=Pr.words[0]|0,Vr=Nr*Ur,Zr=Vr&67108863,Xr=Vr/67108864|0;xr.words[0]=Zr;for(var Or=1;Or<Mr;Or++){for(var jr=Xr>>>26,Jr=Xr&67108863,mn=Math.min(Or,Pr.length-1),gn=Math.max(0,Or-dn.length+1);gn<=mn;gn++){var eo=Or-gn|0;Nr=dn.words[eo]|0,Ur=Pr.words[gn]|0,Vr=Nr*Ur+Jr,jr+=Vr/67108864|0,Jr=Vr&67108863}xr.words[Or]=Jr|0,Xr=jr|0}return Xr!==0?xr.words[Or]=Xr|0:xr.length--,xr.strip()}var Fr=function(Pr,xr,Mr){var Nr=Pr.words,Ur=xr.words,Vr=Mr.words,Zr=0,Xr,Or,jr,Jr=Nr[0]|0,mn=Jr&8191,gn=Jr>>>13,eo=Nr[1]|0,_i=eo&8191,ro=eo>>>13,io=Nr[2]|0,ao=io&8191,oo=io>>>13,to=Nr[3]|0,so=to&8191,lo=to>>>13,Ro=Nr[4]|0,Io=Ro&8191,Fo=Ro>>>13,xo=Nr[5]|0,ho=xo&8191,po=xo>>>13,Ao=Nr[6]|0,Bo=Ao&8191,Mo=Ao>>>13,bo=Nr[7]|0,yo=bo&8191,Do=bo>>>13,Tu=Nr[8]|0,wu=Tu&8191,$o=Tu>>>13,mo=Nr[9]|0,_o=mo&8191,To=mo>>>13,iu=Ur[0]|0,nu=iu&8191,Jo=iu>>>13,cu=Ur[1]|0,au=cu&8191,tu=cu>>>13,Iu=Ur[2]|0,Ru=Iu&8191,$u=Iu>>>13,Yu=Ur[3]|0,qu=Yu&8191,fu=Yu>>>13,Xu=Ur[4]|0,Nu=Xu&8191,jo=Xu>>>13,qo=Ur[5]|0,Vo=qo&8191,zo=qo>>>13,Au=Ur[6]|0,_u=Au&8191,hu=Au>>>13,vu=Ur[7]|0,ju=vu&8191,Co=vu>>>13,Ho=Ur[8]|0,Ko=Ho&8191,Go=Ho>>>13,du=Ur[9]|0,Cu=du&8191,gu=du>>>13;Mr.negative=Pr.negative^xr.negative,Mr.length=19,Xr=Math.imul(mn,nu),Or=Math.imul(mn,Jo),Or=Or+Math.imul(gn,nu)|0,jr=Math.imul(gn,Jo);var el=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(el>>>26)|0,el&=67108863,Xr=Math.imul(_i,nu),Or=Math.imul(_i,Jo),Or=Or+Math.imul(ro,nu)|0,jr=Math.imul(ro,Jo),Xr=Xr+Math.imul(mn,au)|0,Or=Or+Math.imul(mn,tu)|0,Or=Or+Math.imul(gn,au)|0,jr=jr+Math.imul(gn,tu)|0;var wl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(wl>>>26)|0,wl&=67108863,Xr=Math.imul(ao,nu),Or=Math.imul(ao,Jo),Or=Or+Math.imul(oo,nu)|0,jr=Math.imul(oo,Jo),Xr=Xr+Math.imul(_i,au)|0,Or=Or+Math.imul(_i,tu)|0,Or=Or+Math.imul(ro,au)|0,jr=jr+Math.imul(ro,tu)|0,Xr=Xr+Math.imul(mn,Ru)|0,Or=Or+Math.imul(mn,$u)|0,Or=Or+Math.imul(gn,Ru)|0,jr=jr+Math.imul(gn,$u)|0;var Pl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Pl>>>26)|0,Pl&=67108863,Xr=Math.imul(so,nu),Or=Math.imul(so,Jo),Or=Or+Math.imul(lo,nu)|0,jr=Math.imul(lo,Jo),Xr=Xr+Math.imul(ao,au)|0,Or=Or+Math.imul(ao,tu)|0,Or=Or+Math.imul(oo,au)|0,jr=jr+Math.imul(oo,tu)|0,Xr=Xr+Math.imul(_i,Ru)|0,Or=Or+Math.imul(_i,$u)|0,Or=Or+Math.imul(ro,Ru)|0,jr=jr+Math.imul(ro,$u)|0,Xr=Xr+Math.imul(mn,qu)|0,Or=Or+Math.imul(mn,fu)|0,Or=Or+Math.imul(gn,qu)|0,jr=jr+Math.imul(gn,fu)|0;var kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(kl>>>26)|0,kl&=67108863,Xr=Math.imul(Io,nu),Or=Math.imul(Io,Jo),Or=Or+Math.imul(Fo,nu)|0,jr=Math.imul(Fo,Jo),Xr=Xr+Math.imul(so,au)|0,Or=Or+Math.imul(so,tu)|0,Or=Or+Math.imul(lo,au)|0,jr=jr+Math.imul(lo,tu)|0,Xr=Xr+Math.imul(ao,Ru)|0,Or=Or+Math.imul(ao,$u)|0,Or=Or+Math.imul(oo,Ru)|0,jr=jr+Math.imul(oo,$u)|0,Xr=Xr+Math.imul(_i,qu)|0,Or=Or+Math.imul(_i,fu)|0,Or=Or+Math.imul(ro,qu)|0,jr=jr+Math.imul(ro,fu)|0,Xr=Xr+Math.imul(mn,Nu)|0,Or=Or+Math.imul(mn,jo)|0,Or=Or+Math.imul(gn,Nu)|0,jr=jr+Math.imul(gn,jo)|0;var Ll=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,Xr=Math.imul(ho,nu),Or=Math.imul(ho,Jo),Or=Or+Math.imul(po,nu)|0,jr=Math.imul(po,Jo),Xr=Xr+Math.imul(Io,au)|0,Or=Or+Math.imul(Io,tu)|0,Or=Or+Math.imul(Fo,au)|0,jr=jr+Math.imul(Fo,tu)|0,Xr=Xr+Math.imul(so,Ru)|0,Or=Or+Math.imul(so,$u)|0,Or=Or+Math.imul(lo,Ru)|0,jr=jr+Math.imul(lo,$u)|0,Xr=Xr+Math.imul(ao,qu)|0,Or=Or+Math.imul(ao,fu)|0,Or=Or+Math.imul(oo,qu)|0,jr=jr+Math.imul(oo,fu)|0,Xr=Xr+Math.imul(_i,Nu)|0,Or=Or+Math.imul(_i,jo)|0,Or=Or+Math.imul(ro,Nu)|0,jr=jr+Math.imul(ro,jo)|0,Xr=Xr+Math.imul(mn,Vo)|0,Or=Or+Math.imul(mn,zo)|0,Or=Or+Math.imul(gn,Vo)|0,jr=jr+Math.imul(gn,zo)|0;var Hl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Hl>>>26)|0,Hl&=67108863,Xr=Math.imul(Bo,nu),Or=Math.imul(Bo,Jo),Or=Or+Math.imul(Mo,nu)|0,jr=Math.imul(Mo,Jo),Xr=Xr+Math.imul(ho,au)|0,Or=Or+Math.imul(ho,tu)|0,Or=Or+Math.imul(po,au)|0,jr=jr+Math.imul(po,tu)|0,Xr=Xr+Math.imul(Io,Ru)|0,Or=Or+Math.imul(Io,$u)|0,Or=Or+Math.imul(Fo,Ru)|0,jr=jr+Math.imul(Fo,$u)|0,Xr=Xr+Math.imul(so,qu)|0,Or=Or+Math.imul(so,fu)|0,Or=Or+Math.imul(lo,qu)|0,jr=jr+Math.imul(lo,fu)|0,Xr=Xr+Math.imul(ao,Nu)|0,Or=Or+Math.imul(ao,jo)|0,Or=Or+Math.imul(oo,Nu)|0,jr=jr+Math.imul(oo,jo)|0,Xr=Xr+Math.imul(_i,Vo)|0,Or=Or+Math.imul(_i,zo)|0,Or=Or+Math.imul(ro,Vo)|0,jr=jr+Math.imul(ro,zo)|0,Xr=Xr+Math.imul(mn,_u)|0,Or=Or+Math.imul(mn,hu)|0,Or=Or+Math.imul(gn,_u)|0,jr=jr+Math.imul(gn,hu)|0;var Nl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,Xr=Math.imul(yo,nu),Or=Math.imul(yo,Jo),Or=Or+Math.imul(Do,nu)|0,jr=Math.imul(Do,Jo),Xr=Xr+Math.imul(Bo,au)|0,Or=Or+Math.imul(Bo,tu)|0,Or=Or+Math.imul(Mo,au)|0,jr=jr+Math.imul(Mo,tu)|0,Xr=Xr+Math.imul(ho,Ru)|0,Or=Or+Math.imul(ho,$u)|0,Or=Or+Math.imul(po,Ru)|0,jr=jr+Math.imul(po,$u)|0,Xr=Xr+Math.imul(Io,qu)|0,Or=Or+Math.imul(Io,fu)|0,Or=Or+Math.imul(Fo,qu)|0,jr=jr+Math.imul(Fo,fu)|0,Xr=Xr+Math.imul(so,Nu)|0,Or=Or+Math.imul(so,jo)|0,Or=Or+Math.imul(lo,Nu)|0,jr=jr+Math.imul(lo,jo)|0,Xr=Xr+Math.imul(ao,Vo)|0,Or=Or+Math.imul(ao,zo)|0,Or=Or+Math.imul(oo,Vo)|0,jr=jr+Math.imul(oo,zo)|0,Xr=Xr+Math.imul(_i,_u)|0,Or=Or+Math.imul(_i,hu)|0,Or=Or+Math.imul(ro,_u)|0,jr=jr+Math.imul(ro,hu)|0,Xr=Xr+Math.imul(mn,ju)|0,Or=Or+Math.imul(mn,Co)|0,Or=Or+Math.imul(gn,ju)|0,jr=jr+Math.imul(gn,Co)|0;var Dl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Dl>>>26)|0,Dl&=67108863,Xr=Math.imul(wu,nu),Or=Math.imul(wu,Jo),Or=Or+Math.imul($o,nu)|0,jr=Math.imul($o,Jo),Xr=Xr+Math.imul(yo,au)|0,Or=Or+Math.imul(yo,tu)|0,Or=Or+Math.imul(Do,au)|0,jr=jr+Math.imul(Do,tu)|0,Xr=Xr+Math.imul(Bo,Ru)|0,Or=Or+Math.imul(Bo,$u)|0,Or=Or+Math.imul(Mo,Ru)|0,jr=jr+Math.imul(Mo,$u)|0,Xr=Xr+Math.imul(ho,qu)|0,Or=Or+Math.imul(ho,fu)|0,Or=Or+Math.imul(po,qu)|0,jr=jr+Math.imul(po,fu)|0,Xr=Xr+Math.imul(Io,Nu)|0,Or=Or+Math.imul(Io,jo)|0,Or=Or+Math.imul(Fo,Nu)|0,jr=jr+Math.imul(Fo,jo)|0,Xr=Xr+Math.imul(so,Vo)|0,Or=Or+Math.imul(so,zo)|0,Or=Or+Math.imul(lo,Vo)|0,jr=jr+Math.imul(lo,zo)|0,Xr=Xr+Math.imul(ao,_u)|0,Or=Or+Math.imul(ao,hu)|0,Or=Or+Math.imul(oo,_u)|0,jr=jr+Math.imul(oo,hu)|0,Xr=Xr+Math.imul(_i,ju)|0,Or=Or+Math.imul(_i,Co)|0,Or=Or+Math.imul(ro,ju)|0,jr=jr+Math.imul(ro,Co)|0,Xr=Xr+Math.imul(mn,Ko)|0,Or=Or+Math.imul(mn,Go)|0,Or=Or+Math.imul(gn,Ko)|0,jr=jr+Math.imul(gn,Go)|0;var Ju=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,Xr=Math.imul(_o,nu),Or=Math.imul(_o,Jo),Or=Or+Math.imul(To,nu)|0,jr=Math.imul(To,Jo),Xr=Xr+Math.imul(wu,au)|0,Or=Or+Math.imul(wu,tu)|0,Or=Or+Math.imul($o,au)|0,jr=jr+Math.imul($o,tu)|0,Xr=Xr+Math.imul(yo,Ru)|0,Or=Or+Math.imul(yo,$u)|0,Or=Or+Math.imul(Do,Ru)|0,jr=jr+Math.imul(Do,$u)|0,Xr=Xr+Math.imul(Bo,qu)|0,Or=Or+Math.imul(Bo,fu)|0,Or=Or+Math.imul(Mo,qu)|0,jr=jr+Math.imul(Mo,fu)|0,Xr=Xr+Math.imul(ho,Nu)|0,Or=Or+Math.imul(ho,jo)|0,Or=Or+Math.imul(po,Nu)|0,jr=jr+Math.imul(po,jo)|0,Xr=Xr+Math.imul(Io,Vo)|0,Or=Or+Math.imul(Io,zo)|0,Or=Or+Math.imul(Fo,Vo)|0,jr=jr+Math.imul(Fo,zo)|0,Xr=Xr+Math.imul(so,_u)|0,Or=Or+Math.imul(so,hu)|0,Or=Or+Math.imul(lo,_u)|0,jr=jr+Math.imul(lo,hu)|0,Xr=Xr+Math.imul(ao,ju)|0,Or=Or+Math.imul(ao,Co)|0,Or=Or+Math.imul(oo,ju)|0,jr=jr+Math.imul(oo,Co)|0,Xr=Xr+Math.imul(_i,Ko)|0,Or=Or+Math.imul(_i,Go)|0,Or=Or+Math.imul(ro,Ko)|0,jr=jr+Math.imul(ro,Go)|0,Xr=Xr+Math.imul(mn,Cu)|0,Or=Or+Math.imul(mn,gu)|0,Or=Or+Math.imul(gn,Cu)|0,jr=jr+Math.imul(gn,gu)|0;var Kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Kl>>>26)|0,Kl&=67108863,Xr=Math.imul(_o,au),Or=Math.imul(_o,tu),Or=Or+Math.imul(To,au)|0,jr=Math.imul(To,tu),Xr=Xr+Math.imul(wu,Ru)|0,Or=Or+Math.imul(wu,$u)|0,Or=Or+Math.imul($o,Ru)|0,jr=jr+Math.imul($o,$u)|0,Xr=Xr+Math.imul(yo,qu)|0,Or=Or+Math.imul(yo,fu)|0,Or=Or+Math.imul(Do,qu)|0,jr=jr+Math.imul(Do,fu)|0,Xr=Xr+Math.imul(Bo,Nu)|0,Or=Or+Math.imul(Bo,jo)|0,Or=Or+Math.imul(Mo,Nu)|0,jr=jr+Math.imul(Mo,jo)|0,Xr=Xr+Math.imul(ho,Vo)|0,Or=Or+Math.imul(ho,zo)|0,Or=Or+Math.imul(po,Vo)|0,jr=jr+Math.imul(po,zo)|0,Xr=Xr+Math.imul(Io,_u)|0,Or=Or+Math.imul(Io,hu)|0,Or=Or+Math.imul(Fo,_u)|0,jr=jr+Math.imul(Fo,hu)|0,Xr=Xr+Math.imul(so,ju)|0,Or=Or+Math.imul(so,Co)|0,Or=Or+Math.imul(lo,ju)|0,jr=jr+Math.imul(lo,Co)|0,Xr=Xr+Math.imul(ao,Ko)|0,Or=Or+Math.imul(ao,Go)|0,Or=Or+Math.imul(oo,Ko)|0,jr=jr+Math.imul(oo,Go)|0,Xr=Xr+Math.imul(_i,Cu)|0,Or=Or+Math.imul(_i,gu)|0,Or=Or+Math.imul(ro,Cu)|0,jr=jr+Math.imul(ro,gu)|0;var ep=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ep>>>26)|0,ep&=67108863,Xr=Math.imul(_o,Ru),Or=Math.imul(_o,$u),Or=Or+Math.imul(To,Ru)|0,jr=Math.imul(To,$u),Xr=Xr+Math.imul(wu,qu)|0,Or=Or+Math.imul(wu,fu)|0,Or=Or+Math.imul($o,qu)|0,jr=jr+Math.imul($o,fu)|0,Xr=Xr+Math.imul(yo,Nu)|0,Or=Or+Math.imul(yo,jo)|0,Or=Or+Math.imul(Do,Nu)|0,jr=jr+Math.imul(Do,jo)|0,Xr=Xr+Math.imul(Bo,Vo)|0,Or=Or+Math.imul(Bo,zo)|0,Or=Or+Math.imul(Mo,Vo)|0,jr=jr+Math.imul(Mo,zo)|0,Xr=Xr+Math.imul(ho,_u)|0,Or=Or+Math.imul(ho,hu)|0,Or=Or+Math.imul(po,_u)|0,jr=jr+Math.imul(po,hu)|0,Xr=Xr+Math.imul(Io,ju)|0,Or=Or+Math.imul(Io,Co)|0,Or=Or+Math.imul(Fo,ju)|0,jr=jr+Math.imul(Fo,Co)|0,Xr=Xr+Math.imul(so,Ko)|0,Or=Or+Math.imul(so,Go)|0,Or=Or+Math.imul(lo,Ko)|0,jr=jr+Math.imul(lo,Go)|0,Xr=Xr+Math.imul(ao,Cu)|0,Or=Or+Math.imul(ao,gu)|0,Or=Or+Math.imul(oo,Cu)|0,jr=jr+Math.imul(oo,gu)|0;var ap=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ap>>>26)|0,ap&=67108863,Xr=Math.imul(_o,qu),Or=Math.imul(_o,fu),Or=Or+Math.imul(To,qu)|0,jr=Math.imul(To,fu),Xr=Xr+Math.imul(wu,Nu)|0,Or=Or+Math.imul(wu,jo)|0,Or=Or+Math.imul($o,Nu)|0,jr=jr+Math.imul($o,jo)|0,Xr=Xr+Math.imul(yo,Vo)|0,Or=Or+Math.imul(yo,zo)|0,Or=Or+Math.imul(Do,Vo)|0,jr=jr+Math.imul(Do,zo)|0,Xr=Xr+Math.imul(Bo,_u)|0,Or=Or+Math.imul(Bo,hu)|0,Or=Or+Math.imul(Mo,_u)|0,jr=jr+Math.imul(Mo,hu)|0,Xr=Xr+Math.imul(ho,ju)|0,Or=Or+Math.imul(ho,Co)|0,Or=Or+Math.imul(po,ju)|0,jr=jr+Math.imul(po,Co)|0,Xr=Xr+Math.imul(Io,Ko)|0,Or=Or+Math.imul(Io,Go)|0,Or=Or+Math.imul(Fo,Ko)|0,jr=jr+Math.imul(Fo,Go)|0,Xr=Xr+Math.imul(so,Cu)|0,Or=Or+Math.imul(so,gu)|0,Or=Or+Math.imul(lo,Cu)|0,jr=jr+Math.imul(lo,gu)|0;var fp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(fp>>>26)|0,fp&=67108863,Xr=Math.imul(_o,Nu),Or=Math.imul(_o,jo),Or=Or+Math.imul(To,Nu)|0,jr=Math.imul(To,jo),Xr=Xr+Math.imul(wu,Vo)|0,Or=Or+Math.imul(wu,zo)|0,Or=Or+Math.imul($o,Vo)|0,jr=jr+Math.imul($o,zo)|0,Xr=Xr+Math.imul(yo,_u)|0,Or=Or+Math.imul(yo,hu)|0,Or=Or+Math.imul(Do,_u)|0,jr=jr+Math.imul(Do,hu)|0,Xr=Xr+Math.imul(Bo,ju)|0,Or=Or+Math.imul(Bo,Co)|0,Or=Or+Math.imul(Mo,ju)|0,jr=jr+Math.imul(Mo,Co)|0,Xr=Xr+Math.imul(ho,Ko)|0,Or=Or+Math.imul(ho,Go)|0,Or=Or+Math.imul(po,Ko)|0,jr=jr+Math.imul(po,Go)|0,Xr=Xr+Math.imul(Io,Cu)|0,Or=Or+Math.imul(Io,gu)|0,Or=Or+Math.imul(Fo,Cu)|0,jr=jr+Math.imul(Fo,gu)|0;var _f=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(_f>>>26)|0,_f&=67108863,Xr=Math.imul(_o,Vo),Or=Math.imul(_o,zo),Or=Or+Math.imul(To,Vo)|0,jr=Math.imul(To,zo),Xr=Xr+Math.imul(wu,_u)|0,Or=Or+Math.imul(wu,hu)|0,Or=Or+Math.imul($o,_u)|0,jr=jr+Math.imul($o,hu)|0,Xr=Xr+Math.imul(yo,ju)|0,Or=Or+Math.imul(yo,Co)|0,Or=Or+Math.imul(Do,ju)|0,jr=jr+Math.imul(Do,Co)|0,Xr=Xr+Math.imul(Bo,Ko)|0,Or=Or+Math.imul(Bo,Go)|0,Or=Or+Math.imul(Mo,Ko)|0,jr=jr+Math.imul(Mo,Go)|0,Xr=Xr+Math.imul(ho,Cu)|0,Or=Or+Math.imul(ho,gu)|0,Or=Or+Math.imul(po,Cu)|0,jr=jr+Math.imul(po,gu)|0;var rp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(rp>>>26)|0,rp&=67108863,Xr=Math.imul(_o,_u),Or=Math.imul(_o,hu),Or=Or+Math.imul(To,_u)|0,jr=Math.imul(To,hu),Xr=Xr+Math.imul(wu,ju)|0,Or=Or+Math.imul(wu,Co)|0,Or=Or+Math.imul($o,ju)|0,jr=jr+Math.imul($o,Co)|0,Xr=Xr+Math.imul(yo,Ko)|0,Or=Or+Math.imul(yo,Go)|0,Or=Or+Math.imul(Do,Ko)|0,jr=jr+Math.imul(Do,Go)|0,Xr=Xr+Math.imul(Bo,Cu)|0,Or=Or+Math.imul(Bo,gu)|0,Or=Or+Math.imul(Mo,Cu)|0,jr=jr+Math.imul(Mo,gu)|0;var dp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(dp>>>26)|0,dp&=67108863,Xr=Math.imul(_o,ju),Or=Math.imul(_o,Co),Or=Or+Math.imul(To,ju)|0,jr=Math.imul(To,Co),Xr=Xr+Math.imul(wu,Ko)|0,Or=Or+Math.imul(wu,Go)|0,Or=Or+Math.imul($o,Ko)|0,jr=jr+Math.imul($o,Go)|0,Xr=Xr+Math.imul(yo,Cu)|0,Or=Or+Math.imul(yo,gu)|0,Or=Or+Math.imul(Do,Cu)|0,jr=jr+Math.imul(Do,gu)|0;var np=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(np>>>26)|0,np&=67108863,Xr=Math.imul(_o,Ko),Or=Math.imul(_o,Go),Or=Or+Math.imul(To,Ko)|0,jr=Math.imul(To,Go),Xr=Xr+Math.imul(wu,Cu)|0,Or=Or+Math.imul(wu,gu)|0,Or=Or+Math.imul($o,Cu)|0,jr=jr+Math.imul($o,gu)|0;var Jl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Jl>>>26)|0,Jl&=67108863,Xr=Math.imul(_o,Cu),Or=Math.imul(_o,gu),Or=Or+Math.imul(To,Cu)|0,jr=Math.imul(To,gu);var mp=(Zr+Xr|0)+((Or&8191)<<13)|0;return Zr=(jr+(Or>>>13)|0)+(mp>>>26)|0,mp&=67108863,Vr[0]=el,Vr[1]=wl,Vr[2]=Pl,Vr[3]=kl,Vr[4]=Ll,Vr[5]=Hl,Vr[6]=Nl,Vr[7]=Dl,Vr[8]=Ju,Vr[9]=Kl,Vr[10]=ep,Vr[11]=ap,Vr[12]=fp,Vr[13]=_f,Vr[14]=rp,Vr[15]=dp,Vr[16]=np,Vr[17]=Jl,Vr[18]=mp,Zr!==0&&(Vr[19]=Zr,Mr.length++),Mr};Math.imul||(Fr=qr);function Hr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative,xr.length=dn.length+Pr.length;for(var Mr=0,Nr=0,Ur=0;Ur<xr.length-1;Ur++){var Vr=Nr;Nr=0;for(var Zr=Mr&67108863,Xr=Math.min(Ur,Pr.length-1),Or=Math.max(0,Ur-dn.length+1);Or<=Xr;Or++){var jr=Ur-Or,Jr=dn.words[jr]|0,mn=Pr.words[Or]|0,gn=Jr*mn,eo=gn&67108863;Vr=Vr+(gn/67108864|0)|0,eo=eo+Zr|0,Zr=eo&67108863,Vr=Vr+(eo>>>26)|0,Nr+=Vr>>>26,Vr&=67108863}xr.words[Ur]=Zr,Mr=Vr,Vr=Nr}return Mr!==0?xr.words[Ur]=Mr:xr.length--,xr.strip()}function Br(dn,Pr,xr){var Mr=new Wr;return Mr.mulp(dn,Pr,xr)}Jt.prototype.mulTo=function(Pr,xr){var Mr,Nr=this.length+Pr.length;return this.length===10&&Pr.length===10?Mr=Fr(this,Pr,xr):Nr<63?Mr=qr(this,Pr,xr):Nr<1024?Mr=Hr(this,Pr,xr):Mr=Br(this,Pr,xr),Mr};function Wr(dn,Pr){this.x=dn,this.y=Pr}Wr.prototype.makeRBT=function(Pr){for(var xr=new Array(Pr),Mr=Jt.prototype._countBits(Pr)-1,Nr=0;Nr<Pr;Nr++)xr[Nr]=this.revBin(Nr,Mr,Pr);return xr},Wr.prototype.revBin=function(Pr,xr,Mr){if(Pr===0||Pr===Mr-1)return Pr;for(var Nr=0,Ur=0;Ur<xr;Ur++)Nr|=(Pr&1)<<xr-Ur-1,Pr>>=1;return Nr},Wr.prototype.permute=function(Pr,xr,Mr,Nr,Ur,Vr){for(var Zr=0;Zr<Vr;Zr++)Nr[Zr]=xr[Pr[Zr]],Ur[Zr]=Mr[Pr[Zr]]},Wr.prototype.transform=function(Pr,xr,Mr,Nr,Ur,Vr){this.permute(Vr,Pr,xr,Mr,Nr,Ur);for(var Zr=1;Zr<Ur;Zr<<=1)for(var Xr=Zr<<1,Or=Math.cos(2*Math.PI/Xr),jr=Math.sin(2*Math.PI/Xr),Jr=0;Jr<Ur;Jr+=Xr)for(var mn=Or,gn=jr,eo=0;eo<Zr;eo++){var _i=Mr[Jr+eo],ro=Nr[Jr+eo],io=Mr[Jr+eo+Zr],ao=Nr[Jr+eo+Zr],oo=mn*io-gn*ao;ao=mn*ao+gn*io,io=oo,Mr[Jr+eo]=_i+io,Nr[Jr+eo]=ro+ao,Mr[Jr+eo+Zr]=_i-io,Nr[Jr+eo+Zr]=ro-ao,eo!==Xr&&(oo=Or*mn-jr*gn,gn=Or*gn+jr*mn,mn=oo)}},Wr.prototype.guessLen13b=function(Pr,xr){var Mr=Math.max(xr,Pr)|1,Nr=Mr&1,Ur=0;for(Mr=Mr/2|0;Mr;Mr=Mr>>>1)Ur++;return 1<<Ur+1+Nr},Wr.prototype.conjugate=function(Pr,xr,Mr){if(!(Mr<=1))for(var Nr=0;Nr<Mr/2;Nr++){var Ur=Pr[Nr];Pr[Nr]=Pr[Mr-Nr-1],Pr[Mr-Nr-1]=Ur,Ur=xr[Nr],xr[Nr]=-xr[Mr-Nr-1],xr[Mr-Nr-1]=-Ur}},Wr.prototype.normalize13b=function(Pr,xr){for(var Mr=0,Nr=0;Nr<xr/2;Nr++){var Ur=Math.round(Pr[2*Nr+1]/xr)*8192+Math.round(Pr[2*Nr]/xr)+Mr;Pr[Nr]=Ur&67108863,Ur<67108864?Mr=0:Mr=Ur/67108864|0}return Pr},Wr.prototype.convert13b=function(Pr,xr,Mr,Nr){for(var Ur=0,Vr=0;Vr<xr;Vr++)Ur=Ur+(Pr[Vr]|0),Mr[2*Vr]=Ur&8191,Ur=Ur>>>13,Mr[2*Vr+1]=Ur&8191,Ur=Ur>>>13;for(Vr=2*xr;Vr<Nr;++Vr)Mr[Vr]=0;Yt(Ur===0),Yt((Ur&-8192)===0)},Wr.prototype.stub=function(Pr){for(var xr=new Array(Pr),Mr=0;Mr<Pr;Mr++)xr[Mr]=0;return xr},Wr.prototype.mulp=function(Pr,xr,Mr){var Nr=2*this.guessLen13b(Pr.length,xr.length),Ur=this.makeRBT(Nr),Vr=this.stub(Nr),Zr=new Array(Nr),Xr=new Array(Nr),Or=new Array(Nr),jr=new Array(Nr),Jr=new Array(Nr),mn=new Array(Nr),gn=Mr.words;gn.length=Nr,this.convert13b(Pr.words,Pr.length,Zr,Nr),this.convert13b(xr.words,xr.length,jr,Nr),this.transform(Zr,Vr,Xr,Or,Nr,Ur),this.transform(jr,Vr,Jr,mn,Nr,Ur);for(var eo=0;eo<Nr;eo++){var _i=Xr[eo]*Jr[eo]-Or[eo]*mn[eo];Or[eo]=Xr[eo]*mn[eo]+Or[eo]*Jr[eo],Xr[eo]=_i}return this.conjugate(Xr,Or,Nr),this.transform(Xr,Or,gn,Vr,Nr,Ur),this.conjugate(gn,Vr,Nr),this.normalize13b(gn,Nr),Mr.negative=Pr.negative^xr.negative,Mr.length=Pr.length+xr.length,Mr.strip()},Jt.prototype.mul=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),this.mulTo(Pr,xr)},Jt.prototype.mulf=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),Br(this,Pr,xr)},Jt.prototype.imul=function(Pr){return this.clone().mulTo(Pr,this)},Jt.prototype.imuln=function(Pr){Yt(typeof Pr=="number"),Yt(Pr<67108864);for(var xr=0,Mr=0;Mr<this.length;Mr++){var Nr=(this.words[Mr]|0)*Pr,Ur=(Nr&67108863)+(xr&67108863);xr>>=26,xr+=Nr/67108864|0,xr+=Ur>>>26,this.words[Mr]=Ur&67108863}return xr!==0&&(this.words[Mr]=xr,this.length++),this},Jt.prototype.muln=function(Pr){return this.clone().imuln(Pr)},Jt.prototype.sqr=function(){return this.mul(this)},Jt.prototype.isqr=function(){return this.imul(this.clone())},Jt.prototype.pow=function(Pr){var xr=Lr(Pr);if(xr.length===0)return new Jt(1);for(var Mr=this,Nr=0;Nr<xr.length&&xr[Nr]===0;Nr++,Mr=Mr.sqr());if(++Nr<xr.length)for(var Ur=Mr.sqr();Nr<xr.length;Nr++,Ur=Ur.sqr())xr[Nr]!==0&&(Mr=Mr.mul(Ur));return Mr},Jt.prototype.iushln=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=67108863>>>26-xr<<26-xr,Ur;if(xr!==0){var Vr=0;for(Ur=0;Ur<this.length;Ur++){var Zr=this.words[Ur]&Nr,Xr=(this.words[Ur]|0)-Zr<<xr;this.words[Ur]=Xr|Vr,Vr=Zr>>>26-xr}Vr&&(this.words[Ur]=Vr,this.length++)}if(Mr!==0){for(Ur=this.length-1;Ur>=0;Ur--)this.words[Ur+Mr]=this.words[Ur];for(Ur=0;Ur<Mr;Ur++)this.words[Ur]=0;this.length+=Mr}return this.strip()},Jt.prototype.ishln=function(Pr){return Yt(this.negative===0),this.iushln(Pr)},Jt.prototype.iushrn=function(Pr,xr,Mr){Yt(typeof Pr=="number"&&Pr>=0);var Nr;xr?Nr=(xr-xr%26)/26:Nr=0;var Ur=Pr%26,Vr=Math.min((Pr-Ur)/26,this.length),Zr=67108863^67108863>>>Ur<<Ur,Xr=Mr;if(Nr-=Vr,Nr=Math.max(0,Nr),Xr){for(var Or=0;Or<Vr;Or++)Xr.words[Or]=this.words[Or];Xr.length=Vr}if(Vr!==0)if(this.length>Vr)for(this.length-=Vr,Or=0;Or<this.length;Or++)this.words[Or]=this.words[Or+Vr];else this.words[0]=0,this.length=1;var jr=0;for(Or=this.length-1;Or>=0&&(jr!==0||Or>=Nr);Or--){var Jr=this.words[Or]|0;this.words[Or]=jr<<26-Ur|Jr>>>Ur,jr=Jr&Zr}return Xr&&jr!==0&&(Xr.words[Xr.length++]=jr),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Jt.prototype.ishrn=function(Pr,xr,Mr){return Yt(this.negative===0),this.iushrn(Pr,xr,Mr)},Jt.prototype.shln=function(Pr){return this.clone().ishln(Pr)},Jt.prototype.ushln=function(Pr){return this.clone().iushln(Pr)},Jt.prototype.shrn=function(Pr){return this.clone().ishrn(Pr)},Jt.prototype.ushrn=function(Pr){return this.clone().iushrn(Pr)},Jt.prototype.testn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return!1;var Ur=this.words[Mr];return!!(Ur&Nr)},Jt.prototype.imaskn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26;if(Yt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Mr)return this;if(xr!==0&&Mr++,this.length=Math.min(Mr,this.length),xr!==0){var Nr=67108863^67108863>>>xr<<xr;this.words[this.length-1]&=Nr}return this.strip()},Jt.prototype.maskn=function(Pr){return this.clone().imaskn(Pr)},Jt.prototype.iaddn=function(Pr){return Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0?this.isubn(-Pr):this.negative!==0?this.length===1&&(this.words[0]|0)<Pr?(this.words[0]=Pr-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Pr),this.negative=1,this):this._iaddn(Pr)},Jt.prototype._iaddn=function(Pr){this.words[0]+=Pr;for(var xr=0;xr<this.length&&this.words[xr]>=67108864;xr++)this.words[xr]-=67108864,xr===this.length-1?this.words[xr+1]=1:this.words[xr+1]++;return this.length=Math.max(this.length,xr+1),this},Jt.prototype.isubn=function(Pr){if(Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0)return this.iaddn(-Pr);if(this.negative!==0)return this.negative=0,this.iaddn(Pr),this.negative=1,this;if(this.words[0]-=Pr,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xr=0;xr<this.length&&this.words[xr]<0;xr++)this.words[xr]+=67108864,this.words[xr+1]-=1;return this.strip()},Jt.prototype.addn=function(Pr){return this.clone().iaddn(Pr)},Jt.prototype.subn=function(Pr){return this.clone().isubn(Pr)},Jt.prototype.iabs=function(){return this.negative=0,this},Jt.prototype.abs=function(){return this.clone().iabs()},Jt.prototype._ishlnsubmul=function(Pr,xr,Mr){var Nr=Pr.length+Mr,Ur;this._expand(Nr);var Vr,Zr=0;for(Ur=0;Ur<Pr.length;Ur++){Vr=(this.words[Ur+Mr]|0)+Zr;var Xr=(Pr.words[Ur]|0)*xr;Vr-=Xr&67108863,Zr=(Vr>>26)-(Xr/67108864|0),this.words[Ur+Mr]=Vr&67108863}for(;Ur<this.length-Mr;Ur++)Vr=(this.words[Ur+Mr]|0)+Zr,Zr=Vr>>26,this.words[Ur+Mr]=Vr&67108863;if(Zr===0)return this.strip();for(Yt(Zr===-1),Zr=0,Ur=0;Ur<this.length;Ur++)Vr=-(this.words[Ur]|0)+Zr,Zr=Vr>>26,this.words[Ur]=Vr&67108863;return this.negative=1,this.strip()},Jt.prototype._wordDiv=function(Pr,xr){var Mr=this.length-Pr.length,Nr=this.clone(),Ur=Pr,Vr=Ur.words[Ur.length-1]|0,Zr=this._countBits(Vr);Mr=26-Zr,Mr!==0&&(Ur=Ur.ushln(Mr),Nr.iushln(Mr),Vr=Ur.words[Ur.length-1]|0);var Xr=Nr.length-Ur.length,Or;if(xr!=="mod"){Or=new Jt(null),Or.length=Xr+1,Or.words=new Array(Or.length);for(var jr=0;jr<Or.length;jr++)Or.words[jr]=0}var Jr=Nr.clone()._ishlnsubmul(Ur,1,Xr);Jr.negative===0&&(Nr=Jr,Or&&(Or.words[Xr]=1));for(var mn=Xr-1;mn>=0;mn--){var gn=(Nr.words[Ur.length+mn]|0)*67108864+(Nr.words[Ur.length+mn-1]|0);for(gn=Math.min(gn/Vr|0,67108863),Nr._ishlnsubmul(Ur,gn,mn);Nr.negative!==0;)gn--,Nr.negative=0,Nr._ishlnsubmul(Ur,1,mn),Nr.isZero()||(Nr.negative^=1);Or&&(Or.words[mn]=gn)}return Or&&Or.strip(),Nr.strip(),xr!=="div"&&Mr!==0&&Nr.iushrn(Mr),{div:Or||null,mod:Nr}},Jt.prototype.divmod=function(Pr,xr,Mr){if(Yt(!Pr.isZero()),this.isZero())return{div:new Jt(0),mod:new Jt(0)};var Nr,Ur,Vr;return this.negative!==0&&Pr.negative===0?(Vr=this.neg().divmod(Pr,xr),xr!=="mod"&&(Nr=Vr.div.neg()),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.iadd(Pr)),{div:Nr,mod:Ur}):this.negative===0&&Pr.negative!==0?(Vr=this.divmod(Pr.neg(),xr),xr!=="mod"&&(Nr=Vr.div.neg()),{div:Nr,mod:Vr.mod}):this.negative&Pr.negative?(Vr=this.neg().divmod(Pr.neg(),xr),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.isub(Pr)),{div:Vr.div,mod:Ur}):Pr.length>this.length||this.cmp(Pr)<0?{div:new Jt(0),mod:this}:Pr.length===1?xr==="div"?{div:this.divn(Pr.words[0]),mod:null}:xr==="mod"?{div:null,mod:new Jt(this.modn(Pr.words[0]))}:{div:this.divn(Pr.words[0]),mod:new Jt(this.modn(Pr.words[0]))}:this._wordDiv(Pr,xr)},Jt.prototype.div=function(Pr){return this.divmod(Pr,"div",!1).div},Jt.prototype.mod=function(Pr){return this.divmod(Pr,"mod",!1).mod},Jt.prototype.umod=function(Pr){return this.divmod(Pr,"mod",!0).mod},Jt.prototype.divRound=function(Pr){var xr=this.divmod(Pr);if(xr.mod.isZero())return xr.div;var Mr=xr.div.negative!==0?xr.mod.isub(Pr):xr.mod,Nr=Pr.ushrn(1),Ur=Pr.andln(1),Vr=Mr.cmp(Nr);return Vr<0||Ur===1&&Vr===0?xr.div:xr.div.negative!==0?xr.div.isubn(1):xr.div.iaddn(1)},Jt.prototype.modn=function(Pr){Yt(Pr<=67108863);for(var xr=(1<<26)%Pr,Mr=0,Nr=this.length-1;Nr>=0;Nr--)Mr=(xr*Mr+(this.words[Nr]|0))%Pr;return Mr},Jt.prototype.idivn=function(Pr){Yt(Pr<=67108863);for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=(this.words[Mr]|0)+xr*67108864;this.words[Mr]=Nr/Pr|0,xr=Nr%Pr}return this.strip()},Jt.prototype.divn=function(Pr){return this.clone().idivn(Pr)},Jt.prototype.egcd=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=new Jt(0),Zr=new Jt(1),Xr=0;xr.isEven()&&Mr.isEven();)xr.iushrn(1),Mr.iushrn(1),++Xr;for(var Or=Mr.clone(),jr=xr.clone();!xr.isZero();){for(var Jr=0,mn=1;!(xr.words[0]&mn)&&Jr<26;++Jr,mn<<=1);if(Jr>0)for(xr.iushrn(Jr);Jr-- >0;)(Nr.isOdd()||Ur.isOdd())&&(Nr.iadd(Or),Ur.isub(jr)),Nr.iushrn(1),Ur.iushrn(1);for(var gn=0,eo=1;!(Mr.words[0]&eo)&&gn<26;++gn,eo<<=1);if(gn>0)for(Mr.iushrn(gn);gn-- >0;)(Vr.isOdd()||Zr.isOdd())&&(Vr.iadd(Or),Zr.isub(jr)),Vr.iushrn(1),Zr.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Vr),Ur.isub(Zr)):(Mr.isub(xr),Vr.isub(Nr),Zr.isub(Ur))}return{a:Vr,b:Zr,gcd:Mr.iushln(Xr)}},Jt.prototype._invmp=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=Mr.clone();xr.cmpn(1)>0&&Mr.cmpn(1)>0;){for(var Zr=0,Xr=1;!(xr.words[0]&Xr)&&Zr<26;++Zr,Xr<<=1);if(Zr>0)for(xr.iushrn(Zr);Zr-- >0;)Nr.isOdd()&&Nr.iadd(Vr),Nr.iushrn(1);for(var Or=0,jr=1;!(Mr.words[0]&jr)&&Or<26;++Or,jr<<=1);if(Or>0)for(Mr.iushrn(Or);Or-- >0;)Ur.isOdd()&&Ur.iadd(Vr),Ur.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Ur)):(Mr.isub(xr),Ur.isub(Nr))}var Jr;return xr.cmpn(1)===0?Jr=Nr:Jr=Ur,Jr.cmpn(0)<0&&Jr.iadd(Pr),Jr},Jt.prototype.gcd=function(Pr){if(this.isZero())return Pr.abs();if(Pr.isZero())return this.abs();var xr=this.clone(),Mr=Pr.clone();xr.negative=0,Mr.negative=0;for(var Nr=0;xr.isEven()&&Mr.isEven();Nr++)xr.iushrn(1),Mr.iushrn(1);do{for(;xr.isEven();)xr.iushrn(1);for(;Mr.isEven();)Mr.iushrn(1);var Ur=xr.cmp(Mr);if(Ur<0){var Vr=xr;xr=Mr,Mr=Vr}else if(Ur===0||Mr.cmpn(1)===0)break;xr.isub(Mr)}while(!0);return Mr.iushln(Nr)},Jt.prototype.invm=function(Pr){return this.egcd(Pr).a.umod(Pr)},Jt.prototype.isEven=function(){return(this.words[0]&1)===0},Jt.prototype.isOdd=function(){return(this.words[0]&1)===1},Jt.prototype.andln=function(Pr){return this.words[0]&Pr},Jt.prototype.bincn=function(Pr){Yt(typeof Pr=="number");var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return this._expand(Mr+1),this.words[Mr]|=Nr,this;for(var Ur=Nr,Vr=Mr;Ur!==0&&Vr<this.length;Vr++){var Zr=this.words[Vr]|0;Zr+=Ur,Ur=Zr>>>26,Zr&=67108863,this.words[Vr]=Zr}return Ur!==0&&(this.words[Vr]=Ur,this.length++),this},Jt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Jt.prototype.cmpn=function(Pr){var xr=Pr<0;if(this.negative!==0&&!xr)return-1;if(this.negative===0&&xr)return 1;this.strip();var Mr;if(this.length>1)Mr=1;else{xr&&(Pr=-Pr),Yt(Pr<=67108863,"Number is too big");var Nr=this.words[0]|0;Mr=Nr===Pr?0:Nr<Pr?-1:1}return this.negative!==0?-Mr|0:Mr},Jt.prototype.cmp=function(Pr){if(this.negative!==0&&Pr.negative===0)return-1;if(this.negative===0&&Pr.negative!==0)return 1;var xr=this.ucmp(Pr);return this.negative!==0?-xr|0:xr},Jt.prototype.ucmp=function(Pr){if(this.length>Pr.length)return 1;if(this.length<Pr.length)return-1;for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=this.words[Mr]|0,Ur=Pr.words[Mr]|0;if(Nr!==Ur){Nr<Ur?xr=-1:Nr>Ur&&(xr=1);break}}return xr},Jt.prototype.gtn=function(Pr){return this.cmpn(Pr)===1},Jt.prototype.gt=function(Pr){return this.cmp(Pr)===1},Jt.prototype.gten=function(Pr){return this.cmpn(Pr)>=0},Jt.prototype.gte=function(Pr){return this.cmp(Pr)>=0},Jt.prototype.ltn=function(Pr){return this.cmpn(Pr)===-1},Jt.prototype.lt=function(Pr){return this.cmp(Pr)===-1},Jt.prototype.lten=function(Pr){return this.cmpn(Pr)<=0},Jt.prototype.lte=function(Pr){return this.cmp(Pr)<=0},Jt.prototype.eqn=function(Pr){return this.cmpn(Pr)===0},Jt.prototype.eq=function(Pr){return this.cmp(Pr)===0},Jt.red=function(Pr){return new En(Pr)},Jt.prototype.toRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),Yt(this.negative===0,"red works only with positives"),Pr.convertTo(this)._forceRed(Pr)},Jt.prototype.fromRed=function(){return Yt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Jt.prototype._forceRed=function(Pr){return this.red=Pr,this},Jt.prototype.forceRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),this._forceRed(Pr)},Jt.prototype.redAdd=function(Pr){return Yt(this.red,"redAdd works only with red numbers"),this.red.add(this,Pr)},Jt.prototype.redIAdd=function(Pr){return Yt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Pr)},Jt.prototype.redSub=function(Pr){return Yt(this.red,"redSub works only with red numbers"),this.red.sub(this,Pr)},Jt.prototype.redISub=function(Pr){return Yt(this.red,"redISub works only with red numbers"),this.red.isub(this,Pr)},Jt.prototype.redShl=function(Pr){return Yt(this.red,"redShl works only with red numbers"),this.red.shl(this,Pr)},Jt.prototype.redMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.mul(this,Pr)},Jt.prototype.redIMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.imul(this,Pr)},Jt.prototype.redSqr=function(){return Yt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Jt.prototype.redISqr=function(){return Yt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Jt.prototype.redSqrt=function(){return Yt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Jt.prototype.redInvm=function(){return Yt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Jt.prototype.redNeg=function(){return Yt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Jt.prototype.redPow=function(Pr){return Yt(this.red&&!Pr.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Pr)};var Gr={k256:null,p224:null,p192:null,p25519:null};function Kr(dn,Pr){this.name=dn,this.p=new Jt(Pr,16),this.n=this.p.bitLength(),this.k=new Jt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Kr.prototype._tmp=function(){var Pr=new Jt(null);return Pr.words=new Array(Math.ceil(this.n/13)),Pr},Kr.prototype.ireduce=function(Pr){var xr=Pr,Mr;do this.split(xr,this.tmp),xr=this.imulK(xr),xr=xr.iadd(this.tmp),Mr=xr.bitLength();while(Mr>this.n);var Nr=Mr<this.n?-1:xr.ucmp(this.p);return Nr===0?(xr.words[0]=0,xr.length=1):Nr>0?xr.isub(this.p):xr.strip(),xr},Kr.prototype.split=function(Pr,xr){Pr.iushrn(this.n,0,xr)},Kr.prototype.imulK=function(Pr){return Pr.imul(this.k)};function Yr(){Kr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Xt(Yr,Kr),Yr.prototype.split=function(Pr,xr){for(var Mr=4194303,Nr=Math.min(Pr.length,9),Ur=0;Ur<Nr;Ur++)xr.words[Ur]=Pr.words[Ur];if(xr.length=Nr,Pr.length<=9){Pr.words[0]=0,Pr.length=1;return}var Vr=Pr.words[9];for(xr.words[xr.length++]=Vr&Mr,Ur=10;Ur<Pr.length;Ur++){var Zr=Pr.words[Ur]|0;Pr.words[Ur-10]=(Zr&Mr)<<4|Vr>>>22,Vr=Zr}Vr>>>=22,Pr.words[Ur-10]=Vr,Vr===0&&Pr.length>10?Pr.length-=10:Pr.length-=9},Yr.prototype.imulK=function(Pr){Pr.words[Pr.length]=0,Pr.words[Pr.length+1]=0,Pr.length+=2;for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=Pr.words[Mr]|0;xr+=Nr*977,Pr.words[Mr]=xr&67108863,xr=Nr*64+(xr/67108864|0)}return Pr.words[Pr.length-1]===0&&(Pr.length--,Pr.words[Pr.length-1]===0&&Pr.length--),Pr};function hn(){Kr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Xt(hn,Kr);function Qr(){Kr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Xt(Qr,Kr);function pn(){Kr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Xt(pn,Kr),pn.prototype.imulK=function(Pr){for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=(Pr.words[Mr]|0)*19+xr,Ur=Nr&67108863;Nr>>>=26,Pr.words[Mr]=Ur,xr=Nr}return xr!==0&&(Pr.words[Pr.length++]=xr),Pr},Jt._prime=function(Pr){if(Gr[Pr])return Gr[Pr];var xr;if(Pr==="k256")xr=new Yr;else if(Pr==="p224")xr=new hn;else if(Pr==="p192")xr=new Qr;else if(Pr==="p25519")xr=new pn;else throw new Error("Unknown prime "+Pr);return Gr[Pr]=xr,xr};function En(dn){if(typeof dn=="string"){var Pr=Jt._prime(dn);this.m=Pr.p,this.prime=Pr}else Yt(dn.gtn(1),"modulus must be greater than 1"),this.m=dn,this.prime=null}En.prototype._verify1=function(Pr){Yt(Pr.negative===0,"red works only with positives"),Yt(Pr.red,"red works only with red numbers")},En.prototype._verify2=function(Pr,xr){Yt((Pr.negative|xr.negative)===0,"red works only with positives"),Yt(Pr.red&&Pr.red===xr.red,"red works only with red numbers")},En.prototype.imod=function(Pr){return this.prime?this.prime.ireduce(Pr)._forceRed(this):Pr.umod(this.m)._forceRed(this)},En.prototype.neg=function(Pr){return Pr.isZero()?Pr.clone():this.m.sub(Pr)._forceRed(this)},En.prototype.add=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.add(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr._forceRed(this)},En.prototype.iadd=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.iadd(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr},En.prototype.sub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.sub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr._forceRed(this)},En.prototype.isub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.isub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr},En.prototype.shl=function(Pr,xr){return this._verify1(Pr),this.imod(Pr.ushln(xr))},En.prototype.imul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.imul(xr))},En.prototype.mul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.mul(xr))},En.prototype.isqr=function(Pr){return this.imul(Pr,Pr.clone())},En.prototype.sqr=function(Pr){return this.mul(Pr,Pr)},En.prototype.sqrt=function(Pr){if(Pr.isZero())return Pr.clone();var xr=this.m.andln(3);if(Yt(xr%2===1),xr===3){var Mr=this.m.add(new Jt(1)).iushrn(2);return this.pow(Pr,Mr)}for(var Nr=this.m.subn(1),Ur=0;!Nr.isZero()&&Nr.andln(1)===0;)Ur++,Nr.iushrn(1);Yt(!Nr.isZero());var Vr=new Jt(1).toRed(this),Zr=Vr.redNeg(),Xr=this.m.subn(1).iushrn(1),Or=this.m.bitLength();for(Or=new Jt(2*Or*Or).toRed(this);this.pow(Or,Xr).cmp(Zr)!==0;)Or.redIAdd(Zr);for(var jr=this.pow(Or,Nr),Jr=this.pow(Pr,Nr.addn(1).iushrn(1)),mn=this.pow(Pr,Nr),gn=Ur;mn.cmp(Vr)!==0;){for(var eo=mn,_i=0;eo.cmp(Vr)!==0;_i++)eo=eo.redSqr();Yt(_i<gn);var ro=this.pow(jr,new Jt(1).iushln(gn-_i-1));Jr=Jr.redMul(ro),jr=ro.redSqr(),mn=mn.redMul(jr),gn=_i}return Jr},En.prototype.invm=function(Pr){var xr=Pr._invmp(this.m);return xr.negative!==0?(xr.negative=0,this.imod(xr).redNeg()):this.imod(xr)},En.prototype.pow=function(Pr,xr){if(xr.isZero())return new Jt(1).toRed(this);if(xr.cmpn(1)===0)return Pr.clone();var Mr=4,Nr=new Array(1<<Mr);Nr[0]=new Jt(1).toRed(this),Nr[1]=Pr;for(var Ur=2;Ur<Nr.length;Ur++)Nr[Ur]=this.mul(Nr[Ur-1],Pr);var Vr=Nr[0],Zr=0,Xr=0,Or=xr.bitLength()%26;for(Or===0&&(Or=26),Ur=xr.length-1;Ur>=0;Ur--){for(var jr=xr.words[Ur],Jr=Or-1;Jr>=0;Jr--){var mn=jr>>Jr&1;if(Vr!==Nr[0]&&(Vr=this.sqr(Vr)),mn===0&&Zr===0){Xr=0;continue}Zr<<=1,Zr|=mn,Xr++,!(Xr!==Mr&&(Ur!==0||Jr!==0))&&(Vr=this.mul(Vr,Nr[Zr]),Xr=0,Zr=0)}Or=26}return Vr},En.prototype.convertTo=function(Pr){var xr=Pr.umod(this.m);return xr===Pr?xr.clone():xr},En.prototype.convertFrom=function(Pr){var xr=Pr.clone();return xr.red=null,xr},Jt.mont=function(Pr){return new ga(Pr)};function ga(dn){En.call(this,dn),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Jt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Xt(ga,En),ga.prototype.convertTo=function(Pr){return this.imod(Pr.ushln(this.shift))},ga.prototype.convertFrom=function(Pr){var xr=this.imod(Pr.mul(this.rinv));return xr.red=null,xr},ga.prototype.imul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return Pr.words[0]=0,Pr.length=1,Pr;var Mr=Pr.imul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.mul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return new Jt(0)._forceRed(this);var Mr=Pr.mul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.invm=function(Pr){var xr=this.imod(Pr._invmp(this.m).mul(this.r2));return xr._forceRed(this)}})(Bt,commonjsGlobal)})(bn$2);bn$2.exports;var queryString$2={};(function(Bt){const Wt=strictUriEncode,Gt=decodeUriComponent,Yt=splitOnFirst,Xt=Br=>Br==null;function Jt(Br){switch(Br.arrayFormat){case"index":return Wr=>(Gr,Kr)=>{const Yr=Gr.length;return Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[",Yr,"]"].join("")]:[...Gr,[ur(Wr,Br),"[",ur(Yr,Br),"]=",ur(Kr,Br)].join("")]};case"bracket":return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[]"].join("")]:[...Gr,[ur(Wr,Br),"[]=",ur(Kr,Br)].join("")];case"comma":case"separator":return Wr=>(Gr,Kr)=>Kr==null||Kr.length===0?Gr:Gr.length===0?[[ur(Wr,Br),"=",ur(Kr,Br)].join("")]:[[Gr,ur(Kr,Br)].join(Br.arrayFormatSeparator)];default:return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,ur(Wr,Br)]:[...Gr,[ur(Wr,Br),"=",ur(Kr,Br)].join("")]}}function Zt(Br){let Wr;switch(Br.arrayFormat){case"index":return(Gr,Kr,Yr)=>{if(Wr=/\[(\d*)\]$/.exec(Gr),Gr=Gr.replace(/\[\d*\]$/,""),!Wr){Yr[Gr]=Kr;return}Yr[Gr]===void 0&&(Yr[Gr]={}),Yr[Gr][Wr[1]]=Kr};case"bracket":return(Gr,Kr,Yr)=>{if(Wr=/(\[\])$/.exec(Gr),Gr=Gr.replace(/\[\]$/,""),!Wr){Yr[Gr]=Kr;return}if(Yr[Gr]===void 0){Yr[Gr]=[Kr];return}Yr[Gr]=[].concat(Yr[Gr],Kr)};case"comma":case"separator":return(Gr,Kr,Yr)=>{const Qr=typeof Kr=="string"&&Kr.split("").indexOf(Br.arrayFormatSeparator)>-1?Kr.split(Br.arrayFormatSeparator).map(pn=>cr(pn,Br)):Kr===null?Kr:cr(Kr,Br);Yr[Gr]=Qr};default:return(Gr,Kr,Yr)=>{if(Yr[Gr]===void 0){Yr[Gr]=Kr;return}Yr[Gr]=[].concat(Yr[Gr],Kr)}}}function Qt(Br){if(typeof Br!="string"||Br.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ur(Br,Wr){return Wr.encode?Wr.strict?Wt(Br):encodeURIComponent(Br):Br}function cr(Br,Wr){return Wr.decode?Gt(Br):Br}function $r(Br){return Array.isArray(Br)?Br.sort():typeof Br=="object"?$r(Object.keys(Br)).sort((Wr,Gr)=>Number(Wr)-Number(Gr)).map(Wr=>Br[Wr]):Br}function Ar(Br){const Wr=Br.indexOf("#");return Wr!==-1&&(Br=Br.slice(0,Wr)),Br}function Lr(Br){let Wr="";const Gr=Br.indexOf("#");return Gr!==-1&&(Wr=Br.slice(Gr)),Wr}function qr(Br){Br=Ar(Br);const Wr=Br.indexOf("?");return Wr===-1?"":Br.slice(Wr+1)}function Fr(Br,Wr){return Wr.parseNumbers&&!Number.isNaN(Number(Br))&&typeof Br=="string"&&Br.trim()!==""?Br=Number(Br):Wr.parseBooleans&&Br!==null&&(Br.toLowerCase()==="true"||Br.toLowerCase()==="false")&&(Br=Br.toLowerCase()==="true"),Br}function Hr(Br,Wr){Wr=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Zt(Wr),Kr=Object.create(null);if(typeof Br!="string"||(Br=Br.trim().replace(/^[?#&]/,""),!Br))return Kr;for(const Yr of Br.split("&")){let[hn,Qr]=Yt(Wr.decode?Yr.replace(/\+/g," "):Yr,"=");Qr=Qr===void 0?null:["comma","separator"].includes(Wr.arrayFormat)?Qr:cr(Qr,Wr),Gr(cr(hn,Wr),Qr,Kr)}for(const Yr of Object.keys(Kr)){const hn=Kr[Yr];if(typeof hn=="object"&&hn!==null)for(const Qr of Object.keys(hn))hn[Qr]=Fr(hn[Qr],Wr);else Kr[Yr]=Fr(hn,Wr)}return Wr.sort===!1?Kr:(Wr.sort===!0?Object.keys(Kr).sort():Object.keys(Kr).sort(Wr.sort)).reduce((Yr,hn)=>{const Qr=Kr[hn];return Qr&&typeof Qr=="object"&&!Array.isArray(Qr)?Yr[hn]=$r(Qr):Yr[hn]=Qr,Yr},Object.create(null))}Bt.extract=qr,Bt.parse=Hr,Bt.stringify=(Br,Wr)=>{if(!Br)return"";Wr=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Qr=>Wr.skipNull&&Xt(Br[Qr])||Wr.skipEmptyString&&Br[Qr]==="",Kr=Jt(Wr),Yr={};for(const Qr of Object.keys(Br))Gr(Qr)||(Yr[Qr]=Br[Qr]);const hn=Object.keys(Yr);return Wr.sort!==!1&&hn.sort(Wr.sort),hn.map(Qr=>{const pn=Br[Qr];return pn===void 0?"":pn===null?ur(Qr,Wr):Array.isArray(pn)?pn.reduce(Kr(Qr),[]).join("&"):ur(Qr,Wr)+"="+ur(pn,Wr)}).filter(Qr=>Qr.length>0).join("&")},Bt.parseUrl=(Br,Wr)=>{Wr=Object.assign({decode:!0},Wr);const[Gr,Kr]=Yt(Br,"#");return Object.assign({url:Gr.split("?")[0]||"",query:Hr(qr(Br),Wr)},Wr&&Wr.parseFragmentIdentifier&&Kr?{fragmentIdentifier:cr(Kr,Wr)}:{})},Bt.stringifyUrl=(Br,Wr)=>{Wr=Object.assign({encode:!0,strict:!0},Wr);const Gr=Ar(Br.url).split("?")[0]||"",Kr=Bt.extract(Br.url),Yr=Bt.parse(Kr,{sort:!1}),hn=Object.assign(Yr,Br.query);let Qr=Bt.stringify(hn,Wr);Qr&&(Qr=`?${Qr}`);let pn=Lr(Br.url);return Br.fragmentIdentifier&&(pn=`#${ur(Br.fragmentIdentifier,Wr)}`),`${Gr}${Qr}${pn}`}})(queryString$2);const XHR=getFromWindow$1("XMLHttpRequest")||dist$g.XMLHttpRequest;class HTTPConnection extends EventEmitter$1{constructor(Wt){super(),this.url=Wt}formatError(Wt,Gt,Yt=-1){return{error:{message:Gt,code:Yt},id:Wt.id,jsonrpc:Wt.jsonrpc}}send(Wt,Gt){return new Promise(Yt=>{if(Wt.method==="eth_subscribe"){const Qt=this.formatError(Wt,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",Qt),Yt(Qt)}const Xt=new XHR;let Jt=!1;const Zt=(Qt,ur)=>{if(!Jt)if(Xt.abort(),Jt=!0,Gt)Gt(Qt,ur);else{const{id:cr,jsonrpc:$r}=Wt,Ar=Qt?{id:cr,jsonrpc:$r,error:{message:Qt.message,code:Qt.code}}:{id:cr,jsonrpc:$r,result:ur};this.emit("payload",Ar),Yt(Ar)}};Xt.open("POST",this.url,!0),Xt.setRequestHeader("Content-Type","application/json"),Xt.timeout=60*1e3,Xt.onerror=Zt,Xt.ontimeout=Zt,Xt.onreadystatechange=()=>{if(Xt.readyState===4)try{const Qt=JSON.parse(Xt.responseText);Zt(Qt.error,Qt.result)}catch(Qt){Zt(Qt)}},Xt.send(JSON.stringify(Wt))})}}const signingMethods=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],infuraNetworks={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var bn$1={exports:{}};bn$1.exports;(function(Bt){(function(Wt,Gt){function Yt(dn,Pr){if(!dn)throw new Error(Pr||"Assertion failed")}function Xt(dn,Pr){dn.super_=Pr;var xr=function(){};xr.prototype=Pr.prototype,dn.prototype=new xr,dn.prototype.constructor=dn}function Jt(dn,Pr,xr){if(Jt.isBN(dn))return dn;this.negative=0,this.words=null,this.length=0,this.red=null,dn!==null&&((Pr==="le"||Pr==="be")&&(xr=Pr,Pr=10),this._init(dn||0,Pr||10,xr||"be"))}typeof Wt=="object"?Wt.exports=Jt:Gt.BN=Jt,Jt.BN=Jt,Jt.wordSize=26;var Zt;try{Zt=require$$0$a.Buffer}catch{}Jt.isBN=function(Pr){return Pr instanceof Jt?!0:Pr!==null&&typeof Pr=="object"&&Pr.constructor.wordSize===Jt.wordSize&&Array.isArray(Pr.words)},Jt.max=function(Pr,xr){return Pr.cmp(xr)>0?Pr:xr},Jt.min=function(Pr,xr){return Pr.cmp(xr)<0?Pr:xr},Jt.prototype._init=function(Pr,xr,Mr){if(typeof Pr=="number")return this._initNumber(Pr,xr,Mr);if(typeof Pr=="object")return this._initArray(Pr,xr,Mr);xr==="hex"&&(xr=16),Yt(xr===(xr|0)&&xr>=2&&xr<=36),Pr=Pr.toString().replace(/\s+/g,"");var Nr=0;Pr[0]==="-"&&Nr++,xr===16?this._parseHex(Pr,Nr):this._parseBase(Pr,xr,Nr),Pr[0]==="-"&&(this.negative=1),this.strip(),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initNumber=function(Pr,xr,Mr){Pr<0&&(this.negative=1,Pr=-Pr),Pr<67108864?(this.words=[Pr&67108863],this.length=1):Pr<4503599627370496?(this.words=[Pr&67108863,Pr/67108864&67108863],this.length=2):(Yt(Pr<9007199254740992),this.words=[Pr&67108863,Pr/67108864&67108863,1],this.length=3),Mr==="le"&&this._initArray(this.toArray(),xr,Mr)},Jt.prototype._initArray=function(Pr,xr,Mr){if(Yt(typeof Pr.length=="number"),Pr.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Pr.length/3),this.words=new Array(this.length);for(var Nr=0;Nr<this.length;Nr++)this.words[Nr]=0;var Ur,Vr,Zr=0;if(Mr==="be")for(Nr=Pr.length-1,Ur=0;Nr>=0;Nr-=3)Vr=Pr[Nr]|Pr[Nr-1]<<8|Pr[Nr-2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);else if(Mr==="le")for(Nr=0,Ur=0;Nr<Pr.length;Nr+=3)Vr=Pr[Nr]|Pr[Nr+1]<<8|Pr[Nr+2]<<16,this.words[Ur]|=Vr<<Zr&67108863,this.words[Ur+1]=Vr>>>26-Zr&67108863,Zr+=24,Zr>=26&&(Zr-=26,Ur++);return this.strip()};function Qt(dn,Pr,xr){for(var Mr=0,Nr=Math.min(dn.length,xr),Ur=Pr;Ur<Nr;Ur++){var Vr=dn.charCodeAt(Ur)-48;Mr<<=4,Vr>=49&&Vr<=54?Mr|=Vr-49+10:Vr>=17&&Vr<=22?Mr|=Vr-17+10:Mr|=Vr&15}return Mr}Jt.prototype._parseHex=function(Pr,xr){this.length=Math.ceil((Pr.length-xr)/6),this.words=new Array(this.length);for(var Mr=0;Mr<this.length;Mr++)this.words[Mr]=0;var Nr,Ur,Vr=0;for(Mr=Pr.length-6,Nr=0;Mr>=xr;Mr-=6)Ur=Qt(Pr,Mr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303,Vr+=24,Vr>=26&&(Vr-=26,Nr++);Mr+6!==xr&&(Ur=Qt(Pr,xr,Mr+6),this.words[Nr]|=Ur<<Vr&67108863,this.words[Nr+1]|=Ur>>>26-Vr&4194303),this.strip()};function ur(dn,Pr,xr,Mr){for(var Nr=0,Ur=Math.min(dn.length,xr),Vr=Pr;Vr<Ur;Vr++){var Zr=dn.charCodeAt(Vr)-48;Nr*=Mr,Zr>=49?Nr+=Zr-49+10:Zr>=17?Nr+=Zr-17+10:Nr+=Zr}return Nr}Jt.prototype._parseBase=function(Pr,xr,Mr){this.words=[0],this.length=1;for(var Nr=0,Ur=1;Ur<=67108863;Ur*=xr)Nr++;Nr--,Ur=Ur/xr|0;for(var Vr=Pr.length-Mr,Zr=Vr%Nr,Xr=Math.min(Vr,Vr-Zr)+Mr,Or=0,jr=Mr;jr<Xr;jr+=Nr)Or=ur(Pr,jr,jr+Nr,xr),this.imuln(Ur),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or);if(Zr!==0){var Jr=1;for(Or=ur(Pr,jr,Pr.length,xr),jr=0;jr<Zr;jr++)Jr*=xr;this.imuln(Jr),this.words[0]+Or<67108864?this.words[0]+=Or:this._iaddn(Or)}},Jt.prototype.copy=function(Pr){Pr.words=new Array(this.length);for(var xr=0;xr<this.length;xr++)Pr.words[xr]=this.words[xr];Pr.length=this.length,Pr.negative=this.negative,Pr.red=this.red},Jt.prototype.clone=function(){var Pr=new Jt(null);return this.copy(Pr),Pr},Jt.prototype._expand=function(Pr){for(;this.length<Pr;)this.words[this.length++]=0;return this},Jt.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Jt.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},Jt.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var cr=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],$r=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],Ar=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];Jt.prototype.toString=function(Pr,xr){Pr=Pr||10,xr=xr|0||1;var Mr;if(Pr===16||Pr==="hex"){Mr="";for(var Nr=0,Ur=0,Vr=0;Vr<this.length;Vr++){var Zr=this.words[Vr],Xr=((Zr<<Nr|Ur)&16777215).toString(16);Ur=Zr>>>24-Nr&16777215,Ur!==0||Vr!==this.length-1?Mr=cr[6-Xr.length]+Xr+Mr:Mr=Xr+Mr,Nr+=2,Nr>=26&&(Nr-=26,Vr--)}for(Ur!==0&&(Mr=Ur.toString(16)+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}if(Pr===(Pr|0)&&Pr>=2&&Pr<=36){var Or=$r[Pr],jr=Ar[Pr];Mr="";var Jr=this.clone();for(Jr.negative=0;!Jr.isZero();){var mn=Jr.modn(jr).toString(Pr);Jr=Jr.idivn(jr),Jr.isZero()?Mr=mn+Mr:Mr=cr[Or-mn.length]+mn+Mr}for(this.isZero()&&(Mr="0"+Mr);Mr.length%xr!==0;)Mr="0"+Mr;return this.negative!==0&&(Mr="-"+Mr),Mr}Yt(!1,"Base should be between 2 and 36")},Jt.prototype.toNumber=function(){var Pr=this.words[0];return this.length===2?Pr+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Pr+=4503599627370496+this.words[1]*67108864:this.length>2&&Yt(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Pr:Pr},Jt.prototype.toJSON=function(){return this.toString(16)},Jt.prototype.toBuffer=function(Pr,xr){return Yt(typeof Zt<"u"),this.toArrayLike(Zt,Pr,xr)},Jt.prototype.toArray=function(Pr,xr){return this.toArrayLike(Array,Pr,xr)},Jt.prototype.toArrayLike=function(Pr,xr,Mr){var Nr=this.byteLength(),Ur=Mr||Math.max(1,Nr);Yt(Nr<=Ur,"byte array longer than desired length"),Yt(Ur>0,"Requested array length <= 0"),this.strip();var Vr=xr==="le",Zr=new Pr(Ur),Xr,Or,jr=this.clone();if(Vr){for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Or]=Xr;for(;Or<Ur;Or++)Zr[Or]=0}else{for(Or=0;Or<Ur-Nr;Or++)Zr[Or]=0;for(Or=0;!jr.isZero();Or++)Xr=jr.andln(255),jr.iushrn(8),Zr[Ur-Or-1]=Xr}return Zr},Math.clz32?Jt.prototype._countBits=function(Pr){return 32-Math.clz32(Pr)}:Jt.prototype._countBits=function(Pr){var xr=Pr,Mr=0;return xr>=4096&&(Mr+=13,xr>>>=13),xr>=64&&(Mr+=7,xr>>>=7),xr>=8&&(Mr+=4,xr>>>=4),xr>=2&&(Mr+=2,xr>>>=2),Mr+xr},Jt.prototype._zeroBits=function(Pr){if(Pr===0)return 26;var xr=Pr,Mr=0;return xr&8191||(Mr+=13,xr>>>=13),xr&127||(Mr+=7,xr>>>=7),xr&15||(Mr+=4,xr>>>=4),xr&3||(Mr+=2,xr>>>=2),xr&1||Mr++,Mr},Jt.prototype.bitLength=function(){var Pr=this.words[this.length-1],xr=this._countBits(Pr);return(this.length-1)*26+xr};function Lr(dn){for(var Pr=new Array(dn.bitLength()),xr=0;xr<Pr.length;xr++){var Mr=xr/26|0,Nr=xr%26;Pr[xr]=(dn.words[Mr]&1<<Nr)>>>Nr}return Pr}Jt.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Pr=0,xr=0;xr<this.length;xr++){var Mr=this._zeroBits(this.words[xr]);if(Pr+=Mr,Mr!==26)break}return Pr},Jt.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Jt.prototype.toTwos=function(Pr){return this.negative!==0?this.abs().inotn(Pr).iaddn(1):this.clone()},Jt.prototype.fromTwos=function(Pr){return this.testn(Pr-1)?this.notn(Pr).iaddn(1).ineg():this.clone()},Jt.prototype.isNeg=function(){return this.negative!==0},Jt.prototype.neg=function(){return this.clone().ineg()},Jt.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Jt.prototype.iuor=function(Pr){for(;this.length<Pr.length;)this.words[this.length++]=0;for(var xr=0;xr<Pr.length;xr++)this.words[xr]=this.words[xr]|Pr.words[xr];return this.strip()},Jt.prototype.ior=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuor(Pr)},Jt.prototype.or=function(Pr){return this.length>Pr.length?this.clone().ior(Pr):Pr.clone().ior(this)},Jt.prototype.uor=function(Pr){return this.length>Pr.length?this.clone().iuor(Pr):Pr.clone().iuor(this)},Jt.prototype.iuand=function(Pr){var xr;this.length>Pr.length?xr=Pr:xr=this;for(var Mr=0;Mr<xr.length;Mr++)this.words[Mr]=this.words[Mr]&Pr.words[Mr];return this.length=xr.length,this.strip()},Jt.prototype.iand=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuand(Pr)},Jt.prototype.and=function(Pr){return this.length>Pr.length?this.clone().iand(Pr):Pr.clone().iand(this)},Jt.prototype.uand=function(Pr){return this.length>Pr.length?this.clone().iuand(Pr):Pr.clone().iuand(this)},Jt.prototype.iuxor=function(Pr){var xr,Mr;this.length>Pr.length?(xr=this,Mr=Pr):(xr=Pr,Mr=this);for(var Nr=0;Nr<Mr.length;Nr++)this.words[Nr]=xr.words[Nr]^Mr.words[Nr];if(this!==xr)for(;Nr<xr.length;Nr++)this.words[Nr]=xr.words[Nr];return this.length=xr.length,this.strip()},Jt.prototype.ixor=function(Pr){return Yt((this.negative|Pr.negative)===0),this.iuxor(Pr)},Jt.prototype.xor=function(Pr){return this.length>Pr.length?this.clone().ixor(Pr):Pr.clone().ixor(this)},Jt.prototype.uxor=function(Pr){return this.length>Pr.length?this.clone().iuxor(Pr):Pr.clone().iuxor(this)},Jt.prototype.inotn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Math.ceil(Pr/26)|0,Mr=Pr%26;this._expand(xr),Mr>0&&xr--;for(var Nr=0;Nr<xr;Nr++)this.words[Nr]=~this.words[Nr]&67108863;return Mr>0&&(this.words[Nr]=~this.words[Nr]&67108863>>26-Mr),this.strip()},Jt.prototype.notn=function(Pr){return this.clone().inotn(Pr)},Jt.prototype.setn=function(Pr,xr){Yt(typeof Pr=="number"&&Pr>=0);var Mr=Pr/26|0,Nr=Pr%26;return this._expand(Mr+1),xr?this.words[Mr]=this.words[Mr]|1<<Nr:this.words[Mr]=this.words[Mr]&~(1<<Nr),this.strip()},Jt.prototype.iadd=function(Pr){var xr;if(this.negative!==0&&Pr.negative===0)return this.negative=0,xr=this.isub(Pr),this.negative^=1,this._normSign();if(this.negative===0&&Pr.negative!==0)return Pr.negative=0,xr=this.isub(Pr),Pr.negative=1,xr._normSign();var Mr,Nr;this.length>Pr.length?(Mr=this,Nr=Pr):(Mr=Pr,Nr=this);for(var Ur=0,Vr=0;Vr<Nr.length;Vr++)xr=(Mr.words[Vr]|0)+(Nr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;for(;Ur!==0&&Vr<Mr.length;Vr++)xr=(Mr.words[Vr]|0)+Ur,this.words[Vr]=xr&67108863,Ur=xr>>>26;if(this.length=Mr.length,Ur!==0)this.words[this.length]=Ur,this.length++;else if(Mr!==this)for(;Vr<Mr.length;Vr++)this.words[Vr]=Mr.words[Vr];return this},Jt.prototype.add=function(Pr){var xr;return Pr.negative!==0&&this.negative===0?(Pr.negative=0,xr=this.sub(Pr),Pr.negative^=1,xr):Pr.negative===0&&this.negative!==0?(this.negative=0,xr=Pr.sub(this),this.negative=1,xr):this.length>Pr.length?this.clone().iadd(Pr):Pr.clone().iadd(this)},Jt.prototype.isub=function(Pr){if(Pr.negative!==0){Pr.negative=0;var xr=this.iadd(Pr);return Pr.negative=1,xr._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Pr),this.negative=1,this._normSign();var Mr=this.cmp(Pr);if(Mr===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Nr,Ur;Mr>0?(Nr=this,Ur=Pr):(Nr=Pr,Ur=this);for(var Vr=0,Zr=0;Zr<Ur.length;Zr++)xr=(Nr.words[Zr]|0)-(Ur.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;for(;Vr!==0&&Zr<Nr.length;Zr++)xr=(Nr.words[Zr]|0)+Vr,Vr=xr>>26,this.words[Zr]=xr&67108863;if(Vr===0&&Zr<Nr.length&&Nr!==this)for(;Zr<Nr.length;Zr++)this.words[Zr]=Nr.words[Zr];return this.length=Math.max(this.length,Zr),Nr!==this&&(this.negative=1),this.strip()},Jt.prototype.sub=function(Pr){return this.clone().isub(Pr)};function qr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative;var Mr=dn.length+Pr.length|0;xr.length=Mr,Mr=Mr-1|0;var Nr=dn.words[0]|0,Ur=Pr.words[0]|0,Vr=Nr*Ur,Zr=Vr&67108863,Xr=Vr/67108864|0;xr.words[0]=Zr;for(var Or=1;Or<Mr;Or++){for(var jr=Xr>>>26,Jr=Xr&67108863,mn=Math.min(Or,Pr.length-1),gn=Math.max(0,Or-dn.length+1);gn<=mn;gn++){var eo=Or-gn|0;Nr=dn.words[eo]|0,Ur=Pr.words[gn]|0,Vr=Nr*Ur+Jr,jr+=Vr/67108864|0,Jr=Vr&67108863}xr.words[Or]=Jr|0,Xr=jr|0}return Xr!==0?xr.words[Or]=Xr|0:xr.length--,xr.strip()}var Fr=function(Pr,xr,Mr){var Nr=Pr.words,Ur=xr.words,Vr=Mr.words,Zr=0,Xr,Or,jr,Jr=Nr[0]|0,mn=Jr&8191,gn=Jr>>>13,eo=Nr[1]|0,_i=eo&8191,ro=eo>>>13,io=Nr[2]|0,ao=io&8191,oo=io>>>13,to=Nr[3]|0,so=to&8191,lo=to>>>13,Ro=Nr[4]|0,Io=Ro&8191,Fo=Ro>>>13,xo=Nr[5]|0,ho=xo&8191,po=xo>>>13,Ao=Nr[6]|0,Bo=Ao&8191,Mo=Ao>>>13,bo=Nr[7]|0,yo=bo&8191,Do=bo>>>13,Tu=Nr[8]|0,wu=Tu&8191,$o=Tu>>>13,mo=Nr[9]|0,_o=mo&8191,To=mo>>>13,iu=Ur[0]|0,nu=iu&8191,Jo=iu>>>13,cu=Ur[1]|0,au=cu&8191,tu=cu>>>13,Iu=Ur[2]|0,Ru=Iu&8191,$u=Iu>>>13,Yu=Ur[3]|0,qu=Yu&8191,fu=Yu>>>13,Xu=Ur[4]|0,Nu=Xu&8191,jo=Xu>>>13,qo=Ur[5]|0,Vo=qo&8191,zo=qo>>>13,Au=Ur[6]|0,_u=Au&8191,hu=Au>>>13,vu=Ur[7]|0,ju=vu&8191,Co=vu>>>13,Ho=Ur[8]|0,Ko=Ho&8191,Go=Ho>>>13,du=Ur[9]|0,Cu=du&8191,gu=du>>>13;Mr.negative=Pr.negative^xr.negative,Mr.length=19,Xr=Math.imul(mn,nu),Or=Math.imul(mn,Jo),Or=Or+Math.imul(gn,nu)|0,jr=Math.imul(gn,Jo);var el=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(el>>>26)|0,el&=67108863,Xr=Math.imul(_i,nu),Or=Math.imul(_i,Jo),Or=Or+Math.imul(ro,nu)|0,jr=Math.imul(ro,Jo),Xr=Xr+Math.imul(mn,au)|0,Or=Or+Math.imul(mn,tu)|0,Or=Or+Math.imul(gn,au)|0,jr=jr+Math.imul(gn,tu)|0;var wl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(wl>>>26)|0,wl&=67108863,Xr=Math.imul(ao,nu),Or=Math.imul(ao,Jo),Or=Or+Math.imul(oo,nu)|0,jr=Math.imul(oo,Jo),Xr=Xr+Math.imul(_i,au)|0,Or=Or+Math.imul(_i,tu)|0,Or=Or+Math.imul(ro,au)|0,jr=jr+Math.imul(ro,tu)|0,Xr=Xr+Math.imul(mn,Ru)|0,Or=Or+Math.imul(mn,$u)|0,Or=Or+Math.imul(gn,Ru)|0,jr=jr+Math.imul(gn,$u)|0;var Pl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Pl>>>26)|0,Pl&=67108863,Xr=Math.imul(so,nu),Or=Math.imul(so,Jo),Or=Or+Math.imul(lo,nu)|0,jr=Math.imul(lo,Jo),Xr=Xr+Math.imul(ao,au)|0,Or=Or+Math.imul(ao,tu)|0,Or=Or+Math.imul(oo,au)|0,jr=jr+Math.imul(oo,tu)|0,Xr=Xr+Math.imul(_i,Ru)|0,Or=Or+Math.imul(_i,$u)|0,Or=Or+Math.imul(ro,Ru)|0,jr=jr+Math.imul(ro,$u)|0,Xr=Xr+Math.imul(mn,qu)|0,Or=Or+Math.imul(mn,fu)|0,Or=Or+Math.imul(gn,qu)|0,jr=jr+Math.imul(gn,fu)|0;var kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(kl>>>26)|0,kl&=67108863,Xr=Math.imul(Io,nu),Or=Math.imul(Io,Jo),Or=Or+Math.imul(Fo,nu)|0,jr=Math.imul(Fo,Jo),Xr=Xr+Math.imul(so,au)|0,Or=Or+Math.imul(so,tu)|0,Or=Or+Math.imul(lo,au)|0,jr=jr+Math.imul(lo,tu)|0,Xr=Xr+Math.imul(ao,Ru)|0,Or=Or+Math.imul(ao,$u)|0,Or=Or+Math.imul(oo,Ru)|0,jr=jr+Math.imul(oo,$u)|0,Xr=Xr+Math.imul(_i,qu)|0,Or=Or+Math.imul(_i,fu)|0,Or=Or+Math.imul(ro,qu)|0,jr=jr+Math.imul(ro,fu)|0,Xr=Xr+Math.imul(mn,Nu)|0,Or=Or+Math.imul(mn,jo)|0,Or=Or+Math.imul(gn,Nu)|0,jr=jr+Math.imul(gn,jo)|0;var Ll=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,Xr=Math.imul(ho,nu),Or=Math.imul(ho,Jo),Or=Or+Math.imul(po,nu)|0,jr=Math.imul(po,Jo),Xr=Xr+Math.imul(Io,au)|0,Or=Or+Math.imul(Io,tu)|0,Or=Or+Math.imul(Fo,au)|0,jr=jr+Math.imul(Fo,tu)|0,Xr=Xr+Math.imul(so,Ru)|0,Or=Or+Math.imul(so,$u)|0,Or=Or+Math.imul(lo,Ru)|0,jr=jr+Math.imul(lo,$u)|0,Xr=Xr+Math.imul(ao,qu)|0,Or=Or+Math.imul(ao,fu)|0,Or=Or+Math.imul(oo,qu)|0,jr=jr+Math.imul(oo,fu)|0,Xr=Xr+Math.imul(_i,Nu)|0,Or=Or+Math.imul(_i,jo)|0,Or=Or+Math.imul(ro,Nu)|0,jr=jr+Math.imul(ro,jo)|0,Xr=Xr+Math.imul(mn,Vo)|0,Or=Or+Math.imul(mn,zo)|0,Or=Or+Math.imul(gn,Vo)|0,jr=jr+Math.imul(gn,zo)|0;var Hl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Hl>>>26)|0,Hl&=67108863,Xr=Math.imul(Bo,nu),Or=Math.imul(Bo,Jo),Or=Or+Math.imul(Mo,nu)|0,jr=Math.imul(Mo,Jo),Xr=Xr+Math.imul(ho,au)|0,Or=Or+Math.imul(ho,tu)|0,Or=Or+Math.imul(po,au)|0,jr=jr+Math.imul(po,tu)|0,Xr=Xr+Math.imul(Io,Ru)|0,Or=Or+Math.imul(Io,$u)|0,Or=Or+Math.imul(Fo,Ru)|0,jr=jr+Math.imul(Fo,$u)|0,Xr=Xr+Math.imul(so,qu)|0,Or=Or+Math.imul(so,fu)|0,Or=Or+Math.imul(lo,qu)|0,jr=jr+Math.imul(lo,fu)|0,Xr=Xr+Math.imul(ao,Nu)|0,Or=Or+Math.imul(ao,jo)|0,Or=Or+Math.imul(oo,Nu)|0,jr=jr+Math.imul(oo,jo)|0,Xr=Xr+Math.imul(_i,Vo)|0,Or=Or+Math.imul(_i,zo)|0,Or=Or+Math.imul(ro,Vo)|0,jr=jr+Math.imul(ro,zo)|0,Xr=Xr+Math.imul(mn,_u)|0,Or=Or+Math.imul(mn,hu)|0,Or=Or+Math.imul(gn,_u)|0,jr=jr+Math.imul(gn,hu)|0;var Nl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,Xr=Math.imul(yo,nu),Or=Math.imul(yo,Jo),Or=Or+Math.imul(Do,nu)|0,jr=Math.imul(Do,Jo),Xr=Xr+Math.imul(Bo,au)|0,Or=Or+Math.imul(Bo,tu)|0,Or=Or+Math.imul(Mo,au)|0,jr=jr+Math.imul(Mo,tu)|0,Xr=Xr+Math.imul(ho,Ru)|0,Or=Or+Math.imul(ho,$u)|0,Or=Or+Math.imul(po,Ru)|0,jr=jr+Math.imul(po,$u)|0,Xr=Xr+Math.imul(Io,qu)|0,Or=Or+Math.imul(Io,fu)|0,Or=Or+Math.imul(Fo,qu)|0,jr=jr+Math.imul(Fo,fu)|0,Xr=Xr+Math.imul(so,Nu)|0,Or=Or+Math.imul(so,jo)|0,Or=Or+Math.imul(lo,Nu)|0,jr=jr+Math.imul(lo,jo)|0,Xr=Xr+Math.imul(ao,Vo)|0,Or=Or+Math.imul(ao,zo)|0,Or=Or+Math.imul(oo,Vo)|0,jr=jr+Math.imul(oo,zo)|0,Xr=Xr+Math.imul(_i,_u)|0,Or=Or+Math.imul(_i,hu)|0,Or=Or+Math.imul(ro,_u)|0,jr=jr+Math.imul(ro,hu)|0,Xr=Xr+Math.imul(mn,ju)|0,Or=Or+Math.imul(mn,Co)|0,Or=Or+Math.imul(gn,ju)|0,jr=jr+Math.imul(gn,Co)|0;var Dl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Dl>>>26)|0,Dl&=67108863,Xr=Math.imul(wu,nu),Or=Math.imul(wu,Jo),Or=Or+Math.imul($o,nu)|0,jr=Math.imul($o,Jo),Xr=Xr+Math.imul(yo,au)|0,Or=Or+Math.imul(yo,tu)|0,Or=Or+Math.imul(Do,au)|0,jr=jr+Math.imul(Do,tu)|0,Xr=Xr+Math.imul(Bo,Ru)|0,Or=Or+Math.imul(Bo,$u)|0,Or=Or+Math.imul(Mo,Ru)|0,jr=jr+Math.imul(Mo,$u)|0,Xr=Xr+Math.imul(ho,qu)|0,Or=Or+Math.imul(ho,fu)|0,Or=Or+Math.imul(po,qu)|0,jr=jr+Math.imul(po,fu)|0,Xr=Xr+Math.imul(Io,Nu)|0,Or=Or+Math.imul(Io,jo)|0,Or=Or+Math.imul(Fo,Nu)|0,jr=jr+Math.imul(Fo,jo)|0,Xr=Xr+Math.imul(so,Vo)|0,Or=Or+Math.imul(so,zo)|0,Or=Or+Math.imul(lo,Vo)|0,jr=jr+Math.imul(lo,zo)|0,Xr=Xr+Math.imul(ao,_u)|0,Or=Or+Math.imul(ao,hu)|0,Or=Or+Math.imul(oo,_u)|0,jr=jr+Math.imul(oo,hu)|0,Xr=Xr+Math.imul(_i,ju)|0,Or=Or+Math.imul(_i,Co)|0,Or=Or+Math.imul(ro,ju)|0,jr=jr+Math.imul(ro,Co)|0,Xr=Xr+Math.imul(mn,Ko)|0,Or=Or+Math.imul(mn,Go)|0,Or=Or+Math.imul(gn,Ko)|0,jr=jr+Math.imul(gn,Go)|0;var Ju=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,Xr=Math.imul(_o,nu),Or=Math.imul(_o,Jo),Or=Or+Math.imul(To,nu)|0,jr=Math.imul(To,Jo),Xr=Xr+Math.imul(wu,au)|0,Or=Or+Math.imul(wu,tu)|0,Or=Or+Math.imul($o,au)|0,jr=jr+Math.imul($o,tu)|0,Xr=Xr+Math.imul(yo,Ru)|0,Or=Or+Math.imul(yo,$u)|0,Or=Or+Math.imul(Do,Ru)|0,jr=jr+Math.imul(Do,$u)|0,Xr=Xr+Math.imul(Bo,qu)|0,Or=Or+Math.imul(Bo,fu)|0,Or=Or+Math.imul(Mo,qu)|0,jr=jr+Math.imul(Mo,fu)|0,Xr=Xr+Math.imul(ho,Nu)|0,Or=Or+Math.imul(ho,jo)|0,Or=Or+Math.imul(po,Nu)|0,jr=jr+Math.imul(po,jo)|0,Xr=Xr+Math.imul(Io,Vo)|0,Or=Or+Math.imul(Io,zo)|0,Or=Or+Math.imul(Fo,Vo)|0,jr=jr+Math.imul(Fo,zo)|0,Xr=Xr+Math.imul(so,_u)|0,Or=Or+Math.imul(so,hu)|0,Or=Or+Math.imul(lo,_u)|0,jr=jr+Math.imul(lo,hu)|0,Xr=Xr+Math.imul(ao,ju)|0,Or=Or+Math.imul(ao,Co)|0,Or=Or+Math.imul(oo,ju)|0,jr=jr+Math.imul(oo,Co)|0,Xr=Xr+Math.imul(_i,Ko)|0,Or=Or+Math.imul(_i,Go)|0,Or=Or+Math.imul(ro,Ko)|0,jr=jr+Math.imul(ro,Go)|0,Xr=Xr+Math.imul(mn,Cu)|0,Or=Or+Math.imul(mn,gu)|0,Or=Or+Math.imul(gn,Cu)|0,jr=jr+Math.imul(gn,gu)|0;var Kl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Kl>>>26)|0,Kl&=67108863,Xr=Math.imul(_o,au),Or=Math.imul(_o,tu),Or=Or+Math.imul(To,au)|0,jr=Math.imul(To,tu),Xr=Xr+Math.imul(wu,Ru)|0,Or=Or+Math.imul(wu,$u)|0,Or=Or+Math.imul($o,Ru)|0,jr=jr+Math.imul($o,$u)|0,Xr=Xr+Math.imul(yo,qu)|0,Or=Or+Math.imul(yo,fu)|0,Or=Or+Math.imul(Do,qu)|0,jr=jr+Math.imul(Do,fu)|0,Xr=Xr+Math.imul(Bo,Nu)|0,Or=Or+Math.imul(Bo,jo)|0,Or=Or+Math.imul(Mo,Nu)|0,jr=jr+Math.imul(Mo,jo)|0,Xr=Xr+Math.imul(ho,Vo)|0,Or=Or+Math.imul(ho,zo)|0,Or=Or+Math.imul(po,Vo)|0,jr=jr+Math.imul(po,zo)|0,Xr=Xr+Math.imul(Io,_u)|0,Or=Or+Math.imul(Io,hu)|0,Or=Or+Math.imul(Fo,_u)|0,jr=jr+Math.imul(Fo,hu)|0,Xr=Xr+Math.imul(so,ju)|0,Or=Or+Math.imul(so,Co)|0,Or=Or+Math.imul(lo,ju)|0,jr=jr+Math.imul(lo,Co)|0,Xr=Xr+Math.imul(ao,Ko)|0,Or=Or+Math.imul(ao,Go)|0,Or=Or+Math.imul(oo,Ko)|0,jr=jr+Math.imul(oo,Go)|0,Xr=Xr+Math.imul(_i,Cu)|0,Or=Or+Math.imul(_i,gu)|0,Or=Or+Math.imul(ro,Cu)|0,jr=jr+Math.imul(ro,gu)|0;var ep=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ep>>>26)|0,ep&=67108863,Xr=Math.imul(_o,Ru),Or=Math.imul(_o,$u),Or=Or+Math.imul(To,Ru)|0,jr=Math.imul(To,$u),Xr=Xr+Math.imul(wu,qu)|0,Or=Or+Math.imul(wu,fu)|0,Or=Or+Math.imul($o,qu)|0,jr=jr+Math.imul($o,fu)|0,Xr=Xr+Math.imul(yo,Nu)|0,Or=Or+Math.imul(yo,jo)|0,Or=Or+Math.imul(Do,Nu)|0,jr=jr+Math.imul(Do,jo)|0,Xr=Xr+Math.imul(Bo,Vo)|0,Or=Or+Math.imul(Bo,zo)|0,Or=Or+Math.imul(Mo,Vo)|0,jr=jr+Math.imul(Mo,zo)|0,Xr=Xr+Math.imul(ho,_u)|0,Or=Or+Math.imul(ho,hu)|0,Or=Or+Math.imul(po,_u)|0,jr=jr+Math.imul(po,hu)|0,Xr=Xr+Math.imul(Io,ju)|0,Or=Or+Math.imul(Io,Co)|0,Or=Or+Math.imul(Fo,ju)|0,jr=jr+Math.imul(Fo,Co)|0,Xr=Xr+Math.imul(so,Ko)|0,Or=Or+Math.imul(so,Go)|0,Or=Or+Math.imul(lo,Ko)|0,jr=jr+Math.imul(lo,Go)|0,Xr=Xr+Math.imul(ao,Cu)|0,Or=Or+Math.imul(ao,gu)|0,Or=Or+Math.imul(oo,Cu)|0,jr=jr+Math.imul(oo,gu)|0;var ap=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(ap>>>26)|0,ap&=67108863,Xr=Math.imul(_o,qu),Or=Math.imul(_o,fu),Or=Or+Math.imul(To,qu)|0,jr=Math.imul(To,fu),Xr=Xr+Math.imul(wu,Nu)|0,Or=Or+Math.imul(wu,jo)|0,Or=Or+Math.imul($o,Nu)|0,jr=jr+Math.imul($o,jo)|0,Xr=Xr+Math.imul(yo,Vo)|0,Or=Or+Math.imul(yo,zo)|0,Or=Or+Math.imul(Do,Vo)|0,jr=jr+Math.imul(Do,zo)|0,Xr=Xr+Math.imul(Bo,_u)|0,Or=Or+Math.imul(Bo,hu)|0,Or=Or+Math.imul(Mo,_u)|0,jr=jr+Math.imul(Mo,hu)|0,Xr=Xr+Math.imul(ho,ju)|0,Or=Or+Math.imul(ho,Co)|0,Or=Or+Math.imul(po,ju)|0,jr=jr+Math.imul(po,Co)|0,Xr=Xr+Math.imul(Io,Ko)|0,Or=Or+Math.imul(Io,Go)|0,Or=Or+Math.imul(Fo,Ko)|0,jr=jr+Math.imul(Fo,Go)|0,Xr=Xr+Math.imul(so,Cu)|0,Or=Or+Math.imul(so,gu)|0,Or=Or+Math.imul(lo,Cu)|0,jr=jr+Math.imul(lo,gu)|0;var fp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(fp>>>26)|0,fp&=67108863,Xr=Math.imul(_o,Nu),Or=Math.imul(_o,jo),Or=Or+Math.imul(To,Nu)|0,jr=Math.imul(To,jo),Xr=Xr+Math.imul(wu,Vo)|0,Or=Or+Math.imul(wu,zo)|0,Or=Or+Math.imul($o,Vo)|0,jr=jr+Math.imul($o,zo)|0,Xr=Xr+Math.imul(yo,_u)|0,Or=Or+Math.imul(yo,hu)|0,Or=Or+Math.imul(Do,_u)|0,jr=jr+Math.imul(Do,hu)|0,Xr=Xr+Math.imul(Bo,ju)|0,Or=Or+Math.imul(Bo,Co)|0,Or=Or+Math.imul(Mo,ju)|0,jr=jr+Math.imul(Mo,Co)|0,Xr=Xr+Math.imul(ho,Ko)|0,Or=Or+Math.imul(ho,Go)|0,Or=Or+Math.imul(po,Ko)|0,jr=jr+Math.imul(po,Go)|0,Xr=Xr+Math.imul(Io,Cu)|0,Or=Or+Math.imul(Io,gu)|0,Or=Or+Math.imul(Fo,Cu)|0,jr=jr+Math.imul(Fo,gu)|0;var _f=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(_f>>>26)|0,_f&=67108863,Xr=Math.imul(_o,Vo),Or=Math.imul(_o,zo),Or=Or+Math.imul(To,Vo)|0,jr=Math.imul(To,zo),Xr=Xr+Math.imul(wu,_u)|0,Or=Or+Math.imul(wu,hu)|0,Or=Or+Math.imul($o,_u)|0,jr=jr+Math.imul($o,hu)|0,Xr=Xr+Math.imul(yo,ju)|0,Or=Or+Math.imul(yo,Co)|0,Or=Or+Math.imul(Do,ju)|0,jr=jr+Math.imul(Do,Co)|0,Xr=Xr+Math.imul(Bo,Ko)|0,Or=Or+Math.imul(Bo,Go)|0,Or=Or+Math.imul(Mo,Ko)|0,jr=jr+Math.imul(Mo,Go)|0,Xr=Xr+Math.imul(ho,Cu)|0,Or=Or+Math.imul(ho,gu)|0,Or=Or+Math.imul(po,Cu)|0,jr=jr+Math.imul(po,gu)|0;var rp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(rp>>>26)|0,rp&=67108863,Xr=Math.imul(_o,_u),Or=Math.imul(_o,hu),Or=Or+Math.imul(To,_u)|0,jr=Math.imul(To,hu),Xr=Xr+Math.imul(wu,ju)|0,Or=Or+Math.imul(wu,Co)|0,Or=Or+Math.imul($o,ju)|0,jr=jr+Math.imul($o,Co)|0,Xr=Xr+Math.imul(yo,Ko)|0,Or=Or+Math.imul(yo,Go)|0,Or=Or+Math.imul(Do,Ko)|0,jr=jr+Math.imul(Do,Go)|0,Xr=Xr+Math.imul(Bo,Cu)|0,Or=Or+Math.imul(Bo,gu)|0,Or=Or+Math.imul(Mo,Cu)|0,jr=jr+Math.imul(Mo,gu)|0;var dp=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(dp>>>26)|0,dp&=67108863,Xr=Math.imul(_o,ju),Or=Math.imul(_o,Co),Or=Or+Math.imul(To,ju)|0,jr=Math.imul(To,Co),Xr=Xr+Math.imul(wu,Ko)|0,Or=Or+Math.imul(wu,Go)|0,Or=Or+Math.imul($o,Ko)|0,jr=jr+Math.imul($o,Go)|0,Xr=Xr+Math.imul(yo,Cu)|0,Or=Or+Math.imul(yo,gu)|0,Or=Or+Math.imul(Do,Cu)|0,jr=jr+Math.imul(Do,gu)|0;var np=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(np>>>26)|0,np&=67108863,Xr=Math.imul(_o,Ko),Or=Math.imul(_o,Go),Or=Or+Math.imul(To,Ko)|0,jr=Math.imul(To,Go),Xr=Xr+Math.imul(wu,Cu)|0,Or=Or+Math.imul(wu,gu)|0,Or=Or+Math.imul($o,Cu)|0,jr=jr+Math.imul($o,gu)|0;var Jl=(Zr+Xr|0)+((Or&8191)<<13)|0;Zr=(jr+(Or>>>13)|0)+(Jl>>>26)|0,Jl&=67108863,Xr=Math.imul(_o,Cu),Or=Math.imul(_o,gu),Or=Or+Math.imul(To,Cu)|0,jr=Math.imul(To,gu);var mp=(Zr+Xr|0)+((Or&8191)<<13)|0;return Zr=(jr+(Or>>>13)|0)+(mp>>>26)|0,mp&=67108863,Vr[0]=el,Vr[1]=wl,Vr[2]=Pl,Vr[3]=kl,Vr[4]=Ll,Vr[5]=Hl,Vr[6]=Nl,Vr[7]=Dl,Vr[8]=Ju,Vr[9]=Kl,Vr[10]=ep,Vr[11]=ap,Vr[12]=fp,Vr[13]=_f,Vr[14]=rp,Vr[15]=dp,Vr[16]=np,Vr[17]=Jl,Vr[18]=mp,Zr!==0&&(Vr[19]=Zr,Mr.length++),Mr};Math.imul||(Fr=qr);function Hr(dn,Pr,xr){xr.negative=Pr.negative^dn.negative,xr.length=dn.length+Pr.length;for(var Mr=0,Nr=0,Ur=0;Ur<xr.length-1;Ur++){var Vr=Nr;Nr=0;for(var Zr=Mr&67108863,Xr=Math.min(Ur,Pr.length-1),Or=Math.max(0,Ur-dn.length+1);Or<=Xr;Or++){var jr=Ur-Or,Jr=dn.words[jr]|0,mn=Pr.words[Or]|0,gn=Jr*mn,eo=gn&67108863;Vr=Vr+(gn/67108864|0)|0,eo=eo+Zr|0,Zr=eo&67108863,Vr=Vr+(eo>>>26)|0,Nr+=Vr>>>26,Vr&=67108863}xr.words[Ur]=Zr,Mr=Vr,Vr=Nr}return Mr!==0?xr.words[Ur]=Mr:xr.length--,xr.strip()}function Br(dn,Pr,xr){var Mr=new Wr;return Mr.mulp(dn,Pr,xr)}Jt.prototype.mulTo=function(Pr,xr){var Mr,Nr=this.length+Pr.length;return this.length===10&&Pr.length===10?Mr=Fr(this,Pr,xr):Nr<63?Mr=qr(this,Pr,xr):Nr<1024?Mr=Hr(this,Pr,xr):Mr=Br(this,Pr,xr),Mr};function Wr(dn,Pr){this.x=dn,this.y=Pr}Wr.prototype.makeRBT=function(Pr){for(var xr=new Array(Pr),Mr=Jt.prototype._countBits(Pr)-1,Nr=0;Nr<Pr;Nr++)xr[Nr]=this.revBin(Nr,Mr,Pr);return xr},Wr.prototype.revBin=function(Pr,xr,Mr){if(Pr===0||Pr===Mr-1)return Pr;for(var Nr=0,Ur=0;Ur<xr;Ur++)Nr|=(Pr&1)<<xr-Ur-1,Pr>>=1;return Nr},Wr.prototype.permute=function(Pr,xr,Mr,Nr,Ur,Vr){for(var Zr=0;Zr<Vr;Zr++)Nr[Zr]=xr[Pr[Zr]],Ur[Zr]=Mr[Pr[Zr]]},Wr.prototype.transform=function(Pr,xr,Mr,Nr,Ur,Vr){this.permute(Vr,Pr,xr,Mr,Nr,Ur);for(var Zr=1;Zr<Ur;Zr<<=1)for(var Xr=Zr<<1,Or=Math.cos(2*Math.PI/Xr),jr=Math.sin(2*Math.PI/Xr),Jr=0;Jr<Ur;Jr+=Xr)for(var mn=Or,gn=jr,eo=0;eo<Zr;eo++){var _i=Mr[Jr+eo],ro=Nr[Jr+eo],io=Mr[Jr+eo+Zr],ao=Nr[Jr+eo+Zr],oo=mn*io-gn*ao;ao=mn*ao+gn*io,io=oo,Mr[Jr+eo]=_i+io,Nr[Jr+eo]=ro+ao,Mr[Jr+eo+Zr]=_i-io,Nr[Jr+eo+Zr]=ro-ao,eo!==Xr&&(oo=Or*mn-jr*gn,gn=Or*gn+jr*mn,mn=oo)}},Wr.prototype.guessLen13b=function(Pr,xr){var Mr=Math.max(xr,Pr)|1,Nr=Mr&1,Ur=0;for(Mr=Mr/2|0;Mr;Mr=Mr>>>1)Ur++;return 1<<Ur+1+Nr},Wr.prototype.conjugate=function(Pr,xr,Mr){if(!(Mr<=1))for(var Nr=0;Nr<Mr/2;Nr++){var Ur=Pr[Nr];Pr[Nr]=Pr[Mr-Nr-1],Pr[Mr-Nr-1]=Ur,Ur=xr[Nr],xr[Nr]=-xr[Mr-Nr-1],xr[Mr-Nr-1]=-Ur}},Wr.prototype.normalize13b=function(Pr,xr){for(var Mr=0,Nr=0;Nr<xr/2;Nr++){var Ur=Math.round(Pr[2*Nr+1]/xr)*8192+Math.round(Pr[2*Nr]/xr)+Mr;Pr[Nr]=Ur&67108863,Ur<67108864?Mr=0:Mr=Ur/67108864|0}return Pr},Wr.prototype.convert13b=function(Pr,xr,Mr,Nr){for(var Ur=0,Vr=0;Vr<xr;Vr++)Ur=Ur+(Pr[Vr]|0),Mr[2*Vr]=Ur&8191,Ur=Ur>>>13,Mr[2*Vr+1]=Ur&8191,Ur=Ur>>>13;for(Vr=2*xr;Vr<Nr;++Vr)Mr[Vr]=0;Yt(Ur===0),Yt((Ur&-8192)===0)},Wr.prototype.stub=function(Pr){for(var xr=new Array(Pr),Mr=0;Mr<Pr;Mr++)xr[Mr]=0;return xr},Wr.prototype.mulp=function(Pr,xr,Mr){var Nr=2*this.guessLen13b(Pr.length,xr.length),Ur=this.makeRBT(Nr),Vr=this.stub(Nr),Zr=new Array(Nr),Xr=new Array(Nr),Or=new Array(Nr),jr=new Array(Nr),Jr=new Array(Nr),mn=new Array(Nr),gn=Mr.words;gn.length=Nr,this.convert13b(Pr.words,Pr.length,Zr,Nr),this.convert13b(xr.words,xr.length,jr,Nr),this.transform(Zr,Vr,Xr,Or,Nr,Ur),this.transform(jr,Vr,Jr,mn,Nr,Ur);for(var eo=0;eo<Nr;eo++){var _i=Xr[eo]*Jr[eo]-Or[eo]*mn[eo];Or[eo]=Xr[eo]*mn[eo]+Or[eo]*Jr[eo],Xr[eo]=_i}return this.conjugate(Xr,Or,Nr),this.transform(Xr,Or,gn,Vr,Nr,Ur),this.conjugate(gn,Vr,Nr),this.normalize13b(gn,Nr),Mr.negative=Pr.negative^xr.negative,Mr.length=Pr.length+xr.length,Mr.strip()},Jt.prototype.mul=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),this.mulTo(Pr,xr)},Jt.prototype.mulf=function(Pr){var xr=new Jt(null);return xr.words=new Array(this.length+Pr.length),Br(this,Pr,xr)},Jt.prototype.imul=function(Pr){return this.clone().mulTo(Pr,this)},Jt.prototype.imuln=function(Pr){Yt(typeof Pr=="number"),Yt(Pr<67108864);for(var xr=0,Mr=0;Mr<this.length;Mr++){var Nr=(this.words[Mr]|0)*Pr,Ur=(Nr&67108863)+(xr&67108863);xr>>=26,xr+=Nr/67108864|0,xr+=Ur>>>26,this.words[Mr]=Ur&67108863}return xr!==0&&(this.words[Mr]=xr,this.length++),this},Jt.prototype.muln=function(Pr){return this.clone().imuln(Pr)},Jt.prototype.sqr=function(){return this.mul(this)},Jt.prototype.isqr=function(){return this.imul(this.clone())},Jt.prototype.pow=function(Pr){var xr=Lr(Pr);if(xr.length===0)return new Jt(1);for(var Mr=this,Nr=0;Nr<xr.length&&xr[Nr]===0;Nr++,Mr=Mr.sqr());if(++Nr<xr.length)for(var Ur=Mr.sqr();Nr<xr.length;Nr++,Ur=Ur.sqr())xr[Nr]!==0&&(Mr=Mr.mul(Ur));return Mr},Jt.prototype.iushln=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=67108863>>>26-xr<<26-xr,Ur;if(xr!==0){var Vr=0;for(Ur=0;Ur<this.length;Ur++){var Zr=this.words[Ur]&Nr,Xr=(this.words[Ur]|0)-Zr<<xr;this.words[Ur]=Xr|Vr,Vr=Zr>>>26-xr}Vr&&(this.words[Ur]=Vr,this.length++)}if(Mr!==0){for(Ur=this.length-1;Ur>=0;Ur--)this.words[Ur+Mr]=this.words[Ur];for(Ur=0;Ur<Mr;Ur++)this.words[Ur]=0;this.length+=Mr}return this.strip()},Jt.prototype.ishln=function(Pr){return Yt(this.negative===0),this.iushln(Pr)},Jt.prototype.iushrn=function(Pr,xr,Mr){Yt(typeof Pr=="number"&&Pr>=0);var Nr;xr?Nr=(xr-xr%26)/26:Nr=0;var Ur=Pr%26,Vr=Math.min((Pr-Ur)/26,this.length),Zr=67108863^67108863>>>Ur<<Ur,Xr=Mr;if(Nr-=Vr,Nr=Math.max(0,Nr),Xr){for(var Or=0;Or<Vr;Or++)Xr.words[Or]=this.words[Or];Xr.length=Vr}if(Vr!==0)if(this.length>Vr)for(this.length-=Vr,Or=0;Or<this.length;Or++)this.words[Or]=this.words[Or+Vr];else this.words[0]=0,this.length=1;var jr=0;for(Or=this.length-1;Or>=0&&(jr!==0||Or>=Nr);Or--){var Jr=this.words[Or]|0;this.words[Or]=jr<<26-Ur|Jr>>>Ur,jr=Jr&Zr}return Xr&&jr!==0&&(Xr.words[Xr.length++]=jr),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},Jt.prototype.ishrn=function(Pr,xr,Mr){return Yt(this.negative===0),this.iushrn(Pr,xr,Mr)},Jt.prototype.shln=function(Pr){return this.clone().ishln(Pr)},Jt.prototype.ushln=function(Pr){return this.clone().iushln(Pr)},Jt.prototype.shrn=function(Pr){return this.clone().ishrn(Pr)},Jt.prototype.ushrn=function(Pr){return this.clone().iushrn(Pr)},Jt.prototype.testn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return!1;var Ur=this.words[Mr];return!!(Ur&Nr)},Jt.prototype.imaskn=function(Pr){Yt(typeof Pr=="number"&&Pr>=0);var xr=Pr%26,Mr=(Pr-xr)/26;if(Yt(this.negative===0,"imaskn works only with positive numbers"),this.length<=Mr)return this;if(xr!==0&&Mr++,this.length=Math.min(Mr,this.length),xr!==0){var Nr=67108863^67108863>>>xr<<xr;this.words[this.length-1]&=Nr}return this.strip()},Jt.prototype.maskn=function(Pr){return this.clone().imaskn(Pr)},Jt.prototype.iaddn=function(Pr){return Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0?this.isubn(-Pr):this.negative!==0?this.length===1&&(this.words[0]|0)<Pr?(this.words[0]=Pr-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Pr),this.negative=1,this):this._iaddn(Pr)},Jt.prototype._iaddn=function(Pr){this.words[0]+=Pr;for(var xr=0;xr<this.length&&this.words[xr]>=67108864;xr++)this.words[xr]-=67108864,xr===this.length-1?this.words[xr+1]=1:this.words[xr+1]++;return this.length=Math.max(this.length,xr+1),this},Jt.prototype.isubn=function(Pr){if(Yt(typeof Pr=="number"),Yt(Pr<67108864),Pr<0)return this.iaddn(-Pr);if(this.negative!==0)return this.negative=0,this.iaddn(Pr),this.negative=1,this;if(this.words[0]-=Pr,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var xr=0;xr<this.length&&this.words[xr]<0;xr++)this.words[xr]+=67108864,this.words[xr+1]-=1;return this.strip()},Jt.prototype.addn=function(Pr){return this.clone().iaddn(Pr)},Jt.prototype.subn=function(Pr){return this.clone().isubn(Pr)},Jt.prototype.iabs=function(){return this.negative=0,this},Jt.prototype.abs=function(){return this.clone().iabs()},Jt.prototype._ishlnsubmul=function(Pr,xr,Mr){var Nr=Pr.length+Mr,Ur;this._expand(Nr);var Vr,Zr=0;for(Ur=0;Ur<Pr.length;Ur++){Vr=(this.words[Ur+Mr]|0)+Zr;var Xr=(Pr.words[Ur]|0)*xr;Vr-=Xr&67108863,Zr=(Vr>>26)-(Xr/67108864|0),this.words[Ur+Mr]=Vr&67108863}for(;Ur<this.length-Mr;Ur++)Vr=(this.words[Ur+Mr]|0)+Zr,Zr=Vr>>26,this.words[Ur+Mr]=Vr&67108863;if(Zr===0)return this.strip();for(Yt(Zr===-1),Zr=0,Ur=0;Ur<this.length;Ur++)Vr=-(this.words[Ur]|0)+Zr,Zr=Vr>>26,this.words[Ur]=Vr&67108863;return this.negative=1,this.strip()},Jt.prototype._wordDiv=function(Pr,xr){var Mr=this.length-Pr.length,Nr=this.clone(),Ur=Pr,Vr=Ur.words[Ur.length-1]|0,Zr=this._countBits(Vr);Mr=26-Zr,Mr!==0&&(Ur=Ur.ushln(Mr),Nr.iushln(Mr),Vr=Ur.words[Ur.length-1]|0);var Xr=Nr.length-Ur.length,Or;if(xr!=="mod"){Or=new Jt(null),Or.length=Xr+1,Or.words=new Array(Or.length);for(var jr=0;jr<Or.length;jr++)Or.words[jr]=0}var Jr=Nr.clone()._ishlnsubmul(Ur,1,Xr);Jr.negative===0&&(Nr=Jr,Or&&(Or.words[Xr]=1));for(var mn=Xr-1;mn>=0;mn--){var gn=(Nr.words[Ur.length+mn]|0)*67108864+(Nr.words[Ur.length+mn-1]|0);for(gn=Math.min(gn/Vr|0,67108863),Nr._ishlnsubmul(Ur,gn,mn);Nr.negative!==0;)gn--,Nr.negative=0,Nr._ishlnsubmul(Ur,1,mn),Nr.isZero()||(Nr.negative^=1);Or&&(Or.words[mn]=gn)}return Or&&Or.strip(),Nr.strip(),xr!=="div"&&Mr!==0&&Nr.iushrn(Mr),{div:Or||null,mod:Nr}},Jt.prototype.divmod=function(Pr,xr,Mr){if(Yt(!Pr.isZero()),this.isZero())return{div:new Jt(0),mod:new Jt(0)};var Nr,Ur,Vr;return this.negative!==0&&Pr.negative===0?(Vr=this.neg().divmod(Pr,xr),xr!=="mod"&&(Nr=Vr.div.neg()),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.iadd(Pr)),{div:Nr,mod:Ur}):this.negative===0&&Pr.negative!==0?(Vr=this.divmod(Pr.neg(),xr),xr!=="mod"&&(Nr=Vr.div.neg()),{div:Nr,mod:Vr.mod}):this.negative&Pr.negative?(Vr=this.neg().divmod(Pr.neg(),xr),xr!=="div"&&(Ur=Vr.mod.neg(),Mr&&Ur.negative!==0&&Ur.isub(Pr)),{div:Vr.div,mod:Ur}):Pr.length>this.length||this.cmp(Pr)<0?{div:new Jt(0),mod:this}:Pr.length===1?xr==="div"?{div:this.divn(Pr.words[0]),mod:null}:xr==="mod"?{div:null,mod:new Jt(this.modn(Pr.words[0]))}:{div:this.divn(Pr.words[0]),mod:new Jt(this.modn(Pr.words[0]))}:this._wordDiv(Pr,xr)},Jt.prototype.div=function(Pr){return this.divmod(Pr,"div",!1).div},Jt.prototype.mod=function(Pr){return this.divmod(Pr,"mod",!1).mod},Jt.prototype.umod=function(Pr){return this.divmod(Pr,"mod",!0).mod},Jt.prototype.divRound=function(Pr){var xr=this.divmod(Pr);if(xr.mod.isZero())return xr.div;var Mr=xr.div.negative!==0?xr.mod.isub(Pr):xr.mod,Nr=Pr.ushrn(1),Ur=Pr.andln(1),Vr=Mr.cmp(Nr);return Vr<0||Ur===1&&Vr===0?xr.div:xr.div.negative!==0?xr.div.isubn(1):xr.div.iaddn(1)},Jt.prototype.modn=function(Pr){Yt(Pr<=67108863);for(var xr=(1<<26)%Pr,Mr=0,Nr=this.length-1;Nr>=0;Nr--)Mr=(xr*Mr+(this.words[Nr]|0))%Pr;return Mr},Jt.prototype.idivn=function(Pr){Yt(Pr<=67108863);for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=(this.words[Mr]|0)+xr*67108864;this.words[Mr]=Nr/Pr|0,xr=Nr%Pr}return this.strip()},Jt.prototype.divn=function(Pr){return this.clone().idivn(Pr)},Jt.prototype.egcd=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=new Jt(0),Zr=new Jt(1),Xr=0;xr.isEven()&&Mr.isEven();)xr.iushrn(1),Mr.iushrn(1),++Xr;for(var Or=Mr.clone(),jr=xr.clone();!xr.isZero();){for(var Jr=0,mn=1;!(xr.words[0]&mn)&&Jr<26;++Jr,mn<<=1);if(Jr>0)for(xr.iushrn(Jr);Jr-- >0;)(Nr.isOdd()||Ur.isOdd())&&(Nr.iadd(Or),Ur.isub(jr)),Nr.iushrn(1),Ur.iushrn(1);for(var gn=0,eo=1;!(Mr.words[0]&eo)&&gn<26;++gn,eo<<=1);if(gn>0)for(Mr.iushrn(gn);gn-- >0;)(Vr.isOdd()||Zr.isOdd())&&(Vr.iadd(Or),Zr.isub(jr)),Vr.iushrn(1),Zr.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Vr),Ur.isub(Zr)):(Mr.isub(xr),Vr.isub(Nr),Zr.isub(Ur))}return{a:Vr,b:Zr,gcd:Mr.iushln(Xr)}},Jt.prototype._invmp=function(Pr){Yt(Pr.negative===0),Yt(!Pr.isZero());var xr=this,Mr=Pr.clone();xr.negative!==0?xr=xr.umod(Pr):xr=xr.clone();for(var Nr=new Jt(1),Ur=new Jt(0),Vr=Mr.clone();xr.cmpn(1)>0&&Mr.cmpn(1)>0;){for(var Zr=0,Xr=1;!(xr.words[0]&Xr)&&Zr<26;++Zr,Xr<<=1);if(Zr>0)for(xr.iushrn(Zr);Zr-- >0;)Nr.isOdd()&&Nr.iadd(Vr),Nr.iushrn(1);for(var Or=0,jr=1;!(Mr.words[0]&jr)&&Or<26;++Or,jr<<=1);if(Or>0)for(Mr.iushrn(Or);Or-- >0;)Ur.isOdd()&&Ur.iadd(Vr),Ur.iushrn(1);xr.cmp(Mr)>=0?(xr.isub(Mr),Nr.isub(Ur)):(Mr.isub(xr),Ur.isub(Nr))}var Jr;return xr.cmpn(1)===0?Jr=Nr:Jr=Ur,Jr.cmpn(0)<0&&Jr.iadd(Pr),Jr},Jt.prototype.gcd=function(Pr){if(this.isZero())return Pr.abs();if(Pr.isZero())return this.abs();var xr=this.clone(),Mr=Pr.clone();xr.negative=0,Mr.negative=0;for(var Nr=0;xr.isEven()&&Mr.isEven();Nr++)xr.iushrn(1),Mr.iushrn(1);do{for(;xr.isEven();)xr.iushrn(1);for(;Mr.isEven();)Mr.iushrn(1);var Ur=xr.cmp(Mr);if(Ur<0){var Vr=xr;xr=Mr,Mr=Vr}else if(Ur===0||Mr.cmpn(1)===0)break;xr.isub(Mr)}while(!0);return Mr.iushln(Nr)},Jt.prototype.invm=function(Pr){return this.egcd(Pr).a.umod(Pr)},Jt.prototype.isEven=function(){return(this.words[0]&1)===0},Jt.prototype.isOdd=function(){return(this.words[0]&1)===1},Jt.prototype.andln=function(Pr){return this.words[0]&Pr},Jt.prototype.bincn=function(Pr){Yt(typeof Pr=="number");var xr=Pr%26,Mr=(Pr-xr)/26,Nr=1<<xr;if(this.length<=Mr)return this._expand(Mr+1),this.words[Mr]|=Nr,this;for(var Ur=Nr,Vr=Mr;Ur!==0&&Vr<this.length;Vr++){var Zr=this.words[Vr]|0;Zr+=Ur,Ur=Zr>>>26,Zr&=67108863,this.words[Vr]=Zr}return Ur!==0&&(this.words[Vr]=Ur,this.length++),this},Jt.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Jt.prototype.cmpn=function(Pr){var xr=Pr<0;if(this.negative!==0&&!xr)return-1;if(this.negative===0&&xr)return 1;this.strip();var Mr;if(this.length>1)Mr=1;else{xr&&(Pr=-Pr),Yt(Pr<=67108863,"Number is too big");var Nr=this.words[0]|0;Mr=Nr===Pr?0:Nr<Pr?-1:1}return this.negative!==0?-Mr|0:Mr},Jt.prototype.cmp=function(Pr){if(this.negative!==0&&Pr.negative===0)return-1;if(this.negative===0&&Pr.negative!==0)return 1;var xr=this.ucmp(Pr);return this.negative!==0?-xr|0:xr},Jt.prototype.ucmp=function(Pr){if(this.length>Pr.length)return 1;if(this.length<Pr.length)return-1;for(var xr=0,Mr=this.length-1;Mr>=0;Mr--){var Nr=this.words[Mr]|0,Ur=Pr.words[Mr]|0;if(Nr!==Ur){Nr<Ur?xr=-1:Nr>Ur&&(xr=1);break}}return xr},Jt.prototype.gtn=function(Pr){return this.cmpn(Pr)===1},Jt.prototype.gt=function(Pr){return this.cmp(Pr)===1},Jt.prototype.gten=function(Pr){return this.cmpn(Pr)>=0},Jt.prototype.gte=function(Pr){return this.cmp(Pr)>=0},Jt.prototype.ltn=function(Pr){return this.cmpn(Pr)===-1},Jt.prototype.lt=function(Pr){return this.cmp(Pr)===-1},Jt.prototype.lten=function(Pr){return this.cmpn(Pr)<=0},Jt.prototype.lte=function(Pr){return this.cmp(Pr)<=0},Jt.prototype.eqn=function(Pr){return this.cmpn(Pr)===0},Jt.prototype.eq=function(Pr){return this.cmp(Pr)===0},Jt.red=function(Pr){return new En(Pr)},Jt.prototype.toRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),Yt(this.negative===0,"red works only with positives"),Pr.convertTo(this)._forceRed(Pr)},Jt.prototype.fromRed=function(){return Yt(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Jt.prototype._forceRed=function(Pr){return this.red=Pr,this},Jt.prototype.forceRed=function(Pr){return Yt(!this.red,"Already a number in reduction context"),this._forceRed(Pr)},Jt.prototype.redAdd=function(Pr){return Yt(this.red,"redAdd works only with red numbers"),this.red.add(this,Pr)},Jt.prototype.redIAdd=function(Pr){return Yt(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Pr)},Jt.prototype.redSub=function(Pr){return Yt(this.red,"redSub works only with red numbers"),this.red.sub(this,Pr)},Jt.prototype.redISub=function(Pr){return Yt(this.red,"redISub works only with red numbers"),this.red.isub(this,Pr)},Jt.prototype.redShl=function(Pr){return Yt(this.red,"redShl works only with red numbers"),this.red.shl(this,Pr)},Jt.prototype.redMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.mul(this,Pr)},Jt.prototype.redIMul=function(Pr){return Yt(this.red,"redMul works only with red numbers"),this.red._verify2(this,Pr),this.red.imul(this,Pr)},Jt.prototype.redSqr=function(){return Yt(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Jt.prototype.redISqr=function(){return Yt(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Jt.prototype.redSqrt=function(){return Yt(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Jt.prototype.redInvm=function(){return Yt(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Jt.prototype.redNeg=function(){return Yt(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Jt.prototype.redPow=function(Pr){return Yt(this.red&&!Pr.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Pr)};var Gr={k256:null,p224:null,p192:null,p25519:null};function Kr(dn,Pr){this.name=dn,this.p=new Jt(Pr,16),this.n=this.p.bitLength(),this.k=new Jt(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Kr.prototype._tmp=function(){var Pr=new Jt(null);return Pr.words=new Array(Math.ceil(this.n/13)),Pr},Kr.prototype.ireduce=function(Pr){var xr=Pr,Mr;do this.split(xr,this.tmp),xr=this.imulK(xr),xr=xr.iadd(this.tmp),Mr=xr.bitLength();while(Mr>this.n);var Nr=Mr<this.n?-1:xr.ucmp(this.p);return Nr===0?(xr.words[0]=0,xr.length=1):Nr>0?xr.isub(this.p):xr.strip(),xr},Kr.prototype.split=function(Pr,xr){Pr.iushrn(this.n,0,xr)},Kr.prototype.imulK=function(Pr){return Pr.imul(this.k)};function Yr(){Kr.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Xt(Yr,Kr),Yr.prototype.split=function(Pr,xr){for(var Mr=4194303,Nr=Math.min(Pr.length,9),Ur=0;Ur<Nr;Ur++)xr.words[Ur]=Pr.words[Ur];if(xr.length=Nr,Pr.length<=9){Pr.words[0]=0,Pr.length=1;return}var Vr=Pr.words[9];for(xr.words[xr.length++]=Vr&Mr,Ur=10;Ur<Pr.length;Ur++){var Zr=Pr.words[Ur]|0;Pr.words[Ur-10]=(Zr&Mr)<<4|Vr>>>22,Vr=Zr}Vr>>>=22,Pr.words[Ur-10]=Vr,Vr===0&&Pr.length>10?Pr.length-=10:Pr.length-=9},Yr.prototype.imulK=function(Pr){Pr.words[Pr.length]=0,Pr.words[Pr.length+1]=0,Pr.length+=2;for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=Pr.words[Mr]|0;xr+=Nr*977,Pr.words[Mr]=xr&67108863,xr=Nr*64+(xr/67108864|0)}return Pr.words[Pr.length-1]===0&&(Pr.length--,Pr.words[Pr.length-1]===0&&Pr.length--),Pr};function hn(){Kr.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Xt(hn,Kr);function Qr(){Kr.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Xt(Qr,Kr);function pn(){Kr.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Xt(pn,Kr),pn.prototype.imulK=function(Pr){for(var xr=0,Mr=0;Mr<Pr.length;Mr++){var Nr=(Pr.words[Mr]|0)*19+xr,Ur=Nr&67108863;Nr>>>=26,Pr.words[Mr]=Ur,xr=Nr}return xr!==0&&(Pr.words[Pr.length++]=xr),Pr},Jt._prime=function(Pr){if(Gr[Pr])return Gr[Pr];var xr;if(Pr==="k256")xr=new Yr;else if(Pr==="p224")xr=new hn;else if(Pr==="p192")xr=new Qr;else if(Pr==="p25519")xr=new pn;else throw new Error("Unknown prime "+Pr);return Gr[Pr]=xr,xr};function En(dn){if(typeof dn=="string"){var Pr=Jt._prime(dn);this.m=Pr.p,this.prime=Pr}else Yt(dn.gtn(1),"modulus must be greater than 1"),this.m=dn,this.prime=null}En.prototype._verify1=function(Pr){Yt(Pr.negative===0,"red works only with positives"),Yt(Pr.red,"red works only with red numbers")},En.prototype._verify2=function(Pr,xr){Yt((Pr.negative|xr.negative)===0,"red works only with positives"),Yt(Pr.red&&Pr.red===xr.red,"red works only with red numbers")},En.prototype.imod=function(Pr){return this.prime?this.prime.ireduce(Pr)._forceRed(this):Pr.umod(this.m)._forceRed(this)},En.prototype.neg=function(Pr){return Pr.isZero()?Pr.clone():this.m.sub(Pr)._forceRed(this)},En.prototype.add=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.add(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr._forceRed(this)},En.prototype.iadd=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.iadd(xr);return Mr.cmp(this.m)>=0&&Mr.isub(this.m),Mr},En.prototype.sub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.sub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr._forceRed(this)},En.prototype.isub=function(Pr,xr){this._verify2(Pr,xr);var Mr=Pr.isub(xr);return Mr.cmpn(0)<0&&Mr.iadd(this.m),Mr},En.prototype.shl=function(Pr,xr){return this._verify1(Pr),this.imod(Pr.ushln(xr))},En.prototype.imul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.imul(xr))},En.prototype.mul=function(Pr,xr){return this._verify2(Pr,xr),this.imod(Pr.mul(xr))},En.prototype.isqr=function(Pr){return this.imul(Pr,Pr.clone())},En.prototype.sqr=function(Pr){return this.mul(Pr,Pr)},En.prototype.sqrt=function(Pr){if(Pr.isZero())return Pr.clone();var xr=this.m.andln(3);if(Yt(xr%2===1),xr===3){var Mr=this.m.add(new Jt(1)).iushrn(2);return this.pow(Pr,Mr)}for(var Nr=this.m.subn(1),Ur=0;!Nr.isZero()&&Nr.andln(1)===0;)Ur++,Nr.iushrn(1);Yt(!Nr.isZero());var Vr=new Jt(1).toRed(this),Zr=Vr.redNeg(),Xr=this.m.subn(1).iushrn(1),Or=this.m.bitLength();for(Or=new Jt(2*Or*Or).toRed(this);this.pow(Or,Xr).cmp(Zr)!==0;)Or.redIAdd(Zr);for(var jr=this.pow(Or,Nr),Jr=this.pow(Pr,Nr.addn(1).iushrn(1)),mn=this.pow(Pr,Nr),gn=Ur;mn.cmp(Vr)!==0;){for(var eo=mn,_i=0;eo.cmp(Vr)!==0;_i++)eo=eo.redSqr();Yt(_i<gn);var ro=this.pow(jr,new Jt(1).iushln(gn-_i-1));Jr=Jr.redMul(ro),jr=ro.redSqr(),mn=mn.redMul(jr),gn=_i}return Jr},En.prototype.invm=function(Pr){var xr=Pr._invmp(this.m);return xr.negative!==0?(xr.negative=0,this.imod(xr).redNeg()):this.imod(xr)},En.prototype.pow=function(Pr,xr){if(xr.isZero())return new Jt(1).toRed(this);if(xr.cmpn(1)===0)return Pr.clone();var Mr=4,Nr=new Array(1<<Mr);Nr[0]=new Jt(1).toRed(this),Nr[1]=Pr;for(var Ur=2;Ur<Nr.length;Ur++)Nr[Ur]=this.mul(Nr[Ur-1],Pr);var Vr=Nr[0],Zr=0,Xr=0,Or=xr.bitLength()%26;for(Or===0&&(Or=26),Ur=xr.length-1;Ur>=0;Ur--){for(var jr=xr.words[Ur],Jr=Or-1;Jr>=0;Jr--){var mn=jr>>Jr&1;if(Vr!==Nr[0]&&(Vr=this.sqr(Vr)),mn===0&&Zr===0){Xr=0;continue}Zr<<=1,Zr|=mn,Xr++,!(Xr!==Mr&&(Ur!==0||Jr!==0))&&(Vr=this.mul(Vr,Nr[Zr]),Xr=0,Zr=0)}Or=26}return Vr},En.prototype.convertTo=function(Pr){var xr=Pr.umod(this.m);return xr===Pr?xr.clone():xr},En.prototype.convertFrom=function(Pr){var xr=Pr.clone();return xr.red=null,xr},Jt.mont=function(Pr){return new ga(Pr)};function ga(dn){En.call(this,dn),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Jt(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Xt(ga,En),ga.prototype.convertTo=function(Pr){return this.imod(Pr.ushln(this.shift))},ga.prototype.convertFrom=function(Pr){var xr=this.imod(Pr.mul(this.rinv));return xr.red=null,xr},ga.prototype.imul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return Pr.words[0]=0,Pr.length=1,Pr;var Mr=Pr.imul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.mul=function(Pr,xr){if(Pr.isZero()||xr.isZero())return new Jt(0)._forceRed(this);var Mr=Pr.mul(xr),Nr=Mr.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Ur=Mr.isub(Nr).iushrn(this.shift),Vr=Ur;return Ur.cmp(this.m)>=0?Vr=Ur.isub(this.m):Ur.cmpn(0)<0&&(Vr=Ur.iadd(this.m)),Vr._forceRed(this)},ga.prototype.invm=function(Pr){var xr=this.imod(Pr._invmp(this.m).mul(this.r2));return xr._forceRed(this)}})(Bt,commonjsGlobal)})(bn$1);bn$1.exports;function convertUtf8ToHex(Bt,Wt){return utf8ToHex(Bt,!Wt)}const payloadId=payloadId$2;function getInfuraRpcUrl(Bt,Wt){let Gt;const Yt=infuraNetworks[Bt];return Yt&&(Gt=`https://${Yt}.infura.io/v3/${Wt}`),Gt}function getRpcUrl(Bt,Wt){let Gt;const Yt=getInfuraRpcUrl(Bt,Wt.infuraId);return Wt.custom&&Wt.custom[Bt]?Gt=Wt.custom[Bt]:Yt&&(Gt=Yt),Gt}function isEmptyArray(Bt){return!(Bt&&Bt.length)}function isHexString$1(Bt,Wt){return isHexString$3(Bt,Wt)}function parsePersonalSign(Bt){return!isEmptyArray(Bt)&&!isHexString$1(Bt[0])&&(Bt[0]=convertUtf8ToHex(Bt[0])),Bt}var queryString$1={};(function(Bt){const Wt=strictUriEncode,Gt=decodeUriComponent,Yt=splitOnFirst,Xt=Br=>Br==null;function Jt(Br){switch(Br.arrayFormat){case"index":return Wr=>(Gr,Kr)=>{const Yr=Gr.length;return Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[",Yr,"]"].join("")]:[...Gr,[ur(Wr,Br),"[",ur(Yr,Br),"]=",ur(Kr,Br)].join("")]};case"bracket":return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,[ur(Wr,Br),"[]"].join("")]:[...Gr,[ur(Wr,Br),"[]=",ur(Kr,Br)].join("")];case"comma":case"separator":return Wr=>(Gr,Kr)=>Kr==null||Kr.length===0?Gr:Gr.length===0?[[ur(Wr,Br),"=",ur(Kr,Br)].join("")]:[[Gr,ur(Kr,Br)].join(Br.arrayFormatSeparator)];default:return Wr=>(Gr,Kr)=>Kr===void 0||Br.skipNull&&Kr===null||Br.skipEmptyString&&Kr===""?Gr:Kr===null?[...Gr,ur(Wr,Br)]:[...Gr,[ur(Wr,Br),"=",ur(Kr,Br)].join("")]}}function Zt(Br){let Wr;switch(Br.arrayFormat){case"index":return(Gr,Kr,Yr)=>{if(Wr=/\[(\d*)\]$/.exec(Gr),Gr=Gr.replace(/\[\d*\]$/,""),!Wr){Yr[Gr]=Kr;return}Yr[Gr]===void 0&&(Yr[Gr]={}),Yr[Gr][Wr[1]]=Kr};case"bracket":return(Gr,Kr,Yr)=>{if(Wr=/(\[\])$/.exec(Gr),Gr=Gr.replace(/\[\]$/,""),!Wr){Yr[Gr]=Kr;return}if(Yr[Gr]===void 0){Yr[Gr]=[Kr];return}Yr[Gr]=[].concat(Yr[Gr],Kr)};case"comma":case"separator":return(Gr,Kr,Yr)=>{const Qr=typeof Kr=="string"&&Kr.split("").indexOf(Br.arrayFormatSeparator)>-1?Kr.split(Br.arrayFormatSeparator).map(pn=>cr(pn,Br)):Kr===null?Kr:cr(Kr,Br);Yr[Gr]=Qr};default:return(Gr,Kr,Yr)=>{if(Yr[Gr]===void 0){Yr[Gr]=Kr;return}Yr[Gr]=[].concat(Yr[Gr],Kr)}}}function Qt(Br){if(typeof Br!="string"||Br.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function ur(Br,Wr){return Wr.encode?Wr.strict?Wt(Br):encodeURIComponent(Br):Br}function cr(Br,Wr){return Wr.decode?Gt(Br):Br}function $r(Br){return Array.isArray(Br)?Br.sort():typeof Br=="object"?$r(Object.keys(Br)).sort((Wr,Gr)=>Number(Wr)-Number(Gr)).map(Wr=>Br[Wr]):Br}function Ar(Br){const Wr=Br.indexOf("#");return Wr!==-1&&(Br=Br.slice(0,Wr)),Br}function Lr(Br){let Wr="";const Gr=Br.indexOf("#");return Gr!==-1&&(Wr=Br.slice(Gr)),Wr}function qr(Br){Br=Ar(Br);const Wr=Br.indexOf("?");return Wr===-1?"":Br.slice(Wr+1)}function Fr(Br,Wr){return Wr.parseNumbers&&!Number.isNaN(Number(Br))&&typeof Br=="string"&&Br.trim()!==""?Br=Number(Br):Wr.parseBooleans&&Br!==null&&(Br.toLowerCase()==="true"||Br.toLowerCase()==="false")&&(Br=Br.toLowerCase()==="true"),Br}function Hr(Br,Wr){Wr=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Zt(Wr),Kr=Object.create(null);if(typeof Br!="string"||(Br=Br.trim().replace(/^[?#&]/,""),!Br))return Kr;for(const Yr of Br.split("&")){let[hn,Qr]=Yt(Wr.decode?Yr.replace(/\+/g," "):Yr,"=");Qr=Qr===void 0?null:["comma","separator"].includes(Wr.arrayFormat)?Qr:cr(Qr,Wr),Gr(cr(hn,Wr),Qr,Kr)}for(const Yr of Object.keys(Kr)){const hn=Kr[Yr];if(typeof hn=="object"&&hn!==null)for(const Qr of Object.keys(hn))hn[Qr]=Fr(hn[Qr],Wr);else Kr[Yr]=Fr(hn,Wr)}return Wr.sort===!1?Kr:(Wr.sort===!0?Object.keys(Kr).sort():Object.keys(Kr).sort(Wr.sort)).reduce((Yr,hn)=>{const Qr=Kr[hn];return Qr&&typeof Qr=="object"&&!Array.isArray(Qr)?Yr[hn]=$r(Qr):Yr[hn]=Qr,Yr},Object.create(null))}Bt.extract=qr,Bt.parse=Hr,Bt.stringify=(Br,Wr)=>{if(!Br)return"";Wr=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Wr),Qt(Wr.arrayFormatSeparator);const Gr=Qr=>Wr.skipNull&&Xt(Br[Qr])||Wr.skipEmptyString&&Br[Qr]==="",Kr=Jt(Wr),Yr={};for(const Qr of Object.keys(Br))Gr(Qr)||(Yr[Qr]=Br[Qr]);const hn=Object.keys(Yr);return Wr.sort!==!1&&hn.sort(Wr.sort),hn.map(Qr=>{const pn=Br[Qr];return pn===void 0?"":pn===null?ur(Qr,Wr):Array.isArray(pn)?pn.reduce(Kr(Qr),[]).join("&"):ur(Qr,Wr)+"="+ur(pn,Wr)}).filter(Qr=>Qr.length>0).join("&")},Bt.parseUrl=(Br,Wr)=>{Wr=Object.assign({decode:!0},Wr);const[Gr,Kr]=Yt(Br,"#");return Object.assign({url:Gr.split("?")[0]||"",query:Hr(qr(Br),Wr)},Wr&&Wr.parseFragmentIdentifier&&Kr?{fragmentIdentifier:cr(Kr,Wr)}:{})},Bt.stringifyUrl=(Br,Wr)=>{Wr=Object.assign({encode:!0,strict:!0},Wr);const Gr=Ar(Br.url).split("?")[0]||"",Kr=Bt.extract(Br.url),Yr=Bt.parse(Kr,{sort:!1}),hn=Object.assign(Yr,Br.query);let Qr=Bt.stringify(hn,Wr);Qr&&(Qr=`?${Qr}`);let pn=Lr(Br.url);return Br.fragmentIdentifier&&(pn=`#${ur(Br.fragmentIdentifier,Wr)}`),`${Gr}${Qr}${pn}`}})(queryString$1);const ProviderEngine=web3ProviderEngine,CacheSubprovider=cache,FixtureSubprovider=fixture,FilterSubprovider=filters,HookedWalletSubprovider=hookedWallet,NonceSubprovider=nonceTracker,SubscriptionsSubprovider=subscriptions;class WalletConnectProvider extends ProviderEngine{constructor(Wt){if(super({pollingInterval:Wt.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=QRCodeModal,this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{const Gt=await this.getWalletConnector();if(Gt)return this.start(),this.subscribeWalletConnector(),Gt.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async Gt=>this.send(Gt),this.send=async(Gt,Yt)=>{var Xt;if(typeof Gt=="string"){const Jt=Gt;let Zt=Yt;return Jt==="personal_sign"&&(Zt=parsePersonalSign(Zt)),this.sendAsyncPromise(Jt,Zt)}if(Gt=Object.assign({id:payloadId(),jsonrpc:"2.0"},Gt),Gt.method==="personal_sign"&&(Gt.params=parsePersonalSign(Gt.params)),Yt){this.sendAsync(Gt,Yt);return}if(Gt.method==="eth_signTypedData_v4"&&((Xt=this.walletMeta)===null||Xt===void 0?void 0:Xt.name)==="MetaMask"){const{result:Jt}=await this.handleOtherRequests(Gt);return Jt}else return this.sendAsyncPromise(Gt.method,Gt.params)},this.onConnect=Gt=>{this.connectCallbacks.push(Gt)},this.triggerConnect=Gt=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(Yt=>Yt(Gt))},this.bridge=Wt.connector?Wt.connector.bridge:Wt.bridge||"https://bridge.walletconnect.org",this.qrcode=typeof Wt.qrcode>"u"||Wt.qrcode!==!1,this.qrcodeModal=Wt.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=Wt.qrcodeModalOptions,this.wc=Wt.connector||new WalletConnect({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:Wt==null?void 0:Wt.storageId,signingMethods:Wt==null?void 0:Wt.signingMethods,clientMeta:Wt==null?void 0:Wt.clientMeta}),this.rpc=Wt.rpc||null,!this.rpc&&(!Wt.infuraId||typeof Wt.infuraId!="string"||!Wt.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=Wt.infuraId||"",this.chainId=(Wt==null?void 0:Wt.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){await(await this.getWalletConnector({disableSessionCreation:!0})).killSession(),await this.onDisconnect()}async handleRequest(Wt){try{let Gt,Yt=null;const Xt=await this.getWalletConnector();switch(Wt.method){case"wc_killSession":await this.close(),Yt=null;break;case"eth_accounts":Yt=Xt.accounts;break;case"eth_coinbase":Yt=Xt.accounts[0];break;case"eth_chainId":Yt=Xt.chainId;break;case"net_version":Yt=Xt.chainId;break;case"eth_uninstallFilter":this.sendAsync(Wt,Jt=>Jt),Yt=!0;break;default:Gt=await this.handleOtherRequests(Wt)}return Gt||this.formatResponse(Wt,Yt)}catch(Gt){throw this.emit("error",Gt),Gt}}async handleOtherRequests(Wt){if(!signingMethods.includes(Wt.method)&&Wt.method.startsWith("eth_"))return this.handleReadRequests(Wt);const Yt=await(await this.getWalletConnector()).sendCustomRequest(Wt);return this.formatResponse(Wt,Yt)}async handleReadRequests(Wt){if(!this.http){const Gt=new Error("HTTP Connection not available");throw this.emit("error",Gt),Gt}return this.http.send(Wt)}formatResponse(Wt,Gt){return{id:Wt.id,jsonrpc:Wt.jsonrpc,result:Gt}}getWalletConnector(Wt={}){const{disableSessionCreation:Gt=!1}=Wt;return new Promise((Yt,Xt)=>{const Jt=this.wc;this.isConnecting?this.onConnect(Zt=>Yt(Zt)):!Jt.connected&&!Gt?(this.isConnecting=!0,Jt.on("modal_closed",()=>{Xt(new Error("User closed modal"))}),Jt.createSession({chainId:this.chainId}).then(()=>{Jt.on("connect",(Zt,Qt)=>{if(Zt)return this.isConnecting=!1,Xt(Zt);this.isConnecting=!1,this.connected=!0,Qt&&this.updateState(Qt.params[0]),this.emit("connect"),this.triggerConnect(Jt),Yt(Jt)})}).catch(Zt=>{this.isConnecting=!1,Xt(Zt)})):(this.connected||(this.connected=!0,this.updateState(Jt.session)),Yt(Jt))})}async subscribeWalletConnector(){const Wt=await this.getWalletConnector();Wt.on("disconnect",Gt=>{if(Gt){this.emit("error",Gt);return}this.onDisconnect()}),Wt.on("session_update",(Gt,Yt)=>{if(Gt){this.emit("error",Gt);return}this.updateState(Yt.params[0])})}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(Wt){const{accounts:Gt,chainId:Yt,networkId:Xt,rpcUrl:Jt}=Wt;(!this.accounts||Gt&&this.accounts!==Gt)&&(this.accounts=Gt,this.emit("accountsChanged",Gt)),(!this.chainId||Yt&&this.chainId!==Yt)&&(this.chainId=Yt,this.emit("chainChanged",Yt)),(!this.networkId||Xt&&this.networkId!==Xt)&&(this.networkId=Xt,this.emit("networkChanged",Xt)),this.updateRpcUrl(this.chainId,Jt||"")}updateRpcUrl(Wt,Gt=""){const Yt={infuraId:this.infuraId,custom:this.rpc||void 0};Gt=Gt||getRpcUrl(Wt,Yt),Gt?(this.rpcUrl=Gt,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${Wt}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new HTTPConnection(this.rpcUrl),this.http.on("payload",Wt=>this.emit("payload",Wt)),this.http.on("error",Wt=>this.emit("error",Wt)))}sendAsyncPromise(Wt,Gt){return new Promise((Yt,Xt)=>{this.sendAsync({id:payloadId(),jsonrpc:"2.0",method:Wt,params:Gt||[]},(Jt,Zt)=>{if(Jt){Xt(Jt);return}Yt(Zt.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new FixtureSubprovider({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new CacheSubprovider),this.addProvider(new SubscriptionsSubprovider),this.addProvider(new FilterSubprovider),this.addProvider(new NonceSubprovider),this.addProvider(new HookedWalletSubprovider(this.configWallet())),this.addProvider({handleRequest:async(Wt,Gt,Yt)=>{try{const{error:Xt,result:Jt}=await this.handleRequest(Wt);Yt(Xt,Jt)}catch(Xt){Yt(Xt)}},setEngine:Wt=>Wt})}configWallet(){return{getAccounts:async Wt=>{try{const Yt=(await this.getWalletConnector()).accounts;Yt&&Yt.length?Wt(null,Yt):Wt(new Error("Failed to get accounts"))}catch(Gt){Wt(Gt)}},processMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signMessage([Wt.from,Wt.data]);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processPersonalMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signPersonalMessage([Wt.data,Wt.from]);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processSignTransaction:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signTransaction(Wt);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processTransaction:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).sendTransaction(Wt);Gt(null,Xt)}catch(Yt){Gt(Yt)}},processTypedMessage:async(Wt,Gt)=>{try{const Xt=await(await this.getWalletConnector()).signTypedData([Wt.from,Wt.data]);Gt(null,Xt)}catch(Yt){Gt(Yt)}}}}}const esm$4=Object.freeze(Object.defineProperty({__proto__:null,default:WalletConnectProvider},Symbol.toStringTag,{value:"Module"})),require$$4$2=getAugmentedNamespace(esm$4);var __createBinding$_=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Object.defineProperty(Bt,Yt,{enumerable:!0,get:function(){return Wt[Gt]}})}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$_=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$_=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$_(Wt,Bt,Gt);return __setModuleDefault$_(Wt,Bt),Wt},__awaiter$E=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(WalletConnectConnector$1,"__esModule",{value:!0});WalletConnectConnector$1.WalletConnectConnector=WalletConnectConnector$1.BaseWalletConnectConnector=WalletConnectConnector$1.UserRejectedRequestError=WalletConnectConnector$1.URI_AVAILABLE=void 0;const chain_id_1$6=requireChainId$4(),provider_type_1$3=providerType$4,abstract_connector_1=require$$2$3,configuration_1$3=configuration$1;WalletConnectConnector$1.URI_AVAILABLE="URI_AVAILABLE";class UserRejectedRequestError extends Error{constructor(){super(),this.name=this.constructor.name,this.message="The user rejected the request."}}WalletConnectConnector$1.UserRejectedRequestError=UserRejectedRequestError;function getSupportedChains({supportedChainIds:Bt,rpc:Wt}){return Bt||(Wt?Object.keys(Wt).map(Gt=>Number(Gt)):void 0)}class BaseWalletConnectConnector extends abstract_connector_1.AbstractConnector{constructor(Wt){super({supportedChainIds:getSupportedChains(Wt)}),this.config=Wt,this.handleChainChanged=this.handleChainChanged.bind(this),this.handleAccountsChanged=this.handleAccountsChanged.bind(this),this.handleDisconnect=this.handleDisconnect.bind(this)}activate(){return __awaiter$E(this,void 0,void 0,function*(){if(!this.walletConnectProvider){const Gt=yield Promise.resolve().then(()=>__importStar$_(require$$4$2)).then(Yt=>{var Xt;return(Xt=Yt==null?void 0:Yt.default)!==null&&Xt!==void 0?Xt:Yt});this.walletConnectProvider=new Gt(Object.assign(Object.assign({},this.config),{chainId:this.config.defaultChainId||chain_id_1$6.ChainId.ETHEREUM_MAINNET}))}let Wt="";return BaseWalletConnectConnector.isEnabling||(BaseWalletConnectConnector.isEnabling=!0,Wt=yield this.walletConnectProvider.enable().then(Gt=>Gt[0]).catch(Gt=>{throw Gt.message==="User closed modal"?new UserRejectedRequestError:Gt}).finally(()=>{BaseWalletConnectConnector.isEnabling=!1})),this.walletConnectProvider.on("disconnect",this.handleDisconnect),this.walletConnectProvider.on("chainChanged",this.handleChainChanged),this.walletConnectProvider.on("accountsChanged",this.handleAccountsChanged),{provider:this.walletConnectProvider,account:Wt}})}getProvider(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider})}getChainId(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider.send("eth_chainId")})}getAccount(){return __awaiter$E(this,void 0,void 0,function*(){return this.walletConnectProvider.send("eth_accounts").then(Wt=>Wt[0])})}deactivate(){this.walletConnectProvider&&(this.walletConnectProvider.stop(),this.walletConnectProvider.removeListener("disconnect",this.handleDisconnect),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged))}close(){var Wt;return __awaiter$E(this,void 0,void 0,function*(){yield(Wt=this.walletConnectProvider)===null||Wt===void 0?void 0:Wt.close()})}handleChainChanged(Wt){this.emitUpdate({chainId:Wt})}handleAccountsChanged(Wt){this.emitUpdate({account:Wt[0]})}handleDisconnect(){this.emitDeactivate(),this.walletConnectProvider&&(this.walletConnectProvider.stop(),this.walletConnectProvider.removeListener("chainChanged",this.handleChainChanged),this.walletConnectProvider.removeListener("accountsChanged",this.handleAccountsChanged),this.walletConnectProvider=void 0),this.emitDeactivate()}}WalletConnectConnector$1.BaseWalletConnectConnector=BaseWalletConnectConnector;BaseWalletConnectConnector.isEnabling=!1;class WalletConnectConnector extends BaseWalletConnectConnector{constructor(Wt=chain_id_1$6.ChainId.ETHEREUM_MAINNET){const{urls:Gt}=configuration_1$3.getConfiguration()[provider_type_1$3.ProviderType.WALLET_CONNECT],Yt={rpc:Gt,qrcode:!0,pollingInterval:15e4,defaultChainId:Wt};super(Yt),this.params=Yt}getRpc(){return __awaiter$E(this,void 0,void 0,function*(){const Wt=yield this.getChainId();return this.params.rpc[Wt]})}getQrCode(){return this.params.qrcode}getPollingInterval(){return this.params.pollingInterval}}WalletConnectConnector$1.WalletConnectConnector=WalletConnectConnector;WalletConnectConnector.clearStorage=Bt=>{Bt.removeRegExp(new RegExp("\\bwalletconnect\\b"))};var WalletLinkConnector$2={};const scriptRel="modulepreload",assetsURL=function(Bt){return"https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/"+Bt},seen={},__vitePreload=function(Wt,Gt,Yt){if(!Gt||Gt.length===0)return Wt();const Xt=document.getElementsByTagName("link");return Promise.all(Gt.map(Jt=>{if(Jt=assetsURL(Jt),Jt in seen)return;seen[Jt]=!0;const Zt=Jt.endsWith(".css"),Qt=Zt?'[rel="stylesheet"]':"";if(!!Yt)for(let $r=Xt.length-1;$r>=0;$r--){const Ar=Xt[$r];if(Ar.href===Jt&&(!Zt||Ar.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Jt}"]${Qt}`))return;const cr=document.createElement("link");if(cr.rel=Zt?"stylesheet":scriptRel,Zt||(cr.as="script",cr.crossOrigin=""),cr.href=Jt,document.head.appendChild(cr),Zt)return new Promise(($r,Ar)=>{cr.addEventListener("load",$r),cr.addEventListener("error",()=>Ar(new Error(`Unable to preload CSS for ${Jt}`)))})})).then(()=>Wt())};function _extends$B(){return _extends$B=Object.assign||function(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt];for(var Yt in Gt)Object.prototype.hasOwnProperty.call(Gt,Yt)&&(Bt[Yt]=Gt[Yt])}return Bt},_extends$B.apply(this,arguments)}function _inheritsLoose$1(Bt,Wt){Bt.prototype=Object.create(Wt.prototype),Bt.prototype.constructor=Bt,_setPrototypeOf$Q(Bt,Wt)}function _setPrototypeOf$Q(Bt,Wt){return _setPrototypeOf$Q=Object.setPrototypeOf||function(Yt,Xt){return Yt.__proto__=Xt,Yt},_setPrototypeOf$Q(Bt,Wt)}function _assertThisInitialized$Q(Bt){if(Bt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt}var CHAIN_ID$3=1,WalletLinkConnector$1=function(Bt){_inheritsLoose$1(Wt,Bt);function Wt(Yt){var Xt,Jt=Yt.url,Zt=Yt.appName,Qt=Yt.appLogoUrl,ur=Yt.darkMode,cr=Yt.supportedChainIds;return Xt=Bt.call(this,{supportedChainIds:cr})||this,Xt.url=Jt,Xt.appName=Zt,Xt.appLogoUrl=Qt,Xt.darkMode=ur||!1,Xt.handleChainChanged=Xt.handleChainChanged.bind(_assertThisInitialized$Q(Xt)),Xt.handleAccountsChanged=Xt.handleAccountsChanged.bind(_assertThisInitialized$Q(Xt)),Xt}var Gt=Wt.prototype;return Gt.activate=function(){try{var Xt=this,Jt=function(){return Promise.resolve(Xt.provider.request({method:"eth_requestAccounts"})).then(function(ur){var cr=ur[0];return Xt.provider.on("chainChanged",Xt.handleChainChanged),Xt.provider.on("accountsChanged",Xt.handleAccountsChanged),{provider:Xt.provider,account:cr}})},Zt=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)Xt.provider=window.ethereum;else{var Qt=function(){if(!Xt.walletLink)return Promise.resolve(__vitePreload(()=>import("./index-c2b0e4a1.js").then(ur=>ur.i),[]).then(function(ur){var cr;return(cr=ur==null?void 0:ur.default)!=null?cr:ur})).then(function(ur){Xt.walletLink=new ur(_extends$B({appName:Xt.appName,darkMode:Xt.darkMode},Xt.appLogoUrl?{appLogoUrl:Xt.appLogoUrl}:{})),Xt.provider=Xt.walletLink.makeWeb3Provider(Xt.url,CHAIN_ID$3)})}();if(Qt&&Qt.then)return Qt.then(function(){})}}();return Promise.resolve(Zt&&Zt.then?Zt.then(Jt):Jt(Zt))}catch(Qt){return Promise.reject(Qt)}},Gt.getProvider=function(){try{var Xt=this;return Promise.resolve(Xt.provider)}catch(Jt){return Promise.reject(Jt)}},Gt.getChainId=function(){try{var Xt=this;return Promise.resolve(Xt.provider.chainId)}catch(Jt){return Promise.reject(Jt)}},Gt.getAccount=function(){try{var Xt=this;return Promise.resolve(Xt.provider.request({method:"eth_requestAccounts"})).then(function(Jt){return Jt[0]})}catch(Jt){return Promise.reject(Jt)}},Gt.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},Gt.close=function(){try{var Xt=this;return Xt.provider.close(),Xt.emitDeactivate(),Promise.resolve()}catch(Jt){return Promise.reject(Jt)}},Gt.handleChainChanged=function(Xt){this.emitUpdate({chainId:Xt})},Gt.handleAccountsChanged=function(Xt){this.emitUpdate({account:Xt[0]})},Wt}(AbstractConnector);const walletlinkConnector_esm=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:WalletLinkConnector$1},Symbol.toStringTag,{value:"Module"})),require$$1$8=getAugmentedNamespace(walletlinkConnector_esm);Object.defineProperty(WalletLinkConnector$2,"__esModule",{value:!0});WalletLinkConnector$2.WalletLinkConnector=void 0;const schemas_1$4=dist$m,walletlink_connector_1=require$$1$8,configuration_1$2=configuration$1;class WalletLinkConnector extends walletlink_connector_1.WalletLinkConnector{constructor(Wt){const Gt=configuration_1$2.getConfiguration()[schemas_1$4.ProviderType.WALLET_LINK];super({url:Gt.urls[Wt],appName:Gt.appName,supportedChainIds:[Wt]})}}WalletLinkConnector$2.WalletLinkConnector=WalletLinkConnector;var WalletConnectV2Connector$1={},index_cjs$1={},chacha20poly1305={},chacha={},binary={},int={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});function Wt(Qt,ur){var cr=Qt>>>16&65535,$r=Qt&65535,Ar=ur>>>16&65535,Lr=ur&65535;return $r*Lr+(cr*Lr+$r*Ar<<16>>>0)|0}Bt.mul=Math.imul||Wt;function Gt(Qt,ur){return Qt+ur|0}Bt.add=Gt;function Yt(Qt,ur){return Qt-ur|0}Bt.sub=Yt;function Xt(Qt,ur){return Qt<<ur|Qt>>>32-ur}Bt.rotl=Xt;function Jt(Qt,ur){return Qt<<32-ur|Qt>>>ur}Bt.rotr=Jt;function Zt(Qt){return typeof Qt=="number"&&isFinite(Qt)&&Math.floor(Qt)===Qt}Bt.isInteger=Number.isInteger||Zt,Bt.MAX_SAFE_INTEGER=9007199254740991,Bt.isSafeInteger=function(Qt){return Bt.isInteger(Qt)&&Qt>=-Bt.MAX_SAFE_INTEGER&&Qt<=Bt.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+0]<<8|Bt[Wt+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+0]<<8|Bt[Wt+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+1]<<8|Bt[Wt])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+1]<<8|Bt[Wt])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(2)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>8,Wt[Gt+1]=Bt>>>0,Wt}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(2)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>0,Wt[Gt+1]=Bt>>>8,Wt}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(Bt,Wt){return Wt===void 0&&(Wt=0),Bt[Wt]<<24|Bt[Wt+1]<<16|Bt[Wt+2]<<8|Bt[Wt+3]}binary.readInt32BE=readInt32BE;function readUint32BE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt]<<24|Bt[Wt+1]<<16|Bt[Wt+2]<<8|Bt[Wt+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(Bt,Wt){return Wt===void 0&&(Wt=0),Bt[Wt+3]<<24|Bt[Wt+2]<<16|Bt[Wt+1]<<8|Bt[Wt]}binary.readInt32LE=readInt32LE;function readUint32LE(Bt,Wt){return Wt===void 0&&(Wt=0),(Bt[Wt+3]<<24|Bt[Wt+2]<<16|Bt[Wt+1]<<8|Bt[Wt])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>24,Wt[Gt+1]=Bt>>>16,Wt[Gt+2]=Bt>>>8,Wt[Gt+3]=Bt>>>0,Wt}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0),Wt[Gt+0]=Bt>>>0,Wt[Gt+1]=Bt>>>8,Wt[Gt+2]=Bt>>>16,Wt[Gt+3]=Bt>>>24,Wt}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readInt32BE(Bt,Wt),Yt=readInt32BE(Bt,Wt+4);return Gt*4294967296+Yt-(Yt>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readUint32BE(Bt,Wt),Yt=readUint32BE(Bt,Wt+4);return Gt*4294967296+Yt}binary.readUint64BE=readUint64BE;function readInt64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readInt32LE(Bt,Wt),Yt=readInt32LE(Bt,Wt+4);return Yt*4294967296+Gt-(Gt>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=readUint32LE(Bt,Wt),Yt=readUint32LE(Bt,Wt+4);return Yt*4294967296+Gt}binary.readUint64LE=readUint64LE;function writeUint64BE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0),writeUint32BE(Bt/4294967296>>>0,Wt,Gt),writeUint32BE(Bt>>>0,Wt,Gt+4),Wt}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(Bt,Wt,Gt){return Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0),writeUint32LE(Bt>>>0,Wt,Gt),writeUint32LE(Bt/4294967296>>>0,Wt,Gt+4),Wt}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(Bt,Wt,Gt){if(Gt===void 0&&(Gt=0),Bt%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(Bt/8>Wt.length-Gt)throw new Error("readUintBE: array is too short for the given bitLength");for(var Yt=0,Xt=1,Jt=Bt/8+Gt-1;Jt>=Gt;Jt--)Yt+=Wt[Jt]*Xt,Xt*=256;return Yt}binary.readUintBE=readUintBE;function readUintLE(Bt,Wt,Gt){if(Gt===void 0&&(Gt=0),Bt%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(Bt/8>Wt.length-Gt)throw new Error("readUintLE: array is too short for the given bitLength");for(var Yt=0,Xt=1,Jt=Gt;Jt<Gt+Bt/8;Jt++)Yt+=Wt[Jt]*Xt,Xt*=256;return Yt}binary.readUintLE=readUintLE;function writeUintBE(Bt,Wt,Gt,Yt){if(Gt===void 0&&(Gt=new Uint8Array(Bt/8)),Yt===void 0&&(Yt=0),Bt%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Wt))throw new Error("writeUintBE value must be an integer");for(var Xt=1,Jt=Bt/8+Yt-1;Jt>=Yt;Jt--)Gt[Jt]=Wt/Xt&255,Xt*=256;return Gt}binary.writeUintBE=writeUintBE;function writeUintLE(Bt,Wt,Gt,Yt){if(Gt===void 0&&(Gt=new Uint8Array(Bt/8)),Yt===void 0&&(Yt=0),Bt%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Wt))throw new Error("writeUintLE value must be an integer");for(var Xt=1,Jt=Yt;Jt<Yt+Bt/8;Jt++)Gt[Jt]=Wt/Xt&255,Xt*=256;return Gt}binary.writeUintLE=writeUintLE;function readFloat32BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat32(Wt)}binary.readFloat32BE=readFloat32BE;function readFloat32LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat32(Wt,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat64(Wt)}binary.readFloat64BE=readFloat64BE;function readFloat64LE(Bt,Wt){Wt===void 0&&(Wt=0);var Gt=new DataView(Bt.buffer,Bt.byteOffset,Bt.byteLength);return Gt.getFloat64(Wt,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat32(Gt,Bt),Wt}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(4)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat32(Gt,Bt,!0),Wt}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat64(Gt,Bt),Wt}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE(Bt,Wt,Gt){Wt===void 0&&(Wt=new Uint8Array(8)),Gt===void 0&&(Gt=0);var Yt=new DataView(Wt.buffer,Wt.byteOffset,Wt.byteLength);return Yt.setFloat64(Gt,Bt,!0),Wt}binary.writeFloat64LE=writeFloat64LE;var wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(Bt){for(var Wt=0;Wt<Bt.length;Wt++)Bt[Wt]=0;return Bt}wipe$1.wipe=wipe;Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$3=wipe$1,ROUNDS=20;function core(Bt,Wt,Gt){for(var Yt=1634760805,Xt=857760878,Jt=2036477234,Zt=1797285236,Qt=Gt[3]<<24|Gt[2]<<16|Gt[1]<<8|Gt[0],ur=Gt[7]<<24|Gt[6]<<16|Gt[5]<<8|Gt[4],cr=Gt[11]<<24|Gt[10]<<16|Gt[9]<<8|Gt[8],$r=Gt[15]<<24|Gt[14]<<16|Gt[13]<<8|Gt[12],Ar=Gt[19]<<24|Gt[18]<<16|Gt[17]<<8|Gt[16],Lr=Gt[23]<<24|Gt[22]<<16|Gt[21]<<8|Gt[20],qr=Gt[27]<<24|Gt[26]<<16|Gt[25]<<8|Gt[24],Fr=Gt[31]<<24|Gt[30]<<16|Gt[29]<<8|Gt[28],Hr=Wt[3]<<24|Wt[2]<<16|Wt[1]<<8|Wt[0],Br=Wt[7]<<24|Wt[6]<<16|Wt[5]<<8|Wt[4],Wr=Wt[11]<<24|Wt[10]<<16|Wt[9]<<8|Wt[8],Gr=Wt[15]<<24|Wt[14]<<16|Wt[13]<<8|Wt[12],Kr=Yt,Yr=Xt,hn=Jt,Qr=Zt,pn=Qt,En=ur,ga=cr,dn=$r,Pr=Ar,xr=Lr,Mr=qr,Nr=Fr,Ur=Hr,Vr=Br,Zr=Wr,Xr=Gr,Or=0;Or<ROUNDS;Or+=2)Kr=Kr+pn|0,Ur^=Kr,Ur=Ur>>>32-16|Ur<<16,Pr=Pr+Ur|0,pn^=Pr,pn=pn>>>32-12|pn<<12,Yr=Yr+En|0,Vr^=Yr,Vr=Vr>>>32-16|Vr<<16,xr=xr+Vr|0,En^=xr,En=En>>>32-12|En<<12,hn=hn+ga|0,Zr^=hn,Zr=Zr>>>32-16|Zr<<16,Mr=Mr+Zr|0,ga^=Mr,ga=ga>>>32-12|ga<<12,Qr=Qr+dn|0,Xr^=Qr,Xr=Xr>>>32-16|Xr<<16,Nr=Nr+Xr|0,dn^=Nr,dn=dn>>>32-12|dn<<12,hn=hn+ga|0,Zr^=hn,Zr=Zr>>>32-8|Zr<<8,Mr=Mr+Zr|0,ga^=Mr,ga=ga>>>32-7|ga<<7,Qr=Qr+dn|0,Xr^=Qr,Xr=Xr>>>32-8|Xr<<8,Nr=Nr+Xr|0,dn^=Nr,dn=dn>>>32-7|dn<<7,Yr=Yr+En|0,Vr^=Yr,Vr=Vr>>>32-8|Vr<<8,xr=xr+Vr|0,En^=xr,En=En>>>32-7|En<<7,Kr=Kr+pn|0,Ur^=Kr,Ur=Ur>>>32-8|Ur<<8,Pr=Pr+Ur|0,pn^=Pr,pn=pn>>>32-7|pn<<7,Kr=Kr+En|0,Xr^=Kr,Xr=Xr>>>32-16|Xr<<16,Mr=Mr+Xr|0,En^=Mr,En=En>>>32-12|En<<12,Yr=Yr+ga|0,Ur^=Yr,Ur=Ur>>>32-16|Ur<<16,Nr=Nr+Ur|0,ga^=Nr,ga=ga>>>32-12|ga<<12,hn=hn+dn|0,Vr^=hn,Vr=Vr>>>32-16|Vr<<16,Pr=Pr+Vr|0,dn^=Pr,dn=dn>>>32-12|dn<<12,Qr=Qr+pn|0,Zr^=Qr,Zr=Zr>>>32-16|Zr<<16,xr=xr+Zr|0,pn^=xr,pn=pn>>>32-12|pn<<12,hn=hn+dn|0,Vr^=hn,Vr=Vr>>>32-8|Vr<<8,Pr=Pr+Vr|0,dn^=Pr,dn=dn>>>32-7|dn<<7,Qr=Qr+pn|0,Zr^=Qr,Zr=Zr>>>32-8|Zr<<8,xr=xr+Zr|0,pn^=xr,pn=pn>>>32-7|pn<<7,Yr=Yr+ga|0,Ur^=Yr,Ur=Ur>>>32-8|Ur<<8,Nr=Nr+Ur|0,ga^=Nr,ga=ga>>>32-7|ga<<7,Kr=Kr+En|0,Xr^=Kr,Xr=Xr>>>32-8|Xr<<8,Mr=Mr+Xr|0,En^=Mr,En=En>>>32-7|En<<7;binary_1.writeUint32LE(Kr+Yt|0,Bt,0),binary_1.writeUint32LE(Yr+Xt|0,Bt,4),binary_1.writeUint32LE(hn+Jt|0,Bt,8),binary_1.writeUint32LE(Qr+Zt|0,Bt,12),binary_1.writeUint32LE(pn+Qt|0,Bt,16),binary_1.writeUint32LE(En+ur|0,Bt,20),binary_1.writeUint32LE(ga+cr|0,Bt,24),binary_1.writeUint32LE(dn+$r|0,Bt,28),binary_1.writeUint32LE(Pr+Ar|0,Bt,32),binary_1.writeUint32LE(xr+Lr|0,Bt,36),binary_1.writeUint32LE(Mr+qr|0,Bt,40),binary_1.writeUint32LE(Nr+Fr|0,Bt,44),binary_1.writeUint32LE(Ur+Hr|0,Bt,48),binary_1.writeUint32LE(Vr+Br|0,Bt,52),binary_1.writeUint32LE(Zr+Wr|0,Bt,56),binary_1.writeUint32LE(Xr+Gr|0,Bt,60)}function streamXOR(Bt,Wt,Gt,Yt,Xt){if(Xt===void 0&&(Xt=0),Bt.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(Yt.length<Gt.length)throw new Error("ChaCha: destination is shorter than source");var Jt,Zt;if(Xt===0){if(Wt.length!==8&&Wt.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");Jt=new Uint8Array(16),Zt=Jt.length-Wt.length,Jt.set(Wt,Zt)}else{if(Wt.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");Jt=Wt,Zt=Xt}for(var Qt=new Uint8Array(64),ur=0;ur<Gt.length;ur+=64){core(Qt,Jt,Bt);for(var cr=ur;cr<ur+64&&cr<Gt.length;cr++)Yt[cr]=Gt[cr]^Qt[cr-ur];incrementCounter(Jt,0,Zt)}return wipe_1$3.wipe(Qt),Xt===0&&wipe_1$3.wipe(Jt),Yt}chacha.streamXOR=streamXOR;function stream(Bt,Wt,Gt,Yt){return Yt===void 0&&(Yt=0),wipe_1$3.wipe(Gt),streamXOR(Bt,Wt,Gt,Gt,Yt)}chacha.stream=stream;function incrementCounter(Bt,Wt,Gt){for(var Yt=1;Gt--;)Yt=Yt+(Bt[Wt]&255)|0,Bt[Wt]=Yt&255,Yt>>>=8,Wt++;if(Yt>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select$1(Bt,Wt,Gt){return~(Bt-1)&Wt|Bt-1&Gt}constantTime.select=select$1;function lessOrEqual(Bt,Wt){return(Bt|0)-(Wt|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare(Bt,Wt){if(Bt.length!==Wt.length)return 0;for(var Gt=0,Yt=0;Yt<Bt.length;Yt++)Gt|=Bt[Yt]^Wt[Yt];return 1&Gt-1>>>8}constantTime.compare=compare;function equal$1(Bt,Wt){return Bt.length===0||Wt.length===0?!1:compare(Bt,Wt)!==0}constantTime.equal=equal$1;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=constantTime,Gt=wipe$1;Bt.DIGEST_LENGTH=16;var Yt=function(){function Zt(Qt){this.digestLength=Bt.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var ur=Qt[0]|Qt[1]<<8;this._r[0]=ur&8191;var cr=Qt[2]|Qt[3]<<8;this._r[1]=(ur>>>13|cr<<3)&8191;var $r=Qt[4]|Qt[5]<<8;this._r[2]=(cr>>>10|$r<<6)&7939;var Ar=Qt[6]|Qt[7]<<8;this._r[3]=($r>>>7|Ar<<9)&8191;var Lr=Qt[8]|Qt[9]<<8;this._r[4]=(Ar>>>4|Lr<<12)&255,this._r[5]=Lr>>>1&8190;var qr=Qt[10]|Qt[11]<<8;this._r[6]=(Lr>>>14|qr<<2)&8191;var Fr=Qt[12]|Qt[13]<<8;this._r[7]=(qr>>>11|Fr<<5)&8065;var Hr=Qt[14]|Qt[15]<<8;this._r[8]=(Fr>>>8|Hr<<8)&8191,this._r[9]=Hr>>>5&127,this._pad[0]=Qt[16]|Qt[17]<<8,this._pad[1]=Qt[18]|Qt[19]<<8,this._pad[2]=Qt[20]|Qt[21]<<8,this._pad[3]=Qt[22]|Qt[23]<<8,this._pad[4]=Qt[24]|Qt[25]<<8,this._pad[5]=Qt[26]|Qt[27]<<8,this._pad[6]=Qt[28]|Qt[29]<<8,this._pad[7]=Qt[30]|Qt[31]<<8}return Zt.prototype._blocks=function(Qt,ur,cr){for(var $r=this._fin?0:2048,Ar=this._h[0],Lr=this._h[1],qr=this._h[2],Fr=this._h[3],Hr=this._h[4],Br=this._h[5],Wr=this._h[6],Gr=this._h[7],Kr=this._h[8],Yr=this._h[9],hn=this._r[0],Qr=this._r[1],pn=this._r[2],En=this._r[3],ga=this._r[4],dn=this._r[5],Pr=this._r[6],xr=this._r[7],Mr=this._r[8],Nr=this._r[9];cr>=16;){var Ur=Qt[ur+0]|Qt[ur+1]<<8;Ar+=Ur&8191;var Vr=Qt[ur+2]|Qt[ur+3]<<8;Lr+=(Ur>>>13|Vr<<3)&8191;var Zr=Qt[ur+4]|Qt[ur+5]<<8;qr+=(Vr>>>10|Zr<<6)&8191;var Xr=Qt[ur+6]|Qt[ur+7]<<8;Fr+=(Zr>>>7|Xr<<9)&8191;var Or=Qt[ur+8]|Qt[ur+9]<<8;Hr+=(Xr>>>4|Or<<12)&8191,Br+=Or>>>1&8191;var jr=Qt[ur+10]|Qt[ur+11]<<8;Wr+=(Or>>>14|jr<<2)&8191;var Jr=Qt[ur+12]|Qt[ur+13]<<8;Gr+=(jr>>>11|Jr<<5)&8191;var mn=Qt[ur+14]|Qt[ur+15]<<8;Kr+=(Jr>>>8|mn<<8)&8191,Yr+=mn>>>5|$r;var gn=0,eo=gn;eo+=Ar*hn,eo+=Lr*(5*Nr),eo+=qr*(5*Mr),eo+=Fr*(5*xr),eo+=Hr*(5*Pr),gn=eo>>>13,eo&=8191,eo+=Br*(5*dn),eo+=Wr*(5*ga),eo+=Gr*(5*En),eo+=Kr*(5*pn),eo+=Yr*(5*Qr),gn+=eo>>>13,eo&=8191;var _i=gn;_i+=Ar*Qr,_i+=Lr*hn,_i+=qr*(5*Nr),_i+=Fr*(5*Mr),_i+=Hr*(5*xr),gn=_i>>>13,_i&=8191,_i+=Br*(5*Pr),_i+=Wr*(5*dn),_i+=Gr*(5*ga),_i+=Kr*(5*En),_i+=Yr*(5*pn),gn+=_i>>>13,_i&=8191;var ro=gn;ro+=Ar*pn,ro+=Lr*Qr,ro+=qr*hn,ro+=Fr*(5*Nr),ro+=Hr*(5*Mr),gn=ro>>>13,ro&=8191,ro+=Br*(5*xr),ro+=Wr*(5*Pr),ro+=Gr*(5*dn),ro+=Kr*(5*ga),ro+=Yr*(5*En),gn+=ro>>>13,ro&=8191;var io=gn;io+=Ar*En,io+=Lr*pn,io+=qr*Qr,io+=Fr*hn,io+=Hr*(5*Nr),gn=io>>>13,io&=8191,io+=Br*(5*Mr),io+=Wr*(5*xr),io+=Gr*(5*Pr),io+=Kr*(5*dn),io+=Yr*(5*ga),gn+=io>>>13,io&=8191;var ao=gn;ao+=Ar*ga,ao+=Lr*En,ao+=qr*pn,ao+=Fr*Qr,ao+=Hr*hn,gn=ao>>>13,ao&=8191,ao+=Br*(5*Nr),ao+=Wr*(5*Mr),ao+=Gr*(5*xr),ao+=Kr*(5*Pr),ao+=Yr*(5*dn),gn+=ao>>>13,ao&=8191;var oo=gn;oo+=Ar*dn,oo+=Lr*ga,oo+=qr*En,oo+=Fr*pn,oo+=Hr*Qr,gn=oo>>>13,oo&=8191,oo+=Br*hn,oo+=Wr*(5*Nr),oo+=Gr*(5*Mr),oo+=Kr*(5*xr),oo+=Yr*(5*Pr),gn+=oo>>>13,oo&=8191;var to=gn;to+=Ar*Pr,to+=Lr*dn,to+=qr*ga,to+=Fr*En,to+=Hr*pn,gn=to>>>13,to&=8191,to+=Br*Qr,to+=Wr*hn,to+=Gr*(5*Nr),to+=Kr*(5*Mr),to+=Yr*(5*xr),gn+=to>>>13,to&=8191;var so=gn;so+=Ar*xr,so+=Lr*Pr,so+=qr*dn,so+=Fr*ga,so+=Hr*En,gn=so>>>13,so&=8191,so+=Br*pn,so+=Wr*Qr,so+=Gr*hn,so+=Kr*(5*Nr),so+=Yr*(5*Mr),gn+=so>>>13,so&=8191;var lo=gn;lo+=Ar*Mr,lo+=Lr*xr,lo+=qr*Pr,lo+=Fr*dn,lo+=Hr*ga,gn=lo>>>13,lo&=8191,lo+=Br*En,lo+=Wr*pn,lo+=Gr*Qr,lo+=Kr*hn,lo+=Yr*(5*Nr),gn+=lo>>>13,lo&=8191;var Ro=gn;Ro+=Ar*Nr,Ro+=Lr*Mr,Ro+=qr*xr,Ro+=Fr*Pr,Ro+=Hr*dn,gn=Ro>>>13,Ro&=8191,Ro+=Br*ga,Ro+=Wr*En,Ro+=Gr*pn,Ro+=Kr*Qr,Ro+=Yr*hn,gn+=Ro>>>13,Ro&=8191,gn=(gn<<2)+gn|0,gn=gn+eo|0,eo=gn&8191,gn=gn>>>13,_i+=gn,Ar=eo,Lr=_i,qr=ro,Fr=io,Hr=ao,Br=oo,Wr=to,Gr=so,Kr=lo,Yr=Ro,ur+=16,cr-=16}this._h[0]=Ar,this._h[1]=Lr,this._h[2]=qr,this._h[3]=Fr,this._h[4]=Hr,this._h[5]=Br,this._h[6]=Wr,this._h[7]=Gr,this._h[8]=Kr,this._h[9]=Yr},Zt.prototype.finish=function(Qt,ur){ur===void 0&&(ur=0);var cr=new Uint16Array(10),$r,Ar,Lr,qr;if(this._leftover){for(qr=this._leftover,this._buffer[qr++]=1;qr<16;qr++)this._buffer[qr]=0;this._fin=1,this._blocks(this._buffer,0,16)}for($r=this._h[1]>>>13,this._h[1]&=8191,qr=2;qr<10;qr++)this._h[qr]+=$r,$r=this._h[qr]>>>13,this._h[qr]&=8191;for(this._h[0]+=$r*5,$r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=$r,$r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=$r,cr[0]=this._h[0]+5,$r=cr[0]>>>13,cr[0]&=8191,qr=1;qr<10;qr++)cr[qr]=this._h[qr]+$r,$r=cr[qr]>>>13,cr[qr]&=8191;for(cr[9]-=8192,Ar=($r^1)-1,qr=0;qr<10;qr++)cr[qr]&=Ar;for(Ar=~Ar,qr=0;qr<10;qr++)this._h[qr]=this._h[qr]&Ar|cr[qr];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,Lr=this._h[0]+this._pad[0],this._h[0]=Lr&65535,qr=1;qr<8;qr++)Lr=(this._h[qr]+this._pad[qr]|0)+(Lr>>>16)|0,this._h[qr]=Lr&65535;return Qt[ur+0]=this._h[0]>>>0,Qt[ur+1]=this._h[0]>>>8,Qt[ur+2]=this._h[1]>>>0,Qt[ur+3]=this._h[1]>>>8,Qt[ur+4]=this._h[2]>>>0,Qt[ur+5]=this._h[2]>>>8,Qt[ur+6]=this._h[3]>>>0,Qt[ur+7]=this._h[3]>>>8,Qt[ur+8]=this._h[4]>>>0,Qt[ur+9]=this._h[4]>>>8,Qt[ur+10]=this._h[5]>>>0,Qt[ur+11]=this._h[5]>>>8,Qt[ur+12]=this._h[6]>>>0,Qt[ur+13]=this._h[6]>>>8,Qt[ur+14]=this._h[7]>>>0,Qt[ur+15]=this._h[7]>>>8,this._finished=!0,this},Zt.prototype.update=function(Qt){var ur=0,cr=Qt.length,$r;if(this._leftover){$r=16-this._leftover,$r>cr&&($r=cr);for(var Ar=0;Ar<$r;Ar++)this._buffer[this._leftover+Ar]=Qt[ur+Ar];if(cr-=$r,ur+=$r,this._leftover+=$r,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(cr>=16&&($r=cr-cr%16,this._blocks(Qt,ur,$r),ur+=$r,cr-=$r),cr){for(var Ar=0;Ar<cr;Ar++)this._buffer[this._leftover+Ar]=Qt[ur+Ar];this._leftover+=cr}return this},Zt.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var Qt=new Uint8Array(16);return this.finish(Qt),Qt},Zt.prototype.clean=function(){return Gt.wipe(this._buffer),Gt.wipe(this._r),Gt.wipe(this._h),Gt.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},Zt}();Bt.Poly1305=Yt;function Xt(Zt,Qt){var ur=new Yt(Zt);ur.update(Qt);var cr=ur.digest();return ur.clean(),cr}Bt.oneTimeAuth=Xt;function Jt(Zt,Qt){return Zt.length!==Bt.DIGEST_LENGTH||Qt.length!==Bt.DIGEST_LENGTH?!1:Wt.equal(Zt,Qt)}Bt.equal=Jt})(poly1305);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=chacha,Gt=poly1305,Yt=wipe$1,Xt=binary,Jt=constantTime;Bt.KEY_LENGTH=32,Bt.NONCE_LENGTH=12,Bt.TAG_LENGTH=16;var Zt=new Uint8Array(16),Qt=function(){function ur(cr){if(this.nonceLength=Bt.NONCE_LENGTH,this.tagLength=Bt.TAG_LENGTH,cr.length!==Bt.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(cr)}return ur.prototype.seal=function(cr,$r,Ar,Lr){if(cr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var qr=new Uint8Array(16);qr.set(cr,qr.length-cr.length);var Fr=new Uint8Array(32);Wt.stream(this._key,qr,Fr,4);var Hr=$r.length+this.tagLength,Br;if(Lr){if(Lr.length!==Hr)throw new Error("ChaCha20Poly1305: incorrect destination length");Br=Lr}else Br=new Uint8Array(Hr);return Wt.streamXOR(this._key,qr,$r,Br,4),this._authenticate(Br.subarray(Br.length-this.tagLength,Br.length),Fr,Br.subarray(0,Br.length-this.tagLength),Ar),Yt.wipe(qr),Br},ur.prototype.open=function(cr,$r,Ar,Lr){if(cr.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if($r.length<this.tagLength)return null;var qr=new Uint8Array(16);qr.set(cr,qr.length-cr.length);var Fr=new Uint8Array(32);Wt.stream(this._key,qr,Fr,4);var Hr=new Uint8Array(this.tagLength);if(this._authenticate(Hr,Fr,$r.subarray(0,$r.length-this.tagLength),Ar),!Jt.equal(Hr,$r.subarray($r.length-this.tagLength,$r.length)))return null;var Br=$r.length-this.tagLength,Wr;if(Lr){if(Lr.length!==Br)throw new Error("ChaCha20Poly1305: incorrect destination length");Wr=Lr}else Wr=new Uint8Array(Br);return Wt.streamXOR(this._key,qr,$r.subarray(0,$r.length-this.tagLength),Wr,4),Yt.wipe(qr),Wr},ur.prototype.clean=function(){return Yt.wipe(this._key),this},ur.prototype._authenticate=function(cr,$r,Ar,Lr){var qr=new Gt.Poly1305($r);Lr&&(qr.update(Lr),Lr.length%16>0&&qr.update(Zt.subarray(Lr.length%16))),qr.update(Ar),Ar.length%16>0&&qr.update(Zt.subarray(Ar.length%16));var Fr=new Uint8Array(8);Lr&&Xt.writeUint64LE(Lr.length,Fr),qr.update(Fr),Xt.writeUint64LE(Ar.length,Fr),qr.update(Fr);for(var Hr=qr.digest(),Br=0;Br<Hr.length;Br++)cr[Br]=Hr[Br];qr.clean(),Yt.wipe(Hr),Yt.wipe(Fr)},ur}();Bt.ChaCha20Poly1305=Qt})(chacha20poly1305);var hkdf={},hmac$2={},hash$4={};Object.defineProperty(hash$4,"__esModule",{value:!0});function isSerializableHash(Bt){return typeof Bt.saveState<"u"&&typeof Bt.restoreState<"u"&&typeof Bt.cleanSavedState<"u"}hash$4.isSerializableHash=isSerializableHash;Object.defineProperty(hmac$2,"__esModule",{value:!0});var hash_1=hash$4,constant_time_1=constantTime,wipe_1$2=wipe$1,HMAC=function(){function Bt(Wt,Gt){this._finished=!1,this._inner=new Wt,this._outer=new Wt,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var Yt=new Uint8Array(this.blockSize);Gt.length>this.blockSize?this._inner.update(Gt).finish(Yt).clean():Yt.set(Gt);for(var Xt=0;Xt<Yt.length;Xt++)Yt[Xt]^=54;this._inner.update(Yt);for(var Xt=0;Xt<Yt.length;Xt++)Yt[Xt]^=106;this._outer.update(Yt),hash_1.isSerializableHash(this._inner)&&hash_1.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),wipe_1$2.wipe(Yt)}return Bt.prototype.reset=function(){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Bt.prototype.clean=function(){hash_1.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hash_1.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},Bt.prototype.update=function(Wt){return this._inner.update(Wt),this},Bt.prototype.finish=function(Wt){return this._finished?(this._outer.finish(Wt),this):(this._inner.finish(Wt),this._outer.update(Wt.subarray(0,this.digestLength)).finish(Wt),this._finished=!0,this)},Bt.prototype.digest=function(){var Wt=new Uint8Array(this.digestLength);return this.finish(Wt),Wt},Bt.prototype.saveState=function(){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},Bt.prototype.restoreState=function(Wt){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(Wt),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Bt.prototype.cleanSavedState=function(Wt){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(Wt)},Bt}();hmac$2.HMAC=HMAC;function hmac$1(Bt,Wt,Gt){var Yt=new HMAC(Bt,Wt);Yt.update(Gt);var Xt=Yt.digest();return Yt.clean(),Xt}hmac$2.hmac=hmac$1;hmac$2.equal=constant_time_1.equal;Object.defineProperty(hkdf,"__esModule",{value:!0});var hmac_1=hmac$2,wipe_1$1=wipe$1,HKDF=function(){function Bt(Wt,Gt,Yt,Xt){Yt===void 0&&(Yt=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=Wt,this._info=Xt;var Jt=hmac_1.hmac(this._hash,Yt,Gt);this._hmac=new hmac_1.HMAC(Wt,Jt),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return Bt.prototype._fillBuffer=function(){this._counter[0]++;var Wt=this._counter[0];if(Wt===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),Wt>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},Bt.prototype.expand=function(Wt){for(var Gt=new Uint8Array(Wt),Yt=0;Yt<Gt.length;Yt++)this._bufpos===this._buffer.length&&this._fillBuffer(),Gt[Yt]=this._buffer[this._bufpos++];return Gt},Bt.prototype.clean=function(){this._hmac.clean(),wipe_1$1.wipe(this._buffer),wipe_1$1.wipe(this._counter),this._bufpos=0},Bt}(),HKDF_1=hkdf.HKDF=HKDF,random={},system={},browser$5={};Object.defineProperty(browser$5,"__esModule",{value:!0});browser$5.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const Wt=typeof self<"u"?self.crypto||self.msCrypto:null;Wt&&Wt.getRandomValues!==void 0&&(this._crypto=Wt,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(Wt){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const Gt=new Uint8Array(Wt);for(let Yt=0;Yt<Gt.length;Yt+=QUOTA)this._crypto.getRandomValues(Gt.subarray(Yt,Yt+Math.min(Gt.length-Yt,QUOTA)));return Gt}}browser$5.BrowserRandomSource=BrowserRandomSource;function commonjsRequire$1(Bt){throw new Error('Could not dynamically require "'+Bt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$1={};Object.defineProperty(node$1,"__esModule",{value:!0});node$1.NodeRandomSource=void 0;const wipe_1=wipe$1;class NodeRandomSource{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire$1<"u"){const Wt=require$$0$a;Wt&&Wt.randomBytes&&(this._crypto=Wt,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(Wt){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let Gt=this._crypto.randomBytes(Wt);if(Gt.length!==Wt)throw new Error("NodeRandomSource: got fewer bytes than requested");const Yt=new Uint8Array(Wt);for(let Xt=0;Xt<Yt.length;Xt++)Yt[Xt]=Gt[Xt];return(0,wipe_1.wipe)(Gt),Yt}}node$1.NodeRandomSource=NodeRandomSource;Object.defineProperty(system,"__esModule",{value:!0});system.SystemRandomSource=void 0;const browser_1=browser$5,node_1$1=node$1;class SystemRandomSource{constructor(){if(this.isAvailable=!1,this.name="",this._source=new browser_1.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new node_1$1.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(Wt){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(Wt)}}system.SystemRandomSource=SystemRandomSource;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.randomStringForEntropy=Bt.randomString=Bt.randomUint32=Bt.randomBytes=Bt.defaultRandomSource=void 0;const Wt=system,Gt=binary,Yt=wipe$1;Bt.defaultRandomSource=new Wt.SystemRandomSource;function Xt(cr,$r=Bt.defaultRandomSource){return $r.randomBytes(cr)}Bt.randomBytes=Xt;function Jt(cr=Bt.defaultRandomSource){const $r=Xt(4,cr),Ar=(0,Gt.readUint32LE)($r);return(0,Yt.wipe)($r),Ar}Bt.randomUint32=Jt;const Zt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Qt(cr,$r=Zt,Ar=Bt.defaultRandomSource){if($r.length<2)throw new Error("randomString charset is too short");if($r.length>256)throw new Error("randomString charset is too long");let Lr="";const qr=$r.length,Fr=256-256%qr;for(;cr>0;){const Hr=Xt(Math.ceil(cr*256/Fr),Ar);for(let Br=0;Br<Hr.length&&cr>0;Br++){const Wr=Hr[Br];Wr<Fr&&(Lr+=$r.charAt(Wr%qr),cr--)}(0,Yt.wipe)(Hr)}return Lr}Bt.randomString=Qt;function ur(cr,$r=Zt,Ar=Bt.defaultRandomSource){const Lr=Math.ceil(cr/(Math.log($r.length)/Math.LN2));return Qt(Lr,$r,Ar)}Bt.randomStringForEntropy=ur})(random);var sha256$4={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0});var Wt=binary,Gt=wipe$1;Bt.DIGEST_LENGTH=32,Bt.BLOCK_SIZE=64;var Yt=function(){function Qt(){this.digestLength=Bt.DIGEST_LENGTH,this.blockSize=Bt.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return Qt.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},Qt.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},Qt.prototype.clean=function(){Gt.wipe(this._buffer),Gt.wipe(this._temp),this.reset()},Qt.prototype.update=function(ur,cr){if(cr===void 0&&(cr=ur.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var $r=0;if(this._bytesHashed+=cr,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&cr>0;)this._buffer[this._bufferLength++]=ur[$r++],cr--;this._bufferLength===this.blockSize&&(Jt(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(cr>=this.blockSize&&($r=Jt(this._temp,this._state,ur,$r,cr),cr%=this.blockSize);cr>0;)this._buffer[this._bufferLength++]=ur[$r++],cr--;return this},Qt.prototype.finish=function(ur){if(!this._finished){var cr=this._bytesHashed,$r=this._bufferLength,Ar=cr/536870912|0,Lr=cr<<3,qr=cr%64<56?64:128;this._buffer[$r]=128;for(var Fr=$r+1;Fr<qr-8;Fr++)this._buffer[Fr]=0;Wt.writeUint32BE(Ar,this._buffer,qr-8),Wt.writeUint32BE(Lr,this._buffer,qr-4),Jt(this._temp,this._state,this._buffer,0,qr),this._finished=!0}for(var Fr=0;Fr<this.digestLength/4;Fr++)Wt.writeUint32BE(this._state[Fr],ur,Fr*4);return this},Qt.prototype.digest=function(){var ur=new Uint8Array(this.digestLength);return this.finish(ur),ur},Qt.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},Qt.prototype.restoreState=function(ur){return this._state.set(ur.state),this._bufferLength=ur.bufferLength,ur.buffer&&this._buffer.set(ur.buffer),this._bytesHashed=ur.bytesHashed,this._finished=!1,this},Qt.prototype.cleanSavedState=function(ur){Gt.wipe(ur.state),ur.buffer&&Gt.wipe(ur.buffer),ur.bufferLength=0,ur.bytesHashed=0},Qt}();Bt.SHA256=Yt;var Xt=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Jt(Qt,ur,cr,$r,Ar){for(;Ar>=64;){for(var Lr=ur[0],qr=ur[1],Fr=ur[2],Hr=ur[3],Br=ur[4],Wr=ur[5],Gr=ur[6],Kr=ur[7],Yr=0;Yr<16;Yr++){var hn=$r+Yr*4;Qt[Yr]=Wt.readUint32BE(cr,hn)}for(var Yr=16;Yr<64;Yr++){var Qr=Qt[Yr-2],pn=(Qr>>>17|Qr<<32-17)^(Qr>>>19|Qr<<32-19)^Qr>>>10;Qr=Qt[Yr-15];var En=(Qr>>>7|Qr<<32-7)^(Qr>>>18|Qr<<32-18)^Qr>>>3;Qt[Yr]=(pn+Qt[Yr-7]|0)+(En+Qt[Yr-16]|0)}for(var Yr=0;Yr<64;Yr++){var pn=(((Br>>>6|Br<<26)^(Br>>>11|Br<<21)^(Br>>>25|Br<<7))+(Br&Wr^~Br&Gr)|0)+(Kr+(Xt[Yr]+Qt[Yr]|0)|0)|0,En=((Lr>>>2|Lr<<32-2)^(Lr>>>13|Lr<<32-13)^(Lr>>>22|Lr<<32-22))+(Lr&qr^Lr&Fr^qr&Fr)|0;Kr=Gr,Gr=Wr,Wr=Br,Br=Hr+pn|0,Hr=Fr,Fr=qr,qr=Lr,Lr=pn+En|0}ur[0]+=Lr,ur[1]+=qr,ur[2]+=Fr,ur[3]+=Hr,ur[4]+=Br,ur[5]+=Wr,ur[6]+=Gr,ur[7]+=Kr,$r+=64,Ar-=64}return $r}function Zt(Qt){var ur=new Yt;ur.update(Qt);var cr=ur.digest();return ur.clean(),cr}Bt.hash=Zt})(sha256$4);var x25519={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sharedKey=Bt.generateKeyPair=Bt.generateKeyPairFromSeed=Bt.scalarMultBase=Bt.scalarMult=Bt.SHARED_KEY_LENGTH=Bt.SECRET_KEY_LENGTH=Bt.PUBLIC_KEY_LENGTH=void 0;const Wt=random,Gt=wipe$1;Bt.PUBLIC_KEY_LENGTH=32,Bt.SECRET_KEY_LENGTH=32,Bt.SHARED_KEY_LENGTH=32;function Yt(Yr){const hn=new Float64Array(16);if(Yr)for(let Qr=0;Qr<Yr.length;Qr++)hn[Qr]=Yr[Qr];return hn}const Xt=new Uint8Array(32);Xt[0]=9;const Jt=Yt([56129,1]);function Zt(Yr){let hn=1;for(let Qr=0;Qr<16;Qr++){let pn=Yr[Qr]+hn+65535;hn=Math.floor(pn/65536),Yr[Qr]=pn-hn*65536}Yr[0]+=hn-1+37*(hn-1)}function Qt(Yr,hn,Qr){const pn=~(Qr-1);for(let En=0;En<16;En++){const ga=pn&(Yr[En]^hn[En]);Yr[En]^=ga,hn[En]^=ga}}function ur(Yr,hn){const Qr=Yt(),pn=Yt();for(let En=0;En<16;En++)pn[En]=hn[En];Zt(pn),Zt(pn),Zt(pn);for(let En=0;En<2;En++){Qr[0]=pn[0]-65517;for(let dn=1;dn<15;dn++)Qr[dn]=pn[dn]-65535-(Qr[dn-1]>>16&1),Qr[dn-1]&=65535;Qr[15]=pn[15]-32767-(Qr[14]>>16&1);const ga=Qr[15]>>16&1;Qr[14]&=65535,Qt(pn,Qr,1-ga)}for(let En=0;En<16;En++)Yr[2*En]=pn[En]&255,Yr[2*En+1]=pn[En]>>8}function cr(Yr,hn){for(let Qr=0;Qr<16;Qr++)Yr[Qr]=hn[2*Qr]+(hn[2*Qr+1]<<8);Yr[15]&=32767}function $r(Yr,hn,Qr){for(let pn=0;pn<16;pn++)Yr[pn]=hn[pn]+Qr[pn]}function Ar(Yr,hn,Qr){for(let pn=0;pn<16;pn++)Yr[pn]=hn[pn]-Qr[pn]}function Lr(Yr,hn,Qr){let pn,En,ga=0,dn=0,Pr=0,xr=0,Mr=0,Nr=0,Ur=0,Vr=0,Zr=0,Xr=0,Or=0,jr=0,Jr=0,mn=0,gn=0,eo=0,_i=0,ro=0,io=0,ao=0,oo=0,to=0,so=0,lo=0,Ro=0,Io=0,Fo=0,xo=0,ho=0,po=0,Ao=0,Bo=Qr[0],Mo=Qr[1],bo=Qr[2],yo=Qr[3],Do=Qr[4],Tu=Qr[5],wu=Qr[6],$o=Qr[7],mo=Qr[8],_o=Qr[9],To=Qr[10],iu=Qr[11],nu=Qr[12],Jo=Qr[13],cu=Qr[14],au=Qr[15];pn=hn[0],ga+=pn*Bo,dn+=pn*Mo,Pr+=pn*bo,xr+=pn*yo,Mr+=pn*Do,Nr+=pn*Tu,Ur+=pn*wu,Vr+=pn*$o,Zr+=pn*mo,Xr+=pn*_o,Or+=pn*To,jr+=pn*iu,Jr+=pn*nu,mn+=pn*Jo,gn+=pn*cu,eo+=pn*au,pn=hn[1],dn+=pn*Bo,Pr+=pn*Mo,xr+=pn*bo,Mr+=pn*yo,Nr+=pn*Do,Ur+=pn*Tu,Vr+=pn*wu,Zr+=pn*$o,Xr+=pn*mo,Or+=pn*_o,jr+=pn*To,Jr+=pn*iu,mn+=pn*nu,gn+=pn*Jo,eo+=pn*cu,_i+=pn*au,pn=hn[2],Pr+=pn*Bo,xr+=pn*Mo,Mr+=pn*bo,Nr+=pn*yo,Ur+=pn*Do,Vr+=pn*Tu,Zr+=pn*wu,Xr+=pn*$o,Or+=pn*mo,jr+=pn*_o,Jr+=pn*To,mn+=pn*iu,gn+=pn*nu,eo+=pn*Jo,_i+=pn*cu,ro+=pn*au,pn=hn[3],xr+=pn*Bo,Mr+=pn*Mo,Nr+=pn*bo,Ur+=pn*yo,Vr+=pn*Do,Zr+=pn*Tu,Xr+=pn*wu,Or+=pn*$o,jr+=pn*mo,Jr+=pn*_o,mn+=pn*To,gn+=pn*iu,eo+=pn*nu,_i+=pn*Jo,ro+=pn*cu,io+=pn*au,pn=hn[4],Mr+=pn*Bo,Nr+=pn*Mo,Ur+=pn*bo,Vr+=pn*yo,Zr+=pn*Do,Xr+=pn*Tu,Or+=pn*wu,jr+=pn*$o,Jr+=pn*mo,mn+=pn*_o,gn+=pn*To,eo+=pn*iu,_i+=pn*nu,ro+=pn*Jo,io+=pn*cu,ao+=pn*au,pn=hn[5],Nr+=pn*Bo,Ur+=pn*Mo,Vr+=pn*bo,Zr+=pn*yo,Xr+=pn*Do,Or+=pn*Tu,jr+=pn*wu,Jr+=pn*$o,mn+=pn*mo,gn+=pn*_o,eo+=pn*To,_i+=pn*iu,ro+=pn*nu,io+=pn*Jo,ao+=pn*cu,oo+=pn*au,pn=hn[6],Ur+=pn*Bo,Vr+=pn*Mo,Zr+=pn*bo,Xr+=pn*yo,Or+=pn*Do,jr+=pn*Tu,Jr+=pn*wu,mn+=pn*$o,gn+=pn*mo,eo+=pn*_o,_i+=pn*To,ro+=pn*iu,io+=pn*nu,ao+=pn*Jo,oo+=pn*cu,to+=pn*au,pn=hn[7],Vr+=pn*Bo,Zr+=pn*Mo,Xr+=pn*bo,Or+=pn*yo,jr+=pn*Do,Jr+=pn*Tu,mn+=pn*wu,gn+=pn*$o,eo+=pn*mo,_i+=pn*_o,ro+=pn*To,io+=pn*iu,ao+=pn*nu,oo+=pn*Jo,to+=pn*cu,so+=pn*au,pn=hn[8],Zr+=pn*Bo,Xr+=pn*Mo,Or+=pn*bo,jr+=pn*yo,Jr+=pn*Do,mn+=pn*Tu,gn+=pn*wu,eo+=pn*$o,_i+=pn*mo,ro+=pn*_o,io+=pn*To,ao+=pn*iu,oo+=pn*nu,to+=pn*Jo,so+=pn*cu,lo+=pn*au,pn=hn[9],Xr+=pn*Bo,Or+=pn*Mo,jr+=pn*bo,Jr+=pn*yo,mn+=pn*Do,gn+=pn*Tu,eo+=pn*wu,_i+=pn*$o,ro+=pn*mo,io+=pn*_o,ao+=pn*To,oo+=pn*iu,to+=pn*nu,so+=pn*Jo,lo+=pn*cu,Ro+=pn*au,pn=hn[10],Or+=pn*Bo,jr+=pn*Mo,Jr+=pn*bo,mn+=pn*yo,gn+=pn*Do,eo+=pn*Tu,_i+=pn*wu,ro+=pn*$o,io+=pn*mo,ao+=pn*_o,oo+=pn*To,to+=pn*iu,so+=pn*nu,lo+=pn*Jo,Ro+=pn*cu,Io+=pn*au,pn=hn[11],jr+=pn*Bo,Jr+=pn*Mo,mn+=pn*bo,gn+=pn*yo,eo+=pn*Do,_i+=pn*Tu,ro+=pn*wu,io+=pn*$o,ao+=pn*mo,oo+=pn*_o,to+=pn*To,so+=pn*iu,lo+=pn*nu,Ro+=pn*Jo,Io+=pn*cu,Fo+=pn*au,pn=hn[12],Jr+=pn*Bo,mn+=pn*Mo,gn+=pn*bo,eo+=pn*yo,_i+=pn*Do,ro+=pn*Tu,io+=pn*wu,ao+=pn*$o,oo+=pn*mo,to+=pn*_o,so+=pn*To,lo+=pn*iu,Ro+=pn*nu,Io+=pn*Jo,Fo+=pn*cu,xo+=pn*au,pn=hn[13],mn+=pn*Bo,gn+=pn*Mo,eo+=pn*bo,_i+=pn*yo,ro+=pn*Do,io+=pn*Tu,ao+=pn*wu,oo+=pn*$o,to+=pn*mo,so+=pn*_o,lo+=pn*To,Ro+=pn*iu,Io+=pn*nu,Fo+=pn*Jo,xo+=pn*cu,ho+=pn*au,pn=hn[14],gn+=pn*Bo,eo+=pn*Mo,_i+=pn*bo,ro+=pn*yo,io+=pn*Do,ao+=pn*Tu,oo+=pn*wu,to+=pn*$o,so+=pn*mo,lo+=pn*_o,Ro+=pn*To,Io+=pn*iu,Fo+=pn*nu,xo+=pn*Jo,ho+=pn*cu,po+=pn*au,pn=hn[15],eo+=pn*Bo,_i+=pn*Mo,ro+=pn*bo,io+=pn*yo,ao+=pn*Do,oo+=pn*Tu,to+=pn*wu,so+=pn*$o,lo+=pn*mo,Ro+=pn*_o,Io+=pn*To,Fo+=pn*iu,xo+=pn*nu,ho+=pn*Jo,po+=pn*cu,Ao+=pn*au,ga+=38*_i,dn+=38*ro,Pr+=38*io,xr+=38*ao,Mr+=38*oo,Nr+=38*to,Ur+=38*so,Vr+=38*lo,Zr+=38*Ro,Xr+=38*Io,Or+=38*Fo,jr+=38*xo,Jr+=38*ho,mn+=38*po,gn+=38*Ao,En=1,pn=ga+En+65535,En=Math.floor(pn/65536),ga=pn-En*65536,pn=dn+En+65535,En=Math.floor(pn/65536),dn=pn-En*65536,pn=Pr+En+65535,En=Math.floor(pn/65536),Pr=pn-En*65536,pn=xr+En+65535,En=Math.floor(pn/65536),xr=pn-En*65536,pn=Mr+En+65535,En=Math.floor(pn/65536),Mr=pn-En*65536,pn=Nr+En+65535,En=Math.floor(pn/65536),Nr=pn-En*65536,pn=Ur+En+65535,En=Math.floor(pn/65536),Ur=pn-En*65536,pn=Vr+En+65535,En=Math.floor(pn/65536),Vr=pn-En*65536,pn=Zr+En+65535,En=Math.floor(pn/65536),Zr=pn-En*65536,pn=Xr+En+65535,En=Math.floor(pn/65536),Xr=pn-En*65536,pn=Or+En+65535,En=Math.floor(pn/65536),Or=pn-En*65536,pn=jr+En+65535,En=Math.floor(pn/65536),jr=pn-En*65536,pn=Jr+En+65535,En=Math.floor(pn/65536),Jr=pn-En*65536,pn=mn+En+65535,En=Math.floor(pn/65536),mn=pn-En*65536,pn=gn+En+65535,En=Math.floor(pn/65536),gn=pn-En*65536,pn=eo+En+65535,En=Math.floor(pn/65536),eo=pn-En*65536,ga+=En-1+37*(En-1),En=1,pn=ga+En+65535,En=Math.floor(pn/65536),ga=pn-En*65536,pn=dn+En+65535,En=Math.floor(pn/65536),dn=pn-En*65536,pn=Pr+En+65535,En=Math.floor(pn/65536),Pr=pn-En*65536,pn=xr+En+65535,En=Math.floor(pn/65536),xr=pn-En*65536,pn=Mr+En+65535,En=Math.floor(pn/65536),Mr=pn-En*65536,pn=Nr+En+65535,En=Math.floor(pn/65536),Nr=pn-En*65536,pn=Ur+En+65535,En=Math.floor(pn/65536),Ur=pn-En*65536,pn=Vr+En+65535,En=Math.floor(pn/65536),Vr=pn-En*65536,pn=Zr+En+65535,En=Math.floor(pn/65536),Zr=pn-En*65536,pn=Xr+En+65535,En=Math.floor(pn/65536),Xr=pn-En*65536,pn=Or+En+65535,En=Math.floor(pn/65536),Or=pn-En*65536,pn=jr+En+65535,En=Math.floor(pn/65536),jr=pn-En*65536,pn=Jr+En+65535,En=Math.floor(pn/65536),Jr=pn-En*65536,pn=mn+En+65535,En=Math.floor(pn/65536),mn=pn-En*65536,pn=gn+En+65535,En=Math.floor(pn/65536),gn=pn-En*65536,pn=eo+En+65535,En=Math.floor(pn/65536),eo=pn-En*65536,ga+=En-1+37*(En-1),Yr[0]=ga,Yr[1]=dn,Yr[2]=Pr,Yr[3]=xr,Yr[4]=Mr,Yr[5]=Nr,Yr[6]=Ur,Yr[7]=Vr,Yr[8]=Zr,Yr[9]=Xr,Yr[10]=Or,Yr[11]=jr,Yr[12]=Jr,Yr[13]=mn,Yr[14]=gn,Yr[15]=eo}function qr(Yr,hn){Lr(Yr,hn,hn)}function Fr(Yr,hn){const Qr=Yt();for(let pn=0;pn<16;pn++)Qr[pn]=hn[pn];for(let pn=253;pn>=0;pn--)qr(Qr,Qr),pn!==2&&pn!==4&&Lr(Qr,Qr,hn);for(let pn=0;pn<16;pn++)Yr[pn]=Qr[pn]}function Hr(Yr,hn){const Qr=new Uint8Array(32),pn=new Float64Array(80),En=Yt(),ga=Yt(),dn=Yt(),Pr=Yt(),xr=Yt(),Mr=Yt();for(let Zr=0;Zr<31;Zr++)Qr[Zr]=Yr[Zr];Qr[31]=Yr[31]&127|64,Qr[0]&=248,cr(pn,hn);for(let Zr=0;Zr<16;Zr++)ga[Zr]=pn[Zr];En[0]=Pr[0]=1;for(let Zr=254;Zr>=0;--Zr){const Xr=Qr[Zr>>>3]>>>(Zr&7)&1;Qt(En,ga,Xr),Qt(dn,Pr,Xr),$r(xr,En,dn),Ar(En,En,dn),$r(dn,ga,Pr),Ar(ga,ga,Pr),qr(Pr,xr),qr(Mr,En),Lr(En,dn,En),Lr(dn,ga,xr),$r(xr,En,dn),Ar(En,En,dn),qr(ga,En),Ar(dn,Pr,Mr),Lr(En,dn,Jt),$r(En,En,Pr),Lr(dn,dn,En),Lr(En,Pr,Mr),Lr(Pr,ga,pn),qr(ga,xr),Qt(En,ga,Xr),Qt(dn,Pr,Xr)}for(let Zr=0;Zr<16;Zr++)pn[Zr+16]=En[Zr],pn[Zr+32]=dn[Zr],pn[Zr+48]=ga[Zr],pn[Zr+64]=Pr[Zr];const Nr=pn.subarray(32),Ur=pn.subarray(16);Fr(Nr,Nr),Lr(Ur,Ur,Nr);const Vr=new Uint8Array(32);return ur(Vr,Ur),Vr}Bt.scalarMult=Hr;function Br(Yr){return Hr(Yr,Xt)}Bt.scalarMultBase=Br;function Wr(Yr){if(Yr.length!==Bt.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${Bt.SECRET_KEY_LENGTH} bytes`);const hn=new Uint8Array(Yr);return{publicKey:Br(hn),secretKey:hn}}Bt.generateKeyPairFromSeed=Wr;function Gr(Yr){const hn=(0,Wt.randomBytes)(32,Yr),Qr=Wr(hn);return(0,Gt.wipe)(hn),Qr}Bt.generateKeyPair=Gr;function Kr(Yr,hn,Qr=!1){if(Yr.length!==Bt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(hn.length!==Bt.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const pn=Hr(Yr,hn);if(Qr){let En=0;for(let ga=0;ga<pn.length;ga++)En|=pn[ga];if(En===0)throw new Error("X25519: invalid shared key")}return pn}Bt.sharedKey=Kr})(x25519);function asUint8Array(Bt){return globalThis.Buffer!=null?new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength):Bt}function allocUnsafe(Bt=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?asUint8Array(globalThis.Buffer.allocUnsafe(Bt)):new Uint8Array(Bt)}function concat$3(Bt,Wt){Wt||(Wt=Bt.reduce((Xt,Jt)=>Xt+Jt.length,0));const Gt=allocUnsafe(Wt);let Yt=0;for(const Xt of Bt)Gt.set(Xt,Yt),Yt+=Xt.length;return asUint8Array(Gt)}const concat$4=Object.freeze(Object.defineProperty({__proto__:null,concat:concat$3},Symbol.toStringTag,{value:"Module"}));function equals$3(Bt,Wt){if(Bt===Wt)return!0;if(Bt.byteLength!==Wt.byteLength)return!1;for(let Gt=0;Gt<Bt.byteLength;Gt++)if(Bt[Gt]!==Wt[Gt])return!1;return!0}const equals$4=Object.freeze(Object.defineProperty({__proto__:null,equals:equals$3},Symbol.toStringTag,{value:"Module"}));function base$3(Bt,Wt){if(Bt.length>=255)throw new TypeError("Alphabet too long");for(var Gt=new Uint8Array(256),Yt=0;Yt<Gt.length;Yt++)Gt[Yt]=255;for(var Xt=0;Xt<Bt.length;Xt++){var Jt=Bt.charAt(Xt),Zt=Jt.charCodeAt(0);if(Gt[Zt]!==255)throw new TypeError(Jt+" is ambiguous");Gt[Zt]=Xt}var Qt=Bt.length,ur=Bt.charAt(0),cr=Math.log(Qt)/Math.log(256),$r=Math.log(256)/Math.log(Qt);function Ar(Fr){if(Fr instanceof Uint8Array||(ArrayBuffer.isView(Fr)?Fr=new Uint8Array(Fr.buffer,Fr.byteOffset,Fr.byteLength):Array.isArray(Fr)&&(Fr=Uint8Array.from(Fr))),!(Fr instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(Fr.length===0)return"";for(var Hr=0,Br=0,Wr=0,Gr=Fr.length;Wr!==Gr&&Fr[Wr]===0;)Wr++,Hr++;for(var Kr=(Gr-Wr)*$r+1>>>0,Yr=new Uint8Array(Kr);Wr!==Gr;){for(var hn=Fr[Wr],Qr=0,pn=Kr-1;(hn!==0||Qr<Br)&&pn!==-1;pn--,Qr++)hn+=256*Yr[pn]>>>0,Yr[pn]=hn%Qt>>>0,hn=hn/Qt>>>0;if(hn!==0)throw new Error("Non-zero carry");Br=Qr,Wr++}for(var En=Kr-Br;En!==Kr&&Yr[En]===0;)En++;for(var ga=ur.repeat(Hr);En<Kr;++En)ga+=Bt.charAt(Yr[En]);return ga}function Lr(Fr){if(typeof Fr!="string")throw new TypeError("Expected String");if(Fr.length===0)return new Uint8Array;var Hr=0;if(Fr[Hr]!==" "){for(var Br=0,Wr=0;Fr[Hr]===ur;)Br++,Hr++;for(var Gr=(Fr.length-Hr)*cr+1>>>0,Kr=new Uint8Array(Gr);Fr[Hr];){var Yr=Gt[Fr.charCodeAt(Hr)];if(Yr===255)return;for(var hn=0,Qr=Gr-1;(Yr!==0||hn<Wr)&&Qr!==-1;Qr--,hn++)Yr+=Qt*Kr[Qr]>>>0,Kr[Qr]=Yr%256>>>0,Yr=Yr/256>>>0;if(Yr!==0)throw new Error("Non-zero carry");Wr=hn,Hr++}if(Fr[Hr]!==" "){for(var pn=Gr-Wr;pn!==Gr&&Kr[pn]===0;)pn++;for(var En=new Uint8Array(Br+(Gr-pn)),ga=Br;pn!==Gr;)En[ga++]=Kr[pn++];return En}}}function qr(Fr){var Hr=Lr(Fr);if(Hr)return Hr;throw new Error(`Non-${Wt} character`)}return{encode:Ar,decodeUnsafe:Lr,decode:qr}}var src$c=base$3,_brrp__multiformats_scope_baseX=src$c;const empty$1=new Uint8Array(0),toHex$1=Bt=>Bt.reduce((Wt,Gt)=>Wt+Gt.toString(16).padStart(2,"0"),""),fromHex=Bt=>{const Wt=Bt.match(/../g);return Wt?new Uint8Array(Wt.map(Gt=>parseInt(Gt,16))):empty$1},equals$2=(Bt,Wt)=>{if(Bt===Wt)return!0;if(Bt.byteLength!==Wt.byteLength)return!1;for(let Gt=0;Gt<Bt.byteLength;Gt++)if(Bt[Gt]!==Wt[Gt])return!1;return!0},coerce=Bt=>{if(Bt instanceof Uint8Array&&Bt.constructor.name==="Uint8Array")return Bt;if(Bt instanceof ArrayBuffer)return new Uint8Array(Bt);if(ArrayBuffer.isView(Bt))return new Uint8Array(Bt.buffer,Bt.byteOffset,Bt.byteLength);throw new Error("Unknown type, must be binary type")},isBinary=Bt=>Bt instanceof ArrayBuffer||ArrayBuffer.isView(Bt),fromString$2=Bt=>new TextEncoder().encode(Bt),toString$b=Bt=>new TextDecoder().decode(Bt),bytes$1=Object.freeze(Object.defineProperty({__proto__:null,coerce,empty:empty$1,equals:equals$2,fromHex,fromString:fromString$2,isBinary,toHex:toHex$1,toString:toString$b},Symbol.toStringTag,{value:"Module"}));class Encoder{constructor(Wt,Gt,Yt){this.name=Wt,this.prefix=Gt,this.baseEncode=Yt}encode(Wt){if(Wt instanceof Uint8Array)return`${this.prefix}${this.baseEncode(Wt)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(Wt,Gt,Yt){if(this.name=Wt,this.prefix=Gt,Gt.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=Gt.codePointAt(0),this.baseDecode=Yt}decode(Wt){if(typeof Wt=="string"){if(Wt.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(Wt)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(Wt.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(Wt){return or(this,Wt)}}class ComposedDecoder{constructor(Wt){this.decoders=Wt}or(Wt){return or(this,Wt)}decode(Wt){const Gt=Wt[0],Yt=this.decoders[Gt];if(Yt)return Yt.decode(Wt);throw RangeError(`Unable to decode multibase string ${JSON.stringify(Wt)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const or=(Bt,Wt)=>new ComposedDecoder({...Bt.decoders||{[Bt.prefix]:Bt},...Wt.decoders||{[Wt.prefix]:Wt}});class Codec{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.prefix=Gt,this.baseEncode=Yt,this.baseDecode=Xt,this.encoder=new Encoder(Wt,Gt,Yt),this.decoder=new Decoder(Wt,Gt,Xt)}encode(Wt){return this.encoder.encode(Wt)}decode(Wt){return this.decoder.decode(Wt)}}const from$1=({name:Bt,prefix:Wt,encode:Gt,decode:Yt})=>new Codec(Bt,Wt,Gt,Yt),baseX$1=({prefix:Bt,name:Wt,alphabet:Gt})=>{const{encode:Yt,decode:Xt}=_brrp__multiformats_scope_baseX(Gt,Wt);return from$1({prefix:Bt,name:Wt,encode:Yt,decode:Jt=>coerce(Xt(Jt))})},decode$d=(Bt,Wt,Gt,Yt)=>{const Xt={};for(let $r=0;$r<Wt.length;++$r)Xt[Wt[$r]]=$r;let Jt=Bt.length;for(;Bt[Jt-1]==="=";)--Jt;const Zt=new Uint8Array(Jt*Gt/8|0);let Qt=0,ur=0,cr=0;for(let $r=0;$r<Jt;++$r){const Ar=Xt[Bt[$r]];if(Ar===void 0)throw new SyntaxError(`Non-${Yt} character`);ur=ur<<Gt|Ar,Qt+=Gt,Qt>=8&&(Qt-=8,Zt[cr++]=255&ur>>Qt)}if(Qt>=Gt||255&ur<<8-Qt)throw new SyntaxError("Unexpected end of data");return Zt},encode$c=(Bt,Wt,Gt)=>{const Yt=Wt[Wt.length-1]==="=",Xt=(1<<Gt)-1;let Jt="",Zt=0,Qt=0;for(let ur=0;ur<Bt.length;++ur)for(Qt=Qt<<8|Bt[ur],Zt+=8;Zt>Gt;)Zt-=Gt,Jt+=Wt[Xt&Qt>>Zt];if(Zt&&(Jt+=Wt[Xt&Qt<<Gt-Zt]),Yt)for(;Jt.length*Gt&7;)Jt+="=";return Jt},rfc4648$2=({name:Bt,prefix:Wt,bitsPerChar:Gt,alphabet:Yt})=>from$1({prefix:Wt,name:Bt,encode(Xt){return encode$c(Xt,Yt,Gt)},decode(Xt){return decode$d(Xt,Yt,Gt,Bt)}}),identity$d=from$1({prefix:"\0",name:"identity",encode:Bt=>toString$b(Bt),decode:Bt=>fromString$2(Bt)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$d},Symbol.toStringTag,{value:"Module"})),base2=rfc4648$2({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$1=Object.freeze(Object.defineProperty({__proto__:null,base2},Symbol.toStringTag,{value:"Module"})),base8=rfc4648$2({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),base10=baseX$1({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$1=Object.freeze(Object.defineProperty({__proto__:null,base10},Symbol.toStringTag,{value:"Module"})),base16=rfc4648$2({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc4648$2({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$1=Object.freeze(Object.defineProperty({__proto__:null,base16,base16upper},Symbol.toStringTag,{value:"Module"})),base32=rfc4648$2({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648$2({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648$2({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648$2({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648$2({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648$2({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648$2({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648$2({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648$2({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$1=Object.freeze(Object.defineProperty({__proto__:null,base32,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64$1=rfc4648$2({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648$2({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648$2({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648$2({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$2=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$1,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce((Bt,Wt,Gt)=>(Bt[Gt]=Wt,Bt),[]),alphabetCharsToBytes=alphabet.reduce((Bt,Wt,Gt)=>(Bt[Wt.codePointAt(0)]=Gt,Bt),[]);function encode$b(Bt){return Bt.reduce((Wt,Gt)=>(Wt+=alphabetBytesToChars[Gt],Wt),"")}function decode$c(Bt){const Wt=[];for(const Gt of Bt){const Yt=alphabetCharsToBytes[Gt.codePointAt(0)];if(Yt===void 0)throw new Error(`Non-base256emoji character: ${Gt}`);Wt.push(Yt)}return new Uint8Array(Wt)}const base256emoji=from$1({prefix:"🚀",name:"base256emoji",encode:encode$b,decode:decode$c}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"}));var encode_1$2=encode$a,MSB$2=128,REST$2=127,MSBALL$1=~REST$2,INT$1=Math.pow(2,31);function encode$a(Bt,Wt,Gt){Wt=Wt||[],Gt=Gt||0;for(var Yt=Gt;Bt>=INT$1;)Wt[Gt++]=Bt&255|MSB$2,Bt/=128;for(;Bt&MSBALL$1;)Wt[Gt++]=Bt&255|MSB$2,Bt>>>=7;return Wt[Gt]=Bt|0,encode$a.bytes=Gt-Yt+1,Wt}var decode$b=read$2,MSB$1$1=128,REST$1$1=127;function read$2(Bt,Yt){var Gt=0,Yt=Yt||0,Xt=0,Jt=Yt,Zt,Qt=Bt.length;do{if(Jt>=Qt)throw read$2.bytes=0,new RangeError("Could not decode varint");Zt=Bt[Jt++],Gt+=Xt<28?(Zt&REST$1$1)<<Xt:(Zt&REST$1$1)*Math.pow(2,Xt),Xt+=7}while(Zt>=MSB$1$1);return read$2.bytes=Jt-Yt,Gt}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$2=function(Bt){return Bt<N1$1?1:Bt<N2$1?2:Bt<N3$1?3:Bt<N4$1?4:Bt<N5$1?5:Bt<N6$1?6:Bt<N7$1?7:Bt<N8$1?8:Bt<N9$1?9:10},varint$4={encode:encode_1$2,decode:decode$b,encodingLength:length$2},_brrp_varint=varint$4;const decode$a=(Bt,Wt=0)=>[_brrp_varint.decode(Bt,Wt),_brrp_varint.decode.bytes],encodeTo=(Bt,Wt,Gt=0)=>(_brrp_varint.encode(Bt,Wt,Gt),Wt),encodingLength=Bt=>_brrp_varint.encodingLength(Bt),varint$3=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$a,encodeTo,encodingLength},Symbol.toStringTag,{value:"Module"})),create=(Bt,Wt)=>{const Gt=Wt.byteLength,Yt=encodingLength(Bt),Xt=Yt+encodingLength(Gt),Jt=new Uint8Array(Xt+Gt);return encodeTo(Bt,Jt,0),encodeTo(Gt,Jt,Yt),Jt.set(Wt,Xt),new Digest(Bt,Gt,Wt,Jt)},decode$9=Bt=>{const Wt=coerce(Bt),[Gt,Yt]=decode$a(Wt),[Xt,Jt]=decode$a(Wt.subarray(Yt)),Zt=Wt.subarray(Yt+Jt);if(Zt.byteLength!==Xt)throw new Error("Incorrect length");return new Digest(Gt,Xt,Zt,Wt)},equals$1=(Bt,Wt)=>Bt===Wt?!0:Bt.code===Wt.code&&Bt.size===Wt.size&&equals$2(Bt.bytes,Wt.bytes);class Digest{constructor(Wt,Gt,Yt,Xt){this.code=Wt,this.size=Gt,this.digest=Yt,this.bytes=Xt}}const digest$2=Object.freeze(Object.defineProperty({__proto__:null,Digest,create,decode:decode$9,equals:equals$1},Symbol.toStringTag,{value:"Module"})),from=({name:Bt,code:Wt,encode:Gt})=>new Hasher(Bt,Wt,Gt);class Hasher{constructor(Wt,Gt,Yt){this.name=Wt,this.code=Gt,this.encode=Yt}digest(Wt){if(Wt instanceof Uint8Array){const Gt=this.encode(Wt);return Gt instanceof Uint8Array?create(this.code,Gt):Gt.then(Yt=>create(this.code,Yt))}else throw Error("Unknown type, must be binary type")}}const hasher=Object.freeze(Object.defineProperty({__proto__:null,Hasher,from},Symbol.toStringTag,{value:"Module"})),sha$1=Bt=>async Wt=>new Uint8Array(await crypto.subtle.digest(Bt,Wt)),sha256$3=from({name:"sha2-256",code:18,encode:sha$1("SHA-256")}),sha512$2=from({name:"sha2-512",code:19,encode:sha$1("SHA-512")}),sha2=Object.freeze(Object.defineProperty({__proto__:null,sha256:sha256$3,sha512:sha512$2},Symbol.toStringTag,{value:"Module"})),code$2=0,name$4="identity",encode$9=coerce,digest$1=Bt=>create(code$2,encode$9(Bt)),identity$b={code:code$2,name:name$4,encode:encode$9,digest:digest$1},identity$c=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$b},Symbol.toStringTag,{value:"Module"})),name$3="raw",code$1=85,encode$8=Bt=>coerce(Bt),decode$8=Bt=>coerce(Bt),raw=Object.freeze(Object.defineProperty({__proto__:null,code:code$1,decode:decode$8,encode:encode$8,name:name$3},Symbol.toStringTag,{value:"Module"})),textEncoder$1=new TextEncoder,textDecoder$1=new TextDecoder,name$2="json",code=512,encode$7=Bt=>textEncoder$1.encode(JSON.stringify(Bt)),decode$7=Bt=>JSON.parse(textDecoder$1.decode(Bt)),json=Object.freeze(Object.defineProperty({__proto__:null,code,decode:decode$7,encode:encode$7,name:name$2},Symbol.toStringTag,{value:"Module"}));class CID{constructor(Wt,Gt,Yt,Xt){this.code=Gt,this.version=Wt,this.multihash=Yt,this.bytes=Xt,this.byteOffset=Xt.byteOffset,this.byteLength=Xt.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:hidden,byteLength:hidden,code:readonly,version:readonly,multihash:readonly,bytes:readonly,_baseCache:hidden,asCID:hidden})}toV0(){switch(this.version){case 0:return this;default:{const{code:Wt,multihash:Gt}=this;if(Wt!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(Gt.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(Gt)}}}toV1(){switch(this.version){case 0:{const{code:Wt,digest:Gt}=this.multihash,Yt=create(Wt,Gt);return CID.createV1(this.code,Yt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(Wt){return Wt&&this.code===Wt.code&&this.version===Wt.version&&equals$1(this.multihash,Wt.multihash)}toString(Wt){const{bytes:Gt,version:Yt,_baseCache:Xt}=this;switch(Yt){case 0:return toStringV0(Gt,Xt,Wt||base58btc.encoder);default:return toStringV1(Gt,Xt,Wt||base32.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(Wt){return deprecate(/^0\.0/,IS_CID_DEPRECATION),!!(Wt&&(Wt[cidSymbol]||Wt.asCID===Wt))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(Wt){if(Wt instanceof CID)return Wt;if(Wt!=null&&Wt.asCID===Wt){const{version:Gt,code:Yt,multihash:Xt,bytes:Jt}=Wt;return new CID(Gt,Yt,Xt,Jt||encodeCID(Gt,Yt,Xt.bytes))}else if(Wt!=null&&Wt[cidSymbol]===!0){const{version:Gt,multihash:Yt,code:Xt}=Wt,Jt=decode$9(Yt);return CID.create(Gt,Xt,Jt)}else return null}static create(Wt,Gt,Yt){if(typeof Gt!="number")throw new Error("String codecs are no longer supported");switch(Wt){case 0:{if(Gt!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(Wt,Gt,Yt,Yt.bytes)}case 1:{const Xt=encodeCID(Wt,Gt,Yt.bytes);return new CID(Wt,Gt,Yt,Xt)}default:throw new Error("Invalid version")}}static createV0(Wt){return CID.create(0,DAG_PB_CODE,Wt)}static createV1(Wt,Gt){return CID.create(1,Wt,Gt)}static decode(Wt){const[Gt,Yt]=CID.decodeFirst(Wt);if(Yt.length)throw new Error("Incorrect length");return Gt}static decodeFirst(Wt){const Gt=CID.inspectBytes(Wt),Yt=Gt.size-Gt.multihashSize,Xt=coerce(Wt.subarray(Yt,Yt+Gt.multihashSize));if(Xt.byteLength!==Gt.multihashSize)throw new Error("Incorrect length");const Jt=Xt.subarray(Gt.multihashSize-Gt.digestSize),Zt=new Digest(Gt.multihashCode,Gt.digestSize,Jt,Xt);return[Gt.version===0?CID.createV0(Zt):CID.createV1(Gt.codec,Zt),Wt.subarray(Gt.size)]}static inspectBytes(Wt){let Gt=0;const Yt=()=>{const[Ar,Lr]=decode$a(Wt.subarray(Gt));return Gt+=Lr,Ar};let Xt=Yt(),Jt=DAG_PB_CODE;if(Xt===18?(Xt=0,Gt=0):Xt===1&&(Jt=Yt()),Xt!==0&&Xt!==1)throw new RangeError(`Invalid CID version ${Xt}`);const Zt=Gt,Qt=Yt(),ur=Yt(),cr=Gt+ur,$r=cr-Zt;return{version:Xt,codec:Jt,multihashCode:Qt,digestSize:ur,multihashSize:$r,size:cr}}static parse(Wt,Gt){const[Yt,Xt]=parseCIDtoBytes(Wt,Gt),Jt=CID.decode(Xt);return Jt._baseCache.set(Yt,Wt),Jt}}const parseCIDtoBytes=(Bt,Wt)=>{switch(Bt[0]){case"Q":{const Gt=Wt||base58btc;return[base58btc.prefix,Gt.decode(`${base58btc.prefix}${Bt}`)]}case base58btc.prefix:{const Gt=Wt||base58btc;return[base58btc.prefix,Gt.decode(Bt)]}case base32.prefix:{const Gt=Wt||base32;return[base32.prefix,Gt.decode(Bt)]}default:{if(Wt==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[Bt[0],Wt.decode(Bt)]}}},toStringV0=(Bt,Wt,Gt)=>{const{prefix:Yt}=Gt;if(Yt!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${Gt.name} encoding`);const Xt=Wt.get(Yt);if(Xt==null){const Jt=Gt.encode(Bt).slice(1);return Wt.set(Yt,Jt),Jt}else return Xt},toStringV1=(Bt,Wt,Gt)=>{const{prefix:Yt}=Gt,Xt=Wt.get(Yt);if(Xt==null){const Jt=Gt.encode(Bt);return Wt.set(Yt,Jt),Jt}else return Xt},DAG_PB_CODE=112,SHA_256_CODE=18,encodeCID=(Bt,Wt,Gt)=>{const Yt=encodingLength(Bt),Xt=Yt+encodingLength(Wt),Jt=new Uint8Array(Xt+Gt.byteLength);return encodeTo(Bt,Jt,0),encodeTo(Wt,Jt,Yt),Jt.set(Gt,Xt),Jt},cidSymbol=Symbol.for("@ipld/js-cid/CID"),readonly={writable:!1,configurable:!1,enumerable:!0},hidden={writable:!1,enumerable:!1,configurable:!1},version$w="0.0.0-dev",deprecate=(Bt,Wt)=>{if(Bt.test(version$w))console.warn(Wt);else throw new Error(Wt)},IS_CID_DEPRECATION=`CID.isCID(v) is deprecated and will be removed in the next major release.
713
713
  Following code pattern:
714
714
 
715
715
  if (CID.isCID(value)) {
@@ -758,7 +758,7 @@ __p += '`),e0&&(Bl+=`' +
758
758
  function print() { __p += __j.call(arguments, '') }
759
759
  `:`;
760
760
  `)+Bl+`return __p
761
- }`;var Up=sw(function(){return Vp(mu,wp+"return "+Bl).apply(yo,Du)});if(Up.source=Bl,A1(Up))throw Up;return Up}function LS(yn){return p0(yn).toLowerCase()}function jS(yn){return p0(yn).toUpperCase()}function BS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return Iv(yn);if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=Tm(va),mu=Nv(So,Xo),Du=kv(So,Xo)+1;return _g(So,mu,Du).join("")}function FS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return yn.slice(0,Jv(yn)+1);if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=kv(So,Tm(va))+1;return _g(So,0,Xo).join("")}function qS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return yn.replace(Hp,"");if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=Nv(So,Tm(va));return _g(So,Xo).join("")}function US(yn,va){var co=Vo,So=zo;if(M0(va)){var Xo="separator"in va?va.separator:Xo;co="length"in va?qp(va.length):co,So="omission"in va?Om(va.omission):So}yn=p0(yn);var mu=yn.length;if(Ky(yn)){var Du=Tm(yn);mu=Du.length}if(co>=mu)return yn;var Ku=co-Vy(So);if(Ku<1)return So;var ll=Du?_g(Du,0,Ku).join(""):yn.slice(0,Ku);if(Xo===yo)return ll+So;if(Du&&(Ku+=ll.length-Ku),T1(Xo)){if(yn.slice(Ku).search(Xo)){var Cl,Il=ll;for(Xo.global||(Xo=Lv(Xo.source,p0(A0.exec(Xo))+"g")),Xo.lastIndex=0;Cl=Xo.exec(Il);)var Bl=Cl.index;ll=ll.slice(0,Bl===yo?Ku:Bl)}}else if(yn.indexOf(Om(Xo),Ku)!=Ku){var sp=ll.lastIndexOf(Xo);sp>-1&&(ll=ll.slice(0,sp))}return ll+So}function HS(yn){return yn=p0(yn),yn&&Oo.test(yn)?yn.replace(j0,I_):yn}var zS=Sv(function(yn,va,co){return yn+(co?" ":"")+va.toUpperCase()}),O1=u$("toUpperCase");function ow(yn,va,co){return yn=p0(yn),va=co?yo:va,va===yo?P_(yn)?Qv(yn):iv(yn):yn.match(va)||[]}var sw=Gp(function(yn,va){try{return W0(yn,yo,va)}catch(co){return A1(co)?co:new Ip(co)}}),GS=Dy(function(yn,va){return z0(va,function(co){co=Sy(co),kp(yn,co,x1(yn[co],yn))}),yn});function KS(yn){var va=yn==null?0:yn.length,co=Pp();return yn=va?d0(yn,function(So){if(typeof So[1]!="function")throw new dm($o);return[co(So[0]),So[1]]}):[],Gp(function(So){for(var Xo=-1;++Xo<va;){var mu=yn[Xo];if(W0(mu[0],this,So))return W0(mu[1],this,So)}})}function VS(yn){return _0(Sp(yn,nu))}function R1(yn){return function(){return yn}}function YS(yn,va){return yn==null||yn!==yn?va:yn}var XS=c$(),JS=c$(!0);function Em(yn){return yn}function C1(yn){return F1(typeof yn=="function"?yn:Sp(yn,nu))}function ZS(yn){return U1(Sp(yn,nu))}function QS(yn,va){return H1(yn,Sp(va,nu))}var eA=Gp(function(yn,va){return function(co){return Fv(co,yn,va)}}),tA=Gp(function(yn,va){return function(co){return Fv(yn,co,va)}});function I1(yn,va,co){var So=G0(va),Xo=uv(va,So);co==null&&!(M0(va)&&(Xo.length||!So.length))&&(co=va,va=yn,yn=this,Xo=uv(va,G0(va)));var mu=!(M0(co)&&"chain"in co)||!!co.chain,Du=jy(yn);return z0(Xo,function(Ku){var ll=va[Ku];yn[Ku]=ll,Du&&(yn.prototype[Ku]=function(){var Cl=this.__chain__;if(mu||Cl){var Il=yn(this.__wrapped__),Bl=Il.__actions__=bm(this.__actions__);return Bl.push({func:ll,args:arguments,thisArg:yn}),Il.__chain__=Cl,Il}return ll.apply(yn,jm([this.value()],arguments))})}),yn}function rA(){return $0._===this&&($0._=vo),this}function k1(){}function nA(yn){return yn=qp(yn),Gp(function(va){return W1(va,yn)})}var iA=l1(d0),aA=l1(Uy),oA=l1(J0);function uw(yn){return y1(yn)?zy(Sy(yn)):Rw(yn)}function sA(yn){return function(va){return yn==null?yo:Gm(yn,va)}}var uA=d$(),lA=d$(!0);function D1(){return[]}function L1(){return!1}function cA(){return{}}function fA(){return""}function dA(){return!0}function hA(yn,va){if(yn=qp(yn),yn<1||yn>Ho)return[];var co=du,So=jl(yn,du);va=Pp(va),yn-=du;for(var Xo=bv(So,va);++co<yn;)va(co);return Xo}function pA(yn){return Bp(yn)?d0(yn,Sy):Rm(yn)?[yn]:bm(P$(p0(yn)))}function mA(yn){var va=++vn;return p0(yn)+va}var yA=d_(function(yn,va){return yn+va},0),gA=c1("ceil"),vA=d_(function(yn,va){return yn/va},1),_A=c1("floor");function bA(yn){return yn&&yn.length?Wm(yn,Em,Ev):yo}function $A(yn,va){return yn&&yn.length?Wm(yn,Pp(va,2),Ev):yo}function wA(yn){return yv(yn,Em)}function EA(yn,va){return yv(yn,Pp(va,2))}function xA(yn){return yn&&yn.length?Wm(yn,Em,Q_):yo}function SA(yn,va){return yn&&yn.length?Wm(yn,Pp(va,2),Q_):yo}var AA=d_(function(yn,va){return yn*va},1),TA=c1("round"),PA=d_(function(yn,va){return yn-va},0);function MA(yn){return yn&&yn.length?_v(yn,Em):0}function OA(yn,va){return yn&&yn.length?_v(yn,Pp(va,2)):0}return uu.after=X2,uu.ary=B$,uu.assign=jx,uu.assignIn=Q$,uu.assignInWith=S_,uu.assignWith=Bx,uu.at=Fx,uu.before=F$,uu.bind=x1,uu.bindAll=GS,uu.bindKey=q$,uu.castArray=ux,uu.chain=D$,uu.chunk=pE,uu.compact=mE,uu.concat=yE,uu.cond=KS,uu.conforms=VS,uu.constant=R1,uu.countBy=A2,uu.create=qx,uu.curry=U$,uu.curryRight=H$,uu.debounce=W$,uu.defaults=Ux,uu.defaultsDeep=Hx,uu.defer=J2,uu.delay=Z2,uu.difference=gE,uu.differenceBy=vE,uu.differenceWith=_E,uu.drop=bE,uu.dropRight=$E,uu.dropRightWhile=wE,uu.dropWhile=EE,uu.fill=xE,uu.filter=P2,uu.flatMap=R2,uu.flatMapDeep=C2,uu.flatMapDepth=I2,uu.flatten=C$,uu.flattenDeep=SE,uu.flattenDepth=AE,uu.flip=Q2,uu.flow=XS,uu.flowRight=JS,uu.fromPairs=TE,uu.functions=Xx,uu.functionsIn=Jx,uu.groupBy=k2,uu.initial=ME,uu.intersection=OE,uu.intersectionBy=CE,uu.intersectionWith=IE,uu.invert=Qx,uu.invertBy=eS,uu.invokeMap=L2,uu.iteratee=C1,uu.keyBy=j2,uu.keys=G0,uu.keysIn=wm,uu.map=__,uu.mapKeys=rS,uu.mapValues=nS,uu.matches=ZS,uu.matchesProperty=QS,uu.memoize=$_,uu.merge=iS,uu.mergeWith=ew,uu.method=eA,uu.methodOf=tA,uu.mixin=I1,uu.negate=w_,uu.nthArg=nA,uu.omit=aS,uu.omitBy=oS,uu.once=ex,uu.orderBy=B2,uu.over=iA,uu.overArgs=tx,uu.overEvery=aA,uu.overSome=oA,uu.partial=S1,uu.partialRight=z$,uu.partition=F2,uu.pick=sS,uu.pickBy=tw,uu.property=uw,uu.propertyOf=sA,uu.pull=LE,uu.pullAll=N$,uu.pullAllBy=jE,uu.pullAllWith=BE,uu.pullAt=FE,uu.range=uA,uu.rangeRight=lA,uu.rearg=rx,uu.reject=H2,uu.remove=qE,uu.rest=nx,uu.reverse=w1,uu.sampleSize=z2,uu.set=lS,uu.setWith=cS,uu.shuffle=G2,uu.slice=UE,uu.sortBy=Y2,uu.sortedUniq=YE,uu.sortedUniqBy=XE,uu.split=IS,uu.spread=ix,uu.tail=JE,uu.take=ZE,uu.takeRight=QE,uu.takeRightWhile=t2,uu.takeWhile=r2,uu.tap=g2,uu.throttle=ax,uu.thru=v_,uu.toArray=X$,uu.toPairs=rw,uu.toPairsIn=nw,uu.toPath=pA,uu.toPlainObject=Z$,uu.transform=fS,uu.unary=ox,uu.union=n2,uu.unionBy=i2,uu.unionWith=a2,uu.uniq=o2,uu.uniqBy=s2,uu.uniqWith=u2,uu.unset=dS,uu.unzip=E1,uu.unzipWith=k$,uu.update=hS,uu.updateWith=pS,uu.values=Pv,uu.valuesIn=mS,uu.without=l2,uu.words=ow,uu.wrap=sx,uu.xor=c2,uu.xorBy=f2,uu.xorWith=d2,uu.zip=h2,uu.zipObject=p2,uu.zipObjectDeep=m2,uu.zipWith=y2,uu.entries=rw,uu.entriesIn=nw,uu.extend=Q$,uu.extendWith=S_,I1(uu,uu),uu.add=yA,uu.attempt=sw,uu.camelCase=_S,uu.capitalize=iw,uu.ceil=gA,uu.clamp=yS,uu.clone=lx,uu.cloneDeep=fx,uu.cloneDeepWith=dx,uu.cloneWith=cx,uu.conformsTo=hx,uu.deburr=aw,uu.defaultTo=YS,uu.divide=vA,uu.endsWith=bS,uu.eq=dy,uu.escape=$S,uu.escapeRegExp=wS,uu.every=T2,uu.find=M2,uu.findIndex=O$,uu.findKey=Wx,uu.findLast=O2,uu.findLastIndex=R$,uu.findLastKey=zx,uu.floor=_A,uu.forEach=L$,uu.forEachRight=j$,uu.forIn=Gx,uu.forInRight=Kx,uu.forOwn=Vx,uu.forOwnRight=Yx,uu.get=P1,uu.gt=px,uu.gte=mx,uu.has=Zx,uu.hasIn=M1,uu.head=I$,uu.identity=Em,uu.includes=D2,uu.indexOf=PE,uu.inRange=gS,uu.invoke=tS,uu.isArguments=hv,uu.isArray=Bp,uu.isArrayBuffer=yx,uu.isArrayLike=$m,uu.isArrayLikeObject=k0,uu.isBoolean=gx,uu.isBuffer=ev,uu.isDate=vx,uu.isElement=_x,uu.isEmpty=bx,uu.isEqual=$x,uu.isEqualWith=wx,uu.isError=A1,uu.isFinite=Ex,uu.isFunction=jy,uu.isInteger=G$,uu.isLength=E_,uu.isMap=K$,uu.isMatch=xx,uu.isMatchWith=Sx,uu.isNaN=Ax,uu.isNative=Tx,uu.isNil=Mx,uu.isNull=Px,uu.isNumber=V$,uu.isObject=M0,uu.isObjectLike=O0,uu.isPlainObject=Gv,uu.isRegExp=T1,uu.isSafeInteger=Ox,uu.isSet=Y$,uu.isString=x_,uu.isSymbol=Rm,uu.isTypedArray=Tv,uu.isUndefined=Rx,uu.isWeakMap=Cx,uu.isWeakSet=Ix,uu.join=NE,uu.kebabCase=ES,uu.last=Vm,uu.lastIndexOf=kE,uu.lowerCase=xS,uu.lowerFirst=SS,uu.lt=Nx,uu.lte=Dx,uu.max=bA,uu.maxBy=$A,uu.mean=wA,uu.meanBy=EA,uu.min=xA,uu.minBy=SA,uu.stubArray=D1,uu.stubFalse=L1,uu.stubObject=cA,uu.stubString=fA,uu.stubTrue=dA,uu.multiply=AA,uu.nth=DE,uu.noConflict=rA,uu.noop=k1,uu.now=b_,uu.pad=AS,uu.padEnd=TS,uu.padStart=PS,uu.parseInt=MS,uu.random=vS,uu.reduce=q2,uu.reduceRight=U2,uu.repeat=OS,uu.replace=RS,uu.result=uS,uu.round=TA,uu.runInContext=il,uu.sample=W2,uu.size=K2,uu.snakeCase=CS,uu.some=V2,uu.sortedIndex=HE,uu.sortedIndexBy=WE,uu.sortedIndexOf=zE,uu.sortedLastIndex=GE,uu.sortedLastIndexBy=KE,uu.sortedLastIndexOf=VE,uu.startCase=NS,uu.startsWith=kS,uu.subtract=PA,uu.sum=MA,uu.sumBy=OA,uu.template=DS,uu.times=hA,uu.toFinite=By,uu.toInteger=qp,uu.toLength=J$,uu.toLower=LS,uu.toNumber=Ym,uu.toSafeInteger=Lx,uu.toString=p0,uu.toUpper=jS,uu.trim=BS,uu.trimEnd=FS,uu.trimStart=qS,uu.truncate=US,uu.unescape=HS,uu.uniqueId=mA,uu.upperCase=zS,uu.upperFirst=O1,uu.each=L$,uu.eachRight=j$,uu.first=I$,I1(uu,function(){var yn={};return Mm(uu,function(va,co){go.call(uu.prototype,co)||(yn[co]=va)}),yn}(),{chain:!1}),uu.VERSION=Do,z0(["bind","bindKey","curry","curryRight","partial","partialRight"],function(yn){uu[yn].placeholder=uu}),z0(["drop","take"],function(yn,va){zp.prototype[yn]=function(co){co=co===yo?1:Ol(qp(co),0);var So=this.__filtered__&&!va?new zp(this):this.clone();return So.__filtered__?So.__takeCount__=jl(co,So.__takeCount__):So.__views__.push({size:jl(co,du),type:yn+(So.__dir__<0?"Right":"")}),So},zp.prototype[yn+"Right"]=function(co){return this.reverse()[yn](co).reverse()}}),z0(["filter","map","takeWhile"],function(yn,va){var co=va+1,So=co==hu||co==ju;zp.prototype[yn]=function(Xo){var mu=this.clone();return mu.__iteratees__.push({iteratee:Pp(Xo,3),type:co}),mu.__filtered__=mu.__filtered__||So,mu}}),z0(["head","last"],function(yn,va){var co="take"+(va?"Right":"");zp.prototype[yn]=function(){return this[co](1).value()[0]}}),z0(["initial","tail"],function(yn,va){var co="drop"+(va?"":"Right");zp.prototype[yn]=function(){return this.__filtered__?new zp(this):this[co](1)}}),zp.prototype.compact=function(){return this.filter(Em)},zp.prototype.find=function(yn){return this.filter(yn).head()},zp.prototype.findLast=function(yn){return this.reverse().find(yn)},zp.prototype.invokeMap=Gp(function(yn,va){return typeof yn=="function"?new zp(this):this.map(function(co){return Fv(co,yn,va)})}),zp.prototype.reject=function(yn){return this.filter(w_(Pp(yn)))},zp.prototype.slice=function(yn,va){yn=qp(yn);var co=this;return co.__filtered__&&(yn>0||va<0)?new zp(co):(yn<0?co=co.takeRight(-yn):yn&&(co=co.drop(yn)),va!==yo&&(va=qp(va),co=va<0?co.dropRight(-va):co.take(va-yn)),co)},zp.prototype.takeRightWhile=function(yn){return this.reverse().takeWhile(yn).reverse()},zp.prototype.toArray=function(){return this.take(du)},Mm(zp.prototype,function(yn,va){var co=/^(?:filter|find|map|reject)|While$/.test(va),So=/^(?:head|last)$/.test(va),Xo=uu[So?"take"+(va=="last"?"Right":""):va],mu=So||/^find/.test(va);Xo&&(uu.prototype[va]=function(){var Du=this.__wrapped__,Ku=So?[1]:arguments,ll=Du instanceof zp,Cl=Ku[0],Il=ll||Bp(Du),Bl=function(Xp){var e0=Xo.apply(uu,jm([Xp],Ku));return So&&sp?e0[0]:e0};Il&&co&&typeof Cl=="function"&&Cl.length!=1&&(ll=Il=!1);var sp=this.__chain__,wp=!!this.__actions__.length,Rp=mu&&!sp,Up=ll&&!wp;if(!mu&&Il){Du=Up?Du:new zp(this);var Cp=yn.apply(Du,Ku);return Cp.__actions__.push({func:v_,args:[Bl],thisArg:yo}),new Z0(Cp,sp)}return Rp&&Up?yn.apply(this,Ku):(Cp=this.thru(Bl),Rp?So?Cp.value()[0]:Cp.value():Cp)})}),z0(["pop","push","shift","sort","splice","unshift"],function(yn){var va=av[yn],co=/^(?:push|sort|unshift)$/.test(yn)?"tap":"thru",So=/^(?:pop|shift)$/.test(yn);uu.prototype[yn]=function(){var Xo=arguments;if(So&&!this.__chain__){var mu=this.value();return va.apply(Bp(mu)?mu:[],Xo)}return this[co](function(Du){return va.apply(Bp(Du)?Du:[],Xo)})}}),Mm(zp.prototype,function(yn,va){var co=uu[va];if(co){var So=co.name+"";go.call(E0,So)||(E0[So]=[]),E0[So].push({name:va,func:co})}}),E0[f_(yo,Ru).name]=[{name:"wrapper",func:yo}],zp.prototype.clone=L_,zp.prototype.reverse=Xy,zp.prototype.value=qm,uu.prototype.at=v2,uu.prototype.chain=_2,uu.prototype.commit=b2,uu.prototype.next=$2,uu.prototype.plant=E2,uu.prototype.reverse=x2,uu.prototype.toJSON=uu.prototype.valueOf=uu.prototype.value=S2,uu.prototype.first=uu.prototype.head,ul&&(uu.prototype[ul]=w2),uu},Yy=k_();im?((im.exports=Yy)._=Yy,Am._=Yy):$0._=Yy}).call(Wr)})(Gr,Gr.exports);var Kr=Object.defineProperty,Yr=Object.defineProperties,hn=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertySymbols,pn=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,ga=(Mo,bo,yo)=>bo in Mo?Kr(Mo,bo,{enumerable:!0,configurable:!0,writable:!0,value:yo}):Mo[bo]=yo,dn=(Mo,bo)=>{for(var yo in bo||(bo={}))pn.call(bo,yo)&&ga(Mo,yo,bo[yo]);if(Qr)for(var yo of Qr(bo))En.call(bo,yo)&&ga(Mo,yo,bo[yo]);return Mo},Pr=(Mo,bo)=>Yr(Mo,hn(bo));function xr(Mo,bo,yo){let Do;const Tu=Mr(Mo);return bo.rpcMap&&(Do=bo.rpcMap[Tu]),Do||(Do=`${Hr}?chainId=eip155:${Tu}&projectId=${yo}`),Do}function Mr(Mo){return Mo.includes("eip155")?Number(Mo.split(":")[1]):Number(Mo)}function Nr(Mo){return Mo.map(bo=>`${bo.split(":")[0]}:${bo.split(":")[1]}`)}function Ur(Mo,bo){const yo=Object.keys(bo.namespaces).filter(Tu=>Tu.includes(Mo));if(!yo.length)return[];const Do=[];return yo.forEach(Tu=>{const wu=bo.namespaces[Tu].accounts;Do.push(...wu)}),Do}function Vr(Mo={},bo={}){const yo=Zr(Mo),Do=Zr(bo);return Gr.exports.merge(yo,Do)}function Zr(Mo){var bo,yo,Do,Tu;const wu={};if(!Wt.isValidObject(Mo))return wu;for(const[$o,mo]of Object.entries(Mo)){const _o=Wt.isCaipNamespace($o)?[$o]:mo.chains,To=mo.methods||[],iu=mo.events||[],nu=mo.rpcMap||{},Jo=Wt.parseNamespaceKey($o);wu[Jo]=Pr(dn(dn({},wu[Jo]),mo),{chains:Wt.mergeArrays(_o,(bo=wu[Jo])==null?void 0:bo.chains),methods:Wt.mergeArrays(To,(yo=wu[Jo])==null?void 0:yo.methods),events:Wt.mergeArrays(iu,(Do=wu[Jo])==null?void 0:Do.events),rpcMap:dn(dn({},nu),(Tu=wu[Jo])==null?void 0:Tu.rpcMap)})}return wu}function Xr(Mo){return Mo.includes(":")?Mo.split(":")[2]:Mo}function Or(Mo){const bo={};for(const[yo,Do]of Object.entries(Mo)){const Tu=Do.methods||[],wu=Do.events||[],$o=Do.accounts||[],mo=Wt.isCaipNamespace(yo)?[yo]:Do.chains?Do.chains:Nr(Do.accounts);bo[yo]={chains:mo,methods:Tu,events:wu,accounts:$o}}return bo}const jr={},Jr=Mo=>jr[Mo],mn=(Mo,bo)=>{jr[Mo]=bo};class gn{constructor(bo){this.name="polkadot",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2])||[]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class eo{constructor(bo){this.name="eip155",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(bo){switch(bo.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(bo);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(bo.request.method)?await this.client.request(bo):this.getHttpProvider().request(bo.request)}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}setDefaultChain(bo,yo){const Do=Mr(bo);if(!this.httpProviders[Do]){const Tu=yo||xr(`${this.name}:${Do}`,this.namespace,this.client.core.projectId);if(!Tu)throw new Error(`No RPC url provided for chainId: ${Do}`);this.setHttpProvider(Do,Tu)}this.chainId=Do,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${Do}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}createHttpProvider(bo,yo){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new Yt.HttpConnection(Do,Jr("disableProviderPing")))}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;const Tu=Mr(yo);bo[Tu]=this.createHttpProvider(Tu,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}getHttpProvider(){const bo=this.chainId,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}async handleSwitchChain(bo){var yo,Do;let Tu=bo.request.params?(yo=bo.request.params[0])==null?void 0:yo.chainId:"0x0";Tu=Tu.startsWith("0x")?Tu:`0x${Tu}`;const wu=parseInt(Tu,16);if(this.isChainApproved(wu))this.setDefaultChain(`${wu}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:bo.topic,request:{method:bo.request.method,params:[{chainId:Tu}]},chainId:(Do=this.namespace.chains)==null?void 0:Do[0]}),this.setDefaultChain(`${wu}`);else throw new Error(`Failed to switch to chain 'eip155:${wu}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(bo){return this.namespace.chains.includes(`${this.name}:${bo}`)}}class _i{constructor(bo){this.name="solana",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class ro{constructor(bo){this.name="cosmos",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class io{constructor(bo){this.name="cip34",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||this.getCardanoRPCUrl(bo);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{const Do=this.getCardanoRPCUrl(yo);bo[yo]=this.createHttpProvider(yo,Do)}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}getCardanoRPCUrl(bo){const yo=this.namespace.rpcMap;if(yo)return yo[bo]}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||this.getCardanoRPCUrl(bo);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class ao{constructor(bo){this.name="elrond",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class oo{constructor(bo){this.name="multiversx",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}var to=Object.defineProperty,so=Object.defineProperties,lo=Object.getOwnPropertyDescriptors,Ro=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,xo=(Mo,bo,yo)=>bo in Mo?to(Mo,bo,{enumerable:!0,configurable:!0,writable:!0,value:yo}):Mo[bo]=yo,ho=(Mo,bo)=>{for(var yo in bo||(bo={}))Io.call(bo,yo)&&xo(Mo,yo,bo[yo]);if(Ro)for(var yo of Ro(bo))Fo.call(bo,yo)&&xo(Mo,yo,bo[yo]);return Mo},po=(Mo,bo)=>so(Mo,lo(bo));class Ao{constructor(bo){this.events=new cr.default,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=bo,this.logger=typeof(bo==null?void 0:bo.logger)<"u"&&typeof(bo==null?void 0:bo.logger)!="string"?bo.logger:Gt.pino(Gt.getDefaultLoggerOptions({level:(bo==null?void 0:bo.logger)||$r})),this.disableProviderPing=(bo==null?void 0:bo.disableProviderPing)||!1}static async init(bo){const yo=new Ao(bo);return await yo.initialize(),yo}async request(bo,yo){const[Do,Tu]=this.validateChain(yo);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(Do).request({request:ho({},bo),chainId:`${Do}:${Tu}`,topic:this.session.topic})}sendAsync(bo,yo,Do){this.request(bo,Do).then(Tu=>yo(null,Tu)).catch(Tu=>yo(Tu,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var bo;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(bo=this.session)==null?void 0:bo.topic,reason:Wt.getSdkError("USER_DISCONNECTED")}),await this.cleanup()}async connect(bo){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(bo),await this.cleanupPendingPairings(),!bo.skipPairing)return await this.pair(bo.pairingTopic)}on(bo,yo){this.events.on(bo,yo)}once(bo,yo){this.events.once(bo,yo)}removeListener(bo,yo){this.events.removeListener(bo,yo)}off(bo,yo){this.events.off(bo,yo)}get isWalletConnect(){return!0}async pair(bo){this.shouldAbortPairingAttempt=!1;let yo=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(yo>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:Do,approval:Tu}=await this.client.connect({pairingTopic:bo,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});Do&&(this.uri=Do,this.events.emit("display_uri",Do)),await Tu().then(wu=>{this.session=wu,this.namespaces||(this.namespaces=Or(wu.namespaces),this.persist("namespaces",this.namespaces))}).catch(wu=>{if(wu.message!==Bt.PROPOSAL_EXPIRY_MESSAGE)throw wu;yo++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(bo,yo){try{if(!this.session)return;const[Do,Tu]=this.validateChain(bo);this.getProvider(Do).setDefaultChain(Tu,yo)}catch(Do){if(!/Please call connect/.test(Do.message))throw Do}}async cleanupPendingPairings(bo={}){this.logger.info("Cleaning up inactive pairings...");const yo=this.client.pairing.getAll();if(Wt.isValidArray(yo)){for(const Do of yo)bo.deletePairings?this.client.core.expirer.set(Do.topic,0):await this.client.core.relayer.subscriber.unsubscribe(Do.topic);this.logger.info(`Inactive pairings cleared: ${yo.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const bo=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[bo]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Qt.default.init({logger:this.providerOpts.logger||$r,relayUrl:this.providerOpts.relayUrl||Ar,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const bo=[...new Set(Object.keys(this.session.namespaces).map(yo=>Wt.parseNamespaceKey(yo)))];mn("client",this.client),mn("events",this.events),mn("disableProviderPing",this.disableProviderPing),bo.forEach(yo=>{if(!this.session)return;const Do=Ur(yo,this.session),Tu=Nr(Do),wu=Vr(this.namespaces,this.optionalNamespaces),$o=po(ho({},wu[yo]),{accounts:Do,chains:Tu});switch(yo){case"eip155":this.rpcProviders[yo]=new eo({namespace:$o});break;case"solana":this.rpcProviders[yo]=new _i({namespace:$o});break;case"cosmos":this.rpcProviders[yo]=new ro({namespace:$o});break;case"polkadot":this.rpcProviders[yo]=new gn({namespace:$o});break;case"cip34":this.rpcProviders[yo]=new io({namespace:$o});break;case"elrond":this.rpcProviders[yo]=new ao({namespace:$o});break;case"multiversx":this.rpcProviders[yo]=new oo({namespace:$o});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",bo=>{this.events.emit("session_ping",bo)}),this.client.on("session_event",bo=>{const{params:yo}=bo,{event:Do}=yo;if(Do.name==="accountsChanged"){const Tu=Do.data;Tu&&Wt.isValidArray(Tu)&&this.events.emit("accountsChanged",Tu.map(Xr))}else Do.name==="chainChanged"?this.onChainChanged(yo.chainId):this.events.emit(Do.name,Do.data);this.events.emit("session_event",bo)}),this.client.on("session_update",({topic:bo,params:yo})=>{var Do;const{namespaces:Tu}=yo,wu=(Do=this.client)==null?void 0:Do.session.get(bo);this.session=po(ho({},wu),{namespaces:Tu}),this.onSessionUpdate(),this.events.emit("session_update",{topic:bo,params:yo})}),this.client.on("session_delete",async bo=>{await this.cleanup(),this.events.emit("session_delete",bo),this.events.emit("disconnect",po(ho({},Wt.getSdkError("USER_DISCONNECTED")),{data:bo.topic}))}),this.on(Br.DEFAULT_CHAIN_CHANGED,bo=>{this.onChainChanged(bo,!0)})}getProvider(bo){if(!this.rpcProviders[bo])throw new Error(`Provider not found: ${bo}`);return this.rpcProviders[bo]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(bo=>{var yo;this.getProvider(bo).updateNamespace((yo=this.session)==null?void 0:yo.namespaces[bo])})}setNamespaces(bo){const{namespaces:yo,optionalNamespaces:Do,sessionProperties:Tu}=bo;yo&&Object.keys(yo).length&&(this.namespaces=yo),Do&&Object.keys(Do).length&&(this.optionalNamespaces=Do),this.sessionProperties=Tu,this.persist("namespaces",yo),this.persist("optionalNamespaces",Do)}validateChain(bo){const[yo,Do]=(bo==null?void 0:bo.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[yo,Do];if(yo&&!Object.keys(this.namespaces||{}).map($o=>Wt.parseNamespaceKey($o)).includes(yo))throw new Error(`Namespace '${yo}' is not configured. Please call connect() first with namespace config.`);if(yo&&Do)return[yo,Do];const Tu=Wt.parseNamespaceKey(Object.keys(this.namespaces)[0]),wu=this.rpcProviders[Tu].getDefaultChain();return[Tu,wu]}async requestAccounts(){const[bo]=this.validateChain();return await this.getProvider(bo).requestAccounts()}onChainChanged(bo,yo=!1){var Do;if(!this.namespaces)return;const[Tu,wu]=this.validateChain(bo);yo||this.getProvider(Tu).setDefaultChain(wu),((Do=this.namespaces[Tu])!=null?Do:this.namespaces[`${Tu}:${wu}`]).defaultChain=wu,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",wu)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(bo,yo){this.client.core.storage.setItem(`${Fr}/${bo}`,yo)}async getFromStore(bo){return await this.client.core.storage.getItem(`${Fr}/${bo}`)}}const Bo=Ao;return index_cjs.UniversalProvider=Bo,index_cjs.default=Ao,index_cjs}const t$1=Symbol(),s$2=Object.getPrototypeOf,c$3=new WeakMap,l$2=Bt=>Bt&&(c$3.has(Bt)?c$3.get(Bt):s$2(Bt)===Object.prototype||s$2(Bt)===Array.prototype),y$3=Bt=>l$2(Bt)&&Bt[t$1]||null,h$1=(Bt,Wt=!0)=>{c$3.set(Bt,Wt)},isObject$d=Bt=>typeof Bt=="object"&&Bt!==null,proxyStateMap=new WeakMap,refSet=new WeakSet,buildProxyFunction=(Bt=Object.is,Wt=(cr,$r)=>new Proxy(cr,$r),Gt=cr=>isObject$d(cr)&&!refSet.has(cr)&&(Array.isArray(cr)||!(Symbol.iterator in cr))&&!(cr instanceof WeakMap)&&!(cr instanceof WeakSet)&&!(cr instanceof Error)&&!(cr instanceof Number)&&!(cr instanceof Date)&&!(cr instanceof String)&&!(cr instanceof RegExp)&&!(cr instanceof ArrayBuffer),Yt=cr=>{switch(cr.status){case"fulfilled":return cr.value;case"rejected":throw cr.reason;default:throw cr}},Xt=new WeakMap,Jt=(cr,$r,Ar=Yt)=>{const Lr=Xt.get(cr);if((Lr==null?void 0:Lr[0])===$r)return Lr[1];const qr=Array.isArray(cr)?[]:Object.create(Object.getPrototypeOf(cr));return h$1(qr,!0),Xt.set(cr,[$r,qr]),Reflect.ownKeys(cr).forEach(Fr=>{if(Object.getOwnPropertyDescriptor(qr,Fr))return;const Hr=Reflect.get(cr,Fr),Br={value:Hr,enumerable:!0,configurable:!0};if(refSet.has(Hr))h$1(Hr,!1);else if(Hr instanceof Promise)delete Br.value,Br.get=()=>Ar(Hr);else if(proxyStateMap.has(Hr)){const[Wr,Gr]=proxyStateMap.get(Hr);Br.value=Jt(Wr,Gr(),Ar)}Object.defineProperty(qr,Fr,Br)}),qr},Zt=new WeakMap,Qt=[1,1],ur=cr=>{if(!isObject$d(cr))throw new Error("object required");const $r=Zt.get(cr);if($r)return $r;let Ar=Qt[0];const Lr=new Set,qr=(ga,dn=++Qt[0])=>{Ar!==dn&&(Ar=dn,Lr.forEach(Pr=>Pr(ga,dn)))};let Fr=Qt[1];const Hr=(ga=++Qt[1])=>(Fr!==ga&&!Lr.size&&(Fr=ga,Wr.forEach(([dn])=>{const Pr=dn[1](ga);Pr>Ar&&(Ar=Pr)})),Ar),Br=ga=>(dn,Pr)=>{const xr=[...dn];xr[1]=[ga,...xr[1]],qr(xr,Pr)},Wr=new Map,Gr=(ga,dn)=>{if(Lr.size){const Pr=dn[3](Br(ga));Wr.set(ga,[dn,Pr])}else Wr.set(ga,[dn])},Kr=ga=>{var dn;const Pr=Wr.get(ga);Pr&&(Wr.delete(ga),(dn=Pr[1])==null||dn.call(Pr))},Yr=ga=>(Lr.add(ga),Lr.size===1&&Wr.forEach(([Pr,xr],Mr)=>{const Nr=Pr[3](Br(Mr));Wr.set(Mr,[Pr,Nr])}),()=>{Lr.delete(ga),Lr.size===0&&Wr.forEach(([Pr,xr],Mr)=>{xr&&(xr(),Wr.set(Mr,[Pr]))})}),hn=Array.isArray(cr)?[]:Object.create(Object.getPrototypeOf(cr)),pn=Wt(hn,{deleteProperty(ga,dn){const Pr=Reflect.get(ga,dn);Kr(dn);const xr=Reflect.deleteProperty(ga,dn);return xr&&qr(["delete",[dn],Pr]),xr},set(ga,dn,Pr,xr){const Mr=Reflect.has(ga,dn),Nr=Reflect.get(ga,dn,xr);if(Mr&&(Bt(Nr,Pr)||Zt.has(Pr)&&Bt(Nr,Zt.get(Pr))))return!0;Kr(dn),isObject$d(Pr)&&(Pr=y$3(Pr)||Pr);let Ur=Pr;if(Pr instanceof Promise)Pr.then(Vr=>{Pr.status="fulfilled",Pr.value=Vr,qr(["resolve",[dn],Vr])}).catch(Vr=>{Pr.status="rejected",Pr.reason=Vr,qr(["reject",[dn],Vr])});else{!proxyStateMap.has(Pr)&&Gt(Pr)&&(Ur=ur(Pr));const Vr=!refSet.has(Ur)&&proxyStateMap.get(Ur);Vr&&Gr(dn,Vr)}return Reflect.set(ga,dn,Ur,xr),qr(["set",[dn],Pr,Nr]),!0}});Zt.set(cr,pn);const En=[hn,Hr,Jt,Yr];return proxyStateMap.set(pn,En),Reflect.ownKeys(cr).forEach(ga=>{const dn=Object.getOwnPropertyDescriptor(cr,ga);"value"in dn&&(pn[ga]=cr[ga],delete dn.value,delete dn.writable),Object.defineProperty(hn,ga,dn)}),pn})=>[ur,proxyStateMap,refSet,Bt,Wt,Gt,Yt,Xt,Jt,Zt,Qt],[defaultProxyFunction]=buildProxyFunction();function proxy(Bt={}){return defaultProxyFunction(Bt)}function subscribe(Bt,Wt,Gt){const Yt=proxyStateMap.get(Bt);let Xt;const Jt=[],Zt=Yt[3];let Qt=!1;const cr=Zt($r=>{if(Jt.push($r),Gt){Wt(Jt.splice(0));return}Xt||(Xt=Promise.resolve().then(()=>{Xt=void 0,Qt&&Wt(Jt.splice(0))}))});return Qt=!0,()=>{Qt=!1,cr()}}function snapshot(Bt,Wt){const Gt=proxyStateMap.get(Bt),[Yt,Xt,Jt]=Gt;return Jt(Yt,Xt(),Wt)}var bufferExports=requireBuffer();const n$1=proxy({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),N$2={state:n$1,subscribe(Bt){return subscribe(n$1,()=>Bt(n$1))},push(Bt,Wt){Bt!==n$1.view&&(n$1.view=Bt,Wt&&(n$1.data=Wt),n$1.history.push(Bt))},reset(Bt){n$1.view=Bt,n$1.history=[Bt]},replace(Bt){n$1.history.length>1&&(n$1.history[n$1.history.length-1]=Bt,n$1.view=Bt)},goBack(){if(n$1.history.length>1){n$1.history.pop();const[Bt]=n$1.history.slice(-1);n$1.view=Bt}},setData(Bt){n$1.data=Bt}},i$2={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return i$2.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const Bt=navigator.userAgent.toLowerCase();return i$2.isMobile()&&(Bt.includes("iphone")||Bt.includes("ipad"))},isHttpUrl(Bt){return Bt.startsWith("http://")||Bt.startsWith("https://")},isArray(Bt){return Array.isArray(Bt)&&Bt.length>0},formatNativeUrl(Bt,Wt,Gt){if(i$2.isHttpUrl(Bt))return this.formatUniversalUrl(Bt,Wt,Gt);let Yt=Bt;Yt.includes("://")||(Yt=Bt.replaceAll("/","").replaceAll(":",""),Yt=`${Yt}://`),Yt.endsWith("/")||(Yt=`${Yt}/`),this.setWalletConnectDeepLink(Yt,Gt);const Xt=encodeURIComponent(Wt);return`${Yt}wc?uri=${Xt}`},formatUniversalUrl(Bt,Wt,Gt){if(!i$2.isHttpUrl(Bt))return this.formatNativeUrl(Bt,Wt,Gt);let Yt=Bt;Yt.endsWith("/")||(Yt=`${Yt}/`),this.setWalletConnectDeepLink(Yt,Gt);const Xt=encodeURIComponent(Wt);return`${Yt}wc?uri=${Xt}`},async wait(Bt){return new Promise(Wt=>{setTimeout(Wt,Bt)})},openHref(Bt,Wt){window.open(Bt,Wt,"noreferrer noopener")},setWalletConnectDeepLink(Bt,Wt){try{localStorage.setItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:Bt,name:Wt}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(Bt){try{const[Wt]=Bt.split("?");localStorage.setItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:Wt,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(i$2.WCM_VERSION,"2.5.9")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var Bt;const Wt=(Bt=N$2.state.data)==null?void 0:Bt.Wallet;if(!Wt)throw new Error('Missing "Wallet" view data');return Wt}},T=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r$3=proxy({enabled:T,userSessionId:"",events:[],connectedWalletId:void 0}),$={state:r$3,subscribe(Bt){return subscribe(r$3.events,()=>Bt(snapshot(r$3.events[r$3.events.length-1])))},initialize(){r$3.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r$3.userSessionId=crypto.randomUUID())},setConnectedWalletId(Bt){r$3.connectedWalletId=Bt},click(Bt){if(r$3.enabled){const Wt={type:"CLICK",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}},track(Bt){if(r$3.enabled){const Wt={type:"TRACK",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}},view(Bt){if(r$3.enabled){const Wt={type:"VIEW",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}}},l$1=proxy({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),c$2={state:l$1,subscribe(Bt){return subscribe(l$1,()=>Bt(l$1))},setChains(Bt){l$1.chains=Bt},setWalletConnectUri(Bt){l$1.walletConnectUri=Bt},setIsCustomDesktop(Bt){l$1.isCustomDesktop=Bt},setIsCustomMobile(Bt){l$1.isCustomMobile=Bt},setIsDataLoaded(Bt){l$1.isDataLoaded=Bt},setIsUiLoaded(Bt){l$1.isUiLoaded=Bt},setIsAuth(Bt){l$1.isAuth=Bt}},y$2=proxy({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),C={state:y$2,subscribe(Bt){return subscribe(y$2,()=>Bt(y$2))},setConfig(Bt){var Wt,Gt;$.initialize(),c$2.setChains(Bt.chains),c$2.setIsAuth(!!Bt.enableAuthMode),c$2.setIsCustomMobile(!!((Wt=Bt.mobileWallets)!=null&&Wt.length)),c$2.setIsCustomDesktop(!!((Gt=Bt.desktopWallets)!=null&&Gt.length)),i$2.setModalVersionInStorage(),Object.assign(y$2,Bt)}},L$1="https://explorer-api.walletconnect.com";async function W$1(Bt,Wt){const Gt=new URL(Bt,L$1);return Gt.searchParams.append("projectId",C.state.projectId),Object.entries(Wt).forEach(([Yt,Xt])=>{Xt&&Gt.searchParams.append(Yt,String(Xt))}),(await fetch(Gt)).json()}const m$1={async getDesktopListings(Bt){return W$1("/w3m/v1/getDesktopListings",Bt)},async getMobileListings(Bt){return W$1("/w3m/v1/getMobileListings",Bt)},async getInjectedListings(Bt){return W$1("/w3m/v1/getInjectedListings",Bt)},async getAllListings(Bt){return W$1("/w3m/v1/getAllListings",Bt)},getWalletImageUrl(Bt){return`${L$1}/w3m/v1/getWalletImage/${Bt}?projectId=${C.state.projectId}`},getAssetImageUrl(Bt){return`${L$1}/w3m/v1/getAssetImage/${Bt}?projectId=${C.state.projectId}`}};var P$2=Object.defineProperty,O$1=Object.getOwnPropertySymbols,_$1=Object.prototype.hasOwnProperty,R$1=Object.prototype.propertyIsEnumerable,U$1=(Bt,Wt,Gt)=>Wt in Bt?P$2(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt,B$1=(Bt,Wt)=>{for(var Gt in Wt||(Wt={}))_$1.call(Wt,Gt)&&U$1(Bt,Gt,Wt[Gt]);if(O$1)for(var Gt of O$1(Wt))R$1.call(Wt,Gt)&&U$1(Bt,Gt,Wt[Gt]);return Bt};const M$1=i$2.isMobile(),d$2=proxy({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),G$1={state:d$2,async getRecomendedWallets(){const{explorerRecommendedWalletIds:Bt,explorerExcludedWalletIds:Wt}=C.state;if(Bt==="NONE"||Wt==="ALL"&&!Bt)return d$2.recomendedWallets;if(i$2.isArray(Bt)){const Gt={recommendedIds:Bt.join(",")},{listings:Yt}=await m$1.getAllListings(Gt),Xt=Object.values(Yt);Xt.sort((Jt,Zt)=>{const Qt=Bt.indexOf(Jt.id),ur=Bt.indexOf(Zt.id);return Qt-ur}),d$2.recomendedWallets=Xt}else{const{chains:Gt,isAuth:Yt}=c$2.state,Xt=Gt==null?void 0:Gt.join(","),Jt=i$2.isArray(Wt),Zt={page:1,sdks:Yt?"auth_v1":void 0,entries:i$2.RECOMMENDED_WALLET_AMOUNT,chains:Xt,version:2,excludedIds:Jt?Wt.join(","):void 0},{listings:Qt}=M$1?await m$1.getMobileListings(Zt):await m$1.getDesktopListings(Zt);d$2.recomendedWallets=Object.values(Qt)}return d$2.recomendedWallets},async getWallets(Bt){const Wt=B$1({},Bt),{explorerRecommendedWalletIds:Gt,explorerExcludedWalletIds:Yt}=C.state,{recomendedWallets:Xt}=d$2;if(Yt==="ALL")return d$2.wallets;Xt.length?Wt.excludedIds=Xt.map(Ar=>Ar.id).join(","):i$2.isArray(Gt)&&(Wt.excludedIds=Gt.join(",")),i$2.isArray(Yt)&&(Wt.excludedIds=[Wt.excludedIds,Yt].filter(Boolean).join(",")),c$2.state.isAuth&&(Wt.sdks="auth_v1");const{page:Jt,search:Zt}=Bt,{listings:Qt,total:ur}=M$1?await m$1.getMobileListings(Wt):await m$1.getDesktopListings(Wt),cr=Object.values(Qt),$r=Zt?"search":"wallets";return d$2[$r]={listings:[...d$2[$r].listings,...cr],total:ur,page:Jt??1},{listings:cr,total:ur}},getWalletImageUrl(Bt){return m$1.getWalletImageUrl(Bt)},getAssetImageUrl(Bt){return m$1.getAssetImageUrl(Bt)},resetSearch(){d$2.search={listings:[],total:0,page:1}}},I$1=proxy({open:!1}),Q$1={state:I$1,subscribe(Bt){return subscribe(I$1,()=>Bt(I$1))},async open(Bt){return new Promise(Wt=>{const{isUiLoaded:Gt,isDataLoaded:Yt}=c$2.state;if(c$2.setWalletConnectUri(Bt==null?void 0:Bt.uri),c$2.setChains(Bt==null?void 0:Bt.chains),N$2.reset("ConnectWallet"),Gt&&Yt)I$1.open=!0,Wt();else{const Xt=setInterval(()=>{const Jt=c$2.state;Jt.isUiLoaded&&Jt.isDataLoaded&&(clearInterval(Xt),I$1.open=!0,Wt())},200)}})},close(){I$1.open=!1}};var H$1=Object.defineProperty,D$1=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,j$1=(Bt,Wt,Gt)=>Wt in Bt?H$1(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt,z$2=(Bt,Wt)=>{for(var Gt in Wt||(Wt={}))V.call(Wt,Gt)&&j$1(Bt,Gt,Wt[Gt]);if(D$1)for(var Gt of D$1(Wt))K.call(Wt,Gt)&&j$1(Bt,Gt,Wt[Gt]);return Bt};function J(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const b$1=proxy({themeMode:J()?"dark":"light"}),X$1={state:b$1,subscribe(Bt){return subscribe(b$1,()=>Bt(b$1))},setThemeConfig(Bt){const{themeMode:Wt,themeVariables:Gt}=Bt;Wt&&(b$1.themeMode=Wt),Gt&&(b$1.themeVariables=z$2({},Gt))}},g$1=proxy({open:!1,message:"",variant:"success"}),Y={state:g$1,subscribe(Bt){return subscribe(g$1,()=>Bt(g$1))},openToast(Bt,Wt){g$1.open=!0,g$1.message=Bt,g$1.variant=Wt},closeToast(){g$1.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=bufferExports.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window));let d$1=class{constructor(Wt){this.openModal=Q$1.open,this.closeModal=Q$1.close,this.subscribeModal=Q$1.subscribe,this.setTheme=X$1.setThemeConfig,X$1.setThemeConfig(Wt),C.setConfig(Wt),this.initUi()}async initUi(){if(typeof window<"u"){await __vitePreload(()=>import("./index-5d82af5e.js"),[]);const Wt=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",Wt),c$2.setIsUiLoaded(!0)}}};const dist$f=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:d$1},Symbol.toStringTag,{value:"Module"})),require$$3$1=getAugmentedNamespace(dist$f);var hasRequiredIndex_cjs;function requireIndex_cjs(){if(hasRequiredIndex_cjs)return index_cjs$1;hasRequiredIndex_cjs=1,Object.defineProperty(index_cjs$1,"__esModule",{value:!0});var Bt=eventsExports,Wt=require$$1$7,Gt=requireIndex_cjs$1();function Yt(dn){if(dn&&dn.__esModule)return dn;var Pr=Object.create(null);return dn&&Object.keys(dn).forEach(function(xr){if(xr!=="default"){var Mr=Object.getOwnPropertyDescriptor(dn,xr);Object.defineProperty(Pr,xr,Mr.get?Mr:{enumerable:!0,get:function(){return dn[xr]}})}}),Pr.default=dn,Object.freeze(Pr)}const Xt="wc",Jt="ethereum_provider",Zt=`${Xt}@2:${Jt}:`,Qt="https://rpc.walletconnect.com/v1/",ur=["eth_sendTransaction","personal_sign"],cr=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],$r=["chainChanged","accountsChanged"],Ar=["message","disconnect","connect"];var Lr=Object.defineProperty,qr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,Br=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Gr=(dn,Pr,xr)=>Pr in dn?Lr(dn,Pr,{enumerable:!0,configurable:!0,writable:!0,value:xr}):dn[Pr]=xr,Kr=(dn,Pr)=>{for(var xr in Pr||(Pr={}))Br.call(Pr,xr)&&Gr(dn,xr,Pr[xr]);if(Hr)for(var xr of Hr(Pr))Wr.call(Pr,xr)&&Gr(dn,xr,Pr[xr]);return dn},Yr=(dn,Pr)=>qr(dn,Fr(Pr));function hn(dn){return Number(dn[0].split(":")[1])}function Qr(dn){return`0x${dn.toString(16)}`}function pn(dn){const{chains:Pr,optionalChains:xr,methods:Mr,optionalMethods:Nr,events:Ur,optionalEvents:Vr,rpcMap:Zr}=dn;if(!Wt.isValidArray(Pr))throw new Error("Invalid chains");const Xr={chains:Pr,methods:Mr||ur,events:Ur||$r,rpcMap:Kr({},Pr.length?{[hn(Pr)]:Zr[hn(Pr)]}:{})},Or=Ur==null?void 0:Ur.filter(gn=>!$r.includes(gn)),jr=Mr==null?void 0:Mr.filter(gn=>!ur.includes(gn));if(!xr&&!Vr&&!Nr&&!(Or!=null&&Or.length)&&!(jr!=null&&jr.length))return{required:Pr.length?Xr:void 0};const Jr=(Or==null?void 0:Or.length)&&(jr==null?void 0:jr.length)||!xr,mn={chains:[...new Set(Jr?Xr.chains.concat(xr||[]):xr)],methods:[...new Set(Xr.methods.concat(Nr!=null&&Nr.length?Nr:cr))],events:[...new Set(Xr.events.concat(Vr||Ar))],rpcMap:Zr};return{required:Pr.length?Xr:void 0,optional:xr.length?mn:void 0}}class En{constructor(){this.events=new Bt.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Zt,this.on=(Pr,xr)=>(this.events.on(Pr,xr),this),this.once=(Pr,xr)=>(this.events.once(Pr,xr),this),this.removeListener=(Pr,xr)=>(this.events.removeListener(Pr,xr),this),this.off=(Pr,xr)=>(this.events.off(Pr,xr),this),this.parseAccount=Pr=>this.isCompatibleChainId(Pr)?this.parseAccountId(Pr).address:Pr,this.signer={},this.rpc={}}static async init(Pr){const xr=new En;return await xr.initialize(Pr),xr}async request(Pr){return await this.signer.request(Pr,this.formatChainId(this.chainId))}sendAsync(Pr,xr){this.signer.sendAsync(Pr,xr,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(Pr){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(Pr);const{required:xr,optional:Mr}=pn(this.rpc);try{const Nr=await new Promise(async(Vr,Zr)=>{var Xr;this.rpc.showQrModal&&((Xr=this.modal)==null||Xr.subscribeModal(Or=>{!Or.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),Zr(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Yr(Kr({namespaces:Kr({},xr&&{[this.namespace]:xr})},Mr&&{optionalNamespaces:{[this.namespace]:Mr}}),{pairingTopic:Pr==null?void 0:Pr.pairingTopic})).then(Or=>{Vr(Or)}).catch(Or=>{Zr(new Error(Or.message))})});if(!Nr)return;this.setChainIds(this.rpc.chains);const Ur=Wt.getAccountsFromNamespaces(Nr.namespaces,[this.namespace]);this.setAccounts(Ur),this.events.emit("connect",{chainId:Qr(this.chainId)})}catch(Nr){throw this.signer.logger.error(Nr),Nr}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",Pr=>{const{params:xr}=Pr,{event:Mr}=xr;Mr.name==="accountsChanged"?(this.accounts=this.parseAccounts(Mr.data),this.events.emit("accountsChanged",this.accounts)):Mr.name==="chainChanged"?this.setChainId(this.formatChainId(Mr.data)):this.events.emit(Mr.name,Mr.data),this.events.emit("session_event",Pr)}),this.signer.on("chainChanged",Pr=>{const xr=parseInt(Pr);this.chainId=xr,this.events.emit("chainChanged",Qr(this.chainId)),this.persist()}),this.signer.on("session_update",Pr=>{this.events.emit("session_update",Pr)}),this.signer.on("session_delete",Pr=>{this.reset(),this.events.emit("session_delete",Pr),this.events.emit("disconnect",Yr(Kr({},Wt.getSdkError("USER_DISCONNECTED")),{data:Pr.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",Pr=>{var xr,Mr;this.rpc.showQrModal&&((xr=this.modal)==null||xr.closeModal(),(Mr=this.modal)==null||Mr.openModal({uri:Pr})),this.events.emit("display_uri",Pr)})}switchEthereumChain(Pr){this.request({method:"wallet_switchEthereumChain",params:[{chainId:Pr.toString(16)}]})}isCompatibleChainId(Pr){return typeof Pr=="string"?Pr.startsWith(`${this.namespace}:`):!1}formatChainId(Pr){return`${this.namespace}:${Pr}`}parseChainId(Pr){return Number(Pr.split(":")[1])}setChainIds(Pr){const xr=Pr.filter(Mr=>this.isCompatibleChainId(Mr)).map(Mr=>this.parseChainId(Mr));xr.length&&(this.chainId=xr[0],this.events.emit("chainChanged",Qr(this.chainId)),this.persist())}setChainId(Pr){if(this.isCompatibleChainId(Pr)){const xr=this.parseChainId(Pr);this.chainId=xr,this.switchEthereumChain(xr)}}parseAccountId(Pr){const[xr,Mr,Nr]=Pr.split(":");return{chainId:`${xr}:${Mr}`,address:Nr}}setAccounts(Pr){this.accounts=Pr.filter(xr=>this.parseChainId(this.parseAccountId(xr).chainId)===this.chainId).map(xr=>this.parseAccountId(xr).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(Pr){var xr,Mr;const Nr=(xr=Pr==null?void 0:Pr.chains)!=null?xr:[],Ur=(Mr=Pr==null?void 0:Pr.optionalChains)!=null?Mr:[],Vr=Nr.concat(Ur);if(!Vr.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const Zr=Nr.length?(Pr==null?void 0:Pr.methods)||ur:[],Xr=Nr.length?(Pr==null?void 0:Pr.events)||$r:[],Or=(Pr==null?void 0:Pr.optionalMethods)||[],jr=(Pr==null?void 0:Pr.optionalEvents)||[],Jr=(Pr==null?void 0:Pr.rpcMap)||this.buildRpcMap(Vr,Pr.projectId),mn=(Pr==null?void 0:Pr.qrModalOptions)||void 0;return{chains:Nr==null?void 0:Nr.map(gn=>this.formatChainId(gn)),optionalChains:Ur.map(gn=>this.formatChainId(gn)),methods:Zr,events:Xr,optionalMethods:Or,optionalEvents:jr,rpcMap:Jr,showQrModal:!!(Pr!=null&&Pr.showQrModal),qrModalOptions:mn,projectId:Pr.projectId,metadata:Pr.metadata}}buildRpcMap(Pr,xr){const Mr={};return Pr.forEach(Nr=>{Mr[Nr]=this.getRpcUrl(Nr,xr)}),Mr}async initialize(Pr){if(this.rpc=this.getRpcConfig(Pr),this.chainId=this.rpc.chains.length?hn(this.rpc.chains):hn(this.rpc.optionalChains),this.signer=await Gt.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:Pr.disableProviderPing,relayUrl:Pr.relayUrl,storageOptions:Pr.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let xr;try{const{WalletConnectModal:Mr}=await Promise.resolve().then(function(){return Yt(require$$3$1)});xr=Mr}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(xr)try{this.modal=new xr(Kr({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(Mr){throw this.signer.logger.error(Mr),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(Pr){if(!Pr)return;const{chains:xr,optionalChains:Mr,rpcMap:Nr}=Pr;xr&&Wt.isValidArray(xr)&&(this.rpc.chains=xr.map(Ur=>this.formatChainId(Ur)),xr.forEach(Ur=>{this.rpc.rpcMap[Ur]=(Nr==null?void 0:Nr[Ur])||this.getRpcUrl(Ur)})),Mr&&Wt.isValidArray(Mr)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=Mr==null?void 0:Mr.map(Ur=>this.formatChainId(Ur)),Mr.forEach(Ur=>{this.rpc.rpcMap[Ur]=(Nr==null?void 0:Nr[Ur])||this.getRpcUrl(Ur)}))}getRpcUrl(Pr,xr){var Mr;return((Mr=this.rpc.rpcMap)==null?void 0:Mr[Pr])||`${Qt}?chainId=eip155:${Pr}&projectId=${xr||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const Pr=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),xr=this.session.namespaces[`${this.namespace}:${Pr}`]?this.session.namespaces[`${this.namespace}:${Pr}`]:this.session.namespaces[this.namespace];this.setChainIds(Pr?[this.formatChainId(Pr)]:xr==null?void 0:xr.accounts),this.setAccounts(xr==null?void 0:xr.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(Pr){return typeof Pr=="string"||Pr instanceof String?[this.parseAccount(Pr)]:Pr.map(xr=>this.parseAccount(xr))}}const ga=En;return index_cjs$1.EthereumProvider=ga,index_cjs$1.OPTIONAL_EVENTS=Ar,index_cjs$1.OPTIONAL_METHODS=cr,index_cjs$1.REQUIRED_EVENTS=$r,index_cjs$1.REQUIRED_METHODS=ur,index_cjs$1.default=En,index_cjs$1}var __createBinding$Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Object.defineProperty(Bt,Yt,{enumerable:!0,get:function(){return Wt[Gt]}})}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$Z=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$Z=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$Z(Wt,Bt,Gt);return __setModuleDefault$Z(Wt,Bt),Wt},__awaiter$D=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(WalletConnectV2Connector$1,"__esModule",{value:!0});WalletConnectV2Connector$1.WalletConnectV2Connector=void 0;const AbstractConnector_1=AbstractConnector$1,schemas_1$3=dist$m,configuration_1$1=configuration$1;class WalletConnectV2Connector extends AbstractConnector_1.AbstractConnector{constructor(Wt){super({supportedChainIds:(()=>{const{chains:Gt,optionalChains:Yt}=WalletConnectV2Connector.configuration.chains[Wt];return[...Gt,...Yt]})()}),this.desiredChainId=Wt,this.activate=()=>__awaiter$D(this,void 0,void 0,function*(){const Gt=yield Promise.resolve().then(()=>__importStar$Z(requireIndex_cjs())).then(Xt=>{const{chains:Jt,optionalChains:Zt}=WalletConnectV2Connector.configuration.chains[this.desiredChainId];return Xt.default.init({projectId:WalletConnectV2Connector.configuration.projectId,rpcMap:WalletConnectV2Connector.configuration.urls,chains:Jt,optionalChains:Zt,showQrModal:!0,disableProviderPing:!0,qrModalOptions:{themeVariables:{"--wcm-z-index":"3000"}},methods:["eth_sendTransaction","personal_sign"],optionalMethods:["eth_accounts","eth_requestAccounts","eth_sign","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain"],events:["chainChanged","accountsChanged"],optionalEvents:["disconnect"]})}),Yt=yield Gt.enable();return Gt.on("accountsChanged",this.handleAccountsChanged),Gt.on("chainChanged",this.handleChainChanged),Gt.on("disconnect",this.handleDisconnect),this.provider=Gt,{chainId:Gt.chainId,account:Yt[0],provider:Gt}}),this.getProvider=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider}),this.getChainId=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider.chainId}),this.getAccount=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider.accounts[0]}),this.getWalletName=()=>{var Gt,Yt;return(Yt=(Gt=this.provider)===null||Gt===void 0?void 0:Gt.session)===null||Yt===void 0?void 0:Yt.peer.metadata.name},this.deactivate=()=>{this.provider&&(this.emitDeactivate(),this.provider.removeListener("accountsChanged",this.handleAccountsChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("disconnect",this.handleDisconnect).disconnect())},this.handleAccountsChanged=Gt=>{this.emitUpdate({account:Gt[0]})},this.handleChainChanged=Gt=>{this.emitUpdate({chainId:Gt})},this.handleDisconnect=()=>{if(!this.provider)throw new Error("Provider is undefined");this.deactivate()}}}WalletConnectV2Connector$1.WalletConnectV2Connector=WalletConnectV2Connector;WalletConnectV2Connector.configuration=configuration_1$1.getConfiguration()[schemas_1$3.ProviderType.WALLET_CONNECT_V2];WalletConnectV2Connector.clearStorage=Bt=>{Bt.removeRegExp(new RegExp("^wc@2:"))};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(AbstractConnector$1,Bt),Gt(FortmaticConnector$1,Bt),Gt(InjectedConnector$2,Bt),Gt(NetworkConnector$2,Bt),Gt(WalletConnectConnector$1,Bt),Gt(WalletLinkConnector$2,Bt),Gt(WalletConnectV2Connector$1,Bt)})(connectors);var storage$1={},Storage$1={};Object.defineProperty(Storage$1,"__esModule",{value:!0});Storage$1.Storage=void 0;class Storage{}Storage$1.Storage=Storage;var LocalStorage$1={};Object.defineProperty(LocalStorage$1,"__esModule",{value:!0});LocalStorage$1.LocalStorage=void 0;const Storage_1=Storage$1;class LocalStorage extends Storage_1.Storage{get(Wt){const Gt=window.localStorage.getItem(Wt);return Gt===null?void 0:Gt}set(Wt,Gt){window.localStorage.setItem(Wt,Gt)}remove(Wt){window.localStorage.removeItem(Wt)}removeRegExp(Wt){for(let Gt=localStorage.length-1;Gt>=0;Gt--){const Yt=localStorage.key(Gt);Yt&&Wt.test(Yt)&&localStorage.removeItem(Yt)}}}LocalStorage$1.LocalStorage=LocalStorage;(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(Storage$1,Bt),Gt(LocalStorage$1,Bt)})(storage$1);var ProviderAdapter$1={},__awaiter$C=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(ProviderAdapter$1,"__esModule",{value:!0});ProviderAdapter$1.ProviderAdapter=void 0;class ProviderAdapter{constructor(Wt){this.provider=Wt,this.id=0,this.on=(Gt,Yt)=>this.provider.on(Gt,Yt),this.emit=(Gt,...Yt)=>this.provider.emit(Gt,Yt),this.removeListener=(Gt,Yt)=>this.provider.removeListener(Gt,Yt),this.request=({method:Gt,params:Yt})=>__awaiter$C(this,void 0,void 0,function*(){return this.isModernProvider()?this.provider.request({method:Gt,params:Yt}):this.send(Gt,Yt)}),this.sendAsync=(Gt,Yt)=>__awaiter$C(this,void 0,void 0,function*(){return this.hasSendAsync()?this.provider.sendAsync(Gt,(Xt,Jt)=>{Jt&&!Jt.hasOwnProperty("result")?Yt(Xt,{id:0,jsonrpc:"2.0",result:Jt}):Yt(Xt,Jt)}):this.send(Gt,Yt)})}static adapt(Wt){const Gt=new ProviderAdapter(Wt);return Object.assign(Object.assign({},Wt),{on:Gt.on,emit:Gt.emit,removeListener:Gt.removeListener,request:Gt.request,sendAsync:Gt.sendAsync,send:Gt.send.bind(Gt)})}send(Wt,Gt){return __awaiter$C(this,void 0,void 0,function*(){let Yt,Xt,Jt;const Zt=typeof Gt=="function";if(Zt){const Qt=Wt;Xt=Qt.params||[],Yt=Qt.method,Jt=Gt}else Yt=Wt,Xt=Gt||[],Jt=(Qt,ur)=>{if(Qt)throw Qt;return ur};if(this.isModernProvider()){const[Qt,ur]=yield this.provider.request({method:Yt,params:Xt}).then($r=>[null,$r]).catch($r=>[$r,void 0]);return Jt(Qt,Zt?{id:"",jsonrpc:"2.0",result:ur}:ur)}else{this.patchOldMobile();const[Qt,ur]=Zt?yield new Promise(cr=>this.provider.send(Wt,($r,Ar)=>{cr([$r,Ar])})):yield new Promise(cr=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:Yt,params:Xt},($r,Ar)=>{cr([Ar&&Ar.hasOwnProperty("error")?Ar.error:$r,Ar&&Ar.hasOwnProperty("result")?Ar.result:Ar])}));return Jt(Qt,ur)}})}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}ProviderAdapter$1.ProviderAdapter=ProviderAdapter;var __awaiter$B=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(ConnectionManager$1,"__esModule",{value:!0});ConnectionManager$1.connection=ConnectionManager$1.ConnectionManager=void 0;const chain_id_1$5=requireChainId$4(),provider_type_1$2=providerType$4,connectors_1=connectors,storage_1=storage$1,configuration_1=configuration$1,ProviderAdapter_1=ProviderAdapter$1,DEACTIVATE_EVENT_NAME="Web3ReactDeactivate";class ConnectionManager{constructor(Wt){this.storage=Wt,this.getWalletName=()=>{if(this.connector instanceof connectors_1.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:Gt}=configuration_1.getConfiguration();this.storage.remove(Gt),connectors_1.WalletConnectConnector.clearStorage(this.storage),connectors_1.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&this.connector.removeListener(DEACTIVATE_EVENT_NAME,this.handleWeb3ReactDeactivate),this.disconnect().catch(console.error)}}connect(Wt,Gt=chain_id_1$5.ChainId.ETHEREUM_MAINNET){return __awaiter$B(this,void 0,void 0,function*(){this.connector=this.buildConnector(Wt,Gt),this.connector.on(DEACTIVATE_EVENT_NAME,this.handleWeb3ReactDeactivate);const{provider:Yt,account:Xt}=yield this.connector.activate();return this.setConnectionData(Wt,Gt),{provider:ProviderAdapter_1.ProviderAdapter.adapt(Yt),providerType:Wt,account:Xt||"",chainId:Gt}})}tryPreviousConnection(){return __awaiter$B(this,void 0,void 0,function*(){const Wt=this.getConnectionData();if(!Wt)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const Gt=yield this.connect(Wt.providerType,Wt.chainId);if(Gt.providerType===provider_type_1$2.ProviderType.INJECTED){const Yt=yield Gt.provider.request({method:"eth_chainId"}),Xt=Yt?parseInt(Yt,16):null;Xt&&Wt.chainId!==Xt&&this.setConnectionData(Wt.providerType,Xt)}return Object.assign(Object.assign({},Gt),{chainId:this.getConnectionData().chainId})})}getAvailableProviders(){const Wt=[provider_type_1$2.ProviderType.FORTMATIC,provider_type_1$2.ProviderType.WALLET_CONNECT,provider_type_1$2.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?Wt.unshift(provider_type_1$2.ProviderType.INJECTED):Wt.unshift(provider_type_1$2.ProviderType.METAMASK_MOBILE),Wt}disconnect(){return __awaiter$B(this,void 0,void 0,function*(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&(yield this.connector.close())),this.clearConnectionData(),this.connector=void 0})}getProvider(){return __awaiter$B(this,void 0,void 0,function*(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()})}createProvider(Wt,Gt=chain_id_1$5.ChainId.ETHEREUM_MAINNET){return __awaiter$B(this,void 0,void 0,function*(){const Xt=yield this.buildConnector(Wt,Gt).getProvider();return ProviderAdapter_1.ProviderAdapter.adapt(Xt)})}buildConnector(Wt,Gt){switch(Wt){case provider_type_1$2.ProviderType.INJECTED:return new connectors_1.InjectedConnector(Gt);case provider_type_1$2.ProviderType.FORTMATIC:return new connectors_1.FortmaticConnector(Gt);case provider_type_1$2.ProviderType.WALLET_CONNECT:return new connectors_1.WalletConnectConnector(Gt);case provider_type_1$2.ProviderType.WALLET_LINK:return new connectors_1.WalletLinkConnector(Gt);case provider_type_1$2.ProviderType.NETWORK:return new connectors_1.NetworkConnector(Gt);case provider_type_1$2.ProviderType.WALLET_CONNECT_V2:return new connectors_1.WalletConnectV2Connector(Gt);default:throw new Error(`Invalid provider ${Wt}`)}}getConnectionData(){const{storageKey:Wt}=configuration_1.getConfiguration(),Gt=this.storage.get(Wt);return Gt?JSON.parse(Gt):void 0}setConnectionData(Wt,Gt){const{storageKey:Yt}=configuration_1.getConfiguration(),Xt=JSON.stringify({providerType:Wt,chainId:Gt});this.storage.set(Yt,Xt)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}ConnectionManager$1.ConnectionManager=ConnectionManager;ConnectionManager$1.connection=new ConnectionManager(new storage_1.LocalStorage);var types$6={};Object.defineProperty(types$6,"__esModule",{value:!0});(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(ConnectionManager$1,Bt),Gt(connectors,Bt),Gt(types$6,Bt)})(dist$n);var chainId$3={},chainName$3={},hasRequiredChainName$3;function requireChainName$3(){return hasRequiredChainName$3||(hasRequiredChainName$3=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getChainId=Bt.ChainName=void 0;const Wt=validation$6,Gt=requireChainId$3();var Yt;(function(Jt){Jt.ETHEREUM_MAINNET="Ethereum Mainnet",Jt.ETHEREUM_ROPSTEN="Ropsten",Jt.ETHEREUM_RINKEBY="Rinkeby",Jt.ETHEREUM_GOERLI="Goerli",Jt.ETHEREUM_KOVAN="Kovan",Jt.ETHEREUM_SEPOLIA="Sepolia",Jt.MATIC_MAINNET="Polygon",Jt.MATIC_MUMBAI="Mumbai"})(Yt=Bt.ChainName||(Bt.ChainName={}));function Xt(Jt){switch(Jt){case Yt.ETHEREUM_MAINNET:return Gt.ChainId.ETHEREUM_MAINNET;case Yt.ETHEREUM_ROPSTEN:return Gt.ChainId.ETHEREUM_ROPSTEN;case Yt.ETHEREUM_RINKEBY:return Gt.ChainId.ETHEREUM_RINKEBY;case Yt.ETHEREUM_GOERLI:return Gt.ChainId.ETHEREUM_GOERLI;case Yt.ETHEREUM_KOVAN:return Gt.ChainId.ETHEREUM_KOVAN;case Yt.ETHEREUM_SEPOLIA:return Gt.ChainId.ETHEREUM_SEPOLIA;case Yt.MATIC_MAINNET:return Gt.ChainId.MATIC_MAINNET;case Yt.MATIC_MUMBAI:return Gt.ChainId.MATIC_MUMBAI;default:return null}}Bt.getChainId=Xt,function(Jt){Jt.schema={type:"string",enum:Object.values(Jt)},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Yt=Bt.ChainName||(Bt.ChainName={}))}(chainName$3)),chainName$3}var hasRequiredChainId$3;function requireChainId$3(){return hasRequiredChainId$3||(hasRequiredChainId$3=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getNetwork=Bt.getNetworkMapping=Bt.getURNProtocol=Bt.getChainName=Bt.ChainId=void 0;const Wt=validation$6,Gt=requireChainName$3(),Yt=network$5;var Xt;(function(cr){cr[cr.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",cr[cr.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",cr[cr.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",cr[cr.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",cr[cr.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",cr[cr.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",cr[cr.MATIC_MAINNET=137]="MATIC_MAINNET",cr[cr.MATIC_MUMBAI=80001]="MATIC_MUMBAI"})(Xt=Bt.ChainId||(Bt.ChainId={}));function Jt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return Gt.ChainName.ETHEREUM_MAINNET;case Xt.ETHEREUM_ROPSTEN:return Gt.ChainName.ETHEREUM_ROPSTEN;case Xt.ETHEREUM_RINKEBY:return Gt.ChainName.ETHEREUM_RINKEBY;case Xt.ETHEREUM_GOERLI:return Gt.ChainName.ETHEREUM_GOERLI;case Xt.ETHEREUM_KOVAN:return Gt.ChainName.ETHEREUM_KOVAN;case Xt.ETHEREUM_SEPOLIA:return Gt.ChainName.ETHEREUM_SEPOLIA;case Xt.MATIC_MAINNET:return Gt.ChainName.MATIC_MAINNET;case Xt.MATIC_MUMBAI:return Gt.ChainName.MATIC_MUMBAI;default:return null}}Bt.getChainName=Jt;function Zt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return"mainnet";case Xt.ETHEREUM_ROPSTEN:return"ropsten";case Xt.ETHEREUM_RINKEBY:return"rinkeby";case Xt.ETHEREUM_GOERLI:return"goerli";case Xt.ETHEREUM_KOVAN:return"kovan";case Xt.ETHEREUM_SEPOLIA:return"sepolia";case Xt.MATIC_MAINNET:return"matic";case Xt.MATIC_MUMBAI:return"mumbai"}}Bt.getURNProtocol=Zt;function Qt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_MAINNET,[Yt.Network.MATIC]:Xt.MATIC_MAINNET};case Xt.ETHEREUM_ROPSTEN:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_ROPSTEN,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_RINKEBY:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_RINKEBY,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_GOERLI:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_GOERLI,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_KOVAN:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_KOVAN,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_SEPOLIA:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_SEPOLIA,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.MATIC_MAINNET:return{[Yt.Network.ETHEREUM]:Xt.MATIC_MAINNET,[Yt.Network.MATIC]:Xt.MATIC_MAINNET};case Xt.MATIC_MUMBAI:return{[Yt.Network.ETHEREUM]:Xt.MATIC_MUMBAI,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI}}}Bt.getNetworkMapping=Qt;function ur(cr){switch(cr){case Xt.ETHEREUM_MAINNET:case Xt.ETHEREUM_ROPSTEN:case Xt.ETHEREUM_GOERLI:case Xt.ETHEREUM_KOVAN:case Xt.ETHEREUM_RINKEBY:case Xt.ETHEREUM_SEPOLIA:return Yt.Network.ETHEREUM;case Xt.MATIC_MAINNET:case Xt.MATIC_MUMBAI:return Yt.Network.MATIC}}Bt.getNetwork=ur,function(cr){cr.schema={type:"number",enum:Object.values(cr)},cr.validate=(0,Wt.generateLazyValidator)(cr.schema)}(Xt=Bt.ChainId||(Bt.ChainId={}))}(chainId$3)),chainId$3}const version$v="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const Bt=[];if(["NFD","NFC","NFKD","NFKC"].forEach(Wt=>{try{if("test".normalize(Wt)!=="test")throw new Error("bad normalize")}catch{Bt.push(Wt)}}),Bt.length)throw new Error("missing "+Bt.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(Bt){return Bt.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(Bt){Bt.DEBUG="DEBUG",Bt.INFO="INFO",Bt.WARNING="WARNING",Bt.ERROR="ERROR",Bt.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(Bt){Bt.UNKNOWN_ERROR="UNKNOWN_ERROR",Bt.NOT_IMPLEMENTED="NOT_IMPLEMENTED",Bt.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",Bt.NETWORK_ERROR="NETWORK_ERROR",Bt.SERVER_ERROR="SERVER_ERROR",Bt.TIMEOUT="TIMEOUT",Bt.BUFFER_OVERRUN="BUFFER_OVERRUN",Bt.NUMERIC_FAULT="NUMERIC_FAULT",Bt.MISSING_NEW="MISSING_NEW",Bt.INVALID_ARGUMENT="INVALID_ARGUMENT",Bt.MISSING_ARGUMENT="MISSING_ARGUMENT",Bt.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",Bt.CALL_EXCEPTION="CALL_EXCEPTION",Bt.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",Bt.NONCE_EXPIRED="NONCE_EXPIRED",Bt.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",Bt.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",Bt.TRANSACTION_REPLACED="TRANSACTION_REPLACED",Bt.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(Wt){Object.defineProperty(this,"version",{enumerable:!0,value:Wt,writable:!1})}_log(Wt,Gt){const Yt=Wt.toLowerCase();LogLevels[Yt]==null&&this.throwArgumentError("invalid log level name","logLevel",Wt),!(_logLevel>LogLevels[Yt])&&console.log.apply(console,Gt)}debug(...Wt){this._log(Logger.levels.DEBUG,Wt)}info(...Wt){this._log(Logger.levels.INFO,Wt)}warn(...Wt){this._log(Logger.levels.WARNING,Wt)}makeError(Wt,Gt,Yt){if(_censorErrors)return this.makeError("censored error",Gt,{});Gt||(Gt=Logger.errors.UNKNOWN_ERROR),Yt||(Yt={});const Xt=[];Object.keys(Yt).forEach(ur=>{const cr=Yt[ur];try{if(cr instanceof Uint8Array){let $r="";for(let Ar=0;Ar<cr.length;Ar++)$r+=HEX[cr[Ar]>>4],$r+=HEX[cr[Ar]&15];Xt.push(ur+"=Uint8Array(0x"+$r+")")}else Xt.push(ur+"="+JSON.stringify(cr))}catch{Xt.push(ur+"="+JSON.stringify(Yt[ur].toString()))}}),Xt.push(`code=${Gt}`),Xt.push(`version=${this.version}`);const Jt=Wt;let Zt="";switch(Gt){case ErrorCode.NUMERIC_FAULT:{Zt="NUMERIC_FAULT";const ur=Wt;switch(ur){case"overflow":case"underflow":case"division-by-zero":Zt+="-"+ur;break;case"negative-power":case"negative-width":Zt+="-unsupported";break;case"unbound-bitwise-result":Zt+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:Zt=Gt;break}Zt&&(Wt+=" [ See: https://links.ethers.org/v5-errors-"+Zt+" ]"),Xt.length&&(Wt+=" ("+Xt.join(", ")+")");const Qt=new Error(Wt);return Qt.reason=Jt,Qt.code=Gt,Object.keys(Yt).forEach(function(ur){Qt[ur]=Yt[ur]}),Qt}throwError(Wt,Gt,Yt){throw this.makeError(Wt,Gt,Yt)}throwArgumentError(Wt,Gt,Yt){return this.throwError(Wt,Logger.errors.INVALID_ARGUMENT,{argument:Gt,value:Yt})}assert(Wt,Gt,Yt,Xt){Wt||this.throwError(Gt,Yt,Xt)}assertArgument(Wt,Gt,Yt,Xt){Wt||this.throwArgumentError(Gt,Yt,Xt)}checkNormalize(Wt){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(Wt,Gt){typeof Wt=="number"&&(Gt==null&&(Gt="value not safe"),(Wt<0||Wt>=9007199254740991)&&this.throwError(Gt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:Wt}),Wt%1&&this.throwError(Gt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:Wt}))}checkArgumentCount(Wt,Gt,Yt){Yt?Yt=": "+Yt:Yt="",Wt<Gt&&this.throwError("missing argument"+Yt,Logger.errors.MISSING_ARGUMENT,{count:Wt,expectedCount:Gt}),Wt>Gt&&this.throwError("too many arguments"+Yt,Logger.errors.UNEXPECTED_ARGUMENT,{count:Wt,expectedCount:Gt})}checkNew(Wt,Gt){(Wt===Object||Wt==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:Gt.name})}checkAbstract(Wt,Gt){Wt===Gt?this.throwError("cannot instantiate abstract class "+JSON.stringify(Gt.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:Wt.name,operation:"new"}):(Wt===Object||Wt==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:Gt.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$v)),_globalLogger}static setCensorship(Wt,Gt){if(!Wt&&Gt&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!Wt)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!Wt,_permanentCensorErrors=!!Gt}static setLogLevel(Wt){const Gt=LogLevels[Wt.toLowerCase()];if(Gt==null){Logger.globalLogger().warn("invalid log level - "+Wt);return}_logLevel=Gt}static from(Wt){return new Logger(Wt)}}Logger.errors=ErrorCode;Logger.levels=LogLevel;const version$u="bytes/5.7.0",logger$M=new Logger(version$u);function isHexable(Bt){return!!Bt.toHexString}function addSlice(Bt){return Bt.slice||(Bt.slice=function(){const Wt=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(Bt,Wt)))}),Bt}function isBytesLike(Bt){return isHexString(Bt)&&!(Bt.length%2)||isBytes(Bt)}function isInteger(Bt){return typeof Bt=="number"&&Bt==Bt&&Bt%1===0}function isBytes(Bt){if(Bt==null)return!1;if(Bt.constructor===Uint8Array)return!0;if(typeof Bt=="string"||!isInteger(Bt.length)||Bt.length<0)return!1;for(let Wt=0;Wt<Bt.length;Wt++){const Gt=Bt[Wt];if(!isInteger(Gt)||Gt<0||Gt>=256)return!1}return!0}function arrayify(Bt,Wt){if(Wt||(Wt={}),typeof Bt=="number"){logger$M.checkSafeUint53(Bt,"invalid arrayify value");const Gt=[];for(;Bt;)Gt.unshift(Bt&255),Bt=parseInt(String(Bt/256));return Gt.length===0&&Gt.push(0),addSlice(new Uint8Array(Gt))}if(Wt.allowMissingPrefix&&typeof Bt=="string"&&Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),isHexable(Bt)&&(Bt=Bt.toHexString()),isHexString(Bt)){let Gt=Bt.substring(2);Gt.length%2&&(Wt.hexPad==="left"?Gt="0"+Gt:Wt.hexPad==="right"?Gt+="0":logger$M.throwArgumentError("hex data is odd-length","value",Bt));const Yt=[];for(let Xt=0;Xt<Gt.length;Xt+=2)Yt.push(parseInt(Gt.substring(Xt,Xt+2),16));return addSlice(new Uint8Array(Yt))}return isBytes(Bt)?addSlice(new Uint8Array(Bt)):logger$M.throwArgumentError("invalid arrayify value","value",Bt)}function concat$2(Bt){const Wt=Bt.map(Xt=>arrayify(Xt)),Gt=Wt.reduce((Xt,Jt)=>Xt+Jt.length,0),Yt=new Uint8Array(Gt);return Wt.reduce((Xt,Jt)=>(Yt.set(Jt,Xt),Xt+Jt.length),0),addSlice(Yt)}function stripZeros(Bt){let Wt=arrayify(Bt);if(Wt.length===0)return Wt;let Gt=0;for(;Gt<Wt.length&&Wt[Gt]===0;)Gt++;return Gt&&(Wt=Wt.slice(Gt)),Wt}function zeroPad(Bt,Wt){Bt=arrayify(Bt),Bt.length>Wt&&logger$M.throwArgumentError("value out of range","value",arguments[0]);const Gt=new Uint8Array(Wt);return Gt.set(Bt,Wt-Bt.length),addSlice(Gt)}function isHexString(Bt,Wt){return!(typeof Bt!="string"||!Bt.match(/^0x[0-9A-Fa-f]*$/)||Wt&&Bt.length!==2+2*Wt)}const HexCharacters="0123456789abcdef";function hexlify(Bt,Wt){if(Wt||(Wt={}),typeof Bt=="number"){logger$M.checkSafeUint53(Bt,"invalid hexlify value");let Gt="";for(;Bt;)Gt=HexCharacters[Bt&15]+Gt,Bt=Math.floor(Bt/16);return Gt.length?(Gt.length%2&&(Gt="0"+Gt),"0x"+Gt):"0x00"}if(typeof Bt=="bigint")return Bt=Bt.toString(16),Bt.length%2?"0x0"+Bt:"0x"+Bt;if(Wt.allowMissingPrefix&&typeof Bt=="string"&&Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),isHexable(Bt))return Bt.toHexString();if(isHexString(Bt))return Bt.length%2&&(Wt.hexPad==="left"?Bt="0x0"+Bt.substring(2):Wt.hexPad==="right"?Bt+="0":logger$M.throwArgumentError("hex data is odd-length","value",Bt)),Bt.toLowerCase();if(isBytes(Bt)){let Gt="0x";for(let Yt=0;Yt<Bt.length;Yt++){let Xt=Bt[Yt];Gt+=HexCharacters[(Xt&240)>>4]+HexCharacters[Xt&15]}return Gt}return logger$M.throwArgumentError("invalid hexlify value","value",Bt)}function hexDataLength(Bt){if(typeof Bt!="string")Bt=hexlify(Bt);else if(!isHexString(Bt)||Bt.length%2)return null;return(Bt.length-2)/2}function hexDataSlice(Bt,Wt,Gt){return typeof Bt!="string"?Bt=hexlify(Bt):(!isHexString(Bt)||Bt.length%2)&&logger$M.throwArgumentError("invalid hexData","value",Bt),Wt=2+2*Wt,Gt!=null?"0x"+Bt.substring(Wt,2+2*Gt):"0x"+Bt.substring(Wt)}function hexConcat(Bt){let Wt="0x";return Bt.forEach(Gt=>{Wt+=hexlify(Gt).substring(2)}),Wt}function hexValue(Bt){const Wt=hexStripZeros(hexlify(Bt,{hexPad:"left"}));return Wt==="0x"?"0x0":Wt}function hexStripZeros(Bt){typeof Bt!="string"&&(Bt=hexlify(Bt)),isHexString(Bt)||logger$M.throwArgumentError("invalid hex string","value",Bt),Bt=Bt.substring(2);let Wt=0;for(;Wt<Bt.length&&Bt[Wt]==="0";)Wt++;return"0x"+Bt.substring(Wt)}function hexZeroPad(Bt,Wt){for(typeof Bt!="string"?Bt=hexlify(Bt):isHexString(Bt)||logger$M.throwArgumentError("invalid hex string","value",Bt),Bt.length>2*Wt+2&&logger$M.throwArgumentError("value out of range","value",arguments[1]);Bt.length<2*Wt+2;)Bt="0x0"+Bt.substring(2);return Bt}function splitSignature(Bt){const Wt={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(Bt)){let Gt=arrayify(Bt);Gt.length===64?(Wt.v=27+(Gt[32]>>7),Gt[32]&=127,Wt.r=hexlify(Gt.slice(0,32)),Wt.s=hexlify(Gt.slice(32,64))):Gt.length===65?(Wt.r=hexlify(Gt.slice(0,32)),Wt.s=hexlify(Gt.slice(32,64)),Wt.v=Gt[64]):logger$M.throwArgumentError("invalid signature string","signature",Bt),Wt.v<27&&(Wt.v===0||Wt.v===1?Wt.v+=27:logger$M.throwArgumentError("signature invalid v byte","signature",Bt)),Wt.recoveryParam=1-Wt.v%2,Wt.recoveryParam&&(Gt[32]|=128),Wt._vs=hexlify(Gt.slice(32,64))}else{if(Wt.r=Bt.r,Wt.s=Bt.s,Wt.v=Bt.v,Wt.recoveryParam=Bt.recoveryParam,Wt._vs=Bt._vs,Wt._vs!=null){const Xt=zeroPad(arrayify(Wt._vs),32);Wt._vs=hexlify(Xt);const Jt=Xt[0]>=128?1:0;Wt.recoveryParam==null?Wt.recoveryParam=Jt:Wt.recoveryParam!==Jt&&logger$M.throwArgumentError("signature recoveryParam mismatch _vs","signature",Bt),Xt[0]&=127;const Zt=hexlify(Xt);Wt.s==null?Wt.s=Zt:Wt.s!==Zt&&logger$M.throwArgumentError("signature v mismatch _vs","signature",Bt)}if(Wt.recoveryParam==null)Wt.v==null?logger$M.throwArgumentError("signature missing v and recoveryParam","signature",Bt):Wt.v===0||Wt.v===1?Wt.recoveryParam=Wt.v:Wt.recoveryParam=1-Wt.v%2;else if(Wt.v==null)Wt.v=27+Wt.recoveryParam;else{const Xt=Wt.v===0||Wt.v===1?Wt.v:1-Wt.v%2;Wt.recoveryParam!==Xt&&logger$M.throwArgumentError("signature recoveryParam mismatch v","signature",Bt)}Wt.r==null||!isHexString(Wt.r)?logger$M.throwArgumentError("signature missing or invalid r","signature",Bt):Wt.r=hexZeroPad(Wt.r,32),Wt.s==null||!isHexString(Wt.s)?logger$M.throwArgumentError("signature missing or invalid s","signature",Bt):Wt.s=hexZeroPad(Wt.s,32);const Gt=arrayify(Wt.s);Gt[0]>=128&&logger$M.throwArgumentError("signature s out of range","signature",Bt),Wt.recoveryParam&&(Gt[0]|=128);const Yt=hexlify(Gt);Wt._vs&&(isHexString(Wt._vs)||logger$M.throwArgumentError("signature invalid _vs","signature",Bt),Wt._vs=hexZeroPad(Wt._vs,32)),Wt._vs==null?Wt._vs=Yt:Wt._vs!==Yt&&logger$M.throwArgumentError("signature _vs mismatch v and s","signature",Bt)}return Wt.yParityAndS=Wt._vs,Wt.compact=Wt.r+Wt.yParityAndS.substring(2),Wt}function joinSignature(Bt){return Bt=splitSignature(Bt),hexlify(concat$2([Bt.r,Bt.s,Bt.recoveryParam?"0x1c":"0x1b"]))}const version$t="bignumber/5.7.0";var BN=BN$7.BN;const logger$L=new Logger(version$t),_constructorGuard$4={},MAX_SAFE=9007199254740991;function isBigNumberish(Bt){return Bt!=null&&(BigNumber.isBigNumber(Bt)||typeof Bt=="number"&&Bt%1===0||typeof Bt=="string"&&!!Bt.match(/^-?[0-9]+$/)||isHexString(Bt)||typeof Bt=="bigint"||isBytes(Bt))}let _warnedToStringRadix=!1;class BigNumber{constructor(Wt,Gt){Wt!==_constructorGuard$4&&logger$L.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=Gt,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Wt){return toBigNumber(toBN(this).fromTwos(Wt))}toTwos(Wt){return toBigNumber(toBN(this).toTwos(Wt))}abs(){return this._hex[0]==="-"?BigNumber.from(this._hex.substring(1)):this}add(Wt){return toBigNumber(toBN(this).add(toBN(Wt)))}sub(Wt){return toBigNumber(toBN(this).sub(toBN(Wt)))}div(Wt){return BigNumber.from(Wt).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(Wt)))}mul(Wt){return toBigNumber(toBN(this).mul(toBN(Wt)))}mod(Wt){const Gt=toBN(Wt);return Gt.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber(toBN(this).umod(Gt))}pow(Wt){const Gt=toBN(Wt);return Gt.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber(toBN(this).pow(Gt))}and(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(Gt))}or(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(Gt))}xor(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(Gt))}mask(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","mask"),toBigNumber(toBN(this).maskn(Wt))}shl(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","shl"),toBigNumber(toBN(this).shln(Wt))}shr(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","shr"),toBigNumber(toBN(this).shrn(Wt))}eq(Wt){return toBN(this).eq(toBN(Wt))}lt(Wt){return toBN(this).lt(toBN(Wt))}lte(Wt){return toBN(this).lte(toBN(Wt))}gt(Wt){return toBN(this).gt(toBN(Wt))}gte(Wt){return toBN(this).gte(toBN(Wt))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch{throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return logger$L.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_warnedToStringRadix||(_warnedToStringRadix=!0,logger$L.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?logger$L.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):logger$L.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(Wt){return{type:"BigNumber",hex:this.toHexString()}}static from(Wt){if(Wt instanceof BigNumber)return Wt;if(typeof Wt=="string")return Wt.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(_constructorGuard$4,toHex(Wt)):Wt.match(/^-?[0-9]+$/)?new BigNumber(_constructorGuard$4,toHex(new BN(Wt))):logger$L.throwArgumentError("invalid BigNumber string","value",Wt);if(typeof Wt=="number")return Wt%1&&throwFault$1("underflow","BigNumber.from",Wt),(Wt>=MAX_SAFE||Wt<=-MAX_SAFE)&&throwFault$1("overflow","BigNumber.from",Wt),BigNumber.from(String(Wt));const Gt=Wt;if(typeof Gt=="bigint")return BigNumber.from(Gt.toString());if(isBytes(Gt))return BigNumber.from(hexlify(Gt));if(Gt)if(Gt.toHexString){const Yt=Gt.toHexString();if(typeof Yt=="string")return BigNumber.from(Yt)}else{let Yt=Gt._hex;if(Yt==null&&Gt.type==="BigNumber"&&(Yt=Gt.hex),typeof Yt=="string"&&(isHexString(Yt)||Yt[0]==="-"&&isHexString(Yt.substring(1))))return BigNumber.from(Yt)}return logger$L.throwArgumentError("invalid BigNumber value","value",Wt)}static isBigNumber(Wt){return!!(Wt&&Wt._isBigNumber)}}function toHex(Bt){if(typeof Bt!="string")return toHex(Bt.toString(16));if(Bt[0]==="-")return Bt=Bt.substring(1),Bt[0]==="-"&&logger$L.throwArgumentError("invalid hex","value",Bt),Bt=toHex(Bt),Bt==="0x00"?Bt:"-"+Bt;if(Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),Bt==="0x")return"0x00";for(Bt.length%2&&(Bt="0x0"+Bt.substring(2));Bt.length>4&&Bt.substring(0,4)==="0x00";)Bt="0x"+Bt.substring(4);return Bt}function toBigNumber(Bt){return BigNumber.from(toHex(Bt))}function toBN(Bt){const Wt=BigNumber.from(Bt).toHexString();return Wt[0]==="-"?new BN("-"+Wt.substring(3),16):new BN(Wt.substring(2),16)}function throwFault$1(Bt,Wt,Gt){const Yt={fault:Bt,operation:Wt};return Gt!=null&&(Yt.value=Gt),logger$L.throwError(Bt,Logger.errors.NUMERIC_FAULT,Yt)}function _base36To16(Bt){return new BN(Bt,36).toString(16)}function _base16To36(Bt){return new BN(Bt,16).toString(36)}const logger$K=new Logger(version$t),_constructorGuard$3={},Zero$2=BigNumber.from(0),NegativeOne$2=BigNumber.from(-1);function throwFault(Bt,Wt,Gt,Yt){const Xt={fault:Wt,operation:Gt};return Yt!==void 0&&(Xt.value=Yt),logger$K.throwError(Bt,Logger.errors.NUMERIC_FAULT,Xt)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(Bt){if(typeof Bt!="number")try{Bt=BigNumber.from(Bt).toNumber()}catch{}return typeof Bt=="number"&&Bt>=0&&Bt<=256&&!(Bt%1)?"1"+zeros.substring(0,Bt):logger$K.throwArgumentError("invalid decimal size","decimals",Bt)}function formatFixed(Bt,Wt){Wt==null&&(Wt=0);const Gt=getMultiplier(Wt);Bt=BigNumber.from(Bt);const Yt=Bt.lt(Zero$2);Yt&&(Bt=Bt.mul(NegativeOne$2));let Xt=Bt.mod(Gt).toString();for(;Xt.length<Gt.length-1;)Xt="0"+Xt;Xt=Xt.match(/^([0-9]*[1-9]|0)(0*)/)[1];const Jt=Bt.div(Gt).toString();return Gt.length===1?Bt=Jt:Bt=Jt+"."+Xt,Yt&&(Bt="-"+Bt),Bt}function parseFixed(Bt,Wt){Wt==null&&(Wt=0);const Gt=getMultiplier(Wt);(typeof Bt!="string"||!Bt.match(/^-?[0-9.]+$/))&&logger$K.throwArgumentError("invalid decimal value","value",Bt);const Yt=Bt.substring(0,1)==="-";Yt&&(Bt=Bt.substring(1)),Bt==="."&&logger$K.throwArgumentError("missing value","value",Bt);const Xt=Bt.split(".");Xt.length>2&&logger$K.throwArgumentError("too many decimal points","value",Bt);let Jt=Xt[0],Zt=Xt[1];for(Jt||(Jt="0"),Zt||(Zt="0");Zt[Zt.length-1]==="0";)Zt=Zt.substring(0,Zt.length-1);for(Zt.length>Gt.length-1&&throwFault("fractional component exceeds decimals","underflow","parseFixed"),Zt===""&&(Zt="0");Zt.length<Gt.length-1;)Zt+="0";const Qt=BigNumber.from(Jt),ur=BigNumber.from(Zt);let cr=Qt.mul(Gt).add(ur);return Yt&&(cr=cr.mul(NegativeOne$2)),cr}class FixedFormat{constructor(Wt,Gt,Yt,Xt){Wt!==_constructorGuard$3&&logger$K.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=Gt,this.width=Yt,this.decimals=Xt,this.name=(Gt?"":"u")+"fixed"+String(Yt)+"x"+String(Xt),this._multiplier=getMultiplier(Xt),Object.freeze(this)}static from(Wt){if(Wt instanceof FixedFormat)return Wt;typeof Wt=="number"&&(Wt=`fixed128x${Wt}`);let Gt=!0,Yt=128,Xt=18;if(typeof Wt=="string"){if(Wt!=="fixed")if(Wt==="ufixed")Gt=!1;else{const Jt=Wt.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Jt||logger$K.throwArgumentError("invalid fixed format","format",Wt),Gt=Jt[1]!=="u",Yt=parseInt(Jt[2]),Xt=parseInt(Jt[3])}}else if(Wt){const Jt=(Zt,Qt,ur)=>Wt[Zt]==null?ur:(typeof Wt[Zt]!==Qt&&logger$K.throwArgumentError("invalid fixed format ("+Zt+" not "+Qt+")","format."+Zt,Wt[Zt]),Wt[Zt]);Gt=Jt("signed","boolean",Gt),Yt=Jt("width","number",Yt),Xt=Jt("decimals","number",Xt)}return Yt%8&&logger$K.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",Yt),Xt>80&&logger$K.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",Xt),new FixedFormat(_constructorGuard$3,Gt,Yt,Xt)}}class FixedNumber{constructor(Wt,Gt,Yt,Xt){Wt!==_constructorGuard$3&&logger$K.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=Xt,this._hex=Gt,this._value=Yt,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Wt){this.format.name!==Wt.format.name&&logger$K.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Wt)}addUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.add(Yt),this.format.decimals,this.format)}subUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.sub(Yt),this.format.decimals,this.format)}mulUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.mul(Yt).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.mul(this.format._multiplier).div(Yt),this.format.decimals,this.format)}floor(){const Wt=this.toString().split(".");Wt.length===1&&Wt.push("0");let Gt=FixedNumber.from(Wt[0],this.format);const Yt=!Wt[1].match(/^(0*)$/);return this.isNegative()&&Yt&&(Gt=Gt.subUnsafe(ONE$1.toFormat(Gt.format))),Gt}ceiling(){const Wt=this.toString().split(".");Wt.length===1&&Wt.push("0");let Gt=FixedNumber.from(Wt[0],this.format);const Yt=!Wt[1].match(/^(0*)$/);return!this.isNegative()&&Yt&&(Gt=Gt.addUnsafe(ONE$1.toFormat(Gt.format))),Gt}round(Wt){Wt==null&&(Wt=0);const Gt=this.toString().split(".");if(Gt.length===1&&Gt.push("0"),(Wt<0||Wt>80||Wt%1)&&logger$K.throwArgumentError("invalid decimal count","decimals",Wt),Gt[1].length<=Wt)return this;const Yt=FixedNumber.from("1"+zeros.substring(0,Wt),this.format),Xt=BUMP.toFormat(this.format);return this.mulUnsafe(Yt).addUnsafe(Xt).floor().divUnsafe(Yt)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Wt){if(Wt==null)return this._hex;Wt%8&&logger$K.throwArgumentError("invalid byte width","width",Wt);const Gt=BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(Wt).toHexString();return hexZeroPad(Gt,Wt/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Wt){return FixedNumber.fromString(this._value,Wt)}static fromValue(Wt,Gt,Yt){return Yt==null&&Gt!=null&&!isBigNumberish(Gt)&&(Yt=Gt,Gt=null),Gt==null&&(Gt=0),Yt==null&&(Yt="fixed"),FixedNumber.fromString(formatFixed(Wt,Gt),FixedFormat.from(Yt))}static fromString(Wt,Gt){Gt==null&&(Gt="fixed");const Yt=FixedFormat.from(Gt),Xt=parseFixed(Wt,Yt.decimals);!Yt.signed&&Xt.lt(Zero$2)&&throwFault("unsigned value cannot be negative","overflow","value",Wt);let Jt=null;Yt.signed?Jt=Xt.toTwos(Yt.width).toHexString():(Jt=Xt.toHexString(),Jt=hexZeroPad(Jt,Yt.width/8));const Zt=formatFixed(Xt,Yt.decimals);return new FixedNumber(_constructorGuard$3,Jt,Zt,Yt)}static fromBytes(Wt,Gt){Gt==null&&(Gt="fixed");const Yt=FixedFormat.from(Gt);if(arrayify(Wt).length>Yt.width/8)throw new Error("overflow");let Xt=BigNumber.from(Wt);Yt.signed&&(Xt=Xt.fromTwos(Yt.width));const Jt=Xt.toTwos((Yt.signed?0:1)+Yt.width).toHexString(),Zt=formatFixed(Xt,Yt.decimals);return new FixedNumber(_constructorGuard$3,Jt,Zt,Yt)}static from(Wt,Gt){if(typeof Wt=="string")return FixedNumber.fromString(Wt,Gt);if(isBytes(Wt))return FixedNumber.fromBytes(Wt,Gt);try{return FixedNumber.fromValue(Wt,0,Gt)}catch(Yt){if(Yt.code!==Logger.errors.INVALID_ARGUMENT)throw Yt}return logger$K.throwArgumentError("invalid FixedNumber value","value",Wt)}static isFixedNumber(Wt){return!!(Wt&&Wt._isFixedNumber)}}const ONE$1=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version$s="properties/5.7.0";var __awaiter$A=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$J=new Logger(version$s);function defineReadOnly(Bt,Wt,Gt){Object.defineProperty(Bt,Wt,{enumerable:!0,value:Gt,writable:!1})}function getStatic(Bt,Wt){for(let Gt=0;Gt<32;Gt++){if(Bt[Wt])return Bt[Wt];if(!Bt.prototype||typeof Bt.prototype!="object")break;Bt=Object.getPrototypeOf(Bt.prototype).constructor}return null}function resolveProperties(Bt){return __awaiter$A(this,void 0,void 0,function*(){const Wt=Object.keys(Bt).map(Yt=>{const Xt=Bt[Yt];return Promise.resolve(Xt).then(Jt=>({key:Yt,value:Jt}))});return(yield Promise.all(Wt)).reduce((Yt,Xt)=>(Yt[Xt.key]=Xt.value,Yt),{})})}function checkProperties(Bt,Wt){(!Bt||typeof Bt!="object")&&logger$J.throwArgumentError("invalid object","object",Bt),Object.keys(Bt).forEach(Gt=>{Wt[Gt]||logger$J.throwArgumentError("invalid object key - "+Gt,"transaction:"+Gt,Bt)})}function shallowCopy(Bt){const Wt={};for(const Gt in Bt)Wt[Gt]=Bt[Gt];return Wt}const opaque={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(Bt){if(Bt==null||opaque[typeof Bt])return!0;if(Array.isArray(Bt)||typeof Bt=="object"){if(!Object.isFrozen(Bt))return!1;const Wt=Object.keys(Bt);for(let Gt=0;Gt<Wt.length;Gt++){let Yt=null;try{Yt=Bt[Wt[Gt]]}catch{continue}if(!_isFrozen(Yt))return!1}return!0}return logger$J.throwArgumentError(`Cannot deepCopy ${typeof Bt}`,"object",Bt)}function _deepCopy(Bt){if(_isFrozen(Bt))return Bt;if(Array.isArray(Bt))return Object.freeze(Bt.map(Wt=>deepCopy(Wt)));if(typeof Bt=="object"){const Wt={};for(const Gt in Bt){const Yt=Bt[Gt];Yt!==void 0&&defineReadOnly(Wt,Gt,deepCopy(Yt))}return Wt}return logger$J.throwArgumentError(`Cannot deepCopy ${typeof Bt}`,"object",Bt)}function deepCopy(Bt){return _deepCopy(Bt)}class Description{constructor(Wt){for(const Gt in Wt)this[Gt]=deepCopy(Wt[Gt])}}const version$r="abi/5.7.0",logger$I=new Logger(version$r),_constructorGuard$2={};let ModifiersBytes={calldata:!0,memory:!0,storage:!0},ModifiersNest={calldata:!0,memory:!0};function checkModifier(Bt,Wt){if(Bt==="bytes"||Bt==="string"){if(ModifiersBytes[Wt])return!0}else if(Bt==="address"){if(Wt==="payable")return!0}else if((Bt.indexOf("[")>=0||Bt==="tuple")&&ModifiersNest[Wt])return!0;return(ModifiersBytes[Wt]||Wt==="payable")&&logger$I.throwArgumentError("invalid modifier","name",Wt),!1}function parseParamType(Bt,Wt){let Gt=Bt;function Yt(Qt){logger$I.throwArgumentError(`unexpected character at position ${Qt}`,"param",Bt)}Bt=Bt.replace(/\s/g," ");function Xt(Qt){let ur={type:"",name:"",parent:Qt,state:{allowType:!0}};return Wt&&(ur.indexed=!1),ur}let Jt={type:"",name:"",state:{allowType:!0}},Zt=Jt;for(let Qt=0;Qt<Bt.length;Qt++){let ur=Bt[Qt];switch(ur){case"(":Zt.state.allowType&&Zt.type===""?Zt.type="tuple":Zt.state.allowParams||Yt(Qt),Zt.state.allowType=!1,Zt.type=verifyType(Zt.type),Zt.components=[Xt(Zt)],Zt=Zt.components[0];break;case")":delete Zt.state,Zt.name==="indexed"&&(Wt||Yt(Qt),Zt.indexed=!0,Zt.name=""),checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Zt.type=verifyType(Zt.type);let cr=Zt;Zt=Zt.parent,Zt||Yt(Qt),delete cr.parent,Zt.state.allowParams=!1,Zt.state.allowName=!0,Zt.state.allowArray=!0;break;case",":delete Zt.state,Zt.name==="indexed"&&(Wt||Yt(Qt),Zt.indexed=!0,Zt.name=""),checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Zt.type=verifyType(Zt.type);let $r=Xt(Zt.parent);Zt.parent.components.push($r),delete Zt.parent,Zt=$r;break;case" ":Zt.state.allowType&&Zt.type!==""&&(Zt.type=verifyType(Zt.type),delete Zt.state.allowType,Zt.state.allowName=!0,Zt.state.allowParams=!0),Zt.state.allowName&&Zt.name!==""&&(Zt.name==="indexed"?(Wt||Yt(Qt),Zt.indexed&&Yt(Qt),Zt.indexed=!0,Zt.name=""):checkModifier(Zt.type,Zt.name)?Zt.name="":Zt.state.allowName=!1);break;case"[":Zt.state.allowArray||Yt(Qt),Zt.type+=ur,Zt.state.allowArray=!1,Zt.state.allowName=!1,Zt.state.readArray=!0;break;case"]":Zt.state.readArray||Yt(Qt),Zt.type+=ur,Zt.state.readArray=!1,Zt.state.allowArray=!0,Zt.state.allowName=!0;break;default:Zt.state.allowType?(Zt.type+=ur,Zt.state.allowParams=!0,Zt.state.allowArray=!0):Zt.state.allowName?(Zt.name+=ur,delete Zt.state.allowArray):Zt.state.readArray?Zt.type+=ur:Yt(Qt)}}return Zt.parent&&logger$I.throwArgumentError("unexpected eof","param",Bt),delete Jt.state,Zt.name==="indexed"?(Wt||Yt(Gt.length-7),Zt.indexed&&Yt(Gt.length-7),Zt.indexed=!0,Zt.name=""):checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Jt.type=verifyType(Jt.type),Jt}function populate(Bt,Wt){for(let Gt in Wt)defineReadOnly(Bt,Gt,Wt[Gt])}const FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(Wt,Gt){Wt!==_constructorGuard$2&&logger$I.throwError("use fromString",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,Gt);let Yt=this.type.match(paramTypeArray);Yt?populate(this,{arrayLength:parseInt(Yt[2]||"-1"),arrayChildren:ParamType.fromObject({type:Yt[1],components:this.components}),baseType:"array"}):populate(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json){let Yt={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(Yt.indexed=this.indexed),this.components&&(Yt.components=this.components.map(Xt=>JSON.parse(Xt.format(Wt)))),JSON.stringify(Yt)}let Gt="";return this.baseType==="array"?(Gt+=this.arrayChildren.format(Wt),Gt+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(Wt!==FormatTypes.sighash&&(Gt+=this.type),Gt+="("+this.components.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+")"):Gt+=this.type,Wt!==FormatTypes.sighash&&(this.indexed===!0&&(Gt+=" indexed"),Wt===FormatTypes.full&&this.name&&(Gt+=" "+this.name)),Gt}static from(Wt,Gt){return typeof Wt=="string"?ParamType.fromString(Wt,Gt):ParamType.fromObject(Wt)}static fromObject(Wt){return ParamType.isParamType(Wt)?Wt:new ParamType(_constructorGuard$2,{name:Wt.name||null,type:verifyType(Wt.type),indexed:Wt.indexed==null?null:!!Wt.indexed,components:Wt.components?Wt.components.map(ParamType.fromObject):null})}static fromString(Wt,Gt){function Yt(Xt){return ParamType.fromObject({name:Xt.name,type:Xt.type,indexed:Xt.indexed,components:Xt.components})}return Yt(parseParamType(Wt,!!Gt))}static isParamType(Wt){return!!(Wt!=null&&Wt._isParamType)}}function parseParams(Bt,Wt){return splitNesting(Bt).map(Gt=>ParamType.fromString(Gt,Wt))}class Fragment{constructor(Wt,Gt){Wt!==_constructorGuard$2&&logger$I.throwError("use a static from method",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,Gt),this._isFragment=!0,Object.freeze(this)}static from(Wt){return Fragment.isFragment(Wt)?Wt:typeof Wt=="string"?Fragment.fromString(Wt):Fragment.fromObject(Wt)}static fromObject(Wt){if(Fragment.isFragment(Wt))return Wt;switch(Wt.type){case"function":return FunctionFragment.fromObject(Wt);case"event":return EventFragment.fromObject(Wt);case"constructor":return ConstructorFragment.fromObject(Wt);case"error":return ErrorFragment.fromObject(Wt);case"fallback":case"receive":return null}return logger$I.throwArgumentError("invalid fragment object","value",Wt)}static fromString(Wt){return Wt=Wt.replace(/\s/g," "),Wt=Wt.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),Wt=Wt.trim(),Wt.split(" ")[0]==="event"?EventFragment.fromString(Wt.substring(5).trim()):Wt.split(" ")[0]==="function"?FunctionFragment.fromString(Wt.substring(8).trim()):Wt.split("(")[0].trim()==="constructor"?ConstructorFragment.fromString(Wt.trim()):Wt.split(" ")[0]==="error"?ErrorFragment.fromString(Wt.substring(5).trim()):logger$I.throwArgumentError("unsupported fragment","value",Wt)}static isFragment(Wt){return!!(Wt&&Wt._isFragment)}}class EventFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="event "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Wt!==FormatTypes.sighash&&this.anonymous&&(Gt+="anonymous "),Gt.trim()}static from(Wt){return typeof Wt=="string"?EventFragment.fromString(Wt):EventFragment.fromObject(Wt)}static fromObject(Wt){if(EventFragment.isEventFragment(Wt))return Wt;Wt.type!=="event"&&logger$I.throwArgumentError("invalid event object","value",Wt);const Gt={name:verifyIdentifier(Wt.name),anonymous:Wt.anonymous,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(_constructorGuard$2,Gt)}static fromString(Wt){let Gt=Wt.match(regexParen);Gt||logger$I.throwArgumentError("invalid event string","value",Wt);let Yt=!1;return Gt[3].split(" ").forEach(Xt=>{switch(Xt.trim()){case"anonymous":Yt=!0;break;case"":break;default:logger$I.warn("unknown modifier: "+Xt)}}),EventFragment.fromObject({name:Gt[1].trim(),anonymous:Yt,inputs:parseParams(Gt[2],!0),type:"event"})}static isEventFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="event"}}function parseGas(Bt,Wt){Wt.gas=null;let Gt=Bt.split("@");return Gt.length!==1?(Gt.length>2&&logger$I.throwArgumentError("invalid human-readable ABI signature","value",Bt),Gt[1].match(/^[0-9]+$/)||logger$I.throwArgumentError("invalid human-readable ABI signature gas","value",Bt),Wt.gas=BigNumber.from(Gt[1]),Gt[0]):Bt}function parseModifiers(Bt,Wt){Wt.constant=!1,Wt.payable=!1,Wt.stateMutability="nonpayable",Bt.split(" ").forEach(Gt=>{switch(Gt.trim()){case"constant":Wt.constant=!0;break;case"payable":Wt.payable=!0,Wt.stateMutability="payable";break;case"nonpayable":Wt.payable=!1,Wt.stateMutability="nonpayable";break;case"pure":Wt.constant=!0,Wt.stateMutability="pure";break;case"view":Wt.constant=!0,Wt.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+Gt)}})}function verifyState(Bt){let Wt={constant:!1,payable:!0,stateMutability:"payable"};return Bt.stateMutability!=null?(Wt.stateMutability=Bt.stateMutability,Wt.constant=Wt.stateMutability==="view"||Wt.stateMutability==="pure",Bt.constant!=null&&!!Bt.constant!==Wt.constant&&logger$I.throwArgumentError("cannot have constant function with mutability "+Wt.stateMutability,"value",Bt),Wt.payable=Wt.stateMutability==="payable",Bt.payable!=null&&!!Bt.payable!==Wt.payable&&logger$I.throwArgumentError("cannot have payable function with mutability "+Wt.stateMutability,"value",Bt)):Bt.payable!=null?(Wt.payable=!!Bt.payable,Bt.constant==null&&!Wt.payable&&Bt.type!=="constructor"&&logger$I.throwArgumentError("unable to determine stateMutability","value",Bt),Wt.constant=!!Bt.constant,Wt.constant?Wt.stateMutability="view":Wt.stateMutability=Wt.payable?"payable":"nonpayable",Wt.payable&&Wt.constant&&logger$I.throwArgumentError("cannot have constant payable function","value",Bt)):Bt.constant!=null?(Wt.constant=!!Bt.constant,Wt.payable=!Wt.constant,Wt.stateMutability=Wt.constant?"view":"payable"):Bt.type!=="constructor"&&logger$I.throwArgumentError("unable to determine stateMutability","value",Bt),Wt}class ConstructorFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});Wt===FormatTypes.sighash&&logger$I.throwError("cannot format a constructor for sighash",Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let Gt="constructor("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(Gt+=this.stateMutability+" "),Gt.trim()}static from(Wt){return typeof Wt=="string"?ConstructorFragment.fromString(Wt):ConstructorFragment.fromObject(Wt)}static fromObject(Wt){if(ConstructorFragment.isConstructorFragment(Wt))return Wt;Wt.type!=="constructor"&&logger$I.throwArgumentError("invalid constructor object","value",Wt);let Gt=verifyState(Wt);Gt.constant&&logger$I.throwArgumentError("constructor cannot be constant","value",Wt);const Yt={name:null,type:Wt.type,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],payable:Gt.payable,stateMutability:Gt.stateMutability,gas:Wt.gas?BigNumber.from(Wt.gas):null};return new ConstructorFragment(_constructorGuard$2,Yt)}static fromString(Wt){let Gt={type:"constructor"};Wt=parseGas(Wt,Gt);let Yt=Wt.match(regexParen);return(!Yt||Yt[1].trim()!=="constructor")&&logger$I.throwArgumentError("invalid constructor string","value",Wt),Gt.inputs=parseParams(Yt[2].trim(),!1),parseModifiers(Yt[3].trim(),Gt),ConstructorFragment.fromObject(Gt)}static isConstructorFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="constructor"}}class FunctionFragment extends ConstructorFragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt))),outputs:this.outputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="function "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Wt!==FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(Gt+=this.stateMutability+" "):this.constant&&(Gt+="view "),this.outputs&&this.outputs.length&&(Gt+="returns ("+this.outputs.map(Yt=>Yt.format(Wt)).join(", ")+") "),this.gas!=null&&(Gt+="@"+this.gas.toString()+" ")),Gt.trim()}static from(Wt){return typeof Wt=="string"?FunctionFragment.fromString(Wt):FunctionFragment.fromObject(Wt)}static fromObject(Wt){if(FunctionFragment.isFunctionFragment(Wt))return Wt;Wt.type!=="function"&&logger$I.throwArgumentError("invalid function object","value",Wt);let Gt=verifyState(Wt);const Yt={type:Wt.type,name:verifyIdentifier(Wt.name),constant:Gt.constant,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],outputs:Wt.outputs?Wt.outputs.map(ParamType.fromObject):[],payable:Gt.payable,stateMutability:Gt.stateMutability,gas:Wt.gas?BigNumber.from(Wt.gas):null};return new FunctionFragment(_constructorGuard$2,Yt)}static fromString(Wt){let Gt={type:"function"};Wt=parseGas(Wt,Gt);let Yt=Wt.split(" returns ");Yt.length>2&&logger$I.throwArgumentError("invalid function string","value",Wt);let Xt=Yt[0].match(regexParen);if(Xt||logger$I.throwArgumentError("invalid function signature","value",Wt),Gt.name=Xt[1].trim(),Gt.name&&verifyIdentifier(Gt.name),Gt.inputs=parseParams(Xt[2],!1),parseModifiers(Xt[3].trim(),Gt),Yt.length>1){let Jt=Yt[1].match(regexParen);(Jt[1].trim()!=""||Jt[3].trim()!="")&&logger$I.throwArgumentError("unexpected tokens","value",Wt),Gt.outputs=parseParams(Jt[2],!1)}else Gt.outputs=[];return FunctionFragment.fromObject(Gt)}static isFunctionFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="function"}}function checkForbidden(Bt){const Wt=Bt.format();return(Wt==="Error(string)"||Wt==="Panic(uint256)")&&logger$I.throwArgumentError(`cannot specify user defined ${Wt} error`,"fragment",Bt),Bt}class ErrorFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="error "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Gt.trim()}static from(Wt){return typeof Wt=="string"?ErrorFragment.fromString(Wt):ErrorFragment.fromObject(Wt)}static fromObject(Wt){if(ErrorFragment.isErrorFragment(Wt))return Wt;Wt.type!=="error"&&logger$I.throwArgumentError("invalid error object","value",Wt);const Gt={type:Wt.type,name:verifyIdentifier(Wt.name),inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard$2,Gt))}static fromString(Wt){let Gt={type:"error"},Yt=Wt.match(regexParen);return Yt||logger$I.throwArgumentError("invalid error signature","value",Wt),Gt.name=Yt[1].trim(),Gt.name&&verifyIdentifier(Gt.name),Gt.inputs=parseParams(Yt[2],!1),checkForbidden(ErrorFragment.fromObject(Gt))}static isErrorFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="error"}}function verifyType(Bt){return Bt.match(/^uint($|[^1-9])/)?Bt="uint256"+Bt.substring(4):Bt.match(/^int($|[^1-9])/)&&(Bt="int256"+Bt.substring(3)),Bt}const regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(Bt){return(!Bt||!Bt.match(regexIdentifier))&&logger$I.throwArgumentError(`invalid identifier "${Bt}"`,"value",Bt),Bt}const regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(Bt){Bt=Bt.trim();let Wt=[],Gt="",Yt=0;for(let Xt=0;Xt<Bt.length;Xt++){let Jt=Bt[Xt];Jt===","&&Yt===0?(Wt.push(Gt),Gt=""):(Gt+=Jt,Jt==="("?Yt++:Jt===")"&&(Yt--,Yt===-1&&logger$I.throwArgumentError("unbalanced parenthesis","value",Bt)))}return Gt&&Wt.push(Gt),Wt}const logger$H=new Logger(version$r);function checkResultErrors(Bt){const Wt=[],Gt=function(Yt,Xt){if(Array.isArray(Xt))for(let Jt in Xt){const Zt=Yt.slice();Zt.push(Jt);try{Gt(Zt,Xt[Jt])}catch(Qt){Wt.push({path:Zt,error:Qt})}}};return Gt([],Bt),Wt}class Coder{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.type=Gt,this.localName=Yt,this.dynamic=Xt}_throwError(Wt,Gt){logger$H.throwArgumentError(Wt,this.localName,Gt)}}class Writer{constructor(Wt){defineReadOnly(this,"wordSize",Wt||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(Wt)}get data(){return hexConcat(this._data)}get length(){return this._dataLength}_writeData(Wt){return this._data.push(Wt),this._dataLength+=Wt.length,Wt.length}appendWriter(Wt){return this._writeData(concat$2(Wt._data))}writeBytes(Wt){let Gt=arrayify(Wt);const Yt=Gt.length%this.wordSize;return Yt&&(Gt=concat$2([Gt,this._padding.slice(Yt)])),this._writeData(Gt)}_getValue(Wt){let Gt=arrayify(BigNumber.from(Wt));return Gt.length>this.wordSize&&logger$H.throwError("value out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:Gt.length}),Gt.length%this.wordSize&&(Gt=concat$2([this._padding.slice(Gt.length%this.wordSize),Gt])),Gt}writeValue(Wt){return this._writeData(this._getValue(Wt))}writeUpdatableValue(){const Wt=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,Gt=>{this._data[Wt]=this._getValue(Gt)}}}class Reader{constructor(Wt,Gt,Yt,Xt){defineReadOnly(this,"_data",arrayify(Wt)),defineReadOnly(this,"wordSize",Gt||32),defineReadOnly(this,"_coerceFunc",Yt),defineReadOnly(this,"allowLoose",Xt),this._offset=0}get data(){return hexlify(this._data)}get consumed(){return this._offset}static coerce(Wt,Gt){let Yt=Wt.match("^u?int([0-9]+)$");return Yt&&parseInt(Yt[1])<=48&&(Gt=Gt.toNumber()),Gt}coerce(Wt,Gt){return this._coerceFunc?this._coerceFunc(Wt,Gt):Reader.coerce(Wt,Gt)}_peekBytes(Wt,Gt,Yt){let Xt=Math.ceil(Gt/this.wordSize)*this.wordSize;return this._offset+Xt>this._data.length&&(this.allowLoose&&Yt&&this._offset+Gt<=this._data.length?Xt=Gt:logger$H.throwError("data out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+Xt})),this._data.slice(this._offset,this._offset+Xt)}subReader(Wt){return new Reader(this._data.slice(this._offset+Wt),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(Wt,Gt){let Yt=this._peekBytes(0,Wt,!!Gt);return this._offset+=Yt.length,Yt.slice(0,Wt)}readValue(){return BigNumber.from(this.readBytes(this.wordSize))}}function keccak256$1(Bt){return"0x"+sha3$2.keccak_256(arrayify(Bt))}const version$q="rlp/5.7.0",logger$G=new Logger(version$q);function arrayifyInteger(Bt){const Wt=[];for(;Bt;)Wt.unshift(Bt&255),Bt>>=8;return Wt}function unarrayifyInteger(Bt,Wt,Gt){let Yt=0;for(let Xt=0;Xt<Gt;Xt++)Yt=Yt*256+Bt[Wt+Xt];return Yt}function _encode(Bt){if(Array.isArray(Bt)){let Yt=[];if(Bt.forEach(function(Jt){Yt=Yt.concat(_encode(Jt))}),Yt.length<=55)return Yt.unshift(192+Yt.length),Yt;const Xt=arrayifyInteger(Yt.length);return Xt.unshift(247+Xt.length),Xt.concat(Yt)}isBytesLike(Bt)||logger$G.throwArgumentError("RLP object must be BytesLike","object",Bt);const Wt=Array.prototype.slice.call(arrayify(Bt));if(Wt.length===1&&Wt[0]<=127)return Wt;if(Wt.length<=55)return Wt.unshift(128+Wt.length),Wt;const Gt=arrayifyInteger(Wt.length);return Gt.unshift(183+Gt.length),Gt.concat(Wt)}function encode$6(Bt){return hexlify(_encode(Bt))}function _decodeChildren(Bt,Wt,Gt,Yt){const Xt=[];for(;Gt<Wt+1+Yt;){const Jt=_decode(Bt,Gt);Xt.push(Jt.result),Gt+=Jt.consumed,Gt>Wt+1+Yt&&logger$G.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+Yt,result:Xt}}function _decode(Bt,Wt){if(Bt.length===0&&logger$G.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),Bt[Wt]>=248){const Gt=Bt[Wt]-247;Wt+1+Gt>Bt.length&&logger$G.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=unarrayifyInteger(Bt,Wt+1,Gt);return Wt+1+Gt+Yt>Bt.length&&logger$G.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(Bt,Wt,Wt+1+Gt,Gt+Yt)}else if(Bt[Wt]>=192){const Gt=Bt[Wt]-192;return Wt+1+Gt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(Bt,Wt,Wt+1,Gt)}else if(Bt[Wt]>=184){const Gt=Bt[Wt]-183;Wt+1+Gt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=unarrayifyInteger(Bt,Wt+1,Gt);Wt+1+Gt+Yt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const Xt=hexlify(Bt.slice(Wt+1+Gt,Wt+1+Gt+Yt));return{consumed:1+Gt+Yt,result:Xt}}else if(Bt[Wt]>=128){const Gt=Bt[Wt]-128;Wt+1+Gt>Bt.length&&logger$G.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=hexlify(Bt.slice(Wt+1,Wt+1+Gt));return{consumed:1+Gt,result:Yt}}return{consumed:1,result:hexlify(Bt[Wt])}}function decode$6(Bt){const Wt=arrayify(Bt),Gt=_decode(Wt,0);return Gt.consumed!==Wt.length&&logger$G.throwArgumentError("invalid rlp data","data",Bt),Gt.result}const index$4=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$6,encode:encode$6},Symbol.toStringTag,{value:"Module"})),version$p="address/5.7.0",logger$F=new Logger(version$p);function getChecksumAddress(Bt){isHexString(Bt,20)||logger$F.throwArgumentError("invalid address","address",Bt),Bt=Bt.toLowerCase();const Wt=Bt.substring(2).split(""),Gt=new Uint8Array(40);for(let Xt=0;Xt<40;Xt++)Gt[Xt]=Wt[Xt].charCodeAt(0);const Yt=arrayify(keccak256$1(Gt));for(let Xt=0;Xt<40;Xt+=2)Yt[Xt>>1]>>4>=8&&(Wt[Xt]=Wt[Xt].toUpperCase()),(Yt[Xt>>1]&15)>=8&&(Wt[Xt+1]=Wt[Xt+1].toUpperCase());return"0x"+Wt.join("")}const MAX_SAFE_INTEGER$5=9007199254740991;function log10(Bt){return Math.log10?Math.log10(Bt):Math.log(Bt)/Math.LN10}const ibanLookup={};for(let Bt=0;Bt<10;Bt++)ibanLookup[String(Bt)]=String(Bt);for(let Bt=0;Bt<26;Bt++)ibanLookup[String.fromCharCode(65+Bt)]=String(10+Bt);const safeDigits=Math.floor(log10(MAX_SAFE_INTEGER$5));function ibanChecksum(Bt){Bt=Bt.toUpperCase(),Bt=Bt.substring(4)+Bt.substring(0,2)+"00";let Wt=Bt.split("").map(Yt=>ibanLookup[Yt]).join("");for(;Wt.length>=safeDigits;){let Yt=Wt.substring(0,safeDigits);Wt=parseInt(Yt,10)%97+Wt.substring(Yt.length)}let Gt=String(98-parseInt(Wt,10)%97);for(;Gt.length<2;)Gt="0"+Gt;return Gt}function getAddress(Bt){let Wt=null;if(typeof Bt!="string"&&logger$F.throwArgumentError("invalid address","address",Bt),Bt.match(/^(0x)?[0-9a-fA-F]{40}$/))Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),Wt=getChecksumAddress(Bt),Bt.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&Wt!==Bt&&logger$F.throwArgumentError("bad address checksum","address",Bt);else if(Bt.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(Bt.substring(2,4)!==ibanChecksum(Bt)&&logger$F.throwArgumentError("bad icap checksum","address",Bt),Wt=_base36To16(Bt.substring(4));Wt.length<40;)Wt="0"+Wt;Wt=getChecksumAddress("0x"+Wt)}else logger$F.throwArgumentError("invalid address","address",Bt);return Wt}function isAddress(Bt){try{return getAddress(Bt),!0}catch{}return!1}function getIcapAddress(Bt){let Wt=_base16To36(getAddress(Bt).substring(2)).toUpperCase();for(;Wt.length<30;)Wt="0"+Wt;return"XE"+ibanChecksum("XE00"+Wt)+Wt}function getContractAddress(Bt){let Wt=null;try{Wt=getAddress(Bt.from)}catch{logger$F.throwArgumentError("missing from address","transaction",Bt)}const Gt=stripZeros(arrayify(BigNumber.from(Bt.nonce).toHexString()));return getAddress(hexDataSlice(keccak256$1(encode$6([Wt,Gt])),12))}function getCreate2Address(Bt,Wt,Gt){return hexDataLength(Wt)!==32&&logger$F.throwArgumentError("salt must be 32 bytes","salt",Wt),hexDataLength(Gt)!==32&&logger$F.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",Gt),getAddress(hexDataSlice(keccak256$1(concat$2(["0xff",getAddress(Bt),Wt,Gt])),12))}class AddressCoder extends Coder{constructor(Wt){super("address","address",Wt,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(Wt,Gt){try{Gt=getAddress(Gt)}catch(Yt){this._throwError(Yt.message,Gt)}return Wt.writeValue(Gt)}decode(Wt){return getAddress(hexZeroPad(Wt.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(Wt){super(Wt.name,Wt.type,void 0,Wt.dynamic),this.coder=Wt}defaultValue(){return this.coder.defaultValue()}encode(Wt,Gt){return this.coder.encode(Wt,Gt)}decode(Wt){return this.coder.decode(Wt)}}const logger$E=new Logger(version$r);function pack$1(Bt,Wt,Gt){let Yt=null;if(Array.isArray(Gt))Yt=Gt;else if(Gt&&typeof Gt=="object"){let ur={};Yt=Wt.map(cr=>{const $r=cr.localName;return $r||logger$E.throwError("cannot encode object for signature with missing names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:cr,value:Gt}),ur[$r]&&logger$E.throwError("cannot encode object for signature with duplicate names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:cr,value:Gt}),ur[$r]=!0,Gt[$r]})}else logger$E.throwArgumentError("invalid tuple value","tuple",Gt);Wt.length!==Yt.length&&logger$E.throwArgumentError("types/value length mismatch","tuple",Gt);let Xt=new Writer(Bt.wordSize),Jt=new Writer(Bt.wordSize),Zt=[];Wt.forEach((ur,cr)=>{let $r=Yt[cr];if(ur.dynamic){let Ar=Jt.length;ur.encode(Jt,$r);let Lr=Xt.writeUpdatableValue();Zt.push(qr=>{Lr(qr+Ar)})}else ur.encode(Xt,$r)}),Zt.forEach(ur=>{ur(Xt.length)});let Qt=Bt.appendWriter(Xt);return Qt+=Bt.appendWriter(Jt),Qt}function unpack(Bt,Wt){let Gt=[],Yt=Bt.subReader(0);Wt.forEach(Jt=>{let Zt=null;if(Jt.dynamic){let Qt=Bt.readValue(),ur=Yt.subReader(Qt.toNumber());try{Zt=Jt.decode(ur)}catch(cr){if(cr.code===Logger.errors.BUFFER_OVERRUN)throw cr;Zt=cr,Zt.baseType=Jt.name,Zt.name=Jt.localName,Zt.type=Jt.type}}else try{Zt=Jt.decode(Bt)}catch(Qt){if(Qt.code===Logger.errors.BUFFER_OVERRUN)throw Qt;Zt=Qt,Zt.baseType=Jt.name,Zt.name=Jt.localName,Zt.type=Jt.type}Zt!=null&&Gt.push(Zt)});const Xt=Wt.reduce((Jt,Zt)=>{const Qt=Zt.localName;return Qt&&(Jt[Qt]||(Jt[Qt]=0),Jt[Qt]++),Jt},{});Wt.forEach((Jt,Zt)=>{let Qt=Jt.localName;if(!Qt||Xt[Qt]!==1||(Qt==="length"&&(Qt="_length"),Gt[Qt]!=null))return;const ur=Gt[Zt];ur instanceof Error?Object.defineProperty(Gt,Qt,{enumerable:!0,get:()=>{throw ur}}):Gt[Qt]=ur});for(let Jt=0;Jt<Gt.length;Jt++){const Zt=Gt[Jt];Zt instanceof Error&&Object.defineProperty(Gt,Jt,{enumerable:!0,get:()=>{throw Zt}})}return Object.freeze(Gt)}class ArrayCoder extends Coder{constructor(Wt,Gt,Yt){const Xt=Wt.type+"["+(Gt>=0?Gt:"")+"]",Jt=Gt===-1||Wt.dynamic;super("array",Xt,Yt,Jt),this.coder=Wt,this.length=Gt}defaultValue(){const Wt=this.coder.defaultValue(),Gt=[];for(let Yt=0;Yt<this.length;Yt++)Gt.push(Wt);return Gt}encode(Wt,Gt){Array.isArray(Gt)||this._throwError("expected array value",Gt);let Yt=this.length;Yt===-1&&(Yt=Gt.length,Wt.writeValue(Gt.length)),logger$E.checkArgumentCount(Gt.length,Yt,"coder array"+(this.localName?" "+this.localName:""));let Xt=[];for(let Jt=0;Jt<Gt.length;Jt++)Xt.push(this.coder);return pack$1(Wt,Xt,Gt)}decode(Wt){let Gt=this.length;Gt===-1&&(Gt=Wt.readValue().toNumber(),Gt*32>Wt._data.length&&logger$E.throwError("insufficient data length",Logger.errors.BUFFER_OVERRUN,{length:Wt._data.length,count:Gt}));let Yt=[];for(let Xt=0;Xt<Gt;Xt++)Yt.push(new AnonymousCoder(this.coder));return Wt.coerce(this.name,unpack(Wt,Yt))}}class BooleanCoder extends Coder{constructor(Wt){super("bool","bool",Wt,!1)}defaultValue(){return!1}encode(Wt,Gt){return Wt.writeValue(Gt?1:0)}decode(Wt){return Wt.coerce(this.type,!Wt.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(Wt,Gt){super(Wt,Wt,Gt,!0)}defaultValue(){return"0x"}encode(Wt,Gt){Gt=arrayify(Gt);let Yt=Wt.writeValue(Gt.length);return Yt+=Wt.writeBytes(Gt),Yt}decode(Wt){return Wt.readBytes(Wt.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(Wt){super("bytes",Wt)}decode(Wt){return Wt.coerce(this.name,hexlify(super.decode(Wt)))}}class FixedBytesCoder extends Coder{constructor(Wt,Gt){let Yt="bytes"+String(Wt);super(Yt,Yt,Gt,!1),this.size=Wt}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(Wt,Gt){let Yt=arrayify(Gt);return Yt.length!==this.size&&this._throwError("incorrect data length",Gt),Wt.writeBytes(Yt)}decode(Wt){return Wt.coerce(this.name,hexlify(Wt.readBytes(this.size)))}}class NullCoder extends Coder{constructor(Wt){super("null","",Wt,!1)}defaultValue(){return null}encode(Wt,Gt){return Gt!=null&&this._throwError("not null",Gt),Wt.writeBytes([])}decode(Wt){return Wt.readBytes(0),Wt.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber.from(-1),Zero$1=BigNumber.from(0),One$1=BigNumber.from(1),Two=BigNumber.from(2),WeiPerEther=BigNumber.from("1000000000000000000"),MaxUint256$1=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),MinInt256=BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),MaxInt256=BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",EtherSymbol="Ξ",index$3=Object.freeze(Object.defineProperty({__proto__:null,AddressZero,EtherSymbol,HashZero,MaxInt256,MaxUint256:MaxUint256$1,MinInt256,NegativeOne:NegativeOne$1,One:One$1,Two,WeiPerEther,Zero:Zero$1},Symbol.toStringTag,{value:"Module"}));class NumberCoder extends Coder{constructor(Wt,Gt,Yt){const Xt=(Gt?"int":"uint")+Wt*8;super(Xt,Xt,Yt,!1),this.size=Wt,this.signed=Gt}defaultValue(){return 0}encode(Wt,Gt){let Yt=BigNumber.from(Gt),Xt=MaxUint256$1.mask(Wt.wordSize*8);if(this.signed){let Jt=Xt.mask(this.size*8-1);(Yt.gt(Jt)||Yt.lt(Jt.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",Gt)}else(Yt.lt(Zero$1)||Yt.gt(Xt.mask(this.size*8)))&&this._throwError("value out-of-bounds",Gt);return Yt=Yt.toTwos(this.size*8).mask(this.size*8),this.signed&&(Yt=Yt.fromTwos(this.size*8).toTwos(8*Wt.wordSize)),Wt.writeValue(Yt)}decode(Wt){let Gt=Wt.readValue().mask(this.size*8);return this.signed&&(Gt=Gt.fromTwos(this.size*8)),Wt.coerce(this.name,Gt)}}const version$o="strings/5.7.0",logger$D=new Logger(version$o);var UnicodeNormalizationForm;(function(Bt){Bt.current="",Bt.NFC="NFC",Bt.NFD="NFD",Bt.NFKC="NFKC",Bt.NFKD="NFKD"})(UnicodeNormalizationForm||(UnicodeNormalizationForm={}));var Utf8ErrorReason;(function(Bt){Bt.UNEXPECTED_CONTINUE="unexpected continuation byte",Bt.BAD_PREFIX="bad codepoint prefix",Bt.OVERRUN="string overrun",Bt.MISSING_CONTINUE="missing continuation byte",Bt.OUT_OF_RANGE="out of UTF-8 range",Bt.UTF16_SURROGATE="UTF-16 surrogate",Bt.OVERLONG="overlong representation"})(Utf8ErrorReason||(Utf8ErrorReason={}));function errorFunc(Bt,Wt,Gt,Yt,Xt){return logger$D.throwArgumentError(`invalid codepoint at offset ${Wt}; ${Bt}`,"bytes",Gt)}function ignoreFunc(Bt,Wt,Gt,Yt,Xt){if(Bt===Utf8ErrorReason.BAD_PREFIX||Bt===Utf8ErrorReason.UNEXPECTED_CONTINUE){let Jt=0;for(let Zt=Wt+1;Zt<Gt.length&&Gt[Zt]>>6===2;Zt++)Jt++;return Jt}return Bt===Utf8ErrorReason.OVERRUN?Gt.length-Wt-1:0}function replaceFunc(Bt,Wt,Gt,Yt,Xt){return Bt===Utf8ErrorReason.OVERLONG?(Yt.push(Xt),0):(Yt.push(65533),ignoreFunc(Bt,Wt,Gt))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(Bt,Wt){Wt==null&&(Wt=Utf8ErrorFuncs.error),Bt=arrayify(Bt);const Gt=[];let Yt=0;for(;Yt<Bt.length;){const Xt=Bt[Yt++];if(!(Xt>>7)){Gt.push(Xt);continue}let Jt=null,Zt=null;if((Xt&224)===192)Jt=1,Zt=127;else if((Xt&240)===224)Jt=2,Zt=2047;else if((Xt&248)===240)Jt=3,Zt=65535;else{(Xt&192)===128?Yt+=Wt(Utf8ErrorReason.UNEXPECTED_CONTINUE,Yt-1,Bt,Gt):Yt+=Wt(Utf8ErrorReason.BAD_PREFIX,Yt-1,Bt,Gt);continue}if(Yt-1+Jt>=Bt.length){Yt+=Wt(Utf8ErrorReason.OVERRUN,Yt-1,Bt,Gt);continue}let Qt=Xt&(1<<8-Jt-1)-1;for(let ur=0;ur<Jt;ur++){let cr=Bt[Yt];if((cr&192)!=128){Yt+=Wt(Utf8ErrorReason.MISSING_CONTINUE,Yt,Bt,Gt),Qt=null;break}Qt=Qt<<6|cr&63,Yt++}if(Qt!==null){if(Qt>1114111){Yt+=Wt(Utf8ErrorReason.OUT_OF_RANGE,Yt-1-Jt,Bt,Gt,Qt);continue}if(Qt>=55296&&Qt<=57343){Yt+=Wt(Utf8ErrorReason.UTF16_SURROGATE,Yt-1-Jt,Bt,Gt,Qt);continue}if(Qt<=Zt){Yt+=Wt(Utf8ErrorReason.OVERLONG,Yt-1-Jt,Bt,Gt,Qt);continue}Gt.push(Qt)}}return Gt}function toUtf8Bytes(Bt,Wt=UnicodeNormalizationForm.current){Wt!=UnicodeNormalizationForm.current&&(logger$D.checkNormalize(),Bt=Bt.normalize(Wt));let Gt=[];for(let Yt=0;Yt<Bt.length;Yt++){const Xt=Bt.charCodeAt(Yt);if(Xt<128)Gt.push(Xt);else if(Xt<2048)Gt.push(Xt>>6|192),Gt.push(Xt&63|128);else if((Xt&64512)==55296){Yt++;const Jt=Bt.charCodeAt(Yt);if(Yt>=Bt.length||(Jt&64512)!==56320)throw new Error("invalid utf-8 string");const Zt=65536+((Xt&1023)<<10)+(Jt&1023);Gt.push(Zt>>18|240),Gt.push(Zt>>12&63|128),Gt.push(Zt>>6&63|128),Gt.push(Zt&63|128)}else Gt.push(Xt>>12|224),Gt.push(Xt>>6&63|128),Gt.push(Xt&63|128)}return arrayify(Gt)}function escapeChar(Bt){const Wt="0000"+Bt.toString(16);return"\\u"+Wt.substring(Wt.length-4)}function _toEscapedUtf8String(Bt,Wt){return'"'+getUtf8CodePoints(Bt,Wt).map(Gt=>{if(Gt<256){switch(Gt){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(Gt>=32&&Gt<127)return String.fromCharCode(Gt)}return Gt<=65535?escapeChar(Gt):(Gt-=65536,escapeChar((Gt>>10&1023)+55296)+escapeChar((Gt&1023)+56320))}).join("")+'"'}function _toUtf8String(Bt){return Bt.map(Wt=>Wt<=65535?String.fromCharCode(Wt):(Wt-=65536,String.fromCharCode((Wt>>10&1023)+55296,(Wt&1023)+56320))).join("")}function toUtf8String(Bt,Wt){return _toUtf8String(getUtf8CodePoints(Bt,Wt))}function toUtf8CodePoints(Bt,Wt=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(Bt,Wt))}function formatBytes32String(Bt){const Wt=toUtf8Bytes(Bt);if(Wt.length>31)throw new Error("bytes32 string must be less than 32 bytes");return hexlify(concat$2([Wt,HashZero]).slice(0,32))}function parseBytes32String(Bt){const Wt=arrayify(Bt);if(Wt.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(Wt[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let Gt=31;for(;Wt[Gt-1]===0;)Gt--;return toUtf8String(Wt.slice(0,Gt))}function bytes2(Bt){if(Bt.length%4!==0)throw new Error("bad data");let Wt=[];for(let Gt=0;Gt<Bt.length;Gt+=4)Wt.push(parseInt(Bt.substring(Gt,Gt+4),16));return Wt}function createTable(Bt,Wt){Wt||(Wt=function(Xt){return[parseInt(Xt,16)]});let Gt=0,Yt={};return Bt.split(",").forEach(Xt=>{let Jt=Xt.split(":");Gt+=parseInt(Jt[0],16),Yt[Gt]=Wt(Jt[1])}),Yt}function createRangeTable(Bt){let Wt=0;return Bt.split(",").map(Gt=>{let Yt=Gt.split("-");Yt.length===1?Yt[1]="0":Yt[1]===""&&(Yt[1]="1");let Xt=Wt+parseInt(Yt[0],16);return Wt=parseInt(Yt[1],16),{l:Xt,h:Wt}})}function matchMap(Bt,Wt){let Gt=0;for(let Yt=0;Yt<Wt.length;Yt++){let Xt=Wt[Yt];if(Gt+=Xt.l,Bt>=Gt&&Bt<=Gt+Xt.h&&(Bt-Gt)%(Xt.d||1)===0){if(Xt.e&&Xt.e.indexOf(Bt-Gt)!==-1)continue;return Xt}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(Bt=>parseInt(Bt,16)),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten$2(Bt){return Bt.reduce((Wt,Gt)=>(Gt.forEach(Yt=>{Wt.push(Yt)}),Wt),[])}function _nameprepTableA1(Bt){return!!matchMap(Bt,Table_A_1_ranges)}function _nameprepTableB2(Bt){let Wt=matchMap(Bt,Table_B_2_ranges);if(Wt)return[Bt+Wt.s];let Gt=Table_B_2_lut_abs[Bt];if(Gt)return Gt;let Yt=Table_B_2_lut_rel[Bt];if(Yt)return[Bt+Yt[0]];let Xt=Table_B_2_complex[Bt];return Xt||null}function _nameprepTableC(Bt){return!!matchMap(Bt,Table_C_ranges)}function nameprep(Bt){if(Bt.match(/^[a-z0-9-]*$/i)&&Bt.length<=59)return Bt.toLowerCase();let Wt=toUtf8CodePoints(Bt);Wt=flatten$2(Wt.map(Yt=>{if(Table_B_1_flags.indexOf(Yt)>=0)return[];if(Yt>=65024&&Yt<=65039)return[];let Xt=_nameprepTableB2(Yt);return Xt||[Yt]})),Wt=toUtf8CodePoints(_toUtf8String(Wt),UnicodeNormalizationForm.NFKC),Wt.forEach(Yt=>{if(_nameprepTableC(Yt))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),Wt.forEach(Yt=>{if(_nameprepTableA1(Yt))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let Gt=_toUtf8String(Wt);if(Gt.substring(0,1)==="-"||Gt.substring(2,4)==="--"||Gt.substring(Gt.length-1)==="-")throw new Error("invalid hyphen");return Gt}class StringCoder extends DynamicBytesCoder{constructor(Wt){super("string",Wt)}defaultValue(){return""}encode(Wt,Gt){return super.encode(Wt,toUtf8Bytes(Gt))}decode(Wt){return toUtf8String(super.decode(Wt))}}class TupleCoder extends Coder{constructor(Wt,Gt){let Yt=!1;const Xt=[];Wt.forEach(Zt=>{Zt.dynamic&&(Yt=!0),Xt.push(Zt.type)});const Jt="tuple("+Xt.join(",")+")";super("tuple",Jt,Gt,Yt),this.coders=Wt}defaultValue(){const Wt=[];this.coders.forEach(Yt=>{Wt.push(Yt.defaultValue())});const Gt=this.coders.reduce((Yt,Xt)=>{const Jt=Xt.localName;return Jt&&(Yt[Jt]||(Yt[Jt]=0),Yt[Jt]++),Yt},{});return this.coders.forEach((Yt,Xt)=>{let Jt=Yt.localName;!Jt||Gt[Jt]!==1||(Jt==="length"&&(Jt="_length"),Wt[Jt]==null&&(Wt[Jt]=Wt[Xt]))}),Object.freeze(Wt)}encode(Wt,Gt){return pack$1(Wt,this.coders,Gt)}decode(Wt){return Wt.coerce(this.name,unpack(Wt,this.coders))}}const logger$C=new Logger(version$r),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(Wt){defineReadOnly(this,"coerceFunc",Wt||null)}_getCoder(Wt){switch(Wt.baseType){case"address":return new AddressCoder(Wt.name);case"bool":return new BooleanCoder(Wt.name);case"string":return new StringCoder(Wt.name);case"bytes":return new BytesCoder(Wt.name);case"array":return new ArrayCoder(this._getCoder(Wt.arrayChildren),Wt.arrayLength,Wt.name);case"tuple":return new TupleCoder((Wt.components||[]).map(Yt=>this._getCoder(Yt)),Wt.name);case"":return new NullCoder(Wt.name)}let Gt=Wt.type.match(paramTypeNumber);if(Gt){let Yt=parseInt(Gt[2]||"256");return(Yt===0||Yt>256||Yt%8!==0)&&logger$C.throwArgumentError("invalid "+Gt[1]+" bit length","param",Wt),new NumberCoder(Yt/8,Gt[1]==="int",Wt.name)}if(Gt=Wt.type.match(paramTypeBytes),Gt){let Yt=parseInt(Gt[1]);return(Yt===0||Yt>32)&&logger$C.throwArgumentError("invalid bytes length","param",Wt),new FixedBytesCoder(Yt,Wt.name)}return logger$C.throwArgumentError("invalid type","type",Wt.type)}_getWordSize(){return 32}_getReader(Wt,Gt){return new Reader(Wt,this._getWordSize(),this.coerceFunc,Gt)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(Wt){const Gt=Wt.map(Xt=>this._getCoder(ParamType.from(Xt)));return new TupleCoder(Gt,"_").defaultValue()}encode(Wt,Gt){Wt.length!==Gt.length&&logger$C.throwError("types/values length mismatch",Logger.errors.INVALID_ARGUMENT,{count:{types:Wt.length,values:Gt.length},value:{types:Wt,values:Gt}});const Yt=Wt.map(Zt=>this._getCoder(ParamType.from(Zt))),Xt=new TupleCoder(Yt,"_"),Jt=this._getWriter();return Xt.encode(Jt,Gt),Jt.data}decode(Wt,Gt,Yt){const Xt=Wt.map(Zt=>this._getCoder(ParamType.from(Zt)));return new TupleCoder(Xt,"_").decode(this._getReader(arrayify(Gt),Yt))}}const defaultAbiCoder=new AbiCoder;function id(Bt){return keccak256$1(toUtf8Bytes(Bt))}const version$n="hash/5.7.0";function decode$5(Bt){Bt=atob(Bt);const Wt=[];for(let Gt=0;Gt<Bt.length;Gt++)Wt.push(Bt.charCodeAt(Gt));return arrayify(Wt)}function encode$5(Bt){Bt=arrayify(Bt);let Wt="";for(let Gt=0;Gt<Bt.length;Gt++)Wt+=String.fromCharCode(Bt[Gt]);return btoa(Wt)}const index$2=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$5,encode:encode$5},Symbol.toStringTag,{value:"Module"}));function flat$2(Bt,Wt){Wt==null&&(Wt=1);const Gt=[],Yt=Gt.forEach,Xt=function(Jt,Zt){Yt.call(Jt,function(Qt){Zt>0&&Array.isArray(Qt)?Xt(Qt,Zt-1):Gt.push(Qt)})};return Xt(Bt,Wt),Gt}function fromEntries$1(Bt){const Wt={};for(let Gt=0;Gt<Bt.length;Gt++){const Yt=Bt[Gt];Wt[Yt[0]]=Yt[1]}return Wt}function decode_arithmetic(Bt){let Wt=0;function Gt(){return Bt[Wt++]<<8|Bt[Wt++]}let Yt=Gt(),Xt=1,Jt=[0,1];for(let hn=1;hn<Yt;hn++)Jt.push(Xt+=Gt());let Zt=Gt(),Qt=Wt;Wt+=Zt;let ur=0,cr=0;function $r(){return ur==0&&(cr=cr<<8|Bt[Wt++],ur=8),cr>>--ur&1}const Ar=31,Lr=Math.pow(2,Ar),qr=Lr>>>1,Fr=qr>>1,Hr=Lr-1;let Br=0;for(let hn=0;hn<Ar;hn++)Br=Br<<1|$r();let Wr=[],Gr=0,Kr=Lr;for(;;){let hn=Math.floor(((Br-Gr+1)*Xt-1)/Kr),Qr=0,pn=Yt;for(;pn-Qr>1;){let dn=Qr+pn>>>1;hn<Jt[dn]?pn=dn:Qr=dn}if(Qr==0)break;Wr.push(Qr);let En=Gr+Math.floor(Kr*Jt[Qr]/Xt),ga=Gr+Math.floor(Kr*Jt[Qr+1]/Xt)-1;for(;!((En^ga)&qr);)Br=Br<<1&Hr|$r(),En=En<<1&Hr,ga=ga<<1&Hr|1;for(;En&~ga&Fr;)Br=Br&qr|Br<<1&Hr>>>1|$r(),En=En<<1^qr,ga=(ga^qr)<<1|qr|1;Gr=En,Kr=1+ga-En}let Yr=Yt-4;return Wr.map(hn=>{switch(hn-Yr){case 3:return Yr+65792+(Bt[Qt++]<<16|Bt[Qt++]<<8|Bt[Qt++]);case 2:return Yr+256+(Bt[Qt++]<<8|Bt[Qt++]);case 1:return Yr+Bt[Qt++];default:return hn-1}})}function read_payload(Bt){let Wt=0;return()=>Bt[Wt++]}function read_compressed_payload(Bt){return read_payload(decode_arithmetic(Bt))}function signed(Bt){return Bt&1?~Bt>>1:Bt>>1}function read_counts(Bt,Wt){let Gt=Array(Bt);for(let Yt=0;Yt<Bt;Yt++)Gt[Yt]=1+Wt();return Gt}function read_ascending(Bt,Wt){let Gt=Array(Bt);for(let Yt=0,Xt=-1;Yt<Bt;Yt++)Gt[Yt]=Xt+=1+Wt();return Gt}function read_deltas(Bt,Wt){let Gt=Array(Bt);for(let Yt=0,Xt=0;Yt<Bt;Yt++)Gt[Yt]=Xt+=signed(Wt());return Gt}function read_member_array(Bt,Wt){let Gt=read_ascending(Bt(),Bt),Yt=Bt(),Xt=read_ascending(Yt,Bt),Jt=read_counts(Yt,Bt);for(let Zt=0;Zt<Yt;Zt++)for(let Qt=0;Qt<Jt[Zt];Qt++)Gt.push(Xt[Zt]+Qt);return Wt?Gt.map(Zt=>Wt[Zt]):Gt}function read_mapped_map(Bt){let Wt=[];for(;;){let Gt=Bt();if(Gt==0)break;Wt.push(read_linear_table(Gt,Bt))}for(;;){let Gt=Bt()-1;if(Gt<0)break;Wt.push(read_replacement_table(Gt,Bt))}return fromEntries$1(flat$2(Wt))}function read_zero_terminated_array(Bt){let Wt=[];for(;;){let Gt=Bt();if(Gt==0)break;Wt.push(Gt)}return Wt}function read_transposed(Bt,Wt,Gt){let Yt=Array(Bt).fill(void 0).map(()=>[]);for(let Xt=0;Xt<Wt;Xt++)read_deltas(Bt,Gt).forEach((Jt,Zt)=>Yt[Zt].push(Jt));return Yt}function read_linear_table(Bt,Wt){let Gt=1+Wt(),Yt=Wt(),Xt=read_zero_terminated_array(Wt),Jt=read_transposed(Xt.length,1+Bt,Wt);return flat$2(Jt.map((Zt,Qt)=>{const ur=Zt[0],cr=Zt.slice(1);return Array(Xt[Qt]).fill(void 0).map(($r,Ar)=>{let Lr=Ar*Yt;return[ur+Ar*Gt,cr.map(qr=>qr+Lr)]})}))}function read_replacement_table(Bt,Wt){let Gt=1+Wt();return read_transposed(Gt,1+Bt,Wt).map(Xt=>[Xt[0],Xt.slice(1)])}function read_emoji_trie(Bt){let Wt=read_member_array(Bt).sort((Yt,Xt)=>Yt-Xt);return Gt();function Gt(){let Yt=[];for(;;){let cr=read_member_array(Bt,Wt);if(cr.length==0)break;Yt.push({set:new Set(cr),node:Gt()})}Yt.sort((cr,$r)=>$r.set.size-cr.set.size);let Xt=Bt(),Jt=Xt%3;Xt=Xt/3|0;let Zt=!!(Xt&1);Xt>>=1;let Qt=Xt==1,ur=Xt==2;return{branches:Yt,valid:Jt,fe0f:Zt,save:Qt,check:ur}}}function getData$6(){return read_compressed_payload(decode$5("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r$2=getData$6(),VALID=new Set(read_member_array(r$2)),IGNORED=new Set(read_member_array(r$2)),MAPPED=read_mapped_map(r$2),EMOJI_ROOT=read_emoji_trie(r$2),HYPHEN=45,UNDERSCORE=95;function explode_cp(Bt){return toUtf8CodePoints(Bt)}function filter_fe0f(Bt){return Bt.filter(Wt=>Wt!=65039)}function ens_normalize_post_check(Bt){for(let Wt of Bt.split(".")){let Gt=explode_cp(Wt);try{for(let Yt=Gt.lastIndexOf(UNDERSCORE)-1;Yt>=0;Yt--)if(Gt[Yt]!==UNDERSCORE)throw new Error("underscore only allowed at start");if(Gt.length>=4&&Gt.every(Yt=>Yt<128)&&Gt[2]===HYPHEN&&Gt[3]===HYPHEN)throw new Error("invalid label extension")}catch(Yt){throw new Error(`Invalid label "${Wt}": ${Yt.message}`)}}return Bt}function ens_normalize(Bt){return ens_normalize_post_check(normalize$1(Bt,filter_fe0f))}function normalize$1(Bt,Wt){let Gt=explode_cp(Bt).reverse(),Yt=[];for(;Gt.length;){let Xt=consume_emoji_reversed(Gt);if(Xt){Yt.push(...Wt(Xt));continue}let Jt=Gt.pop();if(VALID.has(Jt)){Yt.push(Jt);continue}if(IGNORED.has(Jt))continue;let Zt=MAPPED[Jt];if(Zt){Yt.push(...Zt);continue}throw new Error(`Disallowed codepoint: 0x${Jt.toString(16).toUpperCase()}`)}return ens_normalize_post_check(nfc(String.fromCodePoint(...Yt)))}function nfc(Bt){return Bt.normalize("NFC")}function consume_emoji_reversed(Bt,Wt){var Gt;let Yt=EMOJI_ROOT,Xt,Jt,Zt=[],Qt=Bt.length;for(Wt&&(Wt.length=0);Qt;){let ur=Bt[--Qt];if(Yt=(Gt=Yt.branches.find(cr=>cr.set.has(ur)))===null||Gt===void 0?void 0:Gt.node,!Yt)break;if(Yt.save)Jt=ur;else if(Yt.check&&ur===Jt)break;Zt.push(ur),Yt.fe0f&&(Zt.push(65039),Qt>0&&Bt[Qt-1]==65039&&Qt--),Yt.valid&&(Xt=Zt.slice(),Yt.valid==2&&Xt.splice(1,1),Wt&&Wt.push(...Bt.slice(Qt).reverse()),Bt.length=Qt)}return Xt}const logger$B=new Logger(version$n),Zeros$1=new Uint8Array(32);Zeros$1.fill(0);function checkComponent(Bt){if(Bt.length===0)throw new Error("invalid ENS name; empty component");return Bt}function ensNameSplit(Bt){const Wt=toUtf8Bytes(ens_normalize(Bt)),Gt=[];if(Bt.length===0)return Gt;let Yt=0;for(let Xt=0;Xt<Wt.length;Xt++)Wt[Xt]===46&&(Gt.push(checkComponent(Wt.slice(Yt,Xt))),Yt=Xt+1);if(Yt>=Wt.length)throw new Error("invalid ENS name; empty component");return Gt.push(checkComponent(Wt.slice(Yt))),Gt}function isValidName(Bt){try{return ensNameSplit(Bt).length!==0}catch{}return!1}function namehash(Bt){typeof Bt!="string"&&logger$B.throwArgumentError("invalid ENS name; not a string","name",Bt);let Wt=Zeros$1;const Gt=ensNameSplit(Bt);for(;Gt.length;)Wt=keccak256$1(concat$2([Wt,keccak256$1(Gt.pop())]));return hexlify(Wt)}function dnsEncode(Bt){return hexlify(concat$2(ensNameSplit(Bt).map(Wt=>{if(Wt.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const Gt=new Uint8Array(Wt.length+1);return Gt.set(Wt,1),Gt[0]=Gt.length-1,Gt})))+"00"}const messagePrefix=`Ethereum Signed Message:
761
+ }`;var Up=sw(function(){return Vp(mu,wp+"return "+Bl).apply(yo,Du)});if(Up.source=Bl,A1(Up))throw Up;return Up}function LS(yn){return p0(yn).toLowerCase()}function jS(yn){return p0(yn).toUpperCase()}function BS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return Iv(yn);if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=Tm(va),mu=Nv(So,Xo),Du=kv(So,Xo)+1;return _g(So,mu,Du).join("")}function FS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return yn.slice(0,Jv(yn)+1);if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=kv(So,Tm(va))+1;return _g(So,0,Xo).join("")}function qS(yn,va,co){if(yn=p0(yn),yn&&(co||va===yo))return yn.replace(Hp,"");if(!yn||!(va=Om(va)))return yn;var So=Tm(yn),Xo=Nv(So,Tm(va));return _g(So,Xo).join("")}function US(yn,va){var co=Vo,So=zo;if(M0(va)){var Xo="separator"in va?va.separator:Xo;co="length"in va?qp(va.length):co,So="omission"in va?Om(va.omission):So}yn=p0(yn);var mu=yn.length;if(Ky(yn)){var Du=Tm(yn);mu=Du.length}if(co>=mu)return yn;var Ku=co-Vy(So);if(Ku<1)return So;var ll=Du?_g(Du,0,Ku).join(""):yn.slice(0,Ku);if(Xo===yo)return ll+So;if(Du&&(Ku+=ll.length-Ku),T1(Xo)){if(yn.slice(Ku).search(Xo)){var Cl,Il=ll;for(Xo.global||(Xo=Lv(Xo.source,p0(A0.exec(Xo))+"g")),Xo.lastIndex=0;Cl=Xo.exec(Il);)var Bl=Cl.index;ll=ll.slice(0,Bl===yo?Ku:Bl)}}else if(yn.indexOf(Om(Xo),Ku)!=Ku){var sp=ll.lastIndexOf(Xo);sp>-1&&(ll=ll.slice(0,sp))}return ll+So}function HS(yn){return yn=p0(yn),yn&&Oo.test(yn)?yn.replace(j0,I_):yn}var zS=Sv(function(yn,va,co){return yn+(co?" ":"")+va.toUpperCase()}),O1=u$("toUpperCase");function ow(yn,va,co){return yn=p0(yn),va=co?yo:va,va===yo?P_(yn)?Qv(yn):iv(yn):yn.match(va)||[]}var sw=Gp(function(yn,va){try{return W0(yn,yo,va)}catch(co){return A1(co)?co:new Ip(co)}}),GS=Dy(function(yn,va){return z0(va,function(co){co=Sy(co),kp(yn,co,x1(yn[co],yn))}),yn});function KS(yn){var va=yn==null?0:yn.length,co=Pp();return yn=va?d0(yn,function(So){if(typeof So[1]!="function")throw new dm($o);return[co(So[0]),So[1]]}):[],Gp(function(So){for(var Xo=-1;++Xo<va;){var mu=yn[Xo];if(W0(mu[0],this,So))return W0(mu[1],this,So)}})}function VS(yn){return _0(Sp(yn,nu))}function R1(yn){return function(){return yn}}function YS(yn,va){return yn==null||yn!==yn?va:yn}var XS=c$(),JS=c$(!0);function Em(yn){return yn}function C1(yn){return F1(typeof yn=="function"?yn:Sp(yn,nu))}function ZS(yn){return U1(Sp(yn,nu))}function QS(yn,va){return H1(yn,Sp(va,nu))}var eA=Gp(function(yn,va){return function(co){return Fv(co,yn,va)}}),tA=Gp(function(yn,va){return function(co){return Fv(yn,co,va)}});function I1(yn,va,co){var So=G0(va),Xo=uv(va,So);co==null&&!(M0(va)&&(Xo.length||!So.length))&&(co=va,va=yn,yn=this,Xo=uv(va,G0(va)));var mu=!(M0(co)&&"chain"in co)||!!co.chain,Du=jy(yn);return z0(Xo,function(Ku){var ll=va[Ku];yn[Ku]=ll,Du&&(yn.prototype[Ku]=function(){var Cl=this.__chain__;if(mu||Cl){var Il=yn(this.__wrapped__),Bl=Il.__actions__=bm(this.__actions__);return Bl.push({func:ll,args:arguments,thisArg:yn}),Il.__chain__=Cl,Il}return ll.apply(yn,jm([this.value()],arguments))})}),yn}function rA(){return $0._===this&&($0._=vo),this}function k1(){}function nA(yn){return yn=qp(yn),Gp(function(va){return W1(va,yn)})}var iA=l1(d0),aA=l1(Uy),oA=l1(J0);function uw(yn){return y1(yn)?zy(Sy(yn)):Rw(yn)}function sA(yn){return function(va){return yn==null?yo:Gm(yn,va)}}var uA=d$(),lA=d$(!0);function D1(){return[]}function L1(){return!1}function cA(){return{}}function fA(){return""}function dA(){return!0}function hA(yn,va){if(yn=qp(yn),yn<1||yn>Ho)return[];var co=du,So=jl(yn,du);va=Pp(va),yn-=du;for(var Xo=bv(So,va);++co<yn;)va(co);return Xo}function pA(yn){return Bp(yn)?d0(yn,Sy):Rm(yn)?[yn]:bm(P$(p0(yn)))}function mA(yn){var va=++vn;return p0(yn)+va}var yA=d_(function(yn,va){return yn+va},0),gA=c1("ceil"),vA=d_(function(yn,va){return yn/va},1),_A=c1("floor");function bA(yn){return yn&&yn.length?Wm(yn,Em,Ev):yo}function $A(yn,va){return yn&&yn.length?Wm(yn,Pp(va,2),Ev):yo}function wA(yn){return yv(yn,Em)}function EA(yn,va){return yv(yn,Pp(va,2))}function xA(yn){return yn&&yn.length?Wm(yn,Em,Q_):yo}function SA(yn,va){return yn&&yn.length?Wm(yn,Pp(va,2),Q_):yo}var AA=d_(function(yn,va){return yn*va},1),TA=c1("round"),PA=d_(function(yn,va){return yn-va},0);function MA(yn){return yn&&yn.length?_v(yn,Em):0}function OA(yn,va){return yn&&yn.length?_v(yn,Pp(va,2)):0}return uu.after=X2,uu.ary=B$,uu.assign=jx,uu.assignIn=Q$,uu.assignInWith=S_,uu.assignWith=Bx,uu.at=Fx,uu.before=F$,uu.bind=x1,uu.bindAll=GS,uu.bindKey=q$,uu.castArray=ux,uu.chain=D$,uu.chunk=pE,uu.compact=mE,uu.concat=yE,uu.cond=KS,uu.conforms=VS,uu.constant=R1,uu.countBy=A2,uu.create=qx,uu.curry=U$,uu.curryRight=H$,uu.debounce=W$,uu.defaults=Ux,uu.defaultsDeep=Hx,uu.defer=J2,uu.delay=Z2,uu.difference=gE,uu.differenceBy=vE,uu.differenceWith=_E,uu.drop=bE,uu.dropRight=$E,uu.dropRightWhile=wE,uu.dropWhile=EE,uu.fill=xE,uu.filter=P2,uu.flatMap=R2,uu.flatMapDeep=C2,uu.flatMapDepth=I2,uu.flatten=C$,uu.flattenDeep=SE,uu.flattenDepth=AE,uu.flip=Q2,uu.flow=XS,uu.flowRight=JS,uu.fromPairs=TE,uu.functions=Xx,uu.functionsIn=Jx,uu.groupBy=k2,uu.initial=ME,uu.intersection=OE,uu.intersectionBy=CE,uu.intersectionWith=IE,uu.invert=Qx,uu.invertBy=eS,uu.invokeMap=L2,uu.iteratee=C1,uu.keyBy=j2,uu.keys=G0,uu.keysIn=wm,uu.map=__,uu.mapKeys=rS,uu.mapValues=nS,uu.matches=ZS,uu.matchesProperty=QS,uu.memoize=$_,uu.merge=iS,uu.mergeWith=ew,uu.method=eA,uu.methodOf=tA,uu.mixin=I1,uu.negate=w_,uu.nthArg=nA,uu.omit=aS,uu.omitBy=oS,uu.once=ex,uu.orderBy=B2,uu.over=iA,uu.overArgs=tx,uu.overEvery=aA,uu.overSome=oA,uu.partial=S1,uu.partialRight=z$,uu.partition=F2,uu.pick=sS,uu.pickBy=tw,uu.property=uw,uu.propertyOf=sA,uu.pull=LE,uu.pullAll=N$,uu.pullAllBy=jE,uu.pullAllWith=BE,uu.pullAt=FE,uu.range=uA,uu.rangeRight=lA,uu.rearg=rx,uu.reject=H2,uu.remove=qE,uu.rest=nx,uu.reverse=w1,uu.sampleSize=z2,uu.set=lS,uu.setWith=cS,uu.shuffle=G2,uu.slice=UE,uu.sortBy=Y2,uu.sortedUniq=YE,uu.sortedUniqBy=XE,uu.split=IS,uu.spread=ix,uu.tail=JE,uu.take=ZE,uu.takeRight=QE,uu.takeRightWhile=t2,uu.takeWhile=r2,uu.tap=g2,uu.throttle=ax,uu.thru=v_,uu.toArray=X$,uu.toPairs=rw,uu.toPairsIn=nw,uu.toPath=pA,uu.toPlainObject=Z$,uu.transform=fS,uu.unary=ox,uu.union=n2,uu.unionBy=i2,uu.unionWith=a2,uu.uniq=o2,uu.uniqBy=s2,uu.uniqWith=u2,uu.unset=dS,uu.unzip=E1,uu.unzipWith=k$,uu.update=hS,uu.updateWith=pS,uu.values=Pv,uu.valuesIn=mS,uu.without=l2,uu.words=ow,uu.wrap=sx,uu.xor=c2,uu.xorBy=f2,uu.xorWith=d2,uu.zip=h2,uu.zipObject=p2,uu.zipObjectDeep=m2,uu.zipWith=y2,uu.entries=rw,uu.entriesIn=nw,uu.extend=Q$,uu.extendWith=S_,I1(uu,uu),uu.add=yA,uu.attempt=sw,uu.camelCase=_S,uu.capitalize=iw,uu.ceil=gA,uu.clamp=yS,uu.clone=lx,uu.cloneDeep=fx,uu.cloneDeepWith=dx,uu.cloneWith=cx,uu.conformsTo=hx,uu.deburr=aw,uu.defaultTo=YS,uu.divide=vA,uu.endsWith=bS,uu.eq=dy,uu.escape=$S,uu.escapeRegExp=wS,uu.every=T2,uu.find=M2,uu.findIndex=O$,uu.findKey=Wx,uu.findLast=O2,uu.findLastIndex=R$,uu.findLastKey=zx,uu.floor=_A,uu.forEach=L$,uu.forEachRight=j$,uu.forIn=Gx,uu.forInRight=Kx,uu.forOwn=Vx,uu.forOwnRight=Yx,uu.get=P1,uu.gt=px,uu.gte=mx,uu.has=Zx,uu.hasIn=M1,uu.head=I$,uu.identity=Em,uu.includes=D2,uu.indexOf=PE,uu.inRange=gS,uu.invoke=tS,uu.isArguments=hv,uu.isArray=Bp,uu.isArrayBuffer=yx,uu.isArrayLike=$m,uu.isArrayLikeObject=k0,uu.isBoolean=gx,uu.isBuffer=ev,uu.isDate=vx,uu.isElement=_x,uu.isEmpty=bx,uu.isEqual=$x,uu.isEqualWith=wx,uu.isError=A1,uu.isFinite=Ex,uu.isFunction=jy,uu.isInteger=G$,uu.isLength=E_,uu.isMap=K$,uu.isMatch=xx,uu.isMatchWith=Sx,uu.isNaN=Ax,uu.isNative=Tx,uu.isNil=Mx,uu.isNull=Px,uu.isNumber=V$,uu.isObject=M0,uu.isObjectLike=O0,uu.isPlainObject=Gv,uu.isRegExp=T1,uu.isSafeInteger=Ox,uu.isSet=Y$,uu.isString=x_,uu.isSymbol=Rm,uu.isTypedArray=Tv,uu.isUndefined=Rx,uu.isWeakMap=Cx,uu.isWeakSet=Ix,uu.join=NE,uu.kebabCase=ES,uu.last=Vm,uu.lastIndexOf=kE,uu.lowerCase=xS,uu.lowerFirst=SS,uu.lt=Nx,uu.lte=Dx,uu.max=bA,uu.maxBy=$A,uu.mean=wA,uu.meanBy=EA,uu.min=xA,uu.minBy=SA,uu.stubArray=D1,uu.stubFalse=L1,uu.stubObject=cA,uu.stubString=fA,uu.stubTrue=dA,uu.multiply=AA,uu.nth=DE,uu.noConflict=rA,uu.noop=k1,uu.now=b_,uu.pad=AS,uu.padEnd=TS,uu.padStart=PS,uu.parseInt=MS,uu.random=vS,uu.reduce=q2,uu.reduceRight=U2,uu.repeat=OS,uu.replace=RS,uu.result=uS,uu.round=TA,uu.runInContext=il,uu.sample=W2,uu.size=K2,uu.snakeCase=CS,uu.some=V2,uu.sortedIndex=HE,uu.sortedIndexBy=WE,uu.sortedIndexOf=zE,uu.sortedLastIndex=GE,uu.sortedLastIndexBy=KE,uu.sortedLastIndexOf=VE,uu.startCase=NS,uu.startsWith=kS,uu.subtract=PA,uu.sum=MA,uu.sumBy=OA,uu.template=DS,uu.times=hA,uu.toFinite=By,uu.toInteger=qp,uu.toLength=J$,uu.toLower=LS,uu.toNumber=Ym,uu.toSafeInteger=Lx,uu.toString=p0,uu.toUpper=jS,uu.trim=BS,uu.trimEnd=FS,uu.trimStart=qS,uu.truncate=US,uu.unescape=HS,uu.uniqueId=mA,uu.upperCase=zS,uu.upperFirst=O1,uu.each=L$,uu.eachRight=j$,uu.first=I$,I1(uu,function(){var yn={};return Mm(uu,function(va,co){go.call(uu.prototype,co)||(yn[co]=va)}),yn}(),{chain:!1}),uu.VERSION=Do,z0(["bind","bindKey","curry","curryRight","partial","partialRight"],function(yn){uu[yn].placeholder=uu}),z0(["drop","take"],function(yn,va){zp.prototype[yn]=function(co){co=co===yo?1:Ol(qp(co),0);var So=this.__filtered__&&!va?new zp(this):this.clone();return So.__filtered__?So.__takeCount__=jl(co,So.__takeCount__):So.__views__.push({size:jl(co,du),type:yn+(So.__dir__<0?"Right":"")}),So},zp.prototype[yn+"Right"]=function(co){return this.reverse()[yn](co).reverse()}}),z0(["filter","map","takeWhile"],function(yn,va){var co=va+1,So=co==hu||co==ju;zp.prototype[yn]=function(Xo){var mu=this.clone();return mu.__iteratees__.push({iteratee:Pp(Xo,3),type:co}),mu.__filtered__=mu.__filtered__||So,mu}}),z0(["head","last"],function(yn,va){var co="take"+(va?"Right":"");zp.prototype[yn]=function(){return this[co](1).value()[0]}}),z0(["initial","tail"],function(yn,va){var co="drop"+(va?"":"Right");zp.prototype[yn]=function(){return this.__filtered__?new zp(this):this[co](1)}}),zp.prototype.compact=function(){return this.filter(Em)},zp.prototype.find=function(yn){return this.filter(yn).head()},zp.prototype.findLast=function(yn){return this.reverse().find(yn)},zp.prototype.invokeMap=Gp(function(yn,va){return typeof yn=="function"?new zp(this):this.map(function(co){return Fv(co,yn,va)})}),zp.prototype.reject=function(yn){return this.filter(w_(Pp(yn)))},zp.prototype.slice=function(yn,va){yn=qp(yn);var co=this;return co.__filtered__&&(yn>0||va<0)?new zp(co):(yn<0?co=co.takeRight(-yn):yn&&(co=co.drop(yn)),va!==yo&&(va=qp(va),co=va<0?co.dropRight(-va):co.take(va-yn)),co)},zp.prototype.takeRightWhile=function(yn){return this.reverse().takeWhile(yn).reverse()},zp.prototype.toArray=function(){return this.take(du)},Mm(zp.prototype,function(yn,va){var co=/^(?:filter|find|map|reject)|While$/.test(va),So=/^(?:head|last)$/.test(va),Xo=uu[So?"take"+(va=="last"?"Right":""):va],mu=So||/^find/.test(va);Xo&&(uu.prototype[va]=function(){var Du=this.__wrapped__,Ku=So?[1]:arguments,ll=Du instanceof zp,Cl=Ku[0],Il=ll||Bp(Du),Bl=function(Xp){var e0=Xo.apply(uu,jm([Xp],Ku));return So&&sp?e0[0]:e0};Il&&co&&typeof Cl=="function"&&Cl.length!=1&&(ll=Il=!1);var sp=this.__chain__,wp=!!this.__actions__.length,Rp=mu&&!sp,Up=ll&&!wp;if(!mu&&Il){Du=Up?Du:new zp(this);var Cp=yn.apply(Du,Ku);return Cp.__actions__.push({func:v_,args:[Bl],thisArg:yo}),new Z0(Cp,sp)}return Rp&&Up?yn.apply(this,Ku):(Cp=this.thru(Bl),Rp?So?Cp.value()[0]:Cp.value():Cp)})}),z0(["pop","push","shift","sort","splice","unshift"],function(yn){var va=av[yn],co=/^(?:push|sort|unshift)$/.test(yn)?"tap":"thru",So=/^(?:pop|shift)$/.test(yn);uu.prototype[yn]=function(){var Xo=arguments;if(So&&!this.__chain__){var mu=this.value();return va.apply(Bp(mu)?mu:[],Xo)}return this[co](function(Du){return va.apply(Bp(Du)?Du:[],Xo)})}}),Mm(zp.prototype,function(yn,va){var co=uu[va];if(co){var So=co.name+"";go.call(E0,So)||(E0[So]=[]),E0[So].push({name:va,func:co})}}),E0[f_(yo,Ru).name]=[{name:"wrapper",func:yo}],zp.prototype.clone=L_,zp.prototype.reverse=Xy,zp.prototype.value=qm,uu.prototype.at=v2,uu.prototype.chain=_2,uu.prototype.commit=b2,uu.prototype.next=$2,uu.prototype.plant=E2,uu.prototype.reverse=x2,uu.prototype.toJSON=uu.prototype.valueOf=uu.prototype.value=S2,uu.prototype.first=uu.prototype.head,ul&&(uu.prototype[ul]=w2),uu},Yy=k_();im?((im.exports=Yy)._=Yy,Am._=Yy):$0._=Yy}).call(Wr)})(Gr,Gr.exports);var Kr=Object.defineProperty,Yr=Object.defineProperties,hn=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertySymbols,pn=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,ga=(Mo,bo,yo)=>bo in Mo?Kr(Mo,bo,{enumerable:!0,configurable:!0,writable:!0,value:yo}):Mo[bo]=yo,dn=(Mo,bo)=>{for(var yo in bo||(bo={}))pn.call(bo,yo)&&ga(Mo,yo,bo[yo]);if(Qr)for(var yo of Qr(bo))En.call(bo,yo)&&ga(Mo,yo,bo[yo]);return Mo},Pr=(Mo,bo)=>Yr(Mo,hn(bo));function xr(Mo,bo,yo){let Do;const Tu=Mr(Mo);return bo.rpcMap&&(Do=bo.rpcMap[Tu]),Do||(Do=`${Hr}?chainId=eip155:${Tu}&projectId=${yo}`),Do}function Mr(Mo){return Mo.includes("eip155")?Number(Mo.split(":")[1]):Number(Mo)}function Nr(Mo){return Mo.map(bo=>`${bo.split(":")[0]}:${bo.split(":")[1]}`)}function Ur(Mo,bo){const yo=Object.keys(bo.namespaces).filter(Tu=>Tu.includes(Mo));if(!yo.length)return[];const Do=[];return yo.forEach(Tu=>{const wu=bo.namespaces[Tu].accounts;Do.push(...wu)}),Do}function Vr(Mo={},bo={}){const yo=Zr(Mo),Do=Zr(bo);return Gr.exports.merge(yo,Do)}function Zr(Mo){var bo,yo,Do,Tu;const wu={};if(!Wt.isValidObject(Mo))return wu;for(const[$o,mo]of Object.entries(Mo)){const _o=Wt.isCaipNamespace($o)?[$o]:mo.chains,To=mo.methods||[],iu=mo.events||[],nu=mo.rpcMap||{},Jo=Wt.parseNamespaceKey($o);wu[Jo]=Pr(dn(dn({},wu[Jo]),mo),{chains:Wt.mergeArrays(_o,(bo=wu[Jo])==null?void 0:bo.chains),methods:Wt.mergeArrays(To,(yo=wu[Jo])==null?void 0:yo.methods),events:Wt.mergeArrays(iu,(Do=wu[Jo])==null?void 0:Do.events),rpcMap:dn(dn({},nu),(Tu=wu[Jo])==null?void 0:Tu.rpcMap)})}return wu}function Xr(Mo){return Mo.includes(":")?Mo.split(":")[2]:Mo}function Or(Mo){const bo={};for(const[yo,Do]of Object.entries(Mo)){const Tu=Do.methods||[],wu=Do.events||[],$o=Do.accounts||[],mo=Wt.isCaipNamespace(yo)?[yo]:Do.chains?Do.chains:Nr(Do.accounts);bo[yo]={chains:mo,methods:Tu,events:wu,accounts:$o}}return bo}const jr={},Jr=Mo=>jr[Mo],mn=(Mo,bo)=>{jr[Mo]=bo};class gn{constructor(bo){this.name="polkadot",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2])||[]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class eo{constructor(bo){this.name="eip155",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(bo){switch(bo.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(bo);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(bo.request.method)?await this.client.request(bo):this.getHttpProvider().request(bo.request)}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}setDefaultChain(bo,yo){const Do=Mr(bo);if(!this.httpProviders[Do]){const Tu=yo||xr(`${this.name}:${Do}`,this.namespace,this.client.core.projectId);if(!Tu)throw new Error(`No RPC url provided for chainId: ${Do}`);this.setHttpProvider(Do,Tu)}this.chainId=Do,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${Do}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}createHttpProvider(bo,yo){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new Yt.HttpConnection(Do,Jr("disableProviderPing")))}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;const Tu=Mr(yo);bo[Tu]=this.createHttpProvider(Tu,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}getHttpProvider(){const bo=this.chainId,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}async handleSwitchChain(bo){var yo,Do;let Tu=bo.request.params?(yo=bo.request.params[0])==null?void 0:yo.chainId:"0x0";Tu=Tu.startsWith("0x")?Tu:`0x${Tu}`;const wu=parseInt(Tu,16);if(this.isChainApproved(wu))this.setDefaultChain(`${wu}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:bo.topic,request:{method:bo.request.method,params:[{chainId:Tu}]},chainId:(Do=this.namespace.chains)==null?void 0:Do[0]}),this.setDefaultChain(`${wu}`);else throw new Error(`Failed to switch to chain 'eip155:${wu}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(bo){return this.namespace.chains.includes(`${this.name}:${bo}`)}}class _i{constructor(bo){this.name="solana",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class ro{constructor(bo){this.name="cosmos",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class io{constructor(bo){this.name="cip34",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(this.chainId=bo,!this.httpProviders[bo]){const Do=yo||this.getCardanoRPCUrl(bo);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{const Do=this.getCardanoRPCUrl(yo);bo[yo]=this.createHttpProvider(yo,Do)}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}getCardanoRPCUrl(bo){const yo=this.namespace.rpcMap;if(yo)return yo[bo]}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||this.getCardanoRPCUrl(bo);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class ao{constructor(bo){this.name="elrond",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}class oo{constructor(bo){this.name="multiversx",this.namespace=bo.namespace,this.events=Jr("events"),this.client=Jr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(bo){this.namespace=Object.assign(this.namespace,bo)}requestAccounts(){return this.getAccounts()}request(bo){return this.namespace.methods.includes(bo.request.method)?this.client.request(bo):this.getHttpProvider().request(bo.request)}setDefaultChain(bo,yo){if(!this.httpProviders[bo]){const Do=yo||xr(`${this.name}:${bo}`,this.namespace,this.client.core.projectId);if(!Do)throw new Error(`No RPC url provided for chainId: ${bo}`);this.setHttpProvider(bo,Do)}this.chainId=bo,this.events.emit(Br.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const bo=this.namespace.chains[0];if(!bo)throw new Error("ChainId not found");return bo.split(":")[1]}getAccounts(){const bo=this.namespace.accounts;return bo?[...new Set(bo.filter(yo=>yo.split(":")[1]===this.chainId.toString()).map(yo=>yo.split(":")[2]))]:[]}createHttpProviders(){const bo={};return this.namespace.chains.forEach(yo=>{var Do;bo[yo]=this.createHttpProvider(yo,(Do=this.namespace.rpcMap)==null?void 0:Do[yo])}),bo}getHttpProvider(){const bo=`${this.name}:${this.chainId}`,yo=this.httpProviders[bo];if(typeof yo>"u")throw new Error(`JSON-RPC provider for ${bo} not found`);return yo}setHttpProvider(bo,yo){const Do=this.createHttpProvider(bo,yo);Do&&(this.httpProviders[bo]=Do)}createHttpProvider(bo,yo){const Do=yo||xr(bo,this.namespace,this.client.core.projectId);return typeof Do>"u"?void 0:new Xt.JsonRpcProvider(new ur.default(Do,Jr("disableProviderPing")))}}var to=Object.defineProperty,so=Object.defineProperties,lo=Object.getOwnPropertyDescriptors,Ro=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,xo=(Mo,bo,yo)=>bo in Mo?to(Mo,bo,{enumerable:!0,configurable:!0,writable:!0,value:yo}):Mo[bo]=yo,ho=(Mo,bo)=>{for(var yo in bo||(bo={}))Io.call(bo,yo)&&xo(Mo,yo,bo[yo]);if(Ro)for(var yo of Ro(bo))Fo.call(bo,yo)&&xo(Mo,yo,bo[yo]);return Mo},po=(Mo,bo)=>so(Mo,lo(bo));class Ao{constructor(bo){this.events=new cr.default,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=bo,this.logger=typeof(bo==null?void 0:bo.logger)<"u"&&typeof(bo==null?void 0:bo.logger)!="string"?bo.logger:Gt.pino(Gt.getDefaultLoggerOptions({level:(bo==null?void 0:bo.logger)||$r})),this.disableProviderPing=(bo==null?void 0:bo.disableProviderPing)||!1}static async init(bo){const yo=new Ao(bo);return await yo.initialize(),yo}async request(bo,yo){const[Do,Tu]=this.validateChain(yo);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(Do).request({request:ho({},bo),chainId:`${Do}:${Tu}`,topic:this.session.topic})}sendAsync(bo,yo,Do){this.request(bo,Do).then(Tu=>yo(null,Tu)).catch(Tu=>yo(Tu,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var bo;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(bo=this.session)==null?void 0:bo.topic,reason:Wt.getSdkError("USER_DISCONNECTED")}),await this.cleanup()}async connect(bo){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(bo),await this.cleanupPendingPairings(),!bo.skipPairing)return await this.pair(bo.pairingTopic)}on(bo,yo){this.events.on(bo,yo)}once(bo,yo){this.events.once(bo,yo)}removeListener(bo,yo){this.events.removeListener(bo,yo)}off(bo,yo){this.events.off(bo,yo)}get isWalletConnect(){return!0}async pair(bo){this.shouldAbortPairingAttempt=!1;let yo=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(yo>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:Do,approval:Tu}=await this.client.connect({pairingTopic:bo,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});Do&&(this.uri=Do,this.events.emit("display_uri",Do)),await Tu().then(wu=>{this.session=wu,this.namespaces||(this.namespaces=Or(wu.namespaces),this.persist("namespaces",this.namespaces))}).catch(wu=>{if(wu.message!==Bt.PROPOSAL_EXPIRY_MESSAGE)throw wu;yo++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(bo,yo){try{if(!this.session)return;const[Do,Tu]=this.validateChain(bo);this.getProvider(Do).setDefaultChain(Tu,yo)}catch(Do){if(!/Please call connect/.test(Do.message))throw Do}}async cleanupPendingPairings(bo={}){this.logger.info("Cleaning up inactive pairings...");const yo=this.client.pairing.getAll();if(Wt.isValidArray(yo)){for(const Do of yo)bo.deletePairings?this.client.core.expirer.set(Do.topic,0):await this.client.core.relayer.subscriber.unsubscribe(Do.topic);this.logger.info(`Inactive pairings cleared: ${yo.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const bo=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[bo]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Qt.default.init({logger:this.providerOpts.logger||$r,relayUrl:this.providerOpts.relayUrl||Ar,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const bo=[...new Set(Object.keys(this.session.namespaces).map(yo=>Wt.parseNamespaceKey(yo)))];mn("client",this.client),mn("events",this.events),mn("disableProviderPing",this.disableProviderPing),bo.forEach(yo=>{if(!this.session)return;const Do=Ur(yo,this.session),Tu=Nr(Do),wu=Vr(this.namespaces,this.optionalNamespaces),$o=po(ho({},wu[yo]),{accounts:Do,chains:Tu});switch(yo){case"eip155":this.rpcProviders[yo]=new eo({namespace:$o});break;case"solana":this.rpcProviders[yo]=new _i({namespace:$o});break;case"cosmos":this.rpcProviders[yo]=new ro({namespace:$o});break;case"polkadot":this.rpcProviders[yo]=new gn({namespace:$o});break;case"cip34":this.rpcProviders[yo]=new io({namespace:$o});break;case"elrond":this.rpcProviders[yo]=new ao({namespace:$o});break;case"multiversx":this.rpcProviders[yo]=new oo({namespace:$o});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",bo=>{this.events.emit("session_ping",bo)}),this.client.on("session_event",bo=>{const{params:yo}=bo,{event:Do}=yo;if(Do.name==="accountsChanged"){const Tu=Do.data;Tu&&Wt.isValidArray(Tu)&&this.events.emit("accountsChanged",Tu.map(Xr))}else Do.name==="chainChanged"?this.onChainChanged(yo.chainId):this.events.emit(Do.name,Do.data);this.events.emit("session_event",bo)}),this.client.on("session_update",({topic:bo,params:yo})=>{var Do;const{namespaces:Tu}=yo,wu=(Do=this.client)==null?void 0:Do.session.get(bo);this.session=po(ho({},wu),{namespaces:Tu}),this.onSessionUpdate(),this.events.emit("session_update",{topic:bo,params:yo})}),this.client.on("session_delete",async bo=>{await this.cleanup(),this.events.emit("session_delete",bo),this.events.emit("disconnect",po(ho({},Wt.getSdkError("USER_DISCONNECTED")),{data:bo.topic}))}),this.on(Br.DEFAULT_CHAIN_CHANGED,bo=>{this.onChainChanged(bo,!0)})}getProvider(bo){if(!this.rpcProviders[bo])throw new Error(`Provider not found: ${bo}`);return this.rpcProviders[bo]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(bo=>{var yo;this.getProvider(bo).updateNamespace((yo=this.session)==null?void 0:yo.namespaces[bo])})}setNamespaces(bo){const{namespaces:yo,optionalNamespaces:Do,sessionProperties:Tu}=bo;yo&&Object.keys(yo).length&&(this.namespaces=yo),Do&&Object.keys(Do).length&&(this.optionalNamespaces=Do),this.sessionProperties=Tu,this.persist("namespaces",yo),this.persist("optionalNamespaces",Do)}validateChain(bo){const[yo,Do]=(bo==null?void 0:bo.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[yo,Do];if(yo&&!Object.keys(this.namespaces||{}).map($o=>Wt.parseNamespaceKey($o)).includes(yo))throw new Error(`Namespace '${yo}' is not configured. Please call connect() first with namespace config.`);if(yo&&Do)return[yo,Do];const Tu=Wt.parseNamespaceKey(Object.keys(this.namespaces)[0]),wu=this.rpcProviders[Tu].getDefaultChain();return[Tu,wu]}async requestAccounts(){const[bo]=this.validateChain();return await this.getProvider(bo).requestAccounts()}onChainChanged(bo,yo=!1){var Do;if(!this.namespaces)return;const[Tu,wu]=this.validateChain(bo);yo||this.getProvider(Tu).setDefaultChain(wu),((Do=this.namespaces[Tu])!=null?Do:this.namespaces[`${Tu}:${wu}`]).defaultChain=wu,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",wu)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(bo,yo){this.client.core.storage.setItem(`${Fr}/${bo}`,yo)}async getFromStore(bo){return await this.client.core.storage.getItem(`${Fr}/${bo}`)}}const Bo=Ao;return index_cjs.UniversalProvider=Bo,index_cjs.default=Ao,index_cjs}const t$1=Symbol(),s$2=Object.getPrototypeOf,c$3=new WeakMap,l$2=Bt=>Bt&&(c$3.has(Bt)?c$3.get(Bt):s$2(Bt)===Object.prototype||s$2(Bt)===Array.prototype),y$3=Bt=>l$2(Bt)&&Bt[t$1]||null,h$1=(Bt,Wt=!0)=>{c$3.set(Bt,Wt)},isObject$d=Bt=>typeof Bt=="object"&&Bt!==null,proxyStateMap=new WeakMap,refSet=new WeakSet,buildProxyFunction=(Bt=Object.is,Wt=(cr,$r)=>new Proxy(cr,$r),Gt=cr=>isObject$d(cr)&&!refSet.has(cr)&&(Array.isArray(cr)||!(Symbol.iterator in cr))&&!(cr instanceof WeakMap)&&!(cr instanceof WeakSet)&&!(cr instanceof Error)&&!(cr instanceof Number)&&!(cr instanceof Date)&&!(cr instanceof String)&&!(cr instanceof RegExp)&&!(cr instanceof ArrayBuffer),Yt=cr=>{switch(cr.status){case"fulfilled":return cr.value;case"rejected":throw cr.reason;default:throw cr}},Xt=new WeakMap,Jt=(cr,$r,Ar=Yt)=>{const Lr=Xt.get(cr);if((Lr==null?void 0:Lr[0])===$r)return Lr[1];const qr=Array.isArray(cr)?[]:Object.create(Object.getPrototypeOf(cr));return h$1(qr,!0),Xt.set(cr,[$r,qr]),Reflect.ownKeys(cr).forEach(Fr=>{if(Object.getOwnPropertyDescriptor(qr,Fr))return;const Hr=Reflect.get(cr,Fr),Br={value:Hr,enumerable:!0,configurable:!0};if(refSet.has(Hr))h$1(Hr,!1);else if(Hr instanceof Promise)delete Br.value,Br.get=()=>Ar(Hr);else if(proxyStateMap.has(Hr)){const[Wr,Gr]=proxyStateMap.get(Hr);Br.value=Jt(Wr,Gr(),Ar)}Object.defineProperty(qr,Fr,Br)}),qr},Zt=new WeakMap,Qt=[1,1],ur=cr=>{if(!isObject$d(cr))throw new Error("object required");const $r=Zt.get(cr);if($r)return $r;let Ar=Qt[0];const Lr=new Set,qr=(ga,dn=++Qt[0])=>{Ar!==dn&&(Ar=dn,Lr.forEach(Pr=>Pr(ga,dn)))};let Fr=Qt[1];const Hr=(ga=++Qt[1])=>(Fr!==ga&&!Lr.size&&(Fr=ga,Wr.forEach(([dn])=>{const Pr=dn[1](ga);Pr>Ar&&(Ar=Pr)})),Ar),Br=ga=>(dn,Pr)=>{const xr=[...dn];xr[1]=[ga,...xr[1]],qr(xr,Pr)},Wr=new Map,Gr=(ga,dn)=>{if(Lr.size){const Pr=dn[3](Br(ga));Wr.set(ga,[dn,Pr])}else Wr.set(ga,[dn])},Kr=ga=>{var dn;const Pr=Wr.get(ga);Pr&&(Wr.delete(ga),(dn=Pr[1])==null||dn.call(Pr))},Yr=ga=>(Lr.add(ga),Lr.size===1&&Wr.forEach(([Pr,xr],Mr)=>{const Nr=Pr[3](Br(Mr));Wr.set(Mr,[Pr,Nr])}),()=>{Lr.delete(ga),Lr.size===0&&Wr.forEach(([Pr,xr],Mr)=>{xr&&(xr(),Wr.set(Mr,[Pr]))})}),hn=Array.isArray(cr)?[]:Object.create(Object.getPrototypeOf(cr)),pn=Wt(hn,{deleteProperty(ga,dn){const Pr=Reflect.get(ga,dn);Kr(dn);const xr=Reflect.deleteProperty(ga,dn);return xr&&qr(["delete",[dn],Pr]),xr},set(ga,dn,Pr,xr){const Mr=Reflect.has(ga,dn),Nr=Reflect.get(ga,dn,xr);if(Mr&&(Bt(Nr,Pr)||Zt.has(Pr)&&Bt(Nr,Zt.get(Pr))))return!0;Kr(dn),isObject$d(Pr)&&(Pr=y$3(Pr)||Pr);let Ur=Pr;if(Pr instanceof Promise)Pr.then(Vr=>{Pr.status="fulfilled",Pr.value=Vr,qr(["resolve",[dn],Vr])}).catch(Vr=>{Pr.status="rejected",Pr.reason=Vr,qr(["reject",[dn],Vr])});else{!proxyStateMap.has(Pr)&&Gt(Pr)&&(Ur=ur(Pr));const Vr=!refSet.has(Ur)&&proxyStateMap.get(Ur);Vr&&Gr(dn,Vr)}return Reflect.set(ga,dn,Ur,xr),qr(["set",[dn],Pr,Nr]),!0}});Zt.set(cr,pn);const En=[hn,Hr,Jt,Yr];return proxyStateMap.set(pn,En),Reflect.ownKeys(cr).forEach(ga=>{const dn=Object.getOwnPropertyDescriptor(cr,ga);"value"in dn&&(pn[ga]=cr[ga],delete dn.value,delete dn.writable),Object.defineProperty(hn,ga,dn)}),pn})=>[ur,proxyStateMap,refSet,Bt,Wt,Gt,Yt,Xt,Jt,Zt,Qt],[defaultProxyFunction]=buildProxyFunction();function proxy(Bt={}){return defaultProxyFunction(Bt)}function subscribe(Bt,Wt,Gt){const Yt=proxyStateMap.get(Bt);let Xt;const Jt=[],Zt=Yt[3];let Qt=!1;const cr=Zt($r=>{if(Jt.push($r),Gt){Wt(Jt.splice(0));return}Xt||(Xt=Promise.resolve().then(()=>{Xt=void 0,Qt&&Wt(Jt.splice(0))}))});return Qt=!0,()=>{Qt=!1,cr()}}function snapshot(Bt,Wt){const Gt=proxyStateMap.get(Bt),[Yt,Xt,Jt]=Gt;return Jt(Yt,Xt(),Wt)}var bufferExports=requireBuffer();const n$1=proxy({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),N$2={state:n$1,subscribe(Bt){return subscribe(n$1,()=>Bt(n$1))},push(Bt,Wt){Bt!==n$1.view&&(n$1.view=Bt,Wt&&(n$1.data=Wt),n$1.history.push(Bt))},reset(Bt){n$1.view=Bt,n$1.history=[Bt]},replace(Bt){n$1.history.length>1&&(n$1.history[n$1.history.length-1]=Bt,n$1.view=Bt)},goBack(){if(n$1.history.length>1){n$1.history.pop();const[Bt]=n$1.history.slice(-1);n$1.view=Bt}},setData(Bt){n$1.data=Bt}},i$2={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return i$2.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const Bt=navigator.userAgent.toLowerCase();return i$2.isMobile()&&(Bt.includes("iphone")||Bt.includes("ipad"))},isHttpUrl(Bt){return Bt.startsWith("http://")||Bt.startsWith("https://")},isArray(Bt){return Array.isArray(Bt)&&Bt.length>0},formatNativeUrl(Bt,Wt,Gt){if(i$2.isHttpUrl(Bt))return this.formatUniversalUrl(Bt,Wt,Gt);let Yt=Bt;Yt.includes("://")||(Yt=Bt.replaceAll("/","").replaceAll(":",""),Yt=`${Yt}://`),Yt.endsWith("/")||(Yt=`${Yt}/`),this.setWalletConnectDeepLink(Yt,Gt);const Xt=encodeURIComponent(Wt);return`${Yt}wc?uri=${Xt}`},formatUniversalUrl(Bt,Wt,Gt){if(!i$2.isHttpUrl(Bt))return this.formatNativeUrl(Bt,Wt,Gt);let Yt=Bt;Yt.endsWith("/")||(Yt=`${Yt}/`),this.setWalletConnectDeepLink(Yt,Gt);const Xt=encodeURIComponent(Wt);return`${Yt}wc?uri=${Xt}`},async wait(Bt){return new Promise(Wt=>{setTimeout(Wt,Bt)})},openHref(Bt,Wt){window.open(Bt,Wt,"noreferrer noopener")},setWalletConnectDeepLink(Bt,Wt){try{localStorage.setItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:Bt,name:Wt}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(Bt){try{const[Wt]=Bt.split("?");localStorage.setItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:Wt,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(i$2.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(i$2.WCM_VERSION,"2.5.9")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var Bt;const Wt=(Bt=N$2.state.data)==null?void 0:Bt.Wallet;if(!Wt)throw new Error('Missing "Wallet" view data');return Wt}},T=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),r$3=proxy({enabled:T,userSessionId:"",events:[],connectedWalletId:void 0}),$={state:r$3,subscribe(Bt){return subscribe(r$3.events,()=>Bt(snapshot(r$3.events[r$3.events.length-1])))},initialize(){r$3.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(r$3.userSessionId=crypto.randomUUID())},setConnectedWalletId(Bt){r$3.connectedWalletId=Bt},click(Bt){if(r$3.enabled){const Wt={type:"CLICK",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}},track(Bt){if(r$3.enabled){const Wt={type:"TRACK",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}},view(Bt){if(r$3.enabled){const Wt={type:"VIEW",name:Bt.name,userSessionId:r$3.userSessionId,timestamp:Date.now(),data:Bt};r$3.events.push(Wt)}}},l$1=proxy({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),c$2={state:l$1,subscribe(Bt){return subscribe(l$1,()=>Bt(l$1))},setChains(Bt){l$1.chains=Bt},setWalletConnectUri(Bt){l$1.walletConnectUri=Bt},setIsCustomDesktop(Bt){l$1.isCustomDesktop=Bt},setIsCustomMobile(Bt){l$1.isCustomMobile=Bt},setIsDataLoaded(Bt){l$1.isDataLoaded=Bt},setIsUiLoaded(Bt){l$1.isUiLoaded=Bt},setIsAuth(Bt){l$1.isAuth=Bt}},y$2=proxy({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),C={state:y$2,subscribe(Bt){return subscribe(y$2,()=>Bt(y$2))},setConfig(Bt){var Wt,Gt;$.initialize(),c$2.setChains(Bt.chains),c$2.setIsAuth(!!Bt.enableAuthMode),c$2.setIsCustomMobile(!!((Wt=Bt.mobileWallets)!=null&&Wt.length)),c$2.setIsCustomDesktop(!!((Gt=Bt.desktopWallets)!=null&&Gt.length)),i$2.setModalVersionInStorage(),Object.assign(y$2,Bt)}},L$1="https://explorer-api.walletconnect.com";async function W$1(Bt,Wt){const Gt=new URL(Bt,L$1);return Gt.searchParams.append("projectId",C.state.projectId),Object.entries(Wt).forEach(([Yt,Xt])=>{Xt&&Gt.searchParams.append(Yt,String(Xt))}),(await fetch(Gt)).json()}const m$1={async getDesktopListings(Bt){return W$1("/w3m/v1/getDesktopListings",Bt)},async getMobileListings(Bt){return W$1("/w3m/v1/getMobileListings",Bt)},async getInjectedListings(Bt){return W$1("/w3m/v1/getInjectedListings",Bt)},async getAllListings(Bt){return W$1("/w3m/v1/getAllListings",Bt)},getWalletImageUrl(Bt){return`${L$1}/w3m/v1/getWalletImage/${Bt}?projectId=${C.state.projectId}`},getAssetImageUrl(Bt){return`${L$1}/w3m/v1/getAssetImage/${Bt}?projectId=${C.state.projectId}`}};var P$2=Object.defineProperty,O$1=Object.getOwnPropertySymbols,_$1=Object.prototype.hasOwnProperty,R$1=Object.prototype.propertyIsEnumerable,U$1=(Bt,Wt,Gt)=>Wt in Bt?P$2(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt,B$1=(Bt,Wt)=>{for(var Gt in Wt||(Wt={}))_$1.call(Wt,Gt)&&U$1(Bt,Gt,Wt[Gt]);if(O$1)for(var Gt of O$1(Wt))R$1.call(Wt,Gt)&&U$1(Bt,Gt,Wt[Gt]);return Bt};const M$1=i$2.isMobile(),d$2=proxy({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),G$1={state:d$2,async getRecomendedWallets(){const{explorerRecommendedWalletIds:Bt,explorerExcludedWalletIds:Wt}=C.state;if(Bt==="NONE"||Wt==="ALL"&&!Bt)return d$2.recomendedWallets;if(i$2.isArray(Bt)){const Gt={recommendedIds:Bt.join(",")},{listings:Yt}=await m$1.getAllListings(Gt),Xt=Object.values(Yt);Xt.sort((Jt,Zt)=>{const Qt=Bt.indexOf(Jt.id),ur=Bt.indexOf(Zt.id);return Qt-ur}),d$2.recomendedWallets=Xt}else{const{chains:Gt,isAuth:Yt}=c$2.state,Xt=Gt==null?void 0:Gt.join(","),Jt=i$2.isArray(Wt),Zt={page:1,sdks:Yt?"auth_v1":void 0,entries:i$2.RECOMMENDED_WALLET_AMOUNT,chains:Xt,version:2,excludedIds:Jt?Wt.join(","):void 0},{listings:Qt}=M$1?await m$1.getMobileListings(Zt):await m$1.getDesktopListings(Zt);d$2.recomendedWallets=Object.values(Qt)}return d$2.recomendedWallets},async getWallets(Bt){const Wt=B$1({},Bt),{explorerRecommendedWalletIds:Gt,explorerExcludedWalletIds:Yt}=C.state,{recomendedWallets:Xt}=d$2;if(Yt==="ALL")return d$2.wallets;Xt.length?Wt.excludedIds=Xt.map(Ar=>Ar.id).join(","):i$2.isArray(Gt)&&(Wt.excludedIds=Gt.join(",")),i$2.isArray(Yt)&&(Wt.excludedIds=[Wt.excludedIds,Yt].filter(Boolean).join(",")),c$2.state.isAuth&&(Wt.sdks="auth_v1");const{page:Jt,search:Zt}=Bt,{listings:Qt,total:ur}=M$1?await m$1.getMobileListings(Wt):await m$1.getDesktopListings(Wt),cr=Object.values(Qt),$r=Zt?"search":"wallets";return d$2[$r]={listings:[...d$2[$r].listings,...cr],total:ur,page:Jt??1},{listings:cr,total:ur}},getWalletImageUrl(Bt){return m$1.getWalletImageUrl(Bt)},getAssetImageUrl(Bt){return m$1.getAssetImageUrl(Bt)},resetSearch(){d$2.search={listings:[],total:0,page:1}}},I$1=proxy({open:!1}),Q$1={state:I$1,subscribe(Bt){return subscribe(I$1,()=>Bt(I$1))},async open(Bt){return new Promise(Wt=>{const{isUiLoaded:Gt,isDataLoaded:Yt}=c$2.state;if(c$2.setWalletConnectUri(Bt==null?void 0:Bt.uri),c$2.setChains(Bt==null?void 0:Bt.chains),N$2.reset("ConnectWallet"),Gt&&Yt)I$1.open=!0,Wt();else{const Xt=setInterval(()=>{const Jt=c$2.state;Jt.isUiLoaded&&Jt.isDataLoaded&&(clearInterval(Xt),I$1.open=!0,Wt())},200)}})},close(){I$1.open=!1}};var H$1=Object.defineProperty,D$1=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,j$1=(Bt,Wt,Gt)=>Wt in Bt?H$1(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt,z$2=(Bt,Wt)=>{for(var Gt in Wt||(Wt={}))V.call(Wt,Gt)&&j$1(Bt,Gt,Wt[Gt]);if(D$1)for(var Gt of D$1(Wt))K.call(Wt,Gt)&&j$1(Bt,Gt,Wt[Gt]);return Bt};function J(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const b$1=proxy({themeMode:J()?"dark":"light"}),X$1={state:b$1,subscribe(Bt){return subscribe(b$1,()=>Bt(b$1))},setThemeConfig(Bt){const{themeMode:Wt,themeVariables:Gt}=Bt;Wt&&(b$1.themeMode=Wt),Gt&&(b$1.themeVariables=z$2({},Gt))}},g$1=proxy({open:!1,message:"",variant:"success"}),Y={state:g$1,subscribe(Bt){return subscribe(g$1,()=>Bt(g$1))},openToast(Bt,Wt){g$1.open=!0,g$1.message=Bt,g$1.variant=Wt},closeToast(){g$1.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=bufferExports.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window));let d$1=class{constructor(Wt){this.openModal=Q$1.open,this.closeModal=Q$1.close,this.subscribeModal=Q$1.subscribe,this.setTheme=X$1.setThemeConfig,X$1.setThemeConfig(Wt),C.setConfig(Wt),this.initUi()}async initUi(){if(typeof window<"u"){await __vitePreload(()=>import("./index-8fbe23b2.js"),[]);const Wt=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",Wt),c$2.setIsUiLoaded(!0)}}};const dist$f=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:d$1},Symbol.toStringTag,{value:"Module"})),require$$3$1=getAugmentedNamespace(dist$f);var hasRequiredIndex_cjs;function requireIndex_cjs(){if(hasRequiredIndex_cjs)return index_cjs$1;hasRequiredIndex_cjs=1,Object.defineProperty(index_cjs$1,"__esModule",{value:!0});var Bt=eventsExports,Wt=require$$1$7,Gt=requireIndex_cjs$1();function Yt(dn){if(dn&&dn.__esModule)return dn;var Pr=Object.create(null);return dn&&Object.keys(dn).forEach(function(xr){if(xr!=="default"){var Mr=Object.getOwnPropertyDescriptor(dn,xr);Object.defineProperty(Pr,xr,Mr.get?Mr:{enumerable:!0,get:function(){return dn[xr]}})}}),Pr.default=dn,Object.freeze(Pr)}const Xt="wc",Jt="ethereum_provider",Zt=`${Xt}@2:${Jt}:`,Qt="https://rpc.walletconnect.com/v1/",ur=["eth_sendTransaction","personal_sign"],cr=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],$r=["chainChanged","accountsChanged"],Ar=["message","disconnect","connect"];var Lr=Object.defineProperty,qr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,Br=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Gr=(dn,Pr,xr)=>Pr in dn?Lr(dn,Pr,{enumerable:!0,configurable:!0,writable:!0,value:xr}):dn[Pr]=xr,Kr=(dn,Pr)=>{for(var xr in Pr||(Pr={}))Br.call(Pr,xr)&&Gr(dn,xr,Pr[xr]);if(Hr)for(var xr of Hr(Pr))Wr.call(Pr,xr)&&Gr(dn,xr,Pr[xr]);return dn},Yr=(dn,Pr)=>qr(dn,Fr(Pr));function hn(dn){return Number(dn[0].split(":")[1])}function Qr(dn){return`0x${dn.toString(16)}`}function pn(dn){const{chains:Pr,optionalChains:xr,methods:Mr,optionalMethods:Nr,events:Ur,optionalEvents:Vr,rpcMap:Zr}=dn;if(!Wt.isValidArray(Pr))throw new Error("Invalid chains");const Xr={chains:Pr,methods:Mr||ur,events:Ur||$r,rpcMap:Kr({},Pr.length?{[hn(Pr)]:Zr[hn(Pr)]}:{})},Or=Ur==null?void 0:Ur.filter(gn=>!$r.includes(gn)),jr=Mr==null?void 0:Mr.filter(gn=>!ur.includes(gn));if(!xr&&!Vr&&!Nr&&!(Or!=null&&Or.length)&&!(jr!=null&&jr.length))return{required:Pr.length?Xr:void 0};const Jr=(Or==null?void 0:Or.length)&&(jr==null?void 0:jr.length)||!xr,mn={chains:[...new Set(Jr?Xr.chains.concat(xr||[]):xr)],methods:[...new Set(Xr.methods.concat(Nr!=null&&Nr.length?Nr:cr))],events:[...new Set(Xr.events.concat(Vr||Ar))],rpcMap:Zr};return{required:Pr.length?Xr:void 0,optional:xr.length?mn:void 0}}class En{constructor(){this.events=new Bt.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Zt,this.on=(Pr,xr)=>(this.events.on(Pr,xr),this),this.once=(Pr,xr)=>(this.events.once(Pr,xr),this),this.removeListener=(Pr,xr)=>(this.events.removeListener(Pr,xr),this),this.off=(Pr,xr)=>(this.events.off(Pr,xr),this),this.parseAccount=Pr=>this.isCompatibleChainId(Pr)?this.parseAccountId(Pr).address:Pr,this.signer={},this.rpc={}}static async init(Pr){const xr=new En;return await xr.initialize(Pr),xr}async request(Pr){return await this.signer.request(Pr,this.formatChainId(this.chainId))}sendAsync(Pr,xr){this.signer.sendAsync(Pr,xr,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(Pr){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(Pr);const{required:xr,optional:Mr}=pn(this.rpc);try{const Nr=await new Promise(async(Vr,Zr)=>{var Xr;this.rpc.showQrModal&&((Xr=this.modal)==null||Xr.subscribeModal(Or=>{!Or.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),Zr(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Yr(Kr({namespaces:Kr({},xr&&{[this.namespace]:xr})},Mr&&{optionalNamespaces:{[this.namespace]:Mr}}),{pairingTopic:Pr==null?void 0:Pr.pairingTopic})).then(Or=>{Vr(Or)}).catch(Or=>{Zr(new Error(Or.message))})});if(!Nr)return;this.setChainIds(this.rpc.chains);const Ur=Wt.getAccountsFromNamespaces(Nr.namespaces,[this.namespace]);this.setAccounts(Ur),this.events.emit("connect",{chainId:Qr(this.chainId)})}catch(Nr){throw this.signer.logger.error(Nr),Nr}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",Pr=>{const{params:xr}=Pr,{event:Mr}=xr;Mr.name==="accountsChanged"?(this.accounts=this.parseAccounts(Mr.data),this.events.emit("accountsChanged",this.accounts)):Mr.name==="chainChanged"?this.setChainId(this.formatChainId(Mr.data)):this.events.emit(Mr.name,Mr.data),this.events.emit("session_event",Pr)}),this.signer.on("chainChanged",Pr=>{const xr=parseInt(Pr);this.chainId=xr,this.events.emit("chainChanged",Qr(this.chainId)),this.persist()}),this.signer.on("session_update",Pr=>{this.events.emit("session_update",Pr)}),this.signer.on("session_delete",Pr=>{this.reset(),this.events.emit("session_delete",Pr),this.events.emit("disconnect",Yr(Kr({},Wt.getSdkError("USER_DISCONNECTED")),{data:Pr.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",Pr=>{var xr,Mr;this.rpc.showQrModal&&((xr=this.modal)==null||xr.closeModal(),(Mr=this.modal)==null||Mr.openModal({uri:Pr})),this.events.emit("display_uri",Pr)})}switchEthereumChain(Pr){this.request({method:"wallet_switchEthereumChain",params:[{chainId:Pr.toString(16)}]})}isCompatibleChainId(Pr){return typeof Pr=="string"?Pr.startsWith(`${this.namespace}:`):!1}formatChainId(Pr){return`${this.namespace}:${Pr}`}parseChainId(Pr){return Number(Pr.split(":")[1])}setChainIds(Pr){const xr=Pr.filter(Mr=>this.isCompatibleChainId(Mr)).map(Mr=>this.parseChainId(Mr));xr.length&&(this.chainId=xr[0],this.events.emit("chainChanged",Qr(this.chainId)),this.persist())}setChainId(Pr){if(this.isCompatibleChainId(Pr)){const xr=this.parseChainId(Pr);this.chainId=xr,this.switchEthereumChain(xr)}}parseAccountId(Pr){const[xr,Mr,Nr]=Pr.split(":");return{chainId:`${xr}:${Mr}`,address:Nr}}setAccounts(Pr){this.accounts=Pr.filter(xr=>this.parseChainId(this.parseAccountId(xr).chainId)===this.chainId).map(xr=>this.parseAccountId(xr).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(Pr){var xr,Mr;const Nr=(xr=Pr==null?void 0:Pr.chains)!=null?xr:[],Ur=(Mr=Pr==null?void 0:Pr.optionalChains)!=null?Mr:[],Vr=Nr.concat(Ur);if(!Vr.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const Zr=Nr.length?(Pr==null?void 0:Pr.methods)||ur:[],Xr=Nr.length?(Pr==null?void 0:Pr.events)||$r:[],Or=(Pr==null?void 0:Pr.optionalMethods)||[],jr=(Pr==null?void 0:Pr.optionalEvents)||[],Jr=(Pr==null?void 0:Pr.rpcMap)||this.buildRpcMap(Vr,Pr.projectId),mn=(Pr==null?void 0:Pr.qrModalOptions)||void 0;return{chains:Nr==null?void 0:Nr.map(gn=>this.formatChainId(gn)),optionalChains:Ur.map(gn=>this.formatChainId(gn)),methods:Zr,events:Xr,optionalMethods:Or,optionalEvents:jr,rpcMap:Jr,showQrModal:!!(Pr!=null&&Pr.showQrModal),qrModalOptions:mn,projectId:Pr.projectId,metadata:Pr.metadata}}buildRpcMap(Pr,xr){const Mr={};return Pr.forEach(Nr=>{Mr[Nr]=this.getRpcUrl(Nr,xr)}),Mr}async initialize(Pr){if(this.rpc=this.getRpcConfig(Pr),this.chainId=this.rpc.chains.length?hn(this.rpc.chains):hn(this.rpc.optionalChains),this.signer=await Gt.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:Pr.disableProviderPing,relayUrl:Pr.relayUrl,storageOptions:Pr.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let xr;try{const{WalletConnectModal:Mr}=await Promise.resolve().then(function(){return Yt(require$$3$1)});xr=Mr}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(xr)try{this.modal=new xr(Kr({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(Mr){throw this.signer.logger.error(Mr),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(Pr){if(!Pr)return;const{chains:xr,optionalChains:Mr,rpcMap:Nr}=Pr;xr&&Wt.isValidArray(xr)&&(this.rpc.chains=xr.map(Ur=>this.formatChainId(Ur)),xr.forEach(Ur=>{this.rpc.rpcMap[Ur]=(Nr==null?void 0:Nr[Ur])||this.getRpcUrl(Ur)})),Mr&&Wt.isValidArray(Mr)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=Mr==null?void 0:Mr.map(Ur=>this.formatChainId(Ur)),Mr.forEach(Ur=>{this.rpc.rpcMap[Ur]=(Nr==null?void 0:Nr[Ur])||this.getRpcUrl(Ur)}))}getRpcUrl(Pr,xr){var Mr;return((Mr=this.rpc.rpcMap)==null?void 0:Mr[Pr])||`${Qt}?chainId=eip155:${Pr}&projectId=${xr||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const Pr=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),xr=this.session.namespaces[`${this.namespace}:${Pr}`]?this.session.namespaces[`${this.namespace}:${Pr}`]:this.session.namespaces[this.namespace];this.setChainIds(Pr?[this.formatChainId(Pr)]:xr==null?void 0:xr.accounts),this.setAccounts(xr==null?void 0:xr.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(Pr){return typeof Pr=="string"||Pr instanceof String?[this.parseAccount(Pr)]:Pr.map(xr=>this.parseAccount(xr))}}const ga=En;return index_cjs$1.EthereumProvider=ga,index_cjs$1.OPTIONAL_EVENTS=Ar,index_cjs$1.OPTIONAL_METHODS=cr,index_cjs$1.REQUIRED_EVENTS=$r,index_cjs$1.REQUIRED_METHODS=ur,index_cjs$1.default=En,index_cjs$1}var __createBinding$Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Object.defineProperty(Bt,Yt,{enumerable:!0,get:function(){return Wt[Gt]}})}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$Z=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$Z=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$Z(Wt,Bt,Gt);return __setModuleDefault$Z(Wt,Bt),Wt},__awaiter$D=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(WalletConnectV2Connector$1,"__esModule",{value:!0});WalletConnectV2Connector$1.WalletConnectV2Connector=void 0;const AbstractConnector_1=AbstractConnector$1,schemas_1$3=dist$m,configuration_1$1=configuration$1;class WalletConnectV2Connector extends AbstractConnector_1.AbstractConnector{constructor(Wt){super({supportedChainIds:(()=>{const{chains:Gt,optionalChains:Yt}=WalletConnectV2Connector.configuration.chains[Wt];return[...Gt,...Yt]})()}),this.desiredChainId=Wt,this.activate=()=>__awaiter$D(this,void 0,void 0,function*(){const Gt=yield Promise.resolve().then(()=>__importStar$Z(requireIndex_cjs())).then(Xt=>{const{chains:Jt,optionalChains:Zt}=WalletConnectV2Connector.configuration.chains[this.desiredChainId];return Xt.default.init({projectId:WalletConnectV2Connector.configuration.projectId,rpcMap:WalletConnectV2Connector.configuration.urls,chains:Jt,optionalChains:Zt,showQrModal:!0,disableProviderPing:!0,qrModalOptions:{themeVariables:{"--wcm-z-index":"3000"}},methods:["eth_sendTransaction","personal_sign"],optionalMethods:["eth_accounts","eth_requestAccounts","eth_sign","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain"],events:["chainChanged","accountsChanged"],optionalEvents:["disconnect"]})}),Yt=yield Gt.enable();return Gt.on("accountsChanged",this.handleAccountsChanged),Gt.on("chainChanged",this.handleChainChanged),Gt.on("disconnect",this.handleDisconnect),this.provider=Gt,{chainId:Gt.chainId,account:Yt[0],provider:Gt}}),this.getProvider=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider}),this.getChainId=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider.chainId}),this.getAccount=()=>__awaiter$D(this,void 0,void 0,function*(){if(!this.provider)throw new Error("Provider is undefined");return this.provider.accounts[0]}),this.getWalletName=()=>{var Gt,Yt;return(Yt=(Gt=this.provider)===null||Gt===void 0?void 0:Gt.session)===null||Yt===void 0?void 0:Yt.peer.metadata.name},this.deactivate=()=>{this.provider&&(this.emitDeactivate(),this.provider.removeListener("accountsChanged",this.handleAccountsChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("disconnect",this.handleDisconnect).disconnect())},this.handleAccountsChanged=Gt=>{this.emitUpdate({account:Gt[0]})},this.handleChainChanged=Gt=>{this.emitUpdate({chainId:Gt})},this.handleDisconnect=()=>{if(!this.provider)throw new Error("Provider is undefined");this.deactivate()}}}WalletConnectV2Connector$1.WalletConnectV2Connector=WalletConnectV2Connector;WalletConnectV2Connector.configuration=configuration_1$1.getConfiguration()[schemas_1$3.ProviderType.WALLET_CONNECT_V2];WalletConnectV2Connector.clearStorage=Bt=>{Bt.removeRegExp(new RegExp("^wc@2:"))};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(AbstractConnector$1,Bt),Gt(FortmaticConnector$1,Bt),Gt(InjectedConnector$2,Bt),Gt(NetworkConnector$2,Bt),Gt(WalletConnectConnector$1,Bt),Gt(WalletLinkConnector$2,Bt),Gt(WalletConnectV2Connector$1,Bt)})(connectors);var storage$1={},Storage$1={};Object.defineProperty(Storage$1,"__esModule",{value:!0});Storage$1.Storage=void 0;class Storage{}Storage$1.Storage=Storage;var LocalStorage$1={};Object.defineProperty(LocalStorage$1,"__esModule",{value:!0});LocalStorage$1.LocalStorage=void 0;const Storage_1=Storage$1;class LocalStorage extends Storage_1.Storage{get(Wt){const Gt=window.localStorage.getItem(Wt);return Gt===null?void 0:Gt}set(Wt,Gt){window.localStorage.setItem(Wt,Gt)}remove(Wt){window.localStorage.removeItem(Wt)}removeRegExp(Wt){for(let Gt=localStorage.length-1;Gt>=0;Gt--){const Yt=localStorage.key(Gt);Yt&&Wt.test(Yt)&&localStorage.removeItem(Yt)}}}LocalStorage$1.LocalStorage=LocalStorage;(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(Storage$1,Bt),Gt(LocalStorage$1,Bt)})(storage$1);var ProviderAdapter$1={},__awaiter$C=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(ProviderAdapter$1,"__esModule",{value:!0});ProviderAdapter$1.ProviderAdapter=void 0;class ProviderAdapter{constructor(Wt){this.provider=Wt,this.id=0,this.on=(Gt,Yt)=>this.provider.on(Gt,Yt),this.emit=(Gt,...Yt)=>this.provider.emit(Gt,Yt),this.removeListener=(Gt,Yt)=>this.provider.removeListener(Gt,Yt),this.request=({method:Gt,params:Yt})=>__awaiter$C(this,void 0,void 0,function*(){return this.isModernProvider()?this.provider.request({method:Gt,params:Yt}):this.send(Gt,Yt)}),this.sendAsync=(Gt,Yt)=>__awaiter$C(this,void 0,void 0,function*(){return this.hasSendAsync()?this.provider.sendAsync(Gt,(Xt,Jt)=>{Jt&&!Jt.hasOwnProperty("result")?Yt(Xt,{id:0,jsonrpc:"2.0",result:Jt}):Yt(Xt,Jt)}):this.send(Gt,Yt)})}static adapt(Wt){const Gt=new ProviderAdapter(Wt);return Object.assign(Object.assign({},Wt),{on:Gt.on,emit:Gt.emit,removeListener:Gt.removeListener,request:Gt.request,sendAsync:Gt.sendAsync,send:Gt.send.bind(Gt)})}send(Wt,Gt){return __awaiter$C(this,void 0,void 0,function*(){let Yt,Xt,Jt;const Zt=typeof Gt=="function";if(Zt){const Qt=Wt;Xt=Qt.params||[],Yt=Qt.method,Jt=Gt}else Yt=Wt,Xt=Gt||[],Jt=(Qt,ur)=>{if(Qt)throw Qt;return ur};if(this.isModernProvider()){const[Qt,ur]=yield this.provider.request({method:Yt,params:Xt}).then($r=>[null,$r]).catch($r=>[$r,void 0]);return Jt(Qt,Zt?{id:"",jsonrpc:"2.0",result:ur}:ur)}else{this.patchOldMobile();const[Qt,ur]=Zt?yield new Promise(cr=>this.provider.send(Wt,($r,Ar)=>{cr([$r,Ar])})):yield new Promise(cr=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:Yt,params:Xt},($r,Ar)=>{cr([Ar&&Ar.hasOwnProperty("error")?Ar.error:$r,Ar&&Ar.hasOwnProperty("result")?Ar.result:Ar])}));return Jt(Qt,ur)}})}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}ProviderAdapter$1.ProviderAdapter=ProviderAdapter;var __awaiter$B=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(ConnectionManager$1,"__esModule",{value:!0});ConnectionManager$1.connection=ConnectionManager$1.ConnectionManager=void 0;const chain_id_1$5=requireChainId$4(),provider_type_1$2=providerType$4,connectors_1=connectors,storage_1=storage$1,configuration_1=configuration$1,ProviderAdapter_1=ProviderAdapter$1,DEACTIVATE_EVENT_NAME="Web3ReactDeactivate";class ConnectionManager{constructor(Wt){this.storage=Wt,this.getWalletName=()=>{if(this.connector instanceof connectors_1.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:Gt}=configuration_1.getConfiguration();this.storage.remove(Gt),connectors_1.WalletConnectConnector.clearStorage(this.storage),connectors_1.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&this.connector.removeListener(DEACTIVATE_EVENT_NAME,this.handleWeb3ReactDeactivate),this.disconnect().catch(console.error)}}connect(Wt,Gt=chain_id_1$5.ChainId.ETHEREUM_MAINNET){return __awaiter$B(this,void 0,void 0,function*(){this.connector=this.buildConnector(Wt,Gt),this.connector.on(DEACTIVATE_EVENT_NAME,this.handleWeb3ReactDeactivate);const{provider:Yt,account:Xt}=yield this.connector.activate();return this.setConnectionData(Wt,Gt),{provider:ProviderAdapter_1.ProviderAdapter.adapt(Yt),providerType:Wt,account:Xt||"",chainId:Gt}})}tryPreviousConnection(){return __awaiter$B(this,void 0,void 0,function*(){const Wt=this.getConnectionData();if(!Wt)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const Gt=yield this.connect(Wt.providerType,Wt.chainId);if(Gt.providerType===provider_type_1$2.ProviderType.INJECTED){const Yt=yield Gt.provider.request({method:"eth_chainId"}),Xt=Yt?parseInt(Yt,16):null;Xt&&Wt.chainId!==Xt&&this.setConnectionData(Wt.providerType,Xt)}return Object.assign(Object.assign({},Gt),{chainId:this.getConnectionData().chainId})})}getAvailableProviders(){const Wt=[provider_type_1$2.ProviderType.FORTMATIC,provider_type_1$2.ProviderType.WALLET_CONNECT,provider_type_1$2.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?Wt.unshift(provider_type_1$2.ProviderType.INJECTED):Wt.unshift(provider_type_1$2.ProviderType.METAMASK_MOBILE),Wt}disconnect(){return __awaiter$B(this,void 0,void 0,function*(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&(yield this.connector.close())),this.clearConnectionData(),this.connector=void 0})}getProvider(){return __awaiter$B(this,void 0,void 0,function*(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()})}createProvider(Wt,Gt=chain_id_1$5.ChainId.ETHEREUM_MAINNET){return __awaiter$B(this,void 0,void 0,function*(){const Xt=yield this.buildConnector(Wt,Gt).getProvider();return ProviderAdapter_1.ProviderAdapter.adapt(Xt)})}buildConnector(Wt,Gt){switch(Wt){case provider_type_1$2.ProviderType.INJECTED:return new connectors_1.InjectedConnector(Gt);case provider_type_1$2.ProviderType.FORTMATIC:return new connectors_1.FortmaticConnector(Gt);case provider_type_1$2.ProviderType.WALLET_CONNECT:return new connectors_1.WalletConnectConnector(Gt);case provider_type_1$2.ProviderType.WALLET_LINK:return new connectors_1.WalletLinkConnector(Gt);case provider_type_1$2.ProviderType.NETWORK:return new connectors_1.NetworkConnector(Gt);case provider_type_1$2.ProviderType.WALLET_CONNECT_V2:return new connectors_1.WalletConnectV2Connector(Gt);default:throw new Error(`Invalid provider ${Wt}`)}}getConnectionData(){const{storageKey:Wt}=configuration_1.getConfiguration(),Gt=this.storage.get(Wt);return Gt?JSON.parse(Gt):void 0}setConnectionData(Wt,Gt){const{storageKey:Yt}=configuration_1.getConfiguration(),Xt=JSON.stringify({providerType:Wt,chainId:Gt});this.storage.set(Yt,Xt)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}ConnectionManager$1.ConnectionManager=ConnectionManager;ConnectionManager$1.connection=new ConnectionManager(new storage_1.LocalStorage);var types$6={};Object.defineProperty(types$6,"__esModule",{value:!0});(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Object.defineProperty(Yt,Zt,{enumerable:!0,get:function(){return Xt[Jt]}})}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(ConnectionManager$1,Bt),Gt(connectors,Bt),Gt(types$6,Bt)})(dist$n);var chainId$3={},chainName$3={},hasRequiredChainName$3;function requireChainName$3(){return hasRequiredChainName$3||(hasRequiredChainName$3=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getChainId=Bt.ChainName=void 0;const Wt=validation$6,Gt=requireChainId$3();var Yt;(function(Jt){Jt.ETHEREUM_MAINNET="Ethereum Mainnet",Jt.ETHEREUM_ROPSTEN="Ropsten",Jt.ETHEREUM_RINKEBY="Rinkeby",Jt.ETHEREUM_GOERLI="Goerli",Jt.ETHEREUM_KOVAN="Kovan",Jt.ETHEREUM_SEPOLIA="Sepolia",Jt.MATIC_MAINNET="Polygon",Jt.MATIC_MUMBAI="Mumbai"})(Yt=Bt.ChainName||(Bt.ChainName={}));function Xt(Jt){switch(Jt){case Yt.ETHEREUM_MAINNET:return Gt.ChainId.ETHEREUM_MAINNET;case Yt.ETHEREUM_ROPSTEN:return Gt.ChainId.ETHEREUM_ROPSTEN;case Yt.ETHEREUM_RINKEBY:return Gt.ChainId.ETHEREUM_RINKEBY;case Yt.ETHEREUM_GOERLI:return Gt.ChainId.ETHEREUM_GOERLI;case Yt.ETHEREUM_KOVAN:return Gt.ChainId.ETHEREUM_KOVAN;case Yt.ETHEREUM_SEPOLIA:return Gt.ChainId.ETHEREUM_SEPOLIA;case Yt.MATIC_MAINNET:return Gt.ChainId.MATIC_MAINNET;case Yt.MATIC_MUMBAI:return Gt.ChainId.MATIC_MUMBAI;default:return null}}Bt.getChainId=Xt,function(Jt){Jt.schema={type:"string",enum:Object.values(Jt)},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Yt=Bt.ChainName||(Bt.ChainName={}))}(chainName$3)),chainName$3}var hasRequiredChainId$3;function requireChainId$3(){return hasRequiredChainId$3||(hasRequiredChainId$3=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getNetwork=Bt.getNetworkMapping=Bt.getURNProtocol=Bt.getChainName=Bt.ChainId=void 0;const Wt=validation$6,Gt=requireChainName$3(),Yt=network$5;var Xt;(function(cr){cr[cr.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",cr[cr.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",cr[cr.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",cr[cr.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",cr[cr.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",cr[cr.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",cr[cr.MATIC_MAINNET=137]="MATIC_MAINNET",cr[cr.MATIC_MUMBAI=80001]="MATIC_MUMBAI"})(Xt=Bt.ChainId||(Bt.ChainId={}));function Jt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return Gt.ChainName.ETHEREUM_MAINNET;case Xt.ETHEREUM_ROPSTEN:return Gt.ChainName.ETHEREUM_ROPSTEN;case Xt.ETHEREUM_RINKEBY:return Gt.ChainName.ETHEREUM_RINKEBY;case Xt.ETHEREUM_GOERLI:return Gt.ChainName.ETHEREUM_GOERLI;case Xt.ETHEREUM_KOVAN:return Gt.ChainName.ETHEREUM_KOVAN;case Xt.ETHEREUM_SEPOLIA:return Gt.ChainName.ETHEREUM_SEPOLIA;case Xt.MATIC_MAINNET:return Gt.ChainName.MATIC_MAINNET;case Xt.MATIC_MUMBAI:return Gt.ChainName.MATIC_MUMBAI;default:return null}}Bt.getChainName=Jt;function Zt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return"mainnet";case Xt.ETHEREUM_ROPSTEN:return"ropsten";case Xt.ETHEREUM_RINKEBY:return"rinkeby";case Xt.ETHEREUM_GOERLI:return"goerli";case Xt.ETHEREUM_KOVAN:return"kovan";case Xt.ETHEREUM_SEPOLIA:return"sepolia";case Xt.MATIC_MAINNET:return"matic";case Xt.MATIC_MUMBAI:return"mumbai"}}Bt.getURNProtocol=Zt;function Qt(cr){switch(cr){case Xt.ETHEREUM_MAINNET:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_MAINNET,[Yt.Network.MATIC]:Xt.MATIC_MAINNET};case Xt.ETHEREUM_ROPSTEN:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_ROPSTEN,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_RINKEBY:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_RINKEBY,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_GOERLI:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_GOERLI,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_KOVAN:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_KOVAN,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.ETHEREUM_SEPOLIA:return{[Yt.Network.ETHEREUM]:Xt.ETHEREUM_SEPOLIA,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI};case Xt.MATIC_MAINNET:return{[Yt.Network.ETHEREUM]:Xt.MATIC_MAINNET,[Yt.Network.MATIC]:Xt.MATIC_MAINNET};case Xt.MATIC_MUMBAI:return{[Yt.Network.ETHEREUM]:Xt.MATIC_MUMBAI,[Yt.Network.MATIC]:Xt.MATIC_MUMBAI}}}Bt.getNetworkMapping=Qt;function ur(cr){switch(cr){case Xt.ETHEREUM_MAINNET:case Xt.ETHEREUM_ROPSTEN:case Xt.ETHEREUM_GOERLI:case Xt.ETHEREUM_KOVAN:case Xt.ETHEREUM_RINKEBY:case Xt.ETHEREUM_SEPOLIA:return Yt.Network.ETHEREUM;case Xt.MATIC_MAINNET:case Xt.MATIC_MUMBAI:return Yt.Network.MATIC}}Bt.getNetwork=ur,function(cr){cr.schema={type:"number",enum:Object.values(cr)},cr.validate=(0,Wt.generateLazyValidator)(cr.schema)}(Xt=Bt.ChainId||(Bt.ChainId={}))}(chainId$3)),chainId$3}const version$v="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const Bt=[];if(["NFD","NFC","NFKD","NFKC"].forEach(Wt=>{try{if("test".normalize(Wt)!=="test")throw new Error("bad normalize")}catch{Bt.push(Wt)}}),Bt.length)throw new Error("missing "+Bt.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(Bt){return Bt.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(Bt){Bt.DEBUG="DEBUG",Bt.INFO="INFO",Bt.WARNING="WARNING",Bt.ERROR="ERROR",Bt.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(Bt){Bt.UNKNOWN_ERROR="UNKNOWN_ERROR",Bt.NOT_IMPLEMENTED="NOT_IMPLEMENTED",Bt.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",Bt.NETWORK_ERROR="NETWORK_ERROR",Bt.SERVER_ERROR="SERVER_ERROR",Bt.TIMEOUT="TIMEOUT",Bt.BUFFER_OVERRUN="BUFFER_OVERRUN",Bt.NUMERIC_FAULT="NUMERIC_FAULT",Bt.MISSING_NEW="MISSING_NEW",Bt.INVALID_ARGUMENT="INVALID_ARGUMENT",Bt.MISSING_ARGUMENT="MISSING_ARGUMENT",Bt.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",Bt.CALL_EXCEPTION="CALL_EXCEPTION",Bt.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",Bt.NONCE_EXPIRED="NONCE_EXPIRED",Bt.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",Bt.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",Bt.TRANSACTION_REPLACED="TRANSACTION_REPLACED",Bt.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(Wt){Object.defineProperty(this,"version",{enumerable:!0,value:Wt,writable:!1})}_log(Wt,Gt){const Yt=Wt.toLowerCase();LogLevels[Yt]==null&&this.throwArgumentError("invalid log level name","logLevel",Wt),!(_logLevel>LogLevels[Yt])&&console.log.apply(console,Gt)}debug(...Wt){this._log(Logger.levels.DEBUG,Wt)}info(...Wt){this._log(Logger.levels.INFO,Wt)}warn(...Wt){this._log(Logger.levels.WARNING,Wt)}makeError(Wt,Gt,Yt){if(_censorErrors)return this.makeError("censored error",Gt,{});Gt||(Gt=Logger.errors.UNKNOWN_ERROR),Yt||(Yt={});const Xt=[];Object.keys(Yt).forEach(ur=>{const cr=Yt[ur];try{if(cr instanceof Uint8Array){let $r="";for(let Ar=0;Ar<cr.length;Ar++)$r+=HEX[cr[Ar]>>4],$r+=HEX[cr[Ar]&15];Xt.push(ur+"=Uint8Array(0x"+$r+")")}else Xt.push(ur+"="+JSON.stringify(cr))}catch{Xt.push(ur+"="+JSON.stringify(Yt[ur].toString()))}}),Xt.push(`code=${Gt}`),Xt.push(`version=${this.version}`);const Jt=Wt;let Zt="";switch(Gt){case ErrorCode.NUMERIC_FAULT:{Zt="NUMERIC_FAULT";const ur=Wt;switch(ur){case"overflow":case"underflow":case"division-by-zero":Zt+="-"+ur;break;case"negative-power":case"negative-width":Zt+="-unsupported";break;case"unbound-bitwise-result":Zt+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:Zt=Gt;break}Zt&&(Wt+=" [ See: https://links.ethers.org/v5-errors-"+Zt+" ]"),Xt.length&&(Wt+=" ("+Xt.join(", ")+")");const Qt=new Error(Wt);return Qt.reason=Jt,Qt.code=Gt,Object.keys(Yt).forEach(function(ur){Qt[ur]=Yt[ur]}),Qt}throwError(Wt,Gt,Yt){throw this.makeError(Wt,Gt,Yt)}throwArgumentError(Wt,Gt,Yt){return this.throwError(Wt,Logger.errors.INVALID_ARGUMENT,{argument:Gt,value:Yt})}assert(Wt,Gt,Yt,Xt){Wt||this.throwError(Gt,Yt,Xt)}assertArgument(Wt,Gt,Yt,Xt){Wt||this.throwArgumentError(Gt,Yt,Xt)}checkNormalize(Wt){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(Wt,Gt){typeof Wt=="number"&&(Gt==null&&(Gt="value not safe"),(Wt<0||Wt>=9007199254740991)&&this.throwError(Gt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:Wt}),Wt%1&&this.throwError(Gt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:Wt}))}checkArgumentCount(Wt,Gt,Yt){Yt?Yt=": "+Yt:Yt="",Wt<Gt&&this.throwError("missing argument"+Yt,Logger.errors.MISSING_ARGUMENT,{count:Wt,expectedCount:Gt}),Wt>Gt&&this.throwError("too many arguments"+Yt,Logger.errors.UNEXPECTED_ARGUMENT,{count:Wt,expectedCount:Gt})}checkNew(Wt,Gt){(Wt===Object||Wt==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:Gt.name})}checkAbstract(Wt,Gt){Wt===Gt?this.throwError("cannot instantiate abstract class "+JSON.stringify(Gt.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:Wt.name,operation:"new"}):(Wt===Object||Wt==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:Gt.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$v)),_globalLogger}static setCensorship(Wt,Gt){if(!Wt&&Gt&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!Wt)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!Wt,_permanentCensorErrors=!!Gt}static setLogLevel(Wt){const Gt=LogLevels[Wt.toLowerCase()];if(Gt==null){Logger.globalLogger().warn("invalid log level - "+Wt);return}_logLevel=Gt}static from(Wt){return new Logger(Wt)}}Logger.errors=ErrorCode;Logger.levels=LogLevel;const version$u="bytes/5.7.0",logger$M=new Logger(version$u);function isHexable(Bt){return!!Bt.toHexString}function addSlice(Bt){return Bt.slice||(Bt.slice=function(){const Wt=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(Bt,Wt)))}),Bt}function isBytesLike(Bt){return isHexString(Bt)&&!(Bt.length%2)||isBytes(Bt)}function isInteger(Bt){return typeof Bt=="number"&&Bt==Bt&&Bt%1===0}function isBytes(Bt){if(Bt==null)return!1;if(Bt.constructor===Uint8Array)return!0;if(typeof Bt=="string"||!isInteger(Bt.length)||Bt.length<0)return!1;for(let Wt=0;Wt<Bt.length;Wt++){const Gt=Bt[Wt];if(!isInteger(Gt)||Gt<0||Gt>=256)return!1}return!0}function arrayify(Bt,Wt){if(Wt||(Wt={}),typeof Bt=="number"){logger$M.checkSafeUint53(Bt,"invalid arrayify value");const Gt=[];for(;Bt;)Gt.unshift(Bt&255),Bt=parseInt(String(Bt/256));return Gt.length===0&&Gt.push(0),addSlice(new Uint8Array(Gt))}if(Wt.allowMissingPrefix&&typeof Bt=="string"&&Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),isHexable(Bt)&&(Bt=Bt.toHexString()),isHexString(Bt)){let Gt=Bt.substring(2);Gt.length%2&&(Wt.hexPad==="left"?Gt="0"+Gt:Wt.hexPad==="right"?Gt+="0":logger$M.throwArgumentError("hex data is odd-length","value",Bt));const Yt=[];for(let Xt=0;Xt<Gt.length;Xt+=2)Yt.push(parseInt(Gt.substring(Xt,Xt+2),16));return addSlice(new Uint8Array(Yt))}return isBytes(Bt)?addSlice(new Uint8Array(Bt)):logger$M.throwArgumentError("invalid arrayify value","value",Bt)}function concat$2(Bt){const Wt=Bt.map(Xt=>arrayify(Xt)),Gt=Wt.reduce((Xt,Jt)=>Xt+Jt.length,0),Yt=new Uint8Array(Gt);return Wt.reduce((Xt,Jt)=>(Yt.set(Jt,Xt),Xt+Jt.length),0),addSlice(Yt)}function stripZeros(Bt){let Wt=arrayify(Bt);if(Wt.length===0)return Wt;let Gt=0;for(;Gt<Wt.length&&Wt[Gt]===0;)Gt++;return Gt&&(Wt=Wt.slice(Gt)),Wt}function zeroPad(Bt,Wt){Bt=arrayify(Bt),Bt.length>Wt&&logger$M.throwArgumentError("value out of range","value",arguments[0]);const Gt=new Uint8Array(Wt);return Gt.set(Bt,Wt-Bt.length),addSlice(Gt)}function isHexString(Bt,Wt){return!(typeof Bt!="string"||!Bt.match(/^0x[0-9A-Fa-f]*$/)||Wt&&Bt.length!==2+2*Wt)}const HexCharacters="0123456789abcdef";function hexlify(Bt,Wt){if(Wt||(Wt={}),typeof Bt=="number"){logger$M.checkSafeUint53(Bt,"invalid hexlify value");let Gt="";for(;Bt;)Gt=HexCharacters[Bt&15]+Gt,Bt=Math.floor(Bt/16);return Gt.length?(Gt.length%2&&(Gt="0"+Gt),"0x"+Gt):"0x00"}if(typeof Bt=="bigint")return Bt=Bt.toString(16),Bt.length%2?"0x0"+Bt:"0x"+Bt;if(Wt.allowMissingPrefix&&typeof Bt=="string"&&Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),isHexable(Bt))return Bt.toHexString();if(isHexString(Bt))return Bt.length%2&&(Wt.hexPad==="left"?Bt="0x0"+Bt.substring(2):Wt.hexPad==="right"?Bt+="0":logger$M.throwArgumentError("hex data is odd-length","value",Bt)),Bt.toLowerCase();if(isBytes(Bt)){let Gt="0x";for(let Yt=0;Yt<Bt.length;Yt++){let Xt=Bt[Yt];Gt+=HexCharacters[(Xt&240)>>4]+HexCharacters[Xt&15]}return Gt}return logger$M.throwArgumentError("invalid hexlify value","value",Bt)}function hexDataLength(Bt){if(typeof Bt!="string")Bt=hexlify(Bt);else if(!isHexString(Bt)||Bt.length%2)return null;return(Bt.length-2)/2}function hexDataSlice(Bt,Wt,Gt){return typeof Bt!="string"?Bt=hexlify(Bt):(!isHexString(Bt)||Bt.length%2)&&logger$M.throwArgumentError("invalid hexData","value",Bt),Wt=2+2*Wt,Gt!=null?"0x"+Bt.substring(Wt,2+2*Gt):"0x"+Bt.substring(Wt)}function hexConcat(Bt){let Wt="0x";return Bt.forEach(Gt=>{Wt+=hexlify(Gt).substring(2)}),Wt}function hexValue(Bt){const Wt=hexStripZeros(hexlify(Bt,{hexPad:"left"}));return Wt==="0x"?"0x0":Wt}function hexStripZeros(Bt){typeof Bt!="string"&&(Bt=hexlify(Bt)),isHexString(Bt)||logger$M.throwArgumentError("invalid hex string","value",Bt),Bt=Bt.substring(2);let Wt=0;for(;Wt<Bt.length&&Bt[Wt]==="0";)Wt++;return"0x"+Bt.substring(Wt)}function hexZeroPad(Bt,Wt){for(typeof Bt!="string"?Bt=hexlify(Bt):isHexString(Bt)||logger$M.throwArgumentError("invalid hex string","value",Bt),Bt.length>2*Wt+2&&logger$M.throwArgumentError("value out of range","value",arguments[1]);Bt.length<2*Wt+2;)Bt="0x0"+Bt.substring(2);return Bt}function splitSignature(Bt){const Wt={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(Bt)){let Gt=arrayify(Bt);Gt.length===64?(Wt.v=27+(Gt[32]>>7),Gt[32]&=127,Wt.r=hexlify(Gt.slice(0,32)),Wt.s=hexlify(Gt.slice(32,64))):Gt.length===65?(Wt.r=hexlify(Gt.slice(0,32)),Wt.s=hexlify(Gt.slice(32,64)),Wt.v=Gt[64]):logger$M.throwArgumentError("invalid signature string","signature",Bt),Wt.v<27&&(Wt.v===0||Wt.v===1?Wt.v+=27:logger$M.throwArgumentError("signature invalid v byte","signature",Bt)),Wt.recoveryParam=1-Wt.v%2,Wt.recoveryParam&&(Gt[32]|=128),Wt._vs=hexlify(Gt.slice(32,64))}else{if(Wt.r=Bt.r,Wt.s=Bt.s,Wt.v=Bt.v,Wt.recoveryParam=Bt.recoveryParam,Wt._vs=Bt._vs,Wt._vs!=null){const Xt=zeroPad(arrayify(Wt._vs),32);Wt._vs=hexlify(Xt);const Jt=Xt[0]>=128?1:0;Wt.recoveryParam==null?Wt.recoveryParam=Jt:Wt.recoveryParam!==Jt&&logger$M.throwArgumentError("signature recoveryParam mismatch _vs","signature",Bt),Xt[0]&=127;const Zt=hexlify(Xt);Wt.s==null?Wt.s=Zt:Wt.s!==Zt&&logger$M.throwArgumentError("signature v mismatch _vs","signature",Bt)}if(Wt.recoveryParam==null)Wt.v==null?logger$M.throwArgumentError("signature missing v and recoveryParam","signature",Bt):Wt.v===0||Wt.v===1?Wt.recoveryParam=Wt.v:Wt.recoveryParam=1-Wt.v%2;else if(Wt.v==null)Wt.v=27+Wt.recoveryParam;else{const Xt=Wt.v===0||Wt.v===1?Wt.v:1-Wt.v%2;Wt.recoveryParam!==Xt&&logger$M.throwArgumentError("signature recoveryParam mismatch v","signature",Bt)}Wt.r==null||!isHexString(Wt.r)?logger$M.throwArgumentError("signature missing or invalid r","signature",Bt):Wt.r=hexZeroPad(Wt.r,32),Wt.s==null||!isHexString(Wt.s)?logger$M.throwArgumentError("signature missing or invalid s","signature",Bt):Wt.s=hexZeroPad(Wt.s,32);const Gt=arrayify(Wt.s);Gt[0]>=128&&logger$M.throwArgumentError("signature s out of range","signature",Bt),Wt.recoveryParam&&(Gt[0]|=128);const Yt=hexlify(Gt);Wt._vs&&(isHexString(Wt._vs)||logger$M.throwArgumentError("signature invalid _vs","signature",Bt),Wt._vs=hexZeroPad(Wt._vs,32)),Wt._vs==null?Wt._vs=Yt:Wt._vs!==Yt&&logger$M.throwArgumentError("signature _vs mismatch v and s","signature",Bt)}return Wt.yParityAndS=Wt._vs,Wt.compact=Wt.r+Wt.yParityAndS.substring(2),Wt}function joinSignature(Bt){return Bt=splitSignature(Bt),hexlify(concat$2([Bt.r,Bt.s,Bt.recoveryParam?"0x1c":"0x1b"]))}const version$t="bignumber/5.7.0";var BN=BN$7.BN;const logger$L=new Logger(version$t),_constructorGuard$4={},MAX_SAFE=9007199254740991;function isBigNumberish(Bt){return Bt!=null&&(BigNumber.isBigNumber(Bt)||typeof Bt=="number"&&Bt%1===0||typeof Bt=="string"&&!!Bt.match(/^-?[0-9]+$/)||isHexString(Bt)||typeof Bt=="bigint"||isBytes(Bt))}let _warnedToStringRadix=!1;class BigNumber{constructor(Wt,Gt){Wt!==_constructorGuard$4&&logger$L.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=Gt,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Wt){return toBigNumber(toBN(this).fromTwos(Wt))}toTwos(Wt){return toBigNumber(toBN(this).toTwos(Wt))}abs(){return this._hex[0]==="-"?BigNumber.from(this._hex.substring(1)):this}add(Wt){return toBigNumber(toBN(this).add(toBN(Wt)))}sub(Wt){return toBigNumber(toBN(this).sub(toBN(Wt)))}div(Wt){return BigNumber.from(Wt).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(Wt)))}mul(Wt){return toBigNumber(toBN(this).mul(toBN(Wt)))}mod(Wt){const Gt=toBN(Wt);return Gt.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber(toBN(this).umod(Gt))}pow(Wt){const Gt=toBN(Wt);return Gt.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber(toBN(this).pow(Gt))}and(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(Gt))}or(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(Gt))}xor(Wt){const Gt=toBN(Wt);return(this.isNegative()||Gt.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(Gt))}mask(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","mask"),toBigNumber(toBN(this).maskn(Wt))}shl(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","shl"),toBigNumber(toBN(this).shln(Wt))}shr(Wt){return(this.isNegative()||Wt<0)&&throwFault$1("negative-width","shr"),toBigNumber(toBN(this).shrn(Wt))}eq(Wt){return toBN(this).eq(toBN(Wt))}lt(Wt){return toBN(this).lt(toBN(Wt))}lte(Wt){return toBN(this).lte(toBN(Wt))}gt(Wt){return toBN(this).gt(toBN(Wt))}gte(Wt){return toBN(this).gte(toBN(Wt))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch{throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return logger$L.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_warnedToStringRadix||(_warnedToStringRadix=!0,logger$L.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?logger$L.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{}):logger$L.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(Wt){return{type:"BigNumber",hex:this.toHexString()}}static from(Wt){if(Wt instanceof BigNumber)return Wt;if(typeof Wt=="string")return Wt.match(/^-?0x[0-9a-f]+$/i)?new BigNumber(_constructorGuard$4,toHex(Wt)):Wt.match(/^-?[0-9]+$/)?new BigNumber(_constructorGuard$4,toHex(new BN(Wt))):logger$L.throwArgumentError("invalid BigNumber string","value",Wt);if(typeof Wt=="number")return Wt%1&&throwFault$1("underflow","BigNumber.from",Wt),(Wt>=MAX_SAFE||Wt<=-MAX_SAFE)&&throwFault$1("overflow","BigNumber.from",Wt),BigNumber.from(String(Wt));const Gt=Wt;if(typeof Gt=="bigint")return BigNumber.from(Gt.toString());if(isBytes(Gt))return BigNumber.from(hexlify(Gt));if(Gt)if(Gt.toHexString){const Yt=Gt.toHexString();if(typeof Yt=="string")return BigNumber.from(Yt)}else{let Yt=Gt._hex;if(Yt==null&&Gt.type==="BigNumber"&&(Yt=Gt.hex),typeof Yt=="string"&&(isHexString(Yt)||Yt[0]==="-"&&isHexString(Yt.substring(1))))return BigNumber.from(Yt)}return logger$L.throwArgumentError("invalid BigNumber value","value",Wt)}static isBigNumber(Wt){return!!(Wt&&Wt._isBigNumber)}}function toHex(Bt){if(typeof Bt!="string")return toHex(Bt.toString(16));if(Bt[0]==="-")return Bt=Bt.substring(1),Bt[0]==="-"&&logger$L.throwArgumentError("invalid hex","value",Bt),Bt=toHex(Bt),Bt==="0x00"?Bt:"-"+Bt;if(Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),Bt==="0x")return"0x00";for(Bt.length%2&&(Bt="0x0"+Bt.substring(2));Bt.length>4&&Bt.substring(0,4)==="0x00";)Bt="0x"+Bt.substring(4);return Bt}function toBigNumber(Bt){return BigNumber.from(toHex(Bt))}function toBN(Bt){const Wt=BigNumber.from(Bt).toHexString();return Wt[0]==="-"?new BN("-"+Wt.substring(3),16):new BN(Wt.substring(2),16)}function throwFault$1(Bt,Wt,Gt){const Yt={fault:Bt,operation:Wt};return Gt!=null&&(Yt.value=Gt),logger$L.throwError(Bt,Logger.errors.NUMERIC_FAULT,Yt)}function _base36To16(Bt){return new BN(Bt,36).toString(16)}function _base16To36(Bt){return new BN(Bt,16).toString(36)}const logger$K=new Logger(version$t),_constructorGuard$3={},Zero$2=BigNumber.from(0),NegativeOne$2=BigNumber.from(-1);function throwFault(Bt,Wt,Gt,Yt){const Xt={fault:Wt,operation:Gt};return Yt!==void 0&&(Xt.value=Yt),logger$K.throwError(Bt,Logger.errors.NUMERIC_FAULT,Xt)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(Bt){if(typeof Bt!="number")try{Bt=BigNumber.from(Bt).toNumber()}catch{}return typeof Bt=="number"&&Bt>=0&&Bt<=256&&!(Bt%1)?"1"+zeros.substring(0,Bt):logger$K.throwArgumentError("invalid decimal size","decimals",Bt)}function formatFixed(Bt,Wt){Wt==null&&(Wt=0);const Gt=getMultiplier(Wt);Bt=BigNumber.from(Bt);const Yt=Bt.lt(Zero$2);Yt&&(Bt=Bt.mul(NegativeOne$2));let Xt=Bt.mod(Gt).toString();for(;Xt.length<Gt.length-1;)Xt="0"+Xt;Xt=Xt.match(/^([0-9]*[1-9]|0)(0*)/)[1];const Jt=Bt.div(Gt).toString();return Gt.length===1?Bt=Jt:Bt=Jt+"."+Xt,Yt&&(Bt="-"+Bt),Bt}function parseFixed(Bt,Wt){Wt==null&&(Wt=0);const Gt=getMultiplier(Wt);(typeof Bt!="string"||!Bt.match(/^-?[0-9.]+$/))&&logger$K.throwArgumentError("invalid decimal value","value",Bt);const Yt=Bt.substring(0,1)==="-";Yt&&(Bt=Bt.substring(1)),Bt==="."&&logger$K.throwArgumentError("missing value","value",Bt);const Xt=Bt.split(".");Xt.length>2&&logger$K.throwArgumentError("too many decimal points","value",Bt);let Jt=Xt[0],Zt=Xt[1];for(Jt||(Jt="0"),Zt||(Zt="0");Zt[Zt.length-1]==="0";)Zt=Zt.substring(0,Zt.length-1);for(Zt.length>Gt.length-1&&throwFault("fractional component exceeds decimals","underflow","parseFixed"),Zt===""&&(Zt="0");Zt.length<Gt.length-1;)Zt+="0";const Qt=BigNumber.from(Jt),ur=BigNumber.from(Zt);let cr=Qt.mul(Gt).add(ur);return Yt&&(cr=cr.mul(NegativeOne$2)),cr}class FixedFormat{constructor(Wt,Gt,Yt,Xt){Wt!==_constructorGuard$3&&logger$K.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=Gt,this.width=Yt,this.decimals=Xt,this.name=(Gt?"":"u")+"fixed"+String(Yt)+"x"+String(Xt),this._multiplier=getMultiplier(Xt),Object.freeze(this)}static from(Wt){if(Wt instanceof FixedFormat)return Wt;typeof Wt=="number"&&(Wt=`fixed128x${Wt}`);let Gt=!0,Yt=128,Xt=18;if(typeof Wt=="string"){if(Wt!=="fixed")if(Wt==="ufixed")Gt=!1;else{const Jt=Wt.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Jt||logger$K.throwArgumentError("invalid fixed format","format",Wt),Gt=Jt[1]!=="u",Yt=parseInt(Jt[2]),Xt=parseInt(Jt[3])}}else if(Wt){const Jt=(Zt,Qt,ur)=>Wt[Zt]==null?ur:(typeof Wt[Zt]!==Qt&&logger$K.throwArgumentError("invalid fixed format ("+Zt+" not "+Qt+")","format."+Zt,Wt[Zt]),Wt[Zt]);Gt=Jt("signed","boolean",Gt),Yt=Jt("width","number",Yt),Xt=Jt("decimals","number",Xt)}return Yt%8&&logger$K.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",Yt),Xt>80&&logger$K.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",Xt),new FixedFormat(_constructorGuard$3,Gt,Yt,Xt)}}class FixedNumber{constructor(Wt,Gt,Yt,Xt){Wt!==_constructorGuard$3&&logger$K.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=Xt,this._hex=Gt,this._value=Yt,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Wt){this.format.name!==Wt.format.name&&logger$K.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Wt)}addUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.add(Yt),this.format.decimals,this.format)}subUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.sub(Yt),this.format.decimals,this.format)}mulUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.mul(Yt).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Wt){this._checkFormat(Wt);const Gt=parseFixed(this._value,this.format.decimals),Yt=parseFixed(Wt._value,Wt.format.decimals);return FixedNumber.fromValue(Gt.mul(this.format._multiplier).div(Yt),this.format.decimals,this.format)}floor(){const Wt=this.toString().split(".");Wt.length===1&&Wt.push("0");let Gt=FixedNumber.from(Wt[0],this.format);const Yt=!Wt[1].match(/^(0*)$/);return this.isNegative()&&Yt&&(Gt=Gt.subUnsafe(ONE$1.toFormat(Gt.format))),Gt}ceiling(){const Wt=this.toString().split(".");Wt.length===1&&Wt.push("0");let Gt=FixedNumber.from(Wt[0],this.format);const Yt=!Wt[1].match(/^(0*)$/);return!this.isNegative()&&Yt&&(Gt=Gt.addUnsafe(ONE$1.toFormat(Gt.format))),Gt}round(Wt){Wt==null&&(Wt=0);const Gt=this.toString().split(".");if(Gt.length===1&&Gt.push("0"),(Wt<0||Wt>80||Wt%1)&&logger$K.throwArgumentError("invalid decimal count","decimals",Wt),Gt[1].length<=Wt)return this;const Yt=FixedNumber.from("1"+zeros.substring(0,Wt),this.format),Xt=BUMP.toFormat(this.format);return this.mulUnsafe(Yt).addUnsafe(Xt).floor().divUnsafe(Yt)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Wt){if(Wt==null)return this._hex;Wt%8&&logger$K.throwArgumentError("invalid byte width","width",Wt);const Gt=BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(Wt).toHexString();return hexZeroPad(Gt,Wt/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Wt){return FixedNumber.fromString(this._value,Wt)}static fromValue(Wt,Gt,Yt){return Yt==null&&Gt!=null&&!isBigNumberish(Gt)&&(Yt=Gt,Gt=null),Gt==null&&(Gt=0),Yt==null&&(Yt="fixed"),FixedNumber.fromString(formatFixed(Wt,Gt),FixedFormat.from(Yt))}static fromString(Wt,Gt){Gt==null&&(Gt="fixed");const Yt=FixedFormat.from(Gt),Xt=parseFixed(Wt,Yt.decimals);!Yt.signed&&Xt.lt(Zero$2)&&throwFault("unsigned value cannot be negative","overflow","value",Wt);let Jt=null;Yt.signed?Jt=Xt.toTwos(Yt.width).toHexString():(Jt=Xt.toHexString(),Jt=hexZeroPad(Jt,Yt.width/8));const Zt=formatFixed(Xt,Yt.decimals);return new FixedNumber(_constructorGuard$3,Jt,Zt,Yt)}static fromBytes(Wt,Gt){Gt==null&&(Gt="fixed");const Yt=FixedFormat.from(Gt);if(arrayify(Wt).length>Yt.width/8)throw new Error("overflow");let Xt=BigNumber.from(Wt);Yt.signed&&(Xt=Xt.fromTwos(Yt.width));const Jt=Xt.toTwos((Yt.signed?0:1)+Yt.width).toHexString(),Zt=formatFixed(Xt,Yt.decimals);return new FixedNumber(_constructorGuard$3,Jt,Zt,Yt)}static from(Wt,Gt){if(typeof Wt=="string")return FixedNumber.fromString(Wt,Gt);if(isBytes(Wt))return FixedNumber.fromBytes(Wt,Gt);try{return FixedNumber.fromValue(Wt,0,Gt)}catch(Yt){if(Yt.code!==Logger.errors.INVALID_ARGUMENT)throw Yt}return logger$K.throwArgumentError("invalid FixedNumber value","value",Wt)}static isFixedNumber(Wt){return!!(Wt&&Wt._isFixedNumber)}}const ONE$1=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version$s="properties/5.7.0";var __awaiter$A=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$J=new Logger(version$s);function defineReadOnly(Bt,Wt,Gt){Object.defineProperty(Bt,Wt,{enumerable:!0,value:Gt,writable:!1})}function getStatic(Bt,Wt){for(let Gt=0;Gt<32;Gt++){if(Bt[Wt])return Bt[Wt];if(!Bt.prototype||typeof Bt.prototype!="object")break;Bt=Object.getPrototypeOf(Bt.prototype).constructor}return null}function resolveProperties(Bt){return __awaiter$A(this,void 0,void 0,function*(){const Wt=Object.keys(Bt).map(Yt=>{const Xt=Bt[Yt];return Promise.resolve(Xt).then(Jt=>({key:Yt,value:Jt}))});return(yield Promise.all(Wt)).reduce((Yt,Xt)=>(Yt[Xt.key]=Xt.value,Yt),{})})}function checkProperties(Bt,Wt){(!Bt||typeof Bt!="object")&&logger$J.throwArgumentError("invalid object","object",Bt),Object.keys(Bt).forEach(Gt=>{Wt[Gt]||logger$J.throwArgumentError("invalid object key - "+Gt,"transaction:"+Gt,Bt)})}function shallowCopy(Bt){const Wt={};for(const Gt in Bt)Wt[Gt]=Bt[Gt];return Wt}const opaque={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(Bt){if(Bt==null||opaque[typeof Bt])return!0;if(Array.isArray(Bt)||typeof Bt=="object"){if(!Object.isFrozen(Bt))return!1;const Wt=Object.keys(Bt);for(let Gt=0;Gt<Wt.length;Gt++){let Yt=null;try{Yt=Bt[Wt[Gt]]}catch{continue}if(!_isFrozen(Yt))return!1}return!0}return logger$J.throwArgumentError(`Cannot deepCopy ${typeof Bt}`,"object",Bt)}function _deepCopy(Bt){if(_isFrozen(Bt))return Bt;if(Array.isArray(Bt))return Object.freeze(Bt.map(Wt=>deepCopy(Wt)));if(typeof Bt=="object"){const Wt={};for(const Gt in Bt){const Yt=Bt[Gt];Yt!==void 0&&defineReadOnly(Wt,Gt,deepCopy(Yt))}return Wt}return logger$J.throwArgumentError(`Cannot deepCopy ${typeof Bt}`,"object",Bt)}function deepCopy(Bt){return _deepCopy(Bt)}class Description{constructor(Wt){for(const Gt in Wt)this[Gt]=deepCopy(Wt[Gt])}}const version$r="abi/5.7.0",logger$I=new Logger(version$r),_constructorGuard$2={};let ModifiersBytes={calldata:!0,memory:!0,storage:!0},ModifiersNest={calldata:!0,memory:!0};function checkModifier(Bt,Wt){if(Bt==="bytes"||Bt==="string"){if(ModifiersBytes[Wt])return!0}else if(Bt==="address"){if(Wt==="payable")return!0}else if((Bt.indexOf("[")>=0||Bt==="tuple")&&ModifiersNest[Wt])return!0;return(ModifiersBytes[Wt]||Wt==="payable")&&logger$I.throwArgumentError("invalid modifier","name",Wt),!1}function parseParamType(Bt,Wt){let Gt=Bt;function Yt(Qt){logger$I.throwArgumentError(`unexpected character at position ${Qt}`,"param",Bt)}Bt=Bt.replace(/\s/g," ");function Xt(Qt){let ur={type:"",name:"",parent:Qt,state:{allowType:!0}};return Wt&&(ur.indexed=!1),ur}let Jt={type:"",name:"",state:{allowType:!0}},Zt=Jt;for(let Qt=0;Qt<Bt.length;Qt++){let ur=Bt[Qt];switch(ur){case"(":Zt.state.allowType&&Zt.type===""?Zt.type="tuple":Zt.state.allowParams||Yt(Qt),Zt.state.allowType=!1,Zt.type=verifyType(Zt.type),Zt.components=[Xt(Zt)],Zt=Zt.components[0];break;case")":delete Zt.state,Zt.name==="indexed"&&(Wt||Yt(Qt),Zt.indexed=!0,Zt.name=""),checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Zt.type=verifyType(Zt.type);let cr=Zt;Zt=Zt.parent,Zt||Yt(Qt),delete cr.parent,Zt.state.allowParams=!1,Zt.state.allowName=!0,Zt.state.allowArray=!0;break;case",":delete Zt.state,Zt.name==="indexed"&&(Wt||Yt(Qt),Zt.indexed=!0,Zt.name=""),checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Zt.type=verifyType(Zt.type);let $r=Xt(Zt.parent);Zt.parent.components.push($r),delete Zt.parent,Zt=$r;break;case" ":Zt.state.allowType&&Zt.type!==""&&(Zt.type=verifyType(Zt.type),delete Zt.state.allowType,Zt.state.allowName=!0,Zt.state.allowParams=!0),Zt.state.allowName&&Zt.name!==""&&(Zt.name==="indexed"?(Wt||Yt(Qt),Zt.indexed&&Yt(Qt),Zt.indexed=!0,Zt.name=""):checkModifier(Zt.type,Zt.name)?Zt.name="":Zt.state.allowName=!1);break;case"[":Zt.state.allowArray||Yt(Qt),Zt.type+=ur,Zt.state.allowArray=!1,Zt.state.allowName=!1,Zt.state.readArray=!0;break;case"]":Zt.state.readArray||Yt(Qt),Zt.type+=ur,Zt.state.readArray=!1,Zt.state.allowArray=!0,Zt.state.allowName=!0;break;default:Zt.state.allowType?(Zt.type+=ur,Zt.state.allowParams=!0,Zt.state.allowArray=!0):Zt.state.allowName?(Zt.name+=ur,delete Zt.state.allowArray):Zt.state.readArray?Zt.type+=ur:Yt(Qt)}}return Zt.parent&&logger$I.throwArgumentError("unexpected eof","param",Bt),delete Jt.state,Zt.name==="indexed"?(Wt||Yt(Gt.length-7),Zt.indexed&&Yt(Gt.length-7),Zt.indexed=!0,Zt.name=""):checkModifier(Zt.type,Zt.name)&&(Zt.name=""),Jt.type=verifyType(Jt.type),Jt}function populate(Bt,Wt){for(let Gt in Wt)defineReadOnly(Bt,Gt,Wt[Gt])}const FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(Wt,Gt){Wt!==_constructorGuard$2&&logger$I.throwError("use fromString",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,Gt);let Yt=this.type.match(paramTypeArray);Yt?populate(this,{arrayLength:parseInt(Yt[2]||"-1"),arrayChildren:ParamType.fromObject({type:Yt[1],components:this.components}),baseType:"array"}):populate(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json){let Yt={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(Yt.indexed=this.indexed),this.components&&(Yt.components=this.components.map(Xt=>JSON.parse(Xt.format(Wt)))),JSON.stringify(Yt)}let Gt="";return this.baseType==="array"?(Gt+=this.arrayChildren.format(Wt),Gt+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(Wt!==FormatTypes.sighash&&(Gt+=this.type),Gt+="("+this.components.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+")"):Gt+=this.type,Wt!==FormatTypes.sighash&&(this.indexed===!0&&(Gt+=" indexed"),Wt===FormatTypes.full&&this.name&&(Gt+=" "+this.name)),Gt}static from(Wt,Gt){return typeof Wt=="string"?ParamType.fromString(Wt,Gt):ParamType.fromObject(Wt)}static fromObject(Wt){return ParamType.isParamType(Wt)?Wt:new ParamType(_constructorGuard$2,{name:Wt.name||null,type:verifyType(Wt.type),indexed:Wt.indexed==null?null:!!Wt.indexed,components:Wt.components?Wt.components.map(ParamType.fromObject):null})}static fromString(Wt,Gt){function Yt(Xt){return ParamType.fromObject({name:Xt.name,type:Xt.type,indexed:Xt.indexed,components:Xt.components})}return Yt(parseParamType(Wt,!!Gt))}static isParamType(Wt){return!!(Wt!=null&&Wt._isParamType)}}function parseParams(Bt,Wt){return splitNesting(Bt).map(Gt=>ParamType.fromString(Gt,Wt))}class Fragment{constructor(Wt,Gt){Wt!==_constructorGuard$2&&logger$I.throwError("use a static from method",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,Gt),this._isFragment=!0,Object.freeze(this)}static from(Wt){return Fragment.isFragment(Wt)?Wt:typeof Wt=="string"?Fragment.fromString(Wt):Fragment.fromObject(Wt)}static fromObject(Wt){if(Fragment.isFragment(Wt))return Wt;switch(Wt.type){case"function":return FunctionFragment.fromObject(Wt);case"event":return EventFragment.fromObject(Wt);case"constructor":return ConstructorFragment.fromObject(Wt);case"error":return ErrorFragment.fromObject(Wt);case"fallback":case"receive":return null}return logger$I.throwArgumentError("invalid fragment object","value",Wt)}static fromString(Wt){return Wt=Wt.replace(/\s/g," "),Wt=Wt.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),Wt=Wt.trim(),Wt.split(" ")[0]==="event"?EventFragment.fromString(Wt.substring(5).trim()):Wt.split(" ")[0]==="function"?FunctionFragment.fromString(Wt.substring(8).trim()):Wt.split("(")[0].trim()==="constructor"?ConstructorFragment.fromString(Wt.trim()):Wt.split(" ")[0]==="error"?ErrorFragment.fromString(Wt.substring(5).trim()):logger$I.throwArgumentError("unsupported fragment","value",Wt)}static isFragment(Wt){return!!(Wt&&Wt._isFragment)}}class EventFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="event "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Wt!==FormatTypes.sighash&&this.anonymous&&(Gt+="anonymous "),Gt.trim()}static from(Wt){return typeof Wt=="string"?EventFragment.fromString(Wt):EventFragment.fromObject(Wt)}static fromObject(Wt){if(EventFragment.isEventFragment(Wt))return Wt;Wt.type!=="event"&&logger$I.throwArgumentError("invalid event object","value",Wt);const Gt={name:verifyIdentifier(Wt.name),anonymous:Wt.anonymous,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(_constructorGuard$2,Gt)}static fromString(Wt){let Gt=Wt.match(regexParen);Gt||logger$I.throwArgumentError("invalid event string","value",Wt);let Yt=!1;return Gt[3].split(" ").forEach(Xt=>{switch(Xt.trim()){case"anonymous":Yt=!0;break;case"":break;default:logger$I.warn("unknown modifier: "+Xt)}}),EventFragment.fromObject({name:Gt[1].trim(),anonymous:Yt,inputs:parseParams(Gt[2],!0),type:"event"})}static isEventFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="event"}}function parseGas(Bt,Wt){Wt.gas=null;let Gt=Bt.split("@");return Gt.length!==1?(Gt.length>2&&logger$I.throwArgumentError("invalid human-readable ABI signature","value",Bt),Gt[1].match(/^[0-9]+$/)||logger$I.throwArgumentError("invalid human-readable ABI signature gas","value",Bt),Wt.gas=BigNumber.from(Gt[1]),Gt[0]):Bt}function parseModifiers(Bt,Wt){Wt.constant=!1,Wt.payable=!1,Wt.stateMutability="nonpayable",Bt.split(" ").forEach(Gt=>{switch(Gt.trim()){case"constant":Wt.constant=!0;break;case"payable":Wt.payable=!0,Wt.stateMutability="payable";break;case"nonpayable":Wt.payable=!1,Wt.stateMutability="nonpayable";break;case"pure":Wt.constant=!0,Wt.stateMutability="pure";break;case"view":Wt.constant=!0,Wt.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+Gt)}})}function verifyState(Bt){let Wt={constant:!1,payable:!0,stateMutability:"payable"};return Bt.stateMutability!=null?(Wt.stateMutability=Bt.stateMutability,Wt.constant=Wt.stateMutability==="view"||Wt.stateMutability==="pure",Bt.constant!=null&&!!Bt.constant!==Wt.constant&&logger$I.throwArgumentError("cannot have constant function with mutability "+Wt.stateMutability,"value",Bt),Wt.payable=Wt.stateMutability==="payable",Bt.payable!=null&&!!Bt.payable!==Wt.payable&&logger$I.throwArgumentError("cannot have payable function with mutability "+Wt.stateMutability,"value",Bt)):Bt.payable!=null?(Wt.payable=!!Bt.payable,Bt.constant==null&&!Wt.payable&&Bt.type!=="constructor"&&logger$I.throwArgumentError("unable to determine stateMutability","value",Bt),Wt.constant=!!Bt.constant,Wt.constant?Wt.stateMutability="view":Wt.stateMutability=Wt.payable?"payable":"nonpayable",Wt.payable&&Wt.constant&&logger$I.throwArgumentError("cannot have constant payable function","value",Bt)):Bt.constant!=null?(Wt.constant=!!Bt.constant,Wt.payable=!Wt.constant,Wt.stateMutability=Wt.constant?"view":"payable"):Bt.type!=="constructor"&&logger$I.throwArgumentError("unable to determine stateMutability","value",Bt),Wt}class ConstructorFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});Wt===FormatTypes.sighash&&logger$I.throwError("cannot format a constructor for sighash",Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let Gt="constructor("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(Gt+=this.stateMutability+" "),Gt.trim()}static from(Wt){return typeof Wt=="string"?ConstructorFragment.fromString(Wt):ConstructorFragment.fromObject(Wt)}static fromObject(Wt){if(ConstructorFragment.isConstructorFragment(Wt))return Wt;Wt.type!=="constructor"&&logger$I.throwArgumentError("invalid constructor object","value",Wt);let Gt=verifyState(Wt);Gt.constant&&logger$I.throwArgumentError("constructor cannot be constant","value",Wt);const Yt={name:null,type:Wt.type,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],payable:Gt.payable,stateMutability:Gt.stateMutability,gas:Wt.gas?BigNumber.from(Wt.gas):null};return new ConstructorFragment(_constructorGuard$2,Yt)}static fromString(Wt){let Gt={type:"constructor"};Wt=parseGas(Wt,Gt);let Yt=Wt.match(regexParen);return(!Yt||Yt[1].trim()!=="constructor")&&logger$I.throwArgumentError("invalid constructor string","value",Wt),Gt.inputs=parseParams(Yt[2].trim(),!1),parseModifiers(Yt[3].trim(),Gt),ConstructorFragment.fromObject(Gt)}static isConstructorFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="constructor"}}class FunctionFragment extends ConstructorFragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt))),outputs:this.outputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="function "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Wt!==FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(Gt+=this.stateMutability+" "):this.constant&&(Gt+="view "),this.outputs&&this.outputs.length&&(Gt+="returns ("+this.outputs.map(Yt=>Yt.format(Wt)).join(", ")+") "),this.gas!=null&&(Gt+="@"+this.gas.toString()+" ")),Gt.trim()}static from(Wt){return typeof Wt=="string"?FunctionFragment.fromString(Wt):FunctionFragment.fromObject(Wt)}static fromObject(Wt){if(FunctionFragment.isFunctionFragment(Wt))return Wt;Wt.type!=="function"&&logger$I.throwArgumentError("invalid function object","value",Wt);let Gt=verifyState(Wt);const Yt={type:Wt.type,name:verifyIdentifier(Wt.name),constant:Gt.constant,inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[],outputs:Wt.outputs?Wt.outputs.map(ParamType.fromObject):[],payable:Gt.payable,stateMutability:Gt.stateMutability,gas:Wt.gas?BigNumber.from(Wt.gas):null};return new FunctionFragment(_constructorGuard$2,Yt)}static fromString(Wt){let Gt={type:"function"};Wt=parseGas(Wt,Gt);let Yt=Wt.split(" returns ");Yt.length>2&&logger$I.throwArgumentError("invalid function string","value",Wt);let Xt=Yt[0].match(regexParen);if(Xt||logger$I.throwArgumentError("invalid function signature","value",Wt),Gt.name=Xt[1].trim(),Gt.name&&verifyIdentifier(Gt.name),Gt.inputs=parseParams(Xt[2],!1),parseModifiers(Xt[3].trim(),Gt),Yt.length>1){let Jt=Yt[1].match(regexParen);(Jt[1].trim()!=""||Jt[3].trim()!="")&&logger$I.throwArgumentError("unexpected tokens","value",Wt),Gt.outputs=parseParams(Jt[2],!1)}else Gt.outputs=[];return FunctionFragment.fromObject(Gt)}static isFunctionFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="function"}}function checkForbidden(Bt){const Wt=Bt.format();return(Wt==="Error(string)"||Wt==="Panic(uint256)")&&logger$I.throwArgumentError(`cannot specify user defined ${Wt} error`,"fragment",Bt),Bt}class ErrorFragment extends Fragment{format(Wt){if(Wt||(Wt=FormatTypes.sighash),FormatTypes[Wt]||logger$I.throwArgumentError("invalid format type","format",Wt),Wt===FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(Yt=>JSON.parse(Yt.format(Wt)))});let Gt="";return Wt!==FormatTypes.sighash&&(Gt+="error "),Gt+=this.name+"("+this.inputs.map(Yt=>Yt.format(Wt)).join(Wt===FormatTypes.full?", ":",")+") ",Gt.trim()}static from(Wt){return typeof Wt=="string"?ErrorFragment.fromString(Wt):ErrorFragment.fromObject(Wt)}static fromObject(Wt){if(ErrorFragment.isErrorFragment(Wt))return Wt;Wt.type!=="error"&&logger$I.throwArgumentError("invalid error object","value",Wt);const Gt={type:Wt.type,name:verifyIdentifier(Wt.name),inputs:Wt.inputs?Wt.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard$2,Gt))}static fromString(Wt){let Gt={type:"error"},Yt=Wt.match(regexParen);return Yt||logger$I.throwArgumentError("invalid error signature","value",Wt),Gt.name=Yt[1].trim(),Gt.name&&verifyIdentifier(Gt.name),Gt.inputs=parseParams(Yt[2],!1),checkForbidden(ErrorFragment.fromObject(Gt))}static isErrorFragment(Wt){return Wt&&Wt._isFragment&&Wt.type==="error"}}function verifyType(Bt){return Bt.match(/^uint($|[^1-9])/)?Bt="uint256"+Bt.substring(4):Bt.match(/^int($|[^1-9])/)&&(Bt="int256"+Bt.substring(3)),Bt}const regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(Bt){return(!Bt||!Bt.match(regexIdentifier))&&logger$I.throwArgumentError(`invalid identifier "${Bt}"`,"value",Bt),Bt}const regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(Bt){Bt=Bt.trim();let Wt=[],Gt="",Yt=0;for(let Xt=0;Xt<Bt.length;Xt++){let Jt=Bt[Xt];Jt===","&&Yt===0?(Wt.push(Gt),Gt=""):(Gt+=Jt,Jt==="("?Yt++:Jt===")"&&(Yt--,Yt===-1&&logger$I.throwArgumentError("unbalanced parenthesis","value",Bt)))}return Gt&&Wt.push(Gt),Wt}const logger$H=new Logger(version$r);function checkResultErrors(Bt){const Wt=[],Gt=function(Yt,Xt){if(Array.isArray(Xt))for(let Jt in Xt){const Zt=Yt.slice();Zt.push(Jt);try{Gt(Zt,Xt[Jt])}catch(Qt){Wt.push({path:Zt,error:Qt})}}};return Gt([],Bt),Wt}class Coder{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.type=Gt,this.localName=Yt,this.dynamic=Xt}_throwError(Wt,Gt){logger$H.throwArgumentError(Wt,this.localName,Gt)}}class Writer{constructor(Wt){defineReadOnly(this,"wordSize",Wt||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(Wt)}get data(){return hexConcat(this._data)}get length(){return this._dataLength}_writeData(Wt){return this._data.push(Wt),this._dataLength+=Wt.length,Wt.length}appendWriter(Wt){return this._writeData(concat$2(Wt._data))}writeBytes(Wt){let Gt=arrayify(Wt);const Yt=Gt.length%this.wordSize;return Yt&&(Gt=concat$2([Gt,this._padding.slice(Yt)])),this._writeData(Gt)}_getValue(Wt){let Gt=arrayify(BigNumber.from(Wt));return Gt.length>this.wordSize&&logger$H.throwError("value out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:Gt.length}),Gt.length%this.wordSize&&(Gt=concat$2([this._padding.slice(Gt.length%this.wordSize),Gt])),Gt}writeValue(Wt){return this._writeData(this._getValue(Wt))}writeUpdatableValue(){const Wt=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,Gt=>{this._data[Wt]=this._getValue(Gt)}}}class Reader{constructor(Wt,Gt,Yt,Xt){defineReadOnly(this,"_data",arrayify(Wt)),defineReadOnly(this,"wordSize",Gt||32),defineReadOnly(this,"_coerceFunc",Yt),defineReadOnly(this,"allowLoose",Xt),this._offset=0}get data(){return hexlify(this._data)}get consumed(){return this._offset}static coerce(Wt,Gt){let Yt=Wt.match("^u?int([0-9]+)$");return Yt&&parseInt(Yt[1])<=48&&(Gt=Gt.toNumber()),Gt}coerce(Wt,Gt){return this._coerceFunc?this._coerceFunc(Wt,Gt):Reader.coerce(Wt,Gt)}_peekBytes(Wt,Gt,Yt){let Xt=Math.ceil(Gt/this.wordSize)*this.wordSize;return this._offset+Xt>this._data.length&&(this.allowLoose&&Yt&&this._offset+Gt<=this._data.length?Xt=Gt:logger$H.throwError("data out-of-bounds",Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+Xt})),this._data.slice(this._offset,this._offset+Xt)}subReader(Wt){return new Reader(this._data.slice(this._offset+Wt),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(Wt,Gt){let Yt=this._peekBytes(0,Wt,!!Gt);return this._offset+=Yt.length,Yt.slice(0,Wt)}readValue(){return BigNumber.from(this.readBytes(this.wordSize))}}function keccak256$1(Bt){return"0x"+sha3$2.keccak_256(arrayify(Bt))}const version$q="rlp/5.7.0",logger$G=new Logger(version$q);function arrayifyInteger(Bt){const Wt=[];for(;Bt;)Wt.unshift(Bt&255),Bt>>=8;return Wt}function unarrayifyInteger(Bt,Wt,Gt){let Yt=0;for(let Xt=0;Xt<Gt;Xt++)Yt=Yt*256+Bt[Wt+Xt];return Yt}function _encode(Bt){if(Array.isArray(Bt)){let Yt=[];if(Bt.forEach(function(Jt){Yt=Yt.concat(_encode(Jt))}),Yt.length<=55)return Yt.unshift(192+Yt.length),Yt;const Xt=arrayifyInteger(Yt.length);return Xt.unshift(247+Xt.length),Xt.concat(Yt)}isBytesLike(Bt)||logger$G.throwArgumentError("RLP object must be BytesLike","object",Bt);const Wt=Array.prototype.slice.call(arrayify(Bt));if(Wt.length===1&&Wt[0]<=127)return Wt;if(Wt.length<=55)return Wt.unshift(128+Wt.length),Wt;const Gt=arrayifyInteger(Wt.length);return Gt.unshift(183+Gt.length),Gt.concat(Wt)}function encode$6(Bt){return hexlify(_encode(Bt))}function _decodeChildren(Bt,Wt,Gt,Yt){const Xt=[];for(;Gt<Wt+1+Yt;){const Jt=_decode(Bt,Gt);Xt.push(Jt.result),Gt+=Jt.consumed,Gt>Wt+1+Yt&&logger$G.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+Yt,result:Xt}}function _decode(Bt,Wt){if(Bt.length===0&&logger$G.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),Bt[Wt]>=248){const Gt=Bt[Wt]-247;Wt+1+Gt>Bt.length&&logger$G.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=unarrayifyInteger(Bt,Wt+1,Gt);return Wt+1+Gt+Yt>Bt.length&&logger$G.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(Bt,Wt,Wt+1+Gt,Gt+Yt)}else if(Bt[Wt]>=192){const Gt=Bt[Wt]-192;return Wt+1+Gt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(Bt,Wt,Wt+1,Gt)}else if(Bt[Wt]>=184){const Gt=Bt[Wt]-183;Wt+1+Gt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=unarrayifyInteger(Bt,Wt+1,Gt);Wt+1+Gt+Yt>Bt.length&&logger$G.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const Xt=hexlify(Bt.slice(Wt+1+Gt,Wt+1+Gt+Yt));return{consumed:1+Gt+Yt,result:Xt}}else if(Bt[Wt]>=128){const Gt=Bt[Wt]-128;Wt+1+Gt>Bt.length&&logger$G.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const Yt=hexlify(Bt.slice(Wt+1,Wt+1+Gt));return{consumed:1+Gt,result:Yt}}return{consumed:1,result:hexlify(Bt[Wt])}}function decode$6(Bt){const Wt=arrayify(Bt),Gt=_decode(Wt,0);return Gt.consumed!==Wt.length&&logger$G.throwArgumentError("invalid rlp data","data",Bt),Gt.result}const index$4=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$6,encode:encode$6},Symbol.toStringTag,{value:"Module"})),version$p="address/5.7.0",logger$F=new Logger(version$p);function getChecksumAddress(Bt){isHexString(Bt,20)||logger$F.throwArgumentError("invalid address","address",Bt),Bt=Bt.toLowerCase();const Wt=Bt.substring(2).split(""),Gt=new Uint8Array(40);for(let Xt=0;Xt<40;Xt++)Gt[Xt]=Wt[Xt].charCodeAt(0);const Yt=arrayify(keccak256$1(Gt));for(let Xt=0;Xt<40;Xt+=2)Yt[Xt>>1]>>4>=8&&(Wt[Xt]=Wt[Xt].toUpperCase()),(Yt[Xt>>1]&15)>=8&&(Wt[Xt+1]=Wt[Xt+1].toUpperCase());return"0x"+Wt.join("")}const MAX_SAFE_INTEGER$5=9007199254740991;function log10(Bt){return Math.log10?Math.log10(Bt):Math.log(Bt)/Math.LN10}const ibanLookup={};for(let Bt=0;Bt<10;Bt++)ibanLookup[String(Bt)]=String(Bt);for(let Bt=0;Bt<26;Bt++)ibanLookup[String.fromCharCode(65+Bt)]=String(10+Bt);const safeDigits=Math.floor(log10(MAX_SAFE_INTEGER$5));function ibanChecksum(Bt){Bt=Bt.toUpperCase(),Bt=Bt.substring(4)+Bt.substring(0,2)+"00";let Wt=Bt.split("").map(Yt=>ibanLookup[Yt]).join("");for(;Wt.length>=safeDigits;){let Yt=Wt.substring(0,safeDigits);Wt=parseInt(Yt,10)%97+Wt.substring(Yt.length)}let Gt=String(98-parseInt(Wt,10)%97);for(;Gt.length<2;)Gt="0"+Gt;return Gt}function getAddress(Bt){let Wt=null;if(typeof Bt!="string"&&logger$F.throwArgumentError("invalid address","address",Bt),Bt.match(/^(0x)?[0-9a-fA-F]{40}$/))Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),Wt=getChecksumAddress(Bt),Bt.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&Wt!==Bt&&logger$F.throwArgumentError("bad address checksum","address",Bt);else if(Bt.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(Bt.substring(2,4)!==ibanChecksum(Bt)&&logger$F.throwArgumentError("bad icap checksum","address",Bt),Wt=_base36To16(Bt.substring(4));Wt.length<40;)Wt="0"+Wt;Wt=getChecksumAddress("0x"+Wt)}else logger$F.throwArgumentError("invalid address","address",Bt);return Wt}function isAddress(Bt){try{return getAddress(Bt),!0}catch{}return!1}function getIcapAddress(Bt){let Wt=_base16To36(getAddress(Bt).substring(2)).toUpperCase();for(;Wt.length<30;)Wt="0"+Wt;return"XE"+ibanChecksum("XE00"+Wt)+Wt}function getContractAddress(Bt){let Wt=null;try{Wt=getAddress(Bt.from)}catch{logger$F.throwArgumentError("missing from address","transaction",Bt)}const Gt=stripZeros(arrayify(BigNumber.from(Bt.nonce).toHexString()));return getAddress(hexDataSlice(keccak256$1(encode$6([Wt,Gt])),12))}function getCreate2Address(Bt,Wt,Gt){return hexDataLength(Wt)!==32&&logger$F.throwArgumentError("salt must be 32 bytes","salt",Wt),hexDataLength(Gt)!==32&&logger$F.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",Gt),getAddress(hexDataSlice(keccak256$1(concat$2(["0xff",getAddress(Bt),Wt,Gt])),12))}class AddressCoder extends Coder{constructor(Wt){super("address","address",Wt,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(Wt,Gt){try{Gt=getAddress(Gt)}catch(Yt){this._throwError(Yt.message,Gt)}return Wt.writeValue(Gt)}decode(Wt){return getAddress(hexZeroPad(Wt.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(Wt){super(Wt.name,Wt.type,void 0,Wt.dynamic),this.coder=Wt}defaultValue(){return this.coder.defaultValue()}encode(Wt,Gt){return this.coder.encode(Wt,Gt)}decode(Wt){return this.coder.decode(Wt)}}const logger$E=new Logger(version$r);function pack$1(Bt,Wt,Gt){let Yt=null;if(Array.isArray(Gt))Yt=Gt;else if(Gt&&typeof Gt=="object"){let ur={};Yt=Wt.map(cr=>{const $r=cr.localName;return $r||logger$E.throwError("cannot encode object for signature with missing names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:cr,value:Gt}),ur[$r]&&logger$E.throwError("cannot encode object for signature with duplicate names",Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:cr,value:Gt}),ur[$r]=!0,Gt[$r]})}else logger$E.throwArgumentError("invalid tuple value","tuple",Gt);Wt.length!==Yt.length&&logger$E.throwArgumentError("types/value length mismatch","tuple",Gt);let Xt=new Writer(Bt.wordSize),Jt=new Writer(Bt.wordSize),Zt=[];Wt.forEach((ur,cr)=>{let $r=Yt[cr];if(ur.dynamic){let Ar=Jt.length;ur.encode(Jt,$r);let Lr=Xt.writeUpdatableValue();Zt.push(qr=>{Lr(qr+Ar)})}else ur.encode(Xt,$r)}),Zt.forEach(ur=>{ur(Xt.length)});let Qt=Bt.appendWriter(Xt);return Qt+=Bt.appendWriter(Jt),Qt}function unpack(Bt,Wt){let Gt=[],Yt=Bt.subReader(0);Wt.forEach(Jt=>{let Zt=null;if(Jt.dynamic){let Qt=Bt.readValue(),ur=Yt.subReader(Qt.toNumber());try{Zt=Jt.decode(ur)}catch(cr){if(cr.code===Logger.errors.BUFFER_OVERRUN)throw cr;Zt=cr,Zt.baseType=Jt.name,Zt.name=Jt.localName,Zt.type=Jt.type}}else try{Zt=Jt.decode(Bt)}catch(Qt){if(Qt.code===Logger.errors.BUFFER_OVERRUN)throw Qt;Zt=Qt,Zt.baseType=Jt.name,Zt.name=Jt.localName,Zt.type=Jt.type}Zt!=null&&Gt.push(Zt)});const Xt=Wt.reduce((Jt,Zt)=>{const Qt=Zt.localName;return Qt&&(Jt[Qt]||(Jt[Qt]=0),Jt[Qt]++),Jt},{});Wt.forEach((Jt,Zt)=>{let Qt=Jt.localName;if(!Qt||Xt[Qt]!==1||(Qt==="length"&&(Qt="_length"),Gt[Qt]!=null))return;const ur=Gt[Zt];ur instanceof Error?Object.defineProperty(Gt,Qt,{enumerable:!0,get:()=>{throw ur}}):Gt[Qt]=ur});for(let Jt=0;Jt<Gt.length;Jt++){const Zt=Gt[Jt];Zt instanceof Error&&Object.defineProperty(Gt,Jt,{enumerable:!0,get:()=>{throw Zt}})}return Object.freeze(Gt)}class ArrayCoder extends Coder{constructor(Wt,Gt,Yt){const Xt=Wt.type+"["+(Gt>=0?Gt:"")+"]",Jt=Gt===-1||Wt.dynamic;super("array",Xt,Yt,Jt),this.coder=Wt,this.length=Gt}defaultValue(){const Wt=this.coder.defaultValue(),Gt=[];for(let Yt=0;Yt<this.length;Yt++)Gt.push(Wt);return Gt}encode(Wt,Gt){Array.isArray(Gt)||this._throwError("expected array value",Gt);let Yt=this.length;Yt===-1&&(Yt=Gt.length,Wt.writeValue(Gt.length)),logger$E.checkArgumentCount(Gt.length,Yt,"coder array"+(this.localName?" "+this.localName:""));let Xt=[];for(let Jt=0;Jt<Gt.length;Jt++)Xt.push(this.coder);return pack$1(Wt,Xt,Gt)}decode(Wt){let Gt=this.length;Gt===-1&&(Gt=Wt.readValue().toNumber(),Gt*32>Wt._data.length&&logger$E.throwError("insufficient data length",Logger.errors.BUFFER_OVERRUN,{length:Wt._data.length,count:Gt}));let Yt=[];for(let Xt=0;Xt<Gt;Xt++)Yt.push(new AnonymousCoder(this.coder));return Wt.coerce(this.name,unpack(Wt,Yt))}}class BooleanCoder extends Coder{constructor(Wt){super("bool","bool",Wt,!1)}defaultValue(){return!1}encode(Wt,Gt){return Wt.writeValue(Gt?1:0)}decode(Wt){return Wt.coerce(this.type,!Wt.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(Wt,Gt){super(Wt,Wt,Gt,!0)}defaultValue(){return"0x"}encode(Wt,Gt){Gt=arrayify(Gt);let Yt=Wt.writeValue(Gt.length);return Yt+=Wt.writeBytes(Gt),Yt}decode(Wt){return Wt.readBytes(Wt.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(Wt){super("bytes",Wt)}decode(Wt){return Wt.coerce(this.name,hexlify(super.decode(Wt)))}}class FixedBytesCoder extends Coder{constructor(Wt,Gt){let Yt="bytes"+String(Wt);super(Yt,Yt,Gt,!1),this.size=Wt}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(Wt,Gt){let Yt=arrayify(Gt);return Yt.length!==this.size&&this._throwError("incorrect data length",Gt),Wt.writeBytes(Yt)}decode(Wt){return Wt.coerce(this.name,hexlify(Wt.readBytes(this.size)))}}class NullCoder extends Coder{constructor(Wt){super("null","",Wt,!1)}defaultValue(){return null}encode(Wt,Gt){return Gt!=null&&this._throwError("not null",Gt),Wt.writeBytes([])}decode(Wt){return Wt.readBytes(0),Wt.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber.from(-1),Zero$1=BigNumber.from(0),One$1=BigNumber.from(1),Two=BigNumber.from(2),WeiPerEther=BigNumber.from("1000000000000000000"),MaxUint256$1=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),MinInt256=BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),MaxInt256=BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",EtherSymbol="Ξ",index$3=Object.freeze(Object.defineProperty({__proto__:null,AddressZero,EtherSymbol,HashZero,MaxInt256,MaxUint256:MaxUint256$1,MinInt256,NegativeOne:NegativeOne$1,One:One$1,Two,WeiPerEther,Zero:Zero$1},Symbol.toStringTag,{value:"Module"}));class NumberCoder extends Coder{constructor(Wt,Gt,Yt){const Xt=(Gt?"int":"uint")+Wt*8;super(Xt,Xt,Yt,!1),this.size=Wt,this.signed=Gt}defaultValue(){return 0}encode(Wt,Gt){let Yt=BigNumber.from(Gt),Xt=MaxUint256$1.mask(Wt.wordSize*8);if(this.signed){let Jt=Xt.mask(this.size*8-1);(Yt.gt(Jt)||Yt.lt(Jt.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",Gt)}else(Yt.lt(Zero$1)||Yt.gt(Xt.mask(this.size*8)))&&this._throwError("value out-of-bounds",Gt);return Yt=Yt.toTwos(this.size*8).mask(this.size*8),this.signed&&(Yt=Yt.fromTwos(this.size*8).toTwos(8*Wt.wordSize)),Wt.writeValue(Yt)}decode(Wt){let Gt=Wt.readValue().mask(this.size*8);return this.signed&&(Gt=Gt.fromTwos(this.size*8)),Wt.coerce(this.name,Gt)}}const version$o="strings/5.7.0",logger$D=new Logger(version$o);var UnicodeNormalizationForm;(function(Bt){Bt.current="",Bt.NFC="NFC",Bt.NFD="NFD",Bt.NFKC="NFKC",Bt.NFKD="NFKD"})(UnicodeNormalizationForm||(UnicodeNormalizationForm={}));var Utf8ErrorReason;(function(Bt){Bt.UNEXPECTED_CONTINUE="unexpected continuation byte",Bt.BAD_PREFIX="bad codepoint prefix",Bt.OVERRUN="string overrun",Bt.MISSING_CONTINUE="missing continuation byte",Bt.OUT_OF_RANGE="out of UTF-8 range",Bt.UTF16_SURROGATE="UTF-16 surrogate",Bt.OVERLONG="overlong representation"})(Utf8ErrorReason||(Utf8ErrorReason={}));function errorFunc(Bt,Wt,Gt,Yt,Xt){return logger$D.throwArgumentError(`invalid codepoint at offset ${Wt}; ${Bt}`,"bytes",Gt)}function ignoreFunc(Bt,Wt,Gt,Yt,Xt){if(Bt===Utf8ErrorReason.BAD_PREFIX||Bt===Utf8ErrorReason.UNEXPECTED_CONTINUE){let Jt=0;for(let Zt=Wt+1;Zt<Gt.length&&Gt[Zt]>>6===2;Zt++)Jt++;return Jt}return Bt===Utf8ErrorReason.OVERRUN?Gt.length-Wt-1:0}function replaceFunc(Bt,Wt,Gt,Yt,Xt){return Bt===Utf8ErrorReason.OVERLONG?(Yt.push(Xt),0):(Yt.push(65533),ignoreFunc(Bt,Wt,Gt))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(Bt,Wt){Wt==null&&(Wt=Utf8ErrorFuncs.error),Bt=arrayify(Bt);const Gt=[];let Yt=0;for(;Yt<Bt.length;){const Xt=Bt[Yt++];if(!(Xt>>7)){Gt.push(Xt);continue}let Jt=null,Zt=null;if((Xt&224)===192)Jt=1,Zt=127;else if((Xt&240)===224)Jt=2,Zt=2047;else if((Xt&248)===240)Jt=3,Zt=65535;else{(Xt&192)===128?Yt+=Wt(Utf8ErrorReason.UNEXPECTED_CONTINUE,Yt-1,Bt,Gt):Yt+=Wt(Utf8ErrorReason.BAD_PREFIX,Yt-1,Bt,Gt);continue}if(Yt-1+Jt>=Bt.length){Yt+=Wt(Utf8ErrorReason.OVERRUN,Yt-1,Bt,Gt);continue}let Qt=Xt&(1<<8-Jt-1)-1;for(let ur=0;ur<Jt;ur++){let cr=Bt[Yt];if((cr&192)!=128){Yt+=Wt(Utf8ErrorReason.MISSING_CONTINUE,Yt,Bt,Gt),Qt=null;break}Qt=Qt<<6|cr&63,Yt++}if(Qt!==null){if(Qt>1114111){Yt+=Wt(Utf8ErrorReason.OUT_OF_RANGE,Yt-1-Jt,Bt,Gt,Qt);continue}if(Qt>=55296&&Qt<=57343){Yt+=Wt(Utf8ErrorReason.UTF16_SURROGATE,Yt-1-Jt,Bt,Gt,Qt);continue}if(Qt<=Zt){Yt+=Wt(Utf8ErrorReason.OVERLONG,Yt-1-Jt,Bt,Gt,Qt);continue}Gt.push(Qt)}}return Gt}function toUtf8Bytes(Bt,Wt=UnicodeNormalizationForm.current){Wt!=UnicodeNormalizationForm.current&&(logger$D.checkNormalize(),Bt=Bt.normalize(Wt));let Gt=[];for(let Yt=0;Yt<Bt.length;Yt++){const Xt=Bt.charCodeAt(Yt);if(Xt<128)Gt.push(Xt);else if(Xt<2048)Gt.push(Xt>>6|192),Gt.push(Xt&63|128);else if((Xt&64512)==55296){Yt++;const Jt=Bt.charCodeAt(Yt);if(Yt>=Bt.length||(Jt&64512)!==56320)throw new Error("invalid utf-8 string");const Zt=65536+((Xt&1023)<<10)+(Jt&1023);Gt.push(Zt>>18|240),Gt.push(Zt>>12&63|128),Gt.push(Zt>>6&63|128),Gt.push(Zt&63|128)}else Gt.push(Xt>>12|224),Gt.push(Xt>>6&63|128),Gt.push(Xt&63|128)}return arrayify(Gt)}function escapeChar(Bt){const Wt="0000"+Bt.toString(16);return"\\u"+Wt.substring(Wt.length-4)}function _toEscapedUtf8String(Bt,Wt){return'"'+getUtf8CodePoints(Bt,Wt).map(Gt=>{if(Gt<256){switch(Gt){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(Gt>=32&&Gt<127)return String.fromCharCode(Gt)}return Gt<=65535?escapeChar(Gt):(Gt-=65536,escapeChar((Gt>>10&1023)+55296)+escapeChar((Gt&1023)+56320))}).join("")+'"'}function _toUtf8String(Bt){return Bt.map(Wt=>Wt<=65535?String.fromCharCode(Wt):(Wt-=65536,String.fromCharCode((Wt>>10&1023)+55296,(Wt&1023)+56320))).join("")}function toUtf8String(Bt,Wt){return _toUtf8String(getUtf8CodePoints(Bt,Wt))}function toUtf8CodePoints(Bt,Wt=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(Bt,Wt))}function formatBytes32String(Bt){const Wt=toUtf8Bytes(Bt);if(Wt.length>31)throw new Error("bytes32 string must be less than 32 bytes");return hexlify(concat$2([Wt,HashZero]).slice(0,32))}function parseBytes32String(Bt){const Wt=arrayify(Bt);if(Wt.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(Wt[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let Gt=31;for(;Wt[Gt-1]===0;)Gt--;return toUtf8String(Wt.slice(0,Gt))}function bytes2(Bt){if(Bt.length%4!==0)throw new Error("bad data");let Wt=[];for(let Gt=0;Gt<Bt.length;Gt+=4)Wt.push(parseInt(Bt.substring(Gt,Gt+4),16));return Wt}function createTable(Bt,Wt){Wt||(Wt=function(Xt){return[parseInt(Xt,16)]});let Gt=0,Yt={};return Bt.split(",").forEach(Xt=>{let Jt=Xt.split(":");Gt+=parseInt(Jt[0],16),Yt[Gt]=Wt(Jt[1])}),Yt}function createRangeTable(Bt){let Wt=0;return Bt.split(",").map(Gt=>{let Yt=Gt.split("-");Yt.length===1?Yt[1]="0":Yt[1]===""&&(Yt[1]="1");let Xt=Wt+parseInt(Yt[0],16);return Wt=parseInt(Yt[1],16),{l:Xt,h:Wt}})}function matchMap(Bt,Wt){let Gt=0;for(let Yt=0;Yt<Wt.length;Yt++){let Xt=Wt[Yt];if(Gt+=Xt.l,Bt>=Gt&&Bt<=Gt+Xt.h&&(Bt-Gt)%(Xt.d||1)===0){if(Xt.e&&Xt.e.indexOf(Bt-Gt)!==-1)continue;return Xt}}return null}const Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(Bt=>parseInt(Bt,16)),Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2),Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten$2(Bt){return Bt.reduce((Wt,Gt)=>(Gt.forEach(Yt=>{Wt.push(Yt)}),Wt),[])}function _nameprepTableA1(Bt){return!!matchMap(Bt,Table_A_1_ranges)}function _nameprepTableB2(Bt){let Wt=matchMap(Bt,Table_B_2_ranges);if(Wt)return[Bt+Wt.s];let Gt=Table_B_2_lut_abs[Bt];if(Gt)return Gt;let Yt=Table_B_2_lut_rel[Bt];if(Yt)return[Bt+Yt[0]];let Xt=Table_B_2_complex[Bt];return Xt||null}function _nameprepTableC(Bt){return!!matchMap(Bt,Table_C_ranges)}function nameprep(Bt){if(Bt.match(/^[a-z0-9-]*$/i)&&Bt.length<=59)return Bt.toLowerCase();let Wt=toUtf8CodePoints(Bt);Wt=flatten$2(Wt.map(Yt=>{if(Table_B_1_flags.indexOf(Yt)>=0)return[];if(Yt>=65024&&Yt<=65039)return[];let Xt=_nameprepTableB2(Yt);return Xt||[Yt]})),Wt=toUtf8CodePoints(_toUtf8String(Wt),UnicodeNormalizationForm.NFKC),Wt.forEach(Yt=>{if(_nameprepTableC(Yt))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),Wt.forEach(Yt=>{if(_nameprepTableA1(Yt))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let Gt=_toUtf8String(Wt);if(Gt.substring(0,1)==="-"||Gt.substring(2,4)==="--"||Gt.substring(Gt.length-1)==="-")throw new Error("invalid hyphen");return Gt}class StringCoder extends DynamicBytesCoder{constructor(Wt){super("string",Wt)}defaultValue(){return""}encode(Wt,Gt){return super.encode(Wt,toUtf8Bytes(Gt))}decode(Wt){return toUtf8String(super.decode(Wt))}}class TupleCoder extends Coder{constructor(Wt,Gt){let Yt=!1;const Xt=[];Wt.forEach(Zt=>{Zt.dynamic&&(Yt=!0),Xt.push(Zt.type)});const Jt="tuple("+Xt.join(",")+")";super("tuple",Jt,Gt,Yt),this.coders=Wt}defaultValue(){const Wt=[];this.coders.forEach(Yt=>{Wt.push(Yt.defaultValue())});const Gt=this.coders.reduce((Yt,Xt)=>{const Jt=Xt.localName;return Jt&&(Yt[Jt]||(Yt[Jt]=0),Yt[Jt]++),Yt},{});return this.coders.forEach((Yt,Xt)=>{let Jt=Yt.localName;!Jt||Gt[Jt]!==1||(Jt==="length"&&(Jt="_length"),Wt[Jt]==null&&(Wt[Jt]=Wt[Xt]))}),Object.freeze(Wt)}encode(Wt,Gt){return pack$1(Wt,this.coders,Gt)}decode(Wt){return Wt.coerce(this.name,unpack(Wt,this.coders))}}const logger$C=new Logger(version$r),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(Wt){defineReadOnly(this,"coerceFunc",Wt||null)}_getCoder(Wt){switch(Wt.baseType){case"address":return new AddressCoder(Wt.name);case"bool":return new BooleanCoder(Wt.name);case"string":return new StringCoder(Wt.name);case"bytes":return new BytesCoder(Wt.name);case"array":return new ArrayCoder(this._getCoder(Wt.arrayChildren),Wt.arrayLength,Wt.name);case"tuple":return new TupleCoder((Wt.components||[]).map(Yt=>this._getCoder(Yt)),Wt.name);case"":return new NullCoder(Wt.name)}let Gt=Wt.type.match(paramTypeNumber);if(Gt){let Yt=parseInt(Gt[2]||"256");return(Yt===0||Yt>256||Yt%8!==0)&&logger$C.throwArgumentError("invalid "+Gt[1]+" bit length","param",Wt),new NumberCoder(Yt/8,Gt[1]==="int",Wt.name)}if(Gt=Wt.type.match(paramTypeBytes),Gt){let Yt=parseInt(Gt[1]);return(Yt===0||Yt>32)&&logger$C.throwArgumentError("invalid bytes length","param",Wt),new FixedBytesCoder(Yt,Wt.name)}return logger$C.throwArgumentError("invalid type","type",Wt.type)}_getWordSize(){return 32}_getReader(Wt,Gt){return new Reader(Wt,this._getWordSize(),this.coerceFunc,Gt)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(Wt){const Gt=Wt.map(Xt=>this._getCoder(ParamType.from(Xt)));return new TupleCoder(Gt,"_").defaultValue()}encode(Wt,Gt){Wt.length!==Gt.length&&logger$C.throwError("types/values length mismatch",Logger.errors.INVALID_ARGUMENT,{count:{types:Wt.length,values:Gt.length},value:{types:Wt,values:Gt}});const Yt=Wt.map(Zt=>this._getCoder(ParamType.from(Zt))),Xt=new TupleCoder(Yt,"_"),Jt=this._getWriter();return Xt.encode(Jt,Gt),Jt.data}decode(Wt,Gt,Yt){const Xt=Wt.map(Zt=>this._getCoder(ParamType.from(Zt)));return new TupleCoder(Xt,"_").decode(this._getReader(arrayify(Gt),Yt))}}const defaultAbiCoder=new AbiCoder;function id(Bt){return keccak256$1(toUtf8Bytes(Bt))}const version$n="hash/5.7.0";function decode$5(Bt){Bt=atob(Bt);const Wt=[];for(let Gt=0;Gt<Bt.length;Gt++)Wt.push(Bt.charCodeAt(Gt));return arrayify(Wt)}function encode$5(Bt){Bt=arrayify(Bt);let Wt="";for(let Gt=0;Gt<Bt.length;Gt++)Wt+=String.fromCharCode(Bt[Gt]);return btoa(Wt)}const index$2=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$5,encode:encode$5},Symbol.toStringTag,{value:"Module"}));function flat$2(Bt,Wt){Wt==null&&(Wt=1);const Gt=[],Yt=Gt.forEach,Xt=function(Jt,Zt){Yt.call(Jt,function(Qt){Zt>0&&Array.isArray(Qt)?Xt(Qt,Zt-1):Gt.push(Qt)})};return Xt(Bt,Wt),Gt}function fromEntries$1(Bt){const Wt={};for(let Gt=0;Gt<Bt.length;Gt++){const Yt=Bt[Gt];Wt[Yt[0]]=Yt[1]}return Wt}function decode_arithmetic(Bt){let Wt=0;function Gt(){return Bt[Wt++]<<8|Bt[Wt++]}let Yt=Gt(),Xt=1,Jt=[0,1];for(let hn=1;hn<Yt;hn++)Jt.push(Xt+=Gt());let Zt=Gt(),Qt=Wt;Wt+=Zt;let ur=0,cr=0;function $r(){return ur==0&&(cr=cr<<8|Bt[Wt++],ur=8),cr>>--ur&1}const Ar=31,Lr=Math.pow(2,Ar),qr=Lr>>>1,Fr=qr>>1,Hr=Lr-1;let Br=0;for(let hn=0;hn<Ar;hn++)Br=Br<<1|$r();let Wr=[],Gr=0,Kr=Lr;for(;;){let hn=Math.floor(((Br-Gr+1)*Xt-1)/Kr),Qr=0,pn=Yt;for(;pn-Qr>1;){let dn=Qr+pn>>>1;hn<Jt[dn]?pn=dn:Qr=dn}if(Qr==0)break;Wr.push(Qr);let En=Gr+Math.floor(Kr*Jt[Qr]/Xt),ga=Gr+Math.floor(Kr*Jt[Qr+1]/Xt)-1;for(;!((En^ga)&qr);)Br=Br<<1&Hr|$r(),En=En<<1&Hr,ga=ga<<1&Hr|1;for(;En&~ga&Fr;)Br=Br&qr|Br<<1&Hr>>>1|$r(),En=En<<1^qr,ga=(ga^qr)<<1|qr|1;Gr=En,Kr=1+ga-En}let Yr=Yt-4;return Wr.map(hn=>{switch(hn-Yr){case 3:return Yr+65792+(Bt[Qt++]<<16|Bt[Qt++]<<8|Bt[Qt++]);case 2:return Yr+256+(Bt[Qt++]<<8|Bt[Qt++]);case 1:return Yr+Bt[Qt++];default:return hn-1}})}function read_payload(Bt){let Wt=0;return()=>Bt[Wt++]}function read_compressed_payload(Bt){return read_payload(decode_arithmetic(Bt))}function signed(Bt){return Bt&1?~Bt>>1:Bt>>1}function read_counts(Bt,Wt){let Gt=Array(Bt);for(let Yt=0;Yt<Bt;Yt++)Gt[Yt]=1+Wt();return Gt}function read_ascending(Bt,Wt){let Gt=Array(Bt);for(let Yt=0,Xt=-1;Yt<Bt;Yt++)Gt[Yt]=Xt+=1+Wt();return Gt}function read_deltas(Bt,Wt){let Gt=Array(Bt);for(let Yt=0,Xt=0;Yt<Bt;Yt++)Gt[Yt]=Xt+=signed(Wt());return Gt}function read_member_array(Bt,Wt){let Gt=read_ascending(Bt(),Bt),Yt=Bt(),Xt=read_ascending(Yt,Bt),Jt=read_counts(Yt,Bt);for(let Zt=0;Zt<Yt;Zt++)for(let Qt=0;Qt<Jt[Zt];Qt++)Gt.push(Xt[Zt]+Qt);return Wt?Gt.map(Zt=>Wt[Zt]):Gt}function read_mapped_map(Bt){let Wt=[];for(;;){let Gt=Bt();if(Gt==0)break;Wt.push(read_linear_table(Gt,Bt))}for(;;){let Gt=Bt()-1;if(Gt<0)break;Wt.push(read_replacement_table(Gt,Bt))}return fromEntries$1(flat$2(Wt))}function read_zero_terminated_array(Bt){let Wt=[];for(;;){let Gt=Bt();if(Gt==0)break;Wt.push(Gt)}return Wt}function read_transposed(Bt,Wt,Gt){let Yt=Array(Bt).fill(void 0).map(()=>[]);for(let Xt=0;Xt<Wt;Xt++)read_deltas(Bt,Gt).forEach((Jt,Zt)=>Yt[Zt].push(Jt));return Yt}function read_linear_table(Bt,Wt){let Gt=1+Wt(),Yt=Wt(),Xt=read_zero_terminated_array(Wt),Jt=read_transposed(Xt.length,1+Bt,Wt);return flat$2(Jt.map((Zt,Qt)=>{const ur=Zt[0],cr=Zt.slice(1);return Array(Xt[Qt]).fill(void 0).map(($r,Ar)=>{let Lr=Ar*Yt;return[ur+Ar*Gt,cr.map(qr=>qr+Lr)]})}))}function read_replacement_table(Bt,Wt){let Gt=1+Wt();return read_transposed(Gt,1+Bt,Wt).map(Xt=>[Xt[0],Xt.slice(1)])}function read_emoji_trie(Bt){let Wt=read_member_array(Bt).sort((Yt,Xt)=>Yt-Xt);return Gt();function Gt(){let Yt=[];for(;;){let cr=read_member_array(Bt,Wt);if(cr.length==0)break;Yt.push({set:new Set(cr),node:Gt()})}Yt.sort((cr,$r)=>$r.set.size-cr.set.size);let Xt=Bt(),Jt=Xt%3;Xt=Xt/3|0;let Zt=!!(Xt&1);Xt>>=1;let Qt=Xt==1,ur=Xt==2;return{branches:Yt,valid:Jt,fe0f:Zt,save:Qt,check:ur}}}function getData$6(){return read_compressed_payload(decode$5("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r$2=getData$6(),VALID=new Set(read_member_array(r$2)),IGNORED=new Set(read_member_array(r$2)),MAPPED=read_mapped_map(r$2),EMOJI_ROOT=read_emoji_trie(r$2),HYPHEN=45,UNDERSCORE=95;function explode_cp(Bt){return toUtf8CodePoints(Bt)}function filter_fe0f(Bt){return Bt.filter(Wt=>Wt!=65039)}function ens_normalize_post_check(Bt){for(let Wt of Bt.split(".")){let Gt=explode_cp(Wt);try{for(let Yt=Gt.lastIndexOf(UNDERSCORE)-1;Yt>=0;Yt--)if(Gt[Yt]!==UNDERSCORE)throw new Error("underscore only allowed at start");if(Gt.length>=4&&Gt.every(Yt=>Yt<128)&&Gt[2]===HYPHEN&&Gt[3]===HYPHEN)throw new Error("invalid label extension")}catch(Yt){throw new Error(`Invalid label "${Wt}": ${Yt.message}`)}}return Bt}function ens_normalize(Bt){return ens_normalize_post_check(normalize$1(Bt,filter_fe0f))}function normalize$1(Bt,Wt){let Gt=explode_cp(Bt).reverse(),Yt=[];for(;Gt.length;){let Xt=consume_emoji_reversed(Gt);if(Xt){Yt.push(...Wt(Xt));continue}let Jt=Gt.pop();if(VALID.has(Jt)){Yt.push(Jt);continue}if(IGNORED.has(Jt))continue;let Zt=MAPPED[Jt];if(Zt){Yt.push(...Zt);continue}throw new Error(`Disallowed codepoint: 0x${Jt.toString(16).toUpperCase()}`)}return ens_normalize_post_check(nfc(String.fromCodePoint(...Yt)))}function nfc(Bt){return Bt.normalize("NFC")}function consume_emoji_reversed(Bt,Wt){var Gt;let Yt=EMOJI_ROOT,Xt,Jt,Zt=[],Qt=Bt.length;for(Wt&&(Wt.length=0);Qt;){let ur=Bt[--Qt];if(Yt=(Gt=Yt.branches.find(cr=>cr.set.has(ur)))===null||Gt===void 0?void 0:Gt.node,!Yt)break;if(Yt.save)Jt=ur;else if(Yt.check&&ur===Jt)break;Zt.push(ur),Yt.fe0f&&(Zt.push(65039),Qt>0&&Bt[Qt-1]==65039&&Qt--),Yt.valid&&(Xt=Zt.slice(),Yt.valid==2&&Xt.splice(1,1),Wt&&Wt.push(...Bt.slice(Qt).reverse()),Bt.length=Qt)}return Xt}const logger$B=new Logger(version$n),Zeros$1=new Uint8Array(32);Zeros$1.fill(0);function checkComponent(Bt){if(Bt.length===0)throw new Error("invalid ENS name; empty component");return Bt}function ensNameSplit(Bt){const Wt=toUtf8Bytes(ens_normalize(Bt)),Gt=[];if(Bt.length===0)return Gt;let Yt=0;for(let Xt=0;Xt<Wt.length;Xt++)Wt[Xt]===46&&(Gt.push(checkComponent(Wt.slice(Yt,Xt))),Yt=Xt+1);if(Yt>=Wt.length)throw new Error("invalid ENS name; empty component");return Gt.push(checkComponent(Wt.slice(Yt))),Gt}function isValidName(Bt){try{return ensNameSplit(Bt).length!==0}catch{}return!1}function namehash(Bt){typeof Bt!="string"&&logger$B.throwArgumentError("invalid ENS name; not a string","name",Bt);let Wt=Zeros$1;const Gt=ensNameSplit(Bt);for(;Gt.length;)Wt=keccak256$1(concat$2([Wt,keccak256$1(Gt.pop())]));return hexlify(Wt)}function dnsEncode(Bt){return hexlify(concat$2(ensNameSplit(Bt).map(Wt=>{if(Wt.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const Gt=new Uint8Array(Wt.length+1);return Gt.set(Wt,1),Gt[0]=Gt.length-1,Gt})))+"00"}const messagePrefix=`Ethereum Signed Message:
762
762
  `;function hashMessage(Bt){return typeof Bt=="string"&&(Bt=toUtf8Bytes(Bt)),keccak256$1(concat$2([toUtf8Bytes(messagePrefix),toUtf8Bytes(String(Bt.length)),Bt]))}var __awaiter$z=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$A=new Logger(version$n),padding=new Uint8Array(32);padding.fill(0);const NegativeOne=BigNumber.from(-1),Zero=BigNumber.from(0),One=BigNumber.from(1),MaxUint256=BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(Bt){const Wt=arrayify(Bt),Gt=Wt.length%32;return Gt?hexConcat([Wt,padding.slice(Gt)]):hexlify(Wt)}const hexTrue=hexZeroPad(One.toHexString(),32),hexFalse=hexZeroPad(Zero.toHexString(),32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(Bt){return function(Wt){return typeof Wt!="string"&&logger$A.throwArgumentError(`invalid domain value for ${JSON.stringify(Bt)}`,`domain.${Bt}`,Wt),Wt}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(Bt){try{return BigNumber.from(Bt).toString()}catch{}return logger$A.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",Bt)},verifyingContract:function(Bt){try{return getAddress(Bt).toLowerCase()}catch{}return logger$A.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",Bt)},salt:function(Bt){try{const Wt=arrayify(Bt);if(Wt.length!==32)throw new Error("bad length");return hexlify(Wt)}catch{}return logger$A.throwArgumentError('invalid domain value "salt"',"domain.salt",Bt)}};function getBaseEncoder(Bt){{const Wt=Bt.match(/^(u?)int(\d*)$/);if(Wt){const Gt=Wt[1]==="",Yt=parseInt(Wt[2]||"256");(Yt%8!==0||Yt>256||Wt[2]&&Wt[2]!==String(Yt))&&logger$A.throwArgumentError("invalid numeric width","type",Bt);const Xt=MaxUint256.mask(Gt?Yt-1:Yt),Jt=Gt?Xt.add(One).mul(NegativeOne):Zero;return function(Zt){const Qt=BigNumber.from(Zt);return(Qt.lt(Jt)||Qt.gt(Xt))&&logger$A.throwArgumentError(`value out-of-bounds for ${Bt}`,"value",Zt),hexZeroPad(Qt.toTwos(256).toHexString(),32)}}}{const Wt=Bt.match(/^bytes(\d+)$/);if(Wt){const Gt=parseInt(Wt[1]);return(Gt===0||Gt>32||Wt[1]!==String(Gt))&&logger$A.throwArgumentError("invalid bytes width","type",Bt),function(Yt){return arrayify(Yt).length!==Gt&&logger$A.throwArgumentError(`invalid length for ${Bt}`,"value",Yt),hexPadRight(Yt)}}}switch(Bt){case"address":return function(Wt){return hexZeroPad(getAddress(Wt),32)};case"bool":return function(Wt){return Wt?hexTrue:hexFalse};case"bytes":return function(Wt){return keccak256$1(Wt)};case"string":return function(Wt){return id(Wt)}}return null}function encodeType(Bt,Wt){return`${Bt}(${Wt.map(({name:Gt,type:Yt})=>Yt+" "+Gt).join(",")})`}class TypedDataEncoder{constructor(Wt){defineReadOnly(this,"types",Object.freeze(deepCopy(Wt))),defineReadOnly(this,"_encoderCache",{}),defineReadOnly(this,"_types",{});const Gt={},Yt={},Xt={};Object.keys(Wt).forEach(Qt=>{Gt[Qt]={},Yt[Qt]=[],Xt[Qt]={}});for(const Qt in Wt){const ur={};Wt[Qt].forEach(cr=>{ur[cr.name]&&logger$A.throwArgumentError(`duplicate variable name ${JSON.stringify(cr.name)} in ${JSON.stringify(Qt)}`,"types",Wt),ur[cr.name]=!0;const $r=cr.type.match(/^([^\x5b]*)(\x5b|$)/)[1];$r===Qt&&logger$A.throwArgumentError(`circular type reference to ${JSON.stringify($r)}`,"types",Wt),!getBaseEncoder($r)&&(Yt[$r]||logger$A.throwArgumentError(`unknown type ${JSON.stringify($r)}`,"types",Wt),Yt[$r].push(Qt),Gt[Qt][$r]=!0)})}const Jt=Object.keys(Yt).filter(Qt=>Yt[Qt].length===0);Jt.length===0?logger$A.throwArgumentError("missing primary type","types",Wt):Jt.length>1&&logger$A.throwArgumentError(`ambiguous primary types or unused types: ${Jt.map(Qt=>JSON.stringify(Qt)).join(", ")}`,"types",Wt),defineReadOnly(this,"primaryType",Jt[0]);function Zt(Qt,ur){ur[Qt]&&logger$A.throwArgumentError(`circular type reference to ${JSON.stringify(Qt)}`,"types",Wt),ur[Qt]=!0,Object.keys(Gt[Qt]).forEach(cr=>{Yt[cr]&&(Zt(cr,ur),Object.keys(ur).forEach($r=>{Xt[$r][cr]=!0}))}),delete ur[Qt]}Zt(this.primaryType,{});for(const Qt in Xt){const ur=Object.keys(Xt[Qt]);ur.sort(),this._types[Qt]=encodeType(Qt,Wt[Qt])+ur.map(cr=>encodeType(cr,Wt[cr])).join("")}}getEncoder(Wt){let Gt=this._encoderCache[Wt];return Gt||(Gt=this._encoderCache[Wt]=this._getEncoder(Wt)),Gt}_getEncoder(Wt){{const Xt=getBaseEncoder(Wt);if(Xt)return Xt}const Gt=Wt.match(/^(.*)(\x5b(\d*)\x5d)$/);if(Gt){const Xt=Gt[1],Jt=this.getEncoder(Xt),Zt=parseInt(Gt[3]);return Qt=>{Zt>=0&&Qt.length!==Zt&&logger$A.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",Qt);let ur=Qt.map(Jt);return this._types[Xt]&&(ur=ur.map(keccak256$1)),keccak256$1(hexConcat(ur))}}const Yt=this.types[Wt];if(Yt){const Xt=id(this._types[Wt]);return Jt=>{const Zt=Yt.map(({name:Qt,type:ur})=>{const cr=this.getEncoder(ur)(Jt[Qt]);return this._types[ur]?keccak256$1(cr):cr});return Zt.unshift(Xt),hexConcat(Zt)}}return logger$A.throwArgumentError(`unknown type: ${Wt}`,"type",Wt)}encodeType(Wt){const Gt=this._types[Wt];return Gt||logger$A.throwArgumentError(`unknown type: ${JSON.stringify(Wt)}`,"name",Wt),Gt}encodeData(Wt,Gt){return this.getEncoder(Wt)(Gt)}hashStruct(Wt,Gt){return keccak256$1(this.encodeData(Wt,Gt))}encode(Wt){return this.encodeData(this.primaryType,Wt)}hash(Wt){return this.hashStruct(this.primaryType,Wt)}_visit(Wt,Gt,Yt){if(getBaseEncoder(Wt))return Yt(Wt,Gt);const Xt=Wt.match(/^(.*)(\x5b(\d*)\x5d)$/);if(Xt){const Zt=Xt[1],Qt=parseInt(Xt[3]);return Qt>=0&&Gt.length!==Qt&&logger$A.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",Gt),Gt.map(ur=>this._visit(Zt,ur,Yt))}const Jt=this.types[Wt];return Jt?Jt.reduce((Zt,{name:Qt,type:ur})=>(Zt[Qt]=this._visit(ur,Gt[Qt],Yt),Zt),{}):logger$A.throwArgumentError(`unknown type: ${Wt}`,"type",Wt)}visit(Wt,Gt){return this._visit(this.primaryType,Wt,Gt)}static from(Wt){return new TypedDataEncoder(Wt)}static getPrimaryType(Wt){return TypedDataEncoder.from(Wt).primaryType}static hashStruct(Wt,Gt,Yt){return TypedDataEncoder.from(Gt).hashStruct(Wt,Yt)}static hashDomain(Wt){const Gt=[];for(const Yt in Wt){const Xt=domainFieldTypes[Yt];Xt||logger$A.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(Yt)}`,"domain",Wt),Gt.push({name:Yt,type:Xt})}return Gt.sort((Yt,Xt)=>domainFieldNames.indexOf(Yt.name)-domainFieldNames.indexOf(Xt.name)),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:Gt},Wt)}static encode(Wt,Gt,Yt){return hexConcat(["0x1901",TypedDataEncoder.hashDomain(Wt),TypedDataEncoder.from(Gt).hash(Yt)])}static hash(Wt,Gt,Yt){return keccak256$1(TypedDataEncoder.encode(Wt,Gt,Yt))}static resolveNames(Wt,Gt,Yt,Xt){return __awaiter$z(this,void 0,void 0,function*(){Wt=shallowCopy(Wt);const Jt={};Wt.verifyingContract&&!isHexString(Wt.verifyingContract,20)&&(Jt[Wt.verifyingContract]="0x");const Zt=TypedDataEncoder.from(Gt);Zt.visit(Yt,(Qt,ur)=>(Qt==="address"&&!isHexString(ur,20)&&(Jt[ur]="0x"),ur));for(const Qt in Jt)Jt[Qt]=yield Xt(Qt);return Wt.verifyingContract&&Jt[Wt.verifyingContract]&&(Wt.verifyingContract=Jt[Wt.verifyingContract]),Yt=Zt.visit(Yt,(Qt,ur)=>Qt==="address"&&Jt[ur]?Jt[ur]:ur),{domain:Wt,value:Yt}})}static getPayload(Wt,Gt,Yt){TypedDataEncoder.hashDomain(Wt);const Xt={},Jt=[];domainFieldNames.forEach(ur=>{const cr=Wt[ur];cr!=null&&(Xt[ur]=domainChecks[ur](cr),Jt.push({name:ur,type:domainFieldTypes[ur]}))});const Zt=TypedDataEncoder.from(Gt),Qt=shallowCopy(Gt);return Qt.EIP712Domain?logger$A.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",Gt):Qt.EIP712Domain=Jt,Zt.encode(Yt),{types:Qt,domain:Xt,primaryType:Zt.primaryType,message:Zt.visit(Yt,(ur,cr)=>{if(ur.match(/^bytes(\d*)/))return hexlify(arrayify(cr));if(ur.match(/^u?int/))return BigNumber.from(cr).toString();switch(ur){case"address":return cr.toLowerCase();case"bool":return!!cr;case"string":return typeof cr!="string"&&logger$A.throwArgumentError("invalid string","value",cr),cr}return logger$A.throwArgumentError("unsupported type","type",ur)})}}}const logger$z=new Logger(version$r);class LogDescription extends Description{}class TransactionDescription extends Description{}class ErrorDescription extends Description{}class Indexed extends Description{static isIndexed(Wt){return!!(Wt&&Wt._isIndexed)}}const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(Bt,Wt){const Gt=new Error(`deferred error during ABI decoding triggered accessing ${Bt}`);return Gt.error=Wt,Gt}class Interface{constructor(Wt){let Gt=[];typeof Wt=="string"?Gt=JSON.parse(Wt):Gt=Wt,defineReadOnly(this,"fragments",Gt.map(Yt=>Fragment.from(Yt)).filter(Yt=>Yt!=null)),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach(Yt=>{let Xt=null;switch(Yt.type){case"constructor":if(this.deploy){logger$z.warn("duplicate definition - constructor");return}defineReadOnly(this,"deploy",Yt);return;case"function":Xt=this.functions;break;case"event":Xt=this.events;break;case"error":Xt=this.errors;break;default:return}let Jt=Yt.format();if(Xt[Jt]){logger$z.warn("duplicate definition - "+Jt);return}Xt[Jt]=Yt}),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(Wt){Wt||(Wt=FormatTypes.full),Wt===FormatTypes.sighash&&logger$z.throwArgumentError("interface does not support formatting sighash","format",Wt);const Gt=this.fragments.map(Yt=>Yt.format(Wt));return Wt===FormatTypes.json?JSON.stringify(Gt.map(Yt=>JSON.parse(Yt))):Gt}static getAbiCoder(){return defaultAbiCoder}static getAddress(Wt){return getAddress(Wt)}static getSighash(Wt){return hexDataSlice(id(Wt.format()),0,4)}static getEventTopic(Wt){return id(Wt.format())}getFunction(Wt){if(isHexString(Wt)){for(const Yt in this.functions)if(Wt===this.getSighash(Yt))return this.functions[Yt];logger$z.throwArgumentError("no matching function","sighash",Wt)}if(Wt.indexOf("(")===-1){const Yt=Wt.trim(),Xt=Object.keys(this.functions).filter(Jt=>Jt.split("(")[0]===Yt);return Xt.length===0?logger$z.throwArgumentError("no matching function","name",Yt):Xt.length>1&&logger$z.throwArgumentError("multiple matching functions","name",Yt),this.functions[Xt[0]]}const Gt=this.functions[FunctionFragment.fromString(Wt).format()];return Gt||logger$z.throwArgumentError("no matching function","signature",Wt),Gt}getEvent(Wt){if(isHexString(Wt)){const Yt=Wt.toLowerCase();for(const Xt in this.events)if(Yt===this.getEventTopic(Xt))return this.events[Xt];logger$z.throwArgumentError("no matching event","topichash",Yt)}if(Wt.indexOf("(")===-1){const Yt=Wt.trim(),Xt=Object.keys(this.events).filter(Jt=>Jt.split("(")[0]===Yt);return Xt.length===0?logger$z.throwArgumentError("no matching event","name",Yt):Xt.length>1&&logger$z.throwArgumentError("multiple matching events","name",Yt),this.events[Xt[0]]}const Gt=this.events[EventFragment.fromString(Wt).format()];return Gt||logger$z.throwArgumentError("no matching event","signature",Wt),Gt}getError(Wt){if(isHexString(Wt)){const Yt=getStatic(this.constructor,"getSighash");for(const Xt in this.errors){const Jt=this.errors[Xt];if(Wt===Yt(Jt))return this.errors[Xt]}logger$z.throwArgumentError("no matching error","sighash",Wt)}if(Wt.indexOf("(")===-1){const Yt=Wt.trim(),Xt=Object.keys(this.errors).filter(Jt=>Jt.split("(")[0]===Yt);return Xt.length===0?logger$z.throwArgumentError("no matching error","name",Yt):Xt.length>1&&logger$z.throwArgumentError("multiple matching errors","name",Yt),this.errors[Xt[0]]}const Gt=this.errors[FunctionFragment.fromString(Wt).format()];return Gt||logger$z.throwArgumentError("no matching error","signature",Wt),Gt}getSighash(Wt){if(typeof Wt=="string")try{Wt=this.getFunction(Wt)}catch(Gt){try{Wt=this.getError(Wt)}catch{throw Gt}}return getStatic(this.constructor,"getSighash")(Wt)}getEventTopic(Wt){return typeof Wt=="string"&&(Wt=this.getEvent(Wt)),getStatic(this.constructor,"getEventTopic")(Wt)}_decodeParams(Wt,Gt){return this._abiCoder.decode(Wt,Gt)}_encodeParams(Wt,Gt){return this._abiCoder.encode(Wt,Gt)}encodeDeploy(Wt){return this._encodeParams(this.deploy.inputs,Wt||[])}decodeErrorResult(Wt,Gt){typeof Wt=="string"&&(Wt=this.getError(Wt));const Yt=arrayify(Gt);return hexlify(Yt.slice(0,4))!==this.getSighash(Wt)&&logger$z.throwArgumentError(`data signature does not match error ${Wt.name}.`,"data",hexlify(Yt)),this._decodeParams(Wt.inputs,Yt.slice(4))}encodeErrorResult(Wt,Gt){return typeof Wt=="string"&&(Wt=this.getError(Wt)),hexlify(concat$2([this.getSighash(Wt),this._encodeParams(Wt.inputs,Gt||[])]))}decodeFunctionData(Wt,Gt){typeof Wt=="string"&&(Wt=this.getFunction(Wt));const Yt=arrayify(Gt);return hexlify(Yt.slice(0,4))!==this.getSighash(Wt)&&logger$z.throwArgumentError(`data signature does not match function ${Wt.name}.`,"data",hexlify(Yt)),this._decodeParams(Wt.inputs,Yt.slice(4))}encodeFunctionData(Wt,Gt){return typeof Wt=="string"&&(Wt=this.getFunction(Wt)),hexlify(concat$2([this.getSighash(Wt),this._encodeParams(Wt.inputs,Gt||[])]))}decodeFunctionResult(Wt,Gt){typeof Wt=="string"&&(Wt=this.getFunction(Wt));let Yt=arrayify(Gt),Xt=null,Jt="",Zt=null,Qt=null,ur=null;switch(Yt.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(Wt.outputs,Yt)}catch{}break;case 4:{const cr=hexlify(Yt.slice(0,4)),$r=BuiltinErrors[cr];if($r)Zt=this._abiCoder.decode($r.inputs,Yt.slice(4)),Qt=$r.name,ur=$r.signature,$r.reason&&(Xt=Zt[0]),Qt==="Error"?Jt=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(Zt[0])}`:Qt==="Panic"&&(Jt=`; VM Exception while processing transaction: reverted with panic code ${Zt[0]}`);else try{const Ar=this.getError(cr);Zt=this._abiCoder.decode(Ar.inputs,Yt.slice(4)),Qt=Ar.name,ur=Ar.format()}catch{}break}}return logger$z.throwError("call revert exception"+Jt,Logger.errors.CALL_EXCEPTION,{method:Wt.format(),data:hexlify(Gt),errorArgs:Zt,errorName:Qt,errorSignature:ur,reason:Xt})}encodeFunctionResult(Wt,Gt){return typeof Wt=="string"&&(Wt=this.getFunction(Wt)),hexlify(this._abiCoder.encode(Wt.outputs,Gt||[]))}encodeFilterTopics(Wt,Gt){typeof Wt=="string"&&(Wt=this.getEvent(Wt)),Gt.length>Wt.inputs.length&&logger$z.throwError("too many arguments for "+Wt.format(),Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:Gt});let Yt=[];Wt.anonymous||Yt.push(this.getEventTopic(Wt));const Xt=(Jt,Zt)=>Jt.type==="string"?id(Zt):Jt.type==="bytes"?keccak256$1(hexlify(Zt)):(Jt.type==="bool"&&typeof Zt=="boolean"&&(Zt=Zt?"0x01":"0x00"),Jt.type.match(/^u?int/)&&(Zt=BigNumber.from(Zt).toHexString()),Jt.type==="address"&&this._abiCoder.encode(["address"],[Zt]),hexZeroPad(hexlify(Zt),32));for(Gt.forEach((Jt,Zt)=>{let Qt=Wt.inputs[Zt];if(!Qt.indexed){Jt!=null&&logger$z.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+Qt.name,Jt);return}Jt==null?Yt.push(null):Qt.baseType==="array"||Qt.baseType==="tuple"?logger$z.throwArgumentError("filtering with tuples or arrays not supported","contract."+Qt.name,Jt):Array.isArray(Jt)?Yt.push(Jt.map(ur=>Xt(Qt,ur))):Yt.push(Xt(Qt,Jt))});Yt.length&&Yt[Yt.length-1]===null;)Yt.pop();return Yt}encodeEventLog(Wt,Gt){typeof Wt=="string"&&(Wt=this.getEvent(Wt));const Yt=[],Xt=[],Jt=[];return Wt.anonymous||Yt.push(this.getEventTopic(Wt)),Gt.length!==Wt.inputs.length&&logger$z.throwArgumentError("event arguments/values mismatch","values",Gt),Wt.inputs.forEach((Zt,Qt)=>{const ur=Gt[Qt];if(Zt.indexed)if(Zt.type==="string")Yt.push(id(ur));else if(Zt.type==="bytes")Yt.push(keccak256$1(ur));else{if(Zt.baseType==="tuple"||Zt.baseType==="array")throw new Error("not implemented");Yt.push(this._abiCoder.encode([Zt.type],[ur]))}else Xt.push(Zt),Jt.push(ur)}),{data:this._abiCoder.encode(Xt,Jt),topics:Yt}}decodeEventLog(Wt,Gt,Yt){if(typeof Wt=="string"&&(Wt=this.getEvent(Wt)),Yt!=null&&!Wt.anonymous){let Lr=this.getEventTopic(Wt);(!isHexString(Yt[0],32)||Yt[0].toLowerCase()!==Lr)&&logger$z.throwError("fragment/topic mismatch",Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:Lr,value:Yt[0]}),Yt=Yt.slice(1)}let Xt=[],Jt=[],Zt=[];Wt.inputs.forEach((Lr,qr)=>{Lr.indexed?Lr.type==="string"||Lr.type==="bytes"||Lr.baseType==="tuple"||Lr.baseType==="array"?(Xt.push(ParamType.fromObject({type:"bytes32",name:Lr.name})),Zt.push(!0)):(Xt.push(Lr),Zt.push(!1)):(Jt.push(Lr),Zt.push(!1))});let Qt=Yt!=null?this._abiCoder.decode(Xt,concat$2(Yt)):null,ur=this._abiCoder.decode(Jt,Gt,!0),cr=[],$r=0,Ar=0;Wt.inputs.forEach((Lr,qr)=>{if(Lr.indexed)if(Qt==null)cr[qr]=new Indexed({_isIndexed:!0,hash:null});else if(Zt[qr])cr[qr]=new Indexed({_isIndexed:!0,hash:Qt[Ar++]});else try{cr[qr]=Qt[Ar++]}catch(Fr){cr[qr]=Fr}else try{cr[qr]=ur[$r++]}catch(Fr){cr[qr]=Fr}if(Lr.name&&cr[Lr.name]==null){const Fr=cr[qr];Fr instanceof Error?Object.defineProperty(cr,Lr.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(Lr.name)}`,Fr)}}):cr[Lr.name]=Fr}});for(let Lr=0;Lr<cr.length;Lr++){const qr=cr[Lr];qr instanceof Error&&Object.defineProperty(cr,Lr,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${Lr}`,qr)}})}return Object.freeze(cr)}parseTransaction(Wt){let Gt=this.getFunction(Wt.data.substring(0,10).toLowerCase());return Gt?new TransactionDescription({args:this._abiCoder.decode(Gt.inputs,"0x"+Wt.data.substring(10)),functionFragment:Gt,name:Gt.name,signature:Gt.format(),sighash:this.getSighash(Gt),value:BigNumber.from(Wt.value||"0")}):null}parseLog(Wt){let Gt=this.getEvent(Wt.topics[0]);return!Gt||Gt.anonymous?null:new LogDescription({eventFragment:Gt,name:Gt.name,signature:Gt.format(),topic:this.getEventTopic(Gt),args:this.decodeEventLog(Gt,Wt.data,Wt.topics)})}parseError(Wt){const Gt=hexlify(Wt);let Yt=this.getError(Gt.substring(0,10).toLowerCase());return Yt?new ErrorDescription({args:this._abiCoder.decode(Yt.inputs,"0x"+Gt.substring(10)),errorFragment:Yt,name:Yt.name,signature:Yt.format(),sighash:this.getSighash(Yt)}):null}static isInterface(Wt){return!!(Wt&&Wt._isInterface)}}const version$m="abstract-provider/5.7.0";var __awaiter$y=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$y=new Logger(version$m);class ForkEvent extends Description{static isForkEvent(Wt){return!!(Wt&&Wt._isForkEvent)}}class Provider{constructor(){logger$y.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$y(this,void 0,void 0,function*(){const{block:Wt,gasPrice:Gt}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(Zt=>null)});let Yt=null,Xt=null,Jt=null;return Wt&&Wt.baseFeePerGas&&(Yt=Wt.baseFeePerGas,Jt=BigNumber.from("1500000000"),Xt=Wt.baseFeePerGas.mul(2).add(Jt)),{lastBaseFeePerGas:Yt,maxFeePerGas:Xt,maxPriorityFeePerGas:Jt,gasPrice:Gt}})}addListener(Wt,Gt){return this.on(Wt,Gt)}removeListener(Wt,Gt){return this.off(Wt,Gt)}static isProvider(Wt){return!!(Wt&&Wt._isProvider)}}const version$l="abstract-signer/5.7.0";var __awaiter$x=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$x=new Logger(version$l),allowedTransactionKeys$6=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors$3=[Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED];let Signer$3=class mw{constructor(){logger$x.checkAbstract(new.target,mw),defineReadOnly(this,"_isSigner",!0)}getBalance(Wt){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),Wt)})}getTransactionCount(Wt){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),Wt)})}estimateGas(Wt){return __awaiter$x(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const Gt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.estimateGas(Gt)})}call(Wt,Gt){return __awaiter$x(this,void 0,void 0,function*(){this._checkProvider("call");const Yt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.call(Yt,Gt)})}sendTransaction(Wt){return __awaiter$x(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const Gt=yield this.populateTransaction(Wt),Yt=yield this.signTransaction(Gt);return yield this.provider.sendTransaction(Yt)})}getChainId(){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(Wt){return __awaiter$x(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(Wt)})}checkTransaction(Wt){for(const Yt in Wt)allowedTransactionKeys$6.indexOf(Yt)===-1&&logger$x.throwArgumentError("invalid transaction key: "+Yt,"transaction",Wt);const Gt=shallowCopy(Wt);return Gt.from==null?Gt.from=this.getAddress():Gt.from=Promise.all([Promise.resolve(Gt.from),this.getAddress()]).then(Yt=>(Yt[0].toLowerCase()!==Yt[1].toLowerCase()&&logger$x.throwArgumentError("from address mismatch","transaction",Wt),Yt[0])),Gt}populateTransaction(Wt){return __awaiter$x(this,void 0,void 0,function*(){const Gt=yield resolveProperties(this.checkTransaction(Wt));Gt.to!=null&&(Gt.to=Promise.resolve(Gt.to).then(Xt=>__awaiter$x(this,void 0,void 0,function*(){if(Xt==null)return null;const Jt=yield this.resolveName(Xt);return Jt==null&&logger$x.throwArgumentError("provided ENS name resolves to null","tx.to",Xt),Jt})),Gt.to.catch(Xt=>{}));const Yt=Gt.maxFeePerGas!=null||Gt.maxPriorityFeePerGas!=null;if(Gt.gasPrice!=null&&(Gt.type===2||Yt)?logger$x.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",Wt):(Gt.type===0||Gt.type===1)&&Yt&&logger$x.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",Wt),(Gt.type===2||Gt.type==null)&&Gt.maxFeePerGas!=null&&Gt.maxPriorityFeePerGas!=null)Gt.type=2;else if(Gt.type===0||Gt.type===1)Gt.gasPrice==null&&(Gt.gasPrice=this.getGasPrice());else{const Xt=yield this.getFeeData();if(Gt.type==null)if(Xt.maxFeePerGas!=null&&Xt.maxPriorityFeePerGas!=null)if(Gt.type=2,Gt.gasPrice!=null){const Jt=Gt.gasPrice;delete Gt.gasPrice,Gt.maxFeePerGas=Jt,Gt.maxPriorityFeePerGas=Jt}else Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas);else Xt.gasPrice!=null?(Yt&&logger$x.throwError("network does not support EIP-1559",Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),Gt.gasPrice==null&&(Gt.gasPrice=Xt.gasPrice),Gt.type=0):logger$x.throwError("failed to get consistent fee data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else Gt.type===2&&(Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas))}return Gt.nonce==null&&(Gt.nonce=this.getTransactionCount("pending")),Gt.gasLimit==null&&(Gt.gasLimit=this.estimateGas(Gt).catch(Xt=>{if(forwardErrors$3.indexOf(Xt.code)>=0)throw Xt;return logger$x.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Xt,tx:Gt})})),Gt.chainId==null?Gt.chainId=this.getChainId():Gt.chainId=Promise.all([Promise.resolve(Gt.chainId),this.getChainId()]).then(Xt=>(Xt[1]!==0&&Xt[0]!==Xt[1]&&logger$x.throwArgumentError("chainId address mismatch","transaction",Wt),Xt[0])),yield resolveProperties(Gt)})}_checkProvider(Wt){this.provider||logger$x.throwError("missing provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:Wt||"_checkProvider"})}static isSigner(Wt){return!!(Wt&&Wt._isSigner)}},VoidSigner$1=class yw extends Signer$3{constructor(Wt,Gt){super(),defineReadOnly(this,"address",Wt),defineReadOnly(this,"provider",Gt||null)}getAddress(){return Promise.resolve(this.address)}_fail(Wt,Gt){return Promise.resolve().then(()=>{logger$x.throwError(Wt,Logger.errors.UNSUPPORTED_OPERATION,{operation:Gt})})}signMessage(Wt){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(Wt){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(Wt,Gt,Yt){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(Wt){return new yw(this.address,Wt)}};function createCommonjsModule(Bt,Wt,Gt){return Gt={path:Wt,exports:{},require:function(Yt,Xt){return commonjsRequire(Yt,Xt??Gt.path)}},Bt(Gt,Gt.exports),Gt.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var minimalisticAssert=assert$2;function assert$2(Bt,Wt){if(!Bt)throw new Error(Wt||"Assertion failed")}assert$2.equal=function(Wt,Gt,Yt){if(Wt!=Gt)throw new Error(Yt||"Assertion failed: "+Wt+" != "+Gt)};var utils_1$m=createCommonjsModule(function(Bt,Wt){var Gt=Wt;function Yt(Zt,Qt){if(Array.isArray(Zt))return Zt.slice();if(!Zt)return[];var ur=[];if(typeof Zt!="string"){for(var cr=0;cr<Zt.length;cr++)ur[cr]=Zt[cr]|0;return ur}if(Qt==="hex"){Zt=Zt.replace(/[^a-z0-9]+/ig,""),Zt.length%2!==0&&(Zt="0"+Zt);for(var cr=0;cr<Zt.length;cr+=2)ur.push(parseInt(Zt[cr]+Zt[cr+1],16))}else for(var cr=0;cr<Zt.length;cr++){var $r=Zt.charCodeAt(cr),Ar=$r>>8,Lr=$r&255;Ar?ur.push(Ar,Lr):ur.push(Lr)}return ur}Gt.toArray=Yt;function Xt(Zt){return Zt.length===1?"0"+Zt:Zt}Gt.zero2=Xt;function Jt(Zt){for(var Qt="",ur=0;ur<Zt.length;ur++)Qt+=Xt(Zt[ur].toString(16));return Qt}Gt.toHex=Jt,Gt.encode=function(Qt,ur){return ur==="hex"?Jt(Qt):Qt}}),utils_1$1$1=createCommonjsModule(function(Bt,Wt){var Gt=Wt;Gt.assert=minimalisticAssert,Gt.toArray=utils_1$m.toArray,Gt.zero2=utils_1$m.zero2,Gt.toHex=utils_1$m.toHex,Gt.encode=utils_1$m.encode;function Yt(ur,cr,$r){var Ar=new Array(Math.max(ur.bitLength(),$r)+1);Ar.fill(0);for(var Lr=1<<cr+1,qr=ur.clone(),Fr=0;Fr<Ar.length;Fr++){var Hr,Br=qr.andln(Lr-1);qr.isOdd()?(Br>(Lr>>1)-1?Hr=(Lr>>1)-Br:Hr=Br,qr.isubn(Hr)):Hr=0,Ar[Fr]=Hr,qr.iushrn(1)}return Ar}Gt.getNAF=Yt;function Xt(ur,cr){var $r=[[],[]];ur=ur.clone(),cr=cr.clone();for(var Ar=0,Lr=0,qr;ur.cmpn(-Ar)>0||cr.cmpn(-Lr)>0;){var Fr=ur.andln(3)+Ar&3,Hr=cr.andln(3)+Lr&3;Fr===3&&(Fr=-1),Hr===3&&(Hr=-1);var Br;Fr&1?(qr=ur.andln(7)+Ar&7,(qr===3||qr===5)&&Hr===2?Br=-Fr:Br=Fr):Br=0,$r[0].push(Br);var Wr;Hr&1?(qr=cr.andln(7)+Lr&7,(qr===3||qr===5)&&Fr===2?Wr=-Hr:Wr=Hr):Wr=0,$r[1].push(Wr),2*Ar===Br+1&&(Ar=1-Ar),2*Lr===Wr+1&&(Lr=1-Lr),ur.iushrn(1),cr.iushrn(1)}return $r}Gt.getJSF=Xt;function Jt(ur,cr,$r){var Ar="_"+cr;ur.prototype[cr]=function(){return this[Ar]!==void 0?this[Ar]:this[Ar]=$r.call(this)}}Gt.cachedProperty=Jt;function Zt(ur){return typeof ur=="string"?Gt.toArray(ur,"hex"):ur}Gt.parseBytes=Zt;function Qt(ur){return new BN$7(ur,"hex","le")}Gt.intFromLE=Qt}),getNAF=utils_1$1$1.getNAF,getJSF=utils_1$1$1.getJSF,assert$1$1=utils_1$1$1.assert;function BaseCurve(Bt,Wt){this.type=Bt,this.p=new BN$7(Wt.p,16),this.red=Wt.prime?BN$7.red(Wt.prime):BN$7.mont(this.p),this.zero=new BN$7(0).toRed(this.red),this.one=new BN$7(1).toRed(this.red),this.two=new BN$7(2).toRed(this.red),this.n=Wt.n&&new BN$7(Wt.n,16),this.g=Wt.g&&this.pointFromJSON(Wt.g,Wt.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var Gt=this.n&&this.p.div(this.n);!Gt||Gt.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$2=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function(Wt,Gt){assert$1$1(Wt.precomputed);var Yt=Wt._getDoubles(),Xt=getNAF(Gt,1,this._bitLength),Jt=(1<<Yt.step+1)-(Yt.step%2===0?2:1);Jt/=3;var Zt=[],Qt,ur;for(Qt=0;Qt<Xt.length;Qt+=Yt.step){ur=0;for(var cr=Qt+Yt.step-1;cr>=Qt;cr--)ur=(ur<<1)+Xt[cr];Zt.push(ur)}for(var $r=this.jpoint(null,null,null),Ar=this.jpoint(null,null,null),Lr=Jt;Lr>0;Lr--){for(Qt=0;Qt<Zt.length;Qt++)ur=Zt[Qt],ur===Lr?Ar=Ar.mixedAdd(Yt.points[Qt]):ur===-Lr&&(Ar=Ar.mixedAdd(Yt.points[Qt].neg()));$r=$r.add(Ar)}return $r.toP()};BaseCurve.prototype._wnafMul=function(Wt,Gt){var Yt=4,Xt=Wt._getNAFPoints(Yt);Yt=Xt.wnd;for(var Jt=Xt.points,Zt=getNAF(Gt,Yt,this._bitLength),Qt=this.jpoint(null,null,null),ur=Zt.length-1;ur>=0;ur--){for(var cr=0;ur>=0&&Zt[ur]===0;ur--)cr++;if(ur>=0&&cr++,Qt=Qt.dblp(cr),ur<0)break;var $r=Zt[ur];assert$1$1($r!==0),Wt.type==="affine"?$r>0?Qt=Qt.mixedAdd(Jt[$r-1>>1]):Qt=Qt.mixedAdd(Jt[-$r-1>>1].neg()):$r>0?Qt=Qt.add(Jt[$r-1>>1]):Qt=Qt.add(Jt[-$r-1>>1].neg())}return Wt.type==="affine"?Qt.toP():Qt};BaseCurve.prototype._wnafMulAdd=function(Wt,Gt,Yt,Xt,Jt){var Zt=this._wnafT1,Qt=this._wnafT2,ur=this._wnafT3,cr=0,$r,Ar,Lr;for($r=0;$r<Xt;$r++){Lr=Gt[$r];var qr=Lr._getNAFPoints(Wt);Zt[$r]=qr.wnd,Qt[$r]=qr.points}for($r=Xt-1;$r>=1;$r-=2){var Fr=$r-1,Hr=$r;if(Zt[Fr]!==1||Zt[Hr]!==1){ur[Fr]=getNAF(Yt[Fr],Zt[Fr],this._bitLength),ur[Hr]=getNAF(Yt[Hr],Zt[Hr],this._bitLength),cr=Math.max(ur[Fr].length,cr),cr=Math.max(ur[Hr].length,cr);continue}var Br=[Gt[Fr],null,null,Gt[Hr]];Gt[Fr].y.cmp(Gt[Hr].y)===0?(Br[1]=Gt[Fr].add(Gt[Hr]),Br[2]=Gt[Fr].toJ().mixedAdd(Gt[Hr].neg())):Gt[Fr].y.cmp(Gt[Hr].y.redNeg())===0?(Br[1]=Gt[Fr].toJ().mixedAdd(Gt[Hr]),Br[2]=Gt[Fr].add(Gt[Hr].neg())):(Br[1]=Gt[Fr].toJ().mixedAdd(Gt[Hr]),Br[2]=Gt[Fr].toJ().mixedAdd(Gt[Hr].neg()));var Wr=[-3,-1,-5,-7,0,7,5,1,3],Gr=getJSF(Yt[Fr],Yt[Hr]);for(cr=Math.max(Gr[0].length,cr),ur[Fr]=new Array(cr),ur[Hr]=new Array(cr),Ar=0;Ar<cr;Ar++){var Kr=Gr[0][Ar]|0,Yr=Gr[1][Ar]|0;ur[Fr][Ar]=Wr[(Kr+1)*3+(Yr+1)],ur[Hr][Ar]=0,Qt[Fr]=Br}}var hn=this.jpoint(null,null,null),Qr=this._wnafT4;for($r=cr;$r>=0;$r--){for(var pn=0;$r>=0;){var En=!0;for(Ar=0;Ar<Xt;Ar++)Qr[Ar]=ur[Ar][$r]|0,Qr[Ar]!==0&&(En=!1);if(!En)break;pn++,$r--}if($r>=0&&pn++,hn=hn.dblp(pn),$r<0)break;for(Ar=0;Ar<Xt;Ar++){var ga=Qr[Ar];ga!==0&&(ga>0?Lr=Qt[Ar][ga-1>>1]:ga<0&&(Lr=Qt[Ar][-ga-1>>1].neg()),Lr.type==="affine"?hn=hn.mixedAdd(Lr):hn=hn.add(Lr))}}for($r=0;$r<Xt;$r++)Qt[$r]=null;return Jt?hn:hn.toP()};function BasePoint(Bt,Wt){this.curve=Bt,this.type=Wt,this.precomputed=null}BaseCurve.BasePoint=BasePoint;BasePoint.prototype.eq=function(){throw new Error("Not implemented")};BasePoint.prototype.validate=function(){return this.curve.validate(this)};BaseCurve.prototype.decodePoint=function(Wt,Gt){Wt=utils_1$1$1.toArray(Wt,Gt);var Yt=this.p.byteLength();if((Wt[0]===4||Wt[0]===6||Wt[0]===7)&&Wt.length-1===2*Yt){Wt[0]===6?assert$1$1(Wt[Wt.length-1]%2===0):Wt[0]===7&&assert$1$1(Wt[Wt.length-1]%2===1);var Xt=this.point(Wt.slice(1,1+Yt),Wt.slice(1+Yt,1+2*Yt));return Xt}else if((Wt[0]===2||Wt[0]===3)&&Wt.length-1===Yt)return this.pointFromX(Wt.slice(1,1+Yt),Wt[0]===3);throw new Error("Unknown point format")};BasePoint.prototype.encodeCompressed=function(Wt){return this.encode(Wt,!0)};BasePoint.prototype._encode=function(Wt){var Gt=this.curve.p.byteLength(),Yt=this.getX().toArray("be",Gt);return Wt?[this.getY().isEven()?2:3].concat(Yt):[4].concat(Yt,this.getY().toArray("be",Gt))};BasePoint.prototype.encode=function(Wt,Gt){return utils_1$1$1.encode(this._encode(Gt),Wt)};BasePoint.prototype.precompute=function(Wt){if(this.precomputed)return this;var Gt={doubles:null,naf:null,beta:null};return Gt.naf=this._getNAFPoints(8),Gt.doubles=this._getDoubles(4,Wt),Gt.beta=this._getBeta(),this.precomputed=Gt,this};BasePoint.prototype._hasDoubles=function(Wt){if(!this.precomputed)return!1;var Gt=this.precomputed.doubles;return Gt?Gt.points.length>=Math.ceil((Wt.bitLength()+1)/Gt.step):!1};BasePoint.prototype._getDoubles=function(Wt,Gt){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var Yt=[this],Xt=this,Jt=0;Jt<Gt;Jt+=Wt){for(var Zt=0;Zt<Wt;Zt++)Xt=Xt.dbl();Yt.push(Xt)}return{step:Wt,points:Yt}};BasePoint.prototype._getNAFPoints=function(Wt){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var Gt=[this],Yt=(1<<Wt)-1,Xt=Yt===1?null:this.dbl(),Jt=1;Jt<Yt;Jt++)Gt[Jt]=Gt[Jt-1].add(Xt);return{wnd:Wt,points:Gt}};BasePoint.prototype._getBeta=function(){return null};BasePoint.prototype.dblp=function(Wt){for(var Gt=this,Yt=0;Yt<Wt;Yt++)Gt=Gt.dbl();return Gt};var inherits_browser=createCommonjsModule(function(Bt){typeof Object.create=="function"?Bt.exports=function(Gt,Yt){Yt&&(Gt.super_=Yt,Gt.prototype=Object.create(Yt.prototype,{constructor:{value:Gt,enumerable:!1,writable:!0,configurable:!0}}))}:Bt.exports=function(Gt,Yt){if(Yt){Gt.super_=Yt;var Xt=function(){};Xt.prototype=Yt.prototype,Gt.prototype=new Xt,Gt.prototype.constructor=Gt}}}),assert$2$1=utils_1$1$1.assert;function ShortCurve(Bt){base$2.call(this,"short",Bt),this.a=new BN$7(Bt.a,16).toRed(this.red),this.b=new BN$7(Bt.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(Bt),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits_browser(ShortCurve,base$2);var short_1=ShortCurve;ShortCurve.prototype._getEndomorphism=function(Wt){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var Gt,Yt;if(Wt.beta)Gt=new BN$7(Wt.beta,16).toRed(this.red);else{var Xt=this._getEndoRoots(this.p);Gt=Xt[0].cmp(Xt[1])<0?Xt[0]:Xt[1],Gt=Gt.toRed(this.red)}if(Wt.lambda)Yt=new BN$7(Wt.lambda,16);else{var Jt=this._getEndoRoots(this.n);this.g.mul(Jt[0]).x.cmp(this.g.x.redMul(Gt))===0?Yt=Jt[0]:(Yt=Jt[1],assert$2$1(this.g.mul(Yt).x.cmp(this.g.x.redMul(Gt))===0))}var Zt;return Wt.basis?Zt=Wt.basis.map(function(Qt){return{a:new BN$7(Qt.a,16),b:new BN$7(Qt.b,16)}}):Zt=this._getEndoBasis(Yt),{beta:Gt,lambda:Yt,basis:Zt}}};ShortCurve.prototype._getEndoRoots=function(Wt){var Gt=Wt===this.p?this.red:BN$7.mont(Wt),Yt=new BN$7(2).toRed(Gt).redInvm(),Xt=Yt.redNeg(),Jt=new BN$7(3).toRed(Gt).redNeg().redSqrt().redMul(Yt),Zt=Xt.redAdd(Jt).fromRed(),Qt=Xt.redSub(Jt).fromRed();return[Zt,Qt]};ShortCurve.prototype._getEndoBasis=function(Wt){for(var Gt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),Yt=Wt,Xt=this.n.clone(),Jt=new BN$7(1),Zt=new BN$7(0),Qt=new BN$7(0),ur=new BN$7(1),cr,$r,Ar,Lr,qr,Fr,Hr,Br=0,Wr,Gr;Yt.cmpn(0)!==0;){var Kr=Xt.div(Yt);Wr=Xt.sub(Kr.mul(Yt)),Gr=Qt.sub(Kr.mul(Jt));var Yr=ur.sub(Kr.mul(Zt));if(!Ar&&Wr.cmp(Gt)<0)cr=Hr.neg(),$r=Jt,Ar=Wr.neg(),Lr=Gr;else if(Ar&&++Br===2)break;Hr=Wr,Xt=Yt,Yt=Wr,Qt=Jt,Jt=Gr,ur=Zt,Zt=Yr}qr=Wr.neg(),Fr=Gr;var hn=Ar.sqr().add(Lr.sqr()),Qr=qr.sqr().add(Fr.sqr());return Qr.cmp(hn)>=0&&(qr=cr,Fr=$r),Ar.negative&&(Ar=Ar.neg(),Lr=Lr.neg()),qr.negative&&(qr=qr.neg(),Fr=Fr.neg()),[{a:Ar,b:Lr},{a:qr,b:Fr}]};ShortCurve.prototype._endoSplit=function(Wt){var Gt=this.endo.basis,Yt=Gt[0],Xt=Gt[1],Jt=Xt.b.mul(Wt).divRound(this.n),Zt=Yt.b.neg().mul(Wt).divRound(this.n),Qt=Jt.mul(Yt.a),ur=Zt.mul(Xt.a),cr=Jt.mul(Yt.b),$r=Zt.mul(Xt.b),Ar=Wt.sub(Qt).sub(ur),Lr=cr.add($r).neg();return{k1:Ar,k2:Lr}};ShortCurve.prototype.pointFromX=function(Wt,Gt){Wt=new BN$7(Wt,16),Wt.red||(Wt=Wt.toRed(this.red));var Yt=Wt.redSqr().redMul(Wt).redIAdd(Wt.redMul(this.a)).redIAdd(this.b),Xt=Yt.redSqrt();if(Xt.redSqr().redSub(Yt).cmp(this.zero)!==0)throw new Error("invalid point");var Jt=Xt.fromRed().isOdd();return(Gt&&!Jt||!Gt&&Jt)&&(Xt=Xt.redNeg()),this.point(Wt,Xt)};ShortCurve.prototype.validate=function(Wt){if(Wt.inf)return!0;var Gt=Wt.x,Yt=Wt.y,Xt=this.a.redMul(Gt),Jt=Gt.redSqr().redMul(Gt).redIAdd(Xt).redIAdd(this.b);return Yt.redSqr().redISub(Jt).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function(Wt,Gt,Yt){for(var Xt=this._endoWnafT1,Jt=this._endoWnafT2,Zt=0;Zt<Wt.length;Zt++){var Qt=this._endoSplit(Gt[Zt]),ur=Wt[Zt],cr=ur._getBeta();Qt.k1.negative&&(Qt.k1.ineg(),ur=ur.neg(!0)),Qt.k2.negative&&(Qt.k2.ineg(),cr=cr.neg(!0)),Xt[Zt*2]=ur,Xt[Zt*2+1]=cr,Jt[Zt*2]=Qt.k1,Jt[Zt*2+1]=Qt.k2}for(var $r=this._wnafMulAdd(1,Xt,Jt,Zt*2,Yt),Ar=0;Ar<Zt*2;Ar++)Xt[Ar]=null,Jt[Ar]=null;return $r};function Point(Bt,Wt,Gt,Yt){base$2.BasePoint.call(this,Bt,"affine"),Wt===null&&Gt===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$7(Wt,16),this.y=new BN$7(Gt,16),Yt&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}inherits_browser(Point,base$2.BasePoint);ShortCurve.prototype.point=function(Wt,Gt,Yt){return new Point(this,Wt,Gt,Yt)};ShortCurve.prototype.pointFromJSON=function(Wt,Gt){return Point.fromJSON(this,Wt,Gt)};Point.prototype._getBeta=function(){if(this.curve.endo){var Wt=this.precomputed;if(Wt&&Wt.beta)return Wt.beta;var Gt=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(Wt){var Yt=this.curve,Xt=function(Jt){return Yt.point(Jt.x.redMul(Yt.endo.beta),Jt.y)};Wt.beta=Gt,Gt.precomputed={beta:null,naf:Wt.naf&&{wnd:Wt.naf.wnd,points:Wt.naf.points.map(Xt)},doubles:Wt.doubles&&{step:Wt.doubles.step,points:Wt.doubles.points.map(Xt)}}}return Gt}};Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Point.fromJSON=function(Wt,Gt,Yt){typeof Gt=="string"&&(Gt=JSON.parse(Gt));var Xt=Wt.point(Gt[0],Gt[1],Yt);if(!Gt[2])return Xt;function Jt(Qt){return Wt.point(Qt[0],Qt[1],Yt)}var Zt=Gt[2];return Xt.precomputed={beta:null,doubles:Zt.doubles&&{step:Zt.doubles.step,points:[Xt].concat(Zt.doubles.points.map(Jt))},naf:Zt.naf&&{wnd:Zt.naf.wnd,points:[Xt].concat(Zt.naf.points.map(Jt))}},Xt};Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=function(){return this.inf};Point.prototype.add=function(Wt){if(this.inf)return Wt;if(Wt.inf)return this;if(this.eq(Wt))return this.dbl();if(this.neg().eq(Wt))return this.curve.point(null,null);if(this.x.cmp(Wt.x)===0)return this.curve.point(null,null);var Gt=this.y.redSub(Wt.y);Gt.cmpn(0)!==0&&(Gt=Gt.redMul(this.x.redSub(Wt.x).redInvm()));var Yt=Gt.redSqr().redISub(this.x).redISub(Wt.x),Xt=Gt.redMul(this.x.redSub(Yt)).redISub(this.y);return this.curve.point(Yt,Xt)};Point.prototype.dbl=function(){if(this.inf)return this;var Wt=this.y.redAdd(this.y);if(Wt.cmpn(0)===0)return this.curve.point(null,null);var Gt=this.curve.a,Yt=this.x.redSqr(),Xt=Wt.redInvm(),Jt=Yt.redAdd(Yt).redIAdd(Yt).redIAdd(Gt).redMul(Xt),Zt=Jt.redSqr().redISub(this.x.redAdd(this.x)),Qt=Jt.redMul(this.x.redSub(Zt)).redISub(this.y);return this.curve.point(Zt,Qt)};Point.prototype.getX=function(){return this.x.fromRed()};Point.prototype.getY=function(){return this.y.fromRed()};Point.prototype.mul=function(Wt){return Wt=new BN$7(Wt,16),this.isInfinity()?this:this._hasDoubles(Wt)?this.curve._fixedNafMul(this,Wt):this.curve.endo?this.curve._endoWnafMulAdd([this],[Wt]):this.curve._wnafMul(this,Wt)};Point.prototype.mulAdd=function(Wt,Gt,Yt){var Xt=[this,Gt],Jt=[Wt,Yt];return this.curve.endo?this.curve._endoWnafMulAdd(Xt,Jt):this.curve._wnafMulAdd(1,Xt,Jt,2)};Point.prototype.jmulAdd=function(Wt,Gt,Yt){var Xt=[this,Gt],Jt=[Wt,Yt];return this.curve.endo?this.curve._endoWnafMulAdd(Xt,Jt,!0):this.curve._wnafMulAdd(1,Xt,Jt,2,!0)};Point.prototype.eq=function(Wt){return this===Wt||this.inf===Wt.inf&&(this.inf||this.x.cmp(Wt.x)===0&&this.y.cmp(Wt.y)===0)};Point.prototype.neg=function(Wt){if(this.inf)return this;var Gt=this.curve.point(this.x,this.y.redNeg());if(Wt&&this.precomputed){var Yt=this.precomputed,Xt=function(Jt){return Jt.neg()};Gt.precomputed={naf:Yt.naf&&{wnd:Yt.naf.wnd,points:Yt.naf.points.map(Xt)},doubles:Yt.doubles&&{step:Yt.doubles.step,points:Yt.doubles.points.map(Xt)}}}return Gt};Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var Wt=this.curve.jpoint(this.x,this.y,this.curve.one);return Wt};function JPoint(Bt,Wt,Gt,Yt){base$2.BasePoint.call(this,Bt,"jacobian"),Wt===null&&Gt===null&&Yt===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$7(0)):(this.x=new BN$7(Wt,16),this.y=new BN$7(Gt,16),this.z=new BN$7(Yt,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits_browser(JPoint,base$2.BasePoint);ShortCurve.prototype.jpoint=function(Wt,Gt,Yt){return new JPoint(this,Wt,Gt,Yt)};JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Wt=this.z.redInvm(),Gt=Wt.redSqr(),Yt=this.x.redMul(Gt),Xt=this.y.redMul(Gt).redMul(Wt);return this.curve.point(Yt,Xt)};JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function(Wt){if(this.isInfinity())return Wt;if(Wt.isInfinity())return this;var Gt=Wt.z.redSqr(),Yt=this.z.redSqr(),Xt=this.x.redMul(Gt),Jt=Wt.x.redMul(Yt),Zt=this.y.redMul(Gt.redMul(Wt.z)),Qt=Wt.y.redMul(Yt.redMul(this.z)),ur=Xt.redSub(Jt),cr=Zt.redSub(Qt);if(ur.cmpn(0)===0)return cr.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var $r=ur.redSqr(),Ar=$r.redMul(ur),Lr=Xt.redMul($r),qr=cr.redSqr().redIAdd(Ar).redISub(Lr).redISub(Lr),Fr=cr.redMul(Lr.redISub(qr)).redISub(Zt.redMul(Ar)),Hr=this.z.redMul(Wt.z).redMul(ur);return this.curve.jpoint(qr,Fr,Hr)};JPoint.prototype.mixedAdd=function(Wt){if(this.isInfinity())return Wt.toJ();if(Wt.isInfinity())return this;var Gt=this.z.redSqr(),Yt=this.x,Xt=Wt.x.redMul(Gt),Jt=this.y,Zt=Wt.y.redMul(Gt).redMul(this.z),Qt=Yt.redSub(Xt),ur=Jt.redSub(Zt);if(Qt.cmpn(0)===0)return ur.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var cr=Qt.redSqr(),$r=cr.redMul(Qt),Ar=Yt.redMul(cr),Lr=ur.redSqr().redIAdd($r).redISub(Ar).redISub(Ar),qr=ur.redMul(Ar.redISub(Lr)).redISub(Jt.redMul($r)),Fr=this.z.redMul(Qt);return this.curve.jpoint(Lr,qr,Fr)};JPoint.prototype.dblp=function(Wt){if(Wt===0)return this;if(this.isInfinity())return this;if(!Wt)return this.dbl();var Gt;if(this.curve.zeroA||this.curve.threeA){var Yt=this;for(Gt=0;Gt<Wt;Gt++)Yt=Yt.dbl();return Yt}var Xt=this.curve.a,Jt=this.curve.tinv,Zt=this.x,Qt=this.y,ur=this.z,cr=ur.redSqr().redSqr(),$r=Qt.redAdd(Qt);for(Gt=0;Gt<Wt;Gt++){var Ar=Zt.redSqr(),Lr=$r.redSqr(),qr=Lr.redSqr(),Fr=Ar.redAdd(Ar).redIAdd(Ar).redIAdd(Xt.redMul(cr)),Hr=Zt.redMul(Lr),Br=Fr.redSqr().redISub(Hr.redAdd(Hr)),Wr=Hr.redISub(Br),Gr=Fr.redMul(Wr);Gr=Gr.redIAdd(Gr).redISub(qr);var Kr=$r.redMul(ur);Gt+1<Wt&&(cr=cr.redMul(qr)),Zt=Br,ur=Kr,$r=Gr}return this.curve.jpoint(Zt,$r.redMul(Jt),ur)};JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint.prototype._zeroDbl=function(){var Wt,Gt,Yt;if(this.zOne){var Xt=this.x.redSqr(),Jt=this.y.redSqr(),Zt=Jt.redSqr(),Qt=this.x.redAdd(Jt).redSqr().redISub(Xt).redISub(Zt);Qt=Qt.redIAdd(Qt);var ur=Xt.redAdd(Xt).redIAdd(Xt),cr=ur.redSqr().redISub(Qt).redISub(Qt),$r=Zt.redIAdd(Zt);$r=$r.redIAdd($r),$r=$r.redIAdd($r),Wt=cr,Gt=ur.redMul(Qt.redISub(cr)).redISub($r),Yt=this.y.redAdd(this.y)}else{var Ar=this.x.redSqr(),Lr=this.y.redSqr(),qr=Lr.redSqr(),Fr=this.x.redAdd(Lr).redSqr().redISub(Ar).redISub(qr);Fr=Fr.redIAdd(Fr);var Hr=Ar.redAdd(Ar).redIAdd(Ar),Br=Hr.redSqr(),Wr=qr.redIAdd(qr);Wr=Wr.redIAdd(Wr),Wr=Wr.redIAdd(Wr),Wt=Br.redISub(Fr).redISub(Fr),Gt=Hr.redMul(Fr.redISub(Wt)).redISub(Wr),Yt=this.y.redMul(this.z),Yt=Yt.redIAdd(Yt)}return this.curve.jpoint(Wt,Gt,Yt)};JPoint.prototype._threeDbl=function(){var Wt,Gt,Yt;if(this.zOne){var Xt=this.x.redSqr(),Jt=this.y.redSqr(),Zt=Jt.redSqr(),Qt=this.x.redAdd(Jt).redSqr().redISub(Xt).redISub(Zt);Qt=Qt.redIAdd(Qt);var ur=Xt.redAdd(Xt).redIAdd(Xt).redIAdd(this.curve.a),cr=ur.redSqr().redISub(Qt).redISub(Qt);Wt=cr;var $r=Zt.redIAdd(Zt);$r=$r.redIAdd($r),$r=$r.redIAdd($r),Gt=ur.redMul(Qt.redISub(cr)).redISub($r),Yt=this.y.redAdd(this.y)}else{var Ar=this.z.redSqr(),Lr=this.y.redSqr(),qr=this.x.redMul(Lr),Fr=this.x.redSub(Ar).redMul(this.x.redAdd(Ar));Fr=Fr.redAdd(Fr).redIAdd(Fr);var Hr=qr.redIAdd(qr);Hr=Hr.redIAdd(Hr);var Br=Hr.redAdd(Hr);Wt=Fr.redSqr().redISub(Br),Yt=this.y.redAdd(this.z).redSqr().redISub(Lr).redISub(Ar);var Wr=Lr.redSqr();Wr=Wr.redIAdd(Wr),Wr=Wr.redIAdd(Wr),Wr=Wr.redIAdd(Wr),Gt=Fr.redMul(Hr.redISub(Wt)).redISub(Wr)}return this.curve.jpoint(Wt,Gt,Yt)};JPoint.prototype._dbl=function(){var Wt=this.curve.a,Gt=this.x,Yt=this.y,Xt=this.z,Jt=Xt.redSqr().redSqr(),Zt=Gt.redSqr(),Qt=Yt.redSqr(),ur=Zt.redAdd(Zt).redIAdd(Zt).redIAdd(Wt.redMul(Jt)),cr=Gt.redAdd(Gt);cr=cr.redIAdd(cr);var $r=cr.redMul(Qt),Ar=ur.redSqr().redISub($r.redAdd($r)),Lr=$r.redISub(Ar),qr=Qt.redSqr();qr=qr.redIAdd(qr),qr=qr.redIAdd(qr),qr=qr.redIAdd(qr);var Fr=ur.redMul(Lr).redISub(qr),Hr=Yt.redAdd(Yt).redMul(Xt);return this.curve.jpoint(Ar,Fr,Hr)};JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var Wt=this.x.redSqr(),Gt=this.y.redSqr(),Yt=this.z.redSqr(),Xt=Gt.redSqr(),Jt=Wt.redAdd(Wt).redIAdd(Wt),Zt=Jt.redSqr(),Qt=this.x.redAdd(Gt).redSqr().redISub(Wt).redISub(Xt);Qt=Qt.redIAdd(Qt),Qt=Qt.redAdd(Qt).redIAdd(Qt),Qt=Qt.redISub(Zt);var ur=Qt.redSqr(),cr=Xt.redIAdd(Xt);cr=cr.redIAdd(cr),cr=cr.redIAdd(cr),cr=cr.redIAdd(cr);var $r=Jt.redIAdd(Qt).redSqr().redISub(Zt).redISub(ur).redISub(cr),Ar=Gt.redMul($r);Ar=Ar.redIAdd(Ar),Ar=Ar.redIAdd(Ar);var Lr=this.x.redMul(ur).redISub(Ar);Lr=Lr.redIAdd(Lr),Lr=Lr.redIAdd(Lr);var qr=this.y.redMul($r.redMul(cr.redISub($r)).redISub(Qt.redMul(ur)));qr=qr.redIAdd(qr),qr=qr.redIAdd(qr),qr=qr.redIAdd(qr);var Fr=this.z.redAdd(Qt).redSqr().redISub(Yt).redISub(ur);return this.curve.jpoint(Lr,qr,Fr)};JPoint.prototype.mul=function(Wt,Gt){return Wt=new BN$7(Wt,Gt),this.curve._wnafMul(this,Wt)};JPoint.prototype.eq=function(Wt){if(Wt.type==="affine")return this.eq(Wt.toJ());if(this===Wt)return!0;var Gt=this.z.redSqr(),Yt=Wt.z.redSqr();if(this.x.redMul(Yt).redISub(Wt.x.redMul(Gt)).cmpn(0)!==0)return!1;var Xt=Gt.redMul(this.z),Jt=Yt.redMul(Wt.z);return this.y.redMul(Jt).redISub(Wt.y.redMul(Xt)).cmpn(0)===0};JPoint.prototype.eqXToP=function(Wt){var Gt=this.z.redSqr(),Yt=Wt.toRed(this.curve.red).redMul(Gt);if(this.x.cmp(Yt)===0)return!0;for(var Xt=Wt.clone(),Jt=this.curve.redN.redMul(Gt);;){if(Xt.iadd(this.curve.n),Xt.cmp(this.curve.p)>=0)return!1;if(Yt.redIAdd(Jt),this.x.cmp(Yt)===0)return!0}};JPoint.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var curve_1=createCommonjsModule(function(Bt,Wt){var Gt=Wt;Gt.base=base$2,Gt.short=short_1,Gt.mont=null,Gt.edwards=null}),curves_1=createCommonjsModule(function(Bt,Wt){var Gt=Wt,Yt=utils_1$1$1.assert;function Xt(Qt){Qt.type==="short"?this.curve=new curve_1.short(Qt):Qt.type==="edwards"?this.curve=new curve_1.edwards(Qt):this.curve=new curve_1.mont(Qt),this.g=this.curve.g,this.n=this.curve.n,this.hash=Qt.hash,Yt(this.g.validate(),"Invalid curve"),Yt(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Gt.PresetCurve=Xt;function Jt(Qt,ur){Object.defineProperty(Gt,Qt,{configurable:!0,enumerable:!0,get:function(){var cr=new Xt(ur);return Object.defineProperty(Gt,Qt,{configurable:!0,enumerable:!0,value:cr}),cr}})}Jt("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash$9.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),Jt("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash$9.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),Jt("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash$9.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),Jt("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash$9.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),Jt("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash$9.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),Jt("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$9.sha256,gRed:!1,g:["9"]}),Jt("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$9.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Zt;try{Zt=null.crash()}catch{Zt=void 0}Jt("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash$9.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Zt]})});function HmacDRBG(Bt){if(!(this instanceof HmacDRBG))return new HmacDRBG(Bt);this.hash=Bt.hash,this.predResist=!!Bt.predResist,this.outLen=this.hash.outSize,this.minEntropy=Bt.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Wt=utils_1$m.toArray(Bt.entropy,Bt.entropyEnc||"hex"),Gt=utils_1$m.toArray(Bt.nonce,Bt.nonceEnc||"hex"),Yt=utils_1$m.toArray(Bt.pers,Bt.persEnc||"hex");minimalisticAssert(Wt.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Wt,Gt,Yt)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function(Wt,Gt,Yt){var Xt=Wt.concat(Gt).concat(Yt);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var Jt=0;Jt<this.V.length;Jt++)this.K[Jt]=0,this.V[Jt]=1;this._update(Xt),this._reseed=1,this.reseedInterval=281474976710656};HmacDRBG.prototype._hmac=function(){return new hash$9.hmac(this.hash,this.K)};HmacDRBG.prototype._update=function(Wt){var Gt=this._hmac().update(this.V).update([0]);Wt&&(Gt=Gt.update(Wt)),this.K=Gt.digest(),this.V=this._hmac().update(this.V).digest(),Wt&&(this.K=this._hmac().update(this.V).update([1]).update(Wt).digest(),this.V=this._hmac().update(this.V).digest())};HmacDRBG.prototype.reseed=function(Wt,Gt,Yt,Xt){typeof Gt!="string"&&(Xt=Yt,Yt=Gt,Gt=null),Wt=utils_1$m.toArray(Wt,Gt),Yt=utils_1$m.toArray(Yt,Xt),minimalisticAssert(Wt.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Wt.concat(Yt||[])),this._reseed=1};HmacDRBG.prototype.generate=function(Wt,Gt,Yt,Xt){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof Gt!="string"&&(Xt=Yt,Yt=Gt,Gt=null),Yt&&(Yt=utils_1$m.toArray(Yt,Xt||"hex"),this._update(Yt));for(var Jt=[];Jt.length<Wt;)this.V=this._hmac().update(this.V).digest(),Jt=Jt.concat(this.V);var Zt=Jt.slice(0,Wt);return this._update(Yt),this._reseed++,utils_1$m.encode(Zt,Gt)};var assert$3=utils_1$1$1.assert;function KeyPair(Bt,Wt){this.ec=Bt,this.priv=null,this.pub=null,Wt.priv&&this._importPrivate(Wt.priv,Wt.privEnc),Wt.pub&&this._importPublic(Wt.pub,Wt.pubEnc)}var key=KeyPair;KeyPair.fromPublic=function(Wt,Gt,Yt){return Gt instanceof KeyPair?Gt:new KeyPair(Wt,{pub:Gt,pubEnc:Yt})};KeyPair.fromPrivate=function(Wt,Gt,Yt){return Gt instanceof KeyPair?Gt:new KeyPair(Wt,{priv:Gt,privEnc:Yt})};KeyPair.prototype.validate=function(){var Wt=this.getPublic();return Wt.isInfinity()?{result:!1,reason:"Invalid public key"}:Wt.validate()?Wt.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair.prototype.getPublic=function(Wt,Gt){return typeof Wt=="string"&&(Gt=Wt,Wt=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),Gt?this.pub.encode(Gt,Wt):this.pub};KeyPair.prototype.getPrivate=function(Wt){return Wt==="hex"?this.priv.toString(16,2):this.priv};KeyPair.prototype._importPrivate=function(Wt,Gt){this.priv=new BN$7(Wt,Gt||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair.prototype._importPublic=function(Wt,Gt){if(Wt.x||Wt.y){this.ec.curve.type==="mont"?assert$3(Wt.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$3(Wt.x&&Wt.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(Wt.x,Wt.y);return}this.pub=this.ec.curve.decodePoint(Wt,Gt)};KeyPair.prototype.derive=function(Wt){return Wt.validate()||assert$3(Wt.validate(),"public point not validated"),Wt.mul(this.priv).getX()};KeyPair.prototype.sign=function(Wt,Gt,Yt){return this.ec.sign(Wt,this,Gt,Yt)};KeyPair.prototype.verify=function(Wt,Gt){return this.ec.verify(Wt,Gt,this)};KeyPair.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var assert$4=utils_1$1$1.assert;function Signature(Bt,Wt){if(Bt instanceof Signature)return Bt;this._importDER(Bt,Wt)||(assert$4(Bt.r&&Bt.s,"Signature without r or s"),this.r=new BN$7(Bt.r,16),this.s=new BN$7(Bt.s,16),Bt.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=Bt.recoveryParam)}var signature=Signature;function Position(){this.place=0}function getLength(Bt,Wt){var Gt=Bt[Wt.place++];if(!(Gt&128))return Gt;var Yt=Gt&15;if(Yt===0||Yt>4)return!1;for(var Xt=0,Jt=0,Zt=Wt.place;Jt<Yt;Jt++,Zt++)Xt<<=8,Xt|=Bt[Zt],Xt>>>=0;return Xt<=127?!1:(Wt.place=Zt,Xt)}function rmPadding(Bt){for(var Wt=0,Gt=Bt.length-1;!Bt[Wt]&&!(Bt[Wt+1]&128)&&Wt<Gt;)Wt++;return Wt===0?Bt:Bt.slice(Wt)}Signature.prototype._importDER=function(Wt,Gt){Wt=utils_1$1$1.toArray(Wt,Gt);var Yt=new Position;if(Wt[Yt.place++]!==48)return!1;var Xt=getLength(Wt,Yt);if(Xt===!1||Xt+Yt.place!==Wt.length||Wt[Yt.place++]!==2)return!1;var Jt=getLength(Wt,Yt);if(Jt===!1)return!1;var Zt=Wt.slice(Yt.place,Jt+Yt.place);if(Yt.place+=Jt,Wt[Yt.place++]!==2)return!1;var Qt=getLength(Wt,Yt);if(Qt===!1||Wt.length!==Qt+Yt.place)return!1;var ur=Wt.slice(Yt.place,Qt+Yt.place);if(Zt[0]===0)if(Zt[1]&128)Zt=Zt.slice(1);else return!1;if(ur[0]===0)if(ur[1]&128)ur=ur.slice(1);else return!1;return this.r=new BN$7(Zt),this.s=new BN$7(ur),this.recoveryParam=null,!0};function constructLength(Bt,Wt){if(Wt<128){Bt.push(Wt);return}var Gt=1+(Math.log(Wt)/Math.LN2>>>3);for(Bt.push(Gt|128);--Gt;)Bt.push(Wt>>>(Gt<<3)&255);Bt.push(Wt)}Signature.prototype.toDER=function(Wt){var Gt=this.r.toArray(),Yt=this.s.toArray();for(Gt[0]&128&&(Gt=[0].concat(Gt)),Yt[0]&128&&(Yt=[0].concat(Yt)),Gt=rmPadding(Gt),Yt=rmPadding(Yt);!Yt[0]&&!(Yt[1]&128);)Yt=Yt.slice(1);var Xt=[2];constructLength(Xt,Gt.length),Xt=Xt.concat(Gt),Xt.push(2),constructLength(Xt,Yt.length);var Jt=Xt.concat(Yt),Zt=[48];return constructLength(Zt,Jt.length),Zt=Zt.concat(Jt),utils_1$1$1.encode(Zt,Wt)};var rand=function(){throw new Error("unsupported")},assert$5=utils_1$1$1.assert;function EC(Bt){if(!(this instanceof EC))return new EC(Bt);typeof Bt=="string"&&(assert$5(Object.prototype.hasOwnProperty.call(curves_1,Bt),"Unknown curve "+Bt),Bt=curves_1[Bt]),Bt instanceof curves_1.PresetCurve&&(Bt={curve:Bt}),this.curve=Bt.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Bt.curve.g,this.g.precompute(Bt.curve.n.bitLength()+1),this.hash=Bt.hash||Bt.curve.hash}var ec=EC;EC.prototype.keyPair=function(Wt){return new key(this,Wt)};EC.prototype.keyFromPrivate=function(Wt,Gt){return key.fromPrivate(this,Wt,Gt)};EC.prototype.keyFromPublic=function(Wt,Gt){return key.fromPublic(this,Wt,Gt)};EC.prototype.genKeyPair=function(Wt){Wt||(Wt={});for(var Gt=new hmacDrbg({hash:this.hash,pers:Wt.pers,persEnc:Wt.persEnc||"utf8",entropy:Wt.entropy||rand(this.hash.hmacStrength),entropyEnc:Wt.entropy&&Wt.entropyEnc||"utf8",nonce:this.n.toArray()}),Yt=this.n.byteLength(),Xt=this.n.sub(new BN$7(2));;){var Jt=new BN$7(Gt.generate(Yt));if(!(Jt.cmp(Xt)>0))return Jt.iaddn(1),this.keyFromPrivate(Jt)}};EC.prototype._truncateToN=function(Wt,Gt){var Yt=Wt.byteLength()*8-this.n.bitLength();return Yt>0&&(Wt=Wt.ushrn(Yt)),!Gt&&Wt.cmp(this.n)>=0?Wt.sub(this.n):Wt};EC.prototype.sign=function(Wt,Gt,Yt,Xt){typeof Yt=="object"&&(Xt=Yt,Yt=null),Xt||(Xt={}),Gt=this.keyFromPrivate(Gt,Yt),Wt=this._truncateToN(new BN$7(Wt,16));for(var Jt=this.n.byteLength(),Zt=Gt.getPrivate().toArray("be",Jt),Qt=Wt.toArray("be",Jt),ur=new hmacDrbg({hash:this.hash,entropy:Zt,nonce:Qt,pers:Xt.pers,persEnc:Xt.persEnc||"utf8"}),cr=this.n.sub(new BN$7(1)),$r=0;;$r++){var Ar=Xt.k?Xt.k($r):new BN$7(ur.generate(this.n.byteLength()));if(Ar=this._truncateToN(Ar,!0),!(Ar.cmpn(1)<=0||Ar.cmp(cr)>=0)){var Lr=this.g.mul(Ar);if(!Lr.isInfinity()){var qr=Lr.getX(),Fr=qr.umod(this.n);if(Fr.cmpn(0)!==0){var Hr=Ar.invm(this.n).mul(Fr.mul(Gt.getPrivate()).iadd(Wt));if(Hr=Hr.umod(this.n),Hr.cmpn(0)!==0){var Br=(Lr.getY().isOdd()?1:0)|(qr.cmp(Fr)!==0?2:0);return Xt.canonical&&Hr.cmp(this.nh)>0&&(Hr=this.n.sub(Hr),Br^=1),new signature({r:Fr,s:Hr,recoveryParam:Br})}}}}}};EC.prototype.verify=function(Wt,Gt,Yt,Xt){Wt=this._truncateToN(new BN$7(Wt,16)),Yt=this.keyFromPublic(Yt,Xt),Gt=new signature(Gt,"hex");var Jt=Gt.r,Zt=Gt.s;if(Jt.cmpn(1)<0||Jt.cmp(this.n)>=0||Zt.cmpn(1)<0||Zt.cmp(this.n)>=0)return!1;var Qt=Zt.invm(this.n),ur=Qt.mul(Wt).umod(this.n),cr=Qt.mul(Jt).umod(this.n),$r;return this.curve._maxwellTrick?($r=this.g.jmulAdd(ur,Yt.getPublic(),cr),$r.isInfinity()?!1:$r.eqXToP(Jt)):($r=this.g.mulAdd(ur,Yt.getPublic(),cr),$r.isInfinity()?!1:$r.getX().umod(this.n).cmp(Jt)===0)};EC.prototype.recoverPubKey=function(Bt,Wt,Gt,Yt){assert$5((3&Gt)===Gt,"The recovery param is more than two bits"),Wt=new signature(Wt,Yt);var Xt=this.n,Jt=new BN$7(Bt),Zt=Wt.r,Qt=Wt.s,ur=Gt&1,cr=Gt>>1;if(Zt.cmp(this.curve.p.umod(this.curve.n))>=0&&cr)throw new Error("Unable to find sencond key candinate");cr?Zt=this.curve.pointFromX(Zt.add(this.curve.n),ur):Zt=this.curve.pointFromX(Zt,ur);var $r=Wt.r.invm(Xt),Ar=Xt.sub(Jt).mul($r).umod(Xt),Lr=Qt.mul($r).umod(Xt);return this.g.mulAdd(Ar,Zt,Lr)};EC.prototype.getKeyRecoveryParam=function(Bt,Wt,Gt,Yt){if(Wt=new signature(Wt,Yt),Wt.recoveryParam!==null)return Wt.recoveryParam;for(var Xt=0;Xt<4;Xt++){var Jt;try{Jt=this.recoverPubKey(Bt,Wt,Xt)}catch{continue}if(Jt.eq(Gt))return Xt}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule(function(Bt,Wt){var Gt=Wt;Gt.version="6.5.4",Gt.utils=utils_1$1$1,Gt.rand=function(){throw new Error("unsupported")},Gt.curve=curve_1,Gt.curves=curves_1,Gt.ec=ec,Gt.eddsa=null}),EC$1=elliptic_1.ec;const version$k="signing-key/5.7.0",logger$w=new Logger(version$k);let _curve=null;function getCurve(){return _curve||(_curve=new EC$1("secp256k1")),_curve}class SigningKey{constructor(Wt){defineReadOnly(this,"curve","secp256k1"),defineReadOnly(this,"privateKey",hexlify(Wt)),hexDataLength(this.privateKey)!==32&&logger$w.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const Gt=getCurve().keyFromPrivate(arrayify(this.privateKey));defineReadOnly(this,"publicKey","0x"+Gt.getPublic(!1,"hex")),defineReadOnly(this,"compressedPublicKey","0x"+Gt.getPublic(!0,"hex")),defineReadOnly(this,"_isSigningKey",!0)}_addPoint(Wt){const Gt=getCurve().keyFromPublic(arrayify(this.publicKey)),Yt=getCurve().keyFromPublic(arrayify(Wt));return"0x"+Gt.pub.add(Yt.pub).encodeCompressed("hex")}signDigest(Wt){const Gt=getCurve().keyFromPrivate(arrayify(this.privateKey)),Yt=arrayify(Wt);Yt.length!==32&&logger$w.throwArgumentError("bad digest length","digest",Wt);const Xt=Gt.sign(Yt,{canonical:!0});return splitSignature({recoveryParam:Xt.recoveryParam,r:hexZeroPad("0x"+Xt.r.toString(16),32),s:hexZeroPad("0x"+Xt.s.toString(16),32)})}computeSharedSecret(Wt){const Gt=getCurve().keyFromPrivate(arrayify(this.privateKey)),Yt=getCurve().keyFromPublic(arrayify(computePublicKey(Wt)));return hexZeroPad("0x"+Gt.derive(Yt.getPublic()).toString(16),32)}static isSigningKey(Wt){return!!(Wt&&Wt._isSigningKey)}}function recoverPublicKey$1(Bt,Wt){const Gt=splitSignature(Wt),Yt={r:arrayify(Gt.r),s:arrayify(Gt.s)};return"0x"+getCurve().recoverPubKey(arrayify(Bt),Yt,Gt.recoveryParam).encode("hex",!1)}function computePublicKey(Bt,Wt){const Gt=arrayify(Bt);if(Gt.length===32){const Yt=new SigningKey(Gt);return Wt?"0x"+getCurve().keyFromPrivate(Gt).getPublic(!0,"hex"):Yt.publicKey}else{if(Gt.length===33)return Wt?hexlify(Gt):"0x"+getCurve().keyFromPublic(Gt).getPublic(!1,"hex");if(Gt.length===65)return Wt?"0x"+getCurve().keyFromPublic(Gt).getPublic(!0,"hex"):hexlify(Gt)}return logger$w.throwArgumentError("invalid public or private key","key","[REDACTED]")}const version$j="transactions/5.7.0",logger$v=new Logger(version$j);var TransactionTypes;(function(Bt){Bt[Bt.legacy=0]="legacy",Bt[Bt.eip2930=1]="eip2930",Bt[Bt.eip1559=2]="eip1559"})(TransactionTypes||(TransactionTypes={}));function handleAddress(Bt){return Bt==="0x"?null:getAddress(Bt)}function handleNumber(Bt){return Bt==="0x"?Zero$1:BigNumber.from(Bt)}const transactionFields=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],allowedTransactionKeys$5={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function computeAddress$1(Bt){const Wt=computePublicKey(Bt);return getAddress(hexDataSlice(keccak256$1(hexDataSlice(Wt,1)),12))}function recoverAddress(Bt,Wt){return computeAddress$1(recoverPublicKey$1(arrayify(Bt),Wt))}function formatNumber$1(Bt,Wt){const Gt=stripZeros(BigNumber.from(Bt).toHexString());return Gt.length>32&&logger$v.throwArgumentError("invalid length for "+Wt,"transaction:"+Wt,Bt),Gt}function accessSetify(Bt,Wt){return{address:getAddress(Bt),storageKeys:(Wt||[]).map((Gt,Yt)=>(hexDataLength(Gt)!==32&&logger$v.throwArgumentError("invalid access list storageKey",`accessList[${Bt}:${Yt}]`,Gt),Gt.toLowerCase()))}}function accessListify(Bt){if(Array.isArray(Bt))return Bt.map((Gt,Yt)=>Array.isArray(Gt)?(Gt.length>2&&logger$v.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${Yt}]`,Gt),accessSetify(Gt[0],Gt[1])):accessSetify(Gt.address,Gt.storageKeys));const Wt=Object.keys(Bt).map(Gt=>{const Yt=Bt[Gt].reduce((Xt,Jt)=>(Xt[Jt]=!0,Xt),{});return accessSetify(Gt,Object.keys(Yt).sort())});return Wt.sort((Gt,Yt)=>Gt.address.localeCompare(Yt.address)),Wt}function formatAccessList(Bt){return accessListify(Bt).map(Wt=>[Wt.address,Wt.storageKeys])}function _serializeEip1559(Bt,Wt){if(Bt.gasPrice!=null){const Yt=BigNumber.from(Bt.gasPrice),Xt=BigNumber.from(Bt.maxFeePerGas||0);Yt.eq(Xt)||logger$v.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:Yt,maxFeePerGas:Xt})}const Gt=[formatNumber$1(Bt.chainId||0,"chainId"),formatNumber$1(Bt.nonce||0,"nonce"),formatNumber$1(Bt.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber$1(Bt.maxFeePerGas||0,"maxFeePerGas"),formatNumber$1(Bt.gasLimit||0,"gasLimit"),Bt.to!=null?getAddress(Bt.to):"0x",formatNumber$1(Bt.value||0,"value"),Bt.data||"0x",formatAccessList(Bt.accessList||[])];if(Wt){const Yt=splitSignature(Wt);Gt.push(formatNumber$1(Yt.recoveryParam,"recoveryParam")),Gt.push(stripZeros(Yt.r)),Gt.push(stripZeros(Yt.s))}return hexConcat(["0x02",encode$6(Gt)])}function _serializeEip2930(Bt,Wt){const Gt=[formatNumber$1(Bt.chainId||0,"chainId"),formatNumber$1(Bt.nonce||0,"nonce"),formatNumber$1(Bt.gasPrice||0,"gasPrice"),formatNumber$1(Bt.gasLimit||0,"gasLimit"),Bt.to!=null?getAddress(Bt.to):"0x",formatNumber$1(Bt.value||0,"value"),Bt.data||"0x",formatAccessList(Bt.accessList||[])];if(Wt){const Yt=splitSignature(Wt);Gt.push(formatNumber$1(Yt.recoveryParam,"recoveryParam")),Gt.push(stripZeros(Yt.r)),Gt.push(stripZeros(Yt.s))}return hexConcat(["0x01",encode$6(Gt)])}function _serialize(Bt,Wt){checkProperties(Bt,allowedTransactionKeys$5);const Gt=[];transactionFields.forEach(function(Zt){let Qt=Bt[Zt.name]||[];const ur={};Zt.numeric&&(ur.hexPad="left"),Qt=arrayify(hexlify(Qt,ur)),Zt.length&&Qt.length!==Zt.length&&Qt.length>0&&logger$v.throwArgumentError("invalid length for "+Zt.name,"transaction:"+Zt.name,Qt),Zt.maxLength&&(Qt=stripZeros(Qt),Qt.length>Zt.maxLength&&logger$v.throwArgumentError("invalid length for "+Zt.name,"transaction:"+Zt.name,Qt)),Gt.push(hexlify(Qt))});let Yt=0;if(Bt.chainId!=null?(Yt=Bt.chainId,typeof Yt!="number"&&logger$v.throwArgumentError("invalid transaction.chainId","transaction",Bt)):Wt&&!isBytesLike(Wt)&&Wt.v>28&&(Yt=Math.floor((Wt.v-35)/2)),Yt!==0&&(Gt.push(hexlify(Yt)),Gt.push("0x"),Gt.push("0x")),!Wt)return encode$6(Gt);const Xt=splitSignature(Wt);let Jt=27+Xt.recoveryParam;return Yt!==0?(Gt.pop(),Gt.pop(),Gt.pop(),Jt+=Yt*2+8,Xt.v>28&&Xt.v!==Jt&&logger$v.throwArgumentError("transaction.chainId/signature.v mismatch","signature",Wt)):Xt.v!==Jt&&logger$v.throwArgumentError("transaction.chainId/signature.v mismatch","signature",Wt),Gt.push(hexlify(Jt)),Gt.push(stripZeros(arrayify(Xt.r))),Gt.push(stripZeros(arrayify(Xt.s))),encode$6(Gt)}function serialize$2(Bt,Wt){if(Bt.type==null||Bt.type===0)return Bt.accessList!=null&&logger$v.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",Bt),_serialize(Bt,Wt);switch(Bt.type){case 1:return _serializeEip2930(Bt,Wt);case 2:return _serializeEip1559(Bt,Wt)}return logger$v.throwError(`unsupported transaction type: ${Bt.type}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:Bt.type})}function _parseEipSignature(Bt,Wt,Gt){try{const Yt=handleNumber(Wt[0]).toNumber();if(Yt!==0&&Yt!==1)throw new Error("bad recid");Bt.v=Yt}catch{logger$v.throwArgumentError("invalid v for transaction type: 1","v",Wt[0])}Bt.r=hexZeroPad(Wt[1],32),Bt.s=hexZeroPad(Wt[2],32);try{const Yt=keccak256$1(Gt(Bt));Bt.from=recoverAddress(Yt,{r:Bt.r,s:Bt.s,recoveryParam:Bt.v})}catch{}}function _parseEip1559(Bt){const Wt=decode$6(Bt.slice(1));Wt.length!==9&&Wt.length!==12&&logger$v.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify(Bt));const Gt=handleNumber(Wt[2]),Yt=handleNumber(Wt[3]),Xt={type:2,chainId:handleNumber(Wt[0]).toNumber(),nonce:handleNumber(Wt[1]).toNumber(),maxPriorityFeePerGas:Gt,maxFeePerGas:Yt,gasPrice:null,gasLimit:handleNumber(Wt[4]),to:handleAddress(Wt[5]),value:handleNumber(Wt[6]),data:Wt[7],accessList:accessListify(Wt[8])};return Wt.length===9||(Xt.hash=keccak256$1(Bt),_parseEipSignature(Xt,Wt.slice(9),_serializeEip1559)),Xt}function _parseEip2930(Bt){const Wt=decode$6(Bt.slice(1));Wt.length!==8&&Wt.length!==11&&logger$v.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify(Bt));const Gt={type:1,chainId:handleNumber(Wt[0]).toNumber(),nonce:handleNumber(Wt[1]).toNumber(),gasPrice:handleNumber(Wt[2]),gasLimit:handleNumber(Wt[3]),to:handleAddress(Wt[4]),value:handleNumber(Wt[5]),data:Wt[6],accessList:accessListify(Wt[7])};return Wt.length===8||(Gt.hash=keccak256$1(Bt),_parseEipSignature(Gt,Wt.slice(8),_serializeEip2930)),Gt}function _parse(Bt){const Wt=decode$6(Bt);Wt.length!==9&&Wt.length!==6&&logger$v.throwArgumentError("invalid raw transaction","rawTransaction",Bt);const Gt={nonce:handleNumber(Wt[0]).toNumber(),gasPrice:handleNumber(Wt[1]),gasLimit:handleNumber(Wt[2]),to:handleAddress(Wt[3]),value:handleNumber(Wt[4]),data:Wt[5],chainId:0};if(Wt.length===6)return Gt;try{Gt.v=BigNumber.from(Wt[6]).toNumber()}catch{return Gt}if(Gt.r=hexZeroPad(Wt[7],32),Gt.s=hexZeroPad(Wt[8],32),BigNumber.from(Gt.r).isZero()&&BigNumber.from(Gt.s).isZero())Gt.chainId=Gt.v,Gt.v=0;else{Gt.chainId=Math.floor((Gt.v-35)/2),Gt.chainId<0&&(Gt.chainId=0);let Yt=Gt.v-27;const Xt=Wt.slice(0,6);Gt.chainId!==0&&(Xt.push(hexlify(Gt.chainId)),Xt.push("0x"),Xt.push("0x"),Yt-=Gt.chainId*2+8);const Jt=keccak256$1(encode$6(Xt));try{Gt.from=recoverAddress(Jt,{r:hexlify(Gt.r),s:hexlify(Gt.s),recoveryParam:Yt})}catch{}Gt.hash=keccak256$1(Bt)}return Gt.type=null,Gt}function parse$i(Bt){const Wt=arrayify(Bt);if(Wt[0]>127)return _parse(Wt);switch(Wt[0]){case 1:return _parseEip2930(Wt);case 2:return _parseEip1559(Wt)}return logger$v.throwError(`unsupported transaction type: ${Wt[0]}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:Wt[0]})}const version$i="contracts/5.7.0";var __awaiter$w=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$u=new Logger(version$i),allowedTransactionKeys$4={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function resolveName(Bt,Wt){return __awaiter$w(this,void 0,void 0,function*(){const Gt=yield Wt;typeof Gt!="string"&&logger$u.throwArgumentError("invalid address or ENS name","name",Gt);try{return getAddress(Gt)}catch{}Bt||logger$u.throwError("a provider or signer is needed to resolve ENS names",Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const Yt=yield Bt.resolveName(Gt);return Yt==null&&logger$u.throwArgumentError("resolver or addr is not configured for ENS name","name",Gt),Yt})}function resolveAddresses(Bt,Wt,Gt){return __awaiter$w(this,void 0,void 0,function*(){return Array.isArray(Gt)?yield Promise.all(Gt.map((Yt,Xt)=>resolveAddresses(Bt,Array.isArray(Wt)?Wt[Xt]:Wt[Yt.name],Yt))):Gt.type==="address"?yield resolveName(Bt,Wt):Gt.type==="tuple"?yield resolveAddresses(Bt,Wt,Gt.components):Gt.baseType==="array"?Array.isArray(Wt)?yield Promise.all(Wt.map(Yt=>resolveAddresses(Bt,Yt,Gt.arrayChildren))):Promise.reject(logger$u.makeError("invalid value for array",Logger.errors.INVALID_ARGUMENT,{argument:"value",value:Wt})):Wt})}function populateTransaction(Bt,Wt,Gt){return __awaiter$w(this,void 0,void 0,function*(){let Yt={};Gt.length===Wt.inputs.length+1&&typeof Gt[Gt.length-1]=="object"&&(Yt=shallowCopy(Gt.pop())),logger$u.checkArgumentCount(Gt.length,Wt.inputs.length,"passed to contract"),Bt.signer?Yt.from?Yt.from=resolveProperties({override:resolveName(Bt.signer,Yt.from),signer:Bt.signer.getAddress()}).then(cr=>__awaiter$w(this,void 0,void 0,function*(){return getAddress(cr.signer)!==cr.override&&logger$u.throwError("Contract with a Signer cannot override from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),cr.override})):Yt.from=Bt.signer.getAddress():Yt.from&&(Yt.from=resolveName(Bt.provider,Yt.from));const Xt=yield resolveProperties({args:resolveAddresses(Bt.signer||Bt.provider,Gt,Wt.inputs),address:Bt.resolvedAddress,overrides:resolveProperties(Yt)||{}}),Jt=Bt.interface.encodeFunctionData(Wt,Xt.args),Zt={data:Jt,to:Xt.address},Qt=Xt.overrides;if(Qt.nonce!=null&&(Zt.nonce=BigNumber.from(Qt.nonce).toNumber()),Qt.gasLimit!=null&&(Zt.gasLimit=BigNumber.from(Qt.gasLimit)),Qt.gasPrice!=null&&(Zt.gasPrice=BigNumber.from(Qt.gasPrice)),Qt.maxFeePerGas!=null&&(Zt.maxFeePerGas=BigNumber.from(Qt.maxFeePerGas)),Qt.maxPriorityFeePerGas!=null&&(Zt.maxPriorityFeePerGas=BigNumber.from(Qt.maxPriorityFeePerGas)),Qt.from!=null&&(Zt.from=Qt.from),Qt.type!=null&&(Zt.type=Qt.type),Qt.accessList!=null&&(Zt.accessList=accessListify(Qt.accessList)),Zt.gasLimit==null&&Wt.gas!=null){let cr=21e3;const $r=arrayify(Jt);for(let Ar=0;Ar<$r.length;Ar++)cr+=4,$r[Ar]&&(cr+=64);Zt.gasLimit=BigNumber.from(Wt.gas).add(cr)}if(Qt.value){const cr=BigNumber.from(Qt.value);!cr.isZero()&&!Wt.payable&&logger$u.throwError("non-payable method cannot override value",Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:Yt.value}),Zt.value=cr}Qt.customData&&(Zt.customData=shallowCopy(Qt.customData)),Qt.ccipReadEnabled&&(Zt.ccipReadEnabled=!!Qt.ccipReadEnabled),delete Yt.nonce,delete Yt.gasLimit,delete Yt.gasPrice,delete Yt.from,delete Yt.value,delete Yt.type,delete Yt.accessList,delete Yt.maxFeePerGas,delete Yt.maxPriorityFeePerGas,delete Yt.customData,delete Yt.ccipReadEnabled;const ur=Object.keys(Yt).filter(cr=>Yt[cr]!=null);return ur.length&&logger$u.throwError(`cannot override ${ur.map(cr=>JSON.stringify(cr)).join(",")}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:ur}),Zt})}function buildPopulate(Bt,Wt){return function(...Gt){return populateTransaction(Bt,Wt,Gt)}}function buildEstimate(Bt,Wt){const Gt=Bt.signer||Bt.provider;return function(...Yt){return __awaiter$w(this,void 0,void 0,function*(){Gt||logger$u.throwError("estimate require a provider or signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const Xt=yield populateTransaction(Bt,Wt,Yt);return yield Gt.estimateGas(Xt)})}}function addContractWait(Bt,Wt){const Gt=Wt.wait.bind(Wt);Wt.wait=Yt=>Gt(Yt).then(Xt=>(Xt.events=Xt.logs.map(Jt=>{let Zt=deepCopy(Jt),Qt=null;try{Qt=Bt.interface.parseLog(Jt)}catch{}return Qt&&(Zt.args=Qt.args,Zt.decode=(ur,cr)=>Bt.interface.decodeEventLog(Qt.eventFragment,ur,cr),Zt.event=Qt.name,Zt.eventSignature=Qt.signature),Zt.removeListener=()=>Bt.provider,Zt.getBlock=()=>Bt.provider.getBlock(Xt.blockHash),Zt.getTransaction=()=>Bt.provider.getTransaction(Xt.transactionHash),Zt.getTransactionReceipt=()=>Promise.resolve(Xt),Zt}),Xt))}function buildCall(Bt,Wt,Gt){const Yt=Bt.signer||Bt.provider;return function(...Xt){return __awaiter$w(this,void 0,void 0,function*(){let Jt;if(Xt.length===Wt.inputs.length+1&&typeof Xt[Xt.length-1]=="object"){const ur=shallowCopy(Xt.pop());ur.blockTag!=null&&(Jt=yield ur.blockTag),delete ur.blockTag,Xt.push(ur)}Bt.deployTransaction!=null&&(yield Bt._deployed(Jt));const Zt=yield populateTransaction(Bt,Wt,Xt),Qt=yield Yt.call(Zt,Jt);try{let ur=Bt.interface.decodeFunctionResult(Wt,Qt);return Gt&&Wt.outputs.length===1&&(ur=ur[0]),ur}catch(ur){throw ur.code===Logger.errors.CALL_EXCEPTION&&(ur.address=Bt.address,ur.args=Xt,ur.transaction=Zt),ur}})}}function buildSend(Bt,Wt){return function(...Gt){return __awaiter$w(this,void 0,void 0,function*(){Bt.signer||logger$u.throwError("sending a transaction requires a signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),Bt.deployTransaction!=null&&(yield Bt._deployed());const Yt=yield populateTransaction(Bt,Wt,Gt),Xt=yield Bt.signer.sendTransaction(Yt);return addContractWait(Bt,Xt),Xt})}}function buildDefault(Bt,Wt,Gt){return Wt.constant?buildCall(Bt,Wt,Gt):buildSend(Bt,Wt)}function getEventTag$1(Bt){return Bt.address&&(Bt.topics==null||Bt.topics.length===0)?"*":(Bt.address||"*")+"@"+(Bt.topics?Bt.topics.map(Wt=>Array.isArray(Wt)?Wt.join("|"):Wt).join(":"):"")}class RunningEvent{constructor(Wt,Gt){defineReadOnly(this,"tag",Wt),defineReadOnly(this,"filter",Gt),this._listeners=[]}addListener(Wt,Gt){this._listeners.push({listener:Wt,once:Gt})}removeListener(Wt){let Gt=!1;this._listeners=this._listeners.filter(Yt=>Gt||Yt.listener!==Wt?!0:(Gt=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(Wt=>Wt.listener)}listenerCount(){return this._listeners.length}run(Wt){const Gt=this.listenerCount();return this._listeners=this._listeners.filter(Yt=>{const Xt=Wt.slice();return setTimeout(()=>{Yt.listener.apply(this,Xt)},0),!Yt.once}),Gt}prepareEvent(Wt){}getEmit(Wt){return[Wt]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(Wt,Gt,Yt,Xt){const Jt={address:Wt};let Zt=Gt.getEventTopic(Yt);Xt?(Zt!==Xt[0]&&logger$u.throwArgumentError("topic mismatch","topics",Xt),Jt.topics=Xt.slice()):Jt.topics=[Zt],super(getEventTag$1(Jt),Jt),defineReadOnly(this,"address",Wt),defineReadOnly(this,"interface",Gt),defineReadOnly(this,"fragment",Yt)}prepareEvent(Wt){super.prepareEvent(Wt),Wt.event=this.fragment.name,Wt.eventSignature=this.fragment.format(),Wt.decode=(Gt,Yt)=>this.interface.decodeEventLog(this.fragment,Gt,Yt);try{Wt.args=this.interface.decodeEventLog(this.fragment,Wt.data,Wt.topics)}catch(Gt){Wt.args=null,Wt.decodeError=Gt}}getEmit(Wt){const Gt=checkResultErrors(Wt.args);if(Gt.length)throw Gt[0].error;const Yt=(Wt.args||[]).slice();return Yt.push(Wt),Yt}}class WildcardRunningEvent extends RunningEvent{constructor(Wt,Gt){super("*",{address:Wt}),defineReadOnly(this,"address",Wt),defineReadOnly(this,"interface",Gt)}prepareEvent(Wt){super.prepareEvent(Wt);try{const Gt=this.interface.parseLog(Wt);Wt.event=Gt.name,Wt.eventSignature=Gt.signature,Wt.decode=(Yt,Xt)=>this.interface.decodeEventLog(Gt.eventFragment,Yt,Xt),Wt.args=Gt.args}catch{}}}class BaseContract{constructor(Wt,Gt,Yt){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(Gt)),Yt==null?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer$3.isSigner(Yt)?(defineReadOnly(this,"provider",Yt.provider||null),defineReadOnly(this,"signer",Yt)):Provider.isProvider(Yt)?(defineReadOnly(this,"provider",Yt),defineReadOnly(this,"signer",null)):logger$u.throwArgumentError("invalid signer or provider","signerOrProvider",Yt),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const Zt={};Object.keys(this.interface.events).forEach(Qt=>{const ur=this.interface.events[Qt];defineReadOnly(this.filters,Qt,(...cr)=>({address:this.address,topics:this.interface.encodeFilterTopics(ur,cr)})),Zt[ur.name]||(Zt[ur.name]=[]),Zt[ur.name].push(Qt)}),Object.keys(Zt).forEach(Qt=>{const ur=Zt[Qt];ur.length===1?defineReadOnly(this.filters,Qt,this.filters[ur[0]]):logger$u.warn(`Duplicate definition of ${Qt} (${ur.join(", ")})`)})}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),Wt==null&&logger$u.throwArgumentError("invalid contract address or ENS name","addressOrName",Wt),defineReadOnly(this,"address",Wt),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,Wt));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress(Wt)))}catch{logger$u.throwError("provider is required to use ENS name as contract address",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(Zt=>{});const Xt={},Jt={};Object.keys(this.interface.functions).forEach(Zt=>{const Qt=this.interface.functions[Zt];if(Jt[Zt]){logger$u.warn(`Duplicate ABI entry for ${JSON.stringify(Zt)}`);return}Jt[Zt]=!0;{const ur=Qt.name;Xt[`%${ur}`]||(Xt[`%${ur}`]=[]),Xt[`%${ur}`].push(Zt)}this[Zt]==null&&defineReadOnly(this,Zt,buildDefault(this,Qt,!0)),this.functions[Zt]==null&&defineReadOnly(this.functions,Zt,buildDefault(this,Qt,!1)),this.callStatic[Zt]==null&&defineReadOnly(this.callStatic,Zt,buildCall(this,Qt,!0)),this.populateTransaction[Zt]==null&&defineReadOnly(this.populateTransaction,Zt,buildPopulate(this,Qt)),this.estimateGas[Zt]==null&&defineReadOnly(this.estimateGas,Zt,buildEstimate(this,Qt))}),Object.keys(Xt).forEach(Zt=>{const Qt=Xt[Zt];if(Qt.length>1)return;Zt=Zt.substring(1);const ur=Qt[0];try{this[Zt]==null&&defineReadOnly(this,Zt,this[ur])}catch{}this.functions[Zt]==null&&defineReadOnly(this.functions,Zt,this.functions[ur]),this.callStatic[Zt]==null&&defineReadOnly(this.callStatic,Zt,this.callStatic[ur]),this.populateTransaction[Zt]==null&&defineReadOnly(this.populateTransaction,Zt,this.populateTransaction[ur]),this.estimateGas[Zt]==null&&defineReadOnly(this.estimateGas,Zt,this.estimateGas[ur])})}static getContractAddress(Wt){return getContractAddress(Wt)}static getInterface(Wt){return Interface.isInterface(Wt)?Wt:new Interface(Wt)}deployed(){return this._deployed()}_deployed(Wt){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,Wt).then(Gt=>(Gt==="0x"&&logger$u.throwError("contract not deployed",Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(Wt){this.signer||logger$u.throwError("sending a transactions require a signer",Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const Gt=shallowCopy(Wt||{});return["from","to"].forEach(function(Yt){Gt[Yt]!=null&&logger$u.throwError("cannot override "+Yt,Logger.errors.UNSUPPORTED_OPERATION,{operation:Yt})}),Gt.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(Gt))}connect(Wt){typeof Wt=="string"&&(Wt=new VoidSigner$1(Wt,this.provider));const Gt=new this.constructor(this.address,this.interface,Wt);return this.deployTransaction&&defineReadOnly(Gt,"deployTransaction",this.deployTransaction),Gt}attach(Wt){return new this.constructor(Wt,this.interface,this.signer||this.provider)}static isIndexed(Wt){return Indexed.isIndexed(Wt)}_normalizeRunningEvent(Wt){return this._runningEvents[Wt.tag]?this._runningEvents[Wt.tag]:Wt}_getRunningEvent(Wt){if(typeof Wt=="string"){if(Wt==="error")return this._normalizeRunningEvent(new ErrorRunningEvent);if(Wt==="event")return this._normalizeRunningEvent(new RunningEvent("event",null));if(Wt==="*")return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const Gt=this.interface.getEvent(Wt);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,Gt))}if(Wt.topics&&Wt.topics.length>0){try{const Yt=Wt.topics[0];if(typeof Yt!="string")throw new Error("invalid topic");const Xt=this.interface.getEvent(Yt);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,Xt,Wt.topics))}catch{}const Gt={address:this.address,topics:Wt.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag$1(Gt),Gt))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(Wt){if(Wt.listenerCount()===0){delete this._runningEvents[Wt.tag];const Gt=this._wrappedEmits[Wt.tag];Gt&&Wt.filter&&(this.provider.off(Wt.filter,Gt),delete this._wrappedEmits[Wt.tag])}}_wrapEvent(Wt,Gt,Yt){const Xt=deepCopy(Gt);return Xt.removeListener=()=>{Yt&&(Wt.removeListener(Yt),this._checkRunningEvents(Wt))},Xt.getBlock=()=>this.provider.getBlock(Gt.blockHash),Xt.getTransaction=()=>this.provider.getTransaction(Gt.transactionHash),Xt.getTransactionReceipt=()=>this.provider.getTransactionReceipt(Gt.transactionHash),Wt.prepareEvent(Xt),Xt}_addEventListener(Wt,Gt,Yt){if(this.provider||logger$u.throwError("events require a provider or a signer with a provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),Wt.addListener(Gt,Yt),this._runningEvents[Wt.tag]=Wt,!this._wrappedEmits[Wt.tag]){const Xt=Jt=>{let Zt=this._wrapEvent(Wt,Jt,Gt);if(Zt.decodeError==null)try{const Qt=Wt.getEmit(Zt);this.emit(Wt.filter,...Qt)}catch(Qt){Zt.decodeError=Qt.error}Wt.filter!=null&&this.emit("event",Zt),Zt.decodeError!=null&&this.emit("error",Zt.decodeError,Zt)};this._wrappedEmits[Wt.tag]=Xt,Wt.filter!=null&&this.provider.on(Wt.filter,Xt)}}queryFilter(Wt,Gt,Yt){const Xt=this._getRunningEvent(Wt),Jt=shallowCopy(Xt.filter);return typeof Gt=="string"&&isHexString(Gt,32)?(Yt!=null&&logger$u.throwArgumentError("cannot specify toBlock with blockhash","toBlock",Yt),Jt.blockHash=Gt):(Jt.fromBlock=Gt??0,Jt.toBlock=Yt??"latest"),this.provider.getLogs(Jt).then(Zt=>Zt.map(Qt=>this._wrapEvent(Xt,Qt,null)))}on(Wt,Gt){return this._addEventListener(this._getRunningEvent(Wt),Gt,!1),this}once(Wt,Gt){return this._addEventListener(this._getRunningEvent(Wt),Gt,!0),this}emit(Wt,...Gt){if(!this.provider)return!1;const Yt=this._getRunningEvent(Wt),Xt=Yt.run(Gt)>0;return this._checkRunningEvents(Yt),Xt}listenerCount(Wt){return this.provider?Wt==null?Object.keys(this._runningEvents).reduce((Gt,Yt)=>Gt+this._runningEvents[Yt].listenerCount(),0):this._getRunningEvent(Wt).listenerCount():0}listeners(Wt){if(!this.provider)return[];if(Wt==null){const Gt=[];for(let Yt in this._runningEvents)this._runningEvents[Yt].listeners().forEach(Xt=>{Gt.push(Xt)});return Gt}return this._getRunningEvent(Wt).listeners()}removeAllListeners(Wt){if(!this.provider)return this;if(Wt==null){for(const Yt in this._runningEvents){const Xt=this._runningEvents[Yt];Xt.removeAllListeners(),this._checkRunningEvents(Xt)}return this}const Gt=this._getRunningEvent(Wt);return Gt.removeAllListeners(),this._checkRunningEvents(Gt),this}off(Wt,Gt){if(!this.provider)return this;const Yt=this._getRunningEvent(Wt);return Yt.removeListener(Gt),this._checkRunningEvents(Yt),this}removeListener(Wt,Gt){return this.off(Wt,Gt)}}class Contract extends BaseContract{}class ContractFactory{constructor(Wt,Gt,Yt){let Xt=null;typeof Gt=="string"?Xt=Gt:isBytes(Gt)?Xt=hexlify(Gt):Gt&&typeof Gt.object=="string"?Xt=Gt.object:Xt="!",Xt.substring(0,2)!=="0x"&&(Xt="0x"+Xt),(!isHexString(Xt)||Xt.length%2)&&logger$u.throwArgumentError("invalid bytecode","bytecode",Gt),Yt&&!Signer$3.isSigner(Yt)&&logger$u.throwArgumentError("invalid signer","signer",Yt),defineReadOnly(this,"bytecode",Xt),defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(Wt)),defineReadOnly(this,"signer",Yt||null)}getDeployTransaction(...Wt){let Gt={};if(Wt.length===this.interface.deploy.inputs.length+1&&typeof Wt[Wt.length-1]=="object"){Gt=shallowCopy(Wt.pop());for(const Yt in Gt)if(!allowedTransactionKeys$4[Yt])throw new Error("unknown transaction override "+Yt)}return["data","from","to"].forEach(Yt=>{Gt[Yt]!=null&&logger$u.throwError("cannot override "+Yt,Logger.errors.UNSUPPORTED_OPERATION,{operation:Yt})}),Gt.value&&!BigNumber.from(Gt.value).isZero()&&!this.interface.deploy.payable&&logger$u.throwError("non-payable constructor cannot override value",Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:Gt.value}),logger$u.checkArgumentCount(Wt.length,this.interface.deploy.inputs.length," in Contract constructor"),Gt.data=hexlify(concat$2([this.bytecode,this.interface.encodeDeploy(Wt)])),Gt}deploy(...Wt){return __awaiter$w(this,void 0,void 0,function*(){let Gt={};Wt.length===this.interface.deploy.inputs.length+1&&(Gt=Wt.pop()),logger$u.checkArgumentCount(Wt.length,this.interface.deploy.inputs.length," in Contract constructor");const Yt=yield resolveAddresses(this.signer,Wt,this.interface.deploy.inputs);Yt.push(Gt);const Xt=this.getDeployTransaction(...Yt),Jt=yield this.signer.sendTransaction(Xt),Zt=getStatic(this.constructor,"getContractAddress")(Jt),Qt=getStatic(this.constructor,"getContract")(Zt,this.interface,this.signer);return addContractWait(Qt,Jt),defineReadOnly(Qt,"deployTransaction",Jt),Qt})}attach(Wt){return this.constructor.getContract(Wt,this.interface,this.signer)}connect(Wt){return new this.constructor(this.interface,this.bytecode,Wt)}static fromSolidity(Wt,Gt){Wt==null&&logger$u.throwError("missing compiler output",Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof Wt=="string"&&(Wt=JSON.parse(Wt));const Yt=Wt.abi;let Xt=null;return Wt.bytecode?Xt=Wt.bytecode:Wt.evm&&Wt.evm.bytecode&&(Xt=Wt.evm.bytecode),new this(Yt,Xt,Gt)}static getInterface(Wt){return Contract.getInterface(Wt)}static getContractAddress(Wt){return getContractAddress(Wt)}static getContract(Wt,Gt,Yt){return new Contract(Wt,Gt,Yt)}}const lib_esm$1=Object.freeze(Object.defineProperty({__proto__:null,BaseContract,Contract,ContractFactory},Symbol.toStringTag,{value:"Module"})),version$h="abstract-signer/5.7.0";var __awaiter$v=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$t=new Logger(version$h),allowedTransactionKeys$3=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors$2=[Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED];let Signer$2=class gw{constructor(){logger$t.checkAbstract(new.target,gw),defineReadOnly(this,"_isSigner",!0)}getBalance(Wt){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),Wt)})}getTransactionCount(Wt){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),Wt)})}estimateGas(Wt){return __awaiter$v(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const Gt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.estimateGas(Gt)})}call(Wt,Gt){return __awaiter$v(this,void 0,void 0,function*(){this._checkProvider("call");const Yt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.call(Yt,Gt)})}sendTransaction(Wt){return __awaiter$v(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const Gt=yield this.populateTransaction(Wt),Yt=yield this.signTransaction(Gt);return yield this.provider.sendTransaction(Yt)})}getChainId(){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(Wt){return __awaiter$v(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(Wt)})}checkTransaction(Wt){for(const Yt in Wt)allowedTransactionKeys$3.indexOf(Yt)===-1&&logger$t.throwArgumentError("invalid transaction key: "+Yt,"transaction",Wt);const Gt=shallowCopy(Wt);return Gt.from==null?Gt.from=this.getAddress():Gt.from=Promise.all([Promise.resolve(Gt.from),this.getAddress()]).then(Yt=>(Yt[0].toLowerCase()!==Yt[1].toLowerCase()&&logger$t.throwArgumentError("from address mismatch","transaction",Wt),Yt[0])),Gt}populateTransaction(Wt){return __awaiter$v(this,void 0,void 0,function*(){const Gt=yield resolveProperties(this.checkTransaction(Wt));Gt.to!=null&&(Gt.to=Promise.resolve(Gt.to).then(Xt=>__awaiter$v(this,void 0,void 0,function*(){if(Xt==null)return null;const Jt=yield this.resolveName(Xt);return Jt==null&&logger$t.throwArgumentError("provided ENS name resolves to null","tx.to",Xt),Jt})),Gt.to.catch(Xt=>{}));const Yt=Gt.maxFeePerGas!=null||Gt.maxPriorityFeePerGas!=null;if(Gt.gasPrice!=null&&(Gt.type===2||Yt)?logger$t.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",Wt):(Gt.type===0||Gt.type===1)&&Yt&&logger$t.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",Wt),(Gt.type===2||Gt.type==null)&&Gt.maxFeePerGas!=null&&Gt.maxPriorityFeePerGas!=null)Gt.type=2;else if(Gt.type===0||Gt.type===1)Gt.gasPrice==null&&(Gt.gasPrice=this.getGasPrice());else{const Xt=yield this.getFeeData();if(Gt.type==null)if(Xt.maxFeePerGas!=null&&Xt.maxPriorityFeePerGas!=null)if(Gt.type=2,Gt.gasPrice!=null){const Jt=Gt.gasPrice;delete Gt.gasPrice,Gt.maxFeePerGas=Jt,Gt.maxPriorityFeePerGas=Jt}else Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas);else Xt.gasPrice!=null?(Yt&&logger$t.throwError("network does not support EIP-1559",Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),Gt.gasPrice==null&&(Gt.gasPrice=Xt.gasPrice),Gt.type=0):logger$t.throwError("failed to get consistent fee data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else Gt.type===2&&(Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas))}return Gt.nonce==null&&(Gt.nonce=this.getTransactionCount("pending")),Gt.gasLimit==null&&(Gt.gasLimit=this.estimateGas(Gt).catch(Xt=>{if(forwardErrors$2.indexOf(Xt.code)>=0)throw Xt;return logger$t.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Xt,tx:Gt})})),Gt.chainId==null?Gt.chainId=this.getChainId():Gt.chainId=Promise.all([Promise.resolve(Gt.chainId),this.getChainId()]).then(Xt=>(Xt[1]!==0&&Xt[0]!==Xt[1]&&logger$t.throwArgumentError("chainId address mismatch","transaction",Wt),Xt[0])),yield resolveProperties(Gt)})}_checkProvider(Wt){this.provider||logger$t.throwError("missing provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:Wt||"_checkProvider"})}static isSigner(Wt){return!!(Wt&&Wt._isSigner)}};class VoidSigner extends Signer$2{constructor(Wt,Gt){super(),defineReadOnly(this,"address",Wt),defineReadOnly(this,"provider",Gt||null)}getAddress(){return Promise.resolve(this.address)}_fail(Wt,Gt){return Promise.resolve().then(()=>{logger$t.throwError(Wt,Logger.errors.UNSUPPORTED_OPERATION,{operation:Gt})})}signMessage(Wt){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(Wt){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(Wt,Gt,Yt){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(Wt){return new VoidSigner(this.address,Wt)}}const version$g="abstract-signer/5.7.0";var __awaiter$u=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$s=new Logger(version$g),allowedTransactionKeys$2=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors$1=[Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED];let Signer$1=class vw{constructor(){logger$s.checkAbstract(new.target,vw),defineReadOnly(this,"_isSigner",!0)}getBalance(Wt){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),Wt)})}getTransactionCount(Wt){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),Wt)})}estimateGas(Wt){return __awaiter$u(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const Gt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.estimateGas(Gt)})}call(Wt,Gt){return __awaiter$u(this,void 0,void 0,function*(){this._checkProvider("call");const Yt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.call(Yt,Gt)})}sendTransaction(Wt){return __awaiter$u(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const Gt=yield this.populateTransaction(Wt),Yt=yield this.signTransaction(Gt);return yield this.provider.sendTransaction(Yt)})}getChainId(){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(Wt){return __awaiter$u(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(Wt)})}checkTransaction(Wt){for(const Yt in Wt)allowedTransactionKeys$2.indexOf(Yt)===-1&&logger$s.throwArgumentError("invalid transaction key: "+Yt,"transaction",Wt);const Gt=shallowCopy(Wt);return Gt.from==null?Gt.from=this.getAddress():Gt.from=Promise.all([Promise.resolve(Gt.from),this.getAddress()]).then(Yt=>(Yt[0].toLowerCase()!==Yt[1].toLowerCase()&&logger$s.throwArgumentError("from address mismatch","transaction",Wt),Yt[0])),Gt}populateTransaction(Wt){return __awaiter$u(this,void 0,void 0,function*(){const Gt=yield resolveProperties(this.checkTransaction(Wt));Gt.to!=null&&(Gt.to=Promise.resolve(Gt.to).then(Xt=>__awaiter$u(this,void 0,void 0,function*(){if(Xt==null)return null;const Jt=yield this.resolveName(Xt);return Jt==null&&logger$s.throwArgumentError("provided ENS name resolves to null","tx.to",Xt),Jt})),Gt.to.catch(Xt=>{}));const Yt=Gt.maxFeePerGas!=null||Gt.maxPriorityFeePerGas!=null;if(Gt.gasPrice!=null&&(Gt.type===2||Yt)?logger$s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",Wt):(Gt.type===0||Gt.type===1)&&Yt&&logger$s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",Wt),(Gt.type===2||Gt.type==null)&&Gt.maxFeePerGas!=null&&Gt.maxPriorityFeePerGas!=null)Gt.type=2;else if(Gt.type===0||Gt.type===1)Gt.gasPrice==null&&(Gt.gasPrice=this.getGasPrice());else{const Xt=yield this.getFeeData();if(Gt.type==null)if(Xt.maxFeePerGas!=null&&Xt.maxPriorityFeePerGas!=null)if(Gt.type=2,Gt.gasPrice!=null){const Jt=Gt.gasPrice;delete Gt.gasPrice,Gt.maxFeePerGas=Jt,Gt.maxPriorityFeePerGas=Jt}else Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas);else Xt.gasPrice!=null?(Yt&&logger$s.throwError("network does not support EIP-1559",Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),Gt.gasPrice==null&&(Gt.gasPrice=Xt.gasPrice),Gt.type=0):logger$s.throwError("failed to get consistent fee data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else Gt.type===2&&(Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas))}return Gt.nonce==null&&(Gt.nonce=this.getTransactionCount("pending")),Gt.gasLimit==null&&(Gt.gasLimit=this.estimateGas(Gt).catch(Xt=>{if(forwardErrors$1.indexOf(Xt.code)>=0)throw Xt;return logger$s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Xt,tx:Gt})})),Gt.chainId==null?Gt.chainId=this.getChainId():Gt.chainId=Promise.all([Promise.resolve(Gt.chainId),this.getChainId()]).then(Xt=>(Xt[1]!==0&&Xt[0]!==Xt[1]&&logger$s.throwArgumentError("chainId address mismatch","transaction",Wt),Xt[0])),yield resolveProperties(Gt)})}_checkProvider(Wt){this.provider||logger$s.throwError("missing provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:Wt||"_checkProvider"})}static isSigner(Wt){return!!(Wt&&Wt._isSigner)}};class BaseX{constructor(Wt){defineReadOnly(this,"alphabet",Wt),defineReadOnly(this,"base",Wt.length),defineReadOnly(this,"_alphabetMap",{}),defineReadOnly(this,"_leader",Wt.charAt(0));for(let Gt=0;Gt<Wt.length;Gt++)this._alphabetMap[Wt.charAt(Gt)]=Gt}encode(Wt){let Gt=arrayify(Wt);if(Gt.length===0)return"";let Yt=[0];for(let Jt=0;Jt<Gt.length;++Jt){let Zt=Gt[Jt];for(let Qt=0;Qt<Yt.length;++Qt)Zt+=Yt[Qt]<<8,Yt[Qt]=Zt%this.base,Zt=Zt/this.base|0;for(;Zt>0;)Yt.push(Zt%this.base),Zt=Zt/this.base|0}let Xt="";for(let Jt=0;Gt[Jt]===0&&Jt<Gt.length-1;++Jt)Xt+=this._leader;for(let Jt=Yt.length-1;Jt>=0;--Jt)Xt+=this.alphabet[Yt[Jt]];return Xt}decode(Wt){if(typeof Wt!="string")throw new TypeError("Expected String");let Gt=[];if(Wt.length===0)return new Uint8Array(Gt);Gt.push(0);for(let Yt=0;Yt<Wt.length;Yt++){let Xt=this._alphabetMap[Wt[Yt]];if(Xt===void 0)throw new Error("Non-base"+this.base+" character");let Jt=Xt;for(let Zt=0;Zt<Gt.length;++Zt)Jt+=Gt[Zt]*this.base,Gt[Zt]=Jt&255,Jt>>=8;for(;Jt>0;)Gt.push(Jt&255),Jt>>=8}for(let Yt=0;Wt[Yt]===this._leader&&Yt<Wt.length-1;++Yt)Gt.push(0);return arrayify(new Uint8Array(Gt.reverse()))}}new BaseX("abcdefghijklmnopqrstuvwxyz234567");const Base58=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var SupportedAlgorithm;(function(Bt){Bt.sha256="sha256",Bt.sha512="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));const version$f="sha2/5.7.0",logger$r=new Logger(version$f);function ripemd160(Bt){return"0x"+hash$9.ripemd160().update(arrayify(Bt)).digest("hex")}function sha256$2(Bt){return"0x"+hash$9.sha256().update(arrayify(Bt)).digest("hex")}function sha512(Bt){return"0x"+hash$9.sha512().update(arrayify(Bt)).digest("hex")}function computeHmac(Bt,Wt,Gt){return SupportedAlgorithm[Bt]||logger$r.throwError("unsupported algorithm "+Bt,Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:Bt}),"0x"+hash$9.hmac(hash$9[Bt],arrayify(Wt)).update(arrayify(Gt)).digest("hex")}function pbkdf2$1(Bt,Wt,Gt,Yt,Xt){Bt=arrayify(Bt),Wt=arrayify(Wt);let Jt,Zt=1;const Qt=new Uint8Array(Yt),ur=new Uint8Array(Wt.length+4);ur.set(Wt);let cr,$r;for(let Ar=1;Ar<=Zt;Ar++){ur[Wt.length]=Ar>>24&255,ur[Wt.length+1]=Ar>>16&255,ur[Wt.length+2]=Ar>>8&255,ur[Wt.length+3]=Ar&255;let Lr=arrayify(computeHmac(Xt,Bt,ur));Jt||(Jt=Lr.length,$r=new Uint8Array(Jt),Zt=Math.ceil(Yt/Jt),cr=Yt-(Zt-1)*Jt),$r.set(Lr);for(let Hr=1;Hr<Gt;Hr++){Lr=arrayify(computeHmac(Xt,Bt,Lr));for(let Br=0;Br<Jt;Br++)$r[Br]^=Lr[Br]}const qr=(Ar-1)*Jt,Fr=Ar===Zt?cr:Jt;Qt.set(arrayify($r).slice(0,Fr),qr)}return hexlify(Qt)}const version$e="wordlists/5.7.0",logger$q=new Logger(version$e);class Wordlist{constructor(Wt){logger$q.checkAbstract(new.target,Wordlist),defineReadOnly(this,"locale",Wt)}split(Wt){return Wt.toLowerCase().split(/ +/g)}join(Wt){return Wt.join(" ")}static check(Wt){const Gt=[];for(let Yt=0;Yt<2048;Yt++){const Xt=Wt.getWord(Yt);if(Yt!==Wt.getWordIndex(Xt))return"0x";Gt.push(Xt)}return id(Gt.join(`
763
763
  `)+`
764
764
  `)}static register(Wt,Gt){Gt||(Gt=Wt.locale)}}const words$1="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let wordlist=null;function loadWords(Bt){if(wordlist==null&&(wordlist=words$1.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Wordlist.check(Bt)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw wordlist=null,new Error("BIP39 Wordlist for en (English) FAILED")}class LangEn extends Wordlist{constructor(){super("en")}getWord(Wt){return loadWords(this),wordlist[Wt]}getWordIndex(Wt){return loadWords(this),wordlist.indexOf(Wt)}}const langEn=new LangEn;Wordlist.register(langEn);const wordlists={en:langEn},version$d="hdnode/5.7.0",logger$p=new Logger(version$d),N$1=BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),MasterSecret=toUtf8Bytes("Bitcoin seed"),HardenedBit=2147483648;function getUpperMask(Bt){return(1<<Bt)-1<<8-Bt}function getLowerMask(Bt){return(1<<Bt)-1}function bytes32(Bt){return hexZeroPad(hexlify(Bt),32)}function base58check(Bt){return Base58.encode(concat$2([Bt,hexDataSlice(sha256$2(sha256$2(Bt)),0,4)]))}function getWordlist(Bt){if(Bt==null)return wordlists.en;if(typeof Bt=="string"){const Wt=wordlists[Bt];return Wt==null&&logger$p.throwArgumentError("unknown locale","wordlist",Bt),Wt}return Bt}const _constructorGuard$1={},defaultPath="m/44'/60'/0'/0/0";class HDNode{constructor(Wt,Gt,Yt,Xt,Jt,Zt,Qt,ur){if(Wt!==_constructorGuard$1)throw new Error("HDNode constructor cannot be called directly");if(Gt){const cr=new SigningKey(Gt);defineReadOnly(this,"privateKey",cr.privateKey),defineReadOnly(this,"publicKey",cr.compressedPublicKey)}else defineReadOnly(this,"privateKey",null),defineReadOnly(this,"publicKey",hexlify(Yt));defineReadOnly(this,"parentFingerprint",Xt),defineReadOnly(this,"fingerprint",hexDataSlice(ripemd160(sha256$2(this.publicKey)),0,4)),defineReadOnly(this,"address",computeAddress$1(this.publicKey)),defineReadOnly(this,"chainCode",Jt),defineReadOnly(this,"index",Zt),defineReadOnly(this,"depth",Qt),ur==null?(defineReadOnly(this,"mnemonic",null),defineReadOnly(this,"path",null)):typeof ur=="string"?(defineReadOnly(this,"mnemonic",null),defineReadOnly(this,"path",ur)):(defineReadOnly(this,"mnemonic",ur),defineReadOnly(this,"path",ur.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return base58check(concat$2([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",hexlify(this.depth),this.parentFingerprint,hexZeroPad(hexlify(this.index),4),this.chainCode,this.privateKey!=null?concat$2(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new HDNode(_constructorGuard$1,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(Wt){if(Wt>4294967295)throw new Error("invalid index - "+String(Wt));let Gt=this.path;Gt&&(Gt+="/"+(Wt&~HardenedBit));const Yt=new Uint8Array(37);if(Wt&HardenedBit){if(!this.privateKey)throw new Error("cannot derive child of neutered node");Yt.set(arrayify(this.privateKey),1),Gt&&(Gt+="'")}else Yt.set(arrayify(this.publicKey));for(let Ar=24;Ar>=0;Ar-=8)Yt[33+(Ar>>3)]=Wt>>24-Ar&255;const Xt=arrayify(computeHmac(SupportedAlgorithm.sha512,this.chainCode,Yt)),Jt=Xt.slice(0,32),Zt=Xt.slice(32);let Qt=null,ur=null;this.privateKey?Qt=bytes32(BigNumber.from(Jt).add(this.privateKey).mod(N$1)):ur=new SigningKey(hexlify(Jt))._addPoint(this.publicKey);let cr=Gt;const $r=this.mnemonic;return $r&&(cr=Object.freeze({phrase:$r.phrase,path:Gt,locale:$r.locale||"en"})),new HDNode(_constructorGuard$1,Qt,ur,this.fingerprint,bytes32(Zt),Wt,this.depth+1,cr)}derivePath(Wt){const Gt=Wt.split("/");if(Gt.length===0||Gt[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+Wt);Gt[0]==="m"&&Gt.shift();let Yt=this;for(let Xt=0;Xt<Gt.length;Xt++){const Jt=Gt[Xt];if(Jt.match(/^[0-9]+'$/)){const Zt=parseInt(Jt.substring(0,Jt.length-1));if(Zt>=HardenedBit)throw new Error("invalid path index - "+Jt);Yt=Yt._derive(HardenedBit+Zt)}else if(Jt.match(/^[0-9]+$/)){const Zt=parseInt(Jt);if(Zt>=HardenedBit)throw new Error("invalid path index - "+Jt);Yt=Yt._derive(Zt)}else throw new Error("invalid path component - "+Jt)}return Yt}static _fromSeed(Wt,Gt){const Yt=arrayify(Wt);if(Yt.length<16||Yt.length>64)throw new Error("invalid seed");const Xt=arrayify(computeHmac(SupportedAlgorithm.sha512,MasterSecret,Yt));return new HDNode(_constructorGuard$1,bytes32(Xt.slice(0,32)),null,"0x00000000",bytes32(Xt.slice(32)),0,0,Gt)}static fromMnemonic(Wt,Gt,Yt){return Yt=getWordlist(Yt),Wt=entropyToMnemonic(mnemonicToEntropy(Wt,Yt),Yt),HDNode._fromSeed(mnemonicToSeed(Wt,Gt),{phrase:Wt,path:"m",locale:Yt.locale})}static fromSeed(Wt){return HDNode._fromSeed(Wt,null)}static fromExtendedKey(Wt){const Gt=Base58.decode(Wt);(Gt.length!==82||base58check(Gt.slice(0,78))!==Wt)&&logger$p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const Yt=Gt[4],Xt=hexlify(Gt.slice(5,9)),Jt=parseInt(hexlify(Gt.slice(9,13)).substring(2),16),Zt=hexlify(Gt.slice(13,45)),Qt=Gt.slice(45,78);switch(hexlify(Gt.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new HDNode(_constructorGuard$1,null,hexlify(Qt),Xt,Zt,Jt,Yt,null);case"0x0488ade4":case"0x04358394 ":if(Qt[0]!==0)break;return new HDNode(_constructorGuard$1,hexlify(Qt.slice(1)),null,Xt,Zt,Jt,Yt,null)}return logger$p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function mnemonicToSeed(Bt,Wt){Wt||(Wt="");const Gt=toUtf8Bytes("mnemonic"+Wt,UnicodeNormalizationForm.NFKD);return pbkdf2$1(toUtf8Bytes(Bt,UnicodeNormalizationForm.NFKD),Gt,2048,64,"sha512")}function mnemonicToEntropy(Bt,Wt){Wt=getWordlist(Wt),logger$p.checkNormalize();const Gt=Wt.split(Bt);if(Gt.length%3!==0)throw new Error("invalid mnemonic");const Yt=arrayify(new Uint8Array(Math.ceil(11*Gt.length/8)));let Xt=0;for(let cr=0;cr<Gt.length;cr++){let $r=Wt.getWordIndex(Gt[cr].normalize("NFKD"));if($r===-1)throw new Error("invalid mnemonic");for(let Ar=0;Ar<11;Ar++)$r&1<<10-Ar&&(Yt[Xt>>3]|=1<<7-Xt%8),Xt++}const Jt=32*Gt.length/3,Zt=Gt.length/3,Qt=getUpperMask(Zt);if((arrayify(sha256$2(Yt.slice(0,Jt/8)))[0]&Qt)!==(Yt[Yt.length-1]&Qt))throw new Error("invalid checksum");return hexlify(Yt.slice(0,Jt/8))}function entropyToMnemonic(Bt,Wt){if(Wt=getWordlist(Wt),Bt=arrayify(Bt),Bt.length%4!==0||Bt.length<16||Bt.length>32)throw new Error("invalid entropy");const Gt=[0];let Yt=11;for(let Zt=0;Zt<Bt.length;Zt++)Yt>8?(Gt[Gt.length-1]<<=8,Gt[Gt.length-1]|=Bt[Zt],Yt-=8):(Gt[Gt.length-1]<<=Yt,Gt[Gt.length-1]|=Bt[Zt]>>8-Yt,Gt.push(Bt[Zt]&getLowerMask(8-Yt)),Yt+=3);const Xt=Bt.length/4,Jt=arrayify(sha256$2(Bt))[0]&getUpperMask(Xt);return Gt[Gt.length-1]<<=Xt,Gt[Gt.length-1]|=Jt>>8-Xt,Wt.join(Gt.map(Zt=>Wt.getWord(Zt)))}function isValidMnemonic(Bt,Wt){try{return mnemonicToEntropy(Bt,Wt),!0}catch{}return!1}function getAccountPath(Bt){return(typeof Bt!="number"||Bt<0||Bt>=HardenedBit||Bt%1)&&logger$p.throwArgumentError("invalid account index","index",Bt),`m/44'/60'/${Bt}'/0/0`}const version$c="random/5.7.0",logger$o=new Logger(version$c);function getGlobal(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global$1<"u")return global$1;throw new Error("unable to locate global object")}const anyGlobal=getGlobal();let crypto$6=anyGlobal.crypto||anyGlobal.msCrypto;(!crypto$6||!crypto$6.getRandomValues)&&(logger$o.warn("WARNING: Missing strong random number source"),crypto$6={getRandomValues:function(Bt){return logger$o.throwError("no secure random source avaialble",Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function randomBytes(Bt){(Bt<=0||Bt>1024||Bt%1||Bt!=Bt)&&logger$o.throwArgumentError("invalid length","length",Bt);const Wt=new Uint8Array(Bt);return crypto$6.getRandomValues(Wt),arrayify(Wt)}function shuffled(Bt){Bt=Bt.slice();for(let Wt=Bt.length-1;Wt>0;Wt--){const Gt=Math.floor(Math.random()*(Wt+1)),Yt=Bt[Wt];Bt[Wt]=Bt[Gt],Bt[Gt]=Yt}return Bt}var aesJs={exports:{}};(function(Bt,Wt){(function(Gt){function Yt(Jr){return parseInt(Jr)===Jr}function Xt(Jr){if(!Yt(Jr.length))return!1;for(var mn=0;mn<Jr.length;mn++)if(!Yt(Jr[mn])||Jr[mn]<0||Jr[mn]>255)return!1;return!0}function Jt(Jr,mn){if(Jr.buffer&&ArrayBuffer.isView(Jr)&&Jr.name==="Uint8Array")return mn&&(Jr.slice?Jr=Jr.slice():Jr=Array.prototype.slice.call(Jr)),Jr;if(Array.isArray(Jr)){if(!Xt(Jr))throw new Error("Array contains invalid value: "+Jr);return new Uint8Array(Jr)}if(Yt(Jr.length)&&Xt(Jr))return new Uint8Array(Jr);throw new Error("unsupported array-like object")}function Zt(Jr){return new Uint8Array(Jr)}function Qt(Jr,mn,gn,eo,_i){(eo!=null||_i!=null)&&(Jr.slice?Jr=Jr.slice(eo,_i):Jr=Array.prototype.slice.call(Jr,eo,_i)),mn.set(Jr,gn)}var ur=function(){function Jr(gn){var eo=[],_i=0;for(gn=encodeURI(gn);_i<gn.length;){var ro=gn.charCodeAt(_i++);ro===37?(eo.push(parseInt(gn.substr(_i,2),16)),_i+=2):eo.push(ro)}return Jt(eo)}function mn(gn){for(var eo=[],_i=0;_i<gn.length;){var ro=gn[_i];ro<128?(eo.push(String.fromCharCode(ro)),_i++):ro>191&&ro<224?(eo.push(String.fromCharCode((ro&31)<<6|gn[_i+1]&63)),_i+=2):(eo.push(String.fromCharCode((ro&15)<<12|(gn[_i+1]&63)<<6|gn[_i+2]&63)),_i+=3)}return eo.join("")}return{toBytes:Jr,fromBytes:mn}}(),cr=function(){function Jr(eo){for(var _i=[],ro=0;ro<eo.length;ro+=2)_i.push(parseInt(eo.substr(ro,2),16));return _i}var mn="0123456789abcdef";function gn(eo){for(var _i=[],ro=0;ro<eo.length;ro++){var io=eo[ro];_i.push(mn[(io&240)>>4]+mn[io&15])}return _i.join("")}return{toBytes:Jr,fromBytes:gn}}(),$r={16:10,24:12,32:14},Ar=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Lr=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],qr=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Fr=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Hr=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Br=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Wr=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Gr=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Kr=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Yr=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],hn=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Qr=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],pn=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],En=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ga=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function dn(Jr){for(var mn=[],gn=0;gn<Jr.length;gn+=4)mn.push(Jr[gn]<<24|Jr[gn+1]<<16|Jr[gn+2]<<8|Jr[gn+3]);return mn}var Pr=function(Jr){if(!(this instanceof Pr))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:Jt(Jr,!0)}),this._prepare()};Pr.prototype._prepare=function(){var Jr=$r[this.key.length];if(Jr==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var mn=0;mn<=Jr;mn++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var gn=(Jr+1)*4,eo=this.key.length/4,_i=dn(this.key),ro,mn=0;mn<eo;mn++)ro=mn>>2,this._Ke[ro][mn%4]=_i[mn],this._Kd[Jr-ro][mn%4]=_i[mn];for(var io=0,ao=eo,oo;ao<gn;){if(oo=_i[eo-1],_i[0]^=Lr[oo>>16&255]<<24^Lr[oo>>8&255]<<16^Lr[oo&255]<<8^Lr[oo>>24&255]^Ar[io]<<24,io+=1,eo!=8)for(var mn=1;mn<eo;mn++)_i[mn]^=_i[mn-1];else{for(var mn=1;mn<eo/2;mn++)_i[mn]^=_i[mn-1];oo=_i[eo/2-1],_i[eo/2]^=Lr[oo&255]^Lr[oo>>8&255]<<8^Lr[oo>>16&255]<<16^Lr[oo>>24&255]<<24;for(var mn=eo/2+1;mn<eo;mn++)_i[mn]^=_i[mn-1]}for(var mn=0,to,so;mn<eo&&ao<gn;)to=ao>>2,so=ao%4,this._Ke[to][so]=_i[mn],this._Kd[Jr-to][so]=_i[mn++],ao++}for(var to=1;to<Jr;to++)for(var so=0;so<4;so++)oo=this._Kd[to][so],this._Kd[to][so]=Qr[oo>>24&255]^pn[oo>>16&255]^En[oo>>8&255]^ga[oo&255]},Pr.prototype.encrypt=function(Jr){if(Jr.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var mn=this._Ke.length-1,gn=[0,0,0,0],eo=dn(Jr),_i=0;_i<4;_i++)eo[_i]^=this._Ke[0][_i];for(var ro=1;ro<mn;ro++){for(var _i=0;_i<4;_i++)gn[_i]=Fr[eo[_i]>>24&255]^Hr[eo[(_i+1)%4]>>16&255]^Br[eo[(_i+2)%4]>>8&255]^Wr[eo[(_i+3)%4]&255]^this._Ke[ro][_i];eo=gn.slice()}for(var io=Zt(16),ao,_i=0;_i<4;_i++)ao=this._Ke[mn][_i],io[4*_i]=(Lr[eo[_i]>>24&255]^ao>>24)&255,io[4*_i+1]=(Lr[eo[(_i+1)%4]>>16&255]^ao>>16)&255,io[4*_i+2]=(Lr[eo[(_i+2)%4]>>8&255]^ao>>8)&255,io[4*_i+3]=(Lr[eo[(_i+3)%4]&255]^ao)&255;return io},Pr.prototype.decrypt=function(Jr){if(Jr.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var mn=this._Kd.length-1,gn=[0,0,0,0],eo=dn(Jr),_i=0;_i<4;_i++)eo[_i]^=this._Kd[0][_i];for(var ro=1;ro<mn;ro++){for(var _i=0;_i<4;_i++)gn[_i]=Gr[eo[_i]>>24&255]^Kr[eo[(_i+3)%4]>>16&255]^Yr[eo[(_i+2)%4]>>8&255]^hn[eo[(_i+1)%4]&255]^this._Kd[ro][_i];eo=gn.slice()}for(var io=Zt(16),ao,_i=0;_i<4;_i++)ao=this._Kd[mn][_i],io[4*_i]=(qr[eo[_i]>>24&255]^ao>>24)&255,io[4*_i+1]=(qr[eo[(_i+3)%4]>>16&255]^ao>>16)&255,io[4*_i+2]=(qr[eo[(_i+2)%4]>>8&255]^ao>>8)&255,io[4*_i+3]=(qr[eo[(_i+1)%4]&255]^ao)&255;return io};var xr=function(Jr){if(!(this instanceof xr))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Pr(Jr)};xr.prototype.encrypt=function(Jr){if(Jr=Jt(Jr),Jr.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var mn=Zt(Jr.length),gn=Zt(16),eo=0;eo<Jr.length;eo+=16)Qt(Jr,gn,0,eo,eo+16),gn=this._aes.encrypt(gn),Qt(gn,mn,eo);return mn},xr.prototype.decrypt=function(Jr){if(Jr=Jt(Jr),Jr.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var mn=Zt(Jr.length),gn=Zt(16),eo=0;eo<Jr.length;eo+=16)Qt(Jr,gn,0,eo,eo+16),gn=this._aes.decrypt(gn),Qt(gn,mn,eo);return mn};var Mr=function(Jr,mn){if(!(this instanceof Mr))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!mn)mn=Zt(16);else if(mn.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=Jt(mn,!0),this._aes=new Pr(Jr)};Mr.prototype.encrypt=function(Jr){if(Jr=Jt(Jr),Jr.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var mn=Zt(Jr.length),gn=Zt(16),eo=0;eo<Jr.length;eo+=16){Qt(Jr,gn,0,eo,eo+16);for(var _i=0;_i<16;_i++)gn[_i]^=this._lastCipherblock[_i];this._lastCipherblock=this._aes.encrypt(gn),Qt(this._lastCipherblock,mn,eo)}return mn},Mr.prototype.decrypt=function(Jr){if(Jr=Jt(Jr),Jr.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var mn=Zt(Jr.length),gn=Zt(16),eo=0;eo<Jr.length;eo+=16){Qt(Jr,gn,0,eo,eo+16),gn=this._aes.decrypt(gn);for(var _i=0;_i<16;_i++)mn[eo+_i]=gn[_i]^this._lastCipherblock[_i];Qt(Jr,this._lastCipherblock,0,eo,eo+16)}return mn};var Nr=function(Jr,mn,gn){if(!(this instanceof Nr))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!mn)mn=Zt(16);else if(mn.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");gn||(gn=1),this.segmentSize=gn,this._shiftRegister=Jt(mn,!0),this._aes=new Pr(Jr)};Nr.prototype.encrypt=function(Jr){if(Jr.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var mn=Jt(Jr,!0),gn,eo=0;eo<mn.length;eo+=this.segmentSize){gn=this._aes.encrypt(this._shiftRegister);for(var _i=0;_i<this.segmentSize;_i++)mn[eo+_i]^=gn[_i];Qt(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Qt(mn,this._shiftRegister,16-this.segmentSize,eo,eo+this.segmentSize)}return mn},Nr.prototype.decrypt=function(Jr){if(Jr.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var mn=Jt(Jr,!0),gn,eo=0;eo<mn.length;eo+=this.segmentSize){gn=this._aes.encrypt(this._shiftRegister);for(var _i=0;_i<this.segmentSize;_i++)mn[eo+_i]^=gn[_i];Qt(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Qt(Jr,this._shiftRegister,16-this.segmentSize,eo,eo+this.segmentSize)}return mn};var Ur=function(Jr,mn){if(!(this instanceof Ur))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!mn)mn=Zt(16);else if(mn.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=Jt(mn,!0),this._lastPrecipherIndex=16,this._aes=new Pr(Jr)};Ur.prototype.encrypt=function(Jr){for(var mn=Jt(Jr,!0),gn=0;gn<mn.length;gn++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),mn[gn]^=this._lastPrecipher[this._lastPrecipherIndex++];return mn},Ur.prototype.decrypt=Ur.prototype.encrypt;var Vr=function(Jr){if(!(this instanceof Vr))throw Error("Counter must be instanitated with `new`");Jr!==0&&!Jr&&(Jr=1),typeof Jr=="number"?(this._counter=Zt(16),this.setValue(Jr)):this.setBytes(Jr)};Vr.prototype.setValue=function(Jr){if(typeof Jr!="number"||parseInt(Jr)!=Jr)throw new Error("invalid counter value (must be an integer)");for(var mn=15;mn>=0;--mn)this._counter[mn]=Jr%256,Jr=Jr>>8},Vr.prototype.setBytes=function(Jr){if(Jr=Jt(Jr,!0),Jr.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=Jr},Vr.prototype.increment=function(){for(var Jr=15;Jr>=0;Jr--)if(this._counter[Jr]===255)this._counter[Jr]=0;else{this._counter[Jr]++;break}};var Zr=function(Jr,mn){if(!(this instanceof Zr))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",mn instanceof Vr||(mn=new Vr(mn)),this._counter=mn,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Pr(Jr)};Zr.prototype.encrypt=function(Jr){for(var mn=Jt(Jr,!0),gn=0;gn<mn.length;gn++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),mn[gn]^=this._remainingCounter[this._remainingCounterIndex++];return mn},Zr.prototype.decrypt=Zr.prototype.encrypt;function Xr(Jr){Jr=Jt(Jr,!0);var mn=16-Jr.length%16,gn=Zt(Jr.length+mn);Qt(Jr,gn);for(var eo=Jr.length;eo<gn.length;eo++)gn[eo]=mn;return gn}function Or(Jr){if(Jr=Jt(Jr,!0),Jr.length<16)throw new Error("PKCS#7 invalid length");var mn=Jr[Jr.length-1];if(mn>16)throw new Error("PKCS#7 padding byte out of range");for(var gn=Jr.length-mn,eo=0;eo<mn;eo++)if(Jr[gn+eo]!==mn)throw new Error("PKCS#7 invalid padding byte");var _i=Zt(gn);return Qt(Jr,_i,0,0,gn),_i}var jr={AES:Pr,Counter:Vr,ModeOfOperation:{ecb:xr,cbc:Mr,cfb:Nr,ofb:Ur,ctr:Zr},utils:{hex:cr,utf8:ur},padding:{pkcs7:{pad:Xr,strip:Or}},_arrayTest:{coerceArray:Jt,createArray:Zt,copyArray:Qt}};Bt.exports=jr})()})(aesJs);var aesJsExports=aesJs.exports;const aes=getDefaultExportFromCjs(aesJsExports),version$b="json-wallets/5.7.0";function looseArrayify(Bt){return typeof Bt=="string"&&Bt.substring(0,2)!=="0x"&&(Bt="0x"+Bt),arrayify(Bt)}function zpad(Bt,Wt){for(Bt=String(Bt);Bt.length<Wt;)Bt="0"+Bt;return Bt}function getPassword(Bt){return typeof Bt=="string"?toUtf8Bytes(Bt,UnicodeNormalizationForm.NFKC):arrayify(Bt)}function searchPath(Bt,Wt){let Gt=Bt;const Yt=Wt.toLowerCase().split("/");for(let Xt=0;Xt<Yt.length;Xt++){let Jt=null;for(const Zt in Gt)if(Zt.toLowerCase()===Yt[Xt]){Jt=Gt[Zt];break}if(Jt===null)return null;Gt=Jt}return Gt}function uuidV4(Bt){const Wt=arrayify(Bt);Wt[6]=Wt[6]&15|64,Wt[8]=Wt[8]&63|128;const Gt=hexlify(Wt);return[Gt.substring(2,10),Gt.substring(10,14),Gt.substring(14,18),Gt.substring(18,22),Gt.substring(22,34)].join("-")}const logger$n=new Logger(version$b);class CrowdsaleAccount extends Description{isCrowdsaleAccount(Wt){return!!(Wt&&Wt._isCrowdsaleAccount)}}function decrypt$1(Bt,Wt){const Gt=JSON.parse(Bt);Wt=getPassword(Wt);const Yt=getAddress(searchPath(Gt,"ethaddr")),Xt=looseArrayify(searchPath(Gt,"encseed"));(!Xt||Xt.length%16!==0)&&logger$n.throwArgumentError("invalid encseed","json",Bt);const Jt=arrayify(pbkdf2$1(Wt,Wt,2e3,32,"sha256")).slice(0,16),Zt=Xt.slice(0,16),Qt=Xt.slice(16),ur=new aes.ModeOfOperation.cbc(Jt,Zt),cr=aes.padding.pkcs7.strip(arrayify(ur.decrypt(Qt)));let $r="";for(let qr=0;qr<cr.length;qr++)$r+=String.fromCharCode(cr[qr]);const Ar=toUtf8Bytes($r),Lr=keccak256$1(Ar);return new CrowdsaleAccount({_isCrowdsaleAccount:!0,address:Yt,privateKey:Lr})}function isCrowdsaleWallet(Bt){let Wt=null;try{Wt=JSON.parse(Bt)}catch{return!1}return Wt.encseed&&Wt.ethaddr}function isKeystoreWallet(Bt){let Wt=null;try{Wt=JSON.parse(Bt)}catch{return!1}return!(!Wt.version||parseInt(Wt.version)!==Wt.version||parseInt(Wt.version)!==3)}function getJsonWalletAddress(Bt){if(isCrowdsaleWallet(Bt))try{return getAddress(JSON.parse(Bt).ethaddr)}catch{return null}if(isKeystoreWallet(Bt))try{return getAddress(JSON.parse(Bt).address)}catch{return null}return null}var scrypt$1={exports:{}};(function(Bt,Wt){(function(Gt){function Xt(Hr){const Br=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let Wr=1779033703,Gr=3144134277,Kr=1013904242,Yr=2773480762,hn=1359893119,Qr=2600822924,pn=528734635,En=1541459225;const ga=new Uint32Array(64);function dn(Zr){let Xr=0,Or=Zr.length;for(;Or>=64;){let jr=Wr,Jr=Gr,mn=Kr,gn=Yr,eo=hn,_i=Qr,ro=pn,io=En,ao,oo,to,so,lo;for(oo=0;oo<16;oo++)to=Xr+oo*4,ga[oo]=(Zr[to]&255)<<24|(Zr[to+1]&255)<<16|(Zr[to+2]&255)<<8|Zr[to+3]&255;for(oo=16;oo<64;oo++)ao=ga[oo-2],so=(ao>>>17|ao<<32-17)^(ao>>>19|ao<<32-19)^ao>>>10,ao=ga[oo-15],lo=(ao>>>7|ao<<32-7)^(ao>>>18|ao<<32-18)^ao>>>3,ga[oo]=(so+ga[oo-7]|0)+(lo+ga[oo-16]|0)|0;for(oo=0;oo<64;oo++)so=(((eo>>>6|eo<<32-6)^(eo>>>11|eo<<32-11)^(eo>>>25|eo<<32-25))+(eo&_i^~eo&ro)|0)+(io+(Br[oo]+ga[oo]|0)|0)|0,lo=((jr>>>2|jr<<32-2)^(jr>>>13|jr<<32-13)^(jr>>>22|jr<<32-22))+(jr&Jr^jr&mn^Jr&mn)|0,io=ro,ro=_i,_i=eo,eo=gn+so|0,gn=mn,mn=Jr,Jr=jr,jr=so+lo|0;Wr=Wr+jr|0,Gr=Gr+Jr|0,Kr=Kr+mn|0,Yr=Yr+gn|0,hn=hn+eo|0,Qr=Qr+_i|0,pn=pn+ro|0,En=En+io|0,Xr+=64,Or-=64}}dn(Hr);let Pr,xr=Hr.length%64,Mr=Hr.length/536870912|0,Nr=Hr.length<<3,Ur=xr<56?56:120,Vr=Hr.slice(Hr.length-xr,Hr.length);for(Vr.push(128),Pr=xr+1;Pr<Ur;Pr++)Vr.push(0);return Vr.push(Mr>>>24&255),Vr.push(Mr>>>16&255),Vr.push(Mr>>>8&255),Vr.push(Mr>>>0&255),Vr.push(Nr>>>24&255),Vr.push(Nr>>>16&255),Vr.push(Nr>>>8&255),Vr.push(Nr>>>0&255),dn(Vr),[Wr>>>24&255,Wr>>>16&255,Wr>>>8&255,Wr>>>0&255,Gr>>>24&255,Gr>>>16&255,Gr>>>8&255,Gr>>>0&255,Kr>>>24&255,Kr>>>16&255,Kr>>>8&255,Kr>>>0&255,Yr>>>24&255,Yr>>>16&255,Yr>>>8&255,Yr>>>0&255,hn>>>24&255,hn>>>16&255,hn>>>8&255,hn>>>0&255,Qr>>>24&255,Qr>>>16&255,Qr>>>8&255,Qr>>>0&255,pn>>>24&255,pn>>>16&255,pn>>>8&255,pn>>>0&255,En>>>24&255,En>>>16&255,En>>>8&255,En>>>0&255]}function Jt(Hr,Br,Wr){Hr=Hr.length<=64?Hr:Xt(Hr);const Gr=64+Br.length+4,Kr=new Array(Gr),Yr=new Array(64);let hn,Qr=[];for(hn=0;hn<64;hn++)Kr[hn]=54;for(hn=0;hn<Hr.length;hn++)Kr[hn]^=Hr[hn];for(hn=0;hn<Br.length;hn++)Kr[64+hn]=Br[hn];for(hn=Gr-4;hn<Gr;hn++)Kr[hn]=0;for(hn=0;hn<64;hn++)Yr[hn]=92;for(hn=0;hn<Hr.length;hn++)Yr[hn]^=Hr[hn];function pn(){for(let En=Gr-1;En>=Gr-4;En--){if(Kr[En]++,Kr[En]<=255)return;Kr[En]=0}}for(;Wr>=32;)pn(),Qr=Qr.concat(Xt(Yr.concat(Xt(Kr)))),Wr-=32;return Wr>0&&(pn(),Qr=Qr.concat(Xt(Yr.concat(Xt(Kr))).slice(0,Wr))),Qr}function Zt(Hr,Br,Wr,Gr,Kr){let Yr;for($r(Hr,(2*Wr-1)*16,Kr,0,16),Yr=0;Yr<2*Wr;Yr++)cr(Hr,Yr*16,Kr,16),ur(Kr,Gr),$r(Kr,0,Hr,Br+Yr*16,16);for(Yr=0;Yr<Wr;Yr++)$r(Hr,Br+Yr*2*16,Hr,Yr*16,16);for(Yr=0;Yr<Wr;Yr++)$r(Hr,Br+(Yr*2+1)*16,Hr,(Yr+Wr)*16,16)}function Qt(Hr,Br){return Hr<<Br|Hr>>>32-Br}function ur(Hr,Br){$r(Hr,0,Br,0,16);for(let Wr=8;Wr>0;Wr-=2)Br[4]^=Qt(Br[0]+Br[12],7),Br[8]^=Qt(Br[4]+Br[0],9),Br[12]^=Qt(Br[8]+Br[4],13),Br[0]^=Qt(Br[12]+Br[8],18),Br[9]^=Qt(Br[5]+Br[1],7),Br[13]^=Qt(Br[9]+Br[5],9),Br[1]^=Qt(Br[13]+Br[9],13),Br[5]^=Qt(Br[1]+Br[13],18),Br[14]^=Qt(Br[10]+Br[6],7),Br[2]^=Qt(Br[14]+Br[10],9),Br[6]^=Qt(Br[2]+Br[14],13),Br[10]^=Qt(Br[6]+Br[2],18),Br[3]^=Qt(Br[15]+Br[11],7),Br[7]^=Qt(Br[3]+Br[15],9),Br[11]^=Qt(Br[7]+Br[3],13),Br[15]^=Qt(Br[11]+Br[7],18),Br[1]^=Qt(Br[0]+Br[3],7),Br[2]^=Qt(Br[1]+Br[0],9),Br[3]^=Qt(Br[2]+Br[1],13),Br[0]^=Qt(Br[3]+Br[2],18),Br[6]^=Qt(Br[5]+Br[4],7),Br[7]^=Qt(Br[6]+Br[5],9),Br[4]^=Qt(Br[7]+Br[6],13),Br[5]^=Qt(Br[4]+Br[7],18),Br[11]^=Qt(Br[10]+Br[9],7),Br[8]^=Qt(Br[11]+Br[10],9),Br[9]^=Qt(Br[8]+Br[11],13),Br[10]^=Qt(Br[9]+Br[8],18),Br[12]^=Qt(Br[15]+Br[14],7),Br[13]^=Qt(Br[12]+Br[15],9),Br[14]^=Qt(Br[13]+Br[12],13),Br[15]^=Qt(Br[14]+Br[13],18);for(let Wr=0;Wr<16;++Wr)Hr[Wr]+=Br[Wr]}function cr(Hr,Br,Wr,Gr){for(let Kr=0;Kr<Gr;Kr++)Wr[Kr]^=Hr[Br+Kr]}function $r(Hr,Br,Wr,Gr,Kr){for(;Kr--;)Wr[Gr++]=Hr[Br++]}function Ar(Hr){if(!Hr||typeof Hr.length!="number")return!1;for(let Br=0;Br<Hr.length;Br++){const Wr=Hr[Br];if(typeof Wr!="number"||Wr%1||Wr<0||Wr>=256)return!1}return!0}function Lr(Hr,Br){if(typeof Hr!="number"||Hr%1)throw new Error("invalid "+Br);return Hr}function qr(Hr,Br,Wr,Gr,Kr,Yr,hn){if(Wr=Lr(Wr,"N"),Gr=Lr(Gr,"r"),Kr=Lr(Kr,"p"),Yr=Lr(Yr,"dkLen"),Wr===0||Wr&Wr-1)throw new Error("N must be power of 2");if(Wr>2147483647/128/Gr)throw new Error("N too large");if(Gr>2147483647/128/Kr)throw new Error("r too large");if(!Ar(Hr))throw new Error("password must be an array or buffer");if(Hr=Array.prototype.slice.call(Hr),!Ar(Br))throw new Error("salt must be an array or buffer");Br=Array.prototype.slice.call(Br);let Qr=Jt(Hr,Br,Kr*128*Gr);const pn=new Uint32Array(Kr*32*Gr);for(let eo=0;eo<pn.length;eo++){const _i=eo*4;pn[eo]=(Qr[_i+3]&255)<<24|(Qr[_i+2]&255)<<16|(Qr[_i+1]&255)<<8|(Qr[_i+0]&255)<<0}const En=new Uint32Array(64*Gr),ga=new Uint32Array(32*Gr*Wr),dn=32*Gr,Pr=new Uint32Array(16),xr=new Uint32Array(16),Mr=Kr*Wr*2;let Nr=0,Ur=null,Vr=!1,Zr=0,Xr=0,Or,jr;const Jr=hn?parseInt(1e3/Gr):4294967295,mn=typeof setImmediate<"u"?setImmediate:setTimeout,gn=function(){if(Vr)return hn(new Error("cancelled"),Nr/Mr);let eo;switch(Zr){case 0:jr=Xr*32*Gr,$r(pn,jr,En,0,dn),Zr=1,Or=0;case 1:eo=Wr-Or,eo>Jr&&(eo=Jr);for(let ro=0;ro<eo;ro++)$r(En,0,ga,(Or+ro)*dn,dn),Zt(En,dn,Gr,Pr,xr);if(Or+=eo,Nr+=eo,hn){const ro=parseInt(1e3*Nr/Mr);if(ro!==Ur){if(Vr=hn(null,Nr/Mr),Vr)break;Ur=ro}}if(Or<Wr)break;Or=0,Zr=2;case 2:eo=Wr-Or,eo>Jr&&(eo=Jr);for(let ro=0;ro<eo;ro++){const io=(2*Gr-1)*16,ao=En[io]&Wr-1;cr(ga,ao*dn,En,dn),Zt(En,dn,Gr,Pr,xr)}if(Or+=eo,Nr+=eo,hn){const ro=parseInt(1e3*Nr/Mr);if(ro!==Ur){if(Vr=hn(null,Nr/Mr),Vr)break;Ur=ro}}if(Or<Wr)break;if($r(En,0,pn,jr,dn),Xr++,Xr<Kr){Zr=0;break}Qr=[];for(let ro=0;ro<pn.length;ro++)Qr.push(pn[ro]>>0&255),Qr.push(pn[ro]>>8&255),Qr.push(pn[ro]>>16&255),Qr.push(pn[ro]>>24&255);const _i=Jt(Hr,Qr,Yr);return hn&&hn(null,1,_i),_i}hn&&mn(gn)};if(!hn)for(;;){const eo=gn();if(eo!=null)return eo}gn()}const Fr={scrypt:function(Hr,Br,Wr,Gr,Kr,Yr,hn){return new Promise(function(Qr,pn){let En=0;hn&&hn(0),qr(Hr,Br,Wr,Gr,Kr,Yr,function(ga,dn,Pr){if(ga)pn(ga);else if(Pr)hn&&En!==1&&hn(1),Qr(new Uint8Array(Pr));else if(hn&&dn!==En)return En=dn,hn(dn)})})},syncScrypt:function(Hr,Br,Wr,Gr,Kr,Yr){return new Uint8Array(qr(Hr,Br,Wr,Gr,Kr,Yr))}};Bt.exports=Fr})()})(scrypt$1);var scryptExports=scrypt$1.exports;const scrypt=getDefaultExportFromCjs(scryptExports);var __awaiter$t=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$m=new Logger(version$b);function hasMnemonic$1(Bt){return Bt!=null&&Bt.mnemonic&&Bt.mnemonic.phrase}class KeystoreAccount extends Description{isKeystoreAccount(Wt){return!!(Wt&&Wt._isKeystoreAccount)}}function _decrypt(Bt,Wt,Gt){if(searchPath(Bt,"crypto/cipher")==="aes-128-ctr"){const Xt=looseArrayify(searchPath(Bt,"crypto/cipherparams/iv")),Jt=new aes.Counter(Xt),Zt=new aes.ModeOfOperation.ctr(Wt,Jt);return arrayify(Zt.decrypt(Gt))}return null}function _getAccount(Bt,Wt){const Gt=looseArrayify(searchPath(Bt,"crypto/ciphertext"));if(hexlify(keccak256$1(concat$2([Wt.slice(16,32),Gt]))).substring(2)!==searchPath(Bt,"crypto/mac").toLowerCase())throw new Error("invalid password");const Xt=_decrypt(Bt,Wt.slice(0,16),Gt);Xt||logger$m.throwError("unsupported cipher",Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const Jt=Wt.slice(32,64),Zt=computeAddress$1(Xt);if(Bt.address){let ur=Bt.address.toLowerCase();if(ur.substring(0,2)!=="0x"&&(ur="0x"+ur),getAddress(ur)!==Zt)throw new Error("address mismatch")}const Qt={_isKeystoreAccount:!0,address:Zt,privateKey:hexlify(Xt)};if(searchPath(Bt,"x-ethers/version")==="0.1"){const ur=looseArrayify(searchPath(Bt,"x-ethers/mnemonicCiphertext")),cr=looseArrayify(searchPath(Bt,"x-ethers/mnemonicCounter")),$r=new aes.Counter(cr),Ar=new aes.ModeOfOperation.ctr(Jt,$r),Lr=searchPath(Bt,"x-ethers/path")||defaultPath,qr=searchPath(Bt,"x-ethers/locale")||"en",Fr=arrayify(Ar.decrypt(ur));try{const Hr=entropyToMnemonic(Fr,qr),Br=HDNode.fromMnemonic(Hr,null,qr).derivePath(Lr);if(Br.privateKey!=Qt.privateKey)throw new Error("mnemonic mismatch");Qt.mnemonic=Br.mnemonic}catch(Hr){if(Hr.code!==Logger.errors.INVALID_ARGUMENT||Hr.argument!=="wordlist")throw Hr}}return new KeystoreAccount(Qt)}function pbkdf2Sync(Bt,Wt,Gt,Yt,Xt){return arrayify(pbkdf2$1(Bt,Wt,Gt,Yt,Xt))}function pbkdf2(Bt,Wt,Gt,Yt,Xt){return Promise.resolve(pbkdf2Sync(Bt,Wt,Gt,Yt,Xt))}function _computeKdfKey(Bt,Wt,Gt,Yt,Xt){const Jt=getPassword(Wt),Zt=searchPath(Bt,"crypto/kdf");if(Zt&&typeof Zt=="string"){const Qt=function(ur,cr){return logger$m.throwArgumentError("invalid key-derivation function parameters",ur,cr)};if(Zt.toLowerCase()==="scrypt"){const ur=looseArrayify(searchPath(Bt,"crypto/kdfparams/salt")),cr=parseInt(searchPath(Bt,"crypto/kdfparams/n")),$r=parseInt(searchPath(Bt,"crypto/kdfparams/r")),Ar=parseInt(searchPath(Bt,"crypto/kdfparams/p"));(!cr||!$r||!Ar)&&Qt("kdf",Zt),cr&cr-1&&Qt("N",cr);const Lr=parseInt(searchPath(Bt,"crypto/kdfparams/dklen"));return Lr!==32&&Qt("dklen",Lr),Yt(Jt,ur,cr,$r,Ar,64,Xt)}else if(Zt.toLowerCase()==="pbkdf2"){const ur=looseArrayify(searchPath(Bt,"crypto/kdfparams/salt"));let cr=null;const $r=searchPath(Bt,"crypto/kdfparams/prf");$r==="hmac-sha256"?cr="sha256":$r==="hmac-sha512"?cr="sha512":Qt("prf",$r);const Ar=parseInt(searchPath(Bt,"crypto/kdfparams/c")),Lr=parseInt(searchPath(Bt,"crypto/kdfparams/dklen"));return Lr!==32&&Qt("dklen",Lr),Gt(Jt,ur,Ar,Lr,cr)}}return logger$m.throwArgumentError("unsupported key-derivation function","kdf",Zt)}function decryptSync(Bt,Wt){const Gt=JSON.parse(Bt),Yt=_computeKdfKey(Gt,Wt,pbkdf2Sync,scrypt.syncScrypt);return _getAccount(Gt,Yt)}function decrypt(Bt,Wt,Gt){return __awaiter$t(this,void 0,void 0,function*(){const Yt=JSON.parse(Bt),Xt=yield _computeKdfKey(Yt,Wt,pbkdf2,scrypt.scrypt,Gt);return _getAccount(Yt,Xt)})}function encrypt(Bt,Wt,Gt,Yt){try{if(getAddress(Bt.address)!==computeAddress$1(Bt.privateKey))throw new Error("address/privateKey mismatch");if(hasMnemonic$1(Bt)){const Br=Bt.mnemonic;if(HDNode.fromMnemonic(Br.phrase,null,Br.locale).derivePath(Br.path||defaultPath).privateKey!=Bt.privateKey)throw new Error("mnemonic mismatch")}}catch(Br){return Promise.reject(Br)}typeof Gt=="function"&&!Yt&&(Yt=Gt,Gt={}),Gt||(Gt={});const Xt=arrayify(Bt.privateKey),Jt=getPassword(Wt);let Zt=null,Qt=null,ur=null;if(hasMnemonic$1(Bt)){const Br=Bt.mnemonic;Zt=arrayify(mnemonicToEntropy(Br.phrase,Br.locale||"en")),Qt=Br.path||defaultPath,ur=Br.locale||"en"}let cr=Gt.client;cr||(cr="ethers.js");let $r=null;Gt.salt?$r=arrayify(Gt.salt):$r=randomBytes(32);let Ar=null;if(Gt.iv){if(Ar=arrayify(Gt.iv),Ar.length!==16)throw new Error("invalid iv")}else Ar=randomBytes(16);let Lr=null;if(Gt.uuid){if(Lr=arrayify(Gt.uuid),Lr.length!==16)throw new Error("invalid uuid")}else Lr=randomBytes(16);let qr=1<<17,Fr=8,Hr=1;return Gt.scrypt&&(Gt.scrypt.N&&(qr=Gt.scrypt.N),Gt.scrypt.r&&(Fr=Gt.scrypt.r),Gt.scrypt.p&&(Hr=Gt.scrypt.p)),scrypt.scrypt(Jt,$r,qr,Fr,Hr,64,Yt).then(Br=>{Br=arrayify(Br);const Wr=Br.slice(0,16),Gr=Br.slice(16,32),Kr=Br.slice(32,64),Yr=new aes.Counter(Ar),hn=new aes.ModeOfOperation.ctr(Wr,Yr),Qr=arrayify(hn.encrypt(Xt)),pn=keccak256$1(concat$2([Gr,Qr])),En={address:Bt.address.substring(2).toLowerCase(),id:uuidV4(Lr),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(Ar).substring(2)},ciphertext:hexlify(Qr).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify($r).substring(2),n:qr,dklen:32,p:Hr,r:Fr},mac:pn.substring(2)}};if(Zt){const ga=randomBytes(16),dn=new aes.Counter(ga),Pr=new aes.ModeOfOperation.ctr(Kr,dn),xr=arrayify(Pr.encrypt(Zt)),Mr=new Date,Nr=Mr.getUTCFullYear()+"-"+zpad(Mr.getUTCMonth()+1,2)+"-"+zpad(Mr.getUTCDate(),2)+"T"+zpad(Mr.getUTCHours(),2)+"-"+zpad(Mr.getUTCMinutes(),2)+"-"+zpad(Mr.getUTCSeconds(),2)+".0Z";En["x-ethers"]={client:cr,gethFilename:"UTC--"+Nr+"--"+En.address,mnemonicCounter:hexlify(ga).substring(2),mnemonicCiphertext:hexlify(xr).substring(2),path:Qt,locale:ur,version:"0.1"}}return JSON.stringify(En)})}function decryptJsonWallet(Bt,Wt,Gt){if(isCrowdsaleWallet(Bt)){Gt&&Gt(0);const Yt=decrypt$1(Bt,Wt);return Gt&&Gt(1),Promise.resolve(Yt)}return isKeystoreWallet(Bt)?decrypt(Bt,Wt,Gt):Promise.reject(new Error("invalid JSON wallet"))}function decryptJsonWalletSync(Bt,Wt){if(isCrowdsaleWallet(Bt))return decrypt$1(Bt,Wt);if(isKeystoreWallet(Bt))return decryptSync(Bt,Wt);throw new Error("invalid JSON wallet")}const version$a="wallet/5.7.0";var __awaiter$s=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$l=new Logger(version$a);function isAccount(Bt){return Bt!=null&&isHexString(Bt.privateKey,32)&&Bt.address!=null}function hasMnemonic(Bt){const Wt=Bt.mnemonic;return Wt&&Wt.phrase}let Wallet$1=class Mv extends Signer$1{constructor(Wt,Gt){if(super(),isAccount(Wt)){const Yt=new SigningKey(Wt.privateKey);if(defineReadOnly(this,"_signingKey",()=>Yt),defineReadOnly(this,"address",computeAddress$1(this.publicKey)),this.address!==getAddress(Wt.address)&&logger$l.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),hasMnemonic(Wt)){const Xt=Wt.mnemonic;defineReadOnly(this,"_mnemonic",()=>({phrase:Xt.phrase,path:Xt.path||defaultPath,locale:Xt.locale||"en"}));const Jt=this.mnemonic,Zt=HDNode.fromMnemonic(Jt.phrase,null,Jt.locale).derivePath(Jt.path);computeAddress$1(Zt.privateKey)!==this.address&&logger$l.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else defineReadOnly(this,"_mnemonic",()=>null)}else{if(SigningKey.isSigningKey(Wt))Wt.curve!=="secp256k1"&&logger$l.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),defineReadOnly(this,"_signingKey",()=>Wt);else{typeof Wt=="string"&&Wt.match(/^[0-9a-f]*$/i)&&Wt.length===64&&(Wt="0x"+Wt);const Yt=new SigningKey(Wt);defineReadOnly(this,"_signingKey",()=>Yt)}defineReadOnly(this,"_mnemonic",()=>null),defineReadOnly(this,"address",computeAddress$1(this.publicKey))}Gt&&!Provider.isProvider(Gt)&&logger$l.throwArgumentError("invalid provider","provider",Gt),defineReadOnly(this,"provider",Gt||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(Wt){return new Mv(this,Wt)}signTransaction(Wt){return resolveProperties(Wt).then(Gt=>{Gt.from!=null&&(getAddress(Gt.from)!==this.address&&logger$l.throwArgumentError("transaction from address mismatch","transaction.from",Wt.from),delete Gt.from);const Yt=this._signingKey().signDigest(keccak256$1(serialize$2(Gt)));return serialize$2(Gt,Yt)})}signMessage(Wt){return __awaiter$s(this,void 0,void 0,function*(){return joinSignature(this._signingKey().signDigest(hashMessage(Wt)))})}_signTypedData(Wt,Gt,Yt){return __awaiter$s(this,void 0,void 0,function*(){const Xt=yield TypedDataEncoder.resolveNames(Wt,Gt,Yt,Jt=>(this.provider==null&&logger$l.throwError("cannot resolve ENS names without a provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:Jt}),this.provider.resolveName(Jt)));return joinSignature(this._signingKey().signDigest(TypedDataEncoder.hash(Xt.domain,Gt,Xt.value)))})}encrypt(Wt,Gt,Yt){if(typeof Gt=="function"&&!Yt&&(Yt=Gt,Gt={}),Yt&&typeof Yt!="function")throw new Error("invalid callback");return Gt||(Gt={}),encrypt(this,Wt,Gt,Yt)}static createRandom(Wt){let Gt=randomBytes(16);Wt||(Wt={}),Wt.extraEntropy&&(Gt=arrayify(hexDataSlice(keccak256$1(concat$2([Gt,Wt.extraEntropy])),0,16)));const Yt=entropyToMnemonic(Gt,Wt.locale);return Mv.fromMnemonic(Yt,Wt.path,Wt.locale)}static fromEncryptedJson(Wt,Gt,Yt){return decryptJsonWallet(Wt,Gt,Yt).then(Xt=>new Mv(Xt))}static fromEncryptedJsonSync(Wt,Gt){return new Mv(decryptJsonWalletSync(Wt,Gt))}static fromMnemonic(Wt,Gt,Yt){return Gt||(Gt=defaultPath),new Mv(HDNode.fromMnemonic(Wt,null,Yt).derivePath(Gt))}};function verifyMessage(Bt,Wt){return recoverAddress(hashMessage(Bt),Wt)}function verifyTypedData(Bt,Wt,Gt,Yt){return recoverAddress(TypedDataEncoder.hash(Bt,Wt,Gt),Yt)}const version$9="networks/5.7.1",logger$k=new Logger(version$9);function isRenetworkable(Bt){return Bt&&typeof Bt.renetwork=="function"}function ethDefaultProvider(Bt){const Wt=function(Gt,Yt){Yt==null&&(Yt={});const Xt=[];if(Gt.InfuraProvider&&Yt.infura!=="-")try{Xt.push(new Gt.InfuraProvider(Bt,Yt.infura))}catch{}if(Gt.EtherscanProvider&&Yt.etherscan!=="-")try{Xt.push(new Gt.EtherscanProvider(Bt,Yt.etherscan))}catch{}if(Gt.AlchemyProvider&&Yt.alchemy!=="-")try{Xt.push(new Gt.AlchemyProvider(Bt,Yt.alchemy))}catch{}if(Gt.PocketProvider&&Yt.pocket!=="-"){const Jt=["goerli","ropsten","rinkeby","sepolia"];try{const Zt=new Gt.PocketProvider(Bt,Yt.pocket);Zt.network&&Jt.indexOf(Zt.network.name)===-1&&Xt.push(Zt)}catch{}}if(Gt.CloudflareProvider&&Yt.cloudflare!=="-")try{Xt.push(new Gt.CloudflareProvider(Bt))}catch{}if(Gt.AnkrProvider&&Yt.ankr!=="-")try{const Jt=["ropsten"],Zt=new Gt.AnkrProvider(Bt,Yt.ankr);Zt.network&&Jt.indexOf(Zt.network.name)===-1&&Xt.push(Zt)}catch{}if(Xt.length===0)return null;if(Gt.FallbackProvider){let Jt=1;return Yt.quorum!=null?Jt=Yt.quorum:Bt==="homestead"&&(Jt=2),new Gt.FallbackProvider(Xt,Jt)}return Xt[0]};return Wt.renetwork=function(Gt){return ethDefaultProvider(Gt)},Wt}function etcDefaultProvider(Bt,Wt){const Gt=function(Yt,Xt){return Yt.JsonRpcProvider?new Yt.JsonRpcProvider(Bt,Wt):null};return Gt.renetwork=function(Yt){return etcDefaultProvider(Bt,Yt)},Gt}const homestead={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},ropsten={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},classicMordor={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},networks={unspecified:{chainId:0,name:"unspecified"},homestead,mainnet:homestead,morden:{chainId:2,name:"morden"},ropsten,testnet:ropsten,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ethDefaultProvider("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor,classicTestnet:classicMordor,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function getNetwork(Bt){if(Bt==null)return null;if(typeof Bt=="number"){for(const Yt in networks){const Xt=networks[Yt];if(Xt.chainId===Bt)return{name:Xt.name,chainId:Xt.chainId,ensAddress:Xt.ensAddress||null,_defaultProvider:Xt._defaultProvider||null}}return{chainId:Bt,name:"unknown"}}if(typeof Bt=="string"){const Yt=networks[Bt];return Yt==null?null:{name:Yt.name,chainId:Yt.chainId,ensAddress:Yt.ensAddress,_defaultProvider:Yt._defaultProvider||null}}const Wt=networks[Bt.name];if(!Wt)return typeof Bt.chainId!="number"&&logger$k.throwArgumentError("invalid network chainId","network",Bt),Bt;Bt.chainId!==0&&Bt.chainId!==Wt.chainId&&logger$k.throwArgumentError("network chainId mismatch","network",Bt);let Gt=Bt._defaultProvider||null;return Gt==null&&Wt._defaultProvider&&(isRenetworkable(Wt._defaultProvider)?Gt=Wt._defaultProvider.renetwork(Bt):Gt=Wt._defaultProvider),{name:Bt.name,chainId:Wt.chainId,ensAddress:Bt.ensAddress||Wt.ensAddress||null,_defaultProvider:Gt}}const version$8="web/5.7.1";var __awaiter$r=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};function getUrl(Bt,Wt){return __awaiter$r(this,void 0,void 0,function*(){Wt==null&&(Wt={});const Gt={method:Wt.method||"GET",headers:Wt.headers||{},body:Wt.body||void 0};if(Wt.skipFetchSetup!==!0&&(Gt.mode="cors",Gt.cache="no-cache",Gt.credentials="same-origin",Gt.redirect="follow",Gt.referrer="client"),Wt.fetchOptions!=null){const Zt=Wt.fetchOptions;Zt.mode&&(Gt.mode=Zt.mode),Zt.cache&&(Gt.cache=Zt.cache),Zt.credentials&&(Gt.credentials=Zt.credentials),Zt.redirect&&(Gt.redirect=Zt.redirect),Zt.referrer&&(Gt.referrer=Zt.referrer)}const Yt=yield fetch(Bt,Gt),Xt=yield Yt.arrayBuffer(),Jt={};return Yt.headers.forEach?Yt.headers.forEach((Zt,Qt)=>{Jt[Qt.toLowerCase()]=Zt}):Yt.headers.keys().forEach(Zt=>{Jt[Zt.toLowerCase()]=Yt.headers.get(Zt)}),{headers:Jt,statusCode:Yt.status,statusMessage:Yt.statusText,body:arrayify(new Uint8Array(Xt))}})}var __awaiter$q=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$j=new Logger(version$8);function staller(Bt){return new Promise(Wt=>{setTimeout(Wt,Bt)})}function bodyify(Bt,Wt){if(Bt==null)return null;if(typeof Bt=="string")return Bt;if(isBytesLike(Bt)){if(Wt&&(Wt.split("/")[0]==="text"||Wt.split(";")[0].trim()==="application/json"))try{return toUtf8String(Bt)}catch{}return hexlify(Bt)}return Bt}function unpercent(Bt){return toUtf8Bytes(Bt.replace(/%([0-9a-f][0-9a-f])/gi,(Wt,Gt)=>String.fromCharCode(parseInt(Gt,16))))}function _fetchData(Bt,Wt,Gt){const Yt=typeof Bt=="object"&&Bt.throttleLimit!=null?Bt.throttleLimit:12;logger$j.assertArgument(Yt>0&&Yt%1===0,"invalid connection throttle limit","connection.throttleLimit",Yt);const Xt=typeof Bt=="object"?Bt.throttleCallback:null,Jt=typeof Bt=="object"&&typeof Bt.throttleSlotInterval=="number"?Bt.throttleSlotInterval:100;logger$j.assertArgument(Jt>0&&Jt%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",Jt);const Zt=typeof Bt=="object"?!!Bt.errorPassThrough:!1,Qt={};let ur=null;const cr={method:"GET"};let $r=!1,Ar=2*60*1e3;if(typeof Bt=="string")ur=Bt;else if(typeof Bt=="object"){if((Bt==null||Bt.url==null)&&logger$j.throwArgumentError("missing URL","connection.url",Bt),ur=Bt.url,typeof Bt.timeout=="number"&&Bt.timeout>0&&(Ar=Bt.timeout),Bt.headers)for(const Wr in Bt.headers)Qt[Wr.toLowerCase()]={key:Wr,value:String(Bt.headers[Wr])},["if-none-match","if-modified-since"].indexOf(Wr.toLowerCase())>=0&&($r=!0);if(cr.allowGzip=!!Bt.allowGzip,Bt.user!=null&&Bt.password!=null){ur.substring(0,6)!=="https:"&&Bt.allowInsecureAuthentication!==!0&&logger$j.throwError("basic authentication requires a secure https url",Logger.errors.INVALID_ARGUMENT,{argument:"url",url:ur,user:Bt.user,password:"[REDACTED]"});const Wr=Bt.user+":"+Bt.password;Qt.authorization={key:"Authorization",value:"Basic "+encode$5(toUtf8Bytes(Wr))}}Bt.skipFetchSetup!=null&&(cr.skipFetchSetup=!!Bt.skipFetchSetup),Bt.fetchOptions!=null&&(cr.fetchOptions=shallowCopy(Bt.fetchOptions))}const Lr=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),qr=ur?ur.match(Lr):null;if(qr)try{const Wr={statusCode:200,statusMessage:"OK",headers:{"content-type":qr[1]||"text/plain"},body:qr[2]?decode$5(qr[3]):unpercent(qr[3])};let Gr=Wr.body;return Gt&&(Gr=Gt(Wr.body,Wr)),Promise.resolve(Gr)}catch(Wr){logger$j.throwError("processing response error",Logger.errors.SERVER_ERROR,{body:bodyify(qr[1],qr[2]),error:Wr,requestBody:null,requestMethod:"GET",url:ur})}Wt&&(cr.method="POST",cr.body=Wt,Qt["content-type"]==null&&(Qt["content-type"]={key:"Content-Type",value:"application/octet-stream"}),Qt["content-length"]==null&&(Qt["content-length"]={key:"Content-Length",value:String(Wt.length)}));const Fr={};Object.keys(Qt).forEach(Wr=>{const Gr=Qt[Wr];Fr[Gr.key]=Gr.value}),cr.headers=Fr;const Hr=function(){let Wr=null;return{promise:new Promise(function(Yr,hn){Ar&&(Wr=setTimeout(()=>{Wr!=null&&(Wr=null,hn(logger$j.makeError("timeout",Logger.errors.TIMEOUT,{requestBody:bodyify(cr.body,Fr["content-type"]),requestMethod:cr.method,timeout:Ar,url:ur})))},Ar))}),cancel:function(){Wr!=null&&(clearTimeout(Wr),Wr=null)}}}(),Br=function(){return __awaiter$q(this,void 0,void 0,function*(){for(let Wr=0;Wr<Yt;Wr++){let Gr=null;try{if(Gr=yield getUrl(ur,cr),Wr<Yt){if(Gr.statusCode===301||Gr.statusCode===302){const Yr=Gr.headers.location||"";if(cr.method==="GET"&&Yr.match(/^https:/)){ur=Gr.headers.location;continue}}else if(Gr.statusCode===429){let Yr=!0;if(Xt&&(Yr=yield Xt(Wr,ur)),Yr){let hn=0;const Qr=Gr.headers["retry-after"];typeof Qr=="string"&&Qr.match(/^[1-9][0-9]*$/)?hn=parseInt(Qr)*1e3:hn=Jt*parseInt(String(Math.random()*Math.pow(2,Wr))),yield staller(hn);continue}}}}catch(Yr){Gr=Yr.response,Gr==null&&(Hr.cancel(),logger$j.throwError("missing response",Logger.errors.SERVER_ERROR,{requestBody:bodyify(cr.body,Fr["content-type"]),requestMethod:cr.method,serverError:Yr,url:ur}))}let Kr=Gr.body;if($r&&Gr.statusCode===304?Kr=null:!Zt&&(Gr.statusCode<200||Gr.statusCode>=300)&&(Hr.cancel(),logger$j.throwError("bad response",Logger.errors.SERVER_ERROR,{status:Gr.statusCode,headers:Gr.headers,body:bodyify(Kr,Gr.headers?Gr.headers["content-type"]:null),requestBody:bodyify(cr.body,Fr["content-type"]),requestMethod:cr.method,url:ur})),Gt)try{const Yr=yield Gt(Kr,Gr);return Hr.cancel(),Yr}catch(Yr){if(Yr.throttleRetry&&Wr<Yt){let hn=!0;if(Xt&&(hn=yield Xt(Wr,ur)),hn){const Qr=Jt*parseInt(String(Math.random()*Math.pow(2,Wr)));yield staller(Qr);continue}}Hr.cancel(),logger$j.throwError("processing response error",Logger.errors.SERVER_ERROR,{body:bodyify(Kr,Gr.headers?Gr.headers["content-type"]:null),error:Yr,requestBody:bodyify(cr.body,Fr["content-type"]),requestMethod:cr.method,url:ur})}return Hr.cancel(),Kr}return logger$j.throwError("failed response",Logger.errors.SERVER_ERROR,{requestBody:bodyify(cr.body,Fr["content-type"]),requestMethod:cr.method,url:ur})})}();return Promise.race([Hr.promise,Br])}function fetchJson(Bt,Wt,Gt){let Yt=(Jt,Zt)=>{let Qt=null;if(Jt!=null)try{Qt=JSON.parse(toUtf8String(Jt))}catch(ur){logger$j.throwError("invalid JSON",Logger.errors.SERVER_ERROR,{body:Jt,error:ur})}return Gt&&(Qt=Gt(Qt,Zt)),Qt},Xt=null;if(Wt!=null){Xt=toUtf8Bytes(Wt);const Jt=typeof Bt=="string"?{url:Bt}:shallowCopy(Bt);Jt.headers?Object.keys(Jt.headers).filter(Qt=>Qt.toLowerCase()==="content-type").length!==0||(Jt.headers=shallowCopy(Jt.headers),Jt.headers["content-type"]="application/json"):Jt.headers={"content-type":"application/json"},Bt=Jt}return _fetchData(Bt,Xt,Yt)}function poll(Bt,Wt){return Wt||(Wt={}),Wt=shallowCopy(Wt),Wt.floor==null&&(Wt.floor=0),Wt.ceiling==null&&(Wt.ceiling=1e4),Wt.interval==null&&(Wt.interval=250),new Promise(function(Gt,Yt){let Xt=null,Jt=!1;const Zt=()=>Jt?!1:(Jt=!0,Xt&&clearTimeout(Xt),!0);Wt.timeout&&(Xt=setTimeout(()=>{Zt()&&Yt(new Error("timeout"))},Wt.timeout));const Qt=Wt.retryLimit;let ur=0;function cr(){return Bt().then(function($r){if($r!==void 0)Zt()&&Gt($r);else if(Wt.oncePoll)Wt.oncePoll.once("poll",cr);else if(Wt.onceBlock)Wt.onceBlock.once("block",cr);else if(!Jt){if(ur++,ur>Qt){Zt()&&Yt(new Error("retry limit reached"));return}let Ar=Wt.interval*parseInt(String(Math.random()*Math.pow(2,ur)));Ar<Wt.floor&&(Ar=Wt.floor),Ar>Wt.ceiling&&(Ar=Wt.ceiling),setTimeout(cr,Ar)}return null},function($r){Zt()&&Yt($r)})}cr()})}var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(var z$1=0;z$1<ALPHABET.length;z$1++){var x$2=ALPHABET.charAt(z$1);if(ALPHABET_MAP[x$2]!==void 0)throw new TypeError(x$2+" is ambiguous");ALPHABET_MAP[x$2]=z$1}function polymodStep(Bt){var Wt=Bt>>25;return(Bt&33554431)<<5^-(Wt>>0&1)&996825010^-(Wt>>1&1)&642813549^-(Wt>>2&1)&513874426^-(Wt>>3&1)&1027748829^-(Wt>>4&1)&705979059}function prefixChk(Bt){for(var Wt=1,Gt=0;Gt<Bt.length;++Gt){var Yt=Bt.charCodeAt(Gt);if(Yt<33||Yt>126)return"Invalid prefix ("+Bt+")";Wt=polymodStep(Wt)^Yt>>5}for(Wt=polymodStep(Wt),Gt=0;Gt<Bt.length;++Gt){var Xt=Bt.charCodeAt(Gt);Wt=polymodStep(Wt)^Xt&31}return Wt}function encode$4(Bt,Wt,Gt){if(Gt=Gt||90,Bt.length+7+Wt.length>Gt)throw new TypeError("Exceeds length limit");Bt=Bt.toLowerCase();var Yt=prefixChk(Bt);if(typeof Yt=="string")throw new Error(Yt);for(var Xt=Bt+"1",Jt=0;Jt<Wt.length;++Jt){var Zt=Wt[Jt];if(Zt>>5)throw new Error("Non 5-bit word");Yt=polymodStep(Yt)^Zt,Xt+=ALPHABET.charAt(Zt)}for(Jt=0;Jt<6;++Jt)Yt=polymodStep(Yt);for(Yt^=1,Jt=0;Jt<6;++Jt){var Qt=Yt>>(5-Jt)*5&31;Xt+=ALPHABET.charAt(Qt)}return Xt}function __decode(Bt,Wt){if(Wt=Wt||90,Bt.length<8)return Bt+" too short";if(Bt.length>Wt)return"Exceeds length limit";var Gt=Bt.toLowerCase(),Yt=Bt.toUpperCase();if(Bt!==Gt&&Bt!==Yt)return"Mixed-case string "+Bt;Bt=Gt;var Xt=Bt.lastIndexOf("1");if(Xt===-1)return"No separator character for "+Bt;if(Xt===0)return"Missing prefix for "+Bt;var Jt=Bt.slice(0,Xt),Zt=Bt.slice(Xt+1);if(Zt.length<6)return"Data too short";var Qt=prefixChk(Jt);if(typeof Qt=="string")return Qt;for(var ur=[],cr=0;cr<Zt.length;++cr){var $r=Zt.charAt(cr),Ar=ALPHABET_MAP[$r];if(Ar===void 0)return"Unknown character "+$r;Qt=polymodStep(Qt)^Ar,!(cr+6>=Zt.length)&&ur.push(Ar)}return Qt!==1?"Invalid checksum for "+Bt:{prefix:Jt,words:ur}}function decodeUnsafe(){var Bt=__decode.apply(null,arguments);if(typeof Bt=="object")return Bt}function decode$4(Bt){var Wt=__decode.apply(null,arguments);if(typeof Wt=="object")return Wt;throw new Error(Wt)}function convert$4(Bt,Wt,Gt,Yt){for(var Xt=0,Jt=0,Zt=(1<<Gt)-1,Qt=[],ur=0;ur<Bt.length;++ur)for(Xt=Xt<<Wt|Bt[ur],Jt+=Wt;Jt>=Gt;)Jt-=Gt,Qt.push(Xt>>Jt&Zt);if(Yt)Jt>0&&Qt.push(Xt<<Gt-Jt&Zt);else{if(Jt>=Wt)return"Excess padding";if(Xt<<Gt-Jt&Zt)return"Non-zero padding"}return Qt}function toWordsUnsafe(Bt){var Wt=convert$4(Bt,8,5,!0);if(Array.isArray(Wt))return Wt}function toWords(Bt){var Wt=convert$4(Bt,8,5,!0);if(Array.isArray(Wt))return Wt;throw new Error(Wt)}function fromWordsUnsafe(Bt){var Wt=convert$4(Bt,5,8,!1);if(Array.isArray(Wt))return Wt}function fromWords(Bt){var Wt=convert$4(Bt,5,8,!1);if(Array.isArray(Wt))return Wt;throw new Error(Wt)}var bech32={decodeUnsafe,decode:decode$4,encode:encode$4,toWordsUnsafe,toWords,fromWordsUnsafe,fromWords};const bech32$1=getDefaultExportFromCjs(bech32),version$7="providers/5.7.2",logger$i=new Logger(version$7);class Formatter{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const Wt={},Gt=this.address.bind(this),Yt=this.bigNumber.bind(this),Xt=this.blockTag.bind(this),Jt=this.data.bind(this),Zt=this.hash.bind(this),Qt=this.hex.bind(this),ur=this.number.bind(this),cr=this.type.bind(this),$r=Ar=>this.data(Ar,!0);return Wt.transaction={hash:Zt,type:cr,accessList:Formatter.allowNull(this.accessList.bind(this),null),blockHash:Formatter.allowNull(Zt,null),blockNumber:Formatter.allowNull(ur,null),transactionIndex:Formatter.allowNull(ur,null),confirmations:Formatter.allowNull(ur,null),from:Gt,gasPrice:Formatter.allowNull(Yt),maxPriorityFeePerGas:Formatter.allowNull(Yt),maxFeePerGas:Formatter.allowNull(Yt),gasLimit:Yt,to:Formatter.allowNull(Gt,null),value:Yt,nonce:ur,data:Jt,r:Formatter.allowNull(this.uint256),s:Formatter.allowNull(this.uint256),v:Formatter.allowNull(ur),creates:Formatter.allowNull(Gt,null),raw:Formatter.allowNull(Jt)},Wt.transactionRequest={from:Formatter.allowNull(Gt),nonce:Formatter.allowNull(ur),gasLimit:Formatter.allowNull(Yt),gasPrice:Formatter.allowNull(Yt),maxPriorityFeePerGas:Formatter.allowNull(Yt),maxFeePerGas:Formatter.allowNull(Yt),to:Formatter.allowNull(Gt),value:Formatter.allowNull(Yt),data:Formatter.allowNull($r),type:Formatter.allowNull(ur),accessList:Formatter.allowNull(this.accessList.bind(this),null)},Wt.receiptLog={transactionIndex:ur,blockNumber:ur,transactionHash:Zt,address:Gt,topics:Formatter.arrayOf(Zt),data:Jt,logIndex:ur,blockHash:Zt},Wt.receipt={to:Formatter.allowNull(this.address,null),from:Formatter.allowNull(this.address,null),contractAddress:Formatter.allowNull(Gt,null),transactionIndex:ur,root:Formatter.allowNull(Qt),gasUsed:Yt,logsBloom:Formatter.allowNull(Jt),blockHash:Zt,transactionHash:Zt,logs:Formatter.arrayOf(this.receiptLog.bind(this)),blockNumber:ur,confirmations:Formatter.allowNull(ur,null),cumulativeGasUsed:Yt,effectiveGasPrice:Formatter.allowNull(Yt),status:Formatter.allowNull(ur),type:cr},Wt.block={hash:Formatter.allowNull(Zt),parentHash:Zt,number:ur,timestamp:ur,nonce:Formatter.allowNull(Qt),difficulty:this.difficulty.bind(this),gasLimit:Yt,gasUsed:Yt,miner:Formatter.allowNull(Gt),extraData:Jt,transactions:Formatter.allowNull(Formatter.arrayOf(Zt)),baseFeePerGas:Formatter.allowNull(Yt)},Wt.blockWithTransactions=shallowCopy(Wt.block),Wt.blockWithTransactions.transactions=Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this))),Wt.filter={fromBlock:Formatter.allowNull(Xt,void 0),toBlock:Formatter.allowNull(Xt,void 0),blockHash:Formatter.allowNull(Zt,void 0),address:Formatter.allowNull(Gt,void 0),topics:Formatter.allowNull(this.topics.bind(this),void 0)},Wt.filterLog={blockNumber:Formatter.allowNull(ur),blockHash:Formatter.allowNull(Zt),transactionIndex:ur,removed:Formatter.allowNull(this.boolean.bind(this)),address:Gt,data:Formatter.allowFalsish(Jt,"0x"),topics:Formatter.arrayOf(Zt),transactionHash:Zt,logIndex:ur},Wt}accessList(Wt){return accessListify(Wt||[])}number(Wt){return Wt==="0x"?0:BigNumber.from(Wt).toNumber()}type(Wt){return Wt==="0x"||Wt==null?0:BigNumber.from(Wt).toNumber()}bigNumber(Wt){return BigNumber.from(Wt)}boolean(Wt){if(typeof Wt=="boolean")return Wt;if(typeof Wt=="string"){if(Wt=Wt.toLowerCase(),Wt==="true")return!0;if(Wt==="false")return!1}throw new Error("invalid boolean - "+Wt)}hex(Wt,Gt){return typeof Wt=="string"&&(!Gt&&Wt.substring(0,2)!=="0x"&&(Wt="0x"+Wt),isHexString(Wt))?Wt.toLowerCase():logger$i.throwArgumentError("invalid hash","value",Wt)}data(Wt,Gt){const Yt=this.hex(Wt,Gt);if(Yt.length%2!==0)throw new Error("invalid data; odd-length - "+Wt);return Yt}address(Wt){return getAddress(Wt)}callAddress(Wt){if(!isHexString(Wt,32))return null;const Gt=getAddress(hexDataSlice(Wt,12));return Gt===AddressZero?null:Gt}contractAddress(Wt){return getContractAddress(Wt)}blockTag(Wt){if(Wt==null)return"latest";if(Wt==="earliest")return"0x0";switch(Wt){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return Wt}if(typeof Wt=="number"||isHexString(Wt))return hexValue(Wt);throw new Error("invalid blockTag")}hash(Wt,Gt){const Yt=this.hex(Wt,Gt);return hexDataLength(Yt)!==32?logger$i.throwArgumentError("invalid hash","value",Wt):Yt}difficulty(Wt){if(Wt==null)return null;const Gt=BigNumber.from(Wt);try{return Gt.toNumber()}catch{}return null}uint256(Wt){if(!isHexString(Wt))throw new Error("invalid uint256");return hexZeroPad(Wt,32)}_block(Wt,Gt){Wt.author!=null&&Wt.miner==null&&(Wt.miner=Wt.author);const Yt=Wt._difficulty!=null?Wt._difficulty:Wt.difficulty,Xt=Formatter.check(Gt,Wt);return Xt._difficulty=Yt==null?null:BigNumber.from(Yt),Xt}block(Wt){return this._block(Wt,this.formats.block)}blockWithTransactions(Wt){return this._block(Wt,this.formats.blockWithTransactions)}transactionRequest(Wt){return Formatter.check(this.formats.transactionRequest,Wt)}transactionResponse(Wt){Wt.gas!=null&&Wt.gasLimit==null&&(Wt.gasLimit=Wt.gas),Wt.to&&BigNumber.from(Wt.to).isZero()&&(Wt.to="0x0000000000000000000000000000000000000000"),Wt.input!=null&&Wt.data==null&&(Wt.data=Wt.input),Wt.to==null&&Wt.creates==null&&(Wt.creates=this.contractAddress(Wt)),(Wt.type===1||Wt.type===2)&&Wt.accessList==null&&(Wt.accessList=[]);const Gt=Formatter.check(this.formats.transaction,Wt);if(Wt.chainId!=null){let Yt=Wt.chainId;isHexString(Yt)&&(Yt=BigNumber.from(Yt).toNumber()),Gt.chainId=Yt}else{let Yt=Wt.networkId;Yt==null&&Gt.v==null&&(Yt=Wt.chainId),isHexString(Yt)&&(Yt=BigNumber.from(Yt).toNumber()),typeof Yt!="number"&&Gt.v!=null&&(Yt=(Gt.v-35)/2,Yt<0&&(Yt=0),Yt=parseInt(Yt)),typeof Yt!="number"&&(Yt=0),Gt.chainId=Yt}return Gt.blockHash&&Gt.blockHash.replace(/0/g,"")==="x"&&(Gt.blockHash=null),Gt}transaction(Wt){return parse$i(Wt)}receiptLog(Wt){return Formatter.check(this.formats.receiptLog,Wt)}receipt(Wt){const Gt=Formatter.check(this.formats.receipt,Wt);if(Gt.root!=null)if(Gt.root.length<=4){const Yt=BigNumber.from(Gt.root).toNumber();Yt===0||Yt===1?(Gt.status!=null&&Gt.status!==Yt&&logger$i.throwArgumentError("alt-root-status/status mismatch","value",{root:Gt.root,status:Gt.status}),Gt.status=Yt,delete Gt.root):logger$i.throwArgumentError("invalid alt-root-status","value.root",Gt.root)}else Gt.root.length!==66&&logger$i.throwArgumentError("invalid root hash","value.root",Gt.root);return Gt.status!=null&&(Gt.byzantium=!0),Gt}topics(Wt){return Array.isArray(Wt)?Wt.map(Gt=>this.topics(Gt)):Wt!=null?this.hash(Wt,!0):null}filter(Wt){return Formatter.check(this.formats.filter,Wt)}filterLog(Wt){return Formatter.check(this.formats.filterLog,Wt)}static check(Wt,Gt){const Yt={};for(const Xt in Wt)try{const Jt=Wt[Xt](Gt[Xt]);Jt!==void 0&&(Yt[Xt]=Jt)}catch(Jt){throw Jt.checkKey=Xt,Jt.checkValue=Gt[Xt],Jt}return Yt}static allowNull(Wt,Gt){return function(Yt){return Yt==null?Gt:Wt(Yt)}}static allowFalsish(Wt,Gt){return function(Yt){return Yt?Wt(Yt):Gt}}static arrayOf(Wt){return function(Gt){if(!Array.isArray(Gt))throw new Error("not an array");const Yt=[];return Gt.forEach(function(Xt){Yt.push(Wt(Xt))}),Yt}}}function isCommunityResourcable(Bt){return Bt&&typeof Bt.isCommunityResource=="function"}function isCommunityResource(Bt){return isCommunityResourcable(Bt)&&Bt.isCommunityResource()}let throttleMessage=!1;function showThrottleMessage(){throttleMessage||(throttleMessage=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var __awaiter$p=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$h=new Logger(version$7),MAX_CCIP_REDIRECTS=10;function checkTopic(Bt){return Bt==null?"null":(hexDataLength(Bt)!==32&&logger$h.throwArgumentError("invalid topic","topic",Bt),Bt.toLowerCase())}function serializeTopics(Bt){for(Bt=Bt.slice();Bt.length>0&&Bt[Bt.length-1]==null;)Bt.pop();return Bt.map(Wt=>{if(Array.isArray(Wt)){const Gt={};Wt.forEach(Xt=>{Gt[checkTopic(Xt)]=!0});const Yt=Object.keys(Gt);return Yt.sort(),Yt.join("|")}else return checkTopic(Wt)}).join("&")}function deserializeTopics(Bt){return Bt===""?[]:Bt.split(/&/g).map(Wt=>{if(Wt==="")return[];const Gt=Wt.split("|").map(Yt=>Yt==="null"?null:Yt);return Gt.length===1?Gt[0]:Gt})}function getEventTag(Bt){if(typeof Bt=="string"){if(Bt=Bt.toLowerCase(),hexDataLength(Bt)===32)return"tx:"+Bt;if(Bt.indexOf(":")===-1)return Bt}else{if(Array.isArray(Bt))return"filter:*:"+serializeTopics(Bt);if(ForkEvent.isForkEvent(Bt))throw logger$h.warn("not implemented"),new Error("not implemented");if(Bt&&typeof Bt=="object")return"filter:"+(Bt.address||"*")+":"+serializeTopics(Bt.topics||[])}throw new Error("invalid event - "+Bt)}function getTime(){return new Date().getTime()}function stall$1(Bt){return new Promise(Wt=>{setTimeout(Wt,Bt)})}const PollableEvents=["block","network","pending","poll"];class Event{constructor(Wt,Gt,Yt){defineReadOnly(this,"tag",Wt),defineReadOnly(this,"listener",Gt),defineReadOnly(this,"once",Yt),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const Wt=this.tag.split(":");return Wt[0]!=="tx"?null:Wt[1]}get filter(){const Wt=this.tag.split(":");if(Wt[0]!=="filter")return null;const Gt=Wt[1],Yt=deserializeTopics(Wt[2]),Xt={};return Yt.length>0&&(Xt.topics=Yt),Gt&&Gt!=="*"&&(Xt.address=Gt),Xt}pollable(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0}}const coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(Bt){return hexZeroPad(BigNumber.from(Bt).toHexString(),32)}function base58Encode(Bt){return Base58.encode(concat$2([Bt,hexDataSlice(sha256$2(sha256$2(Bt)),0,4)]))}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i"),matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(Bt,Wt){try{return toUtf8String(_parseBytes(Bt,Wt))}catch{}return null}function _parseBytes(Bt,Wt){if(Bt==="0x")return null;const Gt=BigNumber.from(hexDataSlice(Bt,Wt,Wt+32)).toNumber(),Yt=BigNumber.from(hexDataSlice(Bt,Gt,Gt+32)).toNumber();return hexDataSlice(Bt,Gt+32,Gt+32+Yt)}function getIpfsLink(Bt){return Bt.match(/^ipfs:\/\/ipfs\//i)?Bt=Bt.substring(12):Bt.match(/^ipfs:\/\//i)?Bt=Bt.substring(7):logger$h.throwArgumentError("unsupported IPFS format","link",Bt),`https://gateway.ipfs.io/ipfs/${Bt}`}function numPad(Bt){const Wt=arrayify(Bt);if(Wt.length>32)throw new Error("internal; should not happen");const Gt=new Uint8Array(32);return Gt.set(Wt,32-Wt.length),Gt}function bytesPad(Bt){if(Bt.length%32===0)return Bt;const Wt=new Uint8Array(Math.ceil(Bt.length/32)*32);return Wt.set(Bt),Wt}function encodeBytes(Bt){const Wt=[];let Gt=0;for(let Yt=0;Yt<Bt.length;Yt++)Wt.push(null),Gt+=32;for(let Yt=0;Yt<Bt.length;Yt++){const Xt=arrayify(Bt[Yt]);Wt[Yt]=numPad(Gt),Wt.push(numPad(Xt.length)),Wt.push(bytesPad(Xt)),Gt+=32+Math.ceil(Xt.length/32)*32}return hexConcat(Wt)}class Resolver{constructor(Wt,Gt,Yt,Xt){defineReadOnly(this,"provider",Wt),defineReadOnly(this,"name",Yt),defineReadOnly(this,"address",Wt.formatter.address(Gt)),defineReadOnly(this,"_resolvedAddress",Xt)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(Wt=>BigNumber.from(Wt).eq(1)).catch(Wt=>{if(Wt.code===Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,Wt})),this._supportsEip2544}_fetch(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){const Yt={to:this.address,ccipReadEnabled:!0,data:hexConcat([Wt,namehash(this.name),Gt||"0x"])};let Xt=!1;(yield this.supportsWildcard())&&(Xt=!0,Yt.data=hexConcat(["0x9061b923",encodeBytes([dnsEncode(this.name),Yt.data])]));try{let Jt=yield this.provider.call(Yt);return arrayify(Jt).length%32===4&&logger$h.throwError("resolver threw error",Logger.errors.CALL_EXCEPTION,{transaction:Yt,data:Jt}),Xt&&(Jt=_parseBytes(Jt,0)),Jt}catch(Jt){if(Jt.code===Logger.errors.CALL_EXCEPTION)return null;throw Jt}})}_fetchBytes(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){const Yt=yield this._fetch(Wt,Gt);return Yt!=null?_parseBytes(Yt,0):null})}_getAddress(Wt,Gt){const Yt=coinInfos[String(Wt)];if(Yt==null&&logger$h.throwError(`unsupported coin type: ${Wt}`,Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${Wt})`}),Yt.ilk==="eth")return this.provider.formatter.address(Gt);const Xt=arrayify(Gt);if(Yt.p2pkh!=null){const Jt=Gt.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(Jt){const Zt=parseInt(Jt[1],16);if(Jt[2].length===Zt*2&&Zt>=1&&Zt<=75)return base58Encode(concat$2([[Yt.p2pkh],"0x"+Jt[2]]))}}if(Yt.p2sh!=null){const Jt=Gt.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(Jt){const Zt=parseInt(Jt[1],16);if(Jt[2].length===Zt*2&&Zt>=1&&Zt<=75)return base58Encode(concat$2([[Yt.p2sh],"0x"+Jt[2]]))}}if(Yt.prefix!=null){const Jt=Xt[1];let Zt=Xt[0];if(Zt===0?Jt!==20&&Jt!==32&&(Zt=-1):Zt=-1,Zt>=0&&Xt.length===2+Jt&&Jt>=1&&Jt<=75){const Qt=bech32$1.toWords(Xt.slice(2));return Qt.unshift(Zt),bech32$1.encode(Yt.prefix,Qt)}}return null}getAddress(Wt){return __awaiter$p(this,void 0,void 0,function*(){if(Wt==null&&(Wt=60),Wt===60)try{const Xt=yield this._fetch("0x3b3b57de");return Xt==="0x"||Xt===HashZero?null:this.provider.formatter.callAddress(Xt)}catch(Xt){if(Xt.code===Logger.errors.CALL_EXCEPTION)return null;throw Xt}const Gt=yield this._fetchBytes("0xf1cb7e06",bytes32ify(Wt));if(Gt==null||Gt==="0x")return null;const Yt=this._getAddress(Wt,Gt);return Yt==null&&logger$h.throwError("invalid or unsupported coin data",Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${Wt})`,coinType:Wt,data:Gt}),Yt})}getAvatar(){return __awaiter$p(this,void 0,void 0,function*(){const Wt=[{type:"name",content:this.name}];try{const Gt=yield this.getText("avatar");if(Gt==null)return null;for(let Yt=0;Yt<matchers.length;Yt++){const Xt=Gt.match(matchers[Yt]);if(Xt==null)continue;const Jt=Xt[1].toLowerCase();switch(Jt){case"https":return Wt.push({type:"url",content:Gt}),{linkage:Wt,url:Gt};case"data":return Wt.push({type:"data",content:Gt}),{linkage:Wt,url:Gt};case"ipfs":return Wt.push({type:"ipfs",content:Gt}),{linkage:Wt,url:getIpfsLink(Gt)};case"erc721":case"erc1155":{const Zt=Jt==="erc721"?"0xc87b56dd":"0x0e89341c";Wt.push({type:Jt,content:Gt});const Qt=this._resolvedAddress||(yield this.getAddress()),ur=(Xt[2]||"").split("/");if(ur.length!==2)return null;const cr=yield this.provider.formatter.address(ur[0]),$r=hexZeroPad(BigNumber.from(ur[1]).toHexString(),32);if(Jt==="erc721"){const Hr=this.provider.formatter.callAddress(yield this.provider.call({to:cr,data:hexConcat(["0x6352211e",$r])}));if(Qt!==Hr)return null;Wt.push({type:"owner",content:Hr})}else if(Jt==="erc1155"){const Hr=BigNumber.from(yield this.provider.call({to:cr,data:hexConcat(["0x00fdd58e",hexZeroPad(Qt,32),$r])}));if(Hr.isZero())return null;Wt.push({type:"balance",content:Hr.toString()})}const Ar={to:this.provider.formatter.address(ur[0]),data:hexConcat([Zt,$r])};let Lr=_parseString(yield this.provider.call(Ar),0);if(Lr==null)return null;Wt.push({type:"metadata-url-base",content:Lr}),Jt==="erc1155"&&(Lr=Lr.replace("{id}",$r.substring(2)),Wt.push({type:"metadata-url-expanded",content:Lr})),Lr.match(/^ipfs:/i)&&(Lr=getIpfsLink(Lr)),Wt.push({type:"metadata-url",content:Lr});const qr=yield fetchJson(Lr);if(!qr)return null;Wt.push({type:"metadata",content:JSON.stringify(qr)});let Fr=qr.image;if(typeof Fr!="string")return null;if(!Fr.match(/^(https:\/\/|data:)/i)){if(Fr.match(matcherIpfs)==null)return null;Wt.push({type:"url-ipfs",content:Fr}),Fr=getIpfsLink(Fr)}return Wt.push({type:"url",content:Fr}),{linkage:Wt,url:Fr}}}}}catch{}return null})}getContentHash(){return __awaiter$p(this,void 0,void 0,function*(){const Wt=yield this._fetchBytes("0xbc1c58d1");if(Wt==null||Wt==="0x")return null;const Gt=Wt.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(Gt){const Zt=parseInt(Gt[3],16);if(Gt[4].length===Zt*2)return"ipfs://"+Base58.encode("0x"+Gt[1])}const Yt=Wt.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(Yt){const Zt=parseInt(Yt[3],16);if(Yt[4].length===Zt*2)return"ipns://"+Base58.encode("0x"+Yt[1])}const Xt=Wt.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(Xt&&Xt[1].length===32*2)return"bzz://"+Xt[1];const Jt=Wt.match(/^0x90b2c605([0-9a-f]*)$/);if(Jt&&Jt[1].length===34*2){const Zt={"=":"","+":"-","/":"_"};return"sia://"+encode$5("0x"+Jt[1]).replace(/[=+\/]/g,ur=>Zt[ur])}return logger$h.throwError("invalid or unsupported content hash data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:Wt})})}getText(Wt){return __awaiter$p(this,void 0,void 0,function*(){let Gt=toUtf8Bytes(Wt);Gt=concat$2([bytes32ify(64),bytes32ify(Gt.length),Gt]),Gt.length%32!==0&&(Gt=concat$2([Gt,hexZeroPad("0x",32-Wt.length%32)]));const Yt=yield this._fetchBytes("0x59d1d43c",hexlify(Gt));return Yt==null||Yt==="0x"?null:toUtf8String(Yt)})}}let defaultFormatter$1=null,nextPollId=1;class BaseProvider extends Provider{constructor(Wt){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly(this,"anyNetwork",Wt==="any"),this.anyNetwork&&(Wt=this.detectNetwork()),Wt instanceof Promise)this._networkPromise=Wt,Wt.catch(Gt=>{}),this._ready().catch(Gt=>{});else{const Gt=getStatic(new.target,"getNetwork")(Wt);Gt?(defineReadOnly(this,"_network",Gt),this.emit("network",Gt,null)):logger$h.throwArgumentError("invalid network","network",Wt)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$p(this,void 0,void 0,function*(){if(this._network==null){let Wt=null;if(this._networkPromise)try{Wt=yield this._networkPromise}catch{}Wt==null&&(Wt=yield this.detectNetwork()),Wt||logger$h.throwError("no network detected",Logger.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=Wt:defineReadOnly(this,"_network",Wt),this.emit("network",Wt,null))}return this._network})}get ready(){return poll(()=>this._ready().then(Wt=>Wt,Wt=>{if(!(Wt.code===Logger.errors.NETWORK_ERROR&&Wt.event==="noNetwork"))throw Wt}))}static getFormatter(){return defaultFormatter$1==null&&(defaultFormatter$1=new Formatter),defaultFormatter$1}static getNetwork(Wt){return getNetwork(Wt??"homestead")}ccipReadFetch(Wt,Gt,Yt){return __awaiter$p(this,void 0,void 0,function*(){if(this.disableCcipRead||Yt.length===0)return null;const Xt=Wt.to.toLowerCase(),Jt=Gt.toLowerCase(),Zt=[];for(let Qt=0;Qt<Yt.length;Qt++){const ur=Yt[Qt],cr=ur.replace("{sender}",Xt).replace("{data}",Jt),$r=ur.indexOf("{data}")>=0?null:JSON.stringify({data:Jt,sender:Xt}),Ar=yield fetchJson({url:cr,errorPassThrough:!0},$r,(qr,Fr)=>(qr.status=Fr.statusCode,qr));if(Ar.data)return Ar.data;const Lr=Ar.message||"unknown error";if(Ar.status>=400&&Ar.status<500)return logger$h.throwError(`response not found during CCIP fetch: ${Lr}`,Logger.errors.SERVER_ERROR,{url:ur,errorMessage:Lr});Zt.push(Lr)}return logger$h.throwError(`error encountered during CCIP fetch: ${Zt.map(Qt=>JSON.stringify(Qt)).join(", ")}`,Logger.errors.SERVER_ERROR,{urls:Yt,errorMessages:Zt})})}_getInternalBlockNumber(Wt){return __awaiter$p(this,void 0,void 0,function*(){if(yield this._ready(),Wt>0)for(;this._internalBlockNumber;){const Xt=this._internalBlockNumber;try{const Jt=yield Xt;if(getTime()-Jt.respTime<=Wt)return Jt.blockNumber;break}catch{if(this._internalBlockNumber===Xt)break}}const Gt=getTime(),Yt=resolveProperties({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(Xt=>null,Xt=>Xt)}).then(({blockNumber:Xt,networkError:Jt})=>{if(Jt)throw this._internalBlockNumber===Yt&&(this._internalBlockNumber=null),Jt;const Zt=getTime();return Xt=BigNumber.from(Xt).toNumber(),Xt<this._maxInternalBlockNumber&&(Xt=this._maxInternalBlockNumber),this._maxInternalBlockNumber=Xt,this._setFastBlockNumber(Xt),{blockNumber:Xt,reqTime:Gt,respTime:Zt}});return this._internalBlockNumber=Yt,Yt.catch(Xt=>{this._internalBlockNumber===Yt&&(this._internalBlockNumber=null)}),(yield Yt).blockNumber})}poll(){return __awaiter$p(this,void 0,void 0,function*(){const Wt=nextPollId++,Gt=[];let Yt=null;try{Yt=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(Xt){this.emit("error",Xt);return}if(this._setFastBlockNumber(Yt),this.emit("poll",Wt,Yt),Yt===this._lastBlockNumber){this.emit("didPoll",Wt);return}if(this._emitted.block===-2&&(this._emitted.block=Yt-1),Math.abs(this._emitted.block-Yt)>1e3)logger$h.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${Yt})`),this.emit("error",logger$h.makeError("network block skew detected",Logger.errors.NETWORK_ERROR,{blockNumber:Yt,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",Yt);else for(let Xt=this._emitted.block+1;Xt<=Yt;Xt++)this.emit("block",Xt);this._emitted.block!==Yt&&(this._emitted.block=Yt,Object.keys(this._emitted).forEach(Xt=>{if(Xt==="block")return;const Jt=this._emitted[Xt];Jt!=="pending"&&Yt-Jt>12&&delete this._emitted[Xt]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=Yt-1),this._events.forEach(Xt=>{switch(Xt.type){case"tx":{const Jt=Xt.hash;let Zt=this.getTransactionReceipt(Jt).then(Qt=>(!Qt||Qt.blockNumber==null||(this._emitted["t:"+Jt]=Qt.blockNumber,this.emit(Jt,Qt)),null)).catch(Qt=>{this.emit("error",Qt)});Gt.push(Zt);break}case"filter":{if(!Xt._inflight){Xt._inflight=!0,Xt._lastBlockNumber===-2&&(Xt._lastBlockNumber=Yt-1);const Jt=Xt.filter;Jt.fromBlock=Xt._lastBlockNumber+1,Jt.toBlock=Yt;const Zt=Jt.toBlock-this._maxFilterBlockRange;Zt>Jt.fromBlock&&(Jt.fromBlock=Zt),Jt.fromBlock<0&&(Jt.fromBlock=0);const Qt=this.getLogs(Jt).then(ur=>{Xt._inflight=!1,ur.length!==0&&ur.forEach(cr=>{cr.blockNumber>Xt._lastBlockNumber&&(Xt._lastBlockNumber=cr.blockNumber),this._emitted["b:"+cr.blockHash]=cr.blockNumber,this._emitted["t:"+cr.transactionHash]=cr.blockNumber,this.emit(Jt,cr)})}).catch(ur=>{this.emit("error",ur),Xt._inflight=!1});Gt.push(Qt)}break}}}),this._lastBlockNumber=Yt,Promise.all(Gt).then(()=>{this.emit("didPoll",Wt)}).catch(Xt=>{this.emit("error",Xt)})})}resetEventsBlock(Wt){this._lastBlockNumber=Wt-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$p(this,void 0,void 0,function*(){return logger$h.throwError("provider does not support network detection",Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return __awaiter$p(this,void 0,void 0,function*(){const Wt=yield this._ready(),Gt=yield this.detectNetwork();if(Wt.chainId!==Gt.chainId){if(this.anyNetwork)return this._network=Gt,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",Gt,Wt),yield stall$1(0),this._network;const Yt=logger$h.makeError("underlying network changed",Logger.errors.NETWORK_ERROR,{event:"changed",network:Wt,detectedNetwork:Gt});throw this.emit("error",Yt),Yt}return Wt})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(Wt=>{this._setFastBlockNumber(Wt)},Wt=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(Wt){Wt&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!Wt&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(Wt){if(typeof Wt!="number"||Wt<=0||parseInt(String(Wt))!=Wt)throw new Error("invalid polling interval");this._pollingInterval=Wt,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const Wt=getTime();return Wt-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=Wt,this._fastBlockNumberPromise=this.getBlockNumber().then(Gt=>((this._fastBlockNumber==null||Gt>this._fastBlockNumber)&&(this._fastBlockNumber=Gt),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(Wt){this._fastBlockNumber!=null&&Wt<this._fastBlockNumber||(this._fastQueryDate=getTime(),(this._fastBlockNumber==null||Wt>this._fastBlockNumber)&&(this._fastBlockNumber=Wt,this._fastBlockNumberPromise=Promise.resolve(Wt)))}waitForTransaction(Wt,Gt,Yt){return __awaiter$p(this,void 0,void 0,function*(){return this._waitForTransaction(Wt,Gt??1,Yt||0,null)})}_waitForTransaction(Wt,Gt,Yt,Xt){return __awaiter$p(this,void 0,void 0,function*(){const Jt=yield this.getTransactionReceipt(Wt);return(Jt?Jt.confirmations:0)>=Gt?Jt:new Promise((Zt,Qt)=>{const ur=[];let cr=!1;const $r=function(){return cr?!0:(cr=!0,ur.forEach(Lr=>{Lr()}),!1)},Ar=Lr=>{Lr.confirmations<Gt||$r()||Zt(Lr)};if(this.on(Wt,Ar),ur.push(()=>{this.removeListener(Wt,Ar)}),Xt){let Lr=Xt.startBlock,qr=null;const Fr=Hr=>__awaiter$p(this,void 0,void 0,function*(){cr||(yield stall$1(1e3),this.getTransactionCount(Xt.from).then(Br=>__awaiter$p(this,void 0,void 0,function*(){if(!cr){if(Br<=Xt.nonce)Lr=Hr;else{{const Wr=yield this.getTransaction(Wt);if(Wr&&Wr.blockNumber!=null)return}for(qr==null&&(qr=Lr-3,qr<Xt.startBlock&&(qr=Xt.startBlock));qr<=Hr;){if(cr)return;const Wr=yield this.getBlockWithTransactions(qr);for(let Gr=0;Gr<Wr.transactions.length;Gr++){const Kr=Wr.transactions[Gr];if(Kr.hash===Wt)return;if(Kr.from===Xt.from&&Kr.nonce===Xt.nonce){if(cr)return;const Yr=yield this.waitForTransaction(Kr.hash,Gt);if($r())return;let hn="replaced";Kr.data===Xt.data&&Kr.to===Xt.to&&Kr.value.eq(Xt.value)?hn="repriced":Kr.data==="0x"&&Kr.from===Kr.to&&Kr.value.isZero()&&(hn="cancelled"),Qt(logger$h.makeError("transaction was replaced",Logger.errors.TRANSACTION_REPLACED,{cancelled:hn==="replaced"||hn==="cancelled",reason:hn,replacement:this._wrapTransaction(Kr),hash:Wt,receipt:Yr}));return}}qr++}}cr||this.once("block",Fr)}}),Br=>{cr||this.once("block",Fr)}))});if(cr)return;this.once("block",Fr),ur.push(()=>{this.removeListener("block",Fr)})}if(typeof Yt=="number"&&Yt>0){const Lr=setTimeout(()=>{$r()||Qt(logger$h.makeError("timeout exceeded",Logger.errors.TIMEOUT,{timeout:Yt}))},Yt);Lr.unref&&Lr.unref(),ur.push(()=>{clearTimeout(Lr)})}})})}getBlockNumber(){return __awaiter$p(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Wt=yield this.perform("getGasPrice",{});try{return BigNumber.from(Wt)}catch(Gt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:Wt,error:Gt})}})}getBalance(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Yt=yield resolveProperties({address:this._getAddress(Wt),blockTag:this._getBlockTag(Gt)}),Xt=yield this.perform("getBalance",Yt);try{return BigNumber.from(Xt)}catch(Jt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"getBalance",params:Yt,result:Xt,error:Jt})}})}getTransactionCount(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Yt=yield resolveProperties({address:this._getAddress(Wt),blockTag:this._getBlockTag(Gt)}),Xt=yield this.perform("getTransactionCount",Yt);try{return BigNumber.from(Xt).toNumber()}catch(Jt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:Yt,result:Xt,error:Jt})}})}getCode(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Yt=yield resolveProperties({address:this._getAddress(Wt),blockTag:this._getBlockTag(Gt)}),Xt=yield this.perform("getCode",Yt);try{return hexlify(Xt)}catch(Jt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"getCode",params:Yt,result:Xt,error:Jt})}})}getStorageAt(Wt,Gt,Yt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Xt=yield resolveProperties({address:this._getAddress(Wt),blockTag:this._getBlockTag(Yt),position:Promise.resolve(Gt).then(Zt=>hexValue(Zt))}),Jt=yield this.perform("getStorageAt",Xt);try{return hexlify(Jt)}catch(Zt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:Xt,result:Jt,error:Zt})}})}_wrapTransaction(Wt,Gt,Yt){if(Gt!=null&&hexDataLength(Gt)!==32)throw new Error("invalid response - sendTransaction");const Xt=Wt;return Gt!=null&&Wt.hash!==Gt&&logger$h.throwError("Transaction hash mismatch from Provider.sendTransaction.",Logger.errors.UNKNOWN_ERROR,{expectedHash:Wt.hash,returnedHash:Gt}),Xt.wait=(Jt,Zt)=>__awaiter$p(this,void 0,void 0,function*(){Jt==null&&(Jt=1),Zt==null&&(Zt=0);let Qt;Jt!==0&&Yt!=null&&(Qt={data:Wt.data,from:Wt.from,nonce:Wt.nonce,to:Wt.to,value:Wt.value,startBlock:Yt});const ur=yield this._waitForTransaction(Wt.hash,Jt,Zt,Qt);return ur==null&&Jt===0?null:(this._emitted["t:"+Wt.hash]=ur.blockNumber,ur.status===0&&logger$h.throwError("transaction failed",Logger.errors.CALL_EXCEPTION,{transactionHash:Wt.hash,transaction:Wt,receipt:ur}),ur)}),Xt}sendTransaction(Wt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Gt=yield Promise.resolve(Wt).then(Jt=>hexlify(Jt)),Yt=this.formatter.transaction(Wt);Yt.confirmations==null&&(Yt.confirmations=0);const Xt=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const Jt=yield this.perform("sendTransaction",{signedTransaction:Gt});return this._wrapTransaction(Yt,Jt,Xt)}catch(Jt){throw Jt.transaction=Yt,Jt.transactionHash=Yt.hash,Jt}})}_getTransactionRequest(Wt){return __awaiter$p(this,void 0,void 0,function*(){const Gt=yield Wt,Yt={};return["from","to"].forEach(Xt=>{Gt[Xt]!=null&&(Yt[Xt]=Promise.resolve(Gt[Xt]).then(Jt=>Jt?this._getAddress(Jt):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(Xt=>{Gt[Xt]!=null&&(Yt[Xt]=Promise.resolve(Gt[Xt]).then(Jt=>Jt?BigNumber.from(Jt):null))}),["type"].forEach(Xt=>{Gt[Xt]!=null&&(Yt[Xt]=Promise.resolve(Gt[Xt]).then(Jt=>Jt??null))}),Gt.accessList&&(Yt.accessList=this.formatter.accessList(Gt.accessList)),["data"].forEach(Xt=>{Gt[Xt]!=null&&(Yt[Xt]=Promise.resolve(Gt[Xt]).then(Jt=>Jt?hexlify(Jt):null))}),this.formatter.transactionRequest(yield resolveProperties(Yt))})}_getFilter(Wt){return __awaiter$p(this,void 0,void 0,function*(){Wt=yield Wt;const Gt={};return Wt.address!=null&&(Gt.address=this._getAddress(Wt.address)),["blockHash","topics"].forEach(Yt=>{Wt[Yt]!=null&&(Gt[Yt]=Wt[Yt])}),["fromBlock","toBlock"].forEach(Yt=>{Wt[Yt]!=null&&(Gt[Yt]=this._getBlockTag(Wt[Yt]))}),this.formatter.filter(yield resolveProperties(Gt))})}_call(Wt,Gt,Yt){return __awaiter$p(this,void 0,void 0,function*(){Yt>=MAX_CCIP_REDIRECTS&&logger$h.throwError("CCIP read exceeded maximum redirections",Logger.errors.SERVER_ERROR,{redirects:Yt,transaction:Wt});const Xt=Wt.to,Jt=yield this.perform("call",{transaction:Wt,blockTag:Gt});if(Yt>=0&&Gt==="latest"&&Xt!=null&&Jt.substring(0,10)==="0x556f1830"&&hexDataLength(Jt)%32===4)try{const Zt=hexDataSlice(Jt,4),Qt=hexDataSlice(Zt,0,32);BigNumber.from(Qt).eq(Xt)||logger$h.throwError("CCIP Read sender did not match",Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Wt,data:Jt});const ur=[],cr=BigNumber.from(hexDataSlice(Zt,32,64)).toNumber(),$r=BigNumber.from(hexDataSlice(Zt,cr,cr+32)).toNumber(),Ar=hexDataSlice(Zt,cr+32);for(let Wr=0;Wr<$r;Wr++){const Gr=_parseString(Ar,Wr*32);Gr==null&&logger$h.throwError("CCIP Read contained corrupt URL string",Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Wt,data:Jt}),ur.push(Gr)}const Lr=_parseBytes(Zt,64);BigNumber.from(hexDataSlice(Zt,100,128)).isZero()||logger$h.throwError("CCIP Read callback selector included junk",Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Wt,data:Jt});const qr=hexDataSlice(Zt,96,100),Fr=_parseBytes(Zt,128),Hr=yield this.ccipReadFetch(Wt,Lr,ur);Hr==null&&logger$h.throwError("CCIP Read disabled or provided no URLs",Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Wt,data:Jt});const Br={to:Xt,data:hexConcat([qr,encodeBytes([Hr,Fr])])};return this._call(Br,Gt,Yt+1)}catch(Zt){if(Zt.code===Logger.errors.SERVER_ERROR)throw Zt}try{return hexlify(Jt)}catch(Zt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:Wt,blockTag:Gt},result:Jt,error:Zt})}})}call(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Yt=yield resolveProperties({transaction:this._getTransactionRequest(Wt),blockTag:this._getBlockTag(Gt),ccipReadEnabled:Promise.resolve(Wt.ccipReadEnabled)});return this._call(Yt.transaction,Yt.blockTag,Yt.ccipReadEnabled?0:-1)})}estimateGas(Wt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Gt=yield resolveProperties({transaction:this._getTransactionRequest(Wt)}),Yt=yield this.perform("estimateGas",Gt);try{return BigNumber.from(Yt)}catch(Xt){return logger$h.throwError("bad result from backend",Logger.errors.SERVER_ERROR,{method:"estimateGas",params:Gt,result:Yt,error:Xt})}})}_getAddress(Wt){return __awaiter$p(this,void 0,void 0,function*(){Wt=yield Wt,typeof Wt!="string"&&logger$h.throwArgumentError("invalid address or ENS name","name",Wt);const Gt=yield this.resolveName(Wt);return Gt==null&&logger$h.throwError("ENS name not configured",Logger.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(Wt)})`}),Gt})}_getBlock(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork(),Wt=yield Wt;let Yt=-128;const Xt={includeTransactions:!!Gt};if(isHexString(Wt,32))Xt.blockHash=Wt;else try{Xt.blockTag=yield this._getBlockTag(Wt),isHexString(Xt.blockTag)&&(Yt=parseInt(Xt.blockTag.substring(2),16))}catch{logger$h.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",Wt)}return poll(()=>__awaiter$p(this,void 0,void 0,function*(){const Jt=yield this.perform("getBlock",Xt);if(Jt==null)return Xt.blockHash!=null&&this._emitted["b:"+Xt.blockHash]==null||Xt.blockTag!=null&&Yt>this._emitted.block?null:void 0;if(Gt){let Zt=null;for(let ur=0;ur<Jt.transactions.length;ur++){const cr=Jt.transactions[ur];if(cr.blockNumber==null)cr.confirmations=0;else if(cr.confirmations==null){Zt==null&&(Zt=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let $r=Zt-cr.blockNumber+1;$r<=0&&($r=1),cr.confirmations=$r}}const Qt=this.formatter.blockWithTransactions(Jt);return Qt.transactions=Qt.transactions.map(ur=>this._wrapTransaction(ur)),Qt}return this.formatter.block(Jt)}),{oncePoll:this})})}getBlock(Wt){return this._getBlock(Wt,!1)}getBlockWithTransactions(Wt){return this._getBlock(Wt,!0)}getTransaction(Wt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork(),Wt=yield Wt;const Gt={transactionHash:this.formatter.hash(Wt,!0)};return poll(()=>__awaiter$p(this,void 0,void 0,function*(){const Yt=yield this.perform("getTransaction",Gt);if(Yt==null)return this._emitted["t:"+Wt]==null?null:void 0;const Xt=this.formatter.transactionResponse(Yt);if(Xt.blockNumber==null)Xt.confirmations=0;else if(Xt.confirmations==null){let Zt=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-Xt.blockNumber+1;Zt<=0&&(Zt=1),Xt.confirmations=Zt}return this._wrapTransaction(Xt)}),{oncePoll:this})})}getTransactionReceipt(Wt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork(),Wt=yield Wt;const Gt={transactionHash:this.formatter.hash(Wt,!0)};return poll(()=>__awaiter$p(this,void 0,void 0,function*(){const Yt=yield this.perform("getTransactionReceipt",Gt);if(Yt==null)return this._emitted["t:"+Wt]==null?null:void 0;if(Yt.blockHash==null)return;const Xt=this.formatter.receipt(Yt);if(Xt.blockNumber==null)Xt.confirmations=0;else if(Xt.confirmations==null){let Zt=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-Xt.blockNumber+1;Zt<=0&&(Zt=1),Xt.confirmations=Zt}return Xt}),{oncePoll:this})})}getLogs(Wt){return __awaiter$p(this,void 0,void 0,function*(){yield this.getNetwork();const Gt=yield resolveProperties({filter:this._getFilter(Wt)}),Yt=yield this.perform("getLogs",Gt);return Yt.forEach(Xt=>{Xt.removed==null&&(Xt.removed=!1)}),Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(Yt)})}getEtherPrice(){return __awaiter$p(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(Wt){return __awaiter$p(this,void 0,void 0,function*(){if(Wt=yield Wt,typeof Wt=="number"&&Wt<0){Wt%1&&logger$h.throwArgumentError("invalid BlockTag","blockTag",Wt);let Gt=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return Gt+=Wt,Gt<0&&(Gt=0),this.formatter.blockTag(Gt)}return this.formatter.blockTag(Wt)})}getResolver(Wt){return __awaiter$p(this,void 0,void 0,function*(){let Gt=Wt;for(;;){if(Gt===""||Gt==="."||Wt!=="eth"&&Gt==="eth")return null;const Yt=yield this._getResolver(Gt,"getResolver");if(Yt!=null){const Xt=new Resolver(this,Yt,Wt);return Gt!==Wt&&!(yield Xt.supportsWildcard())?null:Xt}Gt=Gt.split(".").slice(1).join(".")}})}_getResolver(Wt,Gt){return __awaiter$p(this,void 0,void 0,function*(){Gt==null&&(Gt="ENS");const Yt=yield this.getNetwork();Yt.ensAddress||logger$h.throwError("network does not support ENS",Logger.errors.UNSUPPORTED_OPERATION,{operation:Gt,network:Yt.name});try{const Xt=yield this.call({to:Yt.ensAddress,data:"0x0178b8bf"+namehash(Wt).substring(2)});return this.formatter.callAddress(Xt)}catch{}return null})}resolveName(Wt){return __awaiter$p(this,void 0,void 0,function*(){Wt=yield Wt;try{return Promise.resolve(this.formatter.address(Wt))}catch(Yt){if(isHexString(Wt))throw Yt}typeof Wt!="string"&&logger$h.throwArgumentError("invalid ENS name","name",Wt);const Gt=yield this.getResolver(Wt);return Gt?yield Gt.getAddress():null})}lookupAddress(Wt){return __awaiter$p(this,void 0,void 0,function*(){Wt=yield Wt,Wt=this.formatter.address(Wt);const Gt=Wt.substring(2).toLowerCase()+".addr.reverse",Yt=yield this._getResolver(Gt,"lookupAddress");if(Yt==null)return null;const Xt=_parseString(yield this.call({to:Yt,data:"0x691f3431"+namehash(Gt).substring(2)}),0);return(yield this.resolveName(Xt))!=Wt?null:Xt})}getAvatar(Wt){return __awaiter$p(this,void 0,void 0,function*(){let Gt=null;if(isHexString(Wt)){const Jt=this.formatter.address(Wt).substring(2).toLowerCase()+".addr.reverse",Zt=yield this._getResolver(Jt,"getAvatar");if(!Zt)return null;Gt=new Resolver(this,Zt,Jt);try{const Qt=yield Gt.getAvatar();if(Qt)return Qt.url}catch(Qt){if(Qt.code!==Logger.errors.CALL_EXCEPTION)throw Qt}try{const Qt=_parseString(yield this.call({to:Zt,data:"0x691f3431"+namehash(Jt).substring(2)}),0);Gt=yield this.getResolver(Qt)}catch(Qt){if(Qt.code!==Logger.errors.CALL_EXCEPTION)throw Qt;return null}}else if(Gt=yield this.getResolver(Wt),!Gt)return null;const Yt=yield Gt.getAvatar();return Yt==null?null:Yt.url})}perform(Wt,Gt){return logger$h.throwError(Wt+" not implemented",Logger.errors.NOT_IMPLEMENTED,{operation:Wt})}_startEvent(Wt){this.polling=this._events.filter(Gt=>Gt.pollable()).length>0}_stopEvent(Wt){this.polling=this._events.filter(Gt=>Gt.pollable()).length>0}_addEventListener(Wt,Gt,Yt){const Xt=new Event(getEventTag(Wt),Gt,Yt);return this._events.push(Xt),this._startEvent(Xt),this}on(Wt,Gt){return this._addEventListener(Wt,Gt,!1)}once(Wt,Gt){return this._addEventListener(Wt,Gt,!0)}emit(Wt,...Gt){let Yt=!1,Xt=[],Jt=getEventTag(Wt);return this._events=this._events.filter(Zt=>Zt.tag!==Jt?!0:(setTimeout(()=>{Zt.listener.apply(this,Gt)},0),Yt=!0,Zt.once?(Xt.push(Zt),!1):!0)),Xt.forEach(Zt=>{this._stopEvent(Zt)}),Yt}listenerCount(Wt){if(!Wt)return this._events.length;let Gt=getEventTag(Wt);return this._events.filter(Yt=>Yt.tag===Gt).length}listeners(Wt){if(Wt==null)return this._events.map(Yt=>Yt.listener);let Gt=getEventTag(Wt);return this._events.filter(Yt=>Yt.tag===Gt).map(Yt=>Yt.listener)}off(Wt,Gt){if(Gt==null)return this.removeAllListeners(Wt);const Yt=[];let Xt=!1,Jt=getEventTag(Wt);return this._events=this._events.filter(Zt=>Zt.tag!==Jt||Zt.listener!=Gt||Xt?!0:(Xt=!0,Yt.push(Zt),!1)),Yt.forEach(Zt=>{this._stopEvent(Zt)}),this}removeAllListeners(Wt){let Gt=[];if(Wt==null)Gt=this._events,this._events=[];else{const Yt=getEventTag(Wt);this._events=this._events.filter(Xt=>Xt.tag!==Yt?!0:(Gt.push(Xt),!1))}return Gt.forEach(Yt=>{this._stopEvent(Yt)}),this}}const version$6="abstract-signer/5.7.0";var __awaiter$o=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$g=new Logger(version$6),allowedTransactionKeys$1=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors=[Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){logger$g.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(Wt){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),Wt)})}getTransactionCount(Wt){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),Wt)})}estimateGas(Wt){return __awaiter$o(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const Gt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.estimateGas(Gt)})}call(Wt,Gt){return __awaiter$o(this,void 0,void 0,function*(){this._checkProvider("call");const Yt=yield resolveProperties(this.checkTransaction(Wt));return yield this.provider.call(Yt,Gt)})}sendTransaction(Wt){return __awaiter$o(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const Gt=yield this.populateTransaction(Wt),Yt=yield this.signTransaction(Gt);return yield this.provider.sendTransaction(Yt)})}getChainId(){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(Wt){return __awaiter$o(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(Wt)})}checkTransaction(Wt){for(const Yt in Wt)allowedTransactionKeys$1.indexOf(Yt)===-1&&logger$g.throwArgumentError("invalid transaction key: "+Yt,"transaction",Wt);const Gt=shallowCopy(Wt);return Gt.from==null?Gt.from=this.getAddress():Gt.from=Promise.all([Promise.resolve(Gt.from),this.getAddress()]).then(Yt=>(Yt[0].toLowerCase()!==Yt[1].toLowerCase()&&logger$g.throwArgumentError("from address mismatch","transaction",Wt),Yt[0])),Gt}populateTransaction(Wt){return __awaiter$o(this,void 0,void 0,function*(){const Gt=yield resolveProperties(this.checkTransaction(Wt));Gt.to!=null&&(Gt.to=Promise.resolve(Gt.to).then(Xt=>__awaiter$o(this,void 0,void 0,function*(){if(Xt==null)return null;const Jt=yield this.resolveName(Xt);return Jt==null&&logger$g.throwArgumentError("provided ENS name resolves to null","tx.to",Xt),Jt})),Gt.to.catch(Xt=>{}));const Yt=Gt.maxFeePerGas!=null||Gt.maxPriorityFeePerGas!=null;if(Gt.gasPrice!=null&&(Gt.type===2||Yt)?logger$g.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",Wt):(Gt.type===0||Gt.type===1)&&Yt&&logger$g.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",Wt),(Gt.type===2||Gt.type==null)&&Gt.maxFeePerGas!=null&&Gt.maxPriorityFeePerGas!=null)Gt.type=2;else if(Gt.type===0||Gt.type===1)Gt.gasPrice==null&&(Gt.gasPrice=this.getGasPrice());else{const Xt=yield this.getFeeData();if(Gt.type==null)if(Xt.maxFeePerGas!=null&&Xt.maxPriorityFeePerGas!=null)if(Gt.type=2,Gt.gasPrice!=null){const Jt=Gt.gasPrice;delete Gt.gasPrice,Gt.maxFeePerGas=Jt,Gt.maxPriorityFeePerGas=Jt}else Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas);else Xt.gasPrice!=null?(Yt&&logger$g.throwError("network does not support EIP-1559",Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),Gt.gasPrice==null&&(Gt.gasPrice=Xt.gasPrice),Gt.type=0):logger$g.throwError("failed to get consistent fee data",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else Gt.type===2&&(Gt.maxFeePerGas==null&&(Gt.maxFeePerGas=Xt.maxFeePerGas),Gt.maxPriorityFeePerGas==null&&(Gt.maxPriorityFeePerGas=Xt.maxPriorityFeePerGas))}return Gt.nonce==null&&(Gt.nonce=this.getTransactionCount("pending")),Gt.gasLimit==null&&(Gt.gasLimit=this.estimateGas(Gt).catch(Xt=>{if(forwardErrors.indexOf(Xt.code)>=0)throw Xt;return logger$g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Xt,tx:Gt})})),Gt.chainId==null?Gt.chainId=this.getChainId():Gt.chainId=Promise.all([Promise.resolve(Gt.chainId),this.getChainId()]).then(Xt=>(Xt[1]!==0&&Xt[0]!==Xt[1]&&logger$g.throwArgumentError("chainId address mismatch","transaction",Wt),Xt[0])),yield resolveProperties(Gt)})}_checkProvider(Wt){this.provider||logger$g.throwError("missing provider",Logger.errors.UNSUPPORTED_OPERATION,{operation:Wt||"_checkProvider"})}static isSigner(Wt){return!!(Wt&&Wt._isSigner)}}var __awaiter$n=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$f=new Logger(version$7),errorGas=["call","estimateGas"];function spelunk(Bt,Wt){if(Bt==null)return null;if(typeof Bt.message=="string"&&Bt.message.match("reverted")){const Gt=isHexString(Bt.data)?Bt.data:null;if(!Wt||Gt)return{message:Bt.message,data:Gt}}if(typeof Bt=="object"){for(const Gt in Bt){const Yt=spelunk(Bt[Gt],Wt);if(Yt)return Yt}return null}if(typeof Bt=="string")try{return spelunk(JSON.parse(Bt),Wt)}catch{}return null}function checkError$1(Bt,Wt,Gt){const Yt=Gt.transaction||Gt.signedTransaction;if(Bt==="call"){const Jt=spelunk(Wt,!0);if(Jt)return Jt.data;logger$f.throwError("missing revert data in call exception; Transaction reverted without a reason string",Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:Yt,error:Wt})}if(Bt==="estimateGas"){let Jt=spelunk(Wt.body,!1);Jt==null&&(Jt=spelunk(Wt,!1)),Jt&&logger$f.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:Jt.message,method:Bt,transaction:Yt,error:Wt})}let Xt=Wt.message;throw Wt.code===Logger.errors.SERVER_ERROR&&Wt.error&&typeof Wt.error.message=="string"?Xt=Wt.error.message:typeof Wt.body=="string"?Xt=Wt.body:typeof Wt.responseText=="string"&&(Xt=Wt.responseText),Xt=(Xt||"").toLowerCase(),Xt.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&logger$f.throwError("insufficient funds for intrinsic transaction cost",Logger.errors.INSUFFICIENT_FUNDS,{error:Wt,method:Bt,transaction:Yt}),Xt.match(/nonce (is )?too low/i)&&logger$f.throwError("nonce has already been used",Logger.errors.NONCE_EXPIRED,{error:Wt,method:Bt,transaction:Yt}),Xt.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&logger$f.throwError("replacement fee too low",Logger.errors.REPLACEMENT_UNDERPRICED,{error:Wt,method:Bt,transaction:Yt}),Xt.match(/only replay-protected/i)&&logger$f.throwError("legacy pre-eip-155 transactions not supported",Logger.errors.UNSUPPORTED_OPERATION,{error:Wt,method:Bt,transaction:Yt}),errorGas.indexOf(Bt)>=0&&Xt.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&logger$f.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Wt,method:Bt,transaction:Yt}),Wt}function timer(Bt){return new Promise(function(Wt){setTimeout(Wt,Bt)})}function getResult$1(Bt){if(Bt.error){const Wt=new Error(Bt.error.message);throw Wt.code=Bt.error.code,Wt.data=Bt.error.data,Wt}return Bt.result}function getLowerCase(Bt){return Bt&&Bt.toLowerCase()}const _constructorGuard={};class JsonRpcSigner extends Signer{constructor(Wt,Gt,Yt){if(super(),Wt!==_constructorGuard)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly(this,"provider",Gt),Yt==null&&(Yt=0),typeof Yt=="string"?(defineReadOnly(this,"_address",this.provider.formatter.address(Yt)),defineReadOnly(this,"_index",null)):typeof Yt=="number"?(defineReadOnly(this,"_index",Yt),defineReadOnly(this,"_address",null)):logger$f.throwArgumentError("invalid address or index","addressOrIndex",Yt)}connect(Wt){return logger$f.throwError("cannot alter JSON-RPC Signer connection",Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(_constructorGuard,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(Wt=>(Wt.length<=this._index&&logger$f.throwError("unknown account #"+this._index,Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(Wt[this._index])))}sendUncheckedTransaction(Wt){Wt=shallowCopy(Wt);const Gt=this.getAddress().then(Yt=>(Yt&&(Yt=Yt.toLowerCase()),Yt));if(Wt.gasLimit==null){const Yt=shallowCopy(Wt);Yt.from=Gt,Wt.gasLimit=this.provider.estimateGas(Yt)}return Wt.to!=null&&(Wt.to=Promise.resolve(Wt.to).then(Yt=>__awaiter$n(this,void 0,void 0,function*(){if(Yt==null)return null;const Xt=yield this.provider.resolveName(Yt);return Xt==null&&logger$f.throwArgumentError("provided ENS name resolves to null","tx.to",Yt),Xt}))),resolveProperties({tx:resolveProperties(Wt),sender:Gt}).then(({tx:Yt,sender:Xt})=>{Yt.from!=null?Yt.from.toLowerCase()!==Xt&&logger$f.throwArgumentError("from address mismatch","transaction",Wt):Yt.from=Xt;const Jt=this.provider.constructor.hexlifyTransaction(Yt,{from:!0});return this.provider.send("eth_sendTransaction",[Jt]).then(Zt=>Zt,Zt=>(typeof Zt.message=="string"&&Zt.message.match(/user denied/i)&&logger$f.throwError("user rejected transaction",Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:Yt}),checkError$1("sendTransaction",Zt,Jt)))})}signTransaction(Wt){return logger$f.throwError("signing transactions is unsupported",Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(Wt){return __awaiter$n(this,void 0,void 0,function*(){const Gt=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),Yt=yield this.sendUncheckedTransaction(Wt);try{return yield poll(()=>__awaiter$n(this,void 0,void 0,function*(){const Xt=yield this.provider.getTransaction(Yt);if(Xt!==null)return this.provider._wrapTransaction(Xt,Yt,Gt)}),{oncePoll:this.provider})}catch(Xt){throw Xt.transactionHash=Yt,Xt}})}signMessage(Wt){return __awaiter$n(this,void 0,void 0,function*(){const Gt=typeof Wt=="string"?toUtf8Bytes(Wt):Wt,Yt=yield this.getAddress();try{return yield this.provider.send("personal_sign",[hexlify(Gt),Yt.toLowerCase()])}catch(Xt){throw typeof Xt.message=="string"&&Xt.message.match(/user denied/i)&&logger$f.throwError("user rejected signing",Logger.errors.ACTION_REJECTED,{action:"signMessage",from:Yt,messageData:Wt}),Xt}})}_legacySignMessage(Wt){return __awaiter$n(this,void 0,void 0,function*(){const Gt=typeof Wt=="string"?toUtf8Bytes(Wt):Wt,Yt=yield this.getAddress();try{return yield this.provider.send("eth_sign",[Yt.toLowerCase(),hexlify(Gt)])}catch(Xt){throw typeof Xt.message=="string"&&Xt.message.match(/user denied/i)&&logger$f.throwError("user rejected signing",Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:Yt,messageData:Wt}),Xt}})}_signTypedData(Wt,Gt,Yt){return __awaiter$n(this,void 0,void 0,function*(){const Xt=yield TypedDataEncoder.resolveNames(Wt,Gt,Yt,Zt=>this.provider.resolveName(Zt)),Jt=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[Jt.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(Xt.domain,Gt,Xt.value))])}catch(Zt){throw typeof Zt.message=="string"&&Zt.message.match(/user denied/i)&&logger$f.throwError("user rejected signing",Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:Jt,messageData:{domain:Xt.domain,types:Gt,value:Xt.value}}),Zt}})}unlock(Wt){return __awaiter$n(this,void 0,void 0,function*(){const Gt=this.provider,Yt=yield this.getAddress();return Gt.send("personal_unlockAccount",[Yt.toLowerCase(),Wt,null])})}}class UncheckedJsonRpcSigner extends JsonRpcSigner{sendTransaction(Wt){return this.sendUncheckedTransaction(Wt).then(Gt=>({hash:Gt,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:Yt=>this.provider.waitForTransaction(Gt,Yt)}))}}const allowedTransactionKeys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class JsonRpcProvider extends BaseProvider{constructor(Wt,Gt){let Yt=Gt;Yt==null&&(Yt=new Promise((Xt,Jt)=>{setTimeout(()=>{this.detectNetwork().then(Zt=>{Xt(Zt)},Zt=>{Jt(Zt)})},0)})),super(Yt),Wt||(Wt=getStatic(this.constructor,"defaultUrl")()),typeof Wt=="string"?defineReadOnly(this,"connection",Object.freeze({url:Wt})):defineReadOnly(this,"connection",Object.freeze(shallowCopy(Wt))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return __awaiter$n(this,void 0,void 0,function*(){yield timer(0);let Wt=null;try{Wt=yield this.send("eth_chainId",[])}catch{try{Wt=yield this.send("net_version",[])}catch{}}if(Wt!=null){const Gt=getStatic(this.constructor,"getNetwork");try{return Gt(BigNumber.from(Wt).toNumber())}catch(Yt){return logger$f.throwError("could not detect network",Logger.errors.NETWORK_ERROR,{chainId:Wt,event:"invalidNetwork",serverError:Yt})}}return logger$f.throwError("could not detect network",Logger.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(Wt){return new JsonRpcSigner(_constructorGuard,this,Wt)}getUncheckedSigner(Wt){return this.getSigner(Wt).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(Wt=>Wt.map(Gt=>this.formatter.address(Gt)))}send(Wt,Gt){const Yt={method:Wt,params:Gt,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy(Yt),provider:this});const Xt=["eth_chainId","eth_blockNumber"].indexOf(Wt)>=0;if(Xt&&this._cache[Wt])return this._cache[Wt];const Jt=fetchJson(this.connection,JSON.stringify(Yt),getResult$1).then(Zt=>(this.emit("debug",{action:"response",request:Yt,response:Zt,provider:this}),Zt),Zt=>{throw this.emit("debug",{action:"response",error:Zt,request:Yt,provider:this}),Zt});return Xt&&(this._cache[Wt]=Jt,setTimeout(()=>{this._cache[Wt]=null},0)),Jt}prepareRequest(Wt,Gt){switch(Wt){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(Gt.address),Gt.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(Gt.address),Gt.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(Gt.address),Gt.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(Gt.address),hexZeroPad(Gt.position,32),Gt.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[Gt.signedTransaction]];case"getBlock":return Gt.blockTag?["eth_getBlockByNumber",[Gt.blockTag,!!Gt.includeTransactions]]:Gt.blockHash?["eth_getBlockByHash",[Gt.blockHash,!!Gt.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[Gt.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[Gt.transactionHash]];case"call":return["eth_call",[getStatic(this.constructor,"hexlifyTransaction")(Gt.transaction,{from:!0}),Gt.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic(this.constructor,"hexlifyTransaction")(Gt.transaction,{from:!0})]];case"getLogs":return Gt.filter&&Gt.filter.address!=null&&(Gt.filter.address=getLowerCase(Gt.filter.address)),["eth_getLogs",[Gt.filter]]}return null}perform(Wt,Gt){return __awaiter$n(this,void 0,void 0,function*(){if(Wt==="call"||Wt==="estimateGas"){const Xt=Gt.transaction;if(Xt&&Xt.type!=null&&BigNumber.from(Xt.type).isZero()&&Xt.maxFeePerGas==null&&Xt.maxPriorityFeePerGas==null){const Jt=yield this.getFeeData();Jt.maxFeePerGas==null&&Jt.maxPriorityFeePerGas==null&&(Gt=shallowCopy(Gt),Gt.transaction=shallowCopy(Xt),delete Gt.transaction.type)}}const Yt=this.prepareRequest(Wt,Gt);Yt==null&&logger$f.throwError(Wt+" not implemented",Logger.errors.NOT_IMPLEMENTED,{operation:Wt});try{return yield this.send(Yt[0],Yt[1])}catch(Xt){return checkError$1(Wt,Xt,Gt)}})}_startEvent(Wt){Wt.tag==="pending"&&this._startPending(),super._startEvent(Wt)}_startPending(){if(this._pendingFilter!=null)return;const Wt=this,Gt=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=Gt,Gt.then(function(Yt){function Xt(){Wt.send("eth_getFilterChanges",[Yt]).then(function(Jt){if(Wt._pendingFilter!=Gt)return null;let Zt=Promise.resolve();return Jt.forEach(function(Qt){Wt._emitted["t:"+Qt.toLowerCase()]="pending",Zt=Zt.then(function(){return Wt.getTransaction(Qt).then(function(ur){return Wt.emit("pending",ur),null})})}),Zt.then(function(){return timer(1e3)})}).then(function(){if(Wt._pendingFilter!=Gt){Wt.send("eth_uninstallFilter",[Yt]);return}return setTimeout(function(){Xt()},0),null}).catch(Jt=>{})}return Xt(),Yt}).catch(Yt=>{})}_stopEvent(Wt){Wt.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(Wt)}static hexlifyTransaction(Wt,Gt){const Yt=shallowCopy(allowedTransactionKeys);if(Gt)for(const Jt in Gt)Gt[Jt]&&(Yt[Jt]=!0);checkProperties(Wt,Yt);const Xt={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(Jt){if(Wt[Jt]==null)return;const Zt=hexValue(BigNumber.from(Wt[Jt]));Jt==="gasLimit"&&(Jt="gas"),Xt[Jt]=Zt}),["from","to","data"].forEach(function(Jt){Wt[Jt]!=null&&(Xt[Jt]=hexlify(Wt[Jt]))}),Wt.accessList&&(Xt.accessList=accessListify(Wt.accessList)),Xt}}let WS=null;try{if(WS=WebSocket,WS==null)throw new Error("inject please")}catch{const Wt=new Logger(version$7);WS=function(){Wt.throwError("WebSockets not supported in this environment",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var __awaiter$m=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$e=new Logger(version$7);let NextId=1;class WebSocketProvider extends JsonRpcProvider{constructor(Wt,Gt){Gt==="any"&&logger$e.throwError("WebSocketProvider does not support 'any' network yet",Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof Wt=="string"?super(Wt,Gt):super("_websocket",Gt),this._pollingInterval=-1,this._wsReady=!1,typeof Wt=="string"?defineReadOnly(this,"_websocket",new WS(this.connection.url)):defineReadOnly(this,"_websocket",Wt),defineReadOnly(this,"_requests",{}),defineReadOnly(this,"_subs",{}),defineReadOnly(this,"_subIds",{}),defineReadOnly(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(Xt=>{this.websocket.send(this._requests[Xt].payload)})},this.websocket.onmessage=Xt=>{const Jt=Xt.data,Zt=JSON.parse(Jt);if(Zt.id!=null){const Qt=String(Zt.id),ur=this._requests[Qt];if(delete this._requests[Qt],Zt.result!==void 0)ur.callback(null,Zt.result),this.emit("debug",{action:"response",request:JSON.parse(ur.payload),response:Zt.result,provider:this});else{let cr=null;Zt.error?(cr=new Error(Zt.error.message||"unknown error"),defineReadOnly(cr,"code",Zt.error.code||null),defineReadOnly(cr,"response",Jt)):cr=new Error("unknown error"),ur.callback(cr,void 0),this.emit("debug",{action:"response",error:cr,request:JSON.parse(ur.payload),provider:this})}}else if(Zt.method==="eth_subscription"){const Qt=this._subs[Zt.params.subscription];Qt&&Qt.processFunc(Zt.params.result)}else console.warn("this should not happen")};const Yt=setInterval(()=>{this.emit("poll")},1e3);Yt.unref&&Yt.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(Wt){logger$e.throwError("cannot reset events block on WebSocketProvider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(Wt){logger$e.throwError("cannot set polling interval on WebSocketProvider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return __awaiter$m(this,void 0,void 0,function*(){return null})}set polling(Wt){Wt&&logger$e.throwError("cannot set polling on WebSocketProvider",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(Wt,Gt){const Yt=NextId++;return new Promise((Xt,Jt)=>{function Zt(ur,cr){return ur?Jt(ur):Xt(cr)}const Qt=JSON.stringify({method:Wt,params:Gt,id:Yt,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(Qt),provider:this}),this._requests[String(Yt)]={callback:Zt,payload:Qt},this._wsReady&&this.websocket.send(Qt)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(Wt,Gt,Yt){return __awaiter$m(this,void 0,void 0,function*(){let Xt=this._subIds[Wt];Xt==null&&(Xt=Promise.all(Gt).then(Zt=>this.send("eth_subscribe",Zt)),this._subIds[Wt]=Xt);const Jt=yield Xt;this._subs[Jt]={tag:Wt,processFunc:Yt}})}_startEvent(Wt){switch(Wt.type){case"block":this._subscribe("block",["newHeads"],Gt=>{const Yt=BigNumber.from(Gt.number).toNumber();this._emitted.block=Yt,this.emit("block",Yt)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],Gt=>{this.emit("pending",Gt)});break;case"filter":this._subscribe(Wt.tag,["logs",this._getFilter(Wt.filter)],Gt=>{Gt.removed==null&&(Gt.removed=!1),this.emit(Wt.filter,this.formatter.filterLog(Gt))});break;case"tx":{const Gt=Yt=>{const Xt=Yt.hash;this.getTransactionReceipt(Xt).then(Jt=>{Jt&&this.emit(Xt,Jt)})};Gt(Wt),this._subscribe("tx",["newHeads"],Yt=>{this._events.filter(Xt=>Xt.type==="tx").forEach(Gt)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",Wt);break}}_stopEvent(Wt){let Gt=Wt.tag;if(Wt.type==="tx"){if(this._events.filter(Xt=>Xt.type==="tx").length)return;Gt="tx"}else if(this.listenerCount(Wt.event))return;const Yt=this._subIds[Gt];Yt&&(delete this._subIds[Gt],Yt.then(Xt=>{this._subs[Xt]&&(delete this._subs[Xt],this.send("eth_unsubscribe",[Xt]))}))}destroy(){return __awaiter$m(this,void 0,void 0,function*(){this.websocket.readyState===WS.CONNECTING&&(yield new Promise(Wt=>{this.websocket.onopen=function(){Wt(!0)},this.websocket.onerror=function(){Wt(!1)}})),this.websocket.close(1e3)})}}var __awaiter$l=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$d=new Logger(version$7);class StaticJsonRpcProvider extends JsonRpcProvider{detectNetwork(){const Wt=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return __awaiter$l(this,void 0,void 0,function*(){let Gt=this.network;return Gt==null&&(Gt=yield Wt.detectNetwork.call(this),Gt||logger$d.throwError("no network detected",Logger.errors.UNKNOWN_ERROR,{}),this._network==null&&(defineReadOnly(this,"_network",Gt),this.emit("network",Gt,null))),Gt})}}class UrlJsonRpcProvider extends StaticJsonRpcProvider{constructor(Wt,Gt){logger$d.checkAbstract(new.target,UrlJsonRpcProvider),Wt=getStatic(new.target,"getNetwork")(Wt),Gt=getStatic(new.target,"getApiKey")(Gt);const Yt=getStatic(new.target,"getUrl")(Wt,Gt);super(Yt,Wt),typeof Gt=="string"?defineReadOnly(this,"apiKey",Gt):Gt!=null&&Object.keys(Gt).forEach(Xt=>{defineReadOnly(this,Xt,Gt[Xt])})}_startPending(){logger$d.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(Wt){return logger$d.throwError("API provider does not support signing",Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(Wt){return Wt}static getUrl(Wt,Gt){return logger$d.throwError("not implemented; sub-classes must override getUrl",Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const logger$c=new Logger(version$7),defaultApiKey$2="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class AlchemyWebSocketProvider extends WebSocketProvider{constructor(Wt,Gt){const Yt=new AlchemyProvider(Wt,Gt),Xt=Yt.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(Xt,Yt.network),defineReadOnly(this,"apiKey",Yt.apiKey)}isCommunityResource(){return this.apiKey===defaultApiKey$2}}class AlchemyProvider extends UrlJsonRpcProvider{static getWebSocketProvider(Wt,Gt){return new AlchemyWebSocketProvider(Wt,Gt)}static getApiKey(Wt){return Wt==null?defaultApiKey$2:(Wt&&typeof Wt!="string"&&logger$c.throwArgumentError("invalid apiKey","apiKey",Wt),Wt)}static getUrl(Wt,Gt){let Yt=null;switch(Wt.name){case"homestead":Yt="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":Yt="eth-goerli.g.alchemy.com/v2/";break;case"matic":Yt="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":Yt="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":Yt="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":Yt="arb-goerli.g.alchemy.com/v2/";break;case"optimism":Yt="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":Yt="opt-goerli.g.alchemy.com/v2/";break;default:logger$c.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+Yt+Gt,throttleCallback:(Xt,Jt)=>(Gt===defaultApiKey$2&&showThrottleMessage(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===defaultApiKey$2}}const logger$b=new Logger(version$7),defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost(Bt){switch(Bt){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return logger$b.throwArgumentError("unsupported network","name",Bt)}class AnkrProvider extends UrlJsonRpcProvider{isCommunityResource(){return this.apiKey===defaultApiKey$1}static getApiKey(Wt){return Wt??defaultApiKey$1}static getUrl(Wt,Gt){Gt==null&&(Gt=defaultApiKey$1);const Yt={allowGzip:!0,url:"https://"+getHost(Wt.name)+Gt,throttleCallback:(Xt,Jt)=>(Gt.apiKey===defaultApiKey$1&&showThrottleMessage(),Promise.resolve(!0))};return Gt.projectSecret!=null&&(Yt.user="",Yt.password=Gt.projectSecret),Yt}}var __awaiter$k=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$a=new Logger(version$7);class CloudflareProvider extends UrlJsonRpcProvider{static getApiKey(Wt){return Wt!=null&&logger$a.throwArgumentError("apiKey not supported for cloudflare","apiKey",Wt),null}static getUrl(Wt,Gt){let Yt=null;switch(Wt.name){case"homestead":Yt="https://cloudflare-eth.com/";break;default:logger$a.throwArgumentError("unsupported network","network",arguments[0])}return Yt}perform(Wt,Gt){const Yt=Object.create(null,{perform:{get:()=>super.perform}});return __awaiter$k(this,void 0,void 0,function*(){return Wt==="getBlockNumber"?(yield Yt.perform.call(this,"getBlock",{blockTag:"latest"})).number:Yt.perform.call(this,Wt,Gt)})}}var __awaiter$j=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$9=new Logger(version$7);function getTransactionPostData(Bt){const Wt={};for(let Gt in Bt){if(Bt[Gt]==null)continue;let Yt=Bt[Gt];Gt==="type"&&Yt===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[Gt]?Yt=hexValue(hexlify(Yt)):Gt==="accessList"?Yt="["+accessListify(Yt).map(Xt=>`{address:"${Xt.address}",storageKeys:["${Xt.storageKeys.join('","')}"]}`).join(",")+"]":Yt=hexlify(Yt),Wt[Gt]=Yt)}return Wt}function getResult(Bt){if(Bt.status==0&&(Bt.message==="No records found"||Bt.message==="No transactions found"))return Bt.result;if(Bt.status!=1||typeof Bt.message!="string"||!Bt.message.match(/^OK/)){const Wt=new Error("invalid response");throw Wt.result=JSON.stringify(Bt),(Bt.result||"").toLowerCase().indexOf("rate limit")>=0&&(Wt.throttleRetry=!0),Wt}return Bt.result}function getJsonResult(Bt){if(Bt&&Bt.status==0&&Bt.message=="NOTOK"&&(Bt.result||"").toLowerCase().indexOf("rate limit")>=0){const Wt=new Error("throttled response");throw Wt.result=JSON.stringify(Bt),Wt.throttleRetry=!0,Wt}if(Bt.jsonrpc!="2.0"){const Wt=new Error("invalid response");throw Wt.result=JSON.stringify(Bt),Wt}if(Bt.error){const Wt=new Error(Bt.error.message||"unknown error");throw Bt.error.code&&(Wt.code=Bt.error.code),Bt.error.data&&(Wt.data=Bt.error.data),Wt}return Bt.result}function checkLogTag(Bt){if(Bt==="pending")throw new Error("pending not supported");return Bt==="latest"?Bt:parseInt(Bt.substring(2),16)}function checkError(Bt,Wt,Gt){if(Bt==="call"&&Wt.code===Logger.errors.SERVER_ERROR){const Xt=Wt.error;if(Xt&&(Xt.message.match(/reverted/i)||Xt.message.match(/VM execution error/i))){let Jt=Xt.data;if(Jt&&(Jt="0x"+Jt.replace(/^.*0x/i,"")),isHexString(Jt))return Jt;logger$9.throwError("missing revert data in call exception",Logger.errors.CALL_EXCEPTION,{error:Wt,data:"0x"})}}let Yt=Wt.message;throw Wt.code===Logger.errors.SERVER_ERROR&&(Wt.error&&typeof Wt.error.message=="string"?Yt=Wt.error.message:typeof Wt.body=="string"?Yt=Wt.body:typeof Wt.responseText=="string"&&(Yt=Wt.responseText)),Yt=(Yt||"").toLowerCase(),Yt.match(/insufficient funds/)&&logger$9.throwError("insufficient funds for intrinsic transaction cost",Logger.errors.INSUFFICIENT_FUNDS,{error:Wt,method:Bt,transaction:Gt}),Yt.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&logger$9.throwError("nonce has already been used",Logger.errors.NONCE_EXPIRED,{error:Wt,method:Bt,transaction:Gt}),Yt.match(/another transaction with same nonce/)&&logger$9.throwError("replacement fee too low",Logger.errors.REPLACEMENT_UNDERPRICED,{error:Wt,method:Bt,transaction:Gt}),Yt.match(/execution failed due to an exception|execution reverted/)&&logger$9.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:Wt,method:Bt,transaction:Gt}),Wt}class EtherscanProvider extends BaseProvider{constructor(Wt,Gt){super(Wt),defineReadOnly(this,"baseUrl",this.getBaseUrl()),defineReadOnly(this,"apiKey",Gt||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return logger$9.throwArgumentError("unsupported network","network",this.network.name)}getUrl(Wt,Gt){const Yt=Object.keys(Gt).reduce((Jt,Zt)=>{const Qt=Gt[Zt];return Qt!=null&&(Jt+=`&${Zt}=${Qt}`),Jt},""),Xt=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${Wt}${Yt}${Xt}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(Wt,Gt){return Gt.module=Wt,Gt.apikey=this.apiKey,Gt}fetch(Wt,Gt,Yt){return __awaiter$j(this,void 0,void 0,function*(){const Xt=Yt?this.getPostUrl():this.getUrl(Wt,Gt),Jt=Yt?this.getPostData(Wt,Gt):null,Zt=Wt==="proxy"?getJsonResult:getResult;this.emit("debug",{action:"request",request:Xt,provider:this});const Qt={url:Xt,throttleSlotInterval:1e3,throttleCallback:($r,Ar)=>(this.isCommunityResource()&&showThrottleMessage(),Promise.resolve(!0))};let ur=null;Jt&&(Qt.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},ur=Object.keys(Jt).map($r=>`${$r}=${Jt[$r]}`).join("&"));const cr=yield fetchJson(Qt,ur,Zt||getJsonResult);return this.emit("debug",{action:"response",request:Xt,response:deepCopy(cr),provider:this}),cr})}detectNetwork(){return __awaiter$j(this,void 0,void 0,function*(){return this.network})}perform(Wt,Gt){const Yt=Object.create(null,{perform:{get:()=>super.perform}});return __awaiter$j(this,void 0,void 0,function*(){switch(Wt){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:Gt.address,tag:Gt.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:Gt.address,tag:Gt.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:Gt.address,tag:Gt.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:Gt.address,position:Gt.position,tag:Gt.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:Gt.signedTransaction},!0).catch(Xt=>checkError("sendTransaction",Xt,Gt.signedTransaction));case"getBlock":if(Gt.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:Gt.blockTag,boolean:Gt.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:Gt.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:Gt.transactionHash});case"call":{if(Gt.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const Xt=getTransactionPostData(Gt.transaction);Xt.module="proxy",Xt.action="eth_call";try{return yield this.fetch("proxy",Xt,!0)}catch(Jt){return checkError("call",Jt,Gt.transaction)}}case"estimateGas":{const Xt=getTransactionPostData(Gt.transaction);Xt.module="proxy",Xt.action="eth_estimateGas";try{return yield this.fetch("proxy",Xt,!0)}catch(Jt){return checkError("estimateGas",Jt,Gt.transaction)}}case"getLogs":{const Xt={action:"getLogs"};if(Gt.filter.fromBlock&&(Xt.fromBlock=checkLogTag(Gt.filter.fromBlock)),Gt.filter.toBlock&&(Xt.toBlock=checkLogTag(Gt.filter.toBlock)),Gt.filter.address&&(Xt.address=Gt.filter.address),Gt.filter.topics&&Gt.filter.topics.length>0&&(Gt.filter.topics.length>1&&logger$9.throwError("unsupported topic count",Logger.errors.UNSUPPORTED_OPERATION,{topics:Gt.filter.topics}),Gt.filter.topics.length===1)){const Qt=Gt.filter.topics[0];(typeof Qt!="string"||Qt.length!==66)&&logger$9.throwError("unsupported topic format",Logger.errors.UNSUPPORTED_OPERATION,{topic0:Qt}),Xt.topic0=Qt}const Jt=yield this.fetch("logs",Xt);let Zt={};for(let Qt=0;Qt<Jt.length;Qt++){const ur=Jt[Qt];if(ur.blockHash==null){if(Zt[ur.blockNumber]==null){const cr=yield this.getBlock(ur.blockNumber);cr&&(Zt[ur.blockNumber]=cr.hash)}ur.blockHash=Zt[ur.blockNumber]}}return Jt}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return Yt.perform.call(this,Wt,Gt)})}getHistory(Wt,Gt,Yt){return __awaiter$j(this,void 0,void 0,function*(){const Xt={action:"txlist",address:yield this.resolveName(Wt),startblock:Gt??0,endblock:Yt??99999999,sort:"asc"};return(yield this.fetch("account",Xt)).map(Zt=>{["contractAddress","to"].forEach(function(ur){Zt[ur]==""&&delete Zt[ur]}),Zt.creates==null&&Zt.contractAddress!=null&&(Zt.creates=Zt.contractAddress);const Qt=this.formatter.transactionResponse(Zt);return Zt.timeStamp&&(Qt.timestamp=parseInt(Zt.timeStamp)),Qt})})}isCommunityResource(){return this.apiKey==null}}var __awaiter$i=globalThis&&globalThis.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};const logger$8=new Logger(version$7);function now$2(){return new Date().getTime()}function checkNetworks(Bt){let Wt=null;for(let Gt=0;Gt<Bt.length;Gt++){const Yt=Bt[Gt];if(Yt==null)return null;Wt?Wt.name===Yt.name&&Wt.chainId===Yt.chainId&&(Wt.ensAddress===Yt.ensAddress||Wt.ensAddress==null&&Yt.ensAddress==null)||logger$8.throwArgumentError("provider mismatch","networks",Bt):Wt=Yt}return Wt}function median(Bt,Wt){Bt=Bt.slice().sort();const Gt=Math.floor(Bt.length/2);if(Bt.length%2)return Bt[Gt];const Yt=Bt[Gt-1],Xt=Bt[Gt];return Wt!=null&&Math.abs(Yt-Xt)>Wt?null:(Yt+Xt)/2}function serialize$1(Bt){if(Bt===null)return"null";if(typeof Bt=="number"||typeof Bt=="boolean")return JSON.stringify(Bt);if(typeof Bt=="string")return Bt;if(BigNumber.isBigNumber(Bt))return Bt.toString();if(Array.isArray(Bt))return JSON.stringify(Bt.map(Wt=>serialize$1(Wt)));if(typeof Bt=="object"){const Wt=Object.keys(Bt);return Wt.sort(),"{"+Wt.map(Gt=>{let Yt=Bt[Gt];return typeof Yt=="function"?Yt="[function]":Yt=serialize$1(Yt),JSON.stringify(Gt)+":"+Yt}).join(",")+"}"}throw new Error("unknown value type: "+typeof Bt)}let nextRid=1;function stall(Bt){let Wt=null,Gt=null,Yt=new Promise(Zt=>{Wt=function(){Gt&&(clearTimeout(Gt),Gt=null),Zt()},Gt=setTimeout(Wt,Bt)});const Xt=Zt=>(Yt=Yt.then(Zt),Yt);function Jt(){return Yt}return{cancel:Wt,getPromise:Jt,wait:Xt}}const ForwardErrors=[Logger.errors.CALL_EXCEPTION,Logger.errors.INSUFFICIENT_FUNDS,Logger.errors.NONCE_EXPIRED,Logger.errors.REPLACEMENT_UNDERPRICED,Logger.errors.UNPREDICTABLE_GAS_LIMIT],ForwardProperties=["address","args","errorArgs","errorSignature","method","transaction"];function exposeDebugConfig(Bt,Wt){const Gt={weight:Bt.weight};return Object.defineProperty(Gt,"provider",{get:()=>Bt.provider}),Bt.start&&(Gt.start=Bt.start),Wt&&(Gt.duration=Wt-Bt.start),Bt.done&&(Bt.error?Gt.error=Bt.error:Gt.result=Bt.result||null),Gt}function normalizedTally(Bt,Wt){return function(Gt){const Yt={};Gt.forEach(Jt=>{const Zt=Bt(Jt.result);Yt[Zt]||(Yt[Zt]={count:0,result:Jt.result}),Yt[Zt].count++});const Xt=Object.keys(Yt);for(let Jt=0;Jt<Xt.length;Jt++){const Zt=Yt[Xt[Jt]];if(Zt.count>=Wt)return Zt.result}}}function getProcessFunc(Bt,Wt,Gt){let Yt=serialize$1;switch(Wt){case"getBlockNumber":return function(Xt){const Jt=Xt.map(Qt=>Qt.result);let Zt=median(Xt.map(Qt=>Qt.result),2);if(Zt!=null)return Zt=Math.ceil(Zt),Jt.indexOf(Zt+1)>=0&&Zt++,Zt>=Bt._highestBlockNumber&&(Bt._highestBlockNumber=Zt),Bt._highestBlockNumber};case"getGasPrice":return function(Xt){const Jt=Xt.map(Zt=>Zt.result);return Jt.sort(),Jt[Math.floor(Jt.length/2)]};case"getEtherPrice":return function(Xt){return median(Xt.map(Jt=>Jt.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":Yt=function(Xt){return Xt==null?null:(Xt=shallowCopy(Xt),Xt.confirmations=-1,serialize$1(Xt))};break;case"getBlock":Gt.includeTransactions?Yt=function(Xt){return Xt==null?null:(Xt=shallowCopy(Xt),Xt.transactions=Xt.transactions.map(Jt=>(Jt=shallowCopy(Jt),Jt.confirmations=-1,Jt)),serialize$1(Xt))}:Yt=function(Xt){return Xt==null?null:serialize$1(Xt)};break;default:throw new Error("unknown method: "+Wt)}return normalizedTally(Yt,Bt.quorum)}function waitForSync(Bt,Wt){return __awaiter$i(this,void 0,void 0,function*(){const Gt=Bt.provider;return Gt.blockNumber!=null&&Gt.blockNumber>=Wt||Wt===-1?Gt:poll(()=>new Promise((Yt,Xt)=>{setTimeout(function(){return Gt.blockNumber>=Wt?Yt(Gt):Bt.cancelled?Yt(null):Yt(void 0)},0)}),{oncePoll:Gt})})}function getRunner(Bt,Wt,Gt,Yt){return __awaiter$i(this,void 0,void 0,function*(){let Xt=Bt.provider;switch(Gt){case"getBlockNumber":case"getGasPrice":return Xt[Gt]();case"getEtherPrice":if(Xt.getEtherPrice)return Xt.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return Yt.blockTag&&isHexString(Yt.blockTag)&&(Xt=yield waitForSync(Bt,Wt)),Xt[Gt](Yt.address,Yt.blockTag||"latest");case"getStorageAt":return Yt.blockTag&&isHexString(Yt.blockTag)&&(Xt=yield waitForSync(Bt,Wt)),Xt.getStorageAt(Yt.address,Yt.position,Yt.blockTag||"latest");case"getBlock":return Yt.blockTag&&isHexString(Yt.blockTag)&&(Xt=yield waitForSync(Bt,Wt)),Xt[Yt.includeTransactions?"getBlockWithTransactions":"getBlock"](Yt.blockTag||Yt.blockHash);case"call":case"estimateGas":return Yt.blockTag&&isHexString(Yt.blockTag)&&(Xt=yield waitForSync(Bt,Wt)),Gt==="call"&&Yt.blockTag?Xt[Gt](Yt.transaction,Yt.blockTag):Xt[Gt](Yt.transaction);case"getTransaction":case"getTransactionReceipt":return Xt[Gt](Yt.transactionHash);case"getLogs":{let Jt=Yt.filter;return(Jt.fromBlock&&isHexString(Jt.fromBlock)||Jt.toBlock&&isHexString(Jt.toBlock))&&(Xt=yield waitForSync(Bt,Wt)),Xt.getLogs(Jt)}}return logger$8.throwError("unknown method error",Logger.errors.UNKNOWN_ERROR,{method:Gt,params:Yt})})}class FallbackProvider extends BaseProvider{constructor(Wt,Gt){Wt.length===0&&logger$8.throwArgumentError("missing providers","providers",Wt);const Yt=Wt.map((Zt,Qt)=>{if(Provider.isProvider(Zt)){const $r=isCommunityResource(Zt)?2e3:750;return Object.freeze({provider:Zt,weight:1,stallTimeout:$r,priority:1})}const ur=shallowCopy(Zt);ur.priority==null&&(ur.priority=1),ur.stallTimeout==null&&(ur.stallTimeout=isCommunityResource(Zt)?2e3:750),ur.weight==null&&(ur.weight=1);const cr=ur.weight;return(cr%1||cr>512||cr<1)&&logger$8.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${Qt}].weight`,cr),Object.freeze(ur)}),Xt=Yt.reduce((Zt,Qt)=>Zt+Qt.weight,0);Gt==null?Gt=Xt/2:Gt>Xt&&logger$8.throwArgumentError("quorum will always fail; larger than total weight","quorum",Gt);let Jt=checkNetworks(Yt.map(Zt=>Zt.provider.network));Jt==null&&(Jt=new Promise((Zt,Qt)=>{setTimeout(()=>{this.detectNetwork().then(Zt,Qt)},0)})),super(Jt),defineReadOnly(this,"providerConfigs",Object.freeze(Yt)),defineReadOnly(this,"quorum",Gt),this._highestBlockNumber=-1}detectNetwork(){return __awaiter$i(this,void 0,void 0,function*(){const Wt=yield Promise.all(this.providerConfigs.map(Gt=>Gt.provider.getNetwork()));return checkNetworks(Wt)})}perform(Wt,Gt){return __awaiter$i(this,void 0,void 0,function*(){if(Wt==="sendTransaction"){const ur=yield Promise.all(this.providerConfigs.map(cr=>cr.provider.sendTransaction(Gt.signedTransaction).then($r=>$r.hash,$r=>$r)));for(let cr=0;cr<ur.length;cr++){const $r=ur[cr];if(typeof $r=="string")return $r}throw ur[0]}this._highestBlockNumber===-1&&Wt!=="getBlockNumber"&&(yield this.getBlockNumber());const Yt=getProcessFunc(this,Wt,Gt),Xt=shuffled(this.providerConfigs.map(shallowCopy));Xt.sort((ur,cr)=>ur.priority-cr.priority);const Jt=this._highestBlockNumber;let Zt=0,Qt=!0;for(;;){const ur=now$2();let cr=Xt.filter(qr=>qr.runner&&ur-qr.start<qr.stallTimeout).reduce((qr,Fr)=>qr+Fr.weight,0);for(;cr<this.quorum&&Zt<Xt.length;){const qr=Xt[Zt++],Fr=nextRid++;qr.start=now$2(),qr.staller=stall(qr.stallTimeout),qr.staller.wait(()=>{qr.staller=null}),qr.runner=getRunner(qr,Jt,Wt,Gt).then(Hr=>{qr.done=!0,qr.result=Hr,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:Fr,backend:exposeDebugConfig(qr,now$2()),request:{method:Wt,params:deepCopy(Gt)},provider:this})},Hr=>{qr.done=!0,qr.error=Hr,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:Fr,backend:exposeDebugConfig(qr,now$2()),request:{method:Wt,params:deepCopy(Gt)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:Fr,backend:exposeDebugConfig(qr,null),request:{method:Wt,params:deepCopy(Gt)},provider:this}),cr+=qr.weight}const $r=[];Xt.forEach(qr=>{qr.done||!qr.runner||($r.push(qr.runner),qr.staller&&$r.push(qr.staller.getPromise()))}),$r.length&&(yield Promise.race($r));const Ar=Xt.filter(qr=>qr.done&&qr.error==null);if(Ar.length>=this.quorum){const qr=Yt(Ar);if(qr!==void 0)return Xt.forEach(Fr=>{Fr.staller&&Fr.staller.cancel(),Fr.cancelled=!0}),qr;Qt||(yield stall(100).getPromise()),Qt=!1}const Lr=Xt.reduce((qr,Fr)=>{if(!Fr.done||Fr.error==null)return qr;const Hr=Fr.error.code;return ForwardErrors.indexOf(Hr)>=0&&(qr[Hr]||(qr[Hr]={error:Fr.error,weight:0}),qr[Hr].weight+=Fr.weight),qr},{});if(Object.keys(Lr).forEach(qr=>{const Fr=Lr[qr];if(Fr.weight<this.quorum)return;Xt.forEach(Wr=>{Wr.staller&&Wr.staller.cancel(),Wr.cancelled=!0});const Hr=Fr.error,Br={};ForwardProperties.forEach(Wr=>{Hr[Wr]!=null&&(Br[Wr]=Hr[Wr])}),logger$8.throwError(Hr.reason||Hr.message,qr,Br)}),Xt.filter(qr=>!qr.done).length===0)break}return Xt.forEach(ur=>{ur.staller&&ur.staller.cancel(),ur.cancelled=!0}),logger$8.throwError("failed to meet quorum",Logger.errors.SERVER_ERROR,{method:Wt,params:Gt,results:Xt.map(ur=>exposeDebugConfig(ur)),provider:this})})}}const IpcProvider=null,logger$7=new Logger(version$7),defaultProjectId="84842078b09946638c03157f83405213";class InfuraWebSocketProvider extends WebSocketProvider{constructor(Wt,Gt){const Yt=new InfuraProvider(Wt,Gt),Xt=Yt.connection;Xt.password&&logger$7.throwError("INFURA WebSocket project secrets unsupported",Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const Jt=Xt.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(Jt,Wt),defineReadOnly(this,"apiKey",Yt.projectId),defineReadOnly(this,"projectId",Yt.projectId),defineReadOnly(this,"projectSecret",Yt.projectSecret)}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends UrlJsonRpcProvider{static getWebSocketProvider(Wt,Gt){return new InfuraWebSocketProvider(Wt,Gt)}static getApiKey(Wt){const Gt={apiKey:defaultProjectId,projectId:defaultProjectId,projectSecret:null};return Wt==null||(typeof Wt=="string"?Gt.projectId=Wt:Wt.projectSecret!=null?(logger$7.assertArgument(typeof Wt.projectId=="string","projectSecret requires a projectId","projectId",Wt.projectId),logger$7.assertArgument(typeof Wt.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),Gt.projectId=Wt.projectId,Gt.projectSecret=Wt.projectSecret):Wt.projectId&&(Gt.projectId=Wt.projectId),Gt.apiKey=Gt.projectId),Gt}static getUrl(Wt,Gt){let Yt=null;switch(Wt?Wt.name:"unknown"){case"homestead":Yt="mainnet.infura.io";break;case"goerli":Yt="goerli.infura.io";break;case"sepolia":Yt="sepolia.infura.io";break;case"matic":Yt="polygon-mainnet.infura.io";break;case"maticmum":Yt="polygon-mumbai.infura.io";break;case"optimism":Yt="optimism-mainnet.infura.io";break;case"optimism-goerli":Yt="optimism-goerli.infura.io";break;case"arbitrum":Yt="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":Yt="arbitrum-goerli.infura.io";break;default:logger$7.throwError("unsupported network",Logger.errors.INVALID_ARGUMENT,{argument:"network",value:Wt})}const Xt={allowGzip:!0,url:"https://"+Yt+"/v3/"+Gt.projectId,throttleCallback:(Jt,Zt)=>(Gt.projectId===defaultProjectId&&showThrottleMessage(),Promise.resolve(!0))};return Gt.projectSecret!=null&&(Xt.user="",Xt.password=Gt.projectSecret),Xt}isCommunityResource(){return this.projectId===defaultProjectId}}class JsonRpcBatchProvider extends JsonRpcProvider{send(Wt,Gt){const Yt={method:Wt,params:Gt,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);const Xt={request:Yt,resolve:null,reject:null},Jt=new Promise((Zt,Qt)=>{Xt.resolve=Zt,Xt.reject=Qt});return this._pendingBatch.push(Xt),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const Zt=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const Qt=Zt.map(ur=>ur.request);return this.emit("debug",{action:"requestBatch",request:deepCopy(Qt),provider:this}),fetchJson(this.connection,JSON.stringify(Qt)).then(ur=>{this.emit("debug",{action:"response",request:Qt,response:ur,provider:this}),Zt.forEach((cr,$r)=>{const Ar=ur[$r];if(Ar.error){const Lr=new Error(Ar.error.message);Lr.code=Ar.error.code,Lr.data=Ar.error.data,cr.reject(Lr)}else cr.resolve(Ar.result)})},ur=>{this.emit("debug",{action:"response",error:ur,request:Qt,provider:this}),Zt.forEach(cr=>{cr.reject(ur)})})},10)),Jt}}const logger$6=new Logger(version$7),defaultApiKey="ETHERS_JS_SHARED";class NodesmithProvider extends UrlJsonRpcProvider{static getApiKey(Wt){return Wt&&typeof Wt!="string"&&logger$6.throwArgumentError("invalid apiKey","apiKey",Wt),Wt||defaultApiKey}static getUrl(Wt,Gt){logger$6.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let Yt=null;switch(Wt.name){case"homestead":Yt="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":Yt="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":Yt="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":Yt="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":Yt="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:logger$6.throwArgumentError("unsupported network","network",arguments[0])}return Yt+"?apiKey="+Gt}}const logger$5=new Logger(version$7),defaultApplicationId="62e1ad51b37b8e00394bda3b";class PocketProvider extends UrlJsonRpcProvider{static getApiKey(Wt){const Gt={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return Wt==null?Gt.applicationId=defaultApplicationId:typeof Wt=="string"?Gt.applicationId=Wt:Wt.applicationSecretKey!=null?(Gt.applicationId=Wt.applicationId,Gt.applicationSecretKey=Wt.applicationSecretKey):Wt.applicationId?Gt.applicationId=Wt.applicationId:logger$5.throwArgumentError("unsupported PocketProvider apiKey","apiKey",Wt),Gt}static getUrl(Wt,Gt){let Yt=null;switch(Wt?Wt.name:"unknown"){case"goerli":Yt="eth-goerli.gateway.pokt.network";break;case"homestead":Yt="eth-mainnet.gateway.pokt.network";break;case"kovan":Yt="poa-kovan.gateway.pokt.network";break;case"matic":Yt="poly-mainnet.gateway.pokt.network";break;case"maticmum":Yt="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":Yt="eth-rinkeby.gateway.pokt.network";break;case"ropsten":Yt="eth-ropsten.gateway.pokt.network";break;default:logger$5.throwError("unsupported network",Logger.errors.INVALID_ARGUMENT,{argument:"network",value:Wt})}const Xt=`https://${Yt}/v1/lb/${Gt.applicationId}`,Jt={headers:{},url:Xt};return Gt.applicationSecretKey!=null&&(Jt.user="",Jt.password=Gt.applicationSecretKey),Jt}isCommunityResource(){return this.applicationId===defaultApplicationId}}const logger$4=new Logger(version$7);let _nextId=1;function buildWeb3LegacyFetcher(Bt,Wt){const Gt="Web3LegacyFetcher";return function(Yt,Xt){const Jt={method:Yt,params:Xt,id:_nextId++,jsonrpc:"2.0"};return new Promise((Zt,Qt)=>{this.emit("debug",{action:"request",fetcher:Gt,request:deepCopy(Jt),provider:this}),Wt(Jt,(ur,cr)=>{if(ur)return this.emit("debug",{action:"response",fetcher:Gt,error:ur,request:Jt,provider:this}),Qt(ur);if(this.emit("debug",{action:"response",fetcher:Gt,request:Jt,response:cr,provider:this}),cr.error){const $r=new Error(cr.error.message);return $r.code=cr.error.code,$r.data=cr.error.data,Qt($r)}Zt(cr.result)})})}}function buildEip1193Fetcher(Bt){return function(Wt,Gt){Gt==null&&(Gt=[]);const Yt={method:Wt,params:Gt};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy(Yt),provider:this}),Bt.request(Yt).then(Xt=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:Yt,response:Xt,provider:this}),Xt),Xt=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:Yt,error:Xt,provider:this}),Xt})}}class Web3Provider extends JsonRpcProvider{constructor(Wt,Gt){Wt==null&&logger$4.throwArgumentError("missing provider","provider",Wt);let Yt=null,Xt=null,Jt=null;typeof Wt=="function"?(Yt="unknown:",Xt=Wt):(Yt=Wt.host||Wt.path||"",!Yt&&Wt.isMetaMask&&(Yt="metamask"),Jt=Wt,Wt.request?(Yt===""&&(Yt="eip-1193:"),Xt=buildEip1193Fetcher(Wt)):Wt.sendAsync?Xt=buildWeb3LegacyFetcher(Wt,Wt.sendAsync.bind(Wt)):Wt.send?Xt=buildWeb3LegacyFetcher(Wt,Wt.send.bind(Wt)):logger$4.throwArgumentError("unsupported provider","provider",Wt),Yt||(Yt="unknown:")),super(Yt,Gt),defineReadOnly(this,"jsonRpcFetchFunc",Xt),defineReadOnly(this,"provider",Jt)}send(Wt,Gt){return this.jsonRpcFetchFunc(Wt,Gt)}}const logger$3=new Logger(version$7);function getDefaultProvider(Bt,Wt){if(Bt==null&&(Bt="homestead"),typeof Bt=="string"){const Yt=Bt.match(/^(ws|http)s?:/i);if(Yt)switch(Yt[1].toLowerCase()){case"http":case"https":return new JsonRpcProvider(Bt);case"ws":case"wss":return new WebSocketProvider(Bt);default:logger$3.throwArgumentError("unsupported URL scheme","network",Bt)}}const Gt=getNetwork(Bt);return(!Gt||!Gt._defaultProvider)&&logger$3.throwError("unsupported getDefaultProvider network",Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:Bt}),Gt._defaultProvider({FallbackProvider,AlchemyProvider,AnkrProvider,CloudflareProvider,EtherscanProvider,InfuraProvider,JsonRpcProvider,NodesmithProvider,PocketProvider,Web3Provider,IpcProvider},Wt)}const index$1=Object.freeze(Object.defineProperty({__proto__:null,AlchemyProvider,AlchemyWebSocketProvider,AnkrProvider,BaseProvider,CloudflareProvider,EtherscanProvider,FallbackProvider,Formatter,InfuraProvider,InfuraWebSocketProvider,IpcProvider,JsonRpcBatchProvider,JsonRpcProvider,JsonRpcSigner,NodesmithProvider,PocketProvider,Provider,Resolver,StaticJsonRpcProvider,UrlJsonRpcProvider,Web3Provider,WebSocketProvider,getDefaultProvider,getNetwork,isCommunityResourcable,isCommunityResource,showThrottleMessage},Symbol.toStringTag,{value:"Module"})),version$5="solidity/5.7.0",regexBytes=new RegExp("^bytes([0-9]+)$"),regexNumber=new RegExp("^(u?int)([0-9]*)$"),regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$"),Zeros="0000000000000000000000000000000000000000000000000000000000000000",logger$2=new Logger(version$5);function _pack(Bt,Wt,Gt){switch(Bt){case"address":return Gt?zeroPad(Wt,32):arrayify(Wt);case"string":return toUtf8Bytes(Wt);case"bytes":return arrayify(Wt);case"bool":return Wt=Wt?"0x01":"0x00",Gt?zeroPad(Wt,32):arrayify(Wt)}let Yt=Bt.match(regexNumber);if(Yt){let Xt=parseInt(Yt[2]||"256");return(Yt[2]&&String(Xt)!==Yt[2]||Xt%8!==0||Xt===0||Xt>256)&&logger$2.throwArgumentError("invalid number type","type",Bt),Gt&&(Xt=256),Wt=BigNumber.from(Wt).toTwos(Xt),zeroPad(Wt,Xt/8)}if(Yt=Bt.match(regexBytes),Yt){const Xt=parseInt(Yt[1]);return(String(Xt)!==Yt[1]||Xt===0||Xt>32)&&logger$2.throwArgumentError("invalid bytes type","type",Bt),arrayify(Wt).byteLength!==Xt&&logger$2.throwArgumentError(`invalid value for ${Bt}`,"value",Wt),Gt?arrayify((Wt+Zeros).substring(0,66)):Wt}if(Yt=Bt.match(regexArray),Yt&&Array.isArray(Wt)){const Xt=Yt[1];parseInt(Yt[2]||String(Wt.length))!=Wt.length&&logger$2.throwArgumentError(`invalid array length for ${Bt}`,"value",Wt);const Zt=[];return Wt.forEach(function(Qt){Zt.push(_pack(Xt,Qt,!0))}),concat$2(Zt)}return logger$2.throwArgumentError("invalid type","type",Bt)}function pack(Bt,Wt){Bt.length!=Wt.length&&logger$2.throwArgumentError("wrong number of values; expected ${ types.length }","values",Wt);const Gt=[];return Bt.forEach(function(Yt,Xt){Gt.push(_pack(Yt,Wt[Xt]))}),hexlify(concat$2(Gt))}function keccak256(Bt,Wt){return keccak256$1(pack(Bt,Wt))}function sha256$1(Bt,Wt){return sha256$2(pack(Bt,Wt))}const version$4="units/5.7.0",logger$1=new Logger(version$4),names$3=["wei","kwei","mwei","gwei","szabo","finney","ether"];function commify(Bt){const Wt=String(Bt).split(".");(Wt.length>2||!Wt[0].match(/^-?[0-9]*$/)||Wt[1]&&!Wt[1].match(/^[0-9]*$/)||Bt==="."||Bt==="-.")&&logger$1.throwArgumentError("invalid value","value",Bt);let Gt=Wt[0],Yt="";for(Gt.substring(0,1)==="-"&&(Yt="-",Gt=Gt.substring(1));Gt.substring(0,1)==="0";)Gt=Gt.substring(1);Gt===""&&(Gt="0");let Xt="";for(Wt.length===2&&(Xt="."+(Wt[1]||"0"));Xt.length>2&&Xt[Xt.length-1]==="0";)Xt=Xt.substring(0,Xt.length-1);const Jt=[];for(;Gt.length;)if(Gt.length<=3){Jt.unshift(Gt);break}else{const Zt=Gt.length-3;Jt.unshift(Gt.substring(Zt)),Gt=Gt.substring(0,Zt)}return Yt+Jt.join(",")+Xt}function formatUnits(Bt,Wt){if(typeof Wt=="string"){const Gt=names$3.indexOf(Wt);Gt!==-1&&(Wt=3*Gt)}return formatFixed(Bt,Wt??18)}function parseUnits(Bt,Wt){if(typeof Bt!="string"&&logger$1.throwArgumentError("value must be a string","value",Bt),typeof Wt=="string"){const Gt=names$3.indexOf(Wt);Gt!==-1&&(Wt=3*Gt)}return parseFixed(Bt,Wt??18)}function formatEther(Bt){return formatUnits(Bt,18)}function parseEther(Bt){return parseUnits(Bt,18)}const utils$r=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder,ConstructorFragment,ErrorFragment,EventFragment,FormatTypes,Fragment,FunctionFragment,HDNode,Indexed,Interface,LogDescription,Logger,ParamType,RLP:index$4,SigningKey,get SupportedAlgorithm(){return SupportedAlgorithm},TransactionDescription,get TransactionTypes(){return TransactionTypes},get UnicodeNormalizationForm(){return UnicodeNormalizationForm},Utf8ErrorFuncs,get Utf8ErrorReason(){return Utf8ErrorReason},_TypedDataEncoder:TypedDataEncoder,_fetchData,_toEscapedUtf8String,accessListify,arrayify,base58:Base58,base64:index$2,checkProperties,checkResultErrors,commify,computeAddress:computeAddress$1,computeHmac,computePublicKey,concat:concat$2,deepCopy,defaultAbiCoder,defaultPath,defineReadOnly,dnsEncode,entropyToMnemonic,fetchJson,formatBytes32String,formatEther,formatUnits,getAccountPath,getAddress,getContractAddress,getCreate2Address,getIcapAddress,getJsonWalletAddress,getStatic,hashMessage,hexConcat,hexDataLength,hexDataSlice,hexStripZeros,hexValue,hexZeroPad,hexlify,id,isAddress,isBytes,isBytesLike,isHexString,isValidMnemonic,isValidName,joinSignature,keccak256:keccak256$1,mnemonicToEntropy,mnemonicToSeed,namehash,nameprep,parseBytes32String,parseEther,parseTransaction:parse$i,parseUnits,poll,randomBytes,recoverAddress,recoverPublicKey:recoverPublicKey$1,resolveProperties,ripemd160,serializeTransaction:serialize$2,sha256:sha256$2,sha512,shallowCopy,shuffled,solidityKeccak256:keccak256,solidityPack:pack,soliditySha256:sha256$1,splitSignature,stripZeros,toUtf8Bytes,toUtf8CodePoints,toUtf8String,verifyMessage,verifyTypedData,zeroPad},Symbol.toStringTag,{value:"Module"})),version$3="ethers/5.7.2",logger=new Logger(version$3),ethers=Object.freeze(Object.defineProperty({__proto__:null,BaseContract,BigNumber,Contract,ContractFactory,FixedNumber,Signer:Signer$2,VoidSigner,Wallet:Wallet$1,Wordlist,constants:index$3,get errors(){return ErrorCode},getDefaultProvider,logger,providers:index$1,utils:utils$r,version:version$3,wordlists},Symbol.toStringTag,{value:"Module"}));try{const Bt=window;Bt._ethers==null&&(Bt._ethers=ethers)}catch{}const lib_esm=Object.freeze(Object.defineProperty({__proto__:null,BaseContract,BigNumber,Contract,ContractFactory,FixedNumber,Signer:Signer$2,VoidSigner,Wallet:Wallet$1,Wordlist,constants:index$3,get errors(){return ErrorCode},ethers,getDefaultProvider,logger,providers:index$1,utils:utils$r,version:version$3,wordlists},Symbol.toStringTag,{value:"Module"})),require$$0$5=getAugmentedNamespace(lib_esm);var providerType$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ProviderType=void 0;const Wt=validation$6;(function(Gt){Gt.INJECTED="injected",Gt.FORTMATIC="formatic",Gt.NETWORK="network",Gt.WALLET_CONNECT="wallet_connect",Gt.WALLET_CONNECT_V2="wallet_connect_v2",Gt.WALLET_LINK="wallet_link",Gt.METAMASK_MOBILE="metamask_mobile"})(Bt.ProviderType||(Bt.ProviderType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.ProviderType||(Bt.ProviderType={}))})(providerType$3);var chainConfiguration={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getChainConfiguration=Bt.MANA_GRAPH_BY_CHAIN_ID=void 0;const Wt=requireChainId$3(),Gt=providerType$3,Xt=(0,configuration$1.getRpcUrls)(Gt.ProviderType.NETWORK);Bt.MANA_GRAPH_BY_CHAIN_ID={[Wt.ChainId.ETHEREUM_MAINNET]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-ethereum-mainnet",[Wt.ChainId.ETHEREUM_ROPSTEN]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-ethereum-ropsten",[Wt.ChainId.ETHEREUM_GOERLI]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-ethereum-goerli",[Wt.ChainId.ETHEREUM_RINKEBY]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-ethereum-rinkeby",[Wt.ChainId.ETHEREUM_SEPOLIA]:"https://api.studio.thegraph.com/query/49472/mana-ethereum-sepolia/version/latest",[Wt.ChainId.MATIC_MAINNET]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-matic-mainnet",[Wt.ChainId.MATIC_MUMBAI]:"https://api.thegraph.com/subgraphs/name/decentraland/mana-matic-mumbai"};function Jt(Zt){return{network:(0,Wt.getNetwork)(Zt),manaGraphURL:Bt.MANA_GRAPH_BY_CHAIN_ID[Zt],rpcURL:Xt[Zt],networkMapping:(0,Wt.getNetworkMapping)(Zt)}}Bt.getChainConfiguration=Jt})(chainConfiguration);var utils$q={},MILLISECONDS_IN_MINUTE$2=6e4,getTimezoneOffsetInMilliseconds$2=function(Wt){var Gt=new Date(Wt.getTime()),Yt=Gt.getTimezoneOffset();Gt.setSeconds(0,0);var Xt=Gt.getTime()%MILLISECONDS_IN_MINUTE$2;return Yt*MILLISECONDS_IN_MINUTE$2+Xt};function isDate$6(Bt){return Bt instanceof Date}var is_date=isDate$6,getTimezoneOffsetInMilliseconds$1=getTimezoneOffsetInMilliseconds$2,isDate$5=is_date,MILLISECONDS_IN_HOUR=36e5,MILLISECONDS_IN_MINUTE$1=6e4,DEFAULT_ADDITIONAL_DIGITS=2,parseTokenDateTimeDelimeter=/[T ]/,parseTokenPlainTime=/:/,parseTokenYY=/^(\d{2})$/,parseTokensYYY=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],parseTokenYYYY=/^(\d{4})/,parseTokensYYYYY=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],parseTokenMM=/^-(\d{2})$/,parseTokenDDD=/^-?(\d{3})$/,parseTokenMMDD=/^-?(\d{2})-?(\d{2})$/,parseTokenWww=/^-?W(\d{2})$/,parseTokenWwwD=/^-?W(\d{2})-?(\d{1})$/,parseTokenHH=/^(\d{2}([.,]\d*)?)$/,parseTokenHHMM=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,parseTokenHHMMSS=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,parseTokenTimezone=/([Z+-].*)$/,parseTokenTimezoneZ=/^(Z)$/,parseTokenTimezoneHH=/^([+-])(\d{2})$/,parseTokenTimezoneHHMM=/^([+-])(\d{2}):?(\d{2})$/;function parse$h(Bt,Wt){if(isDate$5(Bt))return new Date(Bt.getTime());if(typeof Bt!="string")return new Date(Bt);var Gt=Wt||{},Yt=Gt.additionalDigits;Yt==null?Yt=DEFAULT_ADDITIONAL_DIGITS:Yt=Number(Yt);var Xt=splitDateString(Bt),Jt=parseYear$1(Xt.date,Yt),Zt=Jt.year,Qt=Jt.restDateString,ur=parseDate(Qt,Zt);if(ur){var cr=ur.getTime(),$r=0,Ar;if(Xt.time&&($r=parseTime(Xt.time)),Xt.timezone)Ar=parseTimezone(Xt.timezone)*MILLISECONDS_IN_MINUTE$1;else{var Lr=cr+$r,qr=new Date(Lr);Ar=getTimezoneOffsetInMilliseconds$1(qr);var Fr=new Date(Lr);Fr.setDate(qr.getDate()+1);var Hr=getTimezoneOffsetInMilliseconds$1(Fr)-getTimezoneOffsetInMilliseconds$1(qr);Hr>0&&(Ar+=Hr)}return new Date(cr+$r+Ar)}else return new Date(Bt)}function splitDateString(Bt){var Wt={},Gt=Bt.split(parseTokenDateTimeDelimeter),Yt;if(parseTokenPlainTime.test(Gt[0])?(Wt.date=null,Yt=Gt[0]):(Wt.date=Gt[0],Yt=Gt[1]),Yt){var Xt=parseTokenTimezone.exec(Yt);Xt?(Wt.time=Yt.replace(Xt[1],""),Wt.timezone=Xt[1]):Wt.time=Yt}return Wt}function parseYear$1(Bt,Wt){var Gt=parseTokensYYY[Wt],Yt=parseTokensYYYYY[Wt],Xt;if(Xt=parseTokenYYYY.exec(Bt)||Yt.exec(Bt),Xt){var Jt=Xt[1];return{year:parseInt(Jt,10),restDateString:Bt.slice(Jt.length)}}if(Xt=parseTokenYY.exec(Bt)||Gt.exec(Bt),Xt){var Zt=Xt[1];return{year:parseInt(Zt,10)*100,restDateString:Bt.slice(Zt.length)}}return{year:null}}function parseDate(Bt,Wt){if(Wt===null)return null;var Gt,Yt,Xt,Jt;if(Bt.length===0)return Yt=new Date(0),Yt.setUTCFullYear(Wt),Yt;if(Gt=parseTokenMM.exec(Bt),Gt)return Yt=new Date(0),Xt=parseInt(Gt[1],10)-1,Yt.setUTCFullYear(Wt,Xt),Yt;if(Gt=parseTokenDDD.exec(Bt),Gt){Yt=new Date(0);var Zt=parseInt(Gt[1],10);return Yt.setUTCFullYear(Wt,0,Zt),Yt}if(Gt=parseTokenMMDD.exec(Bt),Gt){Yt=new Date(0),Xt=parseInt(Gt[1],10)-1;var Qt=parseInt(Gt[2],10);return Yt.setUTCFullYear(Wt,Xt,Qt),Yt}if(Gt=parseTokenWww.exec(Bt),Gt)return Jt=parseInt(Gt[1],10)-1,dayOfISOYear(Wt,Jt);if(Gt=parseTokenWwwD.exec(Bt),Gt){Jt=parseInt(Gt[1],10)-1;var ur=parseInt(Gt[2],10)-1;return dayOfISOYear(Wt,Jt,ur)}return null}function parseTime(Bt){var Wt,Gt,Yt;if(Wt=parseTokenHH.exec(Bt),Wt)return Gt=parseFloat(Wt[1].replace(",",".")),Gt%24*MILLISECONDS_IN_HOUR;if(Wt=parseTokenHHMM.exec(Bt),Wt)return Gt=parseInt(Wt[1],10),Yt=parseFloat(Wt[2].replace(",",".")),Gt%24*MILLISECONDS_IN_HOUR+Yt*MILLISECONDS_IN_MINUTE$1;if(Wt=parseTokenHHMMSS.exec(Bt),Wt){Gt=parseInt(Wt[1],10),Yt=parseInt(Wt[2],10);var Xt=parseFloat(Wt[3].replace(",","."));return Gt%24*MILLISECONDS_IN_HOUR+Yt*MILLISECONDS_IN_MINUTE$1+Xt*1e3}return null}function parseTimezone(Bt){var Wt,Gt;return Wt=parseTokenTimezoneZ.exec(Bt),Wt?0:(Wt=parseTokenTimezoneHH.exec(Bt),Wt?(Gt=parseInt(Wt[2],10)*60,Wt[1]==="+"?-Gt:Gt):(Wt=parseTokenTimezoneHHMM.exec(Bt),Wt?(Gt=parseInt(Wt[2],10)*60+parseInt(Wt[3],10),Wt[1]==="+"?-Gt:Gt):0))}function dayOfISOYear(Bt,Wt,Gt){Wt=Wt||0,Gt=Gt||0;var Yt=new Date(0);Yt.setUTCFullYear(Bt,0,4);var Xt=Yt.getUTCDay()||7,Jt=Wt*7+Gt+1-Xt;return Yt.setUTCDate(Yt.getUTCDate()+Jt),Yt}var parse_1=parse$h,parse$g=parse_1;function startOfYear$1(Bt){var Wt=parse$g(Bt),Gt=new Date(0);return Gt.setFullYear(Wt.getFullYear(),0,1),Gt.setHours(0,0,0,0),Gt}var start_of_year=startOfYear$1,parse$f=parse_1;function startOfDay$3(Bt){var Wt=parse$f(Bt);return Wt.setHours(0,0,0,0),Wt}var start_of_day=startOfDay$3,startOfDay$2=start_of_day,MILLISECONDS_IN_MINUTE=6e4,MILLISECONDS_IN_DAY$1=864e5;function differenceInCalendarDays$1(Bt,Wt){var Gt=startOfDay$2(Bt),Yt=startOfDay$2(Wt),Xt=Gt.getTime()-Gt.getTimezoneOffset()*MILLISECONDS_IN_MINUTE,Jt=Yt.getTime()-Yt.getTimezoneOffset()*MILLISECONDS_IN_MINUTE;return Math.round((Xt-Jt)/MILLISECONDS_IN_DAY$1)}var difference_in_calendar_days=differenceInCalendarDays$1,parse$e=parse_1,startOfYear=start_of_year,differenceInCalendarDays=difference_in_calendar_days;function getDayOfYear$1(Bt){var Wt=parse$e(Bt),Gt=differenceInCalendarDays(Wt,startOfYear(Wt)),Yt=Gt+1;return Yt}var get_day_of_year=getDayOfYear$1,parse$d=parse_1;function startOfWeek$1(Bt,Wt){var Gt=Wt&&Number(Wt.weekStartsOn)||0,Yt=parse$d(Bt),Xt=Yt.getDay(),Jt=(Xt<Gt?7:0)+Xt-Gt;return Yt.setDate(Yt.getDate()-Jt),Yt.setHours(0,0,0,0),Yt}var start_of_week=startOfWeek$1,startOfWeek=start_of_week;function startOfISOWeek$3(Bt){return startOfWeek(Bt,{weekStartsOn:1})}var start_of_iso_week=startOfISOWeek$3,parse$c=parse_1,startOfISOWeek$2=start_of_iso_week;function getISOYear$2(Bt){var Wt=parse$c(Bt),Gt=Wt.getFullYear(),Yt=new Date(0);Yt.setFullYear(Gt+1,0,4),Yt.setHours(0,0,0,0);var Xt=startOfISOWeek$2(Yt),Jt=new Date(0);Jt.setFullYear(Gt,0,4),Jt.setHours(0,0,0,0);var Zt=startOfISOWeek$2(Jt);return Wt.getTime()>=Xt.getTime()?Gt+1:Wt.getTime()>=Zt.getTime()?Gt:Gt-1}var get_iso_year=getISOYear$2,getISOYear$1=get_iso_year,startOfISOWeek$1=start_of_iso_week;function startOfISOYear$1(Bt){var Wt=getISOYear$1(Bt),Gt=new Date(0);Gt.setFullYear(Wt,0,4),Gt.setHours(0,0,0,0);var Yt=startOfISOWeek$1(Gt);return Yt}var start_of_iso_year=startOfISOYear$1,parse$b=parse_1,startOfISOWeek=start_of_iso_week,startOfISOYear=start_of_iso_year,MILLISECONDS_IN_WEEK$2=6048e5;function getISOWeek$1(Bt){var Wt=parse$b(Bt),Gt=startOfISOWeek(Wt).getTime()-startOfISOYear(Wt).getTime();return Math.round(Gt/MILLISECONDS_IN_WEEK$2)+1}var get_iso_week=getISOWeek$1,isDate$4=is_date;function isValid$2(Bt){if(isDate$4(Bt))return!isNaN(Bt);throw new TypeError(toString.call(Bt)+" is not an instance of Date")}var is_valid=isValid$2;function buildDistanceInWordsLocale$1(){var Bt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Wt(Gt,Yt,Xt){Xt=Xt||{};var Jt;return typeof Bt[Gt]=="string"?Jt=Bt[Gt]:Yt===1?Jt=Bt[Gt].one:Jt=Bt[Gt].other.replace("{{count}}",Yt),Xt.addSuffix?Xt.comparison>0?"in "+Jt:Jt+" ago":Jt}return{localize:Wt}}var build_distance_in_words_locale=buildDistanceInWordsLocale$1,commonFormatterKeys=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];function buildFormattingTokensRegExp$1(Bt){var Wt=[];for(var Gt in Bt)Bt.hasOwnProperty(Gt)&&Wt.push(Gt);var Yt=commonFormatterKeys.concat(Wt).sort().reverse(),Xt=new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+Yt.join("|")+"|.)","g");return Xt}var build_formatting_tokens_reg_exp=buildFormattingTokensRegExp$1,buildFormattingTokensRegExp=build_formatting_tokens_reg_exp;function buildFormatLocale$1(){var Bt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt=["January","February","March","April","May","June","July","August","September","October","November","December"],Gt=["Su","Mo","Tu","We","Th","Fr","Sa"],Yt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Jt=["AM","PM"],Zt=["am","pm"],Qt=["a.m.","p.m."],ur={MMM:function($r){return Bt[$r.getMonth()]},MMMM:function($r){return Wt[$r.getMonth()]},dd:function($r){return Gt[$r.getDay()]},ddd:function($r){return Yt[$r.getDay()]},dddd:function($r){return Xt[$r.getDay()]},A:function($r){return $r.getHours()/12>=1?Jt[1]:Jt[0]},a:function($r){return $r.getHours()/12>=1?Zt[1]:Zt[0]},aa:function($r){return $r.getHours()/12>=1?Qt[1]:Qt[0]}},cr=["M","D","DDD","d","Q","W"];return cr.forEach(function($r){ur[$r+"o"]=function(Ar,Lr){return ordinal$1(Lr[$r](Ar))}}),{formatters:ur,formattingTokensRegExp:buildFormattingTokensRegExp(ur)}}function ordinal$1(Bt){var Wt=Bt%100;if(Wt>20||Wt<10)switch(Wt%10){case 1:return Bt+"st";case 2:return Bt+"nd";case 3:return Bt+"rd"}return Bt+"th"}var build_format_locale=buildFormatLocale$1,buildDistanceInWordsLocale=build_distance_in_words_locale,buildFormatLocale=build_format_locale,en$3={distanceInWords:buildDistanceInWordsLocale(),format:buildFormatLocale()},getDayOfYear=get_day_of_year,getISOWeek=get_iso_week,getISOYear=get_iso_year,parse$a=parse_1,isValid$1=is_valid,enLocale$1=en$3;function format$2(Bt,Wt,Gt){var Yt=Wt?String(Wt):"YYYY-MM-DDTHH:mm:ss.SSSZ",Xt=Gt||{},Jt=Xt.locale,Zt=enLocale$1.format.formatters,Qt=enLocale$1.format.formattingTokensRegExp;Jt&&Jt.format&&Jt.format.formatters&&(Zt=Jt.format.formatters,Jt.format.formattingTokensRegExp&&(Qt=Jt.format.formattingTokensRegExp));var ur=parse$a(Bt);if(!isValid$1(ur))return"Invalid Date";var cr=buildFormatFn(Yt,Zt,Qt);return cr(ur)}var formatters$3={M:function(Bt){return Bt.getMonth()+1},MM:function(Bt){return addLeadingZeros$1(Bt.getMonth()+1,2)},Q:function(Bt){return Math.ceil((Bt.getMonth()+1)/3)},D:function(Bt){return Bt.getDate()},DD:function(Bt){return addLeadingZeros$1(Bt.getDate(),2)},DDD:function(Bt){return getDayOfYear(Bt)},DDDD:function(Bt){return addLeadingZeros$1(getDayOfYear(Bt),3)},d:function(Bt){return Bt.getDay()},E:function(Bt){return Bt.getDay()||7},W:function(Bt){return getISOWeek(Bt)},WW:function(Bt){return addLeadingZeros$1(getISOWeek(Bt),2)},YY:function(Bt){return addLeadingZeros$1(Bt.getFullYear(),4).substr(2)},YYYY:function(Bt){return addLeadingZeros$1(Bt.getFullYear(),4)},GG:function(Bt){return String(getISOYear(Bt)).substr(2)},GGGG:function(Bt){return getISOYear(Bt)},H:function(Bt){return Bt.getHours()},HH:function(Bt){return addLeadingZeros$1(Bt.getHours(),2)},h:function(Bt){var Wt=Bt.getHours();return Wt===0?12:Wt>12?Wt%12:Wt},hh:function(Bt){return addLeadingZeros$1(formatters$3.h(Bt),2)},m:function(Bt){return Bt.getMinutes()},mm:function(Bt){return addLeadingZeros$1(Bt.getMinutes(),2)},s:function(Bt){return Bt.getSeconds()},ss:function(Bt){return addLeadingZeros$1(Bt.getSeconds(),2)},S:function(Bt){return Math.floor(Bt.getMilliseconds()/100)},SS:function(Bt){return addLeadingZeros$1(Math.floor(Bt.getMilliseconds()/10),2)},SSS:function(Bt){return addLeadingZeros$1(Bt.getMilliseconds(),3)},Z:function(Bt){return formatTimezone$1(Bt.getTimezoneOffset(),":")},ZZ:function(Bt){return formatTimezone$1(Bt.getTimezoneOffset())},X:function(Bt){return Math.floor(Bt.getTime()/1e3)},x:function(Bt){return Bt.getTime()}};function buildFormatFn(Bt,Wt,Gt){var Yt=Bt.match(Gt),Xt=Yt.length,Jt,Zt;for(Jt=0;Jt<Xt;Jt++)Zt=Wt[Yt[Jt]]||formatters$3[Yt[Jt]],Zt?Yt[Jt]=Zt:Yt[Jt]=removeFormattingTokens(Yt[Jt]);return function(Qt){for(var ur="",cr=0;cr<Xt;cr++)Yt[cr]instanceof Function?ur+=Yt[cr](Qt,formatters$3):ur+=Yt[cr];return ur}}function removeFormattingTokens(Bt){return Bt.match(/\[[\s\S]/)?Bt.replace(/^\[|]$/g,""):Bt.replace(/\\/g,"")}function formatTimezone$1(Bt,Wt){Wt=Wt||"";var Gt=Bt>0?"-":"+",Yt=Math.abs(Bt),Xt=Math.floor(Yt/60),Jt=Yt%60;return Gt+addLeadingZeros$1(Xt,2)+Wt+addLeadingZeros$1(Jt,2)}function addLeadingZeros$1(Bt,Wt){for(var Gt=Math.abs(Bt).toString();Gt.length<Wt;)Gt="0"+Gt;return Gt}var format_1$1=format$2,parse$9=parse_1;function compareDesc$1(Bt,Wt){var Gt=parse$9(Bt),Yt=Gt.getTime(),Xt=parse$9(Wt),Jt=Xt.getTime();return Yt>Jt?-1:Yt<Jt?1:0}var compare_desc=compareDesc$1,parse$8=parse_1;function differenceInMilliseconds$1(Bt,Wt){var Gt=parse$8(Bt),Yt=parse$8(Wt);return Gt.getTime()-Yt.getTime()}var difference_in_milliseconds=differenceInMilliseconds$1,differenceInMilliseconds=difference_in_milliseconds;function differenceInSeconds$1(Bt,Wt){var Gt=differenceInMilliseconds(Bt,Wt)/1e3;return Gt>0?Math.floor(Gt):Math.ceil(Gt)}var difference_in_seconds=differenceInSeconds$1,parse$7=parse_1;function differenceInCalendarMonths$2(Bt,Wt){var Gt=parse$7(Bt),Yt=parse$7(Wt),Xt=Gt.getFullYear()-Yt.getFullYear(),Jt=Gt.getMonth()-Yt.getMonth();return Xt*12+Jt}var difference_in_calendar_months=differenceInCalendarMonths$2,parse$6=parse_1;function compareAsc$2(Bt,Wt){var Gt=parse$6(Bt),Yt=Gt.getTime(),Xt=parse$6(Wt),Jt=Xt.getTime();return Yt<Jt?-1:Yt>Jt?1:0}var compare_asc=compareAsc$2,parse$5=parse_1,differenceInCalendarMonths$1=difference_in_calendar_months,compareAsc$1=compare_asc;function differenceInMonths$1(Bt,Wt){var Gt=parse$5(Bt),Yt=parse$5(Wt),Xt=compareAsc$1(Gt,Yt),Jt=Math.abs(differenceInCalendarMonths$1(Gt,Yt));Gt.setMonth(Gt.getMonth()-Xt*Jt);var Zt=compareAsc$1(Gt,Yt)===-Xt;return Xt*(Jt-Zt)}var difference_in_months=differenceInMonths$1,compareDesc=compare_desc,parse$4=parse_1,differenceInSeconds=difference_in_seconds,differenceInMonths=difference_in_months,enLocale=en$3,MINUTES_IN_DAY=1440,MINUTES_IN_ALMOST_TWO_DAYS=2520,MINUTES_IN_MONTH=43200,MINUTES_IN_TWO_MONTHS=86400;function distanceInWords$1(Bt,Wt,Gt){var Yt=Gt||{},Xt=compareDesc(Bt,Wt),Jt=Yt.locale,Zt=enLocale.distanceInWords.localize;Jt&&Jt.distanceInWords&&Jt.distanceInWords.localize&&(Zt=Jt.distanceInWords.localize);var Qt={addSuffix:!!Yt.addSuffix,comparison:Xt},ur,cr;Xt>0?(ur=parse$4(Bt),cr=parse$4(Wt)):(ur=parse$4(Wt),cr=parse$4(Bt));var $r=differenceInSeconds(cr,ur),Ar=cr.getTimezoneOffset()-ur.getTimezoneOffset(),Lr=Math.round($r/60)-Ar,qr;if(Lr<2)return Yt.includeSeconds?$r<5?Zt("lessThanXSeconds",5,Qt):$r<10?Zt("lessThanXSeconds",10,Qt):$r<20?Zt("lessThanXSeconds",20,Qt):$r<40?Zt("halfAMinute",null,Qt):$r<60?Zt("lessThanXMinutes",1,Qt):Zt("xMinutes",1,Qt):Lr===0?Zt("lessThanXMinutes",1,Qt):Zt("xMinutes",Lr,Qt);if(Lr<45)return Zt("xMinutes",Lr,Qt);if(Lr<90)return Zt("aboutXHours",1,Qt);if(Lr<MINUTES_IN_DAY){var Fr=Math.round(Lr/60);return Zt("aboutXHours",Fr,Qt)}else{if(Lr<MINUTES_IN_ALMOST_TWO_DAYS)return Zt("xDays",1,Qt);if(Lr<MINUTES_IN_MONTH){var Hr=Math.round(Lr/MINUTES_IN_DAY);return Zt("xDays",Hr,Qt)}else if(Lr<MINUTES_IN_TWO_MONTHS)return qr=Math.round(Lr/MINUTES_IN_MONTH),Zt("aboutXMonths",qr,Qt)}if(qr=differenceInMonths(cr,ur),qr<12){var Br=Math.round(Lr/MINUTES_IN_MONTH);return Zt("xMonths",Br,Qt)}else{var Wr=qr%12,Gr=Math.floor(qr/12);return Wr<3?Zt("aboutXYears",Gr,Qt):Wr<9?Zt("overXYears",Gr,Qt):Zt("almostXYears",Gr+1,Qt)}}var distance_in_words=distanceInWords$1,distanceInWords=distance_in_words;function distanceInWordsToNow$1(Bt,Wt){return distanceInWords(Date.now(),Bt,Wt)}var distance_in_words_to_now=distanceInWordsToNow$1,__rest$g=commonjsGlobal&&commonjsGlobal.__rest||function(Bt,Wt){var Gt={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Wt.indexOf(Yt)<0&&(Gt[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Yt=Object.getOwnPropertySymbols(Bt);Xt<Yt.length;Xt++)Wt.indexOf(Yt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[Xt])&&(Gt[Yt[Xt]]=Bt[Yt[Xt]]);return Gt},__importDefault$Q=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(utils$q,"__esModule",{value:!0});utils$q.formatNumber=utils$q.formatDateTime=utils$q.formatDate=utils$q.distanceInWordsToNow=utils$q.toObjectByKey=utils$q.toObjectById=utils$q.insertScript=utils$q.isMobile=void 0;const format_1=__importDefault$Q(format_1$1),distance_in_words_to_now_1=__importDefault$Q(distance_in_words_to_now),utils_1$l=utils$W;function isMobile(){const Bt=window.navigator;return!!Bt&&(/Mobi/i.test(Bt.userAgent)||/Android/i.test(Bt.userAgent))}utils$q.isMobile=isMobile;function insertScript(Bt){var{type:Wt="text/javascript",async:Gt=!0}=Bt,Yt=__rest$g(Bt,["type","async"]);const Xt=document.createElement("script");return Object.assign(Xt,Object.assign({type:Wt,async:Gt},Yt)),document.body.appendChild(Xt),Xt}utils$q.insertScript=insertScript;function toObjectById(Bt,Wt={}){return toObjectByKey(Bt,Wt,"id")}utils$q.toObjectById=toObjectById;function toObjectByKey(Bt,Wt={},Gt){return Bt.reduce((Yt,Xt)=>(Yt[Xt[Gt]]=Xt,Yt),Object.assign({},Wt))}utils$q.toObjectByKey=toObjectByKey;function distanceInWordsToNow(Bt,Wt=!0){return(0,distance_in_words_to_now_1.default)(Bt,{addSuffix:Wt,locale:(0,utils_1$l.getCurrentLocale)()})}utils$q.distanceInWordsToNow=distanceInWordsToNow;function formatDate$1(Bt,Wt="MMMM Do, YYYY"){return(0,format_1.default)(Bt,Wt,{locale:(0,utils_1$l.getCurrentLocale)()})}utils$q.formatDate=formatDate$1;function formatDateTime(Bt,Wt="MMMM Do, YYYY - hh:mm aa"){return(0,format_1.default)(Bt,Wt,{locale:(0,utils_1$l.getCurrentLocale)()})}utils$q.formatDateTime=formatDateTime;function formatNumber(Bt=0,Wt=2){return parseFloat((+Bt).toFixed(Wt)).toLocaleString()}utils$q.formatNumber=formatNumber;var wcv2Utils={},FetchIsWalletConnectV2EnabledWrapper={},utils$p={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__awaiter||function(Xt,Jt,Zt,Qt){function ur(cr){return cr instanceof Zt?cr:new Zt(function($r){$r(cr)})}return new(Zt||(Zt=Promise))(function(cr,$r){function Ar(Fr){try{qr(Qt.next(Fr))}catch(Hr){$r(Hr)}}function Lr(Fr){try{qr(Qt.throw(Fr))}catch(Hr){$r(Hr)}}function qr(Fr){Fr.done?cr(Fr.value):ur(Fr.value).then(Ar,Lr)}qr((Qt=Qt.apply(Xt,Jt||[])).next())})};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.fetchSingleApplicationFeatures=Bt.fetchApplicationFeatures=void 0;const Gt=Xt=>Wt(void 0,void 0,void 0,function*(){const Jt=Xt.map(Qt=>(0,Bt.fetchSingleApplicationFeatures)(Qt));return(yield Promise.all(Jt)).reduce((Qt,ur)=>(Qt[ur.name]=ur,Qt),{})});Bt.fetchApplicationFeatures=Gt;const Yt=Xt=>Wt(void 0,void 0,void 0,function*(){const Jt=`https://feature-flags.decentraland.org/${Xt}.json`,Qt=yield(yield fetch(Jt,{credentials:"include",mode:"cors"})).json();return{name:Xt,flags:Qt.flags,variants:Qt.variants}});Bt.fetchSingleApplicationFeatures=Yt})(utils$p);var types$5={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.FeatureName=Bt.ApplicationName=void 0,function(Wt){Wt.EXPLORER="explorer",Wt.BUILDER="builder",Wt.MARKETPLACE="marketplace",Wt.ACCOUNT="account",Wt.DAO="dao",Wt.EVENTS="events",Wt.LANDING="landing",Wt.DAPPS="dapps",Wt.TEST="test"}(Bt.ApplicationName||(Bt.ApplicationName={})),function(Wt){Wt.WALLET_CONNECT_V2="wallet-connect-v2"}(Bt.FeatureName||(Bt.FeatureName={}))})(types$5);var __awaiter$h=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(FetchIsWalletConnectV2EnabledWrapper,"__esModule",{value:!0});FetchIsWalletConnectV2EnabledWrapper.FetchIsWalletConnectV2Enabled=void 0;const utils_1$k=utils$p,types_1$2=types$5;class FetchIsWalletConnectV2Enabled{constructor(){this.isWalletConnectV2Enabled=null,this.fetchIsWalletConnectV2EnabledPromise=null,this.exec=()=>__awaiter$h(this,void 0,void 0,function*(){return this.isWalletConnectV2Enabled!==null?this.isWalletConnectV2Enabled:(this.fetchIsWalletConnectV2EnabledPromise||(this.fetchIsWalletConnectV2EnabledPromise=(0,utils_1$k.fetchSingleApplicationFeatures)(types_1$2.ApplicationName.DAPPS).then(Wt=>(this.isWalletConnectV2Enabled=!!Wt.flags[`${types_1$2.ApplicationName.DAPPS}-${types_1$2.FeatureName.WALLET_CONNECT_V2}`],this.isWalletConnectV2Enabled))),this.fetchIsWalletConnectV2EnabledPromise)})}}FetchIsWalletConnectV2EnabledWrapper.FetchIsWalletConnectV2Enabled=FetchIsWalletConnectV2Enabled;var TryPreviousConnectionWrapper={},dist$e={},sdk$3={},ws$3={},sceneUpdate$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.SceneUpdate=Bt.SCENE_UPDATE=void 0;const Wt=validation$6;Bt.SCENE_UPDATE="SCENE_UPDATE",function(Gt){Gt.schema={type:"object",properties:{type:{type:"string",enum:[Bt.SCENE_UPDATE]},payload:{type:"object",properties:{sceneId:{type:"string"},sceneType:{type:"string"}},additionalProperties:!1,required:["sceneId","sceneType"]}},required:["payload","type"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.SceneUpdate||(Bt.SceneUpdate={}))})(sceneUpdate$3);var update$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Update=Bt.UPDATE=void 0;const Wt=validation$6;Bt.UPDATE="update",function(Gt){Gt.schema={type:"object",properties:{type:{type:"string",enum:[Bt.UPDATE]}},required:["type"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.Update||(Bt.Update={}))})(update$3);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(sceneUpdate$3,Bt),Gt(update$3,Bt)})(ws$3);var project$3={},type$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ProjectType=void 0;const Wt=validation$6;(function(Gt){Gt.SCENE="scene",Gt.SMART_ITEM="smart-item",Gt.PORTABLE_EXPERIENCE="portable-experience",Gt.LIBRARY="library"})(Bt.ProjectType||(Bt.ProjectType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.ProjectType||(Bt.ProjectType={}))})(type$3);var wearableJson$3={},rarity$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Rarity=void 0;const Wt=validation$6;(function(Gt){Gt.UNIQUE="unique",Gt.MYTHIC="mythic",Gt.LEGENDARY="legendary",Gt.EPIC="epic",Gt.RARE="rare",Gt.UNCOMMON="uncommon",Gt.COMMON="common"})(Bt.Rarity||(Bt.Rarity={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema);const Yt={[Gt.UNIQUE]:1,[Gt.MYTHIC]:10,[Gt.LEGENDARY]:100,[Gt.EPIC]:1e3,[Gt.RARE]:5e3,[Gt.UNCOMMON]:1e4,[Gt.COMMON]:1e5},Xt={[Gt.UNIQUE]:"#FFE617",[Gt.MYTHIC]:"#FB7DE3",[Gt.LEGENDARY]:"#A657ED",[Gt.EPIC]:"#6397F2",[Gt.RARE]:"#3AD682",[Gt.UNCOMMON]:"#FF8563",[Gt.COMMON]:"#D4E0E0"},Jt={[Gt.UNIQUE]:"#FFB626",[Gt.MYTHIC]:"#FF63E1",[Gt.LEGENDARY]:"#842DDA",[Gt.EPIC]:"#3D85E6",[Gt.RARE]:"#36CF75",[Gt.UNCOMMON]:"#ED6D4F",[Gt.COMMON]:"#ABC1C1"};function Zt(cr){return Yt[cr]}Gt.getMaxSupply=Zt;function Qt(cr){return Jt[cr]}Gt.getColor=Qt;function ur(cr){return[Xt[cr],Jt[cr]]}Gt.getGradient=ur}(Bt.Rarity||(Bt.Rarity={}))})(rarity$3);var wearableCategory$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.WearableCategory=void 0;const Wt=validation$6;(function(Gt){Gt.EYEBROWS="eyebrows",Gt.EYES="eyes",Gt.FACIAL_HAIR="facial_hair",Gt.HAIR="hair",Gt.BODY_SHAPE="body_shape",Gt.MOUTH="mouth",Gt.UPPER_BODY="upper_body",Gt.LOWER_BODY="lower_body",Gt.FEET="feet",Gt.EARRING="earring",Gt.EYEWEAR="eyewear",Gt.HAT="hat",Gt.HELMET="helmet",Gt.MASK="mask",Gt.TIARA="tiara",Gt.TOP_HEAD="top_head",Gt.SKIN="skin",Gt.HANDS_WEAR="hands_wear"})(Bt.WearableCategory||(Bt.WearableCategory={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.WearableCategory||(Bt.WearableCategory={}))})(wearableCategory$3);var representation$3={},bodyShape$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.BodyShape=void 0;const Wt=validation$6;(function(Gt){Gt.MALE="urn:decentraland:off-chain:base-avatars:BaseMale",Gt.FEMALE="urn:decentraland:off-chain:base-avatars:BaseFemale"})(Bt.BodyShape||(Bt.BodyShape={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.BodyShape||(Bt.BodyShape={}))})(bodyShape$3);var hideableCategory$1={},bodyPartCategory$1={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.BodyPartCategory=void 0;const Wt=validation$6;(function(Gt){Gt.HEAD="head",Gt.HANDS="hands"})(Bt.BodyPartCategory||(Bt.BodyPartCategory={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.BodyPartCategory||(Bt.BodyPartCategory={}))})(bodyPartCategory$1);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.HideableWearableCategory=void 0;const Wt=wearableCategory$3,Gt=validation$6,Yt=bodyPartCategory$1;(function(Xt){Xt.schema={oneOf:[Object.assign({},Wt.WearableCategory.schema),Object.assign({},Yt.BodyPartCategory.schema)]},Xt.validate=(0,Gt.generateLazyValidator)(Xt.schema)})(Bt.HideableWearableCategory||(Bt.HideableWearableCategory={}))})(hideableCategory$1);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.WearableRepresentation=void 0;const Wt=validation$6,Gt=bodyShape$3,Yt=hideableCategory$1;(function(Xt){Xt.schema={type:"object",properties:{bodyShapes:{type:"array",items:Gt.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}}},overrideHides:{type:"array",items:Yt.HideableWearableCategory.schema},overrideReplaces:{type:"array",items:Yt.HideableWearableCategory.schema}},required:["bodyShapes","mainFile","contents","overrideHides","overrideReplaces"]},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)})(Bt.WearableRepresentation||(Bt.WearableRepresentation={}))})(representation$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.WearableJson=void 0;const Wt=rarity$3,Gt=wearableCategory$3,Yt=representation$3,Xt=validation$6;(function(Jt){Jt.schema={type:"object",properties:{description:{type:"string"},rarity:Object.assign(Object.assign({},Wt.Rarity.schema),{nullable:!0}),name:{type:"string"},data:{type:"object",properties:{replaces:{type:"array",items:Gt.WearableCategory.schema},hides:{type:"array",items:Gt.WearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:Yt.WearableRepresentation.schema,minItems:1},category:Gt.WearableCategory.schema},required:["replaces","hides","tags","representations","category"]}},additionalProperties:!0,required:["description","name","data"]},Jt.validate=(0,Xt.generateLazyValidator)(Jt.schema)})(Bt.WearableJson||(Bt.WearableJson={}))})(wearableJson$3);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(type$3,Bt),Gt(wearableJson$3,Bt)})(project$3);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(ws$3,Bt),Gt(project$3,Bt)})(sdk$3);var bid$3={},listingStatus$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ListingStatus=void 0;const Wt=validation$6;(function(Gt){Gt.OPEN="open",Gt.SOLD="sold",Gt.CANCELLED="cancelled"})(Bt.ListingStatus||(Bt.ListingStatus={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.ListingStatus||(Bt.ListingStatus={}))})(listingStatus$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Bid=Bt.BidSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=listingStatus$3,Xt=network$5;(function(Jt){Jt.RECENTLY_OFFERED="recently_offered",Jt.RECENTLY_UPDATED="recently_updated",Jt.MOST_EXPENSIVE="most_expensive"})(Bt.BidSortBy||(Bt.BidSortBy={})),function(Jt){Jt.schema={type:"object",properties:{id:{type:"string"},bidAddress:{type:"string"},bidder:{type:"string"},seller:{type:"string"},price:{type:"string"},fingerprint:{type:"string"},status:Yt.ListingStatus.schema,blockchainId:{type:"string"},blockNumber:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},network:Xt.Network.schema,chainId:Gt.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"}},required:["id","bidAddress","bidder","seller","price","fingerprint","status","blockchainId","blockNumber","contractAddress","tokenId","network","chainId","expiresAt","createdAt","updatedAt"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Bt.Bid||(Bt.Bid={}))})(bid$3);var account$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Account=Bt.AccountSortBy=void 0;const Wt=validation$6;(function(Gt){Gt.MOST_SALES="most_sales",Gt.MOST_PURCHASES="most_purchases",Gt.MOST_SPENT="most_spent",Gt.MOST_EARNED="most_earned",Gt.MOST_ROYALTIES="most_royalties",Gt.MOST_COLLECTIONS="most_collections"})(Bt.AccountSortBy||(Bt.AccountSortBy={})),function(Gt){Gt.schema={type:"object",properties:{id:{type:"string"},address:{type:"string"},sales:{type:"integer"},purchases:{type:"integer"},spent:{type:"string"},earned:{type:"string"},royalties:{type:"string"},collections:{type:"number"}},required:["id","address","sales","purchases","spent","earned","royalties","collections"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.Account||(Bt.Account={}))})(account$3);var collection$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Collection=Bt.CollectionSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=network$5;(function(Xt){Xt.NEWEST="newest",Xt.NAME="name",Xt.RECENTLY_REVIEWED="recently_reviewed",Xt.RECENTLY_LISTED="recently_listed",Xt.SIZE="size"})(Bt.CollectionSortBy||(Bt.CollectionSortBy={})),function(Xt){Xt.schema={type:"object",properties:{urn:{type:"string"},creator:{type:"string"},name:{type:"string"},contractAddress:{type:"string"},size:{type:"integer"},isOnSale:{type:"boolean"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},network:Yt.Network.schema,chainId:Gt.ChainId.schema,firstListedAt:{type:"integer",nullable:!0}},required:["urn","creator","name","contractAddress","isOnSale","size","createdAt","updatedAt","reviewedAt","network","chainId"]},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)}(Bt.Collection||(Bt.Collection={}))})(collection$3);var contract$3={},nftCategory$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.NFTCategory=void 0;const Wt=validation$6;(function(Gt){Gt.PARCEL="parcel",Gt.ESTATE="estate",Gt.WEARABLE="wearable",Gt.ENS="ens",Gt.EMOTE="emote"})(Bt.NFTCategory||(Bt.NFTCategory={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.NFTCategory||(Bt.NFTCategory={}))})(nftCategory$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Contract=Bt.ContractSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=network$5,Xt=nftCategory$3;(function(Jt){Jt.NAME="name"})(Bt.ContractSortBy||(Bt.ContractSortBy={})),function(Jt){Jt.schema={type:"object",properties:{name:{type:"string"},address:{type:"string"},category:Xt.NFTCategory.schema,network:Yt.Network.schema,chainId:Gt.ChainId.schema},required:["name","address","category","network","chainId"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Bt.Contract||(Bt.Contract={}))})(contract$3);var item$7={},nft$3={},platform$3={},profile$7={},avatar$6={},misc$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.IPFSv1=Bt.IPFSv2=Bt.EthAddress=Bt.Color3=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",required:["r","g","b"],properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}}};const Yt=(0,Wt.generateLazyValidator)(Gt.schema);Gt.validate=Xt=>Yt(Xt)})(Bt.Color3||(Bt.Color3={})),function(Gt){Gt.schema={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"};const Yt=new RegExp(Gt.schema.pattern);Gt.validate=Xt=>Yt.test(Xt)}(Bt.EthAddress||(Bt.EthAddress={})),function(Gt){Gt.schema={type:"string",pattern:"^(ba)[a-zA-Z0-9]{57}$"};const Yt=new RegExp(Gt.schema.pattern);Gt.validate=Xt=>Yt.test(Xt)}(Bt.IPFSv2||(Bt.IPFSv2={})),function(Gt){Gt.schema={type:"string",pattern:"^(Qm)[a-zA-Z0-9]{44}$"};const Yt=new RegExp(Gt.schema.pattern);Gt.validate=Xt=>Yt.test(Xt)}(Bt.IPFSv1||(Bt.IPFSv1={}))})(misc$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Avatar=Bt.Link=Bt.LinkUrl=Bt.AvatarInfo=Bt.Snapshots=void 0;const Wt=wearableCategory$3,Gt=misc$3,Yt=validation$6;var Xt;(function(ur){ur.schema={type:"object",required:["face256","body"],properties:{face256:Gt.IPFSv2.schema,body:Gt.IPFSv2.schema}},ur.validate=(0,Yt.generateLazyValidator)(ur.schema)})(Xt=Bt.Snapshots||(Bt.Snapshots={}));var Jt;(function(ur){ur.schema={type:"object",required:["bodyShape","eyes","hair","skin"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:Wt.WearableCategory.schema},emotes:{type:"array",items:{type:"object",properties:{slot:{type:"number"},urn:{type:"string"}},required:["slot","urn"]},nullable:!0},snapshots:Xt.schema},additionalProperties:!0},ur.validate=(0,Yt.generateLazyValidator)(ur.schema)})(Jt=Bt.AvatarInfo||(Bt.AvatarInfo={}));var Zt;(function(ur){ur.schema={type:"string",pattern:"^((https?:)?\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([\\/\\w .%()\\-]*)*\\/?$"};const cr=new RegExp(ur.schema.pattern,"i");ur.validate=$r=>cr.test($r)})(Zt=Bt.LinkUrl||(Bt.LinkUrl={}));var Qt;(function(ur){ur.schema={type:"object",required:["title","url"],properties:{title:{type:"string"},url:Zt.schema}}})(Qt=Bt.Link||(Bt.Link={})),function(ur){ur.schema={type:"object",required:["name","description","ethAddress","version","tutorialStep","avatar","hasClaimedName"],properties:{userId:{type:"string"},name:{type:"string"},description:{type:"string"},links:{type:"array",maxItems:5,items:Qt.schema,nullable:!0},country:{nullable:!0,type:"string"},employmentStatus:{nullable:!0,type:"string"},gender:{nullable:!0,type:"string"},pronouns:{nullable:!0,type:"string"},relationshipStatus:{nullable:!0,type:"string"},sexualOrientation:{nullable:!0,type:"string"},language:{nullable:!0,type:"string"},profession:{nullable:!0,type:"string"},birthdate:{nullable:!0,type:"number"},realName:{nullable:!0,type:"string"},hobbies:{nullable:!0,type:"string"},ethAddress:Gt.EthAddress.schema,version:{type:"number"},tutorialStep:{type:"number"},email:{type:"string",nullable:!0},blocked:{type:"array",items:{type:"string"},nullable:!0},muted:{type:"array",items:{type:"string"},nullable:!0},interests:{type:"array",items:{type:"string"},nullable:!0},hasClaimedName:{type:"boolean"},hasConnectedWeb3:{type:"boolean",nullable:!0},avatar:Jt.schema},additionalProperties:!0},ur.validate=(0,Yt.generateLazyValidator)(ur.schema)}(Bt.Avatar||(Bt.Avatar={}))})(avatar$6);var profile$6={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Profile=void 0;const Wt=validation$6,Gt=avatar$6;(function(Yt){Yt.schema={type:"object",required:["avatars"],properties:{avatars:{type:"array",items:Gt.Avatar.schema}},additionalProperties:!0},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)})(Bt.Profile||(Bt.Profile={}))})(profile$6);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(avatar$6,Bt),Gt(profile$6,Bt)})(profile$7);var scene$7={},featureToggles$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.FeatureToggles=Bt.portableExperiencesToggles=Bt.toggles=void 0;const Wt=validation$6;Bt.toggles=["enabled","disabled"],Bt.portableExperiencesToggles=[...Bt.toggles,"hideUi"],function(Gt){Gt.schema={type:"object",properties:{voiceChat:{type:"string",enum:Bt.toggles,nullable:!0},portableExperiences:{type:"string",enum:Bt.portableExperiencesToggles,nullable:!0,errorMessage:`valid options are ${Bt.portableExperiencesToggles.join(", ")}`}},errorMessage:`valid options are ${Bt.toggles.join(", ")}`,required:[]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.FeatureToggles||(Bt.FeatureToggles={}))})(featureToggles$3);var worldConfiguration$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.WorldConfiguration=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{name:{type:"string",nullable:!0},skybox:{type:"number",nullable:!0},minimapVisible:{type:"boolean",nullable:!0},miniMapConfig:{type:"object",nullable:!0,properties:{visible:{type:"boolean",nullable:!0},dataImage:{type:"string",nullable:!0},estateImage:{type:"string",nullable:!0}}},skyboxConfig:{type:"object",nullable:!0,properties:{fixedTime:{type:"number",nullable:!0},textures:{type:"array",nullable:!0,items:{type:"string"},oneOf:[{minItems:0,maxItems:0},{minItems:1,maxItems:1},{minItems:6,maxItems:6}],errorMessage:"customSkybox must be an array of 0, 1 or 6 strings"}}},fixedAdapter:{type:"string",nullable:!0},placesConfig:{type:"object",nullable:!0,properties:{optOut:{type:"boolean",nullable:!0}}}},required:[]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.WorldConfiguration||(Bt.WorldConfiguration={}))})(worldConfiguration$3);var sceneParcels$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.SceneParcels=void 0;const Wt=validation$6;(function(Gt){Gt.schema={description:'Describes a scene, a set of parcels whose content is treated as the same entity. A list of parcels is listed, for which one of them is considered the "base" for positioning purposes.',type:"object",properties:{base:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},parcels:{type:"array",items:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},minItems:1}},additionalProperties:!0,required:["base","parcels"]},Gt.schemaValidator=(0,Wt.generateLazyValidator)(Gt.schema),Gt.validate=Yt=>Gt.schemaValidator(Yt)&&Yt.parcels.includes(Yt.base)})(Bt.SceneParcels||(Bt.SceneParcels={}))})(sceneParcels$3);var scene$6={},displayable$3={};Object.defineProperty(displayable$3,"__esModule",{value:!0});displayable$3.displayableProperties=void 0;displayable$3.displayableProperties={menuBarIcon:{description:"Name of the file used as icon for the MenuBar",type:"string",nullable:!0}};var source$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Source=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{version:{type:"number",nullable:!0},origin:{type:"string"},projectId:{type:"string"},point:{type:"object",properties:{x:{type:"integer"},y:{type:"integer"}},nullable:!0,required:["x","y"]},rotation:{type:"string",enum:["north","east","south","west"],nullable:!0},layout:{type:"object",properties:{rows:{type:"integer"},cols:{type:"integer"}},nullable:!0,required:["rows","cols"]},isEmpty:{type:"boolean",nullable:!0}},additionalProperties:!0,required:["origin","projectId"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.Source||(Bt.Source={}))})(source$3);var spawnPoint$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.SpawnPoint=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{name:{type:"string",nullable:!0},position:{type:"object",oneOf:[{$ref:"#single-position"},{$ref:"#multi-position"}],required:["x","y","z"]},default:{type:"boolean",nullable:!0},cameraTarget:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],nullable:!0}},required:["position"],definitions:{"single-position":{$id:"#single-position",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"]},"multi-position":{$id:"#multi-position",type:"object",properties:{x:{type:"array",items:{type:"number"},minItems:1},y:{type:"array",items:{type:"number"},minItems:1},z:{type:"array",items:{type:"number"},minItems:1}},required:["x","y","z"]}}},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.SpawnPoint||(Bt.SpawnPoint={}))})(spawnPoint$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Scene=void 0;const Wt=validation$6,Gt=displayable$3,Yt=featureToggles$3,Xt=sceneParcels$3,Jt=source$3,Zt=spawnPoint$3,Qt=worldConfiguration$3;(function(ur){ur.schema={type:"object",properties:Object.assign(Object.assign({isPortableExperience:{description:"Define the current scene as a Portable Experience",type:"boolean",nullable:!0},main:{description:"File that contains the entry point of the scene's code",type:"string",minLength:1},scene:Xt.SceneParcels.schema},Gt.displayableProperties),{display:{description:"Information related to how should this land be displayed apart from the normal rendering of the scene",type:"object",properties:{title:{description:"A name so other users can identify what the contents of this land should be",type:"string",nullable:!0},favicon:{description:"DEPRECATED. Allow the land owner to set up a favicon to this land",type:"string",nullable:!0},description:{description:"A description that will be shown on client's nav map when the scene is selected",type:"string",nullable:!0},navmapThumbnail:{type:"string",nullable:!0}},nullable:!0,required:[]},owner:{type:"string",nullable:!0},contact:{description:"Describe different ways of contacting the land owner",type:"object",properties:{name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},im:{type:"string",nullable:!0},url:{type:"string",nullable:!0}},nullable:!0,required:[]},tags:{type:"array",items:{type:"string",minLength:1},nullable:!0},source:Object.assign(Object.assign({},Jt.Source.schema),{nullable:!0}),spawnPoints:{type:"array",items:Zt.SpawnPoint.schema,nullable:!0},requiredPermissions:{type:"array",items:{type:"string"},nullable:!0},featureToggles:Object.assign(Object.assign({},Yt.FeatureToggles.schema),{nullable:!0}),worldConfiguration:Object.assign(Object.assign({},Qt.WorldConfiguration.schema),{nullable:!0}),allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!0}}),additionalProperties:!0,required:["main","scene"]},ur.validate=(0,Wt.generateLazyValidator)(ur.schema)})(Bt.Scene||(Bt.Scene={}))})(scene$6);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.SpawnPoint=Bt.Source=Bt.Scene=Bt.SceneParcels=Bt.WorldConfiguration=Bt.FeatureToggles=void 0;var Wt=featureToggles$3;Object.defineProperty(Bt,"FeatureToggles",{enumerable:!0,get:function(){return Wt.FeatureToggles}});var Gt=worldConfiguration$3;Object.defineProperty(Bt,"WorldConfiguration",{enumerable:!0,get:function(){return Gt.WorldConfiguration}});var Yt=sceneParcels$3;Object.defineProperty(Bt,"SceneParcels",{enumerable:!0,get:function(){return Yt.SceneParcels}});var Xt=scene$6;Object.defineProperty(Bt,"Scene",{enumerable:!0,get:function(){return Xt.Scene}});var Jt=source$3;Object.defineProperty(Bt,"Source",{enumerable:!0,get:function(){return Jt.Source}});var Zt=spawnPoint$3;Object.defineProperty(Bt,"SpawnPoint",{enumerable:!0,get:function(){return Zt.SpawnPoint}})})(scene$7);var item$6={},i18n$3={},locale$6={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Locale=void 0;const Wt=validation$6;(function(Gt){Gt.EN="en",Gt.ES="es"})(Bt.Locale||(Bt.Locale={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.Locale||(Bt.Locale={}))})(locale$6);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.I18N=void 0;const Wt=validation$6,Gt=locale$6;(function(Yt){Yt.schema={type:"object",properties:{code:Gt.Locale.schema,text:{type:"string"}},additionalProperties:!0,required:["code","text"]},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)})(Bt.I18N||(Bt.I18N={}))})(i18n$3);var metrics$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Metrics=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{triangles:{type:"number"},materials:{type:"number"},textures:{type:"number"},meshes:{type:"number"},bodies:{type:"number"},entities:{type:"number"}},required:["triangles","materials","textures","meshes","bodies","entities"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.Metrics||(Bt.Metrics={}))})(metrics$3);var standardProps$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.isStandard=Bt.standardProperties=void 0;const Wt=rarity$3,Gt=validation$6;Bt.standardProperties={collectionAddress:{type:"string",nullable:!1},rarity:Wt.Rarity.schema};const Yt={type:"object",properties:Object.assign({},Bt.standardProperties),required:["collectionAddress","rarity"]},Xt=(0,Gt.generateLazyValidator)(Yt);function Jt(Zt){return Xt(Zt)}Bt.isStandard=Jt})(standardProps$3);var thirdPartyProps$3={},merkleProof$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.MerkleProof=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{proof:{type:"array",items:{type:"string"}},index:{type:"number"},hashingKeys:{type:"array",items:{type:"string"}},entityHash:{type:"string"}},required:["entityHash","hashingKeys","index","proof"],additionalProperties:!0},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.MerkleProof||(Bt.MerkleProof={}))})(merkleProof$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.isThirdParty=Bt.thirdPartyProps=void 0;const Wt=validation$6,Gt=merkleProof$3;Bt.thirdPartyProps={merkleProof:Gt.MerkleProof.schema,content:{type:"object",nullable:!1,additionalProperties:{type:"string"},required:[]}};const Yt={type:"object",properties:Object.assign({},Bt.thirdPartyProps),required:["merkleProof","content"],_containsHashingKeys:!0},Xt={keyword:"_containsHashingKeys",validate:(Qt,ur)=>{var cr;const $r=ur;return!((cr=$r==null?void 0:$r.merkleProof)===null||cr===void 0)&&cr.hashingKeys?$r.merkleProof.hashingKeys.every(Ar=>$r.hasOwnProperty(Ar)):!1},errors:!1},Jt=(0,Wt.generateLazyValidator)(Yt,[Xt]);function Zt(Qt){return Jt(Qt)}Bt.isThirdParty=Zt})(thirdPartyProps$3);var wearable$7={},wearable$6={},baseItem$3={};Object.defineProperty(baseItem$3,"__esModule",{value:!0});baseItem$3.isBaseAvatar=baseItem$3.requiredBaseItemProps=baseItem$3.baseItemProperties=void 0;const i18n_1$3=i18n$3,metrics_1$3=metrics$3,displayable_1$3=displayable$3;baseItem$3.baseItemProperties=Object.assign(Object.assign({},displayable_1$3.displayableProperties),{id:{type:"string"},name:{type:"string"},description:{type:"string"},i18n:{type:"array",items:i18n_1$3.I18N.schema,minItems:1,uniqueItemProperties:["code"],errorMessage:'${0#} array should not have duplicates for "code"'},thumbnail:{type:"string"},image:{type:"string"},metrics:Object.assign(Object.assign({},metrics_1$3.Metrics.schema),{nullable:!0})});baseItem$3.requiredBaseItemProps=["id","name","description","i18n","thumbnail","image"];function isBaseAvatar$3(Bt){if(!Bt||!Bt.id)return!1;const Wt=Bt.id.split(":"),Gt=Wt[1]==="decentraland",Yt=Wt[3]==="base-avatars";return Wt.length===5&&Gt&&Yt}baseItem$3.isBaseAvatar=isBaseAvatar$3;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Wearable=void 0;const Wt=validation$6,Gt=wearableCategory$3,Yt=representation$3,Xt=baseItem$3,Jt=standardProps$3,Zt=thirdPartyProps$3,Qt=hideableCategory$1;(function(ur){ur.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},Xt.baseItemProperties),Jt.standardProperties),Zt.thirdPartyProps),{data:{type:"object",properties:{replaces:{type:"array",items:Qt.HideableWearableCategory.schema},hides:{type:"array",items:Qt.HideableWearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:Yt.WearableRepresentation.schema,minItems:1},category:Gt.WearableCategory.schema},required:["replaces","hides","tags","representations","category"]}}),additionalProperties:!0,required:[],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity"],_isBaseAvatar:!0},{required:[...Xt.requiredBaseItemProps,"data","collectionAddress","rarity"],prohibited:["merkleProof","content"]},{required:[...Xt.requiredBaseItemProps,"data","merkleProof","content"],prohibited:["collectionAddress","rarity"],_isThirdParty:!0}],errorMessage:{oneOf:"either standard XOR thirdparty properties conditions must be met"}};const cr={keyword:"_isThirdParty",validate:(Ar,Lr)=>!Ar||(0,Zt.isThirdParty)(Lr),errors:!1},$r={keyword:"_isBaseAvatar",validate:(Ar,Lr)=>!Ar||(0,Xt.isBaseAvatar)(Lr),errors:!1};ur.validate=(0,Wt.generateLazyValidator)(ur.schema,[cr,$r])})(Bt.Wearable||(Bt.Wearable={}))})(wearable$6);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.HideableWearableCategory=Bt.BodyPartCategory=Bt.WearableCategory=Bt.Wearable=Bt.WearableRepresentation=void 0;var Wt=representation$3;Object.defineProperty(Bt,"WearableRepresentation",{enumerable:!0,get:function(){return Wt.WearableRepresentation}});var Gt=wearable$6;Object.defineProperty(Bt,"Wearable",{enumerable:!0,get:function(){return Gt.Wearable}});var Yt=wearableCategory$3;Object.defineProperty(Bt,"WearableCategory",{enumerable:!0,get:function(){return Yt.WearableCategory}});var Xt=bodyPartCategory$1;Object.defineProperty(Bt,"BodyPartCategory",{enumerable:!0,get:function(){return Xt.BodyPartCategory}});var Jt=hideableCategory$1;Object.defineProperty(Bt,"HideableWearableCategory",{enumerable:!0,get:function(){return Jt.HideableWearableCategory}})})(wearable$7);var emote$7={},emote$6={},emoteDataAdr74$3={},emoteCategory$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.EmoteCategory=void 0;const Wt=validation$6;(function(Gt){Gt.DANCE="dance",Gt.STUNT="stunt",Gt.GREETINGS="greetings",Gt.FUN="fun",Gt.POSES="poses",Gt.REACTIONS="reactions",Gt.HORROR="horror",Gt.MISCELLANEOUS="miscellaneous"})(Bt.EmoteCategory||(Bt.EmoteCategory={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.EmoteCategory||(Bt.EmoteCategory={}))})(emoteCategory$3);var representationAdr74$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.EmoteRepresentationADR74=void 0;const Wt=validation$6,Gt=bodyShape$3;(function(Yt){Yt.schema={type:"object",properties:{bodyShapes:{type:"array",items:Gt.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}},errorMessage:{contains:"contents should contain mainFile: ${1/mainFile}"}}},required:["bodyShapes","mainFile","contents"]},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)})(Bt.EmoteRepresentationADR74||(Bt.EmoteRepresentationADR74={}))})(representationAdr74$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.EmoteDataADR74=void 0;const Wt=emoteCategory$3,Gt=validation$6,Yt=representationAdr74$3;(function(Xt){Xt.schema={type:"object",properties:{tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:Yt.EmoteRepresentationADR74.schema,minItems:1},category:Wt.EmoteCategory.schema,loop:{type:"boolean"}},required:["category","tags","representations","loop"],additionalProperties:!0},Xt.validate=(0,Gt.generateLazyValidator)(Xt.schema)})(Bt.EmoteDataADR74||(Bt.EmoteDataADR74={}))})(emoteDataAdr74$3);var hasRequiredEmote$7;function requireEmote$7(){return hasRequiredEmote$7||(hasRequiredEmote$7=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Emote=void 0;const Wt=requireItem$3(),Gt=validation$6,Yt=baseItem$3,Xt=standardProps$3,Jt=thirdPartyProps$3,Zt=emoteDataAdr74$3;(function(Qt){Qt.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},Yt.baseItemProperties),Xt.standardProperties),Jt.thirdPartyProps),{emoteDataADR74:Zt.EmoteDataADR74.schema}),additionalProperties:!0,required:[...Yt.requiredBaseItemProps],oneOf:[{required:["emoteDataADR74"],oneOf:[{required:["collectionAddress","rarity"],prohibited:["merkleProof","content"],errorMessage:"standard properties conditions are not met"},{required:["merkleProof","content","id","name","description","i18n","image","thumbnail","emoteDataADR74"],_isThirdParty:!0,prohibited:["collectionAddress","rarity"],errorMessage:"thirdparty properties conditions are not met"}],errorMessage:{oneOf:"emote should have either standard or thirdparty properties"}}],errorMessage:{oneOf:'emote should have "emoteDataADR74" and match its schema'}};const ur={keyword:"_isThirdParty",validate:(cr,$r)=>!cr||(0,Wt.isThirdParty)($r),errors:!1};Qt.validate=(0,Gt.generateLazyValidator)(Qt.schema,[ur])})(Bt.Emote||(Bt.Emote={}))}(emote$6)),emote$6}var emotePlayMode$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.EmotePlayMode=void 0;const Wt=validation$6;(function(Gt){Gt.SIMPLE="simple",Gt.LOOP="loop"})(Bt.EmotePlayMode||(Bt.EmotePlayMode={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.EmotePlayMode||(Bt.EmotePlayMode={}))})(emotePlayMode$3);var hasRequiredEmote$6;function requireEmote$6(){return hasRequiredEmote$6||(hasRequiredEmote$6=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.EmotePlayMode=Bt.EmoteCategory=Bt.EmoteDataADR74=Bt.EmoteRepresentationADR74=Bt.Emote=void 0;var Wt=requireEmote$7();Object.defineProperty(Bt,"Emote",{enumerable:!0,get:function(){return Wt.Emote}});var Gt=representationAdr74$3;Object.defineProperty(Bt,"EmoteRepresentationADR74",{enumerable:!0,get:function(){return Gt.EmoteRepresentationADR74}});var Yt=emoteDataAdr74$3;Object.defineProperty(Bt,"EmoteDataADR74",{enumerable:!0,get:function(){return Yt.EmoteDataADR74}});var Xt=emoteCategory$3;Object.defineProperty(Bt,"EmoteCategory",{enumerable:!0,get:function(){return Xt.EmoteCategory}});var Jt=emotePlayMode$3;Object.defineProperty(Bt,"EmotePlayMode",{enumerable:!0,get:function(){return Jt.EmotePlayMode}})}(emote$7)),emote$7}var hasRequiredItem$3;function requireItem$3(){return hasRequiredItem$3||(hasRequiredItem$3=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(cr,$r,Ar,Lr){Lr===void 0&&(Lr=Ar);var qr=Object.getOwnPropertyDescriptor($r,Ar);(!qr||("get"in qr?!$r.__esModule:qr.writable||qr.configurable))&&(qr={enumerable:!0,get:function(){return $r[Ar]}}),Object.defineProperty(cr,Lr,qr)}:function(cr,$r,Ar,Lr){Lr===void 0&&(Lr=Ar),cr[Lr]=$r[Ar]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(cr,$r){for(var Ar in cr)Ar!=="default"&&!Object.prototype.hasOwnProperty.call($r,Ar)&&Wt($r,cr,Ar)};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.isThirdParty=Bt.isStandard=Bt.BodyShape=Bt.Metrics=Bt.Locale=Bt.I18N=void 0;var Yt=i18n$3;Object.defineProperty(Bt,"I18N",{enumerable:!0,get:function(){return Yt.I18N}});var Xt=locale$6;Object.defineProperty(Bt,"Locale",{enumerable:!0,get:function(){return Xt.Locale}});var Jt=metrics$3;Object.defineProperty(Bt,"Metrics",{enumerable:!0,get:function(){return Jt.Metrics}});var Zt=bodyShape$3;Object.defineProperty(Bt,"BodyShape",{enumerable:!0,get:function(){return Zt.BodyShape}});var Qt=standardProps$3;Object.defineProperty(Bt,"isStandard",{enumerable:!0,get:function(){return Qt.isStandard}});var ur=thirdPartyProps$3;Object.defineProperty(Bt,"isThirdParty",{enumerable:!0,get:function(){return ur.isThirdParty}}),Gt(wearable$7,Bt),Gt(requireEmote$6(),Bt)}(item$6)),item$6}var merkleTree$3={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(merkleProof$3,Bt)})(merkleTree$3);var syncDeployments$3={},authChain$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthChain=Bt.AuthLink=Bt.AuthLinkType=void 0;const Wt=validation$6;var Gt;(function(Xt){Xt.SIGNER="SIGNER",Xt.ECDSA_PERSONAL_EPHEMERAL="ECDSA_EPHEMERAL",Xt.ECDSA_PERSONAL_SIGNED_ENTITY="ECDSA_SIGNED_ENTITY",Xt.ECDSA_EIP_1654_EPHEMERAL="ECDSA_EIP_1654_EPHEMERAL",Xt.ECDSA_EIP_1654_SIGNED_ENTITY="ECDSA_EIP_1654_SIGNED_ENTITY"})(Gt=Bt.AuthLinkType||(Bt.AuthLinkType={}));var Yt;(function(Xt){Xt.schema={type:"object",properties:{type:{type:"string",enum:Object.values(Gt)},payload:{type:"string"},signature:{type:"string",nullable:!0}},required:["payload","type"],if:{properties:{type:{not:{const:Gt.SIGNER}}}},then:{required:["signature"]},else:{oneOf:[{properties:{signature:{type:"string",const:""}},required:["signature"]},{properties:{signature:{type:"null"}}}]}},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)})(Yt=Bt.AuthLink||(Bt.AuthLink={})),function(Xt){Xt.schema={type:"array",items:Yt.schema,minItems:1},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)}(Bt.AuthChain||(Bt.AuthChain={}))})(authChain$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PointerChangesSyncDeployment=Bt.SnapshotSyncDeployment=void 0;const Wt=misc$3,Gt=authChain$3,Yt=validation$6;(function(Xt){Xt.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:Gt.AuthChain.schema,entityTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:Wt.IPFSv1.schema}},{properties:{entityId:Wt.IPFSv2.schema}}],required:["entityId","entityType","pointers","entityTimestamp","authChain"]},Xt.validate=(0,Yt.generateLazyValidator)(Xt.schema)})(Bt.SnapshotSyncDeployment||(Bt.SnapshotSyncDeployment={})),function(Xt){Xt.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:Gt.AuthChain.schema,entityTimestamp:{type:"number",minimum:0},localTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:Wt.IPFSv1.schema}},{properties:{entityId:Wt.IPFSv2.schema}}],required:["entityId","entityType","pointers","localTimestamp","entityTimestamp","authChain"]},Xt.validate=(0,Yt.generateLazyValidator)(Xt.schema)}(Bt.PointerChangesSyncDeployment||(Bt.PointerChangesSyncDeployment={}))})(syncDeployments$3);var entity$3={},contentMapping$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.ContentMapping=void 0;const Wt=misc$3,Gt=validation$6;(function(Yt){Yt.schema={type:"object",properties:{file:{type:"string",minLength:1},hash:{type:"string",oneOf:[Wt.IPFSv1.schema,Wt.IPFSv2.schema]}},required:["file","hash"]},Yt.validate=(0,Gt.generateLazyValidator)(Yt.schema)})(Bt.ContentMapping||(Bt.ContentMapping={}))})(contentMapping$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Entity=Bt.EntityType=void 0;const Wt=misc$3,Gt=contentMapping$3,Yt=validation$6;(function(Xt){Xt.SCENE="scene",Xt.PROFILE="profile",Xt.WEARABLE="wearable",Xt.STORE="store",Xt.EMOTE="emote",Xt.OUTFITS="outfits"})(Bt.EntityType||(Bt.EntityType={})),function(Xt){Xt.schema={type:"object",properties:{version:{type:"string",enum:["v3"]},id:{type:"string",oneOf:[Wt.IPFSv1.schema,Wt.IPFSv2.schema]},type:{type:"string"},pointers:{type:"array",items:{type:"string",minLength:1}},timestamp:{type:"number",minimum:0},content:{type:"array",items:Gt.ContentMapping.schema},metadata:{type:"object",nullable:!0}},required:["version","id","type","pointers","timestamp","content"]},Xt.validate=(0,Yt.generateLazyValidator)(Xt.schema)}(Bt.Entity||(Bt.Entity={}))})(entity$3);var deploymentWithAuthChain$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.DeploymentWithAuthChain=void 0;const Wt=authChain$3,Gt=validation$6;(function(Yt){Yt.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},localTimestamp:{type:"number",minimum:0},authChain:Wt.AuthChain.schema},required:["entityId","entityType","pointers","localTimestamp","authChain"]},Yt.validate=(0,Gt.generateLazyValidator)(Yt.schema)})(Bt.DeploymentWithAuthChain||(Bt.DeploymentWithAuthChain={}))})(deploymentWithAuthChain$3);var outfits$7={},outfits$6={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Outfits=Bt.Outfit=void 0;const Wt=wearableCategory$3,Gt=misc$3,Yt=validation$6;var Xt;(function(Jt){Jt.schema={type:"object",required:["bodyShape","eyes","hair","skin","wearables"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:Gt.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:Wt.WearableCategory.schema}},additionalProperties:!0},Jt.validate=(0,Yt.generateLazyValidator)(Jt.schema)})(Xt=Bt.Outfit||(Bt.Outfit={})),function(Jt){Jt.schema={type:"object",required:["outfits","namesForExtraSlots"],properties:{outfits:{type:"array",items:{type:"object",required:["slot","outfit"],properties:{slot:{type:"number"},outfit:Xt.schema}}},namesForExtraSlots:{type:"array",uniqueItems:!0,items:{type:"string"}}},additionalProperties:!0},Jt.validate=(0,Yt.generateLazyValidator)(Jt.schema)}(Bt.Outfits||(Bt.Outfits={}))})(outfits$6);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(outfits$6,Bt)})(outfits$7);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(profile$7,Bt),Gt(scene$7,Bt),Gt(requireItem$3(),Bt),Gt(displayable$3,Bt),Gt(merkleTree$3,Bt),Gt(syncDeployments$3,Bt),Gt(entity$3,Bt),Gt(deploymentWithAuthChain$3,Bt),Gt(outfits$7,Bt)})(platform$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.NFT=Bt.NFTSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=platform$3,Xt=network$5,Jt=nftCategory$3,Zt=rarity$3,Qt=wearableCategory$3;(function(ur){ur.NAME="name",ur.NEWEST="newest",ur.RECENTLY_LISTED="recently_listed",ur.RECENTLY_SOLD="recently_sold",ur.CHEAPEST="cheapest",ur.RENTAL_LISTING_DATE="rental_listing_date",ur.RENTAL_DATE="rented_date",ur.MAX_RENTAL_PRICE="max_rental_price",ur.MIN_RENTAL_PRICE="min_rental_price"})(Bt.NFTSortBy||(Bt.NFTSortBy={})),function(ur){ur.schema={type:"object",properties:{id:{type:"string"},tokenId:{type:"string"},contractAddress:{type:"string"},activeOrderId:{type:"string",nullable:!0},openRentalId:{type:"string",nullable:!0},owner:{type:"string"},name:{type:"string"},image:{type:"string"},url:{type:"string"},data:{type:"object",nullable:!1,properties:{parcel:{type:"object",properties:{description:{type:["string"],nullable:!0},x:{type:"string"},y:{type:"string"},estate:{type:"object",properties:{tokenId:{type:"string"},name:{type:"string"}},required:["tokenId","name"],nullable:!0}},required:["description","x","y","estate"],nullable:!0},estate:{type:"object",properties:{description:{type:["string"],nullable:!0},size:{type:"integer"},parcels:{type:"array",items:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"]}}},required:["description","size","parcels"],nullable:!0},wearable:{type:"object",properties:{bodyShapes:{type:"array",items:Yt.BodyShape.schema},category:Qt.WearableCategory.schema,description:{type:"string"},rarity:Zt.Rarity.schema,isSmart:{type:"boolean"}},required:["bodyShapes","category","description","rarity","isSmart"],nullable:!0},ens:{type:"object",properties:{subdomain:{type:"string"}},required:["subdomain"],nullable:!0},emote:{type:"object",properties:{bodyShapes:{type:"array",items:Yt.BodyShape.schema},category:Yt.EmoteCategory.schema,description:{type:"string"},rarity:Zt.Rarity.schema,loop:{type:"boolean"}},required:["bodyShapes","category","description","rarity","loop"],nullable:!0}},required:[]},issuedId:{type:"string",nullable:!0},itemId:{type:"string",nullable:!0},category:Jt.NFTCategory.schema,network:Xt.Network.schema,chainId:Gt.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},soldAt:{type:"integer"}},required:["id","tokenId","contractAddress","activeOrderId","openRentalId","owner","name","image","url","data","issuedId","itemId","category","network","chainId","createdAt","updatedAt","soldAt"]},ur.validate=(0,Wt.generateLazyValidator)(ur.schema)}(Bt.NFT||(Bt.NFT={}))})(nft$3);(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Item=Bt.ItemSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=network$5,Xt=nft$3,Jt=nftCategory$3;(function(Zt){Zt.NAME="name",Zt.NEWEST="newest",Zt.RECENTLY_REVIEWED="recently_reviewed",Zt.RECENTLY_SOLD="recently_sold",Zt.RECENTLY_LISTED="recently_listed",Zt.CHEAPEST="cheapest"})(Bt.ItemSortBy||(Bt.ItemSortBy={})),function(Zt){Zt.schema={type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail:{type:"string"},url:{type:"string"},category:Jt.NFTCategory.schema,contractAddress:{type:"string"},itemId:{type:"string"},rarity:{type:"string"},price:{type:"string"},available:{type:"integer"},isOnSale:{type:"boolean"},creator:{type:"string"},beneficiary:{type:"string",nullable:!0},data:Xt.NFT.schema.properties.data,network:Yt.Network.schema,chainId:Gt.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},soldAt:{type:"integer"},firstListedAt:{type:"integer",nullable:!0},picks:{type:"object",properties:{pickedByUser:{type:"boolean",nullable:!0},count:{type:"integer"}},required:["count"],nullable:!0},minPrice:{type:"string",nullable:!0},minListingPrice:{type:"string",nullable:!0},maxListingPrice:{type:"string",nullable:!0},listings:{type:"integer",nullable:!0},owners:{type:"integer",nullable:!0}},required:["id","name","thumbnail","url","category","contractAddress","itemId","rarity","price","available","isOnSale","creator","data","network","chainId","createdAt","updatedAt","soldAt"]},Zt.validate=(0,Wt.generateLazyValidator)(Zt.schema)}(Bt.Item||(Bt.Item={}))})(item$7);var metaTransactions$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.MetaTransaction=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{from:{type:"string"},params:{type:"array",items:[{type:"string"},{type:"string"}],additionalItems:!1,minItems:2}},additionalProperties:!1,required:["from","params"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.MetaTransaction||(Bt.MetaTransaction={}))})(metaTransactions$3);var mint$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Mint=Bt.MintSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=network$5;(function(Xt){Xt.RECENTLY_MINTED="recently_minted",Xt.MOST_EXPENSIVE="most_expensive"})(Bt.MintSortBy||(Bt.MintSortBy={})),function(Xt){Xt.schema={type:"object",properties:{id:{type:"string"},creator:{type:"string"},beneficiary:{type:"string"},minter:{type:"string"},price:{type:"string",nullable:!0},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},issuedId:{type:"string"},timestamp:{type:"integer"},network:Yt.Network.schema,chainId:Gt.ChainId.schema},required:["id","creator","beneficiary","minter","itemId","tokenId","issuedId","contractAddress","price","timestamp","network","chainId"]},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)}(Bt.Mint||(Bt.Mint={}))})(mint$3);var catalog$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.CatalogSortDirection=Bt.CatalogSortBy=void 0,function(Wt){Wt.NEWEST="newest",Wt.RECENTLY_SOLD="recently_sold",Wt.CHEAPEST="cheapest",Wt.MOST_EXPENSIVE="most_expensive",Wt.RECENTLY_LISTED="recently_listed"}(Bt.CatalogSortBy||(Bt.CatalogSortBy={})),function(Wt){Wt.ASC="asc",Wt.DESC="desc"}(Bt.CatalogSortDirection||(Bt.CatalogSortDirection={}))})(catalog$3);var order$4={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Order=Bt.OrderSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=listingStatus$3,Xt=network$5;(function(Jt){Jt.RECENTLY_LISTED="recently_listed",Jt.RECENTLY_UPDATED="recently_updated",Jt.CHEAPEST="cheapest",Jt.ISSUED_ID_ASC="issued_id_asc",Jt.ISSUED_ID_DESC="issued_id_desc",Jt.OLDEST="oldest"})(Bt.OrderSortBy||(Bt.OrderSortBy={})),function(Jt){Jt.schema={type:"object",properties:{id:{type:"string"},marketplaceAddress:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},owner:{type:"string"},buyer:{type:["string"],nullable:!0},price:{type:"string"},status:Yt.ListingStatus.schema,network:Xt.Network.schema,chainId:Gt.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"},issuedId:{type:"string"}},required:["id","marketplaceAddress","contractAddress","tokenId","owner","buyer","price","status","network","chainId","expiresAt","createdAt","updatedAt"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Bt.Order||(Bt.Order={}))})(order$4);var saleType$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.SaleType=void 0;const Wt=validation$6;(function(Gt){Gt.ORDER="order",Gt.BID="bid",Gt.MINT="mint"})(Bt.SaleType||(Bt.SaleType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.SaleType||(Bt.SaleType={}))})(saleType$3);var sale$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Sale=Bt.SaleSortBy=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=saleType$3,Xt=network$5;(function(Jt){Jt.RECENTLY_SOLD="recently_sold",Jt.MOST_EXPENSIVE="most_expensive"})(Bt.SaleSortBy||(Bt.SaleSortBy={})),function(Jt){Jt.schema={type:"object",properties:{id:{type:"string"},type:Yt.SaleType.schema,buyer:{type:"string"},seller:{type:"string"},price:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},txHash:{type:"string"},timestamp:{type:"integer"},network:Xt.Network.schema,chainId:Gt.ChainId.schema},required:["id","buyer","seller","itemId","tokenId","price","contractAddress","timestamp","txHash","network","chainId"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Bt.Sale||(Bt.Sale={}))})(sale$3);var rentalsListings$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.RentalListingCreation=Bt.PeriodCreation=Bt.RentalsListingsSortBy=Bt.RentalsListingsFilterByCategory=Bt.RentalsListingSortDirection=Bt.RentalStatus=void 0;const Wt=validation$6,Gt=requireChainId$3(),Yt=network$5;(function(Jt){Jt.OPEN="open",Jt.CANCELLED="cancelled",Jt.EXECUTED="executed",Jt.CLAIMED="claimed"})(Bt.RentalStatus||(Bt.RentalStatus={})),function(Jt){Jt.ASC="asc",Jt.DESC="desc"}(Bt.RentalsListingSortDirection||(Bt.RentalsListingSortDirection={})),function(Jt){Jt.PARCEL="parcel",Jt.ESTATE="estate"}(Bt.RentalsListingsFilterByCategory||(Bt.RentalsListingsFilterByCategory={})),function(Jt){Jt.LAND_CREATION_DATE="land_creation_date",Jt.RENTAL_LISTING_DATE="rental_listing_date",Jt.RENTAL_DATE="rented_date",Jt.NAME="name",Jt.MAX_RENTAL_PRICE="max_rental_price",Jt.MIN_RENTAL_PRICE="min_rental_price"}(Bt.RentalsListingsSortBy||(Bt.RentalsListingsSortBy={}));var Xt;(function(Jt){Jt.schema={type:"object",properties:{minDays:{type:"integer",minimum:0,maximum:2147483647},maxDays:{type:"integer",minimum:0,maximum:2147483647},pricePerDay:{type:"string",pattern:"^[0-9]+$"}},additionalProperties:!1,required:["minDays","maxDays","pricePerDay"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)})(Xt=Bt.PeriodCreation||(Bt.PeriodCreation={})),function(Jt){Jt.schema={type:"object",properties:{network:Yt.Network.schema,chainId:Gt.ChainId.schema,expiration:{type:"number",minimum:0},signature:{type:"string",minLength:1},tokenId:{type:"string",minLength:1},nonces:{type:"array",minItems:3,maxItems:3,items:{minLength:1,type:"string",pattern:"^[0-9]+$"}},contractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},rentalContractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},periods:{type:"array",minItems:1,maxItems:100,uniqueItems:!0,items:Xt.schema},target:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"}},additionalProperties:!1,required:["network","chainId","expiration","signature","nonces","tokenId","contractAddress","rentalContractAddress","periods","target"]},Jt.validate=(0,Wt.generateLazyValidator)(Jt.schema)}(Bt.RentalListingCreation||(Bt.RentalListingCreation={}))})(rentalsListings$3);var analyticsDayData$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AnalyticsDayDataSortBy=void 0,function(Wt){Wt.DATE="date",Wt.MOST_SALES="most_sales"}(Bt.AnalyticsDayDataSortBy||(Bt.AnalyticsDayDataSortBy={}))})(analyticsDayData$3);var store$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Store=void 0;const Wt=validation$6;(function(Gt){Gt.schema={type:"object",properties:{id:{type:"string"},version:{type:"number"},owner:{type:"string"},description:{type:"string"},links:{type:"array",items:{type:"object",properties:{name:{type:"string"},url:{type:"string"}},required:["name","url"]}},images:{type:"array",items:{type:"object",properties:{name:{type:"string"},file:{type:"string"}},required:["name","file"]}}},required:["id","version","owner","description","links","images"]},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)})(Bt.Store||(Bt.Store={}))})(store$3);var wearableGender$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.GenderFilterOption=Bt.WearableGender=void 0;const Wt=validation$6;(function(Gt){Gt.MALE="male",Gt.FEMALE="female"})(Bt.WearableGender||(Bt.WearableGender={})),function(Gt){Gt.MALE="male",Gt.FEMALE="female",Gt.UNISEX="unisex"}(Bt.GenderFilterOption||(Bt.GenderFilterOption={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.WearableGender||(Bt.WearableGender={}))})(wearableGender$3);var world$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.World=Bt.isInsideWorldLimits=Bt.getWorld=void 0;const Wt=validation$6;function Gt(){return{validWorldRanges:[{xMin:-150,yMin:-150,xMax:150,yMax:150},{xMin:62,yMin:151,xMax:162,yMax:158},{xMin:151,yMin:144,xMax:162,yMax:150},{xMin:151,yMin:59,xMax:163,yMax:143}]}}Bt.getWorld=Gt;function Yt(Xt,Jt){const Zt=Gt().validWorldRanges;for(const Qt of Zt)if(Xt>=Qt.xMin&&Xt<=Qt.xMax&&Jt>=Qt.yMin&&Jt<=Qt.yMax)return!0;return!1}Bt.isInsideWorldLimits=Yt,function(Xt){Xt.schema={type:"object",required:["validWorldRanges"],properties:{validWorldRanges:{type:"array",default:[{xMin:-150,yMin:-150,xMax:150,yMax:150}],items:{type:"object",required:["xMin","yMin","xMax","yMax"],properties:{xMin:{type:"integer"},yMin:{type:"integer"},xMax:{type:"integer"},yMax:{type:"integer"}}}}},additionalProperties:!1},Xt.validate=(0,Wt.generateLazyValidator)(Xt.schema)}(Bt.World||(Bt.World={}))})(world$3);var preview$3={},previewCamera$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewCamera=void 0;const Wt=validation$6;(function(Gt){Gt.STATIC="static",Gt.INTERACTIVE="interactive"})(Bt.PreviewCamera||(Bt.PreviewCamera={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewCamera||(Bt.PreviewCamera={}))})(previewCamera$3);var previewConfig$3={};Object.defineProperty(previewConfig$3,"__esModule",{value:!0});var previewController$3={};Object.defineProperty(previewController$3,"__esModule",{value:!0});var previewEmoteEventType$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmoteEventType=void 0;const Wt=validation$6;(function(Gt){Gt.ANIMATION_PLAY="animation_play",Gt.ANIMATION_PAUSE="animation_pause",Gt.ANIMATION_LOOP="animation_loop",Gt.ANIMATION_END="animation_end",Gt.ANIMATION_PLAYING="animation_playing"})(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={}))})(previewEmoteEventType$3);var previewEmote$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmote=void 0;const Wt=validation$6;(function(Gt){Gt.IDLE="idle",Gt.CLAP="clap",Gt.DAB="dab",Gt.DANCE="dance",Gt.FASHION="fashion",Gt.FASHION_2="fashion-2",Gt.FASHION_3="fashion-3",Gt.FASHION_4="fashion-4",Gt.LOVE="love",Gt.MONEY="money",Gt.FIST_PUMP="fist-pump",Gt.HEAD_EXPLODE="head-explode"})(Bt.PreviewEmote||(Bt.PreviewEmote={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmote||(Bt.PreviewEmote={}))})(previewEmote$3);var previewMessage$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sendMessage=Bt.PreviewMessageType=void 0;const Wt=validation$6;(function(Yt){Yt.READY="ready",Yt.LOAD="load",Yt.ERROR="error",Yt.UPDATE="update",Yt.CONTROLLER_REQUEST="controller_request",Yt.CONTROLLER_RESPONSE="controller_response",Yt.EMOTE_EVENT="emote_event"})(Bt.PreviewMessageType||(Bt.PreviewMessageType={})),function(Yt){Yt.schema={type:"string",enum:Object.values(Yt)},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)}(Bt.PreviewMessageType||(Bt.PreviewMessageType={}));const Gt=(Yt,Xt,Jt,Zt="*")=>{const Qt={type:Xt,payload:Jt};Yt.postMessage(Qt,Zt)};Bt.sendMessage=Gt})(previewMessage$3);var previewOptions$3={};Object.defineProperty(previewOptions$3,"__esModule",{value:!0});var previewProjection$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewProjection=void 0;const Wt=validation$6;(function(Gt){Gt.ORTHOGRAPHIC="orthographic",Gt.PERSPECTIVE="perspective"})(Bt.PreviewProjection||(Bt.PreviewProjection={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewProjection||(Bt.PreviewProjection={}))})(previewProjection$3);var previewType$3={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewType=void 0;const Wt=validation$6;(function(Gt){Gt.TEXTURE="texture",Gt.WEARABLE="wearable",Gt.AVATAR="avatar"})(Bt.PreviewType||(Bt.PreviewType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewType||(Bt.PreviewType={}))})(previewType$3);var wearableRepresentationDefinition$3={};Object.defineProperty(wearableRepresentationDefinition$3,"__esModule",{value:!0});var wearableRepresentationWithBlobs$3={};Object.defineProperty(wearableRepresentationWithBlobs$3,"__esModule",{value:!0});var wearableDefinition$3={};Object.defineProperty(wearableDefinition$3,"__esModule",{value:!0});var wearableWithBlobs$3={};Object.defineProperty(wearableWithBlobs$3,"__esModule",{value:!0});var emoteRepresentationDefinition$3={};Object.defineProperty(emoteRepresentationDefinition$3,"__esModule",{value:!0});var emoteRepresentationWithBlobs$3={};Object.defineProperty(emoteRepresentationWithBlobs$3,"__esModule",{value:!0});var emoteDefinition$3={};Object.defineProperty(emoteDefinition$3,"__esModule",{value:!0});var emoteWithBlobs$3={};Object.defineProperty(emoteWithBlobs$3,"__esModule",{value:!0});(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(previewCamera$3,Bt),Gt(previewConfig$3,Bt),Gt(previewController$3,Bt),Gt(previewEmoteEventType$3,Bt),Gt(previewEmote$3,Bt),Gt(previewMessage$3,Bt),Gt(previewOptions$3,Bt),Gt(previewProjection$3,Bt),Gt(previewType$3,Bt),Gt(wearableRepresentationDefinition$3,Bt),Gt(wearableRepresentationWithBlobs$3,Bt),Gt(wearableDefinition$3,Bt),Gt(wearableWithBlobs$3,Bt),Gt(emoteRepresentationDefinition$3,Bt),Gt(emoteRepresentationWithBlobs$3,Bt),Gt(emoteDefinition$3,Bt),Gt(emoteWithBlobs$3,Bt)})(preview$3);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Nr,Ur,Vr,Zr){Zr===void 0&&(Zr=Vr);var Xr=Object.getOwnPropertyDescriptor(Ur,Vr);(!Xr||("get"in Xr?!Ur.__esModule:Xr.writable||Xr.configurable))&&(Xr={enumerable:!0,get:function(){return Ur[Vr]}}),Object.defineProperty(Nr,Zr,Xr)}:function(Nr,Ur,Vr,Zr){Zr===void 0&&(Zr=Vr),Nr[Zr]=Ur[Vr]}),Gt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Nr,Ur){Object.defineProperty(Nr,"default",{enumerable:!0,value:Ur})}:function(Nr,Ur){Nr.default=Ur}),Yt=commonjsGlobal&&commonjsGlobal.__importStar||function(Nr){if(Nr&&Nr.__esModule)return Nr;var Ur={};if(Nr!=null)for(var Vr in Nr)Vr!=="default"&&Object.prototype.hasOwnProperty.call(Nr,Vr)&&Wt(Ur,Nr,Vr);return Gt(Ur,Nr),Ur},Xt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Nr,Ur){for(var Vr in Nr)Vr!=="default"&&!Object.prototype.hasOwnProperty.call(Ur,Vr)&&Wt(Ur,Nr,Vr)};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sdk=Bt.isInsideWorldLimits=Bt.getWorld=Bt.World=Bt.GenderFilterOption=Bt.WearableGender=Bt.Store=Bt.AnalyticsDayDataSortBy=Bt.PeriodCreation=Bt.RentalListingCreation=Bt.RentalsListingsSortBy=Bt.RentalsListingsFilterByCategory=Bt.RentalsListingSortDirection=Bt.RentalStatus=Bt.SaleSortBy=Bt.Sale=Bt.SaleType=Bt.Rarity=Bt.ProviderType=Bt.OrderSortBy=Bt.Order=Bt.CatalogSortDirection=Bt.CatalogSortBy=Bt.NFTSortBy=Bt.NFT=Bt.NFTCategory=Bt.Network=Bt.MintSortBy=Bt.Mint=Bt.MetaTransaction=Bt.ListingStatus=Bt.ItemSortBy=Bt.Item=Bt.ContractSortBy=Bt.Contract=Bt.CollectionSortBy=Bt.Collection=Bt.getChainId=Bt.ChainName=Bt.getURNProtocol=Bt.getChainName=Bt.ChainId=Bt.AccountSortBy=Bt.Account=Bt.BidSortBy=Bt.Bid=void 0;const Jt=Yt(sdk$3);Bt.sdk=Jt,Xt(validation$6,Bt);var Zt=bid$3;Object.defineProperty(Bt,"Bid",{enumerable:!0,get:function(){return Zt.Bid}}),Object.defineProperty(Bt,"BidSortBy",{enumerable:!0,get:function(){return Zt.BidSortBy}});var Qt=account$3;Object.defineProperty(Bt,"Account",{enumerable:!0,get:function(){return Qt.Account}}),Object.defineProperty(Bt,"AccountSortBy",{enumerable:!0,get:function(){return Qt.AccountSortBy}});var ur=requireChainId$3();Object.defineProperty(Bt,"ChainId",{enumerable:!0,get:function(){return ur.ChainId}}),Object.defineProperty(Bt,"getChainName",{enumerable:!0,get:function(){return ur.getChainName}}),Object.defineProperty(Bt,"getURNProtocol",{enumerable:!0,get:function(){return ur.getURNProtocol}});var cr=requireChainName$3();Object.defineProperty(Bt,"ChainName",{enumerable:!0,get:function(){return cr.ChainName}}),Object.defineProperty(Bt,"getChainId",{enumerable:!0,get:function(){return cr.getChainId}});var $r=collection$3;Object.defineProperty(Bt,"Collection",{enumerable:!0,get:function(){return $r.Collection}}),Object.defineProperty(Bt,"CollectionSortBy",{enumerable:!0,get:function(){return $r.CollectionSortBy}});var Ar=contract$3;Object.defineProperty(Bt,"Contract",{enumerable:!0,get:function(){return Ar.Contract}}),Object.defineProperty(Bt,"ContractSortBy",{enumerable:!0,get:function(){return Ar.ContractSortBy}});var Lr=item$7;Object.defineProperty(Bt,"Item",{enumerable:!0,get:function(){return Lr.Item}}),Object.defineProperty(Bt,"ItemSortBy",{enumerable:!0,get:function(){return Lr.ItemSortBy}});var qr=listingStatus$3;Object.defineProperty(Bt,"ListingStatus",{enumerable:!0,get:function(){return qr.ListingStatus}});var Fr=metaTransactions$3;Object.defineProperty(Bt,"MetaTransaction",{enumerable:!0,get:function(){return Fr.MetaTransaction}});var Hr=mint$3;Object.defineProperty(Bt,"Mint",{enumerable:!0,get:function(){return Hr.Mint}}),Object.defineProperty(Bt,"MintSortBy",{enumerable:!0,get:function(){return Hr.MintSortBy}});var Br=network$5;Object.defineProperty(Bt,"Network",{enumerable:!0,get:function(){return Br.Network}});var Wr=nftCategory$3;Object.defineProperty(Bt,"NFTCategory",{enumerable:!0,get:function(){return Wr.NFTCategory}});var Gr=nft$3;Object.defineProperty(Bt,"NFT",{enumerable:!0,get:function(){return Gr.NFT}}),Object.defineProperty(Bt,"NFTSortBy",{enumerable:!0,get:function(){return Gr.NFTSortBy}});var Kr=catalog$3;Object.defineProperty(Bt,"CatalogSortBy",{enumerable:!0,get:function(){return Kr.CatalogSortBy}}),Object.defineProperty(Bt,"CatalogSortDirection",{enumerable:!0,get:function(){return Kr.CatalogSortDirection}});var Yr=order$4;Object.defineProperty(Bt,"Order",{enumerable:!0,get:function(){return Yr.Order}}),Object.defineProperty(Bt,"OrderSortBy",{enumerable:!0,get:function(){return Yr.OrderSortBy}});var hn=providerType$3;Object.defineProperty(Bt,"ProviderType",{enumerable:!0,get:function(){return hn.ProviderType}});var Qr=rarity$3;Object.defineProperty(Bt,"Rarity",{enumerable:!0,get:function(){return Qr.Rarity}});var pn=saleType$3;Object.defineProperty(Bt,"SaleType",{enumerable:!0,get:function(){return pn.SaleType}});var En=sale$3;Object.defineProperty(Bt,"Sale",{enumerable:!0,get:function(){return En.Sale}}),Object.defineProperty(Bt,"SaleSortBy",{enumerable:!0,get:function(){return En.SaleSortBy}});var ga=rentalsListings$3;Object.defineProperty(Bt,"RentalStatus",{enumerable:!0,get:function(){return ga.RentalStatus}}),Object.defineProperty(Bt,"RentalsListingSortDirection",{enumerable:!0,get:function(){return ga.RentalsListingSortDirection}}),Object.defineProperty(Bt,"RentalsListingsFilterByCategory",{enumerable:!0,get:function(){return ga.RentalsListingsFilterByCategory}}),Object.defineProperty(Bt,"RentalsListingsSortBy",{enumerable:!0,get:function(){return ga.RentalsListingsSortBy}}),Object.defineProperty(Bt,"RentalListingCreation",{enumerable:!0,get:function(){return ga.RentalListingCreation}}),Object.defineProperty(Bt,"PeriodCreation",{enumerable:!0,get:function(){return ga.PeriodCreation}});var dn=analyticsDayData$3;Object.defineProperty(Bt,"AnalyticsDayDataSortBy",{enumerable:!0,get:function(){return dn.AnalyticsDayDataSortBy}});var Pr=store$3;Object.defineProperty(Bt,"Store",{enumerable:!0,get:function(){return Pr.Store}});var xr=wearableGender$3;Object.defineProperty(Bt,"WearableGender",{enumerable:!0,get:function(){return xr.WearableGender}}),Object.defineProperty(Bt,"GenderFilterOption",{enumerable:!0,get:function(){return xr.GenderFilterOption}});var Mr=world$3;Object.defineProperty(Bt,"World",{enumerable:!0,get:function(){return Mr.World}}),Object.defineProperty(Bt,"getWorld",{enumerable:!0,get:function(){return Mr.getWorld}}),Object.defineProperty(Bt,"isInsideWorldLimits",{enumerable:!0,get:function(){return Mr.isInsideWorldLimits}}),Xt(preview$3,Bt),Xt(platform$3,Bt),Xt(misc$3,Bt),Xt(authChain$3,Bt),Xt(contentMapping$3,Bt)})(dist$e);var __awaiter$g=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(TryPreviousConnectionWrapper,"__esModule",{value:!0});TryPreviousConnectionWrapper.TryPreviousConnection=void 0;const schemas_1$2=dist$e,decentraland_connect_1$4=dist$n;class TryPreviousConnection{constructor(Wt){this.fetchIsWalletConnectV2Enabled=Wt,this.exec=()=>__awaiter$g(this,void 0,void 0,function*(){const Gt=decentraland_connect_1$4.connection.getConnectionData(),Yt=Gt==null?void 0:Gt.providerType;if(Yt&&(Yt===schemas_1$2.ProviderType.WALLET_CONNECT||Yt===schemas_1$2.ProviderType.WALLET_CONNECT_V2)){const Xt=yield this.fetchIsWalletConnectV2Enabled();(Xt&&Yt===schemas_1$2.ProviderType.WALLET_CONNECT||!Xt&&Yt===schemas_1$2.ProviderType.WALLET_CONNECT_V2)&&(yield decentraland_connect_1$4.connection.disconnect())}return decentraland_connect_1$4.connection.tryPreviousConnection()})}}TryPreviousConnectionWrapper.TryPreviousConnection=TryPreviousConnection;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.tryPreviousConnection=Bt.fetchIsWalletConnectV2Enabled=void 0;const Wt=FetchIsWalletConnectV2EnabledWrapper,Gt=TryPreviousConnectionWrapper;Bt.fetchIsWalletConnectV2Enabled=new Wt.FetchIsWalletConnectV2Enabled().exec,Bt.tryPreviousConnection=new Gt.TryPreviousConnection(Bt.fetchIsWalletConnectV2Enabled).exec})(wcv2Utils);var __awaiter$f=commonjsGlobal&&commonjsGlobal.__awaiter||function(Bt,Wt,Gt,Yt){function Xt(Jt){return Jt instanceof Gt?Jt:new Gt(function(Zt){Zt(Jt)})}return new(Gt||(Gt=Promise))(function(Jt,Zt){function Qt($r){try{cr(Yt.next($r))}catch(Ar){Zt(Ar)}}function ur($r){try{cr(Yt.throw($r))}catch(Ar){Zt(Ar)}}function cr($r){$r.done?Jt($r.value):Xt($r.value).then(Qt,ur)}cr((Yt=Yt.apply(Bt,Wt||[])).next())})};Object.defineProperty(eth,"__esModule",{value:!0});eth.getChainIdByNetwork=eth.isValidChainId=eth.isCoinbaseProvider=eth.isDapperProvider=eth.isCucumberProvider=eth.getConnectedProviderChainId=eth.getConnectedProviderType=eth.getSigner=eth.getConnectedProvider=eth.getNetworkWeb3Provider=eth.getNetworkProvider=eth._setAppChainId=eth._getAppChainId=void 0;const decentraland_connect_1$3=dist$n,chain_id_1$4=requireChainId$3(),ethers_1$4=require$$0$5,provider_type_1$1=providerType$3,chainConfiguration_1$3=chainConfiguration,utils_1$j=utils$q,wcv2Utils_1$1=wcv2Utils;let appChainId;function _getAppChainId(){return appChainId}eth._getAppChainId=_getAppChainId;function _setAppChainId(Bt){appChainId=Bt}eth._setAppChainId=_setAppChainId;function getNetworkProvider(Bt){return __awaiter$f(this,void 0,void 0,function*(){const Wt=yield getConnectedProvider();if(Wt){const Gt=yield new ethers_1$4.ethers.providers.Web3Provider(Wt).getSigner().getChainId();if(Bt===Gt)return Wt}return decentraland_connect_1$3.connection.createProvider(provider_type_1$1.ProviderType.NETWORK,Bt)})}eth.getNetworkProvider=getNetworkProvider;function getNetworkWeb3Provider(Bt){return __awaiter$f(this,void 0,void 0,function*(){const Wt=yield getNetworkProvider(Bt);return new ethers_1$4.ethers.providers.Web3Provider(Wt)})}eth.getNetworkWeb3Provider=getNetworkWeb3Provider;function getConnectedProvider(){return __awaiter$f(this,void 0,void 0,function*(){try{const{provider:Bt}=yield(0,wcv2Utils_1$1.tryPreviousConnection)();return Bt||null}catch{return null}})}eth.getConnectedProvider=getConnectedProvider;function getSigner(){return __awaiter$f(this,void 0,void 0,function*(){const Bt=yield getConnectedProvider();if(!Bt)throw new Error("Could not connect to provider");return new ethers_1$4.ethers.providers.Web3Provider(Bt).getSigner()})}eth.getSigner=getSigner;function getConnectedProviderType(){const Bt=decentraland_connect_1$3.connection.getConnectionData();return Bt?Bt.providerType:null}eth.getConnectedProviderType=getConnectedProviderType;function getConnectedProviderChainId(){const Bt=decentraland_connect_1$3.connection.getConnectionData();return Bt?Bt.chainId:null}eth.getConnectedProviderChainId=getConnectedProviderChainId;function isCucumberProvider(){const Bt=window.ethereum;return(0,utils_1$j.isMobile)()&&!!Bt&&!!Bt.isCucumber}eth.isCucumberProvider=isCucumberProvider;function isDapperProvider(){const Bt=window.ethereum;return!!Bt&&!!Bt.isDapper}eth.isDapperProvider=isDapperProvider;function isCoinbaseProvider(){const Bt=window.ethereum;return!!Bt&&!!Bt.isToshi}eth.isCoinbaseProvider=isCoinbaseProvider;function isValidChainId(Bt){return Object.values(chain_id_1$4.ChainId).includes(Number(Bt))}eth.isValidChainId=isValidChainId;function getChainIdByNetwork(Bt){const Wt=_getAppChainId();if(!Wt)throw new Error("Could not get app chain id");return(0,chainConfiguration_1$3.getChainConfiguration)(Wt).networkMapping[Bt]}eth.getChainIdByNetwork=getChainIdByNetwork;var buildWallet$1={},fetchManaBalance$1={},decentralandTransactions={exports:{}};(function(Bt,Wt){(function(Gt,Yt){Yt(Wt)})(commonjsGlobal,function(Gt){var Yt;Gt.ContractName=void 0,(Yt=Gt.ContractName||(Gt.ContractName={})).Bid="Bid",Yt.BidV2="BidV2",Yt.CollectionFactory="CollectionFactory",Yt.CollectionFactoryV3="CollectionFactoryV3",Yt.CollectionManager="CollectionManager",Yt.CollectionStore="CollectionStore",Yt.Committee="Committee",Yt.ERC20="ERC20",Yt.ERC721="ERC721",Yt.ERC721CollectionV2="ERC721CollectionV2",Yt.Forwarder="Forwarder",Yt.MANAToken="MANAToken",Yt.Marketplace="Marketplace",Yt.MarketplaceV2="MarketplaceV2",Yt.Rarities="Rarities",Yt.RaritiesWithOracle="RaritiesWithOracle",Yt.ThirdPartyRegistry="ThirdPartyRegistry",Yt.Tiers="Tiers",Yt.ChainlinkOracle="ChainlinkOracle",Yt.Rentals="Rentals",Yt.DCLRegistrar="DCLRegistrar",Yt.DCLController="DCLController",Yt.DCLControllerV2="DCLControllerV2";const Xt=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"}],Jt=[{name:"nonce",type:"uint256"},{name:"from",type:"address"},{name:"functionSignature",type:"bytes"}];function Zt(go){return go&&go.__esModule&&Object.prototype.hasOwnProperty.call(go,"default")?go.default:go}function Qt(go,vn){return go(vn={exports:{}},vn.exports),vn.exports}function ur(go){return go&&go.default||go}var cr=Qt(function(go,vn){Object.defineProperty(vn,"__esModule",{value:!0}),vn.regexpCode=vn.getEsmExportName=vn.getProperty=vn.safeStringify=vn.stringify=vn.strConcat=vn.addCodeArg=vn.str=vn._=vn.nil=vn._Code=vn.Name=vn.IDENTIFIER=vn._CodeOrName=void 0;class no{}vn._CodeOrName=no,vn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class uo extends no{constructor(Wo){if(super(),!vn.IDENTIFIER.test(Wo))throw new Error("CodeGen: name must be a valid identifier");this.str=Wo}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}vn.Name=uo;class fo extends no{constructor(Wo){super(),this._items=typeof Wo=="string"?[Wo]:Wo}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const Wo=this._items[0];return Wo===""||Wo==='""'}get str(){var Wo;return(Wo=this._str)!==null&&Wo!==void 0?Wo:this._str=this._items.reduce((su,bu)=>`${su}${bu}`,"")}get names(){var Wo;return(Wo=this._names)!==null&&Wo!==void 0?Wo:this._names=this._items.reduce((su,bu)=>(bu instanceof uo&&(su[bu.str]=(su[bu.str]||0)+1),su),{})}}function vo(ru,...Wo){const su=[ru[0]];let bu=0;for(;bu<Wo.length;)Uo(su,Wo[bu]),su.push(ru[++bu]);return new fo(su)}vn._Code=fo,vn.nil=new fo(""),vn._=vo;const Po=new fo("+");function No(ru,...Wo){const su=[Yo(ru[0])];let bu=0;for(;bu<Wo.length;)su.push(Po),Uo(su,Wo[bu]),su.push(Po,Yo(ru[++bu]));return function(Gu){let ul=1;for(;ul<Gu.length-1;){if(Gu[ul]===Po){const pl=Qo(Gu[ul-1],Gu[ul+1]);if(pl!==void 0){Gu.splice(ul-1,3,pl);continue}Gu[ul++]="+"}ul++}}(su),new fo(su)}function Uo(ru,Wo){var su;Wo instanceof fo?ru.push(...Wo._items):Wo instanceof uo?ru.push(Wo):ru.push(typeof(su=Wo)=="number"||typeof su=="boolean"||su===null?su:Yo(Array.isArray(su)?su.join(","):su))}function Qo(ru,Wo){return Wo==='""'?ru:ru==='""'?Wo:typeof ru=="string"?Wo instanceof uo||ru[ru.length-1]!=='"'?void 0:typeof Wo!="string"?`${ru.slice(0,-1)}${Wo}"`:Wo[0]==='"'?ru.slice(0,-1)+Wo.slice(1):void 0:typeof Wo!="string"||Wo[0]!=='"'||ru instanceof uo?void 0:`"${ru}${Wo.slice(1)}`}function Yo(ru){return JSON.stringify(ru).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vn.str=No,vn.addCodeArg=Uo,vn.strConcat=function(ru,Wo){return Wo.emptyStr()?ru:ru.emptyStr()?Wo:No`${ru}${Wo}`},vn.stringify=function(ru){return new fo(Yo(ru))},vn.safeStringify=Yo,vn.getProperty=function(ru){return typeof ru=="string"&&vn.IDENTIFIER.test(ru)?new fo(`.${ru}`):vo`[${ru}]`},vn.getEsmExportName=function(ru){if(typeof ru=="string"&&vn.IDENTIFIER.test(ru))return new fo(`${ru}`);throw new Error(`CodeGen: invalid export name: ${ru}, use explicit $id name mapping`)},vn.regexpCode=function(ru){return new fo(ru.toString())}});Zt(cr),cr.regexpCode,cr.getEsmExportName,cr.getProperty,cr.safeStringify,cr.stringify,cr.strConcat,cr.addCodeArg,cr.str,cr._,cr.nil,cr._Code,cr.Name,cr.IDENTIFIER,cr._CodeOrName;var $r=Qt(function(go,vn){Object.defineProperty(vn,"__esModule",{value:!0}),vn.ValueScope=vn.ValueScopeName=vn.Scope=vn.varKinds=vn.UsedValueState=void 0;class no extends Error{constructor(Uo){super(`CodeGen: "code" for ${Uo} not defined`),this.value=Uo.value}}var uo;(function(No){No[No.Started=0]="Started",No[No.Completed=1]="Completed"})(uo=vn.UsedValueState||(vn.UsedValueState={})),vn.varKinds={const:new cr.Name("const"),let:new cr.Name("let"),var:new cr.Name("var")};class fo{constructor({prefixes:Uo,parent:Qo}={}){this._names={},this._prefixes=Uo,this._parent=Qo}toName(Uo){return Uo instanceof cr.Name?Uo:this.name(Uo)}name(Uo){return new cr.Name(this._newName(Uo))}_newName(Uo){return`${Uo}${(this._names[Uo]||this._nameGroup(Uo)).index++}`}_nameGroup(Uo){var Qo,Yo;if(!((Yo=(Qo=this._parent)===null||Qo===void 0?void 0:Qo._prefixes)===null||Yo===void 0)&&Yo.has(Uo)||this._prefixes&&!this._prefixes.has(Uo))throw new Error(`CodeGen: prefix "${Uo}" is not allowed in this scope`);return this._names[Uo]={prefix:Uo,index:0}}}vn.Scope=fo;class vo extends cr.Name{constructor(Uo,Qo){super(Qo),this.prefix=Uo}setValue(Uo,{property:Qo,itemIndex:Yo}){this.value=Uo,this.scopePath=cr._`.${new cr.Name(Qo)}[${Yo}]`}}vn.ValueScopeName=vo;const Po=cr._`\n`;vn.ValueScope=class extends fo{constructor(No){super(No),this._values={},this._scope=No.scope,this.opts={...No,_n:No.lines?Po:cr.nil}}get(){return this._scope}name(No){return new vo(No,this._newName(No))}value(No,Uo){var Qo;if(Uo.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const Yo=this.toName(No),{prefix:ru}=Yo,Wo=(Qo=Uo.key)!==null&&Qo!==void 0?Qo:Uo.ref;let su=this._values[ru];if(su){const ul=su.get(Wo);if(ul)return ul}else su=this._values[ru]=new Map;su.set(Wo,Yo);const bu=this._scope[ru]||(this._scope[ru]=[]),Gu=bu.length;return bu[Gu]=Uo.ref,Yo.setValue(Uo,{property:ru,itemIndex:Gu}),Yo}getValue(No,Uo){const Qo=this._values[No];if(Qo)return Qo.get(Uo)}scopeRefs(No,Uo=this._values){return this._reduceValues(Uo,Qo=>{if(Qo.scopePath===void 0)throw new Error(`CodeGen: name "${Qo}" has no value`);return cr._`${No}${Qo.scopePath}`})}scopeCode(No=this._values,Uo,Qo){return this._reduceValues(No,Yo=>{if(Yo.value===void 0)throw new Error(`CodeGen: name "${Yo}" has no value`);return Yo.value.code},Uo,Qo)}_reduceValues(No,Uo,Qo={},Yo){let ru=cr.nil;for(const Wo in No){const su=No[Wo];if(!su)continue;const bu=Qo[Wo]=Qo[Wo]||new Map;su.forEach(Gu=>{if(bu.has(Gu))return;bu.set(Gu,uo.Started);let ul=Uo(Gu);if(ul){const pl=this.opts.es5?vn.varKinds.var:vn.varKinds.const;ru=cr._`${ru}${pl} ${Gu} = ${ul};${this.opts._n}`}else{if(!(ul=Yo==null?void 0:Yo(Gu)))throw new no(Gu);ru=cr._`${ru}${ul}${this.opts._n}`}bu.set(Gu,uo.Completed)})}return ru}}});Zt($r),$r.ValueScope,$r.ValueScopeName,$r.Scope,$r.varKinds,$r.UsedValueState;var Ar=Qt(function(go,vn){Object.defineProperty(vn,"__esModule",{value:!0}),vn.or=vn.and=vn.not=vn.CodeGen=vn.operators=vn.varKinds=vn.ValueScopeName=vn.ValueScope=vn.Scope=vn.Name=vn.regexpCode=vn.stringify=vn.getProperty=vn.nil=vn.strConcat=vn.str=vn._=void 0;var no=cr;Object.defineProperty(vn,"_",{enumerable:!0,get:function(){return no._}}),Object.defineProperty(vn,"str",{enumerable:!0,get:function(){return no.str}}),Object.defineProperty(vn,"strConcat",{enumerable:!0,get:function(){return no.strConcat}}),Object.defineProperty(vn,"nil",{enumerable:!0,get:function(){return no.nil}}),Object.defineProperty(vn,"getProperty",{enumerable:!0,get:function(){return no.getProperty}}),Object.defineProperty(vn,"stringify",{enumerable:!0,get:function(){return no.stringify}}),Object.defineProperty(vn,"regexpCode",{enumerable:!0,get:function(){return no.regexpCode}}),Object.defineProperty(vn,"Name",{enumerable:!0,get:function(){return no.Name}});var uo=$r;Object.defineProperty(vn,"Scope",{enumerable:!0,get:function(){return uo.Scope}}),Object.defineProperty(vn,"ValueScope",{enumerable:!0,get:function(){return uo.ValueScope}}),Object.defineProperty(vn,"ValueScopeName",{enumerable:!0,get:function(){return uo.ValueScopeName}}),Object.defineProperty(vn,"varKinds",{enumerable:!0,get:function(){return uo.varKinds}}),vn.operators={GT:new cr._Code(">"),GTE:new cr._Code(">="),LT:new cr._Code("<"),LTE:new cr._Code("<="),EQ:new cr._Code("==="),NEQ:new cr._Code("!=="),NOT:new cr._Code("!"),OR:new cr._Code("||"),AND:new cr._Code("&&"),ADD:new cr._Code("+")};class fo{optimizeNodes(){return this}optimizeNames(Ou,ml){return this}}class vo extends fo{constructor(Ou,ml,_c){super(),this.varKind=Ou,this.name=ml,this.rhs=_c}render({es5:Ou,_n:ml}){const _c=Ou?$r.varKinds.var:this.varKind,Ep=this.rhs===void 0?"":` = ${this.rhs}`;return`${_c} ${this.name}${Ep};`+ml}optimizeNames(Ou,ml){if(Ou[this.name.str])return this.rhs&&(this.rhs=Tl(this.rhs,Ou,ml)),this}get names(){return this.rhs instanceof cr._CodeOrName?this.rhs.names:{}}}class Po extends fo{constructor(Ou,ml,_c){super(),this.lhs=Ou,this.rhs=ml,this.sideEffects=_c}render({_n:Ou}){return`${this.lhs} = ${this.rhs};`+Ou}optimizeNames(Ou,ml){if(!(this.lhs instanceof cr.Name)||Ou[this.lhs.str]||this.sideEffects)return this.rhs=Tl(this.rhs,Ou,ml),this}get names(){return Qu(this.lhs instanceof cr.Name?{}:{...this.lhs.names},this.rhs)}}class No extends Po{constructor(Ou,ml,_c,Ep){super(Ou,_c,Ep),this.op=ml}render({_n:Ou}){return`${this.lhs} ${this.op}= ${this.rhs};`+Ou}}class Uo extends fo{constructor(Ou){super(),this.label=Ou,this.names={}}render({_n:Ou}){return`${this.label}:`+Ou}}class Qo extends fo{constructor(Ou){super(),this.label=Ou,this.names={}}render({_n:Ou}){return`break${this.label?` ${this.label}`:""};`+Ou}}class Yo extends fo{constructor(Ou){super(),this.error=Ou}render({_n:Ou}){return`throw ${this.error};`+Ou}get names(){return this.error.names}}class ru extends fo{constructor(Ou){super(),this.code=Ou}render({_n:Ou}){return`${this.code};`+Ou}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Ou,ml){return this.code=Tl(this.code,Ou,ml),this}get names(){return this.code instanceof cr._CodeOrName?this.code.names:{}}}class Wo extends fo{constructor(Ou=[]){super(),this.nodes=Ou}render(Ou){return this.nodes.reduce((ml,_c)=>ml+_c.render(Ou),"")}optimizeNodes(){const{nodes:Ou}=this;let ml=Ou.length;for(;ml--;){const _c=Ou[ml].optimizeNodes();Array.isArray(_c)?Ou.splice(ml,1,..._c):_c?Ou[ml]=_c:Ou.splice(ml,1)}return Ou.length>0?this:void 0}optimizeNames(Ou,ml){const{nodes:_c}=this;let Ep=_c.length;for(;Ep--;){const Np=_c[Ep];Np.optimizeNames(Ou,ml)||(Ol(Ou,Np.names),_c.splice(Ep,1))}return _c.length>0?this:void 0}get names(){return this.nodes.reduce((Ou,ml)=>rl(Ou,ml.names),{})}}class su extends Wo{render(Ou){return"{"+Ou._n+super.render(Ou)+"}"+Ou._n}}class bu extends Wo{}class Gu extends su{}Gu.kind="else";class ul extends su{constructor(Ou,ml){super(ml),this.condition=Ou}render(Ou){let ml=`if(${this.condition})`+super.render(Ou);return this.else&&(ml+="else "+this.else.render(Ou)),ml}optimizeNodes(){super.optimizeNodes();const Ou=this.condition;if(Ou===!0)return this.nodes;let ml=this.else;if(ml){const _c=ml.optimizeNodes();ml=this.else=Array.isArray(_c)?new Gu(_c):_c}return ml?Ou===!1?ml instanceof ul?ml:ml.nodes:this.nodes.length?this:new ul(jl(Ou),ml instanceof ul?[ml]:ml.nodes):Ou!==!1&&this.nodes.length?this:void 0}optimizeNames(Ou,ml){var _c;if(this.else=(_c=this.else)===null||_c===void 0?void 0:_c.optimizeNames(Ou,ml),super.optimizeNames(Ou,ml)||this.else)return this.condition=Tl(this.condition,Ou,ml),this}get names(){const Ou=super.names;return Qu(Ou,this.condition),this.else&&rl(Ou,this.else.names),Ou}}ul.kind="if";class pl extends su{}pl.kind="for";class $l extends pl{constructor(Ou){super(),this.iteration=Ou}render(Ou){return`for(${this.iteration})`+super.render(Ou)}optimizeNames(Ou,ml){if(super.optimizeNames(Ou,ml))return this.iteration=Tl(this.iteration,Ou,ml),this}get names(){return rl(super.names,this.iteration.names)}}class Al extends pl{constructor(Ou,ml,_c,Ep){super(),this.varKind=Ou,this.name=ml,this.from=_c,this.to=Ep}render(Ou){const ml=Ou.es5?$r.varKinds.var:this.varKind,{name:_c,from:Ep,to:Np}=this;return`for(${ml} ${_c}=${Ep}; ${_c}<${Np}; ${_c}++)`+super.render(Ou)}get names(){const Ou=Qu(super.names,this.from);return Qu(Ou,this.to)}}class Fl extends pl{constructor(Ou,ml,_c,Ep){super(),this.loop=Ou,this.varKind=ml,this.name=_c,this.iterable=Ep}render(Ou){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Ou)}optimizeNames(Ou,ml){if(super.optimizeNames(Ou,ml))return this.iterable=Tl(this.iterable,Ou,ml),this}get names(){return rl(super.names,this.iterable.names)}}class bl extends su{constructor(Ou,ml,_c){super(),this.name=Ou,this.args=ml,this.async=_c}render(Ou){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Ou)}}bl.kind="func";class fl extends Wo{render(Ou){return"return "+super.render(Ou)}}fl.kind="return";class gl extends su{render(Ou){let ml="try"+super.render(Ou);return this.catch&&(ml+=this.catch.render(Ou)),this.finally&&(ml+=this.finally.render(Ou)),ml}optimizeNodes(){var Ou,ml;return super.optimizeNodes(),(Ou=this.catch)===null||Ou===void 0||Ou.optimizeNodes(),(ml=this.finally)===null||ml===void 0||ml.optimizeNodes(),this}optimizeNames(Ou,ml){var _c,Ep;return super.optimizeNames(Ou,ml),(_c=this.catch)===null||_c===void 0||_c.optimizeNames(Ou,ml),(Ep=this.finally)===null||Ep===void 0||Ep.optimizeNames(Ou,ml),this}get names(){const Ou=super.names;return this.catch&&rl(Ou,this.catch.names),this.finally&&rl(Ou,this.finally.names),Ou}}class ol extends su{constructor(Ou){super(),this.error=Ou}render(Ou){return`catch(${this.error})`+super.render(Ou)}}ol.kind="catch";class Uu extends su{render(Ou){return"finally"+super.render(Ou)}}Uu.kind="finally";function rl(nl,Ou){for(const ml in Ou)nl[ml]=(nl[ml]||0)+(Ou[ml]||0);return nl}function Qu(nl,Ou){return Ou instanceof cr._CodeOrName?rl(nl,Ou.names):nl}function Tl(nl,Ou,ml){return nl instanceof cr.Name?Ep(nl):(_c=nl)instanceof cr._Code&&_c._items.some(Np=>Np instanceof cr.Name&&Ou[Np.str]===1&&ml[Np.str]!==void 0)?new cr._Code(nl._items.reduce((Np,s0)=>(s0 instanceof cr.Name&&(s0=Ep(s0)),s0 instanceof cr._Code?Np.push(...s0._items):Np.push(s0),Np),[])):nl;var _c;function Ep(Np){const s0=ml[Np.str];return s0===void 0||Ou[Np.str]!==1?Np:(delete Ou[Np.str],s0)}}function Ol(nl,Ou){for(const ml in Ou)nl[ml]=(nl[ml]||0)-(Ou[ml]||0)}function jl(nl){return typeof nl=="boolean"||typeof nl=="number"||nl===null?!nl:cr._`!${Ap(nl)}`}vn.CodeGen=class{constructor(nl,Ou={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Ou,_n:Ou.lines?`
@@ -796,7 +796,7 @@ Valid keys: `+JSON.stringify(Object.keys(to),null," "));var bo=Mo(ho,Bo,Io,Fo,x
796
796
  */(function(){var cr=typeof Symbol=="function"&&Symbol.for,$r=cr?Symbol.for("react.element"):60103,Ar=cr?Symbol.for("react.portal"):60106,Lr=cr?Symbol.for("react.fragment"):60107,qr=cr?Symbol.for("react.strict_mode"):60108,Fr=cr?Symbol.for("react.profiler"):60114,Hr=cr?Symbol.for("react.provider"):60109,Br=cr?Symbol.for("react.context"):60110,Wr=cr?Symbol.for("react.async_mode"):60111,Gr=cr?Symbol.for("react.concurrent_mode"):60111,Kr=cr?Symbol.for("react.forward_ref"):60112,Yr=cr?Symbol.for("react.suspense"):60113,hn=cr?Symbol.for("react.suspense_list"):60120,Qr=cr?Symbol.for("react.memo"):60115,pn=cr?Symbol.for("react.lazy"):60116,En=cr?Symbol.for("react.block"):60121,ga=cr?Symbol.for("react.fundamental"):60117,dn=cr?Symbol.for("react.responder"):60118,Pr=cr?Symbol.for("react.scope"):60119;function xr(Mo){return typeof Mo=="string"||typeof Mo=="function"||Mo===Lr||Mo===Gr||Mo===Fr||Mo===qr||Mo===Yr||Mo===hn||typeof Mo=="object"&&Mo!==null&&(Mo.$$typeof===pn||Mo.$$typeof===Qr||Mo.$$typeof===Hr||Mo.$$typeof===Br||Mo.$$typeof===Kr||Mo.$$typeof===ga||Mo.$$typeof===dn||Mo.$$typeof===Pr||Mo.$$typeof===En)}function Mr(Mo){if(typeof Mo=="object"&&Mo!==null){var bo=Mo.$$typeof;switch(bo){case $r:var yo=Mo.type;switch(yo){case Wr:case Gr:case Lr:case Fr:case qr:case Yr:return yo;default:var Do=yo&&yo.$$typeof;switch(Do){case Br:case Kr:case pn:case Qr:case Hr:return Do;default:return bo}}case Ar:return bo}}}var Nr=Wr,Ur=Gr,Vr=Br,Zr=Hr,Xr=$r,Or=Kr,jr=Lr,Jr=pn,mn=Qr,gn=Ar,eo=Fr,_i=qr,ro=Yr,io=!1;function ao(Mo){return io||(io=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),oo(Mo)||Mr(Mo)===Wr}function oo(Mo){return Mr(Mo)===Gr}function to(Mo){return Mr(Mo)===Br}function so(Mo){return Mr(Mo)===Hr}function lo(Mo){return typeof Mo=="object"&&Mo!==null&&Mo.$$typeof===$r}function Ro(Mo){return Mr(Mo)===Kr}function Io(Mo){return Mr(Mo)===Lr}function Fo(Mo){return Mr(Mo)===pn}function xo(Mo){return Mr(Mo)===Qr}function ho(Mo){return Mr(Mo)===Ar}function po(Mo){return Mr(Mo)===Fr}function Ao(Mo){return Mr(Mo)===qr}function Bo(Mo){return Mr(Mo)===Yr}ur.AsyncMode=Nr,ur.ConcurrentMode=Ur,ur.ContextConsumer=Vr,ur.ContextProvider=Zr,ur.Element=Xr,ur.ForwardRef=Or,ur.Fragment=jr,ur.Lazy=Jr,ur.Memo=mn,ur.Portal=gn,ur.Profiler=eo,ur.StrictMode=_i,ur.Suspense=ro,ur.isAsyncMode=ao,ur.isConcurrentMode=oo,ur.isContextConsumer=to,ur.isContextProvider=so,ur.isElement=lo,ur.isForwardRef=Ro,ur.isFragment=Io,ur.isLazy=Fo,ur.isMemo=xo,ur.isPortal=ho,ur.isProfiler=po,ur.isStrictMode=Ao,ur.isSuspense=Bo,ur.isValidElementType=xr,ur.typeOf=Mr})()},"./node_modules/react-is/index.js":(Qt,ur,cr)=>{Qt.exports=cr("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(Qt,ur,cr)=>{cr.r(ur),cr.d(ur,{shallowEqualArrays:()=>Ar,shallowEqualObjects:()=>$r});function $r(Lr,qr){if(Lr===qr)return!0;if(!Lr||!qr)return!1;var Fr=Object.keys(Lr),Hr=Object.keys(qr),Br=Fr.length;if(Hr.length!==Br)return!1;for(var Wr=0;Wr<Br;Wr++){var Gr=Fr[Wr];if(Lr[Gr]!==qr[Gr]||!Object.prototype.hasOwnProperty.call(qr,Gr))return!1}return!0}function Ar(Lr,qr){if(Lr===qr)return!0;if(!Lr||!qr)return!1;var Fr=Lr.length;if(qr.length!==Fr)return!1;for(var Hr=0;Hr<Fr;Hr++)if(Lr[Hr]!==qr[Hr])return!1;return!0}},"./src/Component.ts":function(Qt,ur,cr){var $r=this&&this.__rest||function(Fr,Hr){var Br={};for(var Wr in Fr)Object.prototype.hasOwnProperty.call(Fr,Wr)&&Hr.indexOf(Wr)<0&&(Br[Wr]=Fr[Wr]);if(Fr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Gr=0,Wr=Object.getOwnPropertySymbols(Fr);Gr<Wr.length;Gr++)Hr.indexOf(Wr[Gr])<0&&Object.prototype.propertyIsEnumerable.call(Fr,Wr[Gr])&&(Br[Wr[Gr]]=Fr[Wr[Gr]]);return Br},Ar=this&&this.__importDefault||function(Fr){return Fr&&Fr.__esModule?Fr:{default:Fr}};Object.defineProperty(ur,"__esModule",{value:!0});var Lr=Ar(cr("./src/useMediaQuery.ts")),qr=function(Fr){var Hr=Fr.children,Br=Fr.device,Wr=Fr.onChange,Gr=$r(Fr,["children","device","onChange"]),Kr=(0,Lr.default)(Gr,Br,Wr);return typeof Hr=="function"?Hr(Kr):Kr?Hr:null};ur.default=qr},"./src/Context.ts":(Qt,ur,cr)=>{Object.defineProperty(ur,"__esModule",{value:!0});var $r=cr("react"),Ar=(0,$r.createContext)(void 0);ur.default=Ar},"./src/index.ts":function(Qt,ur,cr){var $r=this&&this.__importDefault||function(Hr){return Hr&&Hr.__esModule?Hr:{default:Hr}};Object.defineProperty(ur,"__esModule",{value:!0}),ur.Context=ur.toQuery=ur.useMediaQuery=ur.default=void 0;var Ar=$r(cr("./src/useMediaQuery.ts"));ur.useMediaQuery=Ar.default;var Lr=$r(cr("./src/Component.ts"));ur.default=Lr.default;var qr=$r(cr("./src/toQuery.ts"));ur.toQuery=qr.default;var Fr=$r(cr("./src/Context.ts"));ur.Context=Fr.default},"./src/mediaQuery.ts":function(Qt,ur,cr){var $r=this&&this.__assign||function(){return $r=Object.assign||function(Yr){for(var hn,Qr=1,pn=arguments.length;Qr<pn;Qr++){hn=arguments[Qr];for(var En in hn)Object.prototype.hasOwnProperty.call(hn,En)&&(Yr[En]=hn[En])}return Yr},$r.apply(this,arguments)},Ar=this&&this.__rest||function(Yr,hn){var Qr={};for(var pn in Yr)Object.prototype.hasOwnProperty.call(Yr,pn)&&hn.indexOf(pn)<0&&(Qr[pn]=Yr[pn]);if(Yr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var En=0,pn=Object.getOwnPropertySymbols(Yr);En<pn.length;En++)hn.indexOf(pn[En])<0&&Object.prototype.propertyIsEnumerable.call(Yr,pn[En])&&(Qr[pn[En]]=Yr[pn[En]]);return Qr},Lr=this&&this.__importDefault||function(Yr){return Yr&&Yr.__esModule?Yr:{default:Yr}};Object.defineProperty(ur,"__esModule",{value:!0});var qr=Lr(cr("./node_modules/prop-types/index.js")),Fr=qr.default.oneOfType([qr.default.string,qr.default.number]),Hr={all:qr.default.bool,grid:qr.default.bool,aural:qr.default.bool,braille:qr.default.bool,handheld:qr.default.bool,print:qr.default.bool,projection:qr.default.bool,screen:qr.default.bool,tty:qr.default.bool,tv:qr.default.bool,embossed:qr.default.bool},Br={orientation:qr.default.oneOf(["portrait","landscape"]),scan:qr.default.oneOf(["progressive","interlace"]),aspectRatio:qr.default.string,deviceAspectRatio:qr.default.string,height:Fr,deviceHeight:Fr,width:Fr,deviceWidth:Fr,color:qr.default.bool,colorIndex:qr.default.bool,monochrome:qr.default.bool,resolution:Fr,type:Object.keys(Hr)};Br.type;var Wr=Ar(Br,["type"]),Gr=$r({minAspectRatio:qr.default.string,maxAspectRatio:qr.default.string,minDeviceAspectRatio:qr.default.string,maxDeviceAspectRatio:qr.default.string,minHeight:Fr,maxHeight:Fr,minDeviceHeight:Fr,maxDeviceHeight:Fr,minWidth:Fr,maxWidth:Fr,minDeviceWidth:Fr,maxDeviceWidth:Fr,minColor:qr.default.number,maxColor:qr.default.number,minColorIndex:qr.default.number,maxColorIndex:qr.default.number,minMonochrome:qr.default.number,maxMonochrome:qr.default.number,minResolution:Fr,maxResolution:Fr},Wr),Kr=$r($r({},Hr),Gr);ur.default={all:Kr,types:Hr,matchers:Br,features:Gr}},"./src/toQuery.ts":function(Qt,ur,cr){var $r=this&&this.__importDefault||function(Wr){return Wr&&Wr.__esModule?Wr:{default:Wr}};Object.defineProperty(ur,"__esModule",{value:!0});var Ar=$r(cr("./node_modules/hyphenate-style-name/index.js")),Lr=$r(cr("./src/mediaQuery.ts")),qr=function(Wr){return"not ".concat(Wr)},Fr=function(Wr,Gr){var Kr=(0,Ar.default)(Wr);return typeof Gr=="number"&&(Gr="".concat(Gr,"px")),Gr===!0?Kr:Gr===!1?qr(Kr):"(".concat(Kr,": ").concat(Gr,")")},Hr=function(Wr){return Wr.join(" and ")},Br=function(Wr){var Gr=[];return Object.keys(Lr.default.all).forEach(function(Kr){var Yr=Wr[Kr];Yr!=null&&Gr.push(Fr(Kr,Yr))}),Hr(Gr)};ur.default=Br},"./src/useMediaQuery.ts":function(Qt,ur,cr){var $r=this&&this.__importDefault||function(ga){return ga&&ga.__esModule?ga:{default:ga}};Object.defineProperty(ur,"__esModule",{value:!0});var Ar=cr("react"),Lr=$r(cr("./node_modules/matchmediaquery/index.js")),qr=$r(cr("./node_modules/hyphenate-style-name/index.js")),Fr=cr("./node_modules/shallow-equal/dist/index.esm.js"),Hr=$r(cr("./src/toQuery.ts")),Br=$r(cr("./src/Context.ts")),Wr=function(ga){return ga.query||(0,Hr.default)(ga)},Gr=function(ga){if(ga){var dn=Object.keys(ga);return dn.reduce(function(Pr,xr){return Pr[(0,qr.default)(xr)]=ga[xr],Pr},{})}},Kr=function(){var ga=(0,Ar.useRef)(!1);return(0,Ar.useEffect)(function(){ga.current=!0},[]),ga.current},Yr=function(ga){var dn=(0,Ar.useContext)(Br.default),Pr=function(){return Gr(ga)||Gr(dn)},xr=(0,Ar.useState)(Pr),Mr=xr[0],Nr=xr[1];return(0,Ar.useEffect)(function(){var Ur=Pr();(0,Fr.shallowEqualObjects)(Mr,Ur)||Nr(Ur)},[ga,dn]),Mr},hn=function(ga){var dn=function(){return Wr(ga)},Pr=(0,Ar.useState)(dn),xr=Pr[0],Mr=Pr[1];return(0,Ar.useEffect)(function(){var Nr=dn();xr!==Nr&&Mr(Nr)},[ga]),xr},Qr=function(ga,dn){var Pr=function(){return(0,Lr.default)(ga,dn||{},!!dn)},xr=(0,Ar.useState)(Pr),Mr=xr[0],Nr=xr[1],Ur=Kr();return(0,Ar.useEffect)(function(){if(Ur){var Vr=Pr();return Nr(Vr),function(){Vr&&Vr.dispose()}}},[ga,dn]),Mr},pn=function(ga){var dn=(0,Ar.useState)(ga.matches),Pr=dn[0],xr=dn[1];return(0,Ar.useEffect)(function(){var Mr=function(Nr){xr(Nr.matches)};return ga.addListener(Mr),xr(ga.matches),function(){ga.removeListener(Mr)}},[ga]),Pr},En=function(ga,dn,Pr){var xr=Yr(dn),Mr=hn(ga);if(!Mr)throw new Error("Invalid or missing MediaQuery!");var Nr=Qr(Mr,xr),Ur=pn(Nr),Vr=Kr();return(0,Ar.useEffect)(function(){Vr&&Pr&&Pr(Ur)},[Ur]),(0,Ar.useEffect)(function(){return function(){Nr&&Nr.dispose()}},[]),Ur};ur.default=En},react:Qt=>{Qt.exports=Gt}},Xt={};function Jt(Qt){var ur=Xt[Qt];if(ur!==void 0)return ur.exports;var cr=Xt[Qt]={exports:{}};return Yt[Qt].call(cr.exports,cr,cr.exports,Jt),cr.exports}Jt.d=(Qt,ur)=>{for(var cr in ur)Jt.o(ur,cr)&&!Jt.o(Qt,cr)&&Object.defineProperty(Qt,cr,{enumerable:!0,get:ur[cr]})},Jt.o=(Qt,ur)=>Object.prototype.hasOwnProperty.call(Qt,ur),Jt.r=Qt=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Qt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Qt,"__esModule",{value:!0})};var Zt=Jt("./src/index.ts");return Zt})())})(reactResponsive);var reactResponsiveExports=reactResponsive.exports;Object.defineProperty(Media,"__esModule",{value:!0});Media.useNotMobileMediaQuery=Media.useMobileMediaQuery=Media.useTabletAndBelowMediaQuery=Media.useTabletMediaQuery=Media.useDesktopMediaQuery=Media.useBigDesktopMediaQuery=Media.NotMobile=Media.Mobile=Media.TabletAndBelow=Media.Tablet=Media.Desktop=void 0;var react_responsive_1=reactResponsiveExports,useBigDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:1920})};Media.useBigDesktopMediaQuery=useBigDesktopMediaQuery;var useDesktopMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:992})};Media.useDesktopMediaQuery=useDesktopMediaQuery;var useTabletMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768,maxWidth:991})};Media.useTabletMediaQuery=useTabletMediaQuery;var useTabletAndBelowMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:991})};Media.useTabletAndBelowMediaQuery=useTabletAndBelowMediaQuery;var useMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({maxWidth:767})};Media.useMobileMediaQuery=useMobileMediaQuery;var useNotMobileMediaQuery=function(){return(0,react_responsive_1.useMediaQuery)({minWidth:768})};Media.useNotMobileMediaQuery=useNotMobileMediaQuery;var Desktop=function(Bt){var Wt=Bt.children,Gt=useDesktopMediaQuery();return Gt?Wt:null};Media.Desktop=Desktop;var Tablet=function(Bt){var Wt=Bt.children,Gt=useTabletMediaQuery();return Gt?Wt:null};Media.Tablet=Tablet;var TabletAndBelow=function(Bt){var Wt=Bt.children,Gt=useTabletAndBelowMediaQuery();return Gt?Wt:null};Media.TabletAndBelow=TabletAndBelow;var Mobile=function(Bt){var Wt=Bt.children,Gt=useMobileMediaQuery();return Gt?Wt:null};Media.Mobile=Mobile;var NotMobile=function(Bt){var Wt=Bt.children,Gt=useNotMobileMediaQuery();return Gt?Wt:null};Media.NotMobile=NotMobile;(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(Media,Bt)})(Media$1);var Container$4={},Container$3={},_interopRequireDefault$9=interopRequireDefaultExports;Container$3.__esModule=!0;Container$3.default=void 0;var _extends2$6=_interopRequireDefault$9(require_extends()),_clsx$5=_interopRequireDefault$9(require$$0$d);_interopRequireDefault$9(requirePropTypes());var _react$6=_interopRequireDefault$9(reactExports),_lib$6=requireLib();function Container$2(Bt){var Wt=Bt.children,Gt=Bt.className,Yt=Bt.content,Xt=Bt.fluid,Jt=Bt.text,Zt=Bt.textAlign,Qt=(0,_clsx$5.default)("ui",(0,_lib$6.useKeyOnly)(Jt,"text"),(0,_lib$6.useKeyOnly)(Xt,"fluid"),(0,_lib$6.useTextAlignProp)(Zt),"container",Gt),ur=(0,_lib$6.getUnhandledProps)(Container$2,Bt),cr=(0,_lib$6.getElementType)(Container$2,Bt);return _react$6.default.createElement(cr,(0,_extends2$6.default)({},ur,{className:Qt}),_lib$6.childrenUtils.isNil(Wt)?Yt:Wt)}Container$2.handledProps=["as","children","className","content","fluid","text","textAlign"];Container$2.propTypes={};var _default$5=Container$2;Container$3.default=_default$5;const Container$1="";(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Yt){return Yt&&Yt.__esModule?Yt:{default:Yt}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Container=void 0;var Gt=Container$3;Object.defineProperty(Bt,"Container",{enumerable:!0,get:function(){return Wt(Gt).default}})})(Container$4);const Tabs$1="";var __extends$z=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=function(Wt,Gt){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Yt,Xt){Yt.__proto__=Xt}||function(Yt,Xt){for(var Jt in Xt)Object.prototype.hasOwnProperty.call(Xt,Jt)&&(Yt[Jt]=Xt[Jt])},Bt(Wt,Gt)};return function(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Class extends value "+String(Gt)+" is not a constructor or null");Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__createBinding$W=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$W=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$W=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$W(Wt,Bt,Gt);return __setModuleDefault$W(Wt,Bt),Wt};Object.defineProperty(Tabs$2,"__esModule",{value:!0});var Tabs_2=Tabs$2.Tabs=void 0,React$P=__importStar$W(reactExports),Media_1$2=Media$1,Container_1$3=Container$4,Tabs=function(Bt){__extends$z(Wt,Bt);function Wt(){return Bt!==null&&Bt.apply(this,arguments)||this}return Wt.prototype.render=function(){var Gt=this.props,Yt=Gt.children,Xt=Gt.isFullscreen,Jt=Gt.onClick;return React$P.createElement("div",{className:"dcl tabs ".concat(Xt?"fullscreen":""),onClick:Jt},React$P.createElement(Media_1$2.NotMobile,null,React$P.createElement(Container_1$3.Container,null,Yt)),React$P.createElement(Media_1$2.Mobile,null,Yt))},Wt.defaultProps={isFullscreen:!1},Wt.Left=function(Gt){var Yt=Gt.children;return React$P.createElement("div",{className:"dcl tabs-left"},Yt)},Wt.Right=function(Gt){var Yt=Gt.children;return React$P.createElement("div",{className:"dcl tabs-right"},Yt)},Wt.Tab=function(Gt){var Yt=Gt.active,Xt=Gt.onClick,Jt=Gt.children;return React$P.createElement("div",{className:"dcl tab ".concat(Yt?"active":""),onClick:Xt},Jt,Yt?React$P.createElement("div",{className:"active-bar"}):null)},Wt}(React$P.PureComponent);Tabs_2=Tabs$2.Tabs=Tabs;var Button$3={};const Button$2="";(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Yt){return Yt&&Yt.__esModule?Yt:{default:Yt}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Button=void 0;var Gt=requireButton$1();Object.defineProperty(Bt,"Button",{enumerable:!0,get:function(){return Wt(Gt).default}})})(Button$3);var WearablePreview$3={},toStr$6=Object.prototype.toString,isArguments$4=function(Wt){var Gt=toStr$6.call(Wt),Yt=Gt==="[object Arguments]";return Yt||(Yt=Gt!=="[object Array]"&&Wt!==null&&typeof Wt=="object"&&typeof Wt.length=="number"&&Wt.length>=0&&toStr$6.call(Wt.callee)==="[object Function]"),Yt},implementation$9,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation$9;hasRequiredImplementation=1;var Bt;if(!Object.keys){var Wt=Object.prototype.hasOwnProperty,Gt=Object.prototype.toString,Yt=isArguments$4,Xt=Object.prototype.propertyIsEnumerable,Jt=!Xt.call({toString:null},"toString"),Zt=Xt.call(function(){},"prototype"),Qt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ur=function(Lr){var qr=Lr.constructor;return qr&&qr.prototype===Lr},cr={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},$r=function(){if(typeof window>"u")return!1;for(var Lr in window)try{if(!cr["$"+Lr]&&Wt.call(window,Lr)&&window[Lr]!==null&&typeof window[Lr]=="object")try{ur(window[Lr])}catch{return!0}}catch{return!0}return!1}(),Ar=function(Lr){if(typeof window>"u"||!$r)return ur(Lr);try{return ur(Lr)}catch{return!1}};Bt=function(qr){var Fr=qr!==null&&typeof qr=="object",Hr=Gt.call(qr)==="[object Function]",Br=Yt(qr),Wr=Fr&&Gt.call(qr)==="[object String]",Gr=[];if(!Fr&&!Hr&&!Br)throw new TypeError("Object.keys called on a non-object");var Kr=Zt&&Hr;if(Wr&&qr.length>0&&!Wt.call(qr,0))for(var Yr=0;Yr<qr.length;++Yr)Gr.push(String(Yr));if(Br&&qr.length>0)for(var hn=0;hn<qr.length;++hn)Gr.push(String(hn));else for(var Qr in qr)!(Kr&&Qr==="prototype")&&Wt.call(qr,Qr)&&Gr.push(String(Qr));if(Jt)for(var pn=Ar(qr),En=0;En<Qt.length;++En)!(pn&&Qt[En]==="constructor")&&Wt.call(qr,Qt[En])&&Gr.push(Qt[En]);return Gr}}return implementation$9=Bt,implementation$9}var slice=Array.prototype.slice,isArgs=isArguments$4,origKeys=Object.keys,keysShim=origKeys?function(Wt){return origKeys(Wt)}:requireImplementation(),originalKeys=Object.keys;keysShim.shim=function(){if(Object.keys){var Wt=function(){var Gt=Object.keys(arguments);return Gt&&Gt.length===arguments.length}(1,2);Wt||(Object.keys=function(Yt){return isArgs(Yt)?originalKeys(slice.call(Yt)):originalKeys(Yt)})}else Object.keys=keysShim;return Object.keys||keysShim};var objectKeys$2=keysShim,GetIntrinsic$6=getIntrinsic,$defineProperty=GetIntrinsic$6("%Object.defineProperty%",!0),hasPropertyDescriptors$1=function(){if($defineProperty)try{return $defineProperty({},"a",{value:1}),!0}catch{return!1}return!1};hasPropertyDescriptors$1.hasArrayLengthDefineBug=function(){if(!hasPropertyDescriptors$1())return null;try{return $defineProperty([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors$1,keys$5=objectKeys$2,hasSymbols$2=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",toStr$5=Object.prototype.toString,concat$1=Array.prototype.concat,origDefineProperty=Object.defineProperty,isFunction$8=function(Bt){return typeof Bt=="function"&&toStr$5.call(Bt)==="[object Function]"},hasPropertyDescriptors=hasPropertyDescriptors_1(),supportsDescriptors$2=origDefineProperty&&hasPropertyDescriptors,defineProperty$4=function(Bt,Wt,Gt,Yt){if(Wt in Bt){if(Yt===!0){if(Bt[Wt]===Gt)return}else if(!isFunction$8(Yt)||!Yt())return}supportsDescriptors$2?origDefineProperty(Bt,Wt,{configurable:!0,enumerable:!1,value:Gt,writable:!0}):Bt[Wt]=Gt},defineProperties$1=function(Bt,Wt){var Gt=arguments.length>2?arguments[2]:{},Yt=keys$5(Wt);hasSymbols$2&&(Yt=concat$1.call(Yt,Object.getOwnPropertySymbols(Wt)));for(var Xt=0;Xt<Yt.length;Xt+=1)defineProperty$4(Bt,Yt[Xt],Wt[Yt[Xt]],Gt[Yt[Xt]])};defineProperties$1.supportsDescriptors=!!supportsDescriptors$2;var defineProperties_1=defineProperties$1,objectKeys$1=objectKeys$2,hasSymbols$1=shams$1(),callBound$9=callBound$d,toObject=Object,$push=callBound$9("Array.prototype.push"),$propIsEnumerable=callBound$9("Object.prototype.propertyIsEnumerable"),originalGetSymbols=hasSymbols$1?Object.getOwnPropertySymbols:null,implementation$8=function(Wt,Gt){if(Wt==null)throw new TypeError("target must be an object");var Yt=toObject(Wt);if(arguments.length===1)return Yt;for(var Xt=1;Xt<arguments.length;++Xt){var Jt=toObject(arguments[Xt]),Zt=objectKeys$1(Jt),Qt=hasSymbols$1&&(Object.getOwnPropertySymbols||originalGetSymbols);if(Qt)for(var ur=Qt(Jt),cr=0;cr<ur.length;++cr){var $r=ur[cr];$propIsEnumerable(Jt,$r)&&$push(Zt,$r)}for(var Ar=0;Ar<Zt.length;++Ar){var Lr=Zt[Ar];if($propIsEnumerable(Jt,Lr)){var qr=Jt[Lr];Yt[Lr]=qr}}}return Yt},implementation$7=implementation$8,lacksProperEnumerationOrder=function(){if(!Object.assign)return!1;for(var Bt="abcdefghijklmnopqrst",Wt=Bt.split(""),Gt={},Yt=0;Yt<Wt.length;++Yt)Gt[Wt[Yt]]=Wt[Yt];var Xt=Object.assign({},Gt),Jt="";for(var Zt in Xt)Jt+=Zt;return Bt!==Jt},assignHasPendingExceptions=function(){if(!Object.assign||!Object.preventExtensions)return!1;var Bt=Object.preventExtensions({1:2});try{Object.assign(Bt,"xy")}catch{return Bt[1]==="y"}return!1},polyfill$4=function(){return!Object.assign||lacksProperEnumerationOrder()||assignHasPendingExceptions()?implementation$7:Object.assign},define$4=defineProperties_1,getPolyfill$5=polyfill$4,shim$5=function(){var Wt=getPolyfill$5();return define$4(Object,{assign:Wt},{assign:function(){return Object.assign!==Wt}}),Wt},defineProperties=defineProperties_1,callBind$3=callBindExports,implementation$6=implementation$8,getPolyfill$4=polyfill$4,shim$4=shim$5,polyfill$3=callBind$3.apply(getPolyfill$4()),bound=function(Wt,Gt){return polyfill$3(Object,arguments)};defineProperties(bound,{getPolyfill:getPolyfill$4,implementation:implementation$6,shim:shim$4});var object_assign=bound,implementation$5={exports:{}},functionsHaveNames=function(){return typeof function(){}.name=="string"},gOPD$2=Object.getOwnPropertyDescriptor;if(gOPD$2)try{gOPD$2([],"length")}catch{gOPD$2=null}functionsHaveNames.functionsHaveConfigurableNames=function(){if(!functionsHaveNames()||!gOPD$2)return!1;var Wt=gOPD$2(function(){},"name");return!!Wt&&!!Wt.configurable};var $bind=Function.prototype.bind;functionsHaveNames.boundFunctionsHaveNames=function(){return functionsHaveNames()&&typeof $bind=="function"&&function(){}.bind().name!==""};var functionsHaveNames_1=functionsHaveNames;(function(Bt){var Wt=functionsHaveNames_1.functionsHaveConfigurableNames(),Gt=Object,Yt=TypeError;Bt.exports=function(){if(this!=null&&this!==Gt(this))throw new Yt("RegExp.prototype.flags getter called on non-object");var Jt="";return this.hasIndices&&(Jt+="d"),this.global&&(Jt+="g"),this.ignoreCase&&(Jt+="i"),this.multiline&&(Jt+="m"),this.dotAll&&(Jt+="s"),this.unicode&&(Jt+="u"),this.unicodeSets&&(Jt+="v"),this.sticky&&(Jt+="y"),Jt},Wt&&Object.defineProperty&&Object.defineProperty(Bt.exports,"name",{value:"get flags"})})(implementation$5);var implementationExports=implementation$5.exports,implementation$4=implementationExports,supportsDescriptors$1=defineProperties_1.supportsDescriptors,$gOPD=Object.getOwnPropertyDescriptor,polyfill$2=function(){if(supportsDescriptors$1&&/a/mig.flags==="gim"){var Wt=$gOPD(RegExp.prototype,"flags");if(Wt&&typeof Wt.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var Gt="",Yt={};if(Object.defineProperty(Yt,"hasIndices",{get:function(){Gt+="d"}}),Object.defineProperty(Yt,"sticky",{get:function(){Gt+="y"}}),Gt==="dy")return Wt.get}}return implementation$4},supportsDescriptors=defineProperties_1.supportsDescriptors,getPolyfill$3=polyfill$2,gOPD$1=Object.getOwnPropertyDescriptor,defineProperty$3=Object.defineProperty,TypeErr=TypeError,getProto=Object.getPrototypeOf,regex=/a/,shim$3=function(){if(!supportsDescriptors||!getProto)throw new TypeErr("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var Wt=getPolyfill$3(),Gt=getProto(regex),Yt=gOPD$1(Gt,"flags");return(!Yt||Yt.get!==Wt)&&defineProperty$3(Gt,"flags",{configurable:!0,enumerable:!1,get:Wt}),Wt},define$3=defineProperties_1,callBind$2=callBindExports,implementation$3=implementationExports,getPolyfill$2=polyfill$2,shim$2=shim$3,flagsBound=callBind$2(getPolyfill$2());define$3(flagsBound,{getPolyfill:getPolyfill$2,implementation:implementation$3,shim:shim$2});var regexp_prototype_flags=flagsBound,esGetIterator={exports:{}},hasMap$1=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap$1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap$1&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap$1&&Map.prototype.forEach,hasSet$1=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet$1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet$1&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet$1&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString$5=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf$1=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||"symbol")?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO$1=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Bt){return Bt.__proto__}:null);function addNumericSeparator(Bt,Wt){if(Bt===1/0||Bt===-1/0||Bt!==Bt||Bt&&Bt>-1e3&&Bt<1e3||$test.call(/e/,Wt))return Wt;var Gt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Bt=="number"){var Yt=Bt<0?-$floor(-Bt):$floor(Bt);if(Yt!==Bt){var Xt=String(Yt),Jt=$slice.call(Wt,Xt.length+1);return $replace.call(Xt,Gt,"$&_")+"."+$replace.call($replace.call(Jt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(Wt,Gt,"$&_")}var utilInspect=require$$0$a,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol$7(inspectCustom)?inspectCustom:null,objectInspect=function Bt(Wt,Gt,Yt,Xt){var Jt=Gt||{};if(has$3(Jt,"quoteStyle")&&Jt.quoteStyle!=="single"&&Jt.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(Jt,"maxStringLength")&&(typeof Jt.maxStringLength=="number"?Jt.maxStringLength<0&&Jt.maxStringLength!==1/0:Jt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Zt=has$3(Jt,"customInspect")?Jt.customInspect:!0;if(typeof Zt!="boolean"&&Zt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(Jt,"indent")&&Jt.indent!==null&&Jt.indent!==" "&&!(parseInt(Jt.indent,10)===Jt.indent&&Jt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(Jt,"numericSeparator")&&typeof Jt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Qt=Jt.numericSeparator;if(typeof Wt>"u")return"undefined";if(Wt===null)return"null";if(typeof Wt=="boolean")return Wt?"true":"false";if(typeof Wt=="string")return inspectString(Wt,Jt);if(typeof Wt=="number"){if(Wt===0)return 1/0/Wt>0?"0":"-0";var ur=String(Wt);return Qt?addNumericSeparator(Wt,ur):ur}if(typeof Wt=="bigint"){var cr=String(Wt)+"n";return Qt?addNumericSeparator(Wt,cr):cr}var $r=typeof Jt.depth>"u"?5:Jt.depth;if(typeof Yt>"u"&&(Yt=0),Yt>=$r&&$r>0&&typeof Wt=="object")return isArray$c(Wt)?"[Array]":"[Object]";var Ar=getIndent(Jt,Yt);if(typeof Xt>"u")Xt=[];else if(indexOf(Xt,Wt)>=0)return"[Circular]";function Lr(Mr,Nr,Ur){if(Nr&&(Xt=$arrSlice.call(Xt),Xt.push(Nr)),Ur){var Vr={depth:Jt.depth};return has$3(Jt,"quoteStyle")&&(Vr.quoteStyle=Jt.quoteStyle),Bt(Mr,Vr,Yt+1,Xt)}return Bt(Mr,Jt,Yt+1,Xt)}if(typeof Wt=="function"&&!isRegExp(Wt)){var qr=nameOf(Wt),Fr=arrObjKeys(Wt,Lr);return"[Function"+(qr?": "+qr:" (anonymous)")+"]"+(Fr.length>0?" { "+$join.call(Fr,", ")+" }":"")}if(isSymbol$7(Wt)){var Hr=hasShammedSymbols?$replace.call(String(Wt),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(Wt);return typeof Wt=="object"&&!hasShammedSymbols?markBoxed(Hr):Hr}if(isElement$2(Wt)){for(var Br="<"+$toLowerCase.call(String(Wt.nodeName)),Wr=Wt.attributes||[],Gr=0;Gr<Wr.length;Gr++)Br+=" "+Wr[Gr].name+"="+wrapQuotes(quote(Wr[Gr].value),"double",Jt);return Br+=">",Wt.childNodes&&Wt.childNodes.length&&(Br+="..."),Br+="</"+$toLowerCase.call(String(Wt.nodeName))+">",Br}if(isArray$c(Wt)){if(Wt.length===0)return"[]";var Kr=arrObjKeys(Wt,Lr);return Ar&&!singleLineValues(Kr)?"["+indentedJoin(Kr,Ar)+"]":"[ "+$join.call(Kr,", ")+" ]"}if(isError$1(Wt)){var Yr=arrObjKeys(Wt,Lr);return!("cause"in Error.prototype)&&"cause"in Wt&&!isEnumerable.call(Wt,"cause")?"{ ["+String(Wt)+"] "+$join.call($concat.call("[cause]: "+Lr(Wt.cause),Yr),", ")+" }":Yr.length===0?"["+String(Wt)+"]":"{ ["+String(Wt)+"] "+$join.call(Yr,", ")+" }"}if(typeof Wt=="object"&&Zt){if(inspectSymbol&&typeof Wt[inspectSymbol]=="function"&&utilInspect)return utilInspect(Wt,{depth:$r-Yt});if(Zt!=="symbol"&&typeof Wt.inspect=="function")return Wt.inspect()}if(isMap$5(Wt)){var hn=[];return mapForEach&&mapForEach.call(Wt,function(Mr,Nr){hn.push(Lr(Nr,Wt,!0)+" => "+Lr(Mr,Wt))}),collectionOf("Map",mapSize.call(Wt),hn,Ar)}if(isSet$5(Wt)){var Qr=[];return setForEach&&setForEach.call(Wt,function(Mr){Qr.push(Lr(Mr,Wt))}),collectionOf("Set",setSize.call(Wt),Qr,Ar)}if(isWeakMap$2(Wt))return weakCollectionOf("WeakMap");if(isWeakSet$1(Wt))return weakCollectionOf("WeakSet");if(isWeakRef(Wt))return weakCollectionOf("WeakRef");if(isNumber$5(Wt))return markBoxed(Lr(Number(Wt)));if(isBigInt$1(Wt))return markBoxed(Lr(bigIntValueOf$1.call(Wt)));if(isBoolean$3(Wt))return markBoxed(booleanValueOf.call(Wt));if(isString$5(Wt))return markBoxed(Lr(String(Wt)));if(!isDate$3(Wt)&&!isRegExp(Wt)){var pn=arrObjKeys(Wt,Lr),En=gPO$1?gPO$1(Wt)===Object.prototype:Wt instanceof Object||Wt.constructor===Object,ga=Wt instanceof Object?"":"null prototype",dn=!En&&toStringTag&&Object(Wt)===Wt&&toStringTag in Wt?$slice.call(toStr$4(Wt),8,-1):ga?"Object":"",Pr=En||typeof Wt.constructor!="function"?"":Wt.constructor.name?Wt.constructor.name+" ":"",xr=Pr+(dn||ga?"["+$join.call($concat.call([],dn||[],ga||[]),": ")+"] ":"");return pn.length===0?xr+"{}":Ar?xr+"{"+indentedJoin(pn,Ar)+"}":xr+"{ "+$join.call(pn,", ")+" }"}return String(Wt)};function wrapQuotes(Bt,Wt,Gt){var Yt=(Gt.quoteStyle||Wt)==="double"?'"':"'";return Yt+Bt+Yt}function quote(Bt){return $replace.call(String(Bt),/"/g,"&quot;")}function isArray$c(Bt){return toStr$4(Bt)==="[object Array]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isDate$3(Bt){return toStr$4(Bt)==="[object Date]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isRegExp(Bt){return toStr$4(Bt)==="[object RegExp]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isError$1(Bt){return toStr$4(Bt)==="[object Error]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isString$5(Bt){return toStr$4(Bt)==="[object String]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isNumber$5(Bt){return toStr$4(Bt)==="[object Number]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isBoolean$3(Bt){return toStr$4(Bt)==="[object Boolean]"&&(!toStringTag||!(typeof Bt=="object"&&toStringTag in Bt))}function isSymbol$7(Bt){if(hasShammedSymbols)return Bt&&typeof Bt=="object"&&Bt instanceof Symbol;if(typeof Bt=="symbol")return!0;if(!Bt||typeof Bt!="object"||!symToString)return!1;try{return symToString.call(Bt),!0}catch{}return!1}function isBigInt$1(Bt){if(!Bt||typeof Bt!="object"||!bigIntValueOf$1)return!1;try{return bigIntValueOf$1.call(Bt),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(Bt){return Bt in this};function has$3(Bt,Wt){return hasOwn$1.call(Bt,Wt)}function toStr$4(Bt){return objectToString$5.call(Bt)}function nameOf(Bt){if(Bt.name)return Bt.name;var Wt=$match.call(functionToString.call(Bt),/^function\s*([\w$]+)/);return Wt?Wt[1]:null}function indexOf(Bt,Wt){if(Bt.indexOf)return Bt.indexOf(Wt);for(var Gt=0,Yt=Bt.length;Gt<Yt;Gt++)if(Bt[Gt]===Wt)return Gt;return-1}function isMap$5(Bt){if(!mapSize||!Bt||typeof Bt!="object")return!1;try{mapSize.call(Bt);try{setSize.call(Bt)}catch{return!0}return Bt instanceof Map}catch{}return!1}function isWeakMap$2(Bt){if(!weakMapHas||!Bt||typeof Bt!="object")return!1;try{weakMapHas.call(Bt,weakMapHas);try{weakSetHas.call(Bt,weakSetHas)}catch{return!0}return Bt instanceof WeakMap}catch{}return!1}function isWeakRef(Bt){if(!weakRefDeref||!Bt||typeof Bt!="object")return!1;try{return weakRefDeref.call(Bt),!0}catch{}return!1}function isSet$5(Bt){if(!setSize||!Bt||typeof Bt!="object")return!1;try{setSize.call(Bt);try{mapSize.call(Bt)}catch{return!0}return Bt instanceof Set}catch{}return!1}function isWeakSet$1(Bt){if(!weakSetHas||!Bt||typeof Bt!="object")return!1;try{weakSetHas.call(Bt,weakSetHas);try{weakMapHas.call(Bt,weakMapHas)}catch{return!0}return Bt instanceof WeakSet}catch{}return!1}function isElement$2(Bt){return!Bt||typeof Bt!="object"?!1:typeof HTMLElement<"u"&&Bt instanceof HTMLElement?!0:typeof Bt.nodeName=="string"&&typeof Bt.getAttribute=="function"}function inspectString(Bt,Wt){if(Bt.length>Wt.maxStringLength){var Gt=Bt.length-Wt.maxStringLength,Yt="... "+Gt+" more character"+(Gt>1?"s":"");return inspectString($slice.call(Bt,0,Wt.maxStringLength),Wt)+Yt}var Xt=$replace.call($replace.call(Bt,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(Xt,"single",Wt)}function lowbyte(Bt){var Wt=Bt.charCodeAt(0),Gt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Wt];return Gt?"\\"+Gt:"\\x"+(Wt<16?"0":"")+$toUpperCase.call(Wt.toString(16))}function markBoxed(Bt){return"Object("+Bt+")"}function weakCollectionOf(Bt){return Bt+" { ? }"}function collectionOf(Bt,Wt,Gt,Yt){var Xt=Yt?indentedJoin(Gt,Yt):$join.call(Gt,", ");return Bt+" ("+Wt+") {"+Xt+"}"}function singleLineValues(Bt){for(var Wt=0;Wt<Bt.length;Wt++)if(indexOf(Bt[Wt],`
797
797
  `)>=0)return!1;return!0}function getIndent(Bt,Wt){var Gt;if(Bt.indent===" ")Gt=" ";else if(typeof Bt.indent=="number"&&Bt.indent>0)Gt=$join.call(Array(Bt.indent+1)," ");else return null;return{base:Gt,prev:$join.call(Array(Wt+1),Gt)}}function indentedJoin(Bt,Wt){if(Bt.length===0)return"";var Gt=`
798
798
  `+Wt.prev+Wt.base;return Gt+$join.call(Bt,","+Gt)+`
799
- `+Wt.prev}function arrObjKeys(Bt,Wt){var Gt=isArray$c(Bt),Yt=[];if(Gt){Yt.length=Bt.length;for(var Xt=0;Xt<Bt.length;Xt++)Yt[Xt]=has$3(Bt,Xt)?Wt(Bt[Xt],Bt):""}var Jt=typeof gOPS=="function"?gOPS(Bt):[],Zt;if(hasShammedSymbols){Zt={};for(var Qt=0;Qt<Jt.length;Qt++)Zt["$"+Jt[Qt]]=Jt[Qt]}for(var ur in Bt)has$3(Bt,ur)&&(Gt&&String(Number(ur))===ur&&ur<Bt.length||hasShammedSymbols&&Zt["$"+ur]instanceof Symbol||($test.call(/[^\w$]/,ur)?Yt.push(Wt(ur,Bt)+": "+Wt(Bt[ur],Bt)):Yt.push(ur+": "+Wt(Bt[ur],Bt))));if(typeof gOPS=="function")for(var cr=0;cr<Jt.length;cr++)isEnumerable.call(Bt,Jt[cr])&&Yt.push("["+Wt(Jt[cr])+"]: "+Wt(Bt[Jt[cr]],Bt));return Yt}var GetIntrinsic$5=getIntrinsic,callBound$8=callBound$d,inspect=objectInspect,$TypeError$1=GetIntrinsic$5("%TypeError%"),$WeakMap$1=GetIntrinsic$5("%WeakMap%",!0),$Map$3=GetIntrinsic$5("%Map%",!0),$weakMapGet=callBound$8("WeakMap.prototype.get",!0),$weakMapSet=callBound$8("WeakMap.prototype.set",!0),$weakMapHas=callBound$8("WeakMap.prototype.has",!0),$mapGet$1=callBound$8("Map.prototype.get",!0),$mapSet=callBound$8("Map.prototype.set",!0),$mapHas$5=callBound$8("Map.prototype.has",!0),listGetNode=function(Bt,Wt){for(var Gt=Bt,Yt;(Yt=Gt.next)!==null;Gt=Yt)if(Yt.key===Wt)return Gt.next=Yt.next,Yt.next=Bt.next,Bt.next=Yt,Yt},listGet=function(Bt,Wt){var Gt=listGetNode(Bt,Wt);return Gt&&Gt.value},listSet=function(Bt,Wt,Gt){var Yt=listGetNode(Bt,Wt);Yt?Yt.value=Gt:Bt.next={key:Wt,next:Bt.next,value:Gt}},listHas=function(Bt,Wt){return!!listGetNode(Bt,Wt)},sideChannel=function(){var Wt,Gt,Yt,Xt={assert:function(Jt){if(!Xt.has(Jt))throw new $TypeError$1("Side channel does not contain "+inspect(Jt))},get:function(Jt){if($WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")){if(Wt)return $weakMapGet(Wt,Jt)}else if($Map$3){if(Gt)return $mapGet$1(Gt,Jt)}else if(Yt)return listGet(Yt,Jt)},has:function(Jt){if($WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")){if(Wt)return $weakMapHas(Wt,Jt)}else if($Map$3){if(Gt)return $mapHas$5(Gt,Jt)}else if(Yt)return listHas(Yt,Jt);return!1},set:function(Jt,Zt){$WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")?(Wt||(Wt=new $WeakMap$1),$weakMapSet(Wt,Jt,Zt)):$Map$3?(Gt||(Gt=new $Map$3),$mapSet(Gt,Jt,Zt)):(Yt||(Yt={key:{},next:null}),listSet(Yt,Jt,Zt))}};return Xt},GetIntrinsic$4=getIntrinsic,has$2=src$f,channel$2=sideChannel(),$TypeError=GetIntrinsic$4("%TypeError%"),SLOT$1={assert:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");if(channel$2.assert(Bt),!SLOT$1.has(Bt,Wt))throw new $TypeError("`"+Wt+"` is not present on `O`")},get:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Gt=channel$2.get(Bt);return Gt&&Gt["$"+Wt]},has:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Gt=channel$2.get(Bt);return!!Gt&&has$2(Gt,"$"+Wt)},set:function(Bt,Wt,Gt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Yt=channel$2.get(Bt);Yt||(Yt={},channel$2.set(Bt,Yt)),Yt["$"+Wt]=Gt}};Object.freeze&&Object.freeze(SLOT$1);var internalSlot=SLOT$1,SLOT=internalSlot,$SyntaxError=SyntaxError,$StopIteration=typeof StopIteration=="object"?StopIteration:null,stopIterationIterator=function(Wt){if(!$StopIteration)throw new $SyntaxError("this environment lacks StopIteration");SLOT.set(Wt,"[[Done]]",!1);var Gt={next:function(){var Xt=SLOT.get(this,"[[Iterator]]"),Jt=SLOT.get(Xt,"[[Done]]");try{return{done:Jt,value:Jt?void 0:Xt.next()}}catch(Zt){if(SLOT.set(Xt,"[[Done]]",!0),Zt!==$StopIteration)throw Zt;return{done:!0,value:void 0}}}};return SLOT.set(Gt,"[[Iterator]]",Wt),Gt},strValue=String.prototype.valueOf,tryStringObject=function(Wt){try{return strValue.call(Wt),!0}catch{return!1}},toStr$3=Object.prototype.toString,strClass="[object String]",hasToStringTag$4=shams(),isString$4=function(Wt){return typeof Wt=="string"?!0:typeof Wt!="object"?!1:hasToStringTag$4?tryStringObject(Wt):toStr$3.call(Wt)===strClass},$Map$2=typeof Map=="function"&&Map.prototype?Map:null,$Set$3=typeof Set=="function"&&Set.prototype?Set:null,exported$2;$Map$2||(exported$2=function(Wt){return!1});var $mapHas$4=$Map$2?Map.prototype.has:null,$setHas$4=$Set$3?Set.prototype.has:null;!exported$2&&!$mapHas$4&&(exported$2=function(Wt){return!1});var isMap$4=exported$2||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($mapHas$4.call(Wt),$setHas$4)try{$setHas$4.call(Wt)}catch{return!0}return Wt instanceof $Map$2}catch{}return!1},$Map$1=typeof Map=="function"&&Map.prototype?Map:null,$Set$2=typeof Set=="function"&&Set.prototype?Set:null,exported$1;$Set$2||(exported$1=function(Wt){return!1});var $mapHas$3=$Map$1?Map.prototype.has:null,$setHas$3=$Set$2?Set.prototype.has:null;!exported$1&&!$setHas$3&&(exported$1=function(Wt){return!1});var isSet$4=exported$1||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($setHas$3.call(Wt),$mapHas$3)try{$mapHas$3.call(Wt)}catch{return!0}return Wt instanceof $Set$2}catch{}return!1},isArguments$3=isArguments$5,getStopIterationIterator=stopIterationIterator;if(hasSymbols$4()||shams$1()){var $iterator=Symbol.iterator;esGetIterator.exports=function(Wt){if(Wt!=null&&typeof Wt[$iterator]<"u")return Wt[$iterator]();if(isArguments$3(Wt))return Array.prototype[$iterator].call(Wt)}}else{var isArray$b=isarray,isString$3=isString$4,GetIntrinsic$3=getIntrinsic,$Map=GetIntrinsic$3("%Map%",!0),$Set$1=GetIntrinsic$3("%Set%",!0),callBound$7=callBound$d,$arrayPush=callBound$7("Array.prototype.push"),$charCodeAt=callBound$7("String.prototype.charCodeAt"),$stringSlice=callBound$7("String.prototype.slice"),advanceStringIndex=function(Wt,Gt){var Yt=Wt.length;if(Gt+1>=Yt)return Gt+1;var Xt=$charCodeAt(Wt,Gt);if(Xt<55296||Xt>56319)return Gt+1;var Jt=$charCodeAt(Wt,Gt+1);return Jt<56320||Jt>57343?Gt+1:Gt+2},getArrayIterator=function(Wt){var Gt=0;return{next:function(){var Xt=Gt>=Wt.length,Jt;return Xt||(Jt=Wt[Gt],Gt+=1),{done:Xt,value:Jt}}}},getNonCollectionIterator=function(Wt,Gt){if(isArray$b(Wt)||isArguments$3(Wt))return getArrayIterator(Wt);if(isString$3(Wt)){var Yt=0;return{next:function(){var Jt=advanceStringIndex(Wt,Yt),Zt=$stringSlice(Wt,Yt,Jt);return Yt=Jt,{done:Jt>Wt.length,value:Zt}}}}if(Gt&&typeof Wt["_es6-shim iterator_"]<"u")return Wt["_es6-shim iterator_"]()};if(!$Map&&!$Set$1)esGetIterator.exports=function(Wt){if(Wt!=null)return getNonCollectionIterator(Wt,!0)};else{var isMap$3=isMap$4,isSet$3=isSet$4,$mapForEach=callBound$7("Map.prototype.forEach",!0),$setForEach=callBound$7("Set.prototype.forEach",!0);if(typeof browser$1$1>"u"||!browser$1$1.versions||!browser$1$1.versions.node)var $mapIterator=callBound$7("Map.prototype.iterator",!0),$setIterator=callBound$7("Set.prototype.iterator",!0);var $mapAtAtIterator=callBound$7("Map.prototype.@@iterator",!0)||callBound$7("Map.prototype._es6-shim iterator_",!0),$setAtAtIterator=callBound$7("Set.prototype.@@iterator",!0)||callBound$7("Set.prototype._es6-shim iterator_",!0),getCollectionIterator=function(Wt){if(isMap$3(Wt)){if($mapIterator)return getStopIterationIterator($mapIterator(Wt));if($mapAtAtIterator)return $mapAtAtIterator(Wt);if($mapForEach){var Gt=[];return $mapForEach(Wt,function(Xt,Jt){$arrayPush(Gt,[Jt,Xt])}),getArrayIterator(Gt)}}if(isSet$3(Wt)){if($setIterator)return getStopIterationIterator($setIterator(Wt));if($setAtAtIterator)return $setAtAtIterator(Wt);if($setForEach){var Yt=[];return $setForEach(Wt,function(Xt){$arrayPush(Yt,Xt)}),getArrayIterator(Yt)}}};esGetIterator.exports=function(Wt){return getCollectionIterator(Wt)||getNonCollectionIterator(Wt)}}}var esGetIteratorExports=esGetIterator.exports,numberIsNaN=function(Bt){return Bt!==Bt},implementation$2=function(Wt,Gt){return Wt===0&&Gt===0?1/Wt===1/Gt:!!(Wt===Gt||numberIsNaN(Wt)&&numberIsNaN(Gt))},implementation$1=implementation$2,polyfill$1=function(){return typeof Object.is=="function"?Object.is:implementation$1},getPolyfill$1=polyfill$1,define$2=defineProperties_1,shim$1=function(){var Wt=getPolyfill$1();return define$2(Object,{is:Wt},{is:function(){return Object.is!==Wt}}),Wt},define$1=defineProperties_1,callBind$1=callBindExports,implementation=implementation$2,getPolyfill=polyfill$1,shim=shim$1,polyfill=callBind$1(getPolyfill(),Object);define$1(polyfill,{getPolyfill,implementation,shim});var objectIs=polyfill,callBind=callBindExports,callBound$6=callBound$d,GetIntrinsic$2=getIntrinsic,isTypedArray$3=isTypedArray$7,$ArrayBuffer=GetIntrinsic$2("ArrayBuffer",!0),$Float32Array=GetIntrinsic$2("Float32Array",!0),$byteLength$2=callBound$6("ArrayBuffer.prototype.byteLength",!0),abSlice=$ArrayBuffer&&!$byteLength$2&&new $ArrayBuffer().slice,$abSlice=abSlice&&callBind(abSlice),isArrayBuffer$3=$byteLength$2||$abSlice?function(Wt){if(!Wt||typeof Wt!="object")return!1;try{return $byteLength$2?$byteLength$2(Wt):$abSlice(Wt,0),!0}catch{return!1}}:$Float32Array?function(Wt){try{return new $Float32Array(Wt).buffer===Wt&&!isTypedArray$3(Wt)}catch(Gt){return typeof Wt=="object"&&Gt.name==="RangeError"}}:function(Wt){return!1},getDay=Date.prototype.getDay,tryDateObject=function(Wt){try{return getDay.call(Wt),!0}catch{return!1}},toStr$2=Object.prototype.toString,dateClass="[object Date]",hasToStringTag$3=shams(),isDateObject=function(Wt){return typeof Wt!="object"||Wt===null?!1:hasToStringTag$3?tryDateObject(Wt):toStr$2.call(Wt)===dateClass},callBound$5=callBound$d,hasToStringTag$2=shams(),has$1,$exec,isRegexMarker,badStringifier;if(hasToStringTag$2){has$1=callBound$5("Object.prototype.hasOwnProperty"),$exec=callBound$5("RegExp.prototype.exec"),isRegexMarker={};var throwRegexMarker=function(){throw isRegexMarker};badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker},typeof Symbol.toPrimitive=="symbol"&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker)}var $toString$1=callBound$5("Object.prototype.toString"),gOPD=Object.getOwnPropertyDescriptor,regexClass="[object RegExp]",isRegex$1=hasToStringTag$2?function(Wt){if(!Wt||typeof Wt!="object")return!1;var Gt=gOPD(Wt,"lastIndex"),Yt=Gt&&has$1(Gt,"value");if(!Yt)return!1;try{$exec(Wt,badStringifier)}catch(Xt){return Xt===isRegexMarker}}:function(Wt){return!Wt||typeof Wt!="object"&&typeof Wt!="function"?!1:$toString$1(Wt)===regexClass},callBound$4=callBound$d,$byteLength$1=callBound$4("SharedArrayBuffer.prototype.byteLength",!0),isSharedArrayBuffer$1=$byteLength$1?function(Wt){if(!Wt||typeof Wt!="object")return!1;try{return $byteLength$1(Wt),!0}catch{return!1}}:function(Wt){return!1},numToStr=Number.prototype.toString,tryNumberObject=function(Wt){try{return numToStr.call(Wt),!0}catch{return!1}},toStr$1=Object.prototype.toString,numClass="[object Number]",hasToStringTag$1=shams(),isNumberObject=function(Wt){return typeof Wt=="number"?!0:typeof Wt!="object"?!1:hasToStringTag$1?tryNumberObject(Wt):toStr$1.call(Wt)===numClass},callBound$3=callBound$d,$boolToStr=callBound$3("Boolean.prototype.toString"),$toString=callBound$3("Object.prototype.toString"),tryBooleanObject=function(Wt){try{return $boolToStr(Wt),!0}catch{return!1}},boolClass="[object Boolean]",hasToStringTag=shams(),isBooleanObject=function(Wt){return typeof Wt=="boolean"?!0:Wt===null||typeof Wt!="object"?!1:hasToStringTag&&Symbol.toStringTag in Wt?tryBooleanObject(Wt):$toString(Wt)===boolClass},isSymbol$6={exports:{}},toStr=Object.prototype.toString,hasSymbols=hasSymbols$4();if(hasSymbols){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function(Wt){return typeof Wt.valueOf()!="symbol"?!1:symStringRegex.test(symToStr.call(Wt))};isSymbol$6.exports=function(Wt){if(typeof Wt=="symbol")return!0;if(toStr.call(Wt)!=="[object Symbol]")return!1;try{return isSymbolObject(Wt)}catch{return!1}}}else isSymbol$6.exports=function(Wt){return!1};var isSymbolExports=isSymbol$6.exports,isBigint={exports:{}},$BigInt=typeof BigInt<"u"&&BigInt,hasBigints=function(){return typeof $BigInt=="function"&&typeof BigInt=="function"&&typeof $BigInt(42)=="bigint"&&typeof BigInt(42)=="bigint"},hasBigInts=hasBigints();if(hasBigInts){var bigIntValueOf=BigInt.prototype.valueOf,tryBigInt=function(Wt){try{return bigIntValueOf.call(Wt),!0}catch{}return!1};isBigint.exports=function(Wt){return Wt===null||typeof Wt>"u"||typeof Wt=="boolean"||typeof Wt=="string"||typeof Wt=="number"||typeof Wt=="symbol"||typeof Wt=="function"?!1:typeof Wt=="bigint"?!0:tryBigInt(Wt)}}else isBigint.exports=function(Wt){return!1};var isBigintExports=isBigint.exports,isString$2=isString$4,isNumber$4=isNumberObject,isBoolean$2=isBooleanObject,isSymbol$5=isSymbolExports,isBigInt=isBigintExports,whichBoxedPrimitive$1=function(Wt){if(Wt==null||typeof Wt!="object"&&typeof Wt!="function")return null;if(isString$2(Wt))return"String";if(isNumber$4(Wt))return"Number";if(isBoolean$2(Wt))return"Boolean";if(isSymbol$5(Wt))return"Symbol";if(isBigInt(Wt))return"BigInt"},$WeakMap=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,$WeakSet$1=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,exported;$WeakMap||(exported=function(Wt){return!1});var $mapHas$2=$WeakMap?$WeakMap.prototype.has:null,$setHas$2=$WeakSet$1?$WeakSet$1.prototype.has:null;!exported&&!$mapHas$2&&(exported=function(Wt){return!1});var isWeakmap=exported||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($mapHas$2.call(Wt,$mapHas$2),$setHas$2)try{$setHas$2.call(Wt,$setHas$2)}catch{return!0}return Wt instanceof $WeakMap}catch{}return!1},isWeakset={exports:{}},GetIntrinsic$1=getIntrinsic,callBound$2=callBound$d,$WeakSet=GetIntrinsic$1("%WeakSet%",!0),$setHas$1=callBound$2("WeakSet.prototype.has",!0);if($setHas$1){var $mapHas$1=callBound$2("WeakMap.prototype.has",!0);isWeakset.exports=function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($setHas$1(Wt,$setHas$1),$mapHas$1)try{$mapHas$1(Wt,$mapHas$1)}catch{return!0}return Wt instanceof $WeakSet}catch{}return!1}}else isWeakset.exports=function(Wt){return!1};var isWeaksetExports=isWeakset.exports,isMap$2=isMap$4,isSet$2=isSet$4,isWeakMap$1=isWeakmap,isWeakSet=isWeaksetExports,whichCollection$1=function(Wt){if(Wt&&typeof Wt=="object"){if(isMap$2(Wt))return"Map";if(isSet$2(Wt))return"Set";if(isWeakMap$1(Wt))return"WeakMap";if(isWeakSet(Wt))return"WeakSet"}return!1},callBound$1=callBound$d,$byteLength=callBound$1("ArrayBuffer.prototype.byteLength",!0),isArrayBuffer$2=isArrayBuffer$3,arrayBufferByteLength=function(Wt){return isArrayBuffer$2(Wt)?$byteLength?$byteLength(Wt):Wt.byteLength:NaN},assign$3=object_assign,callBound=callBound$d,flags=regexp_prototype_flags,GetIntrinsic=getIntrinsic,getIterator=esGetIteratorExports,getSideChannel=sideChannel,is=objectIs,isArguments$2=isArguments$5,isArray$a=isarray,isArrayBuffer$1=isArrayBuffer$3,isDate$2=isDateObject,isRegex=isRegex$1,isSharedArrayBuffer=isSharedArrayBuffer$1,objectKeys=objectKeys$2,whichBoxedPrimitive=whichBoxedPrimitive$1,whichCollection=whichCollection$1,whichTypedArray=whichTypedArray$1,byteLength=arrayBufferByteLength,sabByteLength=callBound("SharedArrayBuffer.prototype.byteLength",!0),$getTime=callBound("Date.prototype.getTime"),gPO=Object.getPrototypeOf,$objToString=callBound("Object.prototype.toString"),$Set=GetIntrinsic("%Set%",!0),$mapHas=callBound("Map.prototype.has",!0),$mapGet=callBound("Map.prototype.get",!0),$mapSize=callBound("Map.prototype.size",!0),$setAdd=callBound("Set.prototype.add",!0),$setDelete=callBound("Set.prototype.delete",!0),$setHas=callBound("Set.prototype.has",!0),$setSize=callBound("Set.prototype.size",!0);function setHasEqualElement(Bt,Wt,Gt,Yt){for(var Xt=getIterator(Bt),Jt;(Jt=Xt.next())&&!Jt.done;)if(internalDeepEqual(Wt,Jt.value,Gt,Yt))return $setDelete(Bt,Jt.value),!0;return!1}function findLooseMatchingPrimitives(Bt){if(typeof Bt>"u")return null;if(typeof Bt!="object")return typeof Bt=="symbol"?!1:typeof Bt=="string"||typeof Bt=="number"?+Bt==+Bt:!0}function mapMightHaveLoosePrim(Bt,Wt,Gt,Yt,Xt,Jt){var Zt=findLooseMatchingPrimitives(Gt);if(Zt!=null)return Zt;var Qt=$mapGet(Wt,Zt),ur=assign$3({},Xt,{strict:!1});return typeof Qt>"u"&&!$mapHas(Wt,Zt)||!internalDeepEqual(Yt,Qt,ur,Jt)?!1:!$mapHas(Bt,Zt)&&internalDeepEqual(Yt,Qt,ur,Jt)}function setMightHaveLoosePrim(Bt,Wt,Gt){var Yt=findLooseMatchingPrimitives(Gt);return Yt??($setHas(Wt,Yt)&&!$setHas(Bt,Yt))}function mapHasEqualEntry(Bt,Wt,Gt,Yt,Xt,Jt){for(var Zt=getIterator(Bt),Qt,ur;(Qt=Zt.next())&&!Qt.done;)if(ur=Qt.value,internalDeepEqual(Gt,ur,Xt,Jt)&&internalDeepEqual(Yt,$mapGet(Wt,ur),Xt,Jt))return $setDelete(Bt,ur),!0;return!1}function internalDeepEqual(Bt,Wt,Gt,Yt){var Xt=Gt||{};if(Xt.strict?is(Bt,Wt):Bt===Wt)return!0;var Jt=whichBoxedPrimitive(Bt),Zt=whichBoxedPrimitive(Wt);if(Jt!==Zt)return!1;if(!Bt||!Wt||typeof Bt!="object"&&typeof Wt!="object")return Xt.strict?is(Bt,Wt):Bt==Wt;var Qt=Yt.has(Bt),ur=Yt.has(Wt),cr;if(Qt&&ur){if(Yt.get(Bt)===Yt.get(Wt))return!0}else cr={};return Qt||Yt.set(Bt,cr),ur||Yt.set(Wt,cr),objEquiv(Bt,Wt,Xt,Yt)}function isBuffer$5(Bt){return!Bt||typeof Bt!="object"||typeof Bt.length!="number"||typeof Bt.copy!="function"||typeof Bt.slice!="function"||Bt.length>0&&typeof Bt[0]!="number"?!1:!!(Bt.constructor&&Bt.constructor.isBuffer&&Bt.constructor.isBuffer(Bt))}function setEquiv(Bt,Wt,Gt,Yt){if($setSize(Bt)!==$setSize(Wt))return!1;for(var Xt=getIterator(Bt),Jt=getIterator(Wt),Zt,Qt,ur;(Zt=Xt.next())&&!Zt.done;)if(Zt.value&&typeof Zt.value=="object")ur||(ur=new $Set),$setAdd(ur,Zt.value);else if(!$setHas(Wt,Zt.value)){if(Gt.strict||!setMightHaveLoosePrim(Bt,Wt,Zt.value))return!1;ur||(ur=new $Set),$setAdd(ur,Zt.value)}if(ur){for(;(Qt=Jt.next())&&!Qt.done;)if(Qt.value&&typeof Qt.value=="object"){if(!setHasEqualElement(ur,Qt.value,Gt.strict,Yt))return!1}else if(!Gt.strict&&!$setHas(Bt,Qt.value)&&!setHasEqualElement(ur,Qt.value,Gt.strict,Yt))return!1;return $setSize(ur)===0}return!0}function mapEquiv(Bt,Wt,Gt,Yt){if($mapSize(Bt)!==$mapSize(Wt))return!1;for(var Xt=getIterator(Bt),Jt=getIterator(Wt),Zt,Qt,ur,cr,$r,Ar;(Zt=Xt.next())&&!Zt.done;)if(cr=Zt.value[0],$r=Zt.value[1],cr&&typeof cr=="object")ur||(ur=new $Set),$setAdd(ur,cr);else if(Ar=$mapGet(Wt,cr),typeof Ar>"u"&&!$mapHas(Wt,cr)||!internalDeepEqual($r,Ar,Gt,Yt)){if(Gt.strict||!mapMightHaveLoosePrim(Bt,Wt,cr,$r,Gt,Yt))return!1;ur||(ur=new $Set),$setAdd(ur,cr)}if(ur){for(;(Qt=Jt.next())&&!Qt.done;)if(cr=Qt.value[0],Ar=Qt.value[1],cr&&typeof cr=="object"){if(!mapHasEqualEntry(ur,Bt,cr,Ar,Gt,Yt))return!1}else if(!Gt.strict&&(!Bt.has(cr)||!internalDeepEqual($mapGet(Bt,cr),Ar,Gt,Yt))&&!mapHasEqualEntry(ur,Bt,cr,Ar,assign$3({},Gt,{strict:!1}),Yt))return!1;return $setSize(ur)===0}return!0}function objEquiv(Bt,Wt,Gt,Yt){var Xt,Jt;if(typeof Bt!=typeof Wt||Bt==null||Wt==null||$objToString(Bt)!==$objToString(Wt)||isArguments$2(Bt)!==isArguments$2(Wt))return!1;var Zt=isArray$a(Bt),Qt=isArray$a(Wt);if(Zt!==Qt)return!1;var ur=Bt instanceof Error,cr=Wt instanceof Error;if(ur!==cr||(ur||cr)&&(Bt.name!==Wt.name||Bt.message!==Wt.message))return!1;var $r=isRegex(Bt),Ar=isRegex(Wt);if($r!==Ar||($r||Ar)&&(Bt.source!==Wt.source||flags(Bt)!==flags(Wt)))return!1;var Lr=isDate$2(Bt),qr=isDate$2(Wt);if(Lr!==qr||(Lr||qr)&&$getTime(Bt)!==$getTime(Wt)||Gt.strict&&gPO&&gPO(Bt)!==gPO(Wt))return!1;var Fr=whichTypedArray(Bt),Hr=whichTypedArray(Wt);if((Fr||Hr)&&Fr!==Hr)return!1;var Br=isBuffer$5(Bt),Wr=isBuffer$5(Wt);if(Br!==Wr)return!1;if(Br||Wr){if(Bt.length!==Wt.length)return!1;for(Xt=0;Xt<Bt.length;Xt++)if(Bt[Xt]!==Wt[Xt])return!1;return!0}var Gr=isArrayBuffer$1(Bt),Kr=isArrayBuffer$1(Wt);if(Gr!==Kr)return!1;if(Gr||Kr)return byteLength(Bt)!==byteLength(Wt)?!1:typeof Uint8Array=="function"&&internalDeepEqual(new Uint8Array(Bt),new Uint8Array(Wt),Gt,Yt);var Yr=isSharedArrayBuffer(Bt),hn=isSharedArrayBuffer(Wt);if(Yr!==hn)return!1;if(Yr||hn)return sabByteLength(Bt)!==sabByteLength(Wt)?!1:typeof Uint8Array=="function"&&internalDeepEqual(new Uint8Array(Bt),new Uint8Array(Wt),Gt,Yt);if(typeof Bt!=typeof Wt)return!1;var Qr=objectKeys(Bt),pn=objectKeys(Wt);if(Qr.length!==pn.length)return!1;for(Qr.sort(),pn.sort(),Xt=Qr.length-1;Xt>=0;Xt--)if(Qr[Xt]!=pn[Xt])return!1;for(Xt=Qr.length-1;Xt>=0;Xt--)if(Jt=Qr[Xt],!internalDeepEqual(Bt[Jt],Wt[Jt],Gt,Yt))return!1;var En=whichCollection(Bt),ga=whichCollection(Wt);return En!==ga?!1:En==="Set"||ga==="Set"?setEquiv(Bt,Wt,Gt,Yt):En==="Map"?mapEquiv(Bt,Wt,Gt,Yt):!0}var deepEqual$1=function(Wt,Gt,Yt){return internalDeepEqual(Wt,Gt,Yt,getSideChannel())},preview$2={},previewCamera$2={},validation$2={},__importDefault$K=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(validation$2,"__esModule",{value:!0});validation$2.validateType=validation$2.generateLazyValidator=validation$2.Ajv=void 0;const ajv_1$2=__importDefault$K(ajvExports);validation$2.Ajv=ajv_1$2.default;const ajv_keywords_1$2=__importDefault$K(distExports$3),ajv_errors_1$2=__importDefault$K(distExports$2);function generateLazyValidator$2(Bt,Wt){let Gt=null;const Yt=(Xt,Jt)=>{if(!Gt){const Zt=new ajv_1$2.default({$data:!0,allErrors:!0});(0,ajv_keywords_1$2.default)(Zt),(0,ajv_errors_1$2.default)(Zt,{singleError:!0}),Wt==null||Wt.forEach(Qt=>Zt.addKeyword(Qt)),Gt=Zt.compile(Bt),Object.defineProperty(Yt,"errors",{get(){return Gt==null?void 0:Gt.errors}})}return Gt(Xt,Jt)};return Yt}validation$2.generateLazyValidator=generateLazyValidator$2;function validateType$2(Bt,Wt){return Bt.validate(Wt)}validation$2.validateType=validateType$2;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewCamera=void 0;const Wt=validation$2;(function(Gt){Gt.STATIC="static",Gt.INTERACTIVE="interactive"})(Bt.PreviewCamera||(Bt.PreviewCamera={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewCamera||(Bt.PreviewCamera={}))})(previewCamera$2);var previewConfig$2={};Object.defineProperty(previewConfig$2,"__esModule",{value:!0});var previewController$2={};Object.defineProperty(previewController$2,"__esModule",{value:!0});var previewEmoteEventType$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmoteEventType=void 0;const Wt=validation$2;(function(Gt){Gt.ANIMATION_PLAY="animation_play",Gt.ANIMATION_PAUSE="animation_pause",Gt.ANIMATION_LOOP="animation_loop",Gt.ANIMATION_END="animation_end",Gt.ANIMATION_PLAYING="animation_playing"})(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={}))})(previewEmoteEventType$2);var previewEmote$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmote=void 0;const Wt=validation$2;(function(Gt){Gt.IDLE="idle",Gt.CLAP="clap",Gt.DAB="dab",Gt.DANCE="dance",Gt.FASHION="fashion",Gt.FASHION_2="fashion-2",Gt.FASHION_3="fashion-3",Gt.FASHION_4="fashion-4",Gt.LOVE="love",Gt.MONEY="money",Gt.FIST_PUMP="fist-pump",Gt.HEAD_EXPLODE="head-explode"})(Bt.PreviewEmote||(Bt.PreviewEmote={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmote||(Bt.PreviewEmote={}))})(previewEmote$2);var previewMessage$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sendMessage=Bt.PreviewMessageType=void 0;const Wt=validation$2;(function(Yt){Yt.READY="ready",Yt.LOAD="load",Yt.ERROR="error",Yt.UPDATE="update",Yt.CONTROLLER_REQUEST="controller_request",Yt.CONTROLLER_RESPONSE="controller_response",Yt.EMOTE_EVENT="emote_event"})(Bt.PreviewMessageType||(Bt.PreviewMessageType={})),function(Yt){Yt.schema={type:"string",enum:Object.values(Yt)},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)}(Bt.PreviewMessageType||(Bt.PreviewMessageType={}));const Gt=(Yt,Xt,Jt,Zt="*")=>{const Qt={type:Xt,payload:Jt};Yt.postMessage(Qt,Zt)};Bt.sendMessage=Gt})(previewMessage$2);var previewOptions$2={};Object.defineProperty(previewOptions$2,"__esModule",{value:!0});var previewProjection$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewProjection=void 0;const Wt=validation$2;(function(Gt){Gt.ORTHOGRAPHIC="orthographic",Gt.PERSPECTIVE="perspective"})(Bt.PreviewProjection||(Bt.PreviewProjection={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewProjection||(Bt.PreviewProjection={}))})(previewProjection$2);var previewType$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewType=void 0;const Wt=validation$2;(function(Gt){Gt.TEXTURE="texture",Gt.WEARABLE="wearable",Gt.AVATAR="avatar"})(Bt.PreviewType||(Bt.PreviewType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewType||(Bt.PreviewType={}))})(previewType$2);var wearableRepresentationDefinition$2={};Object.defineProperty(wearableRepresentationDefinition$2,"__esModule",{value:!0});var wearableRepresentationWithBlobs$2={};Object.defineProperty(wearableRepresentationWithBlobs$2,"__esModule",{value:!0});var wearableDefinition$2={};Object.defineProperty(wearableDefinition$2,"__esModule",{value:!0});var wearableWithBlobs$2={};Object.defineProperty(wearableWithBlobs$2,"__esModule",{value:!0});var emoteRepresentationDefinition$2={};Object.defineProperty(emoteRepresentationDefinition$2,"__esModule",{value:!0});var emoteRepresentationWithBlobs$2={};Object.defineProperty(emoteRepresentationWithBlobs$2,"__esModule",{value:!0});var emoteDefinition$2={};Object.defineProperty(emoteDefinition$2,"__esModule",{value:!0});var emoteWithBlobs$2={};Object.defineProperty(emoteWithBlobs$2,"__esModule",{value:!0});(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(previewCamera$2,Bt),Gt(previewConfig$2,Bt),Gt(previewController$2,Bt),Gt(previewEmoteEventType$2,Bt),Gt(previewEmote$2,Bt),Gt(previewMessage$2,Bt),Gt(previewOptions$2,Bt),Gt(previewProjection$2,Bt),Gt(previewType$2,Bt),Gt(wearableRepresentationDefinition$2,Bt),Gt(wearableRepresentationWithBlobs$2,Bt),Gt(wearableDefinition$2,Bt),Gt(wearableWithBlobs$2,Bt),Gt(emoteRepresentationDefinition$2,Bt),Gt(emoteRepresentationWithBlobs$2,Bt),Gt(emoteDefinition$2,Bt),Gt(emoteWithBlobs$2,Bt)})(preview$2);var debounce$6={},__spreadArray$3=commonjsGlobal&&commonjsGlobal.__spreadArray||function(Bt,Wt,Gt){if(Gt||arguments.length===2)for(var Yt=0,Xt=Wt.length,Jt;Yt<Xt;Yt++)(Jt||!(Yt in Wt))&&(Jt||(Jt=Array.prototype.slice.call(Wt,0,Yt)),Jt[Yt]=Wt[Yt]);return Bt.concat(Jt||Array.prototype.slice.call(Wt))};Object.defineProperty(debounce$6,"__esModule",{value:!0});debounce$6.createDebounce=void 0;function createDebounce(){var Bt=null;return function(Wt,Gt){for(var Yt=[],Xt=2;Xt<arguments.length;Xt++)Yt[Xt-2]=arguments[Xt];Bt&&clearTimeout(Bt),Bt=setTimeout.apply(void 0,__spreadArray$3([Wt,Gt],Yt,!1))}}debounce$6.createDebounce=createDebounce;var WearablePreview_controller={},fpFuture={};Object.defineProperty(fpFuture,"__esModule",{value:!0});function future(){let Bt,Wt;const Gt=new Promise((Yt,Xt)=>{Bt=Jt=>{Yt(Jt),Gt.isPending=!1},Wt=Jt=>{Xt(Jt),Gt.isPending=!1}}).catch(Yt=>Promise.reject(Yt));return Gt.resolve=Bt,Gt.reject=Wt,"finally"in Gt||(Gt.finally=Yt=>{Gt.then(Yt),Gt.catch(Yt)}),Gt.isPending=!0,Gt}fpFuture.future=future;fpFuture.default=future;var __importDefault$J=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(WearablePreview_controller,"__esModule",{value:!0});WearablePreview_controller.createController=void 0;var events_1$1=eventsExports,fp_future_1=__importDefault$J(fpFuture),preview_1$1=preview$2,promises=new Map,emoteEvents=new Map;window.onmessage=function(Wt){if(Wt.data&&Wt.data.type)switch(Wt.data.type){case preview_1$1.PreviewMessageType.CONTROLLER_RESPONSE:{var Gt=Wt.data.payload,Yt=Gt.id,Xt=promises.get(Yt);Xt&&(Gt.ok?Xt.resolve(Gt.result):Gt.ok===!1&&Xt.reject(new Error(Gt.error)));break}case preview_1$1.PreviewMessageType.EMOTE_EVENT:{var Gt=Wt.data.payload,Jt=Gt.type,Zt=Gt.payload,Qt=emoteEvents.get(Wt.source);Qt&&Jt&&Qt.emit(Jt,Zt);break}}};var nonce=0;function createSendRequest(Bt){return function(Gt,Yt,Xt){var Jt=document.getElementById(Bt),Zt=Bt+"-"+nonce,Qt=(0,fp_future_1.default)();promises.set(Zt,Qt);var ur=preview_1$1.PreviewMessageType.CONTROLLER_REQUEST,cr={id:Zt,namespace:Gt,method:Yt,params:Xt};return(0,preview_1$1.sendMessage)(Jt.contentWindow,ur,cr),nonce++,Qt}}function createController(Bt){var Wt,Gt=document.getElementById(Bt);if(!Gt)throw new Error('Could not find an iframe with id="'.concat(Bt,'"'));var Yt=(Wt=emoteEvents.get(Gt.contentWindow))!==null&&Wt!==void 0?Wt:new events_1$1.EventEmitter;emoteEvents.set(Gt.contentWindow,Yt);var Xt=createSendRequest(Bt);return{scene:{getScreenshot:function(Jt,Zt){return Xt("scene","getScreenshot",[Jt,Zt])},getMetrics:function(){return Xt("scene","getMetrics",[])},changeZoom:function(Jt){return Xt("scene","changeZoom",[Jt])},panCamera:function(Jt){return Xt("scene","panCamera",[Jt])},changeCameraPosition:function(Jt){return Xt("scene","changeCameraPosition",[Jt])}},emote:{getLength:function(){return Xt("emote","getLength",[])},isPlaying:function(){return Xt("emote","isPlaying",[])},goTo:function(Jt){return Xt("emote","goTo",[Jt])},play:function(){return Xt("emote","play",[])},pause:function(){return Xt("emote","pause",[])},stop:function(){return Xt("emote","stop",[])},events:Yt}}}WearablePreview_controller.createController=createController;const WearablePreview$2="";var __extends$y=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=function(Wt,Gt){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Yt,Xt){Yt.__proto__=Xt}||function(Yt,Xt){for(var Jt in Xt)Object.prototype.hasOwnProperty.call(Xt,Jt)&&(Yt[Jt]=Xt[Jt])},Bt(Wt,Gt)};return function(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Class extends value "+String(Gt)+" is not a constructor or null");Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__createBinding$V=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$V=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$V=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$V(Wt,Bt,Gt);return __setModuleDefault$V(Wt,Bt),Wt},__rest$f=commonjsGlobal&&commonjsGlobal.__rest||function(Bt,Wt){var Gt={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Wt.indexOf(Yt)<0&&(Gt[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Yt=Object.getOwnPropertySymbols(Bt);Xt<Yt.length;Xt++)Wt.indexOf(Yt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[Xt])&&(Gt[Yt[Xt]]=Bt[Yt[Xt]]);return Gt},__importDefault$I=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(WearablePreview$3,"__esModule",{value:!0});var WearablePreview_2=WearablePreview$3.WearablePreview=void 0,React$O=__importStar$V(reactExports),deep_equal_1=__importDefault$I(deepEqual$1),preview_1=preview$2,debounce_1$1=debounce$6,WearablePreview_controller_1=WearablePreview_controller,debounce$5=(0,debounce_1$1.createDebounce)(),WearablePreview$1=function(Bt){__extends$y(Wt,Bt);function Wt(){var Gt=Bt!==null&&Bt.apply(this,arguments)||this;return Gt.state={isReady:!1,pendingOptions:null,lastOptions:null},Gt.iframe=null,Gt.getUrl=function(){var Yt=Gt.props,Xt=Yt.contractAddress,Jt=Yt.tokenId,Zt=Yt.itemId,Qt=Yt.profile,ur=Yt.urns,cr=Yt.urls,$r=Yt.base64s,Ar=Yt.skin,Lr=Yt.hair,qr=Yt.eyes,Fr=Yt.bodyShape,Hr=Yt.emote,Br=Yt.camera,Wr=Yt.projection,Gr=Yt.zoom,Kr=Yt.background,Yr=Yt.offsetX,hn=Yt.offsetY,Qr=Yt.offsetZ,pn=Yt.cameraX,En=Yt.cameraY,ga=Yt.cameraZ,dn=Yt.wheelZoom,Pr=Yt.wheelPrecision,xr=Yt.wheelStart,Mr=Yt.disableBackground,Nr=Yt.disableAutoRotate,Ur=Yt.disableAutoCenter,Vr=Yt.disableFace,Zr=Yt.disableDefaultWearables,Xr=Yt.disableDefaultEmotes,Or=Yt.disableFadeEffect,jr=Yt.showSceneBoundaries,Jr=Yt.showThumbnailBoundaries,mn=Yt.dev,gn=Yt.baseUrl,eo=Yt.peerUrl,_i=Yt.nftServerUrl,ro=Yt.type,io=Xt?"contract=".concat(Xt):"",ao=Jt?"token=".concat(Jt):"",oo=Zt?"item=".concat(Zt):"",to=Qt?"profile=".concat(Qt):"",so=ur&&ur.length>0?ur.map(function(qo){return"urn=".concat(qo)}).join("&"):"",lo=cr&&cr.length>0?cr.map(function(qo){return"url=".concat(qo)}).join("&"):"",Ro=$r&&$r.length>0?$r.map(function(qo){return"base64=".concat(qo)}).join("&"):"",Io=Ar?"skin=".concat(Ar):"",Fo=Lr?"hair=".concat(Lr):"",xo=qr?"eyes=".concat(qr):"",ho=Fr?"bodyShape=".concat(Fr):"",po=Hr?"emote=".concat(Hr):"",Ao=Br?"camera=".concat(Br):"",Bo=Wr?"projection=".concat(Wr):"",Mo=isNaN(Gr)?"":"zoom=".concat(Gr),bo=Kr?"background=".concat(Kr):"",yo=isNaN(Yr)?"":"offsetX=".concat(Yr),Do=isNaN(hn)?"":"offsetY=".concat(hn),Tu=isNaN(Qr)?"":"offsetZ=".concat(Qr),wu=isNaN(pn)?"":"cameraX=".concat(pn),$o=isNaN(En)?"":"cameraY=".concat(En),mo=isNaN(ga)?"":"cameraZ=".concat(ga),_o=isNaN(dn)?"":"wheelZoom=".concat(dn),To=isNaN(Pr)?"":"wheelPrecision=".concat(Pr),iu=isNaN(xr)?"":"wheelStart=".concat(xr),nu=Mr?"disableBackground":"",Jo=Nr?"disableAutoRotate":"",cu=Ur?"disableAutoCenter":"",au=Vr?"disableFace":"",tu=Zr?"disableDefaultWearables":"",Iu=Xr?"disableDefaultEmotes":"",Ru=Or?"disableFadeEffect":"",$u=jr?"showSceneBoundaries":"",Yu=Jr?"showThumbnailBoundaries":"",qu=eo?"peerUrl=".concat(eo):"",fu=_i?"nftServerUrl=".concat(_i):"",Xu=ro?"type=".concat(ro):"",Nu=mn?"env=dev":"",jo=gn+"?"+[io,ao,oo,to,so,lo,Ro,Io,Fo,xo,ho,po,Ao,Bo,Mo,bo,yo,Do,Tu,wu,$o,mo,_o,To,iu,nu,Jo,cu,au,tu,Iu,Ru,$u,Yu,qu,fu,Xu,Nu].filter(function(qo){return!!qo}).join("&");return jo},Gt.getOptions=function(){var Yt=Gt.props;Yt.dev;var Xt=__rest$f(Yt,["dev"]),Jt={};for(var Zt in Xt)typeof Xt[Zt]!="function"&&(Jt[Zt]=Xt[Zt]);return Jt},Gt.handleMessage=function(Yt){var Xt=Gt.props,Jt=Xt.baseUrl,Zt=Xt.onLoad,Qt=Xt.onError,ur=Yt.origin;if(ur===Jt&&Yt.data&&Yt.data.type){var cr=Yt.data.type;switch(cr){case preview_1.PreviewMessageType.LOAD:{Zt();break}case preview_1.PreviewMessageType.ERROR:{var $r=Yt.data.payload;Qt(new Error($r.message));break}case preview_1.PreviewMessageType.READY:{var Ar=Gt.state,Lr=Ar.isReady,qr=Ar.pendingOptions;if(Lr)return;qr!==null?(Gt.sendUpdate(qr),Gt.setState({isReady:!0,pendingOptions:null})):Gt.setState({isReady:!0});break}}}},Gt.handleUpdate=function(){if(Gt.iframe){if(window){var Yt=Gt.getOptions();Gt.state.isReady?Gt.sendUpdate(Yt):Gt.setState({pendingPreviewOptions:Yt})}}else console.warn("Could not send update, iframe is not referenced")},Gt.sendUpdate=function(Yt){var Xt=Gt.state.lastOptions;if(!Xt||!(0,deep_equal_1.default)(Yt,Xt)){(0,preview_1.sendMessage)(Gt.iframe.contentWindow,preview_1.PreviewMessageType.UPDATE,{options:Yt});var Jt=Gt.props.onUpdate;Jt(Yt),Gt.setState({lastOptions:Yt})}},Gt.refIframe=function(Yt){Gt.iframe=Yt},Gt}return Wt.createController=function(Gt){return(0,WearablePreview_controller_1.createController)(Gt)},Wt.prototype.componentDidMount=function(){window.addEventListener("message",this.handleMessage,!1),this.setState({url:this.getUrl()}),this.props.blob&&this.handleUpdate()},Wt.prototype.componentWillUnmount=function(){window.removeEventListener("message",this.handleMessage,!1)},Wt.prototype.componentDidUpdate=function(){debounce$5(this.handleUpdate,500)},Wt.prototype.render=function(){return this.props.tokenId&&this.props.itemId&&console.warn("You should NOT use `tokenId` and `itemId` props simultaneously"),React$O.createElement("iframe",{id:this.props.id,className:"WearablePreview",src:this.state.url,width:"100%",height:"100%",frameBorder:"0",ref:this.refIframe})},Wt.defaultProps={dev:!1,baseUrl:"https://wearable-preview.decentraland.org",onLoad:function(){},onError:function(){},onUpdate:function(){}},Wt}(React$O.PureComponent);WearablePreview_2=WearablePreview$3.WearablePreview=WearablePreview$1;const Edit="/assets/Edit-fd146392.svg",Avatar$1="_Avatar_1cm1z_1",styles$6={Avatar:Avatar$1},Avatar=()=>jsxRuntimeExports.jsxs("div",{className:styles$6.Avatar,children:[jsxRuntimeExports.jsx(WearablePreview_2,{disableBackground:!0,profile:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsxs(Button$3.Button,{primary:!0,fluid:!0,className:"customIconButton",children:[jsxRuntimeExports.jsx("img",{src:Edit,className:"iconSize"})," ",t_1("avatar.edit")]})]});var classnames={exports:{}};/*!
799
+ `+Wt.prev}function arrObjKeys(Bt,Wt){var Gt=isArray$c(Bt),Yt=[];if(Gt){Yt.length=Bt.length;for(var Xt=0;Xt<Bt.length;Xt++)Yt[Xt]=has$3(Bt,Xt)?Wt(Bt[Xt],Bt):""}var Jt=typeof gOPS=="function"?gOPS(Bt):[],Zt;if(hasShammedSymbols){Zt={};for(var Qt=0;Qt<Jt.length;Qt++)Zt["$"+Jt[Qt]]=Jt[Qt]}for(var ur in Bt)has$3(Bt,ur)&&(Gt&&String(Number(ur))===ur&&ur<Bt.length||hasShammedSymbols&&Zt["$"+ur]instanceof Symbol||($test.call(/[^\w$]/,ur)?Yt.push(Wt(ur,Bt)+": "+Wt(Bt[ur],Bt)):Yt.push(ur+": "+Wt(Bt[ur],Bt))));if(typeof gOPS=="function")for(var cr=0;cr<Jt.length;cr++)isEnumerable.call(Bt,Jt[cr])&&Yt.push("["+Wt(Jt[cr])+"]: "+Wt(Bt[Jt[cr]],Bt));return Yt}var GetIntrinsic$5=getIntrinsic,callBound$8=callBound$d,inspect=objectInspect,$TypeError$1=GetIntrinsic$5("%TypeError%"),$WeakMap$1=GetIntrinsic$5("%WeakMap%",!0),$Map$3=GetIntrinsic$5("%Map%",!0),$weakMapGet=callBound$8("WeakMap.prototype.get",!0),$weakMapSet=callBound$8("WeakMap.prototype.set",!0),$weakMapHas=callBound$8("WeakMap.prototype.has",!0),$mapGet$1=callBound$8("Map.prototype.get",!0),$mapSet=callBound$8("Map.prototype.set",!0),$mapHas$5=callBound$8("Map.prototype.has",!0),listGetNode=function(Bt,Wt){for(var Gt=Bt,Yt;(Yt=Gt.next)!==null;Gt=Yt)if(Yt.key===Wt)return Gt.next=Yt.next,Yt.next=Bt.next,Bt.next=Yt,Yt},listGet=function(Bt,Wt){var Gt=listGetNode(Bt,Wt);return Gt&&Gt.value},listSet=function(Bt,Wt,Gt){var Yt=listGetNode(Bt,Wt);Yt?Yt.value=Gt:Bt.next={key:Wt,next:Bt.next,value:Gt}},listHas=function(Bt,Wt){return!!listGetNode(Bt,Wt)},sideChannel=function(){var Wt,Gt,Yt,Xt={assert:function(Jt){if(!Xt.has(Jt))throw new $TypeError$1("Side channel does not contain "+inspect(Jt))},get:function(Jt){if($WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")){if(Wt)return $weakMapGet(Wt,Jt)}else if($Map$3){if(Gt)return $mapGet$1(Gt,Jt)}else if(Yt)return listGet(Yt,Jt)},has:function(Jt){if($WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")){if(Wt)return $weakMapHas(Wt,Jt)}else if($Map$3){if(Gt)return $mapHas$5(Gt,Jt)}else if(Yt)return listHas(Yt,Jt);return!1},set:function(Jt,Zt){$WeakMap$1&&Jt&&(typeof Jt=="object"||typeof Jt=="function")?(Wt||(Wt=new $WeakMap$1),$weakMapSet(Wt,Jt,Zt)):$Map$3?(Gt||(Gt=new $Map$3),$mapSet(Gt,Jt,Zt)):(Yt||(Yt={key:{},next:null}),listSet(Yt,Jt,Zt))}};return Xt},GetIntrinsic$4=getIntrinsic,has$2=src$f,channel$2=sideChannel(),$TypeError=GetIntrinsic$4("%TypeError%"),SLOT$1={assert:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");if(channel$2.assert(Bt),!SLOT$1.has(Bt,Wt))throw new $TypeError("`"+Wt+"` is not present on `O`")},get:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Gt=channel$2.get(Bt);return Gt&&Gt["$"+Wt]},has:function(Bt,Wt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Gt=channel$2.get(Bt);return!!Gt&&has$2(Gt,"$"+Wt)},set:function(Bt,Wt,Gt){if(!Bt||typeof Bt!="object"&&typeof Bt!="function")throw new $TypeError("`O` is not an object");if(typeof Wt!="string")throw new $TypeError("`slot` must be a string");var Yt=channel$2.get(Bt);Yt||(Yt={},channel$2.set(Bt,Yt)),Yt["$"+Wt]=Gt}};Object.freeze&&Object.freeze(SLOT$1);var internalSlot=SLOT$1,SLOT=internalSlot,$SyntaxError=SyntaxError,$StopIteration=typeof StopIteration=="object"?StopIteration:null,stopIterationIterator=function(Wt){if(!$StopIteration)throw new $SyntaxError("this environment lacks StopIteration");SLOT.set(Wt,"[[Done]]",!1);var Gt={next:function(){var Xt=SLOT.get(this,"[[Iterator]]"),Jt=SLOT.get(Xt,"[[Done]]");try{return{done:Jt,value:Jt?void 0:Xt.next()}}catch(Zt){if(SLOT.set(Xt,"[[Done]]",!0),Zt!==$StopIteration)throw Zt;return{done:!0,value:void 0}}}};return SLOT.set(Gt,"[[Iterator]]",Wt),Gt},strValue=String.prototype.valueOf,tryStringObject=function(Wt){try{return strValue.call(Wt),!0}catch{return!1}},toStr$3=Object.prototype.toString,strClass="[object String]",hasToStringTag$4=shams(),isString$4=function(Wt){return typeof Wt=="string"?!0:typeof Wt!="object"?!1:hasToStringTag$4?tryStringObject(Wt):toStr$3.call(Wt)===strClass},$Map$2=typeof Map=="function"&&Map.prototype?Map:null,$Set$3=typeof Set=="function"&&Set.prototype?Set:null,exported$2;$Map$2||(exported$2=function(Wt){return!1});var $mapHas$4=$Map$2?Map.prototype.has:null,$setHas$4=$Set$3?Set.prototype.has:null;!exported$2&&!$mapHas$4&&(exported$2=function(Wt){return!1});var isMap$4=exported$2||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($mapHas$4.call(Wt),$setHas$4)try{$setHas$4.call(Wt)}catch{return!0}return Wt instanceof $Map$2}catch{}return!1},$Map$1=typeof Map=="function"&&Map.prototype?Map:null,$Set$2=typeof Set=="function"&&Set.prototype?Set:null,exported$1;$Set$2||(exported$1=function(Wt){return!1});var $mapHas$3=$Map$1?Map.prototype.has:null,$setHas$3=$Set$2?Set.prototype.has:null;!exported$1&&!$setHas$3&&(exported$1=function(Wt){return!1});var isSet$4=exported$1||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($setHas$3.call(Wt),$mapHas$3)try{$mapHas$3.call(Wt)}catch{return!0}return Wt instanceof $Set$2}catch{}return!1},isArguments$3=isArguments$5,getStopIterationIterator=stopIterationIterator;if(hasSymbols$4()||shams$1()){var $iterator=Symbol.iterator;esGetIterator.exports=function(Wt){if(Wt!=null&&typeof Wt[$iterator]<"u")return Wt[$iterator]();if(isArguments$3(Wt))return Array.prototype[$iterator].call(Wt)}}else{var isArray$b=isarray,isString$3=isString$4,GetIntrinsic$3=getIntrinsic,$Map=GetIntrinsic$3("%Map%",!0),$Set$1=GetIntrinsic$3("%Set%",!0),callBound$7=callBound$d,$arrayPush=callBound$7("Array.prototype.push"),$charCodeAt=callBound$7("String.prototype.charCodeAt"),$stringSlice=callBound$7("String.prototype.slice"),advanceStringIndex=function(Wt,Gt){var Yt=Wt.length;if(Gt+1>=Yt)return Gt+1;var Xt=$charCodeAt(Wt,Gt);if(Xt<55296||Xt>56319)return Gt+1;var Jt=$charCodeAt(Wt,Gt+1);return Jt<56320||Jt>57343?Gt+1:Gt+2},getArrayIterator=function(Wt){var Gt=0;return{next:function(){var Xt=Gt>=Wt.length,Jt;return Xt||(Jt=Wt[Gt],Gt+=1),{done:Xt,value:Jt}}}},getNonCollectionIterator=function(Wt,Gt){if(isArray$b(Wt)||isArguments$3(Wt))return getArrayIterator(Wt);if(isString$3(Wt)){var Yt=0;return{next:function(){var Jt=advanceStringIndex(Wt,Yt),Zt=$stringSlice(Wt,Yt,Jt);return Yt=Jt,{done:Jt>Wt.length,value:Zt}}}}if(Gt&&typeof Wt["_es6-shim iterator_"]<"u")return Wt["_es6-shim iterator_"]()};if(!$Map&&!$Set$1)esGetIterator.exports=function(Wt){if(Wt!=null)return getNonCollectionIterator(Wt,!0)};else{var isMap$3=isMap$4,isSet$3=isSet$4,$mapForEach=callBound$7("Map.prototype.forEach",!0),$setForEach=callBound$7("Set.prototype.forEach",!0);if(typeof browser$1$1>"u"||!browser$1$1.versions||!browser$1$1.versions.node)var $mapIterator=callBound$7("Map.prototype.iterator",!0),$setIterator=callBound$7("Set.prototype.iterator",!0);var $mapAtAtIterator=callBound$7("Map.prototype.@@iterator",!0)||callBound$7("Map.prototype._es6-shim iterator_",!0),$setAtAtIterator=callBound$7("Set.prototype.@@iterator",!0)||callBound$7("Set.prototype._es6-shim iterator_",!0),getCollectionIterator=function(Wt){if(isMap$3(Wt)){if($mapIterator)return getStopIterationIterator($mapIterator(Wt));if($mapAtAtIterator)return $mapAtAtIterator(Wt);if($mapForEach){var Gt=[];return $mapForEach(Wt,function(Xt,Jt){$arrayPush(Gt,[Jt,Xt])}),getArrayIterator(Gt)}}if(isSet$3(Wt)){if($setIterator)return getStopIterationIterator($setIterator(Wt));if($setAtAtIterator)return $setAtAtIterator(Wt);if($setForEach){var Yt=[];return $setForEach(Wt,function(Xt){$arrayPush(Yt,Xt)}),getArrayIterator(Yt)}}};esGetIterator.exports=function(Wt){return getCollectionIterator(Wt)||getNonCollectionIterator(Wt)}}}var esGetIteratorExports=esGetIterator.exports,numberIsNaN=function(Bt){return Bt!==Bt},implementation$2=function(Wt,Gt){return Wt===0&&Gt===0?1/Wt===1/Gt:!!(Wt===Gt||numberIsNaN(Wt)&&numberIsNaN(Gt))},implementation$1=implementation$2,polyfill$1=function(){return typeof Object.is=="function"?Object.is:implementation$1},getPolyfill$1=polyfill$1,define$2=defineProperties_1,shim$1=function(){var Wt=getPolyfill$1();return define$2(Object,{is:Wt},{is:function(){return Object.is!==Wt}}),Wt},define$1=defineProperties_1,callBind$1=callBindExports,implementation=implementation$2,getPolyfill=polyfill$1,shim=shim$1,polyfill=callBind$1(getPolyfill(),Object);define$1(polyfill,{getPolyfill,implementation,shim});var objectIs=polyfill,callBind=callBindExports,callBound$6=callBound$d,GetIntrinsic$2=getIntrinsic,isTypedArray$3=isTypedArray$7,$ArrayBuffer=GetIntrinsic$2("ArrayBuffer",!0),$Float32Array=GetIntrinsic$2("Float32Array",!0),$byteLength$2=callBound$6("ArrayBuffer.prototype.byteLength",!0),abSlice=$ArrayBuffer&&!$byteLength$2&&new $ArrayBuffer().slice,$abSlice=abSlice&&callBind(abSlice),isArrayBuffer$3=$byteLength$2||$abSlice?function(Wt){if(!Wt||typeof Wt!="object")return!1;try{return $byteLength$2?$byteLength$2(Wt):$abSlice(Wt,0),!0}catch{return!1}}:$Float32Array?function(Wt){try{return new $Float32Array(Wt).buffer===Wt&&!isTypedArray$3(Wt)}catch(Gt){return typeof Wt=="object"&&Gt.name==="RangeError"}}:function(Wt){return!1},getDay=Date.prototype.getDay,tryDateObject=function(Wt){try{return getDay.call(Wt),!0}catch{return!1}},toStr$2=Object.prototype.toString,dateClass="[object Date]",hasToStringTag$3=shams(),isDateObject=function(Wt){return typeof Wt!="object"||Wt===null?!1:hasToStringTag$3?tryDateObject(Wt):toStr$2.call(Wt)===dateClass},callBound$5=callBound$d,hasToStringTag$2=shams(),has$1,$exec,isRegexMarker,badStringifier;if(hasToStringTag$2){has$1=callBound$5("Object.prototype.hasOwnProperty"),$exec=callBound$5("RegExp.prototype.exec"),isRegexMarker={};var throwRegexMarker=function(){throw isRegexMarker};badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker},typeof Symbol.toPrimitive=="symbol"&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker)}var $toString$1=callBound$5("Object.prototype.toString"),gOPD=Object.getOwnPropertyDescriptor,regexClass="[object RegExp]",isRegex$1=hasToStringTag$2?function(Wt){if(!Wt||typeof Wt!="object")return!1;var Gt=gOPD(Wt,"lastIndex"),Yt=Gt&&has$1(Gt,"value");if(!Yt)return!1;try{$exec(Wt,badStringifier)}catch(Xt){return Xt===isRegexMarker}}:function(Wt){return!Wt||typeof Wt!="object"&&typeof Wt!="function"?!1:$toString$1(Wt)===regexClass},callBound$4=callBound$d,$byteLength$1=callBound$4("SharedArrayBuffer.prototype.byteLength",!0),isSharedArrayBuffer$1=$byteLength$1?function(Wt){if(!Wt||typeof Wt!="object")return!1;try{return $byteLength$1(Wt),!0}catch{return!1}}:function(Wt){return!1},numToStr=Number.prototype.toString,tryNumberObject=function(Wt){try{return numToStr.call(Wt),!0}catch{return!1}},toStr$1=Object.prototype.toString,numClass="[object Number]",hasToStringTag$1=shams(),isNumberObject=function(Wt){return typeof Wt=="number"?!0:typeof Wt!="object"?!1:hasToStringTag$1?tryNumberObject(Wt):toStr$1.call(Wt)===numClass},callBound$3=callBound$d,$boolToStr=callBound$3("Boolean.prototype.toString"),$toString=callBound$3("Object.prototype.toString"),tryBooleanObject=function(Wt){try{return $boolToStr(Wt),!0}catch{return!1}},boolClass="[object Boolean]",hasToStringTag=shams(),isBooleanObject=function(Wt){return typeof Wt=="boolean"?!0:Wt===null||typeof Wt!="object"?!1:hasToStringTag&&Symbol.toStringTag in Wt?tryBooleanObject(Wt):$toString(Wt)===boolClass},isSymbol$6={exports:{}},toStr=Object.prototype.toString,hasSymbols=hasSymbols$4();if(hasSymbols){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,isSymbolObject=function(Wt){return typeof Wt.valueOf()!="symbol"?!1:symStringRegex.test(symToStr.call(Wt))};isSymbol$6.exports=function(Wt){if(typeof Wt=="symbol")return!0;if(toStr.call(Wt)!=="[object Symbol]")return!1;try{return isSymbolObject(Wt)}catch{return!1}}}else isSymbol$6.exports=function(Wt){return!1};var isSymbolExports=isSymbol$6.exports,isBigint={exports:{}},$BigInt=typeof BigInt<"u"&&BigInt,hasBigints=function(){return typeof $BigInt=="function"&&typeof BigInt=="function"&&typeof $BigInt(42)=="bigint"&&typeof BigInt(42)=="bigint"},hasBigInts=hasBigints();if(hasBigInts){var bigIntValueOf=BigInt.prototype.valueOf,tryBigInt=function(Wt){try{return bigIntValueOf.call(Wt),!0}catch{}return!1};isBigint.exports=function(Wt){return Wt===null||typeof Wt>"u"||typeof Wt=="boolean"||typeof Wt=="string"||typeof Wt=="number"||typeof Wt=="symbol"||typeof Wt=="function"?!1:typeof Wt=="bigint"?!0:tryBigInt(Wt)}}else isBigint.exports=function(Wt){return!1};var isBigintExports=isBigint.exports,isString$2=isString$4,isNumber$4=isNumberObject,isBoolean$2=isBooleanObject,isSymbol$5=isSymbolExports,isBigInt=isBigintExports,whichBoxedPrimitive$1=function(Wt){if(Wt==null||typeof Wt!="object"&&typeof Wt!="function")return null;if(isString$2(Wt))return"String";if(isNumber$4(Wt))return"Number";if(isBoolean$2(Wt))return"Boolean";if(isSymbol$5(Wt))return"Symbol";if(isBigInt(Wt))return"BigInt"},$WeakMap=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,$WeakSet$1=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,exported;$WeakMap||(exported=function(Wt){return!1});var $mapHas$2=$WeakMap?$WeakMap.prototype.has:null,$setHas$2=$WeakSet$1?$WeakSet$1.prototype.has:null;!exported&&!$mapHas$2&&(exported=function(Wt){return!1});var isWeakmap=exported||function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($mapHas$2.call(Wt,$mapHas$2),$setHas$2)try{$setHas$2.call(Wt,$setHas$2)}catch{return!0}return Wt instanceof $WeakMap}catch{}return!1},isWeakset={exports:{}},GetIntrinsic$1=getIntrinsic,callBound$2=callBound$d,$WeakSet=GetIntrinsic$1("%WeakSet%",!0),$setHas$1=callBound$2("WeakSet.prototype.has",!0);if($setHas$1){var $mapHas$1=callBound$2("WeakMap.prototype.has",!0);isWeakset.exports=function(Wt){if(!Wt||typeof Wt!="object")return!1;try{if($setHas$1(Wt,$setHas$1),$mapHas$1)try{$mapHas$1(Wt,$mapHas$1)}catch{return!0}return Wt instanceof $WeakSet}catch{}return!1}}else isWeakset.exports=function(Wt){return!1};var isWeaksetExports=isWeakset.exports,isMap$2=isMap$4,isSet$2=isSet$4,isWeakMap$1=isWeakmap,isWeakSet=isWeaksetExports,whichCollection$1=function(Wt){if(Wt&&typeof Wt=="object"){if(isMap$2(Wt))return"Map";if(isSet$2(Wt))return"Set";if(isWeakMap$1(Wt))return"WeakMap";if(isWeakSet(Wt))return"WeakSet"}return!1},callBound$1=callBound$d,$byteLength=callBound$1("ArrayBuffer.prototype.byteLength",!0),isArrayBuffer$2=isArrayBuffer$3,arrayBufferByteLength=function(Wt){return isArrayBuffer$2(Wt)?$byteLength?$byteLength(Wt):Wt.byteLength:NaN},assign$3=object_assign,callBound=callBound$d,flags=regexp_prototype_flags,GetIntrinsic=getIntrinsic,getIterator=esGetIteratorExports,getSideChannel=sideChannel,is=objectIs,isArguments$2=isArguments$5,isArray$a=isarray,isArrayBuffer$1=isArrayBuffer$3,isDate$2=isDateObject,isRegex=isRegex$1,isSharedArrayBuffer=isSharedArrayBuffer$1,objectKeys=objectKeys$2,whichBoxedPrimitive=whichBoxedPrimitive$1,whichCollection=whichCollection$1,whichTypedArray=whichTypedArray$1,byteLength=arrayBufferByteLength,sabByteLength=callBound("SharedArrayBuffer.prototype.byteLength",!0),$getTime=callBound("Date.prototype.getTime"),gPO=Object.getPrototypeOf,$objToString=callBound("Object.prototype.toString"),$Set=GetIntrinsic("%Set%",!0),$mapHas=callBound("Map.prototype.has",!0),$mapGet=callBound("Map.prototype.get",!0),$mapSize=callBound("Map.prototype.size",!0),$setAdd=callBound("Set.prototype.add",!0),$setDelete=callBound("Set.prototype.delete",!0),$setHas=callBound("Set.prototype.has",!0),$setSize=callBound("Set.prototype.size",!0);function setHasEqualElement(Bt,Wt,Gt,Yt){for(var Xt=getIterator(Bt),Jt;(Jt=Xt.next())&&!Jt.done;)if(internalDeepEqual(Wt,Jt.value,Gt,Yt))return $setDelete(Bt,Jt.value),!0;return!1}function findLooseMatchingPrimitives(Bt){if(typeof Bt>"u")return null;if(typeof Bt!="object")return typeof Bt=="symbol"?!1:typeof Bt=="string"||typeof Bt=="number"?+Bt==+Bt:!0}function mapMightHaveLoosePrim(Bt,Wt,Gt,Yt,Xt,Jt){var Zt=findLooseMatchingPrimitives(Gt);if(Zt!=null)return Zt;var Qt=$mapGet(Wt,Zt),ur=assign$3({},Xt,{strict:!1});return typeof Qt>"u"&&!$mapHas(Wt,Zt)||!internalDeepEqual(Yt,Qt,ur,Jt)?!1:!$mapHas(Bt,Zt)&&internalDeepEqual(Yt,Qt,ur,Jt)}function setMightHaveLoosePrim(Bt,Wt,Gt){var Yt=findLooseMatchingPrimitives(Gt);return Yt??($setHas(Wt,Yt)&&!$setHas(Bt,Yt))}function mapHasEqualEntry(Bt,Wt,Gt,Yt,Xt,Jt){for(var Zt=getIterator(Bt),Qt,ur;(Qt=Zt.next())&&!Qt.done;)if(ur=Qt.value,internalDeepEqual(Gt,ur,Xt,Jt)&&internalDeepEqual(Yt,$mapGet(Wt,ur),Xt,Jt))return $setDelete(Bt,ur),!0;return!1}function internalDeepEqual(Bt,Wt,Gt,Yt){var Xt=Gt||{};if(Xt.strict?is(Bt,Wt):Bt===Wt)return!0;var Jt=whichBoxedPrimitive(Bt),Zt=whichBoxedPrimitive(Wt);if(Jt!==Zt)return!1;if(!Bt||!Wt||typeof Bt!="object"&&typeof Wt!="object")return Xt.strict?is(Bt,Wt):Bt==Wt;var Qt=Yt.has(Bt),ur=Yt.has(Wt),cr;if(Qt&&ur){if(Yt.get(Bt)===Yt.get(Wt))return!0}else cr={};return Qt||Yt.set(Bt,cr),ur||Yt.set(Wt,cr),objEquiv(Bt,Wt,Xt,Yt)}function isBuffer$5(Bt){return!Bt||typeof Bt!="object"||typeof Bt.length!="number"||typeof Bt.copy!="function"||typeof Bt.slice!="function"||Bt.length>0&&typeof Bt[0]!="number"?!1:!!(Bt.constructor&&Bt.constructor.isBuffer&&Bt.constructor.isBuffer(Bt))}function setEquiv(Bt,Wt,Gt,Yt){if($setSize(Bt)!==$setSize(Wt))return!1;for(var Xt=getIterator(Bt),Jt=getIterator(Wt),Zt,Qt,ur;(Zt=Xt.next())&&!Zt.done;)if(Zt.value&&typeof Zt.value=="object")ur||(ur=new $Set),$setAdd(ur,Zt.value);else if(!$setHas(Wt,Zt.value)){if(Gt.strict||!setMightHaveLoosePrim(Bt,Wt,Zt.value))return!1;ur||(ur=new $Set),$setAdd(ur,Zt.value)}if(ur){for(;(Qt=Jt.next())&&!Qt.done;)if(Qt.value&&typeof Qt.value=="object"){if(!setHasEqualElement(ur,Qt.value,Gt.strict,Yt))return!1}else if(!Gt.strict&&!$setHas(Bt,Qt.value)&&!setHasEqualElement(ur,Qt.value,Gt.strict,Yt))return!1;return $setSize(ur)===0}return!0}function mapEquiv(Bt,Wt,Gt,Yt){if($mapSize(Bt)!==$mapSize(Wt))return!1;for(var Xt=getIterator(Bt),Jt=getIterator(Wt),Zt,Qt,ur,cr,$r,Ar;(Zt=Xt.next())&&!Zt.done;)if(cr=Zt.value[0],$r=Zt.value[1],cr&&typeof cr=="object")ur||(ur=new $Set),$setAdd(ur,cr);else if(Ar=$mapGet(Wt,cr),typeof Ar>"u"&&!$mapHas(Wt,cr)||!internalDeepEqual($r,Ar,Gt,Yt)){if(Gt.strict||!mapMightHaveLoosePrim(Bt,Wt,cr,$r,Gt,Yt))return!1;ur||(ur=new $Set),$setAdd(ur,cr)}if(ur){for(;(Qt=Jt.next())&&!Qt.done;)if(cr=Qt.value[0],Ar=Qt.value[1],cr&&typeof cr=="object"){if(!mapHasEqualEntry(ur,Bt,cr,Ar,Gt,Yt))return!1}else if(!Gt.strict&&(!Bt.has(cr)||!internalDeepEqual($mapGet(Bt,cr),Ar,Gt,Yt))&&!mapHasEqualEntry(ur,Bt,cr,Ar,assign$3({},Gt,{strict:!1}),Yt))return!1;return $setSize(ur)===0}return!0}function objEquiv(Bt,Wt,Gt,Yt){var Xt,Jt;if(typeof Bt!=typeof Wt||Bt==null||Wt==null||$objToString(Bt)!==$objToString(Wt)||isArguments$2(Bt)!==isArguments$2(Wt))return!1;var Zt=isArray$a(Bt),Qt=isArray$a(Wt);if(Zt!==Qt)return!1;var ur=Bt instanceof Error,cr=Wt instanceof Error;if(ur!==cr||(ur||cr)&&(Bt.name!==Wt.name||Bt.message!==Wt.message))return!1;var $r=isRegex(Bt),Ar=isRegex(Wt);if($r!==Ar||($r||Ar)&&(Bt.source!==Wt.source||flags(Bt)!==flags(Wt)))return!1;var Lr=isDate$2(Bt),qr=isDate$2(Wt);if(Lr!==qr||(Lr||qr)&&$getTime(Bt)!==$getTime(Wt)||Gt.strict&&gPO&&gPO(Bt)!==gPO(Wt))return!1;var Fr=whichTypedArray(Bt),Hr=whichTypedArray(Wt);if((Fr||Hr)&&Fr!==Hr)return!1;var Br=isBuffer$5(Bt),Wr=isBuffer$5(Wt);if(Br!==Wr)return!1;if(Br||Wr){if(Bt.length!==Wt.length)return!1;for(Xt=0;Xt<Bt.length;Xt++)if(Bt[Xt]!==Wt[Xt])return!1;return!0}var Gr=isArrayBuffer$1(Bt),Kr=isArrayBuffer$1(Wt);if(Gr!==Kr)return!1;if(Gr||Kr)return byteLength(Bt)!==byteLength(Wt)?!1:typeof Uint8Array=="function"&&internalDeepEqual(new Uint8Array(Bt),new Uint8Array(Wt),Gt,Yt);var Yr=isSharedArrayBuffer(Bt),hn=isSharedArrayBuffer(Wt);if(Yr!==hn)return!1;if(Yr||hn)return sabByteLength(Bt)!==sabByteLength(Wt)?!1:typeof Uint8Array=="function"&&internalDeepEqual(new Uint8Array(Bt),new Uint8Array(Wt),Gt,Yt);if(typeof Bt!=typeof Wt)return!1;var Qr=objectKeys(Bt),pn=objectKeys(Wt);if(Qr.length!==pn.length)return!1;for(Qr.sort(),pn.sort(),Xt=Qr.length-1;Xt>=0;Xt--)if(Qr[Xt]!=pn[Xt])return!1;for(Xt=Qr.length-1;Xt>=0;Xt--)if(Jt=Qr[Xt],!internalDeepEqual(Bt[Jt],Wt[Jt],Gt,Yt))return!1;var En=whichCollection(Bt),ga=whichCollection(Wt);return En!==ga?!1:En==="Set"||ga==="Set"?setEquiv(Bt,Wt,Gt,Yt):En==="Map"?mapEquiv(Bt,Wt,Gt,Yt):!0}var deepEqual$1=function(Wt,Gt,Yt){return internalDeepEqual(Wt,Gt,Yt,getSideChannel())},preview$2={},previewCamera$2={},validation$2={},__importDefault$K=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(validation$2,"__esModule",{value:!0});validation$2.validateType=validation$2.generateLazyValidator=validation$2.Ajv=void 0;const ajv_1$2=__importDefault$K(ajvExports);validation$2.Ajv=ajv_1$2.default;const ajv_keywords_1$2=__importDefault$K(distExports$3),ajv_errors_1$2=__importDefault$K(distExports$2);function generateLazyValidator$2(Bt,Wt){let Gt=null;const Yt=(Xt,Jt)=>{if(!Gt){const Zt=new ajv_1$2.default({$data:!0,allErrors:!0});(0,ajv_keywords_1$2.default)(Zt),(0,ajv_errors_1$2.default)(Zt,{singleError:!0}),Wt==null||Wt.forEach(Qt=>Zt.addKeyword(Qt)),Gt=Zt.compile(Bt),Object.defineProperty(Yt,"errors",{get(){return Gt==null?void 0:Gt.errors}})}return Gt(Xt,Jt)};return Yt}validation$2.generateLazyValidator=generateLazyValidator$2;function validateType$2(Bt,Wt){return Bt.validate(Wt)}validation$2.validateType=validateType$2;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewCamera=void 0;const Wt=validation$2;(function(Gt){Gt.STATIC="static",Gt.INTERACTIVE="interactive"})(Bt.PreviewCamera||(Bt.PreviewCamera={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewCamera||(Bt.PreviewCamera={}))})(previewCamera$2);var previewConfig$2={};Object.defineProperty(previewConfig$2,"__esModule",{value:!0});var previewController$2={};Object.defineProperty(previewController$2,"__esModule",{value:!0});var previewEmoteEventType$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmoteEventType=void 0;const Wt=validation$2;(function(Gt){Gt.ANIMATION_PLAY="animation_play",Gt.ANIMATION_PAUSE="animation_pause",Gt.ANIMATION_LOOP="animation_loop",Gt.ANIMATION_END="animation_end",Gt.ANIMATION_PLAYING="animation_playing"})(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmoteEventType||(Bt.PreviewEmoteEventType={}))})(previewEmoteEventType$2);var previewEmote$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewEmote=void 0;const Wt=validation$2;(function(Gt){Gt.IDLE="idle",Gt.CLAP="clap",Gt.DAB="dab",Gt.DANCE="dance",Gt.FASHION="fashion",Gt.FASHION_2="fashion-2",Gt.FASHION_3="fashion-3",Gt.FASHION_4="fashion-4",Gt.LOVE="love",Gt.MONEY="money",Gt.FIST_PUMP="fist-pump",Gt.HEAD_EXPLODE="head-explode"})(Bt.PreviewEmote||(Bt.PreviewEmote={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewEmote||(Bt.PreviewEmote={}))})(previewEmote$2);var previewMessage$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.sendMessage=Bt.PreviewMessageType=void 0;const Wt=validation$2;(function(Yt){Yt.READY="ready",Yt.LOAD="load",Yt.ERROR="error",Yt.UPDATE="update",Yt.CONTROLLER_REQUEST="controller_request",Yt.CONTROLLER_RESPONSE="controller_response",Yt.EMOTE_EVENT="emote_event"})(Bt.PreviewMessageType||(Bt.PreviewMessageType={})),function(Yt){Yt.schema={type:"string",enum:Object.values(Yt)},Yt.validate=(0,Wt.generateLazyValidator)(Yt.schema)}(Bt.PreviewMessageType||(Bt.PreviewMessageType={}));const Gt=(Yt,Xt,Jt,Zt="*")=>{const Qt={type:Xt,payload:Jt};Yt.postMessage(Qt,Zt)};Bt.sendMessage=Gt})(previewMessage$2);var previewOptions$2={};Object.defineProperty(previewOptions$2,"__esModule",{value:!0});var previewProjection$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewProjection=void 0;const Wt=validation$2;(function(Gt){Gt.ORTHOGRAPHIC="orthographic",Gt.PERSPECTIVE="perspective"})(Bt.PreviewProjection||(Bt.PreviewProjection={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewProjection||(Bt.PreviewProjection={}))})(previewProjection$2);var previewType$2={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.PreviewType=void 0;const Wt=validation$2;(function(Gt){Gt.TEXTURE="texture",Gt.WEARABLE="wearable",Gt.AVATAR="avatar"})(Bt.PreviewType||(Bt.PreviewType={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.PreviewType||(Bt.PreviewType={}))})(previewType$2);var wearableRepresentationDefinition$2={};Object.defineProperty(wearableRepresentationDefinition$2,"__esModule",{value:!0});var wearableRepresentationWithBlobs$2={};Object.defineProperty(wearableRepresentationWithBlobs$2,"__esModule",{value:!0});var wearableDefinition$2={};Object.defineProperty(wearableDefinition$2,"__esModule",{value:!0});var wearableWithBlobs$2={};Object.defineProperty(wearableWithBlobs$2,"__esModule",{value:!0});var emoteRepresentationDefinition$2={};Object.defineProperty(emoteRepresentationDefinition$2,"__esModule",{value:!0});var emoteRepresentationWithBlobs$2={};Object.defineProperty(emoteRepresentationWithBlobs$2,"__esModule",{value:!0});var emoteDefinition$2={};Object.defineProperty(emoteDefinition$2,"__esModule",{value:!0});var emoteWithBlobs$2={};Object.defineProperty(emoteWithBlobs$2,"__esModule",{value:!0});(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(previewCamera$2,Bt),Gt(previewConfig$2,Bt),Gt(previewController$2,Bt),Gt(previewEmoteEventType$2,Bt),Gt(previewEmote$2,Bt),Gt(previewMessage$2,Bt),Gt(previewOptions$2,Bt),Gt(previewProjection$2,Bt),Gt(previewType$2,Bt),Gt(wearableRepresentationDefinition$2,Bt),Gt(wearableRepresentationWithBlobs$2,Bt),Gt(wearableDefinition$2,Bt),Gt(wearableWithBlobs$2,Bt),Gt(emoteRepresentationDefinition$2,Bt),Gt(emoteRepresentationWithBlobs$2,Bt),Gt(emoteDefinition$2,Bt),Gt(emoteWithBlobs$2,Bt)})(preview$2);var debounce$6={},__spreadArray$3=commonjsGlobal&&commonjsGlobal.__spreadArray||function(Bt,Wt,Gt){if(Gt||arguments.length===2)for(var Yt=0,Xt=Wt.length,Jt;Yt<Xt;Yt++)(Jt||!(Yt in Wt))&&(Jt||(Jt=Array.prototype.slice.call(Wt,0,Yt)),Jt[Yt]=Wt[Yt]);return Bt.concat(Jt||Array.prototype.slice.call(Wt))};Object.defineProperty(debounce$6,"__esModule",{value:!0});debounce$6.createDebounce=void 0;function createDebounce(){var Bt=null;return function(Wt,Gt){for(var Yt=[],Xt=2;Xt<arguments.length;Xt++)Yt[Xt-2]=arguments[Xt];Bt&&clearTimeout(Bt),Bt=setTimeout.apply(void 0,__spreadArray$3([Wt,Gt],Yt,!1))}}debounce$6.createDebounce=createDebounce;var WearablePreview_controller={},fpFuture={};Object.defineProperty(fpFuture,"__esModule",{value:!0});function future(){let Bt,Wt;const Gt=new Promise((Yt,Xt)=>{Bt=Jt=>{Yt(Jt),Gt.isPending=!1},Wt=Jt=>{Xt(Jt),Gt.isPending=!1}}).catch(Yt=>Promise.reject(Yt));return Gt.resolve=Bt,Gt.reject=Wt,"finally"in Gt||(Gt.finally=Yt=>{Gt.then(Yt),Gt.catch(Yt)}),Gt.isPending=!0,Gt}fpFuture.future=future;fpFuture.default=future;var __importDefault$J=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(WearablePreview_controller,"__esModule",{value:!0});WearablePreview_controller.createController=void 0;var events_1$1=eventsExports,fp_future_1=__importDefault$J(fpFuture),preview_1$1=preview$2,promises=new Map,emoteEvents=new Map;window.onmessage=function(Wt){if(Wt.data&&Wt.data.type)switch(Wt.data.type){case preview_1$1.PreviewMessageType.CONTROLLER_RESPONSE:{var Gt=Wt.data.payload,Yt=Gt.id,Xt=promises.get(Yt);Xt&&(Gt.ok?Xt.resolve(Gt.result):Gt.ok===!1&&Xt.reject(new Error(Gt.error)));break}case preview_1$1.PreviewMessageType.EMOTE_EVENT:{var Gt=Wt.data.payload,Jt=Gt.type,Zt=Gt.payload,Qt=emoteEvents.get(Wt.source);Qt&&Jt&&Qt.emit(Jt,Zt);break}}};var nonce=0;function createSendRequest(Bt){return function(Gt,Yt,Xt){var Jt=document.getElementById(Bt),Zt=Bt+"-"+nonce,Qt=(0,fp_future_1.default)();promises.set(Zt,Qt);var ur=preview_1$1.PreviewMessageType.CONTROLLER_REQUEST,cr={id:Zt,namespace:Gt,method:Yt,params:Xt};return(0,preview_1$1.sendMessage)(Jt.contentWindow,ur,cr),nonce++,Qt}}function createController(Bt){var Wt,Gt=document.getElementById(Bt);if(!Gt)throw new Error('Could not find an iframe with id="'.concat(Bt,'"'));var Yt=(Wt=emoteEvents.get(Gt.contentWindow))!==null&&Wt!==void 0?Wt:new events_1$1.EventEmitter;emoteEvents.set(Gt.contentWindow,Yt);var Xt=createSendRequest(Bt);return{scene:{getScreenshot:function(Jt,Zt){return Xt("scene","getScreenshot",[Jt,Zt])},getMetrics:function(){return Xt("scene","getMetrics",[])},changeZoom:function(Jt){return Xt("scene","changeZoom",[Jt])},panCamera:function(Jt){return Xt("scene","panCamera",[Jt])},changeCameraPosition:function(Jt){return Xt("scene","changeCameraPosition",[Jt])}},emote:{getLength:function(){return Xt("emote","getLength",[])},isPlaying:function(){return Xt("emote","isPlaying",[])},goTo:function(Jt){return Xt("emote","goTo",[Jt])},play:function(){return Xt("emote","play",[])},pause:function(){return Xt("emote","pause",[])},stop:function(){return Xt("emote","stop",[])},events:Yt}}}WearablePreview_controller.createController=createController;const WearablePreview$2="";var __extends$y=commonjsGlobal&&commonjsGlobal.__extends||function(){var Bt=function(Wt,Gt){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Yt,Xt){Yt.__proto__=Xt}||function(Yt,Xt){for(var Jt in Xt)Object.prototype.hasOwnProperty.call(Xt,Jt)&&(Yt[Jt]=Xt[Jt])},Bt(Wt,Gt)};return function(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Class extends value "+String(Gt)+" is not a constructor or null");Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__createBinding$V=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$V=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$V=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$V(Wt,Bt,Gt);return __setModuleDefault$V(Wt,Bt),Wt},__rest$f=commonjsGlobal&&commonjsGlobal.__rest||function(Bt,Wt){var Gt={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Wt.indexOf(Yt)<0&&(Gt[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Yt=Object.getOwnPropertySymbols(Bt);Xt<Yt.length;Xt++)Wt.indexOf(Yt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[Xt])&&(Gt[Yt[Xt]]=Bt[Yt[Xt]]);return Gt},__importDefault$I=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(WearablePreview$3,"__esModule",{value:!0});var WearablePreview_2=WearablePreview$3.WearablePreview=void 0,React$O=__importStar$V(reactExports),deep_equal_1=__importDefault$I(deepEqual$1),preview_1=preview$2,debounce_1$1=debounce$6,WearablePreview_controller_1=WearablePreview_controller,debounce$5=(0,debounce_1$1.createDebounce)(),WearablePreview$1=function(Bt){__extends$y(Wt,Bt);function Wt(){var Gt=Bt!==null&&Bt.apply(this,arguments)||this;return Gt.state={isReady:!1,pendingOptions:null,lastOptions:null},Gt.iframe=null,Gt.getUrl=function(){var Yt=Gt.props,Xt=Yt.contractAddress,Jt=Yt.tokenId,Zt=Yt.itemId,Qt=Yt.profile,ur=Yt.urns,cr=Yt.urls,$r=Yt.base64s,Ar=Yt.skin,Lr=Yt.hair,qr=Yt.eyes,Fr=Yt.bodyShape,Hr=Yt.emote,Br=Yt.camera,Wr=Yt.projection,Gr=Yt.zoom,Kr=Yt.background,Yr=Yt.offsetX,hn=Yt.offsetY,Qr=Yt.offsetZ,pn=Yt.cameraX,En=Yt.cameraY,ga=Yt.cameraZ,dn=Yt.wheelZoom,Pr=Yt.wheelPrecision,xr=Yt.wheelStart,Mr=Yt.disableBackground,Nr=Yt.disableAutoRotate,Ur=Yt.disableAutoCenter,Vr=Yt.disableFace,Zr=Yt.disableDefaultWearables,Xr=Yt.disableDefaultEmotes,Or=Yt.disableFadeEffect,jr=Yt.showSceneBoundaries,Jr=Yt.showThumbnailBoundaries,mn=Yt.dev,gn=Yt.baseUrl,eo=Yt.peerUrl,_i=Yt.nftServerUrl,ro=Yt.type,io=Xt?"contract=".concat(Xt):"",ao=Jt?"token=".concat(Jt):"",oo=Zt?"item=".concat(Zt):"",to=Qt?"profile=".concat(Qt):"",so=ur&&ur.length>0?ur.map(function(qo){return"urn=".concat(qo)}).join("&"):"",lo=cr&&cr.length>0?cr.map(function(qo){return"url=".concat(qo)}).join("&"):"",Ro=$r&&$r.length>0?$r.map(function(qo){return"base64=".concat(qo)}).join("&"):"",Io=Ar?"skin=".concat(Ar):"",Fo=Lr?"hair=".concat(Lr):"",xo=qr?"eyes=".concat(qr):"",ho=Fr?"bodyShape=".concat(Fr):"",po=Hr?"emote=".concat(Hr):"",Ao=Br?"camera=".concat(Br):"",Bo=Wr?"projection=".concat(Wr):"",Mo=isNaN(Gr)?"":"zoom=".concat(Gr),bo=Kr?"background=".concat(Kr):"",yo=isNaN(Yr)?"":"offsetX=".concat(Yr),Do=isNaN(hn)?"":"offsetY=".concat(hn),Tu=isNaN(Qr)?"":"offsetZ=".concat(Qr),wu=isNaN(pn)?"":"cameraX=".concat(pn),$o=isNaN(En)?"":"cameraY=".concat(En),mo=isNaN(ga)?"":"cameraZ=".concat(ga),_o=isNaN(dn)?"":"wheelZoom=".concat(dn),To=isNaN(Pr)?"":"wheelPrecision=".concat(Pr),iu=isNaN(xr)?"":"wheelStart=".concat(xr),nu=Mr?"disableBackground":"",Jo=Nr?"disableAutoRotate":"",cu=Ur?"disableAutoCenter":"",au=Vr?"disableFace":"",tu=Zr?"disableDefaultWearables":"",Iu=Xr?"disableDefaultEmotes":"",Ru=Or?"disableFadeEffect":"",$u=jr?"showSceneBoundaries":"",Yu=Jr?"showThumbnailBoundaries":"",qu=eo?"peerUrl=".concat(eo):"",fu=_i?"nftServerUrl=".concat(_i):"",Xu=ro?"type=".concat(ro):"",Nu=mn?"env=dev":"",jo=gn+"?"+[io,ao,oo,to,so,lo,Ro,Io,Fo,xo,ho,po,Ao,Bo,Mo,bo,yo,Do,Tu,wu,$o,mo,_o,To,iu,nu,Jo,cu,au,tu,Iu,Ru,$u,Yu,qu,fu,Xu,Nu].filter(function(qo){return!!qo}).join("&");return jo},Gt.getOptions=function(){var Yt=Gt.props;Yt.dev;var Xt=__rest$f(Yt,["dev"]),Jt={};for(var Zt in Xt)typeof Xt[Zt]!="function"&&(Jt[Zt]=Xt[Zt]);return Jt},Gt.handleMessage=function(Yt){var Xt=Gt.props,Jt=Xt.baseUrl,Zt=Xt.onLoad,Qt=Xt.onError,ur=Yt.origin;if(ur===Jt&&Yt.data&&Yt.data.type){var cr=Yt.data.type;switch(cr){case preview_1.PreviewMessageType.LOAD:{Zt();break}case preview_1.PreviewMessageType.ERROR:{var $r=Yt.data.payload;Qt(new Error($r.message));break}case preview_1.PreviewMessageType.READY:{var Ar=Gt.state,Lr=Ar.isReady,qr=Ar.pendingOptions;if(Lr)return;qr!==null?(Gt.sendUpdate(qr),Gt.setState({isReady:!0,pendingOptions:null})):Gt.setState({isReady:!0});break}}}},Gt.handleUpdate=function(){if(Gt.iframe){if(window){var Yt=Gt.getOptions();Gt.state.isReady?Gt.sendUpdate(Yt):Gt.setState({pendingPreviewOptions:Yt})}}else console.warn("Could not send update, iframe is not referenced")},Gt.sendUpdate=function(Yt){var Xt=Gt.state.lastOptions;if(!Xt||!(0,deep_equal_1.default)(Yt,Xt)){(0,preview_1.sendMessage)(Gt.iframe.contentWindow,preview_1.PreviewMessageType.UPDATE,{options:Yt});var Jt=Gt.props.onUpdate;Jt(Yt),Gt.setState({lastOptions:Yt})}},Gt.refIframe=function(Yt){Gt.iframe=Yt},Gt}return Wt.createController=function(Gt){return(0,WearablePreview_controller_1.createController)(Gt)},Wt.prototype.componentDidMount=function(){window.addEventListener("message",this.handleMessage,!1),this.setState({url:this.getUrl()}),this.props.blob&&this.handleUpdate()},Wt.prototype.componentWillUnmount=function(){window.removeEventListener("message",this.handleMessage,!1)},Wt.prototype.componentDidUpdate=function(){debounce$5(this.handleUpdate,500)},Wt.prototype.render=function(){return this.props.tokenId&&this.props.itemId&&console.warn("You should NOT use `tokenId` and `itemId` props simultaneously"),React$O.createElement("iframe",{id:this.props.id,className:"WearablePreview",src:this.state.url,width:"100%",height:"100%",frameBorder:"0",ref:this.refIframe})},Wt.defaultProps={dev:!1,baseUrl:"https://wearable-preview.decentraland.org",onLoad:function(){},onError:function(){},onUpdate:function(){}},Wt}(React$O.PureComponent);WearablePreview_2=WearablePreview$3.WearablePreview=WearablePreview$1;const Edit="https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/assets/Edit-fd146392.svg",Avatar$1="_Avatar_1cm1z_1",styles$6={Avatar:Avatar$1},Avatar=()=>jsxRuntimeExports.jsxs("div",{className:styles$6.Avatar,children:[jsxRuntimeExports.jsx(WearablePreview_2,{disableBackground:!0,profile:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsxs(Button$3.Button,{primary:!0,fluid:!0,className:"customIconButton",children:[jsxRuntimeExports.jsx("img",{src:Edit,className:"iconSize"})," ",t_1("avatar.edit")]})]});var classnames={exports:{}};/*!
800
800
  Copyright (c) 2018 Jed Watson.
801
801
  Licensed under the MIT License (MIT), see
802
802
  http://jedwatson.github.io/classnames
@@ -898,7 +898,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
898
898
  C`).concat(ur,",").concat(Qt," ").concat(Ar,",").concat($r," ").concat(cr,",").concat($r,`
899
899
  `),fill:"none",stroke:"#333",strokeWidth:Lr,strokeOpacity:"0.2"},filterProps(qr)))}},{key:"renderNodeItem",value:function(Xt,Jt){return React$W.isValidElement(Xt)?React$W.cloneElement(Xt,Jt):_isFunction(Xt)?Xt(Jt):React$W.createElement(Rectangle,_extends$2({className:"recharts-sankey-node",fill:"#0088fe",fillOpacity:"0.8"},filterProps(Jt),{role:"img"}))}}]),Gt}(reactExports.PureComponent);_defineProperty$2(Sankey,"displayName","Sankey");_defineProperty$2(Sankey,"defaultProps",{nameKey:"name",dataKey:"value",nodePadding:10,nodeWidth:10,linkCurvature:.5,iterations:32,margin:{top:5,right:5,bottom:5,left:5}});var RadarChart=generateCategoricalChart({chartName:"RadarChart",GraphicalChild:Radar,axisComponents:[{axisType:"angleAxis",AxisComp:PolarAngleAxis},{axisType:"radiusAxis",AxisComp:PolarRadiusAxis}],formatAxisMap:formatAxisMap$1,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),ScatterChart=generateCategoricalChart({chartName:"ScatterChart",GraphicalChild:Scatter,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis},{axisType:"zAxis",AxisComp:ZAxis}],formatAxisMap}),AreaChart=generateCategoricalChart({chartName:"AreaChart",GraphicalChild:Area,axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis}],formatAxisMap}),RadialBarChart=generateCategoricalChart({chartName:"RadialBarChart",GraphicalChild:RadialBar,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:PolarAngleAxis},{axisType:"radiusAxis",AxisComp:PolarRadiusAxis}],formatAxisMap:formatAxisMap$1,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),ComposedChart=generateCategoricalChart({chartName:"ComposedChart",GraphicalChild:[Line,Area,Bar,Scatter],axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis},{axisType:"zAxis",AxisComp:ZAxis}],formatAxisMap});function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt];for(var Yt in Gt)Object.prototype.hasOwnProperty.call(Gt,Yt)&&(Bt[Yt]=Gt[Yt])}return Bt},_extends$1.apply(this,arguments)}function _slicedToArray$1(Bt,Wt){return _arrayWithHoles$1(Bt)||_iterableToArrayLimit$1(Bt,Wt)||_unsupportedIterableToArray$1(Bt,Wt)||_nonIterableRest$1()}function _nonIterableRest$1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
900
900
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(Bt,Wt){if(Bt){if(typeof Bt=="string")return _arrayLikeToArray$1(Bt,Wt);var Gt=Object.prototype.toString.call(Bt).slice(8,-1);if(Gt==="Object"&&Bt.constructor&&(Gt=Bt.constructor.name),Gt==="Map"||Gt==="Set")return Array.from(Bt);if(Gt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Gt))return _arrayLikeToArray$1(Bt,Wt)}}function _arrayLikeToArray$1(Bt,Wt){(Wt==null||Wt>Bt.length)&&(Wt=Bt.length);for(var Gt=0,Yt=new Array(Wt);Gt<Wt;Gt++)Yt[Gt]=Bt[Gt];return Yt}function _iterableToArrayLimit$1(Bt,Wt){var Gt=Bt==null?null:typeof Symbol<"u"&&Bt[Symbol.iterator]||Bt["@@iterator"];if(Gt!=null){var Yt,Xt,Jt,Zt,Qt=[],ur=!0,cr=!1;try{if(Jt=(Gt=Gt.call(Bt)).next,Wt===0){if(Object(Gt)!==Gt)return;ur=!1}else for(;!(ur=(Yt=Jt.call(Gt)).done)&&(Qt.push(Yt.value),Qt.length!==Wt);ur=!0);}catch($r){cr=!0,Xt=$r}finally{try{if(!ur&&Gt.return!=null&&(Zt=Gt.return(),Object(Zt)!==Zt))return}finally{if(cr)throw Xt}}return Qt}}function _arrayWithHoles$1(Bt){if(Array.isArray(Bt))return Bt}var getTrapezoidPath=function(Wt,Gt,Yt,Xt,Jt){var Zt=Yt-Xt,Qt;return Qt="M ".concat(Wt,",").concat(Gt),Qt+="L ".concat(Wt+Yt,",").concat(Gt),Qt+="L ".concat(Wt+Yt-Zt/2,",").concat(Gt+Jt),Qt+="L ".concat(Wt+Yt-Zt/2-Xt,",").concat(Gt+Jt),Qt+="L ".concat(Wt,",").concat(Gt," Z"),Qt},Trapezoid=function(Wt){var Gt=reactExports.useRef(),Yt=reactExports.useState(-1),Xt=_slicedToArray$1(Yt,2),Jt=Xt[0],Zt=Xt[1];reactExports.useLayoutEffect(function(){if(Gt.current&&Gt.current.getTotalLength)try{var Gr=Gt.current.getTotalLength();Gr&&Zt(Gr)}catch{}},[]);var Qt=Wt.x,ur=Wt.y,cr=Wt.upperWidth,$r=Wt.lowerWidth,Ar=Wt.height,Lr=Wt.className,qr=Wt.animationEasing,Fr=Wt.animationDuration,Hr=Wt.animationBegin,Br=Wt.isUpdateAnimationActive;if(Qt!==+Qt||ur!==+ur||cr!==+cr||$r!==+$r||Ar!==+Ar||cr===0&&$r===0||Ar===0)return null;var Wr=classNames("recharts-trapezoid",Lr);return Br?React$W.createElement(Animate,{canBegin:Jt>0,from:{upperWidth:0,lowerWidth:0,height:Ar,x:Qt,y:ur},to:{upperWidth:cr,lowerWidth:$r,height:Ar,x:Qt,y:ur},duration:Fr,animationEasing:qr,isActive:Br},function(Gr){var Kr=Gr.upperWidth,Yr=Gr.lowerWidth,hn=Gr.height,Qr=Gr.x,pn=Gr.y;return React$W.createElement(Animate,{canBegin:Jt>0,from:"0px ".concat(Jt===-1?1:Jt,"px"),to:"".concat(Jt,"px 0px"),attributeName:"strokeDasharray",begin:Hr,duration:Fr,easing:qr},React$W.createElement("path",_extends$1({},filterProps(Wt,!0),{className:Wr,d:getTrapezoidPath(Qr,pn,Kr,Yr,hn),ref:Gt})))}):React$W.createElement("g",null,React$W.createElement("path",_extends$1({},filterProps(Wt,!0),{className:Wr,d:getTrapezoidPath(Qt,ur,cr,$r,Ar)})))};Trapezoid.defaultProps={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"};function _slicedToArray(Bt,Wt){return _arrayWithHoles(Bt)||_iterableToArrayLimit(Bt,Wt)||_unsupportedIterableToArray(Bt,Wt)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
901
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(Bt,Wt){if(Bt){if(typeof Bt=="string")return _arrayLikeToArray(Bt,Wt);var Gt=Object.prototype.toString.call(Bt).slice(8,-1);if(Gt==="Object"&&Bt.constructor&&(Gt=Bt.constructor.name),Gt==="Map"||Gt==="Set")return Array.from(Bt);if(Gt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Gt))return _arrayLikeToArray(Bt,Wt)}}function _arrayLikeToArray(Bt,Wt){(Wt==null||Wt>Bt.length)&&(Wt=Bt.length);for(var Gt=0,Yt=new Array(Wt);Gt<Wt;Gt++)Yt[Gt]=Bt[Gt];return Yt}function _iterableToArrayLimit(Bt,Wt){var Gt=Bt==null?null:typeof Symbol<"u"&&Bt[Symbol.iterator]||Bt["@@iterator"];if(Gt!=null){var Yt,Xt,Jt,Zt,Qt=[],ur=!0,cr=!1;try{if(Jt=(Gt=Gt.call(Bt)).next,Wt===0){if(Object(Gt)!==Gt)return;ur=!1}else for(;!(ur=(Yt=Jt.call(Gt)).done)&&(Qt.push(Yt.value),Qt.length!==Wt);ur=!0);}catch($r){cr=!0,Xt=$r}finally{try{if(!ur&&Gt.return!=null&&(Zt=Gt.return(),Object(Zt)!==Zt))return}finally{if(cr)throw Xt}}return Qt}}function _arrayWithHoles(Bt){if(Array.isArray(Bt))return Bt}function _typeof(Bt){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Wt){return typeof Wt}:function(Wt){return Wt&&typeof Symbol=="function"&&Wt.constructor===Symbol&&Wt!==Symbol.prototype?"symbol":typeof Wt},_typeof(Bt)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt];for(var Yt in Gt)Object.prototype.hasOwnProperty.call(Gt,Yt)&&(Bt[Yt]=Gt[Yt])}return Bt},_extends.apply(this,arguments)}function ownKeys$1(Bt,Wt){var Gt=Object.keys(Bt);if(Object.getOwnPropertySymbols){var Yt=Object.getOwnPropertySymbols(Bt);Wt&&(Yt=Yt.filter(function(Xt){return Object.getOwnPropertyDescriptor(Bt,Xt).enumerable})),Gt.push.apply(Gt,Yt)}return Gt}function _objectSpread(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt]!=null?arguments[Wt]:{};Wt%2?ownKeys$1(Object(Gt),!0).forEach(function(Yt){_defineProperty$1(Bt,Yt,Gt[Yt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Bt,Object.getOwnPropertyDescriptors(Gt)):ownKeys$1(Object(Gt)).forEach(function(Yt){Object.defineProperty(Bt,Yt,Object.getOwnPropertyDescriptor(Gt,Yt))})}return Bt}function _classCallCheck(Bt,Wt){if(!(Bt instanceof Wt))throw new TypeError("Cannot call a class as a function")}function _defineProperties(Bt,Wt){for(var Gt=0;Gt<Wt.length;Gt++){var Yt=Wt[Gt];Yt.enumerable=Yt.enumerable||!1,Yt.configurable=!0,"value"in Yt&&(Yt.writable=!0),Object.defineProperty(Bt,_toPropertyKey(Yt.key),Yt)}}function _createClass(Bt,Wt,Gt){return Wt&&_defineProperties(Bt.prototype,Wt),Gt&&_defineProperties(Bt,Gt),Object.defineProperty(Bt,"prototype",{writable:!1}),Bt}function _inherits(Bt,Wt){if(typeof Wt!="function"&&Wt!==null)throw new TypeError("Super expression must either be null or a function");Bt.prototype=Object.create(Wt&&Wt.prototype,{constructor:{value:Bt,writable:!0,configurable:!0}}),Object.defineProperty(Bt,"prototype",{writable:!1}),Wt&&_setPrototypeOf(Bt,Wt)}function _setPrototypeOf(Bt,Wt){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Yt,Xt){return Yt.__proto__=Xt,Yt},_setPrototypeOf(Bt,Wt)}function _createSuper(Bt){var Wt=_isNativeReflectConstruct();return function(){var Yt=_getPrototypeOf(Bt),Xt;if(Wt){var Jt=_getPrototypeOf(this).constructor;Xt=Reflect.construct(Yt,arguments,Jt)}else Xt=Yt.apply(this,arguments);return _possibleConstructorReturn(this,Xt)}}function _possibleConstructorReturn(Bt,Wt){if(Wt&&(_typeof(Wt)==="object"||typeof Wt=="function"))return Wt;if(Wt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(Bt)}function _assertThisInitialized(Bt){if(Bt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(Bt){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Gt){return Gt.__proto__||Object.getPrototypeOf(Gt)},_getPrototypeOf(Bt)}function _defineProperty$1(Bt,Wt,Gt){return Wt=_toPropertyKey(Wt),Wt in Bt?Object.defineProperty(Bt,Wt,{value:Gt,enumerable:!0,configurable:!0,writable:!0}):Bt[Wt]=Gt,Bt}function _toPropertyKey(Bt){var Wt=_toPrimitive(Bt,"string");return _typeof(Wt)==="symbol"?Wt:String(Wt)}function _toPrimitive(Bt,Wt){if(_typeof(Bt)!=="object"||Bt===null)return Bt;var Gt=Bt[Symbol.toPrimitive];if(Gt!==void 0){var Yt=Gt.call(Bt,Wt||"default");if(_typeof(Yt)!=="object")return Yt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Wt==="string"?String:Number)(Bt)}var Funnel=function(Bt){_inherits(Gt,Bt);var Wt=_createSuper(Gt);function Gt(){var Yt;_classCallCheck(this,Gt);for(var Xt=arguments.length,Jt=new Array(Xt),Zt=0;Zt<Xt;Zt++)Jt[Zt]=arguments[Zt];return Yt=Wt.call.apply(Wt,[this].concat(Jt)),_defineProperty$1(_assertThisInitialized(Yt),"state",{isAnimationFinished:!1}),_defineProperty$1(_assertThisInitialized(Yt),"handleAnimationEnd",function(){var Qt=Yt.props.onAnimationEnd;Yt.setState({isAnimationFinished:!0}),_isFunction(Qt)&&Qt()}),_defineProperty$1(_assertThisInitialized(Yt),"handleAnimationStart",function(){var Qt=Yt.props.onAnimationStart;Yt.setState({isAnimationFinished:!1}),_isFunction(Qt)&&Qt()}),Yt}return _createClass(Gt,[{key:"isActiveIndex",value:function(Xt){var Jt=this.props.activeIndex;return Array.isArray(Jt)?Jt.indexOf(Xt)!==-1:Xt===Jt}},{key:"renderTrapezoidsStatically",value:function(Xt){var Jt=this,Zt=this.props.activeShape;return Xt.map(function(Qt,ur){var cr=Jt.isActiveIndex(ur)?Zt:null,$r=_objectSpread(_objectSpread({},Qt),{},{stroke:Qt.stroke});return React$W.createElement(Layer,_extends({className:"recharts-funnel-trapezoid"},adaptEventsOfChild(Jt.props,Qt,ur),{key:"trapezoid-".concat(ur),role:"img"}),Gt.renderTrapezoidItem(cr,$r))})}},{key:"renderTrapezoidsWithAnimation",value:function(){var Xt=this,Jt=this.props,Zt=Jt.trapezoids,Qt=Jt.isAnimationActive,ur=Jt.animationBegin,cr=Jt.animationDuration,$r=Jt.animationEasing,Ar=Jt.animationId,Lr=this.state.prevTrapezoids;return React$W.createElement(Animate,{begin:ur,duration:cr,isActive:Qt,easing:$r,from:{t:0},to:{t:1},key:"funnel-".concat(Ar),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(qr){var Fr=qr.t,Hr=Zt.map(function(Br,Wr){var Gr=Lr&&Lr[Wr];if(Gr){var Kr=interpolateNumber$2(Gr.x,Br.x),Yr=interpolateNumber$2(Gr.y,Br.y),hn=interpolateNumber$2(Gr.upperWidth,Br.upperWidth),Qr=interpolateNumber$2(Gr.lowerWidth,Br.lowerWidth),pn=interpolateNumber$2(Gr.height,Br.height);return _objectSpread(_objectSpread({},Br),{},{x:Kr(Fr),y:Yr(Fr),upperWidth:hn(Fr),lowerWidth:Qr(Fr),height:pn(Fr)})}var En=interpolateNumber$2(Br.x+Br.upperWidth/2,Br.x),ga=interpolateNumber$2(Br.y+Br.height/2,Br.y),dn=interpolateNumber$2(0,Br.upperWidth),Pr=interpolateNumber$2(0,Br.lowerWidth),xr=interpolateNumber$2(0,Br.height);return _objectSpread(_objectSpread({},Br),{},{x:En(Fr),y:ga(Fr),upperWidth:dn(Fr),lowerWidth:Pr(Fr),height:xr(Fr)})});return React$W.createElement(Layer,null,Xt.renderTrapezoidsStatically(Hr))})}},{key:"renderTrapezoids",value:function(){var Xt=this.props,Jt=Xt.trapezoids,Zt=Xt.isAnimationActive,Qt=this.state.prevTrapezoids;return Zt&&Jt&&Jt.length&&(!Qt||!_isEqual(Qt,Jt))?this.renderTrapezoidsWithAnimation():this.renderTrapezoidsStatically(Jt)}},{key:"render",value:function(){var Xt=this.props,Jt=Xt.hide,Zt=Xt.trapezoids,Qt=Xt.className,ur=Xt.isAnimationActive,cr=this.state.isAnimationFinished;if(Jt||!Zt||!Zt.length)return null;var $r=classNames("recharts-trapezoids",Qt);return React$W.createElement(Layer,{className:$r},this.renderTrapezoids(),(!ur||cr)&&LabelList.renderCallByParent(this.props,Zt))}}],[{key:"getDerivedStateFromProps",value:function(Xt,Jt){return Xt.animationId!==Jt.prevAnimationId?{prevAnimationId:Xt.animationId,curTrapezoids:Xt.trapezoids,prevTrapezoids:Jt.curTrapezoids}:Xt.trapezoids!==Jt.curTrapezoids?{curTrapezoids:Xt.trapezoids}:null}},{key:"renderTrapezoidItem",value:function(Xt,Jt){return React$W.isValidElement(Xt)?React$W.cloneElement(Xt,Jt):_isFunction(Xt)?Xt(Jt):_isPlainObject(Xt)?React$W.createElement(Trapezoid,_extends({},Jt,Xt)):React$W.createElement(Trapezoid,Jt)}}]),Gt}(reactExports.PureComponent);_defineProperty$1(Funnel,"displayName","Funnel");_defineProperty$1(Funnel,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",labelLine:!0,hide:!1,isAnimationActive:!Global.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",lastShapeType:"triangle"});_defineProperty$1(Funnel,"getRealFunnelData",function(Bt){var Wt=Bt.props,Gt=Wt.data,Yt=Wt.children,Xt=filterProps(Bt.props),Jt=findAllByType(Yt,Cell);return Gt&&Gt.length?Gt.map(function(Zt,Qt){return _objectSpread(_objectSpread(_objectSpread({payload:Zt},Xt),Zt),Jt&&Jt[Qt]&&Jt[Qt].props)}):Jt&&Jt.length?Jt.map(function(Zt){return _objectSpread(_objectSpread({},Xt),Zt.props)}):[]});_defineProperty$1(Funnel,"getRealWidthHeight",function(Bt,Wt){var Gt=Bt.props.width,Yt=Wt.width,Xt=Wt.height,Jt=Wt.left,Zt=Wt.right,Qt=Wt.top,ur=Wt.bottom,cr=Xt,$r=Yt;return _isNumber(Gt)?$r=Gt:_isString(Gt)&&($r=$r*parseFloat(Gt)/100),{realWidth:$r-Jt-Zt-50,realHeight:cr-ur-Qt,offsetX:(Yt-$r)/2,offsetY:(Xt-cr)/2}});_defineProperty$1(Funnel,"getComposedData",function(Bt){var Wt=Bt.item,Gt=Bt.offset,Yt=Funnel.getRealFunnelData(Wt),Xt=Wt.props,Jt=Xt.dataKey,Zt=Xt.nameKey,Qt=Xt.tooltipType,ur=Xt.lastShapeType,cr=Xt.reversed,$r=Gt.left,Ar=Gt.top,Lr=Funnel.getRealWidthHeight(Wt,Gt),qr=Lr.realHeight,Fr=Lr.realWidth,Hr=Lr.offsetX,Br=Lr.offsetY,Wr=Math.max.apply(null,Yt.map(function(Qr){return getValueByDataKey(Qr,Jt,0)})),Gr=Yt.length,Kr=qr/Gr,Yr={x:Gt.left,y:Gt.top,width:Gt.width,height:Gt.height},hn=Yt.map(function(Qr,pn){var En=getValueByDataKey(Qr,Jt,0),ga=getValueByDataKey(Qr,Zt,pn),dn=En,Pr;if(pn!==Gr-1){if(Pr=getValueByDataKey(Yt[pn+1],Jt,0),Pr instanceof Array){var xr=Pr,Mr=_slicedToArray(xr,1);Pr=Mr[0]}}else if(En instanceof Array&&En.length===2){var Nr=_slicedToArray(En,2);dn=Nr[0],Pr=Nr[1]}else ur==="rectangle"?Pr=dn:Pr=0;var Ur=(Wr-dn)*Fr/(2*Wr)+Ar+25+Hr,Vr=Kr*pn+$r+Br,Zr=dn/Wr*Fr,Xr=Pr/Wr*Fr,Or=[{name:ga,value:dn,payload:Qr,dataKey:Jt,type:Qt}],jr={x:Ur+Zr/2,y:Vr+Kr/2};return _objectSpread(_objectSpread({x:Ur,y:Vr,width:Math.max(Zr,Xr),upperWidth:Zr,lowerWidth:Xr,height:Kr,name:ga,val:dn,tooltipPayload:Or,tooltipPosition:jr},_omit(Qr,"width")),{},{payload:Qr,parentViewBox:Yr,labelViewBox:{x:Ur+(Zr-Xr)/4,y:Vr,width:Math.abs(Zr-Xr)/2+Math.min(Zr,Xr),height:Kr}})});return cr&&(hn=hn.map(function(Qr,pn){var En=Qr.y-pn*Kr+(Gr-1-pn)*Kr;return _objectSpread(_objectSpread({},Qr),{},{upperWidth:Qr.lowerWidth,lowerWidth:Qr.upperWidth,x:Qr.x-(Qr.lowerWidth-Qr.upperWidth)/2,y:Qr.y-pn*Kr+(Gr-1-pn)*Kr,tooltipPosition:_objectSpread(_objectSpread({},Qr.tooltipPosition),{},{y:En+Kr/2}),labelViewBox:_objectSpread(_objectSpread({},Qr.labelViewBox),{},{y:En})})})),{trapezoids:hn,data:Yt}});var FunnelChart=generateCategoricalChart({chartName:"FunnelChart",GraphicalChild:Funnel,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",axisComponents:[],defaultProps:{layout:"centric"}});const es6=Object.freeze(Object.defineProperty({__proto__:null,Area,AreaChart,Bar,BarChart:BarChart$2,Brush,CartesianAxis,CartesianGrid,Cell,ComposedChart,Cross,Curve,Customized,DefaultLegendContent,DefaultTooltipContent,Dot,ErrorBar,Funnel,FunnelChart,Global,Label,LabelList,Layer,Legend,Line,LineChart,Pie,PieChart,PolarAngleAxis,PolarGrid,PolarRadiusAxis,Polygon,Radar,RadarChart,RadialBar,RadialBarChart,Rectangle,ReferenceArea,ReferenceDot,ReferenceLine,ResponsiveContainer,Sankey,Scatter,ScatterChart,Sector,Surface,Symbols,Text,Tooltip,Trapezoid,Treemap,XAxis,YAxis,ZAxis},Symbol.toStringTag,{value:"Module"})),require$$2$1=getAugmentedNamespace(es6);var utils$j={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__spreadArray||function(Hr,Br,Wr){if(Wr||arguments.length===2)for(var Gr=0,Kr=Br.length,Yr;Gr<Kr;Gr++)(Yr||!(Gr in Br))&&(Yr||(Yr=Array.prototype.slice.call(Br,0,Gr)),Yr[Gr]=Br[Gr]);return Hr.concat(Yr||Array.prototype.slice.call(Br))};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getDatasetBounds=Bt.getFlooredFixed=Bt.formatValueToLocale=Bt.isValuesInCurrentRange=Bt.getBarChartRanges=Bt.createExponentialRange=Bt.fixedNumber=Bt.roundNumber=Bt.inverseScale=Bt.roundRange=Bt.formatAndRoundNumberString=Bt.numberFormatter=Bt.CHART_LOG_SCALE=Bt.NON_ACTIVE_BAR_COLOR=Bt.ACTIVE_BAR_COLOR=Bt.LOADING_BAR_COLOR=Bt.HOVERED_BAR_COLOR=void 0,Bt.HOVERED_BAR_COLOR="pink",Bt.LOADING_BAR_COLOR="grey",Bt.ACTIVE_BAR_COLOR="#ff2d55",Bt.NON_ACTIVE_BAR_COLOR="#4f1414",Bt.CHART_LOG_SCALE=5;var Gt=24;Bt.numberFormatter=Intl.NumberFormat("en",{notation:"compact"});var Yt=function(Hr){return Bt.numberFormatter.format(Number(Hr))};Bt.formatAndRoundNumberString=Yt;var Xt=function(Hr){return[(0,Bt.roundNumber)(Hr[0]).toString(),(0,Bt.roundNumber)(Hr[1]).toString()]};Bt.roundRange=Xt;var Jt=function(Hr){return(0,Bt.roundNumber)(Number(Hr))},Zt=function(Hr){return Hr!==0?Math.log(Hr)/Math.log(Bt.CHART_LOG_SCALE):0};Bt.inverseScale=Zt;var Qt=function(Hr,Br){Br===void 0&&(Br=2);var Wr=1;return Hr<10?Number(Hr.toFixed(Br)):(Hr>100&&(Wr=100),Hr>1e3&&(Wr=1e3),Math.round(Hr/Wr)*Wr)};Bt.roundNumber=Qt;var ur=function(Hr,Br){var Wr=new RegExp("^([0-9]+((.|,)?([0-9]?){".concat(Br,"})?)"),"g"),Gr=Hr.match(Wr);return Gr?Gr[0]:""};Bt.fixedNumber=ur;var cr=function(Hr,Br,Wr,Gr){for(var Kr=(0,Bt.inverseScale)(Hr),Yr=(0,Bt.inverseScale)(Br),hn=(Yr-Kr)/Gt,Qr=[],pn=0;pn<Gt;pn++){var En=Qr[pn-1];Qr.push(En!==void 0?En+hn:Kr)}return Wt(Wt([],Qr.map(function(ga){return ga!==0?(0,Bt.roundNumber)(Math.pow(Bt.CHART_LOG_SCALE,ga),Gr):ga}),!0),Wr&&Br>Wr?[Wr]:[],!0)};Bt.createExponentialRange=cr;var $r=function(Hr,Br,Wr,Gr,Kr){var Yr=(0,Bt.createExponentialRange)(Br,Wr,Gr,Kr),hn=Yr.reduce(function(xr,Mr){return xr.set(Mr,0),xr},new Map);try{Object.entries(Hr).forEach(function(xr){var Mr=xr[0],Nr=xr[1],Ur=Jt(Mr),Vr=Yr.findIndex(function(Or){return Ur<=Or}),Zr=Yr[Vr>0?Vr-1:Vr];Zr===void 0&&(Zr=Yr[Yr.length-1]);var Xr=hn.get(Zr)||0;hn.set(Zr,Xr+Nr)});for(var Qr=[],pn=hn.entries(),En=pn.next().value;En;){var ga=En[0],dn=En[1],Pr=pn.next().value;Qr.push({values:[Number(ga),Number(Pr?Pr[0]:ga)],amount:dn}),En=Pr}return Qr}catch{throw Error("Error generating bar chart")}};Bt.getBarChartRanges=$r;var Ar=function(Hr,Br,Wr){return(Hr[0]>=Br||Hr[1]>Br)&&(Hr[0]<Wr||Hr[1]<=Wr)};Bt.isValuesInCurrentRange=Ar;var Lr=function(Hr){var Br=Number(Hr[0]).toLocaleString(),Wr=Number(Hr[1]).toLocaleString();return[Br,Wr]};Bt.formatValueToLocale=Lr;var qr=function(Hr,Br){return(Math.floor(Hr*Math.pow(10,Br))/Math.pow(10,Br)).toFixed(Br)};Bt.getFlooredFixed=qr;var Fr=function(Hr){var Br=Object.keys(Hr).map(function(Wr){return Number(Wr)});return{min:Math.min.apply(Math,Br),max:Math.max.apply(Math,Br)}};Bt.getDatasetBounds=Fr})(utils$j);var BarChartTooltip$1={};const BarChart$1="";var __createBinding$7=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$7=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$7=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$7(Wt,Bt,Gt);return __setModuleDefault$7(Wt,Bt),Wt};Object.defineProperty(BarChartTooltip$1,"__esModule",{value:!0});BarChartTooltip$1.BarChartTooltip=void 0;var React$1=__importStar$7(reactExports),Mana_1$1=Mana$2,utils_1$9=utils$j,BarChartTooltip=function(Bt){var Wt=Bt.active,Gt=Bt.payload,Yt=Bt.network,Xt=Bt.isMana;if(Wt&&Gt&&Gt.length&&Gt[0].payload.amount){var Jt=Gt[0].payload.values,Zt=Jt[0]===Jt[1],Qt=(0,utils_1$9.formatAndRoundNumberString)(Jt[0].toString()),ur=React$1.createElement("span",null,Zt?"".concat(Qt,"+"):Qt),cr=React$1.createElement("span",null,(0,utils_1$9.formatAndRoundNumberString)(Jt[1].toString()));return React$1.createElement("div",{className:"custom-tooltip"},Xt?React$1.createElement(Mana_1$1.Mana,{network:Yt},ur):ur,Zt?null:React$1.createElement(React$1.Fragment,null,React$1.createElement("span",{className:"custom-tooltip-separator"},"-"),Xt?React$1.createElement(Mana_1$1.Mana,{network:Yt},cr):cr))}return null};BarChartTooltip$1.BarChartTooltip=BarChartTooltip;var __createBinding$6=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$6=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$6=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$6(Wt,Bt,Gt);return __setModuleDefault$6(Wt,Bt),Wt},__importDefault$a=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(BarChart$3,"__esModule",{value:!0});BarChart$3.BarChart=void 0;var React=__importStar$6(reactExports),react_1$2=reactExports,classnames_1$1=__importDefault$a(classnamesExports),recharts_1=require$$2$1,network_1=network$3,RangeField_1=RangeField$3,SliderField_1=SliderField$1,Mana_1=Mana$2,Loader_1$1=Loader$5,utils_1$8=utils$j,BarChartTooltip_1=BarChartTooltip$1,DEFAULT_SLIDER_STEP=.1,BarChart=function(Bt){var Wt=Bt.height,Gt=Wt===void 0?150:Wt,Yt=Bt.width,Xt=Yt===void 0?"100%":Yt,Jt=Bt.data,Zt=Bt.upperBound,Qt=Bt.loading,ur=Bt.onChange,cr=Bt.min,$r=Bt.max,Ar=Bt.minLabel,Lr=Bt.maxLabel,qr=Bt.isMana,Fr=qr===void 0?!1:qr,Hr=Bt.network,Br=Hr===void 0?network_1.Network.ETHEREUM:Hr,Wr=Bt.sliderStep,Gr=Wr===void 0?DEFAULT_SLIDER_STEP:Wr,Kr=Bt.errorMessage,Yr=Bt.rangeDecimals,hn=Yr===void 0?2:Yr,Qr=Bt.id,pn=Qr===void 0?"bar-chart":Qr,En=(0,react_1$2.useState)([cr,$r]),ga=En[0],dn=En[1],Pr=(0,react_1$2.useState)(),xr=Pr[0],Mr=Pr[1],Nr=(0,react_1$2.useState)(),Ur=Nr[0],Vr=Nr[1],Zr=(0,react_1$2.useState)(),Xr=Zr[0],Or=Zr[1],jr=(0,react_1$2.useState)(),Jr=jr[0],mn=jr[1],gn=(0,react_1$2.useRef)(null);(0,react_1$2.useEffect)(function(){return dn([cr,$r])},[cr,$r]),(0,react_1$2.useEffect)(function(){return function(){gn.current&&clearTimeout(gn.current)}},[]),(0,react_1$2.useEffect)(function(){if(Jt)try{var Bo=Object.keys(Jt).map(function(Do){return Number(Do)}),Mo=Math.max.apply(Math,Bo),bo=Zt&&Zt<Mo?Zt:Mo,yo=Math.min.apply(Math,Bo);Or(bo),mn(yo),Mr((0,utils_1$8.getBarChartRanges)(Jt,yo,bo,Zt,hn))}catch(Do){console.error("error: ",Do)}},[Jt,Zt]);var eo=(0,react_1$2.useMemo)(function(){return Xr!==void 0?(0,utils_1$8.inverseScale)(Xr):void 0},[Xr]),_i=(0,react_1$2.useMemo)(function(){return Jr!==void 0?(0,utils_1$8.inverseScale)(Jr):void 0},[Jr]),ro=(0,react_1$2.useMemo)(function(){var Bo=ga[0]?(0,utils_1$8.inverseScale)(Number(ga[0])):Number(_i);return Bo<_i?_i:Bo>eo?eo:Bo},[_i,ga,eo]),io=(0,react_1$2.useMemo)(function(){var Bo=ga[1]?(0,utils_1$8.inverseScale)(Number(ga[1])):Number(eo);return Bo>eo?eo:Bo<ro?ro:Bo},[eo,ga,_i,ro]),ao=(0,react_1$2.useMemo)(function(){return ga[0]&&ga[1]&&Number(ga[1])<=Number(ga[0])},[ga]),oo=(0,react_1$2.useMemo)(function(){var Bo=ga[0]?Number(ga[0]):Jr||"";return utils_1$8.numberFormatter.format(Number(Bo))},[Jr,ga]),to=(0,react_1$2.useMemo)(function(){if(Jt){var Bo=(0,utils_1$8.getDatasetBounds)(Jt).max,Mo=Number(ga[1]||Xr),bo=Mo===Xr;return"".concat(utils_1$8.numberFormatter.format(Number(Mo))).concat(bo&&Zt&&Zt<Bo?"+":"")}},[Jt,Xr,Zt,ga]),so=(0,react_1$2.useCallback)(function(Bo,Mo,bo){var yo=(0,utils_1$8.fixedNumber)(Bo[0],hn),Do=(0,utils_1$8.fixedNumber)(Bo[1],hn);dn([yo,Do]),gn.current&&clearTimeout(gn.current),gn.current=setTimeout(function(){return ur([yo,Do],bo||"input")},500)},[dn,ur]),lo=(0,react_1$2.useCallback)(function(Bo,Mo){var bo=Mo[0],yo=Mo[1];if(Xr!==void 0&&Jr!==void 0&&eo){var Do=eo-yo,Tu=(0,utils_1$8.getFlooredFixed)(yo,1)===(0,utils_1$8.getFlooredFixed)(Number(eo),1)||Do<=Gr,wu=Math.pow(utils_1$8.CHART_LOG_SCALE,bo),$o=Tu?Xr:Math.pow(utils_1$8.CHART_LOG_SCALE,yo),mo=[(0,utils_1$8.roundNumber)(wu,hn).toString(),(0,utils_1$8.roundNumber)($o,hn).toString()];dn(mo),so(mo,null,"slider")}},[so,eo,Xr,Jr,Gr]),Ro=(0,react_1$2.useCallback)(function(Bo){Vr(Bo.activeTooltipIndex)},[]),Io=(0,react_1$2.useCallback)(function(){Vr(void 0)},[]),Fo=(0,react_1$2.useCallback)(function(Bo){var Mo=Bo.activePayload,bo=Mo[0].payload.values,yo=bo[0]===bo[1];so(yo?[bo[0].toString(),""]:(0,utils_1$8.roundRange)(Mo[0].payload.values),null,"chart")},[so]),xo=(0,react_1$2.useCallback)(function(Bo,Mo){var bo=(0,utils_1$8.isValuesInCurrentRange)(Bo.values,Number(ga[0]||Jr),Number(ga[1]||Xr));return React.createElement(recharts_1.Cell,{key:"cell-".concat(Mo),fill:Ur===Mo?utils_1$8.HOVERED_BAR_COLOR:Qt?utils_1$8.LOADING_BAR_COLOR:bo?utils_1$8.ACTIVE_BAR_COLOR:utils_1$8.NON_ACTIVE_BAR_COLOR})},[Ur,Qt,Xr,Jr,ga]),ho=(0,react_1$2.useCallback)(function(Bo){Bo.target.blur(),Bo.stopPropagation(),gn.current=setTimeout(function(){Bo.target.focus()},0)},[]),po=(0,react_1$2.useCallback)(function(){if(Number.parseFloat(ga[0])>Number.parseFloat(ga[1])){var Bo=[ga[1],ga[0]];dn(Bo),ur(Bo,"input")}},[ur,dn,ga]);function Ao(Bo){return Fr?React.createElement(Mana_1.Mana,{network:Br,className:"slider-label"},Bo):React.createElement("span",{className:"slider-label"},Bo)}return React.createElement("div",{className:"bar-chart"},React.createElement(RangeField_1.RangeField,{minLabel:Ar,maxLabel:Lr,id:"".concat(pn,"-range-field"),minProps:{icon:Fr?React.createElement(Mana_1.Mana,{network:Br}):null,iconPosition:"left",placeholder:0,onWheel:ho},maxProps:{icon:Fr?React.createElement(Mana_1.Mana,{network:Br}):null,iconPosition:"left",placeholder:1e3,onWheel:ho},onChange:so,onBlur:po,value:ga}),Qt?React.createElement("div",{className:(0,classnames_1$1.default)("loader-container",!Jt&&"no-data-loading-layer")},React.createElement("div",{className:"loading-layer"}),React.createElement(Loader_1$1.Loader,{active:!0})):null,!!Jt&&!!xr&&!!eo&&React.createElement(React.Fragment,null,React.createElement(recharts_1.ResponsiveContainer,{width:Xt,height:Gt},React.createElement(recharts_1.BarChart,{data:xr,margin:{top:20,right:12,left:12},onMouseMove:Ro,onMouseLeave:Io,onClick:Fo},React.createElement(recharts_1.Tooltip,{cursor:!1,content:React.createElement(BarChartTooltip_1.BarChartTooltip,{network:Br,isMana:Fr}),position:{y:25}}),React.createElement(recharts_1.Bar,{dataKey:"amount",barSize:8},xr==null?void 0:xr.map(xo)))),React.createElement(SliderField_1.SliderField,{header:"",range:!0,valueFrom:ro,valueTo:io,min:_i,max:eo,step:Gr,onChange:lo,labelFrom:Ao(oo),labelTo:Ao(to)}),Kr&&ao?React.createElement("span",{className:"bar-chart-error"},Kr):null))};BarChart$3.BarChart=BarChart;var MultiStep$3={};const MultiStep$2="";var __importDefault$9=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(MultiStep$3,"__esModule",{value:!0});MultiStep$3.MultiStep=void 0;var react_1$1=__importDefault$9(reactExports),classnames_1=__importDefault$9(classnamesExports),Icon_1=__importDefault$9(requireIcon()),Button_1$1=Button$3,Loader_1=Loader$5;function MultiStep$1(Bt){var Wt=Bt.steps,Gt=Bt.currentStep;return react_1$1.default.createElement("div",{className:"ui-multi-step","data-testid":"multi-step"},Wt.map(function(Yt,Xt){var Jt=Yt.action&&Gt<=Xt&&!Yt.isLoading,Zt=Xt>Gt;return react_1$1.default.createElement("div",{key:"step-".concat(Xt),"data-testid":Yt.testId||"step-".concat(Xt),className:(0,classnames_1.default)("step-container",{disabled:Zt})},react_1$1.default.createElement("div",null,react_1$1.default.createElement("span",{className:"step-position"},Xt+1)),react_1$1.default.createElement("div",{className:"step-info"},react_1$1.default.createElement("p",{className:"step-title"},Yt.title),Yt.description?react_1$1.default.createElement("p",{className:"step-description"},Yt.description):null,Jt?react_1$1.default.createElement("div",{className:"step-action-container"},react_1$1.default.createElement(Button_1$1.Button,{primary:!0,onClick:Yt.onActionClick,className:"step-action",disabled:Zt},Yt.action),Yt.message?react_1$1.default.createElement("span",null,Yt.message):null):react_1$1.default.createElement("div",{className:"step-message"},Yt.isLoading?react_1$1.default.createElement(Loader_1.Loader,{size:"small",active:!0,"data-testid":"step-loader"}):react_1$1.default.createElement(Icon_1.default,{className:"check-icon",name:"check"}),Yt.message?react_1$1.default.createElement("span",null,Yt.message):null)))}))}MultiStep$3.MultiStep=MultiStep$1;var AuthorizationModal$3={},AuthorizationModal$2={},MultiStep={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(MultiStep$3,Bt)})(MultiStep);const AuthorizationModal$1="";var __importDefault$8=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(AuthorizationModal$2,"__esModule",{value:!0});AuthorizationModal$2.AuthorizationModal=void 0;var react_1=__importDefault$8(reactExports),Button_1=Button$3,Modal_1=Modal$9,MultiStep_1=MultiStep;function AuthorizationModal(Bt){var Wt=Bt.currentStep,Gt=Bt.header,Yt=Bt.steps,Xt=Bt.onClose;return react_1.default.createElement(Modal_1.Modal,{open:!0,onClose:Xt,"data-testid":"authorization-modal",className:"authorization-modal-container"},react_1.default.createElement("div",{className:"authorization-modal"},react_1.default.createElement(Button_1.Button,{basic:!0,"aria-label":"Close",className:"close-button",onClick:Xt}),react_1.default.createElement("h1",{className:"authorization-header"},Gt),react_1.default.createElement(MultiStep_1.MultiStep,{currentStep:Wt,steps:Yt})))}AuthorizationModal$2.AuthorizationModal=AuthorizationModal;var AuthorizationModal_types$1={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationStepAction=Bt.AuthorizationStepStatus=void 0,function(Wt){Wt.LOADING_INFO="loading_info",Wt.PENDING="pending",Wt.WAITING="waiting",Wt.PROCESSING="processing",Wt.ALLOWANCE_AMOUNT_ERROR="allowance_amount_error",Wt.ERROR="error",Wt.DONE="done"}(Bt.AuthorizationStepStatus||(Bt.AuthorizationStepStatus={})),function(Wt){Wt.REVOKE="revoke",Wt.GRANT="grant",Wt.CONFIRM="confirm"}(Bt.AuthorizationStepAction||(Bt.AuthorizationStepAction={}))})(AuthorizationModal_types$1);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(AuthorizationModal$2,Bt),Gt(AuthorizationModal_types$1,Bt)})(AuthorizationModal$3);const require$$73=getAugmentedNamespace(es$2);var colors={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Color=void 0,function(Wt){Wt.NEON_BLUE="#00D3FF",Wt.SUMMER_RED="#FF2D55",Wt.VOID="#16141A",Wt.LUISXVI_VIOLET="#A524B3",Wt.IDONTFEELTHATWELL="#F3F2F5",Wt.SHADOWS="#242129",Wt.NIGHT_TIME="#691FA9",Wt.BLUISH_STEEL="#676370",Wt.INNOCENCE="#FFFFFF",Wt.CANDY_PURPLE="#C640CD",Wt.SUNISH="#FFBC5B",Wt.MILLENIAL_ORANGE="#FC9965",Wt.OJ_NOT_SIMPSON="#FF7439",Wt.DARK="#18141A"}(Bt.Color||(Bt.Color={}))})(colors);var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(Address$2,Bt),Gt(Atlas$2,Bt),Gt(AvatarFace$2,Bt),Gt(Back$2,Bt),Gt(Badge$2,Bt),Gt(Blockie$2,Bt),Gt(BuyManaWithFiatModal$3,Bt),Gt(Center$2,Bt),Gt(Close$2,Bt),Gt(Column$2,Bt),Gt(EmoteIcon$2,Bt),Gt(Empty$2,Bt),Gt(Filter$2,Bt),Gt(Footer$4,Bt),Gt(HeaderMenu$1,Bt),Gt(Hero$2,Bt),Gt(LanguageIcon$2,Bt),Gt(LanguageDropdown$2,Bt),Gt(LoginModal$2,Bt),Gt(Logo$2,Bt),Gt(Field$2,Bt),Gt(Mana$2,Bt),Gt(Message$3,Bt),Gt(ModalNavigation$2,Bt),Gt(Narrow$2,Bt),Gt(Navbar$5,Bt),Gt(Page$2,Bt),Gt(Parallax$1,Bt),Gt(Profile$4,Bt),Gt(Row$2,Bt),Gt(Section$2,Bt),Gt(SignIn$2,Bt),Gt(SmartIcon$2,Bt),Gt(StarWalletIcon$2,Bt),Gt(Stats$2,Bt),Gt(Tabs$2,Bt),Gt(TagField$2,Bt),Gt(TextAreaField$2,Bt),Gt(Toast$1,Bt),Gt(Toasts$2,Bt),Gt(UserMenu$4,Bt),Gt(WalletIcon$2,Bt),Gt(WearableIcon$2,Bt),Gt(requireWearablePreview(),Bt),Gt(SelectField$2,Bt),Gt(TextFilter$3,Bt),Gt(Responsive$2,Bt),Gt(Media$1,Bt),Gt(Box$3,Bt),Gt(RangeField$3,Bt),Gt(SliderField$1,Bt),Gt(BarChart$3,Bt),Gt(MultiStep$3,Bt),Gt(AuthorizationModal$3,Bt),Gt(require$$73,Bt),Gt(colors,Bt)}(dist$c)),dist$c}var AuthorizationModal_types={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationStepAction=Bt.AuthorizationStepStatus=Bt.AuthorizedAction=void 0,function(Wt){Wt.BID="bid",Wt.BUY="buy",Wt.MINT="mint",Wt.RENT="rent",Wt.CLAIM_NAME="claim_name",Wt.SWAP_MANA="swap_mana",Wt.SELL="sell",Wt.PUBLISH_COLLECTION="publish_collection"}(Bt.AuthorizedAction||(Bt.AuthorizedAction={})),function(Wt){Wt.LOADING_INFO="loading_info",Wt.PENDING="pending",Wt.WAITING="waiting",Wt.PROCESSING="processing",Wt.ALLOWANCE_AMOUNT_ERROR="allowance_amount_error",Wt.ERROR="error",Wt.DONE="done"}(Bt.AuthorizationStepStatus||(Bt.AuthorizationStepStatus={})),function(Wt){Wt.REVOKE="revoke",Wt.GRANT="grant",Wt.CONFIRM="confirm"}(Bt.AuthorizationStepAction||(Bt.AuthorizationStepAction={}))})(AuthorizationModal_types);var utils$i={},utils$h={};Object.defineProperty(utils$h,"__esModule",{value:!0});utils$h.getStatus=utils$h.getType=utils$h.removeLast=void 0;function removeLast(Bt,Wt){const Gt=Bt.filter(Wt).pop();return Bt.filter(Yt=>Yt!==Gt)}utils$h.removeLast=removeLast;const ACTION_TYPE_REGEX=/\[(Request|Failure|Success|Clear)\]\s(.+)/,getType=Bt=>{const Wt=ACTION_TYPE_REGEX.exec(Bt.type);return Wt&&Wt.length>2?Wt[2]:""};utils$h.getType=getType;const getStatus=Bt=>{const Wt=ACTION_TYPE_REGEX.exec(Bt.type);return Wt&&Wt.length>2?Wt[1].toUpperCase():""};utils$h.getStatus=getStatus;var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils$i;hasRequiredUtils=1;var Bt=commonjsGlobal&&commonjsGlobal.__importDefault||function(En){return En&&En.__esModule?En:{default:En}};Object.defineProperty(utils$i,"__esModule",{value:!0}),utils$i.getSteps=utils$i.getPriceInMana=utils$i.getStepMessage=utils$i.getStepError=utils$i.getStepStatus=utils$i.getTranslation=utils$i.safeGet=void 0;const Wt=Bt(reactExports),Gt=require$$0$5,Yt=dist$e,Xt=selectors,Jt=types$3,Zt=utils$k,Qt=requireContainers(),ur=selectors$3,cr=utils$h,$r=selectors$1,Ar=utils$l,Lr=utils$W,qr=selectors,Fr=actions$5,Hr=AuthorizationModal_types,Br=150;function Wr(En,ga){const Pr=ga.split(".").reduce((xr,Mr)=>{if(xr!==void 0)return xr[Mr]},En);return typeof Pr!="string"?void 0:Pr}utils$i.safeGet=Wr;function Gr(En,ga,dn){return(0,Lr.t_cond)(Wr(En,ga),`@dapps.authorization_modal.${ga}`,dn)}utils$i.getTranslation=Gr;function Kr(En,ga,dn,Pr){const xr=ga===Jt.AuthorizationAction.REVOKE?Fr.REVOKE_TOKEN_REQUEST:Fr.GRANT_TOKEN_REQUEST;if((0,ur.isLoadingType)((0,Xt.getLoading)(En),xr))return Hr.AuthorizationStepStatus.WAITING;if((0,$r.getTransactions)(En,dn.address).filter(Zr=>(0,Ar.isPending)(Zr.status)&&(0,cr.getType)({type:xr})===(0,cr.getType)({type:Zr.actionType})&&(0,Zt.areEqual)(Zr.payload.authorization,dn)).length)return Hr.AuthorizationStepStatus.PROCESSING;const Nr=(0,Xt.getAuthorizationFlowError)(En);if(Nr===Zt.AuthorizationError.INSUFFICIENT_ALLOWANCE)return Hr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR;if(Nr||(0,Xt.getError)(En))return Hr.AuthorizationStepStatus.ERROR;let Ur=!1;const Vr=(0,qr.getData)(En);return dn.type===Jt.AuthorizationType.ALLOWANCE?Pr?Ur=(0,Zt.hasAuthorizationAndEnoughAllowance)(Vr,dn,Pr.toString()):Ur=!(0,Zt.hasAuthorization)(Vr,dn):Ur=(0,Zt.hasAuthorization)(Vr,dn),Ur?Hr.AuthorizationStepStatus.DONE:(0,ur.isLoadingType)((0,Xt.getLoading)(En),Fr.AUTHORIZATION_FLOW_REQUEST)&&(0,Xt.getLoading)(En).find(Zr=>{var Xr;return((Xr=Zr.payload)===null||Xr===void 0?void 0:Xr.authorizationAction)===ga})?Hr.AuthorizationStepStatus.LOADING_INFO:Hr.AuthorizationStepStatus.PENDING}utils$i.getStepStatus=Kr;function Yr(En,ga,dn){if(En)return ga===Hr.AuthorizationStepAction.REVOKE?Gr(dn,"revoke_cap_error"):En.length>Br?Gr(dn,"generic_error"):En}utils$i.getStepError=Yr;function hn(En,ga,dn,Pr,xr,Mr,Nr){if(En>Pr)return"";if(En<Pr)return Gr(Nr,"done");switch(ga){case Hr.AuthorizationStepStatus.WAITING:return Gr(Nr,"waiting_wallet");case Hr.AuthorizationStepStatus.PROCESSING:return Gr(Nr,"waiting_confirmation");case Hr.AuthorizationStepStatus.ERROR:return Wt.default.createElement("div",{className:"authorization-error"},Yr(dn,Mr,Nr));case Hr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR:return Wt.default.createElement("div",{className:"authorization-error"},Gr(Nr,"spending_cap_error",{price:xr}));case Hr.AuthorizationStepStatus.DONE:return Gr(Nr,"done");default:return}}utils$i.getStepMessage=hn;function Qr(En){if(!En)return"";const ga=Number.parseFloat(Gt.ethers.utils.formatEther(En));return(Math.ceil(ga*100)/100).toString().replace(/\.0+$/,"")}utils$i.getPriceInMana=Qr;function pn({authorization:En,authorizationType:ga,network:dn,requiredAllowance:Pr,authorizedContractLabel:xr,targetContractLabel:Mr,currentAllowance:Nr,translationKeys:Ur}){const Vr=Qr(Pr);return(!Nr||!Nr.isZero())&&ga===Jt.AuthorizationType.ALLOWANCE&&dn===Yt.Network.ETHEREUM?[{title:Gr(Ur,"revoke_cap.title"),description:Gr(Ur,"revoke_cap.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.REVOKE},{title:Gr(Ur,"set_cap.title"),description:Gr(Ur,"set_cap.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.GRANT}]:ga===Jt.AuthorizationType.ALLOWANCE?[{title:Gr(Ur,"authorize_mana.title",{contract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.authorizedAddress||"",chainId:En.chainId,txHash:""},xr||En.authorizedAddress)}),description:Gr(Ur,"authorize_mana.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.GRANT}]:[{title:Gr(Ur,"authorize_nft.title",{contract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.authorizedAddress||"",chainId:En.chainId,txHash:""},xr||En.authorizedAddress),targetContract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.contractAddress||"",chainId:En.chainId,txHash:""},Mr||En.contractAddress)}),actionType:Hr.AuthorizationStepAction.GRANT}]}return utils$i.getSteps=pn,utils$i}var hasRequiredAuthorizationModal$1;function requireAuthorizationModal$1(){if(hasRequiredAuthorizationModal$1)return AuthorizationModal$4;hasRequiredAuthorizationModal$1=1;var Bt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(qr,Fr,Hr,Br){Br===void 0&&(Br=Hr),Object.defineProperty(qr,Br,{enumerable:!0,get:function(){return Fr[Hr]}})}:function(qr,Fr,Hr,Br){Br===void 0&&(Br=Hr),qr[Br]=Fr[Hr]}),Wt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(qr,Fr){Object.defineProperty(qr,"default",{enumerable:!0,value:Fr})}:function(qr,Fr){qr.default=Fr}),Gt=commonjsGlobal&&commonjsGlobal.__importStar||function(qr){if(qr&&qr.__esModule)return qr;var Fr={};if(qr!=null)for(var Hr in qr)Hr!=="default"&&Object.prototype.hasOwnProperty.call(qr,Hr)&&Bt(Fr,qr,Hr);return Wt(Fr,qr),Fr},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(qr){return qr&&qr.__esModule?qr:{default:qr}};Object.defineProperty(AuthorizationModal$4,"__esModule",{value:!0}),AuthorizationModal$4.AuthorizationModal=void 0;const Xt=Gt(reactExports),Jt=Yt(require$$1$6),Zt=dist$e,Qt=requireDist(),ur=utils$m,cr=AuthorizationModal_types,$r=requireUtils(),Ar=[cr.AuthorizationStepStatus.LOADING_INFO,cr.AuthorizationStepStatus.PROCESSING,cr.AuthorizationStepStatus.WAITING];function Lr({authorization:qr,requiredAllowance:Fr,currentAllowance:Hr,action:Br,authorizationType:Wr,revokeStatus:Gr,grantStatus:Kr,confirmationStatus:Yr,error:hn,confirmationError:Qr,network:pn,authorizedContractLabel:En,targetContractLabel:ga,translationKeys:dn,onClose:Pr,onRevoke:xr,onGrant:Mr,onAuthorized:Nr,onFetchAuthorizations:Ur}){const Vr=(0,ur.getAnalytics)(),[Zr]=(0,Xt.useState)((0,Jt.default)()),[Xr,Or]=(0,Xt.useState)(0),[jr,Jr]=(0,Xt.useState)(),[mn,gn]=(0,Xt.useState)(!1),eo=(0,$r.getPriceInMana)(Fr);(0,Xt.useEffect)(()=>{Vr.track("[Authorization Flow] Modal Opened",{action:Br,requiredAllowance:Fr,traceId:Zr})},[]),(0,Xt.useEffect)(()=>{Ur()},[Ur]);const _i=(0,Xt.useCallback)(()=>{xr(Zr),Vr.track("[Authorization Flow] Authorize Revoke Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.REVOKE)},[xr]),ro=(0,Xt.useCallback)(()=>{Mr(Zr),Vr.track("[Authorization Flow] Authorize Grant Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.GRANT)},[Mr]),io=(0,Xt.useCallback)(()=>{Nr(),Vr.track("[Authorization Flow] Confirm Transaction Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.CONFIRM)},[Nr]),ao=(0,Xt.useMemo)(()=>[...(0,$r.getSteps)({authorizationType:Wr,network:pn,requiredAllowance:Fr,currentAllowance:Hr,authorization:qr,authorizedContractLabel:En,translationKeys:dn,targetContractLabel:ga}),{title:(0,$r.getTranslation)(dn,"confirm_transaction.title",{action:(0,$r.getTranslation)(dn,"action")}),action:(0,$r.getTranslation)(dn,"confirm_transaction.action"),status:Yr,actionType:cr.AuthorizationStepAction.CONFIRM,error:Qr,onActionClick:io}].map(to=>to.actionType===cr.AuthorizationStepAction.GRANT?mn||Kr===cr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR&&pn===Zt.Network.ETHEREUM?Object.assign(Object.assign({},to),{error:(0,$r.getTranslation)(dn,"insufficient_amount_error.message",{price:eo}),action:"Revoke",status:Gr,message:Ar.includes(Gr)?void 0:Xt.default.createElement("div",{className:"authorization-error"},(0,$r.getTranslation)(dn,"insufficient_amount_error.message",{price:eo})),actionType:cr.AuthorizationStepAction.REVOKE,testId:"reauthorize-step",onActionClick:_i}):Object.assign(Object.assign({},to),{action:Kr===cr.AuthorizationStepStatus.DONE?void 0:(0,$r.getTranslation)(dn,"set_cap.action"),error:hn,status:Kr,onActionClick:ro}):to.actionType===cr.AuthorizationStepAction.REVOKE?Object.assign(Object.assign({},to),{action:Gr===cr.AuthorizationStepStatus.DONE?void 0:(0,$r.getTranslation)(dn,"revoke_cap.action"),error:hn,status:Gr,onActionClick:_i}):to).map((to,so)=>Object.assign(Object.assign({},to),{isLoading:so===Xr&&Ar.includes(to.status),message:"message"in to&&to.message?to.message:(0,$r.getStepMessage)(so,to.status,to.error,Xr,eo,to.actionType,dn),testId:"testId"in to?to.testId:`${to.actionType}-step`})),[Kr,Gr,Wr,Fr,Hr,pn,Br,Yr,Qr,En,mn,Xr,hn,ro,_i,io]);return(0,Xt.useEffect)(()=>{const oo=ao[Xr];oo.status===cr.AuthorizationStepStatus.DONE&&oo.actionType===jr&&(mn?gn(!1):(Or(Xr+1),Jr(void 0)))},[ao[Xr].status]),(0,Xt.useEffect)(()=>{Kr===cr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR&&pn===Zt.Network.ETHEREUM&&gn(!0)},[Kr,pn,gn]),Xt.default.createElement(Qt.AuthorizationModal,{onClose:Pr,currentStep:Xr,steps:ao,header:(0,$r.getTranslation)(dn,"title",{action:(0,$r.getTranslation)(dn,"title_action")})})}return AuthorizationModal$4.AuthorizationModal=Lr,AuthorizationModal$4}var hasRequiredAuthorizationModal_container;function requireAuthorizationModal_container(){if(hasRequiredAuthorizationModal_container)return AuthorizationModal_container;hasRequiredAuthorizationModal_container=1,Object.defineProperty(AuthorizationModal_container,"__esModule",{value:!0});const Bt=require$$0$e,Wt=actions$5,Gt=types$3,Yt=selectors,Xt=requireAuthorizationModal$1(),Jt=AuthorizationModal_types,Zt=requireUtils(),Qt=(cr,$r)=>{const{authorization:Ar,requiredAllowance:Lr,getConfirmationStatus:qr,getConfirmationError:Fr}=$r;return{revokeStatus:(0,Zt.getStepStatus)(cr,Gt.AuthorizationAction.REVOKE,Ar,void 0),grantStatus:(0,Zt.getStepStatus)(cr,Gt.AuthorizationAction.GRANT,Ar,Lr),confirmationStatus:qr?qr(cr):Jt.AuthorizationStepStatus.PENDING,confirmationError:Fr?Fr(cr):null,error:(0,Yt.getAuthorizationFlowError)(cr)||(0,Yt.getError)(cr)||""}},ur=(cr,$r)=>({onRevoke:Ar=>cr((0,Wt.authorizationFlowRequest)($r.authorization,Gt.AuthorizationAction.REVOKE,"",Ar)),onGrant:Ar=>{var Lr;return cr((0,Wt.authorizationFlowRequest)($r.authorization,Gt.AuthorizationAction.GRANT,((Lr=$r.requiredAllowance)===null||Lr===void 0?void 0:Lr.toString())||"",Ar))},onFetchAuthorizations:()=>cr((0,Wt.fetchAuthorizationsRequest)([$r.authorization]))});return AuthorizationModal_container.default=(0,Bt.connect)(Qt,ur)(Xt.AuthorizationModal),AuthorizationModal_container}var hasRequiredAuthorizationModal;function requireAuthorizationModal(){return hasRequiredAuthorizationModal||(hasRequiredAuthorizationModal=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Object.defineProperty(Jt,ur,{enumerable:!0,get:function(){return Zt[Qt]}})}:function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Jt[ur]=Zt[Qt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Jt,Zt){for(var Qt in Jt)Qt!=="default"&&!Object.prototype.hasOwnProperty.call(Zt,Qt)&&Wt(Zt,Jt,Qt)},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Jt){return Jt&&Jt.__esModule?Jt:{default:Jt}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationModal=void 0;const Xt=Yt(requireAuthorizationModal_container());Bt.AuthorizationModal=Xt.default,Gt(AuthorizationModal_types,Bt)}(AuthorizationModal$5)),AuthorizationModal$5}var hasRequiredWithAuthorizedAction$1;function requireWithAuthorizedAction$1(){if(hasRequiredWithAuthorizedAction$1)return withAuthorizedAction;hasRequiredWithAuthorizedAction$1=1;var Bt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Br,Wr,Gr,Kr){Kr===void 0&&(Kr=Gr),Object.defineProperty(Br,Kr,{enumerable:!0,get:function(){return Wr[Gr]}})}:function(Br,Wr,Gr,Kr){Kr===void 0&&(Kr=Gr),Br[Kr]=Wr[Gr]}),Wt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Br,Wr){Object.defineProperty(Br,"default",{enumerable:!0,value:Wr})}:function(Br,Wr){Br.default=Wr}),Gt=commonjsGlobal&&commonjsGlobal.__importStar||function(Br){if(Br&&Br.__esModule)return Br;var Wr={};if(Br!=null)for(var Gr in Br)Gr!=="default"&&Object.prototype.hasOwnProperty.call(Br,Gr)&&Bt(Wr,Br,Gr);return Wt(Wr,Br),Wr},Yt=commonjsGlobal&&commonjsGlobal.__awaiter||function(Br,Wr,Gr,Kr){function Yr(hn){return hn instanceof Gr?hn:new Gr(function(Qr){Qr(hn)})}return new(Gr||(Gr=Promise))(function(hn,Qr){function pn(dn){try{ga(Kr.next(dn))}catch(Pr){Qr(Pr)}}function En(dn){try{ga(Kr.throw(dn))}catch(Pr){Qr(Pr)}}function ga(dn){dn.done?hn(dn.value):Yr(dn.value).then(pn,En)}ga((Kr=Kr.apply(Br,Wr||[])).next())})};Object.defineProperty(withAuthorizedAction,"__esModule",{value:!0});const Xt=require$$0$e,Jt=Gt(reactExports),Zt=require$$0$5,Qt=types$3,ur=utils$k,cr=eth,$r=selectors$4,Ar=actions$5,Lr=requireAuthorizationModal(),qr=Br=>({address:(0,$r.getAddress)(Br)}),Fr=Br=>({onClearAuthorizationFlow:()=>Br((0,Ar.authorizationFlowClear)())});function Hr(Br,Wr,Gr,Kr,Yr){const hn=Qr=>{const[pn,En]=(0,Jt.useState)(!1),[ga,dn]=(0,Jt.useState)(),[Pr,xr]=(0,Jt.useState)(!1),{address:Mr,onClearAuthorizationFlow:Nr}=Qr,Ur=(0,Jt.useCallback)(Zr=>Yt(this,void 0,void 0,function*(){if(!Mr)return;xr(!0);const{authorizationType:Xr,targetContract:Or,authorizedAddress:jr,targetContractName:Jr,authorizedContractLabel:mn,onAuthorized:gn}=Zr,eo=yield(0,cr.getNetworkProvider)(Or.chainId),_i=new Zt.ethers.providers.Web3Provider(eo),ro={type:Xr,address:Mr,authorizedAddress:jr,contractAddress:Or.address,chainId:Or.chainId,contractName:Jr};try{if(Xr===Qt.AuthorizationType.ALLOWANCE){const{requiredAllowanceInWei:io}=Zr;if(Zt.BigNumber.from(io).isZero()){gn(!0),xr(!1);return}const oo=yield(0,ur.getERC20ContractInstance)(Or.address,_i).allowance(Mr,jr);if(oo.gte(Zt.BigNumber.from(io))){gn(!0),xr(!1);return}dn({translationKeys:Gr,authorization:ro,authorizedContractLabel:mn,currentAllowance:oo,requiredAllowance:Zt.BigNumber.from(io),authorizationType:Xr,action:Wr,network:Or.network,onAuthorized:()=>gn(!1),getConfirmationStatus:Kr,getConfirmationError:Yr})}else{if(yield(0,ur.getERC721ContractInstance)(Or.address,_i).isApprovedForAll(Mr,jr)){gn(!0),xr(!1);return}const{targetContractLabel:oo}=Zr;dn({translationKeys:Gr,authorization:ro,authorizationType:Xr,action:Wr,network:Or.network,authorizedContractLabel:mn,targetContractLabel:oo,onAuthorized:()=>gn(!1),getConfirmationStatus:Kr,getConfirmationError:Yr})}En(!0)}catch(io){console.error(io)}}),[Mr]),Vr=(0,Jt.useCallback)(()=>{xr(!1),En(!1),Nr()},[]);return Jt.default.createElement(Jt.default.Fragment,null,Jt.default.createElement(Br,Object.assign({},Qr,{onAuthorizedAction:Ur,onCloseAuthorization:Vr,isLoadingAuthorization:Pr})),pn&&ga?Jt.default.createElement(Lr.AuthorizationModal,Object.assign({onClose:Vr},ga)):null)};return(0,Xt.connect)(qr,Fr)(hn)}return withAuthorizedAction.default=Hr,withAuthorizedAction}var withAuthorizedAction_types={};Object.defineProperty(withAuthorizedAction_types,"__esModule",{value:!0});var hasRequiredWithAuthorizedAction;function requireWithAuthorizedAction(){return hasRequiredWithAuthorizedAction||(hasRequiredWithAuthorizedAction=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Object.defineProperty(Jt,ur,{enumerable:!0,get:function(){return Zt[Qt]}})}:function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Jt[ur]=Zt[Qt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Jt,Zt){for(var Qt in Jt)Qt!=="default"&&!Object.prototype.hasOwnProperty.call(Zt,Qt)&&Wt(Zt,Jt,Qt)},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Jt){return Jt&&Jt.__esModule?Jt:{default:Jt}};Object.defineProperty(Bt,"__esModule",{value:!0});const Xt=Yt(requireWithAuthorizedAction$1());Bt.default=Xt.default,Gt(withAuthorizedAction_types,Bt)}(withAuthorizedAction$1)),withAuthorizedAction$1}var hasRequiredContainers;function requireContainers(){return hasRequiredContainers||(hasRequiredContainers=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Br){return Br&&Br.__esModule?Br:{default:Br}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.withAuthorizedAction=Bt.UserMenu=Bt.TransactionLink=Bt.SignInPage=Bt.Profile=Bt.NetworkCheck=Bt.NetworkButton=Bt.Navbar=Bt.Modal=Bt.LoginModal=Bt.Footer=Bt.ChainProvider=Bt.ChainCheck=Bt.ChainButton=void 0;var Gt=ChainButton$2;Object.defineProperty(Bt,"ChainButton",{enumerable:!0,get:function(){return Wt(Gt).default}});var Yt=ChainCheck$2;Object.defineProperty(Bt,"ChainCheck",{enumerable:!0,get:function(){return Wt(Yt).default}});var Xt=ChainProvider$2;Object.defineProperty(Bt,"ChainProvider",{enumerable:!0,get:function(){return Wt(Xt).default}});var Jt=Footer$6;Object.defineProperty(Bt,"Footer",{enumerable:!0,get:function(){return Wt(Jt).default}});var Zt=LoginModal$4;Object.defineProperty(Bt,"LoginModal",{enumerable:!0,get:function(){return Wt(Zt).default}});var Qt=Modal$5;Object.defineProperty(Bt,"Modal",{enumerable:!0,get:function(){return Wt(Qt).default}});var ur=Navbar$7;Object.defineProperty(Bt,"Navbar",{enumerable:!0,get:function(){return Wt(ur).default}});var cr=NetworkButton$2;Object.defineProperty(Bt,"NetworkButton",{enumerable:!0,get:function(){return Wt(cr).default}});var $r=NetworkCheck$2;Object.defineProperty(Bt,"NetworkCheck",{enumerable:!0,get:function(){return Wt($r).default}});var Ar=Profile$6;Object.defineProperty(Bt,"Profile",{enumerable:!0,get:function(){return Wt(Ar).default}});var Lr=SignInPage$4;Object.defineProperty(Bt,"SignInPage",{enumerable:!0,get:function(){return Wt(Lr).default}});var qr=TransactionLink$2;Object.defineProperty(Bt,"TransactionLink",{enumerable:!0,get:function(){return Wt(qr).default}});var Fr=UserMenu$6;Object.defineProperty(Bt,"UserMenu",{enumerable:!0,get:function(){return Wt(Fr).default}});var Hr=requireWithAuthorizedAction();Object.defineProperty(Bt,"withAuthorizedAction",{enumerable:!0,get:function(){return Wt(Hr).default}})}(containers)),containers}var containersExports=requireContainers();const avatar$4={edit:"Edit Avatar"},profile_information$2={friends:"Friends"},worlds_button$2={get_a_name:"Get an unique name",activate_world:"Activate my world",jump:'Jump to "{domain}" World'},tabs$2={assets:"Assets",creations:"Creations",dao_activity:"DAO Activity",lists:"Lists",overview:"Overview",places:"Places"},en$2={avatar:avatar$4,profile_information:profile_information$2,worlds_button:worlds_button$2,tabs:tabs$2},avatar$3={edit:"Editar Avatar"},profile_information$1={friends:"Amigos"},worlds_button$1={get_a_name:"Obtenga un nombre único",activate_world:"Activar mi mundo",jump:'Saltar al mundo "{domain}"'},tabs$1={overview:"Resumen",assets:"Objetos",creations:"Creaciones",lists:"Listas",dao_activity:"Actividad DAO",places:"Places"},es$1={avatar:avatar$3,profile_information:profile_information$1,worlds_button:worlds_button$1,tabs:tabs$1},avatar$2={edit:"編輯頭像"},profile_information={friends:"朋友們"},worlds_button={get_a_name:"取一个独特的名字",activate_world:"创造我的世界",jump:"跳转到“{domain}”世界"},tabs={overview:"概述",assets:"資產",creations:"創作",lists:"列表",dao_activity:"DAO 活動",places:"地點"},zh$1={avatar:avatar$2,profile_information,worlds_button,tabs},locales$1=Object.freeze(Object.defineProperty({__proto__:null,en:en$2,es:es$1,zh:zh$1},Symbol.toStringTag,{value:"Module"})),locales=Object.keys(locales$1),Footer=Bt=>jsxRuntimeExports.jsx(containersExports.Footer,{locales,...Bt}),locations={root:()=>"/",signIn:Bt=>`/sign-in${Bt?`?redirectTo=${encodeURIComponent(Bt)}`:""}`};var network$1={},validation$1={},__importDefault$7=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(validation$1,"__esModule",{value:!0});validation$1.validateType=validation$1.generateLazyValidator=validation$1.Ajv=void 0;const ajv_1$1=__importDefault$7(ajvExports);validation$1.Ajv=ajv_1$1.default;const ajv_keywords_1$1=__importDefault$7(distExports$3),ajv_errors_1$1=__importDefault$7(distExports$2);function generateLazyValidator$1(Bt,Wt){let Gt=null;const Yt=(Xt,Jt)=>{if(!Gt){const Zt=new ajv_1$1.default({$data:!0,allErrors:!0});(0,ajv_keywords_1$1.default)(Zt),(0,ajv_errors_1$1.default)(Zt,{singleError:!0}),Wt==null||Wt.forEach(Qt=>Zt.addKeyword(Qt)),Gt=Zt.compile(Bt),Object.defineProperty(Yt,"errors",{get(){return Gt==null?void 0:Gt.errors}})}return Gt(Xt,Jt)};return Yt}validation$1.generateLazyValidator=generateLazyValidator$1;function validateType$1(Bt,Wt){return Bt.validate(Wt)}validation$1.validateType=validateType$1;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Network=void 0;const Wt=validation$1;(function(Gt){Gt.ETHEREUM="ETHEREUM",Gt.MATIC="MATIC"})(Bt.Network||(Bt.Network={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.Network||(Bt.Network={}))})(network$1);const mapState$3=Bt=>{const Wt=selectors$4.isConnected(Bt),Gt=selectors$4.getAddress(Bt),Yt=Gt?selectors$2.getData(Bt)[Gt]:void 0,Xt=selectors$4.getNetworks(Bt),Jt={};if(Wt){const Zt=Object.values(network$1.Network);for(const Qt of Zt)(Xt==null?void 0:Xt[Qt])&&(Jt[Qt]=Xt==null?void 0:Xt[Qt].mana)}return{address:Gt,manaBalances:Jt,avatar:Yt?Yt.avatars[0]:void 0,isSignedIn:Wt,isSigningIn:selectors$4.isConnecting(Bt),hasActivity:!1,hasTranslations:selectors$5.isEnabled(Bt)}},mapDispatch$1=Bt=>({onSignOut:()=>Bt(actions$8.disconnectWallet())}),mergeProps=(Bt,Wt)=>({...Bt,...Wt}),UserMenu=connect(mapState$3,mapDispatch$1,mergeProps)(UserMenu_2),Navbar$2="",Navbar$1=Bt=>{const{isConnected:Wt}=Bt,{pathname:Gt,search:Yt}=location,Xt=useNavigate();Wt&&(Bt={...Bt,rightMenu:jsxRuntimeExports.jsx(UserMenu,{})});const Jt=reactExports.useCallback(()=>{const Qt=new URLSearchParams(Yt).get("redirectTo"),ur=Qt||`${Gt}${Yt}`;Xt(locations.signIn(ur))},[Xt,Gt,Yt]);return jsxRuntimeExports.jsx(containersExports.Navbar,{...Bt,activePage:"profile",isFullscreen:Bt.isFullscreen,isSignIn:Gt===locations.signIn(),onSignIn:Jt})},mapState$2=Bt=>({isConnected:selectors$4.isConnected(Bt)}),Navbar=connect(mapState$2)(Navbar$1),page="_page_1glh3_1",content="_content_1glh3_11",navbar="_navbar_1glh3_16",styles$3={page,content,navbar},PageLayout=({children:Bt,className:Wt})=>jsxRuntimeExports.jsxs("div",{className:classNames(styles$3.page,Wt),children:[jsxRuntimeExports.jsx(Navbar,{className:styles$3.navbar,isFullscreen:!0}),jsxRuntimeExports.jsx("div",{className:styles$3.content,children:Bt}),jsxRuntimeExports.jsx(Footer,{className:styles$3.footer})]}),Copy="/assets/Copy-0d8d4029.svg",People="/assets/People-27bcbb23.svg",Share="/assets/Share-40a90bdc.svg",Wallet="/assets/Wallet-3bf78fcc.svg";function _defineProperty(Bt,Wt,Gt){return Wt=_toPropertyKey$B(Wt),Wt in Bt?Object.defineProperty(Bt,Wt,{value:Gt,enumerable:!0,configurable:!0,writable:!0}):Bt[Wt]=Gt,Bt}function ownKeys(Bt,Wt){var Gt=Object.keys(Bt);if(Object.getOwnPropertySymbols){var Yt=Object.getOwnPropertySymbols(Bt);Wt&&(Yt=Yt.filter(function(Xt){return Object.getOwnPropertyDescriptor(Bt,Xt).enumerable})),Gt.push.apply(Gt,Yt)}return Gt}function _objectSpread2(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt]!=null?arguments[Wt]:{};Wt%2?ownKeys(Object(Gt),!0).forEach(function(Yt){_defineProperty(Bt,Yt,Gt[Yt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Bt,Object.getOwnPropertyDescriptors(Gt)):ownKeys(Object(Gt)).forEach(function(Yt){Object.defineProperty(Bt,Yt,Object.getOwnPropertyDescriptor(Gt,Yt))})}return Bt}function formatProdErrorMessage(Bt){return"Minified Redux error #"+Bt+"; visit https://redux.js.org/Errors?code="+Bt+" for the full message or use the non-minified dev environment for full errors. "}var $$observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),randomString=function(){return Math.random().toString(36).substring(7).split("").join(".")},ActionTypes={INIT:"@@redux/INIT"+randomString(),REPLACE:"@@redux/REPLACE"+randomString(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+randomString()}};function isPlainObject$3(Bt){if(typeof Bt!="object"||Bt===null)return!1;for(var Wt=Bt;Object.getPrototypeOf(Wt)!==null;)Wt=Object.getPrototypeOf(Wt);return Object.getPrototypeOf(Bt)===Wt}function createStore(Bt,Wt,Gt){var Yt;if(typeof Wt=="function"&&typeof Gt=="function"||typeof Gt=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage(0));if(typeof Wt=="function"&&typeof Gt>"u"&&(Gt=Wt,Wt=void 0),typeof Gt<"u"){if(typeof Gt!="function")throw new Error(formatProdErrorMessage(1));return Gt(createStore)(Bt,Wt)}if(typeof Bt!="function")throw new Error(formatProdErrorMessage(2));var Xt=Bt,Jt=Wt,Zt=[],Qt=Zt,ur=!1;function cr(){Qt===Zt&&(Qt=Zt.slice())}function $r(){if(ur)throw new Error(formatProdErrorMessage(3));return Jt}function Ar(Hr){if(typeof Hr!="function")throw new Error(formatProdErrorMessage(4));if(ur)throw new Error(formatProdErrorMessage(5));var Br=!0;return cr(),Qt.push(Hr),function(){if(Br){if(ur)throw new Error(formatProdErrorMessage(6));Br=!1,cr();var Gr=Qt.indexOf(Hr);Qt.splice(Gr,1),Zt=null}}}function Lr(Hr){if(!isPlainObject$3(Hr))throw new Error(formatProdErrorMessage(7));if(typeof Hr.type>"u")throw new Error(formatProdErrorMessage(8));if(ur)throw new Error(formatProdErrorMessage(9));try{ur=!0,Jt=Xt(Jt,Hr)}finally{ur=!1}for(var Br=Zt=Qt,Wr=0;Wr<Br.length;Wr++){var Gr=Br[Wr];Gr()}return Hr}function qr(Hr){if(typeof Hr!="function")throw new Error(formatProdErrorMessage(10));Xt=Hr,Lr({type:ActionTypes.REPLACE})}function Fr(){var Hr,Br=Ar;return Hr={subscribe:function(Gr){if(typeof Gr!="object"||Gr===null)throw new Error(formatProdErrorMessage(11));function Kr(){Gr.next&&Gr.next($r())}Kr();var Yr=Br(Kr);return{unsubscribe:Yr}}},Hr[$$observable]=function(){return this},Hr}return Lr({type:ActionTypes.INIT}),Yt={dispatch:Lr,subscribe:Ar,getState:$r,replaceReducer:qr},Yt[$$observable]=Fr,Yt}function assertReducerShape(Bt){Object.keys(Bt).forEach(function(Wt){var Gt=Bt[Wt],Yt=Gt(void 0,{type:ActionTypes.INIT});if(typeof Yt>"u")throw new Error(formatProdErrorMessage(12));if(typeof Gt(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage(13))})}function combineReducers(Bt){for(var Wt=Object.keys(Bt),Gt={},Yt=0;Yt<Wt.length;Yt++){var Xt=Wt[Yt];typeof Bt[Xt]=="function"&&(Gt[Xt]=Bt[Xt])}var Jt=Object.keys(Gt),Zt;try{assertReducerShape(Gt)}catch(Qt){Zt=Qt}return function(ur,cr){if(ur===void 0&&(ur={}),Zt)throw Zt;for(var $r=!1,Ar={},Lr=0;Lr<Jt.length;Lr++){var qr=Jt[Lr],Fr=Gt[qr],Hr=ur[qr],Br=Fr(Hr,cr);if(typeof Br>"u")throw cr&&cr.type,new Error(formatProdErrorMessage(14));Ar[qr]=Br,$r=$r||Br!==Hr}return $r=$r||Jt.length!==Object.keys(ur).length,$r?Ar:ur}}function bindActionCreator(Bt,Wt){return function(){return Wt(Bt.apply(this,arguments))}}function bindActionCreators(Bt,Wt){if(typeof Bt=="function")return bindActionCreator(Bt,Wt);if(typeof Bt!="object"||Bt===null)throw new Error(formatProdErrorMessage(16));var Gt={};for(var Yt in Bt){var Xt=Bt[Yt];typeof Xt=="function"&&(Gt[Yt]=bindActionCreator(Xt,Wt))}return Gt}function compose(){for(var Bt=arguments.length,Wt=new Array(Bt),Gt=0;Gt<Bt;Gt++)Wt[Gt]=arguments[Gt];return Wt.length===0?function(Yt){return Yt}:Wt.length===1?Wt[0]:Wt.reduce(function(Yt,Xt){return function(){return Yt(Xt.apply(void 0,arguments))}})}function applyMiddleware(){for(var Bt=arguments.length,Wt=new Array(Bt),Gt=0;Gt<Bt;Gt++)Wt[Gt]=arguments[Gt];return function(Yt){return function(){var Xt=Yt.apply(void 0,arguments),Jt=function(){throw new Error(formatProdErrorMessage(15))},Zt={getState:Xt.getState,dispatch:function(){return Jt.apply(void 0,arguments)}},Qt=Wt.map(function(ur){return ur(Zt)});return Jt=compose.apply(void 0,Qt)(Xt.dispatch),_objectSpread2(_objectSpread2({},Xt),{},{dispatch:Jt})}}}function n(Bt){for(var Wt=arguments.length,Gt=Array(Wt>1?Wt-1:0),Yt=1;Yt<Wt;Yt++)Gt[Yt-1]=arguments[Yt];throw Error("[Immer] minified error nr: "+Bt+(Gt.length?" "+Gt.map(function(Xt){return"'"+Xt+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(Bt){return!!Bt&&!!Bt[Q]}function t(Bt){var Wt;return!!Bt&&(function(Gt){if(!Gt||typeof Gt!="object")return!1;var Yt=Object.getPrototypeOf(Gt);if(Yt===null)return!0;var Xt=Object.hasOwnProperty.call(Yt,"constructor")&&Yt.constructor;return Xt===Object||typeof Xt=="function"&&Function.toString.call(Xt)===Z}(Bt)||Array.isArray(Bt)||!!Bt[L]||!!(!((Wt=Bt.constructor)===null||Wt===void 0)&&Wt[L])||s(Bt)||v(Bt))}function i(Bt,Wt,Gt){Gt===void 0&&(Gt=!1),o(Bt)===0?(Gt?Object.keys:nn)(Bt).forEach(function(Yt){Gt&&typeof Yt=="symbol"||Wt(Yt,Bt[Yt],Bt)}):Bt.forEach(function(Yt,Xt){return Wt(Xt,Yt,Bt)})}function o(Bt){var Wt=Bt[Q];return Wt?Wt.i>3?Wt.i-4:Wt.i:Array.isArray(Bt)?1:s(Bt)?2:v(Bt)?3:0}function u(Bt,Wt){return o(Bt)===2?Bt.has(Wt):Object.prototype.hasOwnProperty.call(Bt,Wt)}function a(Bt,Wt){return o(Bt)===2?Bt.get(Wt):Bt[Wt]}function f(Bt,Wt,Gt){var Yt=o(Bt);Yt===2?Bt.set(Wt,Gt):Yt===3?Bt.add(Gt):Bt[Wt]=Gt}function c(Bt,Wt){return Bt===Wt?Bt!==0||1/Bt==1/Wt:Bt!=Bt&&Wt!=Wt}function s(Bt){return X&&Bt instanceof Map}function v(Bt){return q&&Bt instanceof Set}function p(Bt){return Bt.o||Bt.t}function l(Bt){if(Array.isArray(Bt))return Array.prototype.slice.call(Bt);var Wt=rn(Bt);delete Wt[Q];for(var Gt=nn(Wt),Yt=0;Yt<Gt.length;Yt++){var Xt=Gt[Yt],Jt=Wt[Xt];Jt.writable===!1&&(Jt.writable=!0,Jt.configurable=!0),(Jt.get||Jt.set)&&(Wt[Xt]={configurable:!0,writable:!0,enumerable:Jt.enumerable,value:Bt[Xt]})}return Object.create(Object.getPrototypeOf(Bt),Wt)}function d(Bt,Wt){return Wt===void 0&&(Wt=!1),y(Bt)||r(Bt)||!t(Bt)||(o(Bt)>1&&(Bt.set=Bt.add=Bt.clear=Bt.delete=h),Object.freeze(Bt),Wt&&i(Bt,function(Gt,Yt){return d(Yt,!0)},!0)),Bt}function h(){n(2)}function y(Bt){return Bt==null||typeof Bt!="object"||Object.isFrozen(Bt)}function b(Bt){var Wt=tn[Bt];return Wt||n(18,Bt),Wt}function m(Bt,Wt){tn[Bt]||(tn[Bt]=Wt)}function _(){return U}function j(Bt,Wt){Wt&&(b("Patches"),Bt.u=[],Bt.s=[],Bt.v=Wt)}function g(Bt){O(Bt),Bt.p.forEach(S),Bt.p=null}function O(Bt){Bt===U&&(U=Bt.l)}function w(Bt){return U={p:[],l:U,h:Bt,m:!0,_:0}}function S(Bt){var Wt=Bt[Q];Wt.i===0||Wt.i===1?Wt.j():Wt.g=!0}function P(Bt,Wt){Wt._=Wt.p.length;var Gt=Wt.p[0],Yt=Bt!==void 0&&Bt!==Gt;return Wt.h.O||b("ES5").S(Wt,Bt,Yt),Yt?(Gt[Q].P&&(g(Wt),n(4)),t(Bt)&&(Bt=M(Wt,Bt),Wt.l||x(Wt,Bt)),Wt.u&&b("Patches").M(Gt[Q].t,Bt,Wt.u,Wt.s)):Bt=M(Wt,Gt,[]),g(Wt),Wt.u&&Wt.v(Wt.u,Wt.s),Bt!==H?Bt:void 0}function M(Bt,Wt,Gt){if(y(Wt))return Wt;var Yt=Wt[Q];if(!Yt)return i(Wt,function(Qt,ur){return A(Bt,Yt,Wt,Qt,ur,Gt)},!0),Wt;if(Yt.A!==Bt)return Wt;if(!Yt.P)return x(Bt,Yt.t,!0),Yt.t;if(!Yt.I){Yt.I=!0,Yt.A._--;var Xt=Yt.i===4||Yt.i===5?Yt.o=l(Yt.k):Yt.o,Jt=Xt,Zt=!1;Yt.i===3&&(Jt=new Set(Xt),Xt.clear(),Zt=!0),i(Jt,function(Qt,ur){return A(Bt,Yt,Xt,Qt,ur,Gt,Zt)}),x(Bt,Xt,!1),Gt&&Bt.u&&b("Patches").N(Yt,Gt,Bt.u,Bt.s)}return Yt.o}function A(Bt,Wt,Gt,Yt,Xt,Jt,Zt){if(r(Xt)){var Qt=M(Bt,Xt,Jt&&Wt&&Wt.i!==3&&!u(Wt.R,Yt)?Jt.concat(Yt):void 0);if(f(Gt,Yt,Qt),!r(Qt))return;Bt.m=!1}else Zt&&Gt.add(Xt);if(t(Xt)&&!y(Xt)){if(!Bt.h.D&&Bt._<1)return;M(Bt,Xt),Wt&&Wt.A.l||x(Bt,Xt)}}function x(Bt,Wt,Gt){Gt===void 0&&(Gt=!1),!Bt.l&&Bt.h.D&&Bt.m&&d(Wt,Gt)}function z(Bt,Wt){var Gt=Bt[Q];return(Gt?p(Gt):Bt)[Wt]}function I(Bt,Wt){if(Wt in Bt)for(var Gt=Object.getPrototypeOf(Bt);Gt;){var Yt=Object.getOwnPropertyDescriptor(Gt,Wt);if(Yt)return Yt;Gt=Object.getPrototypeOf(Gt)}}function k(Bt){Bt.P||(Bt.P=!0,Bt.l&&k(Bt.l))}function E(Bt){Bt.o||(Bt.o=l(Bt.t))}function N(Bt,Wt,Gt){var Yt=s(Wt)?b("MapSet").F(Wt,Gt):v(Wt)?b("MapSet").T(Wt,Gt):Bt.O?function(Xt,Jt){var Zt=Array.isArray(Xt),Qt={i:Zt?1:0,A:Jt?Jt.A:_(),P:!1,I:!1,R:{},l:Jt,t:Xt,k:null,o:null,j:null,C:!1},ur=Qt,cr=en$1;Zt&&(ur=[Qt],cr=on);var $r=Proxy.revocable(ur,cr),Ar=$r.revoke,Lr=$r.proxy;return Qt.k=Lr,Qt.j=Ar,Lr}(Wt,Gt):b("ES5").J(Wt,Gt);return(Gt?Gt.A:_()).p.push(Yt),Yt}function R(Bt){return r(Bt)||n(22,Bt),function Wt(Gt){if(!t(Gt))return Gt;var Yt,Xt=Gt[Q],Jt=o(Gt);if(Xt){if(!Xt.P&&(Xt.i<4||!b("ES5").K(Xt)))return Xt.t;Xt.I=!0,Yt=D(Gt,Jt),Xt.I=!1}else Yt=D(Gt,Jt);return i(Yt,function(Zt,Qt){Xt&&a(Xt.t,Zt)===Qt||f(Yt,Zt,Wt(Qt))}),Jt===3?new Set(Yt):Yt}(Bt)}function D(Bt,Wt){switch(Wt){case 2:return new Map(Bt);case 3:return Array.from(Bt)}return l(Bt)}function F(){function Bt(Jt,Zt){var Qt=Xt[Jt];return Qt?Qt.enumerable=Zt:Xt[Jt]=Qt={configurable:!0,enumerable:Zt,get:function(){var ur=this[Q];return en$1.get(ur,Jt)},set:function(ur){var cr=this[Q];en$1.set(cr,Jt,ur)}},Qt}function Wt(Jt){for(var Zt=Jt.length-1;Zt>=0;Zt--){var Qt=Jt[Zt][Q];if(!Qt.P)switch(Qt.i){case 5:Yt(Qt)&&k(Qt);break;case 4:Gt(Qt)&&k(Qt)}}}function Gt(Jt){for(var Zt=Jt.t,Qt=Jt.k,ur=nn(Qt),cr=ur.length-1;cr>=0;cr--){var $r=ur[cr];if($r!==Q){var Ar=Zt[$r];if(Ar===void 0&&!u(Zt,$r))return!0;var Lr=Qt[$r],qr=Lr&&Lr[Q];if(qr?qr.t!==Ar:!c(Lr,Ar))return!0}}var Fr=!!Zt[Q];return ur.length!==nn(Zt).length+(Fr?0:1)}function Yt(Jt){var Zt=Jt.k;if(Zt.length!==Jt.t.length)return!0;var Qt=Object.getOwnPropertyDescriptor(Zt,Zt.length-1);if(Qt&&!Qt.get)return!0;for(var ur=0;ur<Zt.length;ur++)if(!Zt.hasOwnProperty(ur))return!0;return!1}var Xt={};m("ES5",{J:function(Jt,Zt){var Qt=Array.isArray(Jt),ur=function($r,Ar){if($r){for(var Lr=Array(Ar.length),qr=0;qr<Ar.length;qr++)Object.defineProperty(Lr,""+qr,Bt(qr,!0));return Lr}var Fr=rn(Ar);delete Fr[Q];for(var Hr=nn(Fr),Br=0;Br<Hr.length;Br++){var Wr=Hr[Br];Fr[Wr]=Bt(Wr,$r||!!Fr[Wr].enumerable)}return Object.create(Object.getPrototypeOf(Ar),Fr)}(Qt,Jt),cr={i:Qt?5:4,A:Zt?Zt.A:_(),P:!1,I:!1,R:{},l:Zt,t:Jt,k:ur,o:null,g:!1,C:!1};return Object.defineProperty(ur,Q,{value:cr,writable:!0}),ur},S:function(Jt,Zt,Qt){Qt?r(Zt)&&Zt[Q].A===Jt&&Wt(Jt.p):(Jt.u&&function ur(cr){if(cr&&typeof cr=="object"){var $r=cr[Q];if($r){var Ar=$r.t,Lr=$r.k,qr=$r.R,Fr=$r.i;if(Fr===4)i(Lr,function(Kr){Kr!==Q&&(Ar[Kr]!==void 0||u(Ar,Kr)?qr[Kr]||ur(Lr[Kr]):(qr[Kr]=!0,k($r)))}),i(Ar,function(Kr){Lr[Kr]!==void 0||u(Lr,Kr)||(qr[Kr]=!1,k($r))});else if(Fr===5){if(Yt($r)&&(k($r),qr.length=!0),Lr.length<Ar.length)for(var Hr=Lr.length;Hr<Ar.length;Hr++)qr[Hr]=!1;else for(var Br=Ar.length;Br<Lr.length;Br++)qr[Br]=!0;for(var Wr=Math.min(Lr.length,Ar.length),Gr=0;Gr<Wr;Gr++)Lr.hasOwnProperty(Gr)||(qr[Gr]=!0),qr[Gr]===void 0&&ur(Lr[Gr])}}}}(Jt.p[0]),Wt(Jt.p))},K:function(Jt){return Jt.i===4?Gt(Jt):Yt(Jt)}})}var G,U,W=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",X=typeof Map<"u",q=typeof Set<"u",B=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Z=""+Object.prototype.constructor,nn=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(Bt){return Object.getOwnPropertyNames(Bt).concat(Object.getOwnPropertySymbols(Bt))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(Bt){var Wt={};return nn(Bt).forEach(function(Gt){Wt[Gt]=Object.getOwnPropertyDescriptor(Bt,Gt)}),Wt},tn={},en$1={get:function(Bt,Wt){if(Wt===Q)return Bt;var Gt=p(Bt);if(!u(Gt,Wt))return function(Xt,Jt,Zt){var Qt,ur=I(Jt,Zt);return ur?"value"in ur?ur.value:(Qt=ur.get)===null||Qt===void 0?void 0:Qt.call(Xt.k):void 0}(Bt,Gt,Wt);var Yt=Gt[Wt];return Bt.I||!t(Yt)?Yt:Yt===z(Bt.t,Wt)?(E(Bt),Bt.o[Wt]=N(Bt.A.h,Yt,Bt)):Yt},has:function(Bt,Wt){return Wt in p(Bt)},ownKeys:function(Bt){return Reflect.ownKeys(p(Bt))},set:function(Bt,Wt,Gt){var Yt=I(p(Bt),Wt);if(Yt!=null&&Yt.set)return Yt.set.call(Bt.k,Gt),!0;if(!Bt.P){var Xt=z(p(Bt),Wt),Jt=Xt==null?void 0:Xt[Q];if(Jt&&Jt.t===Gt)return Bt.o[Wt]=Gt,Bt.R[Wt]=!1,!0;if(c(Gt,Xt)&&(Gt!==void 0||u(Bt.t,Wt)))return!0;E(Bt),k(Bt)}return Bt.o[Wt]===Gt&&(Gt!==void 0||Wt in Bt.o)||Number.isNaN(Gt)&&Number.isNaN(Bt.o[Wt])||(Bt.o[Wt]=Gt,Bt.R[Wt]=!0),!0},deleteProperty:function(Bt,Wt){return z(Bt.t,Wt)!==void 0||Wt in Bt.t?(Bt.R[Wt]=!1,E(Bt),k(Bt)):delete Bt.R[Wt],Bt.o&&delete Bt.o[Wt],!0},getOwnPropertyDescriptor:function(Bt,Wt){var Gt=p(Bt),Yt=Reflect.getOwnPropertyDescriptor(Gt,Wt);return Yt&&{writable:!0,configurable:Bt.i!==1||Wt!=="length",enumerable:Yt.enumerable,value:Gt[Wt]}},defineProperty:function(){n(11)},getPrototypeOf:function(Bt){return Object.getPrototypeOf(Bt.t)},setPrototypeOf:function(){n(12)}},on={};i(en$1,function(Bt,Wt){on[Bt]=function(){return arguments[0]=arguments[0][0],Wt.apply(this,arguments)}}),on.deleteProperty=function(Bt,Wt){return on.set.call(this,Bt,Wt,void 0)},on.set=function(Bt,Wt,Gt){return en$1.set.call(this,Bt[0],Wt,Gt,Bt[0])};var un=function(){function Bt(Gt){var Yt=this;this.O=B,this.D=!0,this.produce=function(Xt,Jt,Zt){if(typeof Xt=="function"&&typeof Jt!="function"){var Qt=Jt;Jt=Xt;var ur=Yt;return function(Hr){var Br=this;Hr===void 0&&(Hr=Qt);for(var Wr=arguments.length,Gr=Array(Wr>1?Wr-1:0),Kr=1;Kr<Wr;Kr++)Gr[Kr-1]=arguments[Kr];return ur.produce(Hr,function(Yr){var hn;return(hn=Jt).call.apply(hn,[Br,Yr].concat(Gr))})}}var cr;if(typeof Jt!="function"&&n(6),Zt!==void 0&&typeof Zt!="function"&&n(7),t(Xt)){var $r=w(Yt),Ar=N(Yt,Xt,void 0),Lr=!0;try{cr=Jt(Ar),Lr=!1}finally{Lr?g($r):O($r)}return typeof Promise<"u"&&cr instanceof Promise?cr.then(function(Hr){return j($r,Zt),P(Hr,$r)},function(Hr){throw g($r),Hr}):(j($r,Zt),P(cr,$r))}if(!Xt||typeof Xt!="object"){if((cr=Jt(Xt))===void 0&&(cr=Xt),cr===H&&(cr=void 0),Yt.D&&d(cr,!0),Zt){var qr=[],Fr=[];b("Patches").M(Xt,cr,qr,Fr),Zt(qr,Fr)}return cr}n(21,Xt)},this.produceWithPatches=function(Xt,Jt){if(typeof Xt=="function")return function(cr){for(var $r=arguments.length,Ar=Array($r>1?$r-1:0),Lr=1;Lr<$r;Lr++)Ar[Lr-1]=arguments[Lr];return Yt.produceWithPatches(cr,function(qr){return Xt.apply(void 0,[qr].concat(Ar))})};var Zt,Qt,ur=Yt.produce(Xt,Jt,function(cr,$r){Zt=cr,Qt=$r});return typeof Promise<"u"&&ur instanceof Promise?ur.then(function(cr){return[cr,Zt,Qt]}):[ur,Zt,Qt]},typeof(Gt==null?void 0:Gt.useProxies)=="boolean"&&this.setUseProxies(Gt.useProxies),typeof(Gt==null?void 0:Gt.autoFreeze)=="boolean"&&this.setAutoFreeze(Gt.autoFreeze)}var Wt=Bt.prototype;return Wt.createDraft=function(Gt){t(Gt)||n(8),r(Gt)&&(Gt=R(Gt));var Yt=w(this),Xt=N(this,Gt,void 0);return Xt[Q].C=!0,O(Yt),Xt},Wt.finishDraft=function(Gt,Yt){var Xt=Gt&&Gt[Q],Jt=Xt.A;return j(Jt,Yt),P(void 0,Jt)},Wt.setAutoFreeze=function(Gt){this.D=Gt},Wt.setUseProxies=function(Gt){Gt&&!B&&n(20),this.O=Gt},Wt.applyPatches=function(Gt,Yt){var Xt;for(Xt=Yt.length-1;Xt>=0;Xt--){var Jt=Yt[Xt];if(Jt.path.length===0&&Jt.op==="replace"){Gt=Jt.value;break}}Xt>-1&&(Yt=Yt.slice(Xt+1));var Zt=b("Patches").$;return r(Gt)?Zt(Gt,Yt):this.produce(Gt,function(Qt){return Zt(Qt,Yt)})},Bt}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);const createNextState3=fn;var NOT_FOUND="NOT_FOUND";function createSingletonCache(Bt){var Wt;return{get:function(Yt){return Wt&&Bt(Wt.key,Yt)?Wt.value:NOT_FOUND},put:function(Yt,Xt){Wt={key:Yt,value:Xt}},getEntries:function(){return Wt?[Wt]:[]},clear:function(){Wt=void 0}}}function createLruCache(Bt,Wt){var Gt=[];function Yt(Qt){var ur=Gt.findIndex(function($r){return Wt(Qt,$r.key)});if(ur>-1){var cr=Gt[ur];return ur>0&&(Gt.splice(ur,1),Gt.unshift(cr)),cr.value}return NOT_FOUND}function Xt(Qt,ur){Yt(Qt)===NOT_FOUND&&(Gt.unshift({key:Qt,value:ur}),Gt.length>Bt&&Gt.pop())}function Jt(){return Gt}function Zt(){Gt=[]}return{get:Yt,put:Xt,getEntries:Jt,clear:Zt}}var defaultEqualityCheck=function(Wt,Gt){return Wt===Gt};function createCacheKeyComparator(Bt){return function(Gt,Yt){if(Gt===null||Yt===null||Gt.length!==Yt.length)return!1;for(var Xt=Gt.length,Jt=0;Jt<Xt;Jt++)if(!Bt(Gt[Jt],Yt[Jt]))return!1;return!0}}function defaultMemoize(Bt,Wt){var Gt=typeof Wt=="object"?Wt:{equalityCheck:Wt},Yt=Gt.equalityCheck,Xt=Yt===void 0?defaultEqualityCheck:Yt,Jt=Gt.maxSize,Zt=Jt===void 0?1:Jt,Qt=Gt.resultEqualityCheck,ur=createCacheKeyComparator(Xt),cr=Zt===1?createSingletonCache(ur):createLruCache(Zt,ur);function $r(){var Ar=cr.get(arguments);if(Ar===NOT_FOUND){if(Ar=Bt.apply(null,arguments),Qt){var Lr=cr.getEntries(),qr=Lr.find(function(Fr){return Qt(Fr.value,Ar)});qr&&(Ar=qr.value)}cr.put(arguments,Ar)}return Ar}return $r.clearCache=function(){return cr.clear()},$r}function getDependencies(Bt){var Wt=Array.isArray(Bt[0])?Bt[0]:Bt;if(!Wt.every(function(Yt){return typeof Yt=="function"})){var Gt=Wt.map(function(Yt){return typeof Yt=="function"?"function "+(Yt.name||"unnamed")+"()":typeof Yt}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+Gt+"]")}return Wt}function createSelectorCreator(Bt){for(var Wt=arguments.length,Gt=new Array(Wt>1?Wt-1:0),Yt=1;Yt<Wt;Yt++)Gt[Yt-1]=arguments[Yt];var Xt=function(){for(var Zt=arguments.length,Qt=new Array(Zt),ur=0;ur<Zt;ur++)Qt[ur]=arguments[ur];var cr=0,$r,Ar={memoizeOptions:void 0},Lr=Qt.pop();if(typeof Lr=="object"&&(Ar=Lr,Lr=Qt.pop()),typeof Lr!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof Lr+"]");var qr=Ar,Fr=qr.memoizeOptions,Hr=Fr===void 0?Gt:Fr,Br=Array.isArray(Hr)?Hr:[Hr],Wr=getDependencies(Qt),Gr=Bt.apply(void 0,[function(){return cr++,Lr.apply(null,arguments)}].concat(Br)),Kr=Bt(function(){for(var hn=[],Qr=Wr.length,pn=0;pn<Qr;pn++)hn.push(Wr[pn].apply(null,arguments));return $r=Gr.apply(null,hn),$r});return Object.assign(Kr,{resultFunc:Lr,memoizedResultFunc:Gr,dependencies:Wr,lastResult:function(){return $r},recomputations:function(){return cr},resetRecomputations:function(){return cr=0}}),Kr};return Xt}var createSelector=createSelectorCreator(defaultMemoize);function createThunkMiddleware(Bt){var Wt=function(Yt){var Xt=Yt.dispatch,Jt=Yt.getState;return function(Zt){return function(Qt){return typeof Qt=="function"?Qt(Xt,Jt,Bt):Zt(Qt)}}};return Wt}var thunk=createThunkMiddleware();thunk.withExtraArgument=createThunkMiddleware;const thunkMiddleware=thunk;var __extends=globalThis&&globalThis.__extends||function(){var Bt=function(Wt,Gt){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Yt,Xt){Yt.__proto__=Xt}||function(Yt,Xt){for(var Jt in Xt)Object.prototype.hasOwnProperty.call(Xt,Jt)&&(Yt[Jt]=Xt[Jt])},Bt(Wt,Gt)};return function(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Class extends value "+String(Gt)+" is not a constructor or null");Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__generator=globalThis&&globalThis.__generator||function(Bt,Wt){var Gt={label:0,sent:function(){if(Jt[0]&1)throw Jt[1];return Jt[1]},trys:[],ops:[]},Yt,Xt,Jt,Zt;return Zt={next:Qt(0),throw:Qt(1),return:Qt(2)},typeof Symbol=="function"&&(Zt[Symbol.iterator]=function(){return this}),Zt;function Qt(cr){return function($r){return ur([cr,$r])}}function ur(cr){if(Yt)throw new TypeError("Generator is already executing.");for(;Gt;)try{if(Yt=1,Xt&&(Jt=cr[0]&2?Xt.return:cr[0]?Xt.throw||((Jt=Xt.return)&&Jt.call(Xt),0):Xt.next)&&!(Jt=Jt.call(Xt,cr[1])).done)return Jt;switch(Xt=0,Jt&&(cr=[cr[0]&2,Jt.value]),cr[0]){case 0:case 1:Jt=cr;break;case 4:return Gt.label++,{value:cr[1],done:!1};case 5:Gt.label++,Xt=cr[1],cr=[0];continue;case 7:cr=Gt.ops.pop(),Gt.trys.pop();continue;default:if(Jt=Gt.trys,!(Jt=Jt.length>0&&Jt[Jt.length-1])&&(cr[0]===6||cr[0]===2)){Gt=0;continue}if(cr[0]===3&&(!Jt||cr[1]>Jt[0]&&cr[1]<Jt[3])){Gt.label=cr[1];break}if(cr[0]===6&&Gt.label<Jt[1]){Gt.label=Jt[1],Jt=cr;break}if(Jt&&Gt.label<Jt[2]){Gt.label=Jt[2],Gt.ops.push(cr);break}Jt[2]&&Gt.ops.pop(),Gt.trys.pop();continue}cr=Wt.call(Bt,Gt)}catch($r){cr=[6,$r],Xt=0}finally{Yt=Jt=0}if(cr[0]&5)throw cr[1];return{value:cr[0]?cr[1]:void 0,done:!0}}},__spreadArray=globalThis&&globalThis.__spreadArray||function(Bt,Wt){for(var Gt=0,Yt=Wt.length,Xt=Bt.length;Gt<Yt;Gt++,Xt++)Bt[Xt]=Wt[Gt];return Bt},__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=function(Bt,Wt,Gt){return Wt in Bt?__defProp(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt},__spreadValues=function(Bt,Wt){for(var Gt in Wt||(Wt={}))__hasOwnProp.call(Wt,Gt)&&__defNormalProp(Bt,Gt,Wt[Gt]);if(__getOwnPropSymbols)for(var Yt=0,Xt=__getOwnPropSymbols(Wt);Yt<Xt.length;Yt++){var Gt=Xt[Yt];__propIsEnum.call(Wt,Gt)&&__defNormalProp(Bt,Gt,Wt[Gt])}return Bt},__spreadProps=function(Bt,Wt){return __defProps(Bt,__getOwnPropDescs(Wt))},__async=function(Bt,Wt,Gt){return new Promise(function(Yt,Xt){var Jt=function(ur){try{Qt(Gt.next(ur))}catch(cr){Xt(cr)}},Zt=function(ur){try{Qt(Gt.throw(ur))}catch(cr){Xt(cr)}},Qt=function(ur){return ur.done?Yt(ur.value):Promise.resolve(ur.value).then(Jt,Zt)};Qt((Gt=Gt.apply(Bt,Wt)).next())})},composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function isPlainObject$2(Bt){if(typeof Bt!="object"||Bt===null)return!1;var Wt=Object.getPrototypeOf(Bt);if(Wt===null)return!0;for(var Gt=Wt;Object.getPrototypeOf(Gt)!==null;)Gt=Object.getPrototypeOf(Gt);return Wt===Gt}var MiddlewareArray=function(Bt){__extends(Wt,Bt);function Wt(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];var Xt=Bt.apply(this,Gt)||this;return Object.setPrototypeOf(Xt,Wt.prototype),Xt}return Object.defineProperty(Wt,Symbol.species,{get:function(){return Wt},enumerable:!1,configurable:!0}),Wt.prototype.concat=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Bt.prototype.concat.apply(this,Gt)},Wt.prototype.prepend=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Gt.length===1&&Array.isArray(Gt[0])?new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt[0].concat(this)))):new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt.concat(this))))},Wt}(Array),EnhancerArray=function(Bt){__extends(Wt,Bt);function Wt(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];var Xt=Bt.apply(this,Gt)||this;return Object.setPrototypeOf(Xt,Wt.prototype),Xt}return Object.defineProperty(Wt,Symbol.species,{get:function(){return Wt},enumerable:!1,configurable:!0}),Wt.prototype.concat=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Bt.prototype.concat.apply(this,Gt)},Wt.prototype.prepend=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Gt.length===1&&Array.isArray(Gt[0])?new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt[0].concat(this)))):new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt.concat(this))))},Wt}(Array);function freezeDraftable(Bt){return t(Bt)?createNextState3(Bt,function(){}):Bt}function isBoolean(Bt){return typeof Bt=="boolean"}function curryGetDefaultMiddleware(){return function(Wt){return getDefaultMiddleware(Wt)}}function getDefaultMiddleware(Bt){Bt===void 0&&(Bt={});var Wt=Bt.thunk,Gt=Wt===void 0?!0:Wt;Bt.immutableCheck,Bt.serializableCheck;var Yt=new MiddlewareArray;return Gt&&(isBoolean(Gt)?Yt.push(thunkMiddleware):Yt.push(thunkMiddleware.withExtraArgument(Gt.extraArgument))),Yt}var IS_PRODUCTION=!0;function configureStore(Bt){var Wt=curryGetDefaultMiddleware(),Gt=Bt||{},Yt=Gt.reducer,Xt=Yt===void 0?void 0:Yt,Jt=Gt.middleware,Zt=Jt===void 0?Wt():Jt,Qt=Gt.devTools,ur=Qt===void 0?!0:Qt,cr=Gt.preloadedState,$r=cr===void 0?void 0:cr,Ar=Gt.enhancers,Lr=Ar===void 0?void 0:Ar,qr;if(typeof Xt=="function")qr=Xt;else if(isPlainObject$2(Xt))qr=combineReducers(Xt);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var Fr=Zt;typeof Fr=="function"&&(Fr=Fr(Wt));var Hr=applyMiddleware.apply(void 0,Fr),Br=compose;ur&&(Br=composeWithDevTools(__spreadValues({trace:!IS_PRODUCTION},typeof ur=="object"&&ur)));var Wr=new EnhancerArray(Hr),Gr=Wr;Array.isArray(Lr)?Gr=__spreadArray([Hr],Lr):typeof Lr=="function"&&(Gr=Lr(Wr));var Kr=Br.apply(void 0,Gr);return createStore(qr,$r,Kr)}function createAction(Bt,Wt){function Gt(){for(var Yt=[],Xt=0;Xt<arguments.length;Xt++)Yt[Xt]=arguments[Xt];if(Wt){var Jt=Wt.apply(void 0,Yt);if(!Jt)throw new Error("prepareAction did not return an object");return __spreadValues(__spreadValues({type:Bt,payload:Jt.payload},"meta"in Jt&&{meta:Jt.meta}),"error"in Jt&&{error:Jt.error})}return{type:Bt,payload:Yt[0]}}return Gt.toString=function(){return""+Bt},Gt.type=Bt,Gt.match=function(Yt){return Yt.type===Bt},Gt}function executeReducerBuilderCallback(Bt){var Wt={},Gt=[],Yt,Xt={addCase:function(Jt,Zt){var Qt=typeof Jt=="string"?Jt:Jt.type;if(Qt in Wt)throw new Error("addCase cannot be called with two reducers for the same action type");return Wt[Qt]=Zt,Xt},addMatcher:function(Jt,Zt){return Gt.push({matcher:Jt,reducer:Zt}),Xt},addDefaultCase:function(Jt){return Yt=Jt,Xt}};return Bt(Xt),[Wt,Gt,Yt]}function isStateFunction(Bt){return typeof Bt=="function"}function createReducer(Bt,Wt,Gt,Yt){Gt===void 0&&(Gt=[]);var Xt=typeof Wt=="function"?executeReducerBuilderCallback(Wt):[Wt,Gt,Yt],Jt=Xt[0],Zt=Xt[1],Qt=Xt[2],ur;if(isStateFunction(Bt))ur=function(){return freezeDraftable(Bt())};else{var cr=freezeDraftable(Bt);ur=function(){return cr}}function $r(Ar,Lr){Ar===void 0&&(Ar=ur());var qr=__spreadArray([Jt[Lr.type]],Zt.filter(function(Fr){var Hr=Fr.matcher;return Hr(Lr)}).map(function(Fr){var Hr=Fr.reducer;return Hr}));return qr.filter(function(Fr){return!!Fr}).length===0&&(qr=[Qt]),qr.reduce(function(Fr,Hr){if(Hr)if(r(Fr)){var Br=Fr,Wr=Hr(Br,Lr);return Wr===void 0?Fr:Wr}else{if(t(Fr))return createNextState3(Fr,function(Gr){return Hr(Gr,Lr)});var Wr=Hr(Fr,Lr);if(Wr===void 0){if(Fr===null)return Fr;throw Error("A case reducer on a non-draftable value must not return undefined")}return Wr}return Fr},Ar)}return $r.getInitialState=ur,$r}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=function(Bt){Bt===void 0&&(Bt=21);for(var Wt="",Gt=Bt;Gt--;)Wt+=urlAlphabet[Math.random()*64|0];return Wt},commonProperties=["name","message","stack","code"],RejectWithValue=function(){function Bt(Wt,Gt){this.payload=Wt,this.meta=Gt}return Bt}(),FulfillWithMeta=function(){function Bt(Wt,Gt){this.payload=Wt,this.meta=Gt}return Bt}(),miniSerializeError=function(Bt){if(typeof Bt=="object"&&Bt!==null){for(var Wt={},Gt=0,Yt=commonProperties;Gt<Yt.length;Gt++){var Xt=Yt[Gt];typeof Bt[Xt]=="string"&&(Wt[Xt]=Bt[Xt])}return Wt}return{message:String(Bt)}};(function(){function Bt(Wt,Gt,Yt){var Xt=createAction(Wt+"/fulfilled",function(cr,$r,Ar,Lr){return{payload:cr,meta:__spreadProps(__spreadValues({},Lr||{}),{arg:Ar,requestId:$r,requestStatus:"fulfilled"})}}),Jt=createAction(Wt+"/pending",function(cr,$r,Ar){return{payload:void 0,meta:__spreadProps(__spreadValues({},Ar||{}),{arg:$r,requestId:cr,requestStatus:"pending"})}}),Zt=createAction(Wt+"/rejected",function(cr,$r,Ar,Lr,qr){return{payload:Lr,error:(Yt&&Yt.serializeError||miniSerializeError)(cr||"Rejected"),meta:__spreadProps(__spreadValues({},qr||{}),{arg:Ar,requestId:$r,rejectedWithValue:!!Lr,requestStatus:"rejected",aborted:(cr==null?void 0:cr.name)==="AbortError",condition:(cr==null?void 0:cr.name)==="ConditionError"})}}),Qt=typeof AbortController<"u"?AbortController:function(){function cr(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return cr.prototype.abort=function(){},cr}();function ur(cr){return function($r,Ar,Lr){var qr=Yt!=null&&Yt.idGenerator?Yt.idGenerator(cr):nanoid(),Fr=new Qt,Hr;function Br(Gr){Hr=Gr,Fr.abort()}var Wr=function(){return __async(this,null,function(){var Gr,Kr,Yr,hn,Qr,pn,En;return __generator(this,function(ga){switch(ga.label){case 0:return ga.trys.push([0,4,,5]),hn=(Gr=Yt==null?void 0:Yt.condition)==null?void 0:Gr.call(Yt,cr,{getState:Ar,extra:Lr}),isThenable(hn)?[4,hn]:[3,2];case 1:hn=ga.sent(),ga.label=2;case 2:if(hn===!1||Fr.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return Qr=new Promise(function(dn,Pr){return Fr.signal.addEventListener("abort",function(){return Pr({name:"AbortError",message:Hr||"Aborted"})})}),$r(Jt(qr,cr,(Kr=Yt==null?void 0:Yt.getPendingMeta)==null?void 0:Kr.call(Yt,{requestId:qr,arg:cr},{getState:Ar,extra:Lr}))),[4,Promise.race([Qr,Promise.resolve(Gt(cr,{dispatch:$r,getState:Ar,extra:Lr,requestId:qr,signal:Fr.signal,abort:Br,rejectWithValue:function(dn,Pr){return new RejectWithValue(dn,Pr)},fulfillWithValue:function(dn,Pr){return new FulfillWithMeta(dn,Pr)}})).then(function(dn){if(dn instanceof RejectWithValue)throw dn;return dn instanceof FulfillWithMeta?Xt(dn.payload,qr,cr,dn.meta):Xt(dn,qr,cr)})])];case 3:return Yr=ga.sent(),[3,5];case 4:return pn=ga.sent(),Yr=pn instanceof RejectWithValue?Zt(null,qr,cr,pn.payload,pn.meta):Zt(pn,qr,cr),[3,5];case 5:return En=Yt&&!Yt.dispatchConditionRejection&&Zt.match(Yr)&&Yr.meta.condition,En||$r(Yr),[2,Yr]}})})}();return Object.assign(Wr,{abort:Br,requestId:qr,arg:cr,unwrap:function(){return Wr.then(unwrapResult)}})}}return Object.assign(ur,{pending:Jt,rejected:Zt,fulfilled:Xt,typePrefix:Wt})}return Bt.withTypes=function(){return Bt},Bt})();function unwrapResult(Bt){if(Bt.meta&&Bt.meta.rejectedWithValue)throw Bt.payload;if(Bt.error)throw Bt.error;return Bt.payload}function isThenable(Bt){return Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"}var alm="listenerMiddleware";createAction(alm+"/add");createAction(alm+"/removeAll");createAction(alm+"/remove");var promise;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global$1<"u"?global$1:globalThis);F();const fetchWorldsRequest=createAction("[Request] Fetch Worlds"),fetchWorldsSuccess=createAction("[Success] Fetch Worlds"),fetchWorldsFailure=createAction("[Failure] Fetch Worlds"),getState=Bt=>Bt.world,getData$3=Bt=>getState(Bt).data,getLoading=Bt=>getState(Bt).loading,getActiveWorlds=createSelector([getData$3],Bt=>Bt.filter(Wt=>Wt.active)),hasAName=Bt=>getData$3(Bt).length>0,isLoadingWorlds=createSelector([getLoading],Bt=>isLoadingType_1(Bt,fetchWorldsRequest.type));var dist$9={},config$1={},env={},location$1={},hasRequiredLocation;function requireLocation(){if(hasRequiredLocation)return location$1;hasRequiredLocation=1,Object.defineProperty(location$1,"__esModule",{value:!0}),location$1.getEnvFromQueryParam=location$1.getEnvFromTLD=void 0;const Bt=requireEnv();function Wt(Yt){const{host:Xt}=Yt;return Xt.endsWith(".org")?Bt.Env.PRODUCTION:Xt.endsWith(".today")||Xt.endsWith(".net")?Bt.Env.STAGING:Xt.endsWith(".io")||Xt.endsWith(".zone")?Bt.Env.DEVELOPMENT:null}location$1.getEnvFromTLD=Wt;function Gt(Yt){const Xt=new URLSearchParams(Yt.search),Jt=Xt.get("ENV")||Xt.get("env");if(Jt){const Zt=Jt.toLowerCase();if((0,Bt.isEnv)(Zt))return Zt}return null}return location$1.getEnvFromQueryParam=Gt,location$1}var hasRequiredEnv;function requireEnv(){return hasRequiredEnv||(hasRequiredEnv=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getEnv=Bt.getDefaultEnv=Bt.parseEnvVar=Bt.isEnv=Bt.getEnvList=Bt.Env=void 0;const Wt=requireLocation();var Gt;(function(ur){ur.DEVELOPMENT="dev",ur.STAGING="stg",ur.PRODUCTION="prod"})(Gt=Bt.Env||(Bt.Env={}));function Yt(){return Object.values(Gt)}Bt.getEnvList=Yt;function Xt(ur){return Yt().includes(ur)}Bt.isEnv=Xt;function Jt(ur){if(Xt(ur))return ur;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${ur}", possible values are ${Yt().map(cr=>`"${cr}"`).join(", ")}.`)}Bt.parseEnvVar=Jt;function Zt(ur={}){const{DCL_DEFAULT_ENV:cr,REACT_APP_DCL_DEFAULT_ENV:$r,GATSBY_DCL_DEFAULT_ENV:Ar}=ur;if(cr&&$r&&cr!==$r)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(cr&&Ar&&cr!==Ar)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if($r&&Ar&&$r!==Ar)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return cr?Jt(cr):$r?Jt($r):Ar?Jt(Ar):Gt.PRODUCTION}Bt.getDefaultEnv=Zt;function Qt(ur={}){if(typeof window<"u"){const cr=(0,Wt.getEnvFromQueryParam)(window.location);if(cr)return cr;const $r=(0,Wt.getEnvFromTLD)(window.location);if($r)return $r}return Zt(ur)}Bt.getEnv=Qt}(env)),env}Object.defineProperty(config$1,"__esModule",{value:!0});config$1.createConfig=void 0;const env_1=requireEnv();function createConfig(Bt,Wt){const Gt=(0,env_1.getEnv)(Wt==null?void 0:Wt.systemEnvVariables),Yt=Bt[Gt];return{get:(Xt,Jt="")=>{if(!Yt)throw new Error(`Could not find a config for env=${Gt}`);return Xt in Yt?Yt[Xt]:Jt},is:Xt=>Gt===Xt,getEnv:()=>Gt}}config$1.createConfig=createConfig;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getEnv=Bt.Env=Bt.createConfig=void 0;var Wt=config$1;Object.defineProperty(Bt,"createConfig",{enumerable:!0,get:function(){return Wt.createConfig}});var Gt=requireEnv();Object.defineProperty(Bt,"Env",{enumerable:!0,get:function(){return Gt.Env}}),Object.defineProperty(Bt,"getEnv",{enumerable:!0,get:function(){return Gt.getEnv}})})(dist$9);const jumpIcon$1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZTbDYAgDEWLcQBHYBUncQZHcNK6gW5QMTFRCX0EwS9OQvwA7mnBANCoAREh8eBzbQfl8exMsE9hbJbKHnt83JEkQGvriXC0COQFcrgvJkiFm/ZbBFx4EYEUfs0jMT+DKtDCTXCCIuGcwBKuHo0iUCvnOj/pQWe9vqNzboUvSJXk7qvx2P0riO9gD2PIOSa47+pF3MHMLVQ4C1ugkcMBxwKeOw0CJyAAAAAASUVORK5CYII=",verifiedIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADgSURBVHgB7ZThDcIgEIVPJ+gIbKAjdAMdgQ3sCHUDN+gIdgNGqRvUDc4jnElTDw4hJv7ol1ya0uM9ehwAbNSCiBYDA4WhaCkcxUxxhBpYcMI4DkpgYb/yO+oMFGeKJlfcYjkfJdvDj5EMnlDOI8fgADrXHUHPcTV+Ss6iGl6Euvp2dIv3nnOlDku3rrxv2PG3XhF/M6YMOmGCFzKLHO1spA8fJdxiJhniFjQwXAUxZkxj1npSF5m4PeSdVsWgBpOV5TcKv7uLrFSeHKNGqfsEtWBo3Zn/puXVOh4zsPH3vAASSlzmB0KCVwAAAABJRU5ErkJggg==",worldIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFNSURBVHgB3VXRjYMwDLU6ASNkg+M24DZgA7IBbFA2KLdBN6Ab3AjoJsgIdAM3UWNhXJNQPvskCyXP8YvtJAB8NBCx8Ga9jd4cLpjiXANH4RfX3mbMw70t5BdcWIA/b603w/hBETrvDX6OC8LuuwQf0AQfNr7kglsWvBScibUn9IwrcSlnnRJw0Unb+ZXVvFL4jm2uSO3ebYgTjJLZILKzWoCR6qpwRhPH50nTcCOfE/M38fsP+0En59fbj7fvOP568SRpLUpsYsCUWyPnTrAPdKLucBT8BOH6UlWMa9i8lVltZUrkKBo14/qpuG5sSBO9aQJWBCeEQL3wrYjLiXKyYIG7OH69MOtSzGyu1UTlwpplUEICuO5ZyTJOv6y4vJTqY8f8KqVXPexBcBQ9aHhG+LzZrejVAO8gNt1hHkGkhqPA5Zc5iazGyBXw0XgAE10YEF/OlCgAAAAASUVORK5CYII=",NETWORK$2="goerli",CHAIN_ID$2="5",PEER_URL$2="https://peer-ap1.decentraland.zone",MARKETPLACE_GRAPH_URL$2="https://api.thegraph.com/subgraphs/name/decentraland/marketplace-goerli",WORLDS_CONTENT_SERVER_URL$3="https://worlds-content-server.decentraland.zone",EXPLORER_URL$3="https://play.decentraland.zone",BUILDER_URL$3="https://builder.decentraland.zone",dev={NETWORK:NETWORK$2,CHAIN_ID:CHAIN_ID$2,PEER_URL:PEER_URL$2,MARKETPLACE_GRAPH_URL:MARKETPLACE_GRAPH_URL$2,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$3,EXPLORER_URL:EXPLORER_URL$3,BUILDER_URL:BUILDER_URL$3},NETWORK$1="mainnet",CHAIN_ID$1="1",PEER_URL$1="https://peer.decentraland.org",MARKETPLACE_GRAPH_URL$1="https://api.thegraph.com/subgraphs/name/decentraland/marketplace-goerli",WORLDS_CONTENT_SERVER_URL$2="https://worlds-content-server.decentraland.zone",EXPLORER_URL$2="https://play.decentraland.zone",BUILDER_URL$2="https://builder.decentraland.zone",prod={NETWORK:NETWORK$1,CHAIN_ID:CHAIN_ID$1,PEER_URL:PEER_URL$1,MARKETPLACE_GRAPH_URL:MARKETPLACE_GRAPH_URL$1,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$2,EXPLORER_URL:EXPLORER_URL$2,BUILDER_URL:BUILDER_URL$2},NETWORK="mainnet",CHAIN_ID="1",PEER_URL="https://peer.decentraland.org",MARKETPLACE_GRAPH_URL="https://api.thegraph.com/subgraphs/name/decentraland/marketplace",WORLDS_CONTENT_SERVER_URL$1="https://worlds-content-server.decentraland.org",EXPLORER_URL$1="https://play.decentraland.org",BUILDER_URL$1="https://builder.decentraland.org",stg={NETWORK,CHAIN_ID,PEER_URL,MARKETPLACE_GRAPH_URL,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$1,EXPLORER_URL:EXPLORER_URL$1,BUILDER_URL:BUILDER_URL$1},config=dist$9.createConfig({[dist$9.Env.DEVELOPMENT]:dev,[dist$9.Env.STAGING]:stg,[dist$9.Env.PRODUCTION]:prod},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});console.log({}.VITE_REACT_APP_DCL_DEFAULT_ENV);const jumpIcon="_jumpIcon_lxozy_2",worldItem="_worldItem_lxozy_7",worldDropdown="_worldDropdown_lxozy_12",worldButton="_worldButton_lxozy_25",smallButton$1="_smallButton_lxozy_29",styles$2={jumpIcon,worldItem,worldDropdown,worldButton,smallButton:smallButton$1},EXPLORER_URL=config.get("EXPLORER_URL"),BUILDER_URL=config.get("BUILDER_URL"),WORLDS_CONTENT_SERVER_URL=config.get("WORLDS_CONTENT_SERVER_URL"),isDevelopment=config.getEnv()===dist$9.Env.DEVELOPMENT,WorldsButton$1=Bt=>{const{address:Wt,isLoading:Gt,className:Yt,hasNames:Xt,worlds:Jt,onFetchWorlds:Zt}=Bt,Qt=Jt.length>0,ur=reactExports.useCallback($r=>{window.open(isDevelopment?`${EXPLORER_URL}/?realm=${WORLDS_CONTENT_SERVER_URL}/world/${$r.domain}&NETWORK=goerli`:`${EXPLORER_URL}/world/${$r.domain}`,"_blank,noreferrer")},[]),cr=reactExports.useCallback(()=>{Xt?Xt&&!Qt&&window.open(`${BUILDER_URL}/worlds`,"_blank,noreferrer"):window.open(`${BUILDER_URL}/names`,"_blank,noreferrer")},[Xt,Qt]);return reactExports.useEffect(()=>{Zt(Wt)},[Wt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Dropdown$4.Dropdown,{className:classNames(Yt,styles$2.worldDropdown),direction:"left",open:!Xt||Xt&&!Qt?!1:void 0,trigger:jsxRuntimeExports.jsx(Button$3.Button,{primary:!0,disabled:Gt,loading:Gt,onClick:cr,className:classNames(Yt,styles$2.worldButton,"customIconButton",{[styles$2.smallButton]:Gt||Qt&&Xt},styles$2.actionButton),children:!Xt&&!Gt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:verifiedIcon})," ",t_1("worlds_button.get_a_name")]}):Xt&&!Qt&&!Gt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:worldIcon})," ",t_1("worlds_button.activate_world")]}):Qt&&!Gt?jsxRuntimeExports.jsx("img",{src:worldIcon}):null}),children:jsxRuntimeExports.jsx(Dropdown$4.Dropdown.Menu,{className:styles$2.worldDropdown,children:Jt.map($r=>jsxRuntimeExports.jsxs(Dropdown$4.Dropdown.Item,{styles:styles$2.worldItem,onClick:()=>ur($r),children:[jsxRuntimeExports.jsx("img",{src:jumpIcon$1,className:styles$2.jumpIcon})," ",t_1("worlds_button.jump",{domain:$r.domain})]},$r.domain))})})})},mapState$1=Bt=>({worlds:getActiveWorlds(Bt),hasNames:hasAName(Bt),isLoading:isLoadingWorlds(Bt)}),mapDispatch=Bt=>bindActionCreators({onFetchWorlds:fetchWorldsRequest},Bt),WorldsButton=connect(mapState$1,mapDispatch)(WorldsButton$1),ProfileInformation$1="_ProfileInformation_1ahco_1",actions$4="_actions_1ahco_9",basicRow="_basicRow_1ahco_16",basicCenteredRow="_basicCenteredRow_1ahco_22",description$2="_description_1ahco_26",userName="_userName_1ahco_30",userNumber="_userNumber_1ahco_36",profileData="_profileData_1ahco_40",wallet="_wallet_1ahco_47",smallButton="_smallButton_1ahco_54",fluidButton="_fluidButton_1ahco_73",Profile="_Profile_1ahco_1",inline="_inline_1ahco_78",dcl="_dcl_1ahco_78",blockie="_blockie_1ahco_78",styles$1={ProfileInformation:ProfileInformation$1,actions:actions$4,basicRow,basicCenteredRow,description:description$2,userName,userNumber,profileData,wallet,smallButton,fluidButton,Profile,inline,dcl,blockie},ProfileInformation=()=>jsxRuntimeExports.jsxs("div",{className:styles$1.ProfileInformation,children:[jsxRuntimeExports.jsxs("div",{className:styles$1.basicRow,children:[jsxRuntimeExports.jsx(Profile_2,{size:"massive",imageOnly:!0,address:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsxs("div",{className:styles$1.profileData,children:[jsxRuntimeExports.jsxs("span",{className:styles$1.userNumber,children:[jsxRuntimeExports.jsx("span",{className:styles$1.userName,children:"Florencia"}),"  #222"]}),jsxRuntimeExports.jsxs("div",{className:styles$1.wallet,children:[jsxRuntimeExports.jsx("img",{src:Wallet,className:"iconSize"}),jsxRuntimeExports.jsx(Profile_2,{textOnly:!0,address:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsx("img",{src:Copy,className:"iconSize"})]}),jsxRuntimeExports.jsxs("div",{className:styles$1.basicCenteredRow,children:[jsxRuntimeExports.jsx("img",{src:People,className:"iconSize"}),"  714 ",t_1("profile_information.friends")]}),jsxRuntimeExports.jsx("span",{className:styles$1.description,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$1.actions,children:[jsxRuntimeExports.jsx(WorldsButton,{address:"0xeDaE96F7739aF8A7fB16E2a888C1E578E1328299"}),jsxRuntimeExports.jsx(Button$3.Button,{primary:!0,className:styles$1.smallButton,children:jsxRuntimeExports.jsx("img",{src:Share,className:"iconSize"})}),jsxRuntimeExports.jsx(Button$3.Button,{inverted:!0,className:styles$1.smallButton,children:jsxRuntimeExports.jsx(default_1$2,{name:"ellipsis horizontal"})})]})]}),MainPage$1="_MainPage_t4kaq_6",infoContainer="_infoContainer_t4kaq_15",tab="_tab_t4kaq_26",styles={MainPage:MainPage$1,infoContainer,tab};function MainPage(){const Bt=[{displayValue:t_1("tabs.overview"),value:t_1("tabs.overview")}],[Wt,Gt]=reactExports.useState(Bt[0].value),Yt=reactExports.useCallback(Xt=>{Gt(Xt)},[Gt]);return jsxRuntimeExports.jsx(PageLayout,{children:jsxRuntimeExports.jsxs("div",{className:styles.MainPage,children:[Wt===Bt[0].value&&jsxRuntimeExports.jsx(Avatar,{}),jsxRuntimeExports.jsxs("div",{className:styles.infoContainer,children:[jsxRuntimeExports.jsx(ProfileInformation,{}),jsxRuntimeExports.jsx(default_1$1,{}),jsxRuntimeExports.jsx(Tabs_2,{children:Bt.map(Xt=>jsxRuntimeExports.jsx(Tabs_2.Tab,{active:Wt===Xt.value,onClick:()=>Yt(Xt.value),children:jsxRuntimeExports.jsx("span",{className:styles.tab,children:Xt.displayValue})},Xt.value))}),jsxRuntimeExports.jsx("div",{children:"content"})]})]})})}const SignInPage$1=Bt=>{const{isConnected:Wt}=Bt,[Gt]=useSearchParams(),Yt=Gt.get("redirectTo"),Xt=useNavigate();return reactExports.useEffect(()=>{Yt&&Wt&&Xt(decodeURIComponent(Yt))},[Yt,Wt,Xt]),jsxRuntimeExports.jsx(PageLayout,{children:jsxRuntimeExports.jsx(_default$3,{})})},mapState=Bt=>({isConnected:selectors$4.isConnected(Bt)}),SignInPage=connect(mapState)(SignInPage$1);var dist$8={},fetcher$1={},__createBinding$5=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$5=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$5=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$5(Wt,Bt,Gt);return __setModuleDefault$5(Wt,Bt),Wt},__rest=commonjsGlobal&&commonjsGlobal.__rest||function(Bt,Wt){var Gt={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Wt.indexOf(Yt)<0&&(Gt[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Yt=Object.getOwnPropertySymbols(Bt);Xt<Yt.length;Xt++)Wt.indexOf(Yt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[Xt])&&(Gt[Yt[Xt]]=Bt[Yt[Xt]]);return Gt};Object.defineProperty(fetcher$1,"__esModule",{value:!0});fetcher$1.createFetchComponent=void 0;const crossFetch=__importStar$5(browserPonyfillExports),NON_RETRYABLE_STATUS_CODES=[400,401,403,404],IDEMPOTENT_HTTP_METHODS=["GET","HEAD","OPTIONS","PUT","DELETE"];async function fetchWithRetriesAndTimeout(Bt,Wt){const{timeout:Gt,abortController:Yt,signal:Xt,retryDelay:Jt}=Wt;let Zt=Wt.attempts,Qt=null,ur;do try{Gt&&(Qt=setTimeout(()=>{Yt.abort()},Gt));const cr=crossFetch.default(Bt.toString(),Object.assign(Object.assign({},Wt),{signal:Xt})),$r=Promise.race([cr,new Promise((Ar,Lr)=>{Xt.addEventListener("abort",()=>{Ar(new crossFetch.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--Zt,ur=await $r,Qt&&clearTimeout(Qt)}finally{if(ur&&(ur.ok||NON_RETRYABLE_STATUS_CODES.includes(ur.status)||Zt===0))break;await new Promise(cr=>setTimeout(cr,Jt))}while((!ur||!ur.ok)&&Zt>0);return ur}function createFetchComponent(Bt){async function Wt(Gt,Yt){const Jt=Object.assign(Object.assign({},Bt==null?void 0:Bt.defaultFetcherOptions),Yt)||{},{timeout:Zt,method:Qt="GET",retryDelay:ur=0,abortController:cr}=Jt,$r=__rest(Jt,["timeout","method","retryDelay","abortController"]);let Ar=$r.attempts||1;const Lr=cr||new AbortController,{signal:qr}=Lr;Bt!=null&&Bt.defaultHeaders&&($r.headers=Object.assign(Object.assign({},Bt==null?void 0:Bt.defaultHeaders),$r.headers||{})),IDEMPOTENT_HTTP_METHODS.includes(Qt.toUpperCase())||(Ar=1);const Fr=await fetchWithRetriesAndTimeout(Gt,Object.assign(Object.assign({},$r),{attempts:Ar,method:Qt,timeout:Zt,retryDelay:ur,signal:qr,abortController:Lr}));if(!(Fr!=null&&Fr.ok)){const Hr=await(Fr==null?void 0:Fr.text());throw new Error(`Failed to fetch ${Gt}. Got status ${Fr==null?void 0:Fr.status}. Response was '${Hr}'`)}return qr.aborted?void 0:Fr}return{fetch:Wt}}fetcher$1.createFetchComponent=createFetchComponent;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createFetchComponent=void 0;var Wt=fetcher$1;Object.defineProperty(Bt,"createFetchComponent",{enumerable:!0,get:function(){return Wt.createFetchComponent}})})(dist$8);var dist$7={},CatalystClient={},ContentClient={},dist$6={},node={};const require$$1$5=getAugmentedNamespace(src$b);async function*batch$1(Bt,Wt=1){let Gt=[];Wt<1&&(Wt=1);for await(const Yt of Bt)for(Gt.push(Yt);Gt.length>=Wt;)yield Gt.slice(0,Wt),Gt=Gt.slice(Wt);for(;Gt.length;)yield Gt.slice(0,Wt),Gt=Gt.slice(Wt)}var itBatch=batch$1;const batch=itBatch;async function*parallelBatch$1(Bt,Wt=1){for await(const Gt of batch(Bt,Wt)){const Yt=Gt.map(Xt=>Xt().then(Jt=>({ok:!0,value:Jt}),Jt=>({ok:!1,err:Jt})));for(let Xt=0;Xt<Yt.length;Xt++){const Jt=await Yt[Xt];if(Jt.ok)yield Jt.value;else throw Jt.err}}}var itParallelBatch=parallelBatch$1,isPlainObj=Bt=>{if(Object.prototype.toString.call(Bt)!=="[object Object]")return!1;const Wt=Object.getPrototypeOf(Bt);return Wt===null||Wt===Object.prototype};const isOptionObject=isPlainObj,{hasOwnProperty:hasOwnProperty$6}=Object.prototype,{propertyIsEnumerable}=Object,defineProperty=(Bt,Wt,Gt)=>Object.defineProperty(Bt,Wt,{value:Gt,writable:!0,enumerable:!0,configurable:!0}),globalThis$1=commonjsGlobal,defaultMergeOptions={concatArrays:!1,ignoreUndefined:!1},getEnumerableOwnPropertyKeys=Bt=>{const Wt=[];for(const Gt in Bt)hasOwnProperty$6.call(Bt,Gt)&&Wt.push(Gt);if(Object.getOwnPropertySymbols){const Gt=Object.getOwnPropertySymbols(Bt);for(const Yt of Gt)propertyIsEnumerable.call(Bt,Yt)&&Wt.push(Yt)}return Wt};function clone$1(Bt){return Array.isArray(Bt)?cloneArray$1(Bt):isOptionObject(Bt)?cloneOptionObject(Bt):Bt}function cloneArray$1(Bt){const Wt=Bt.slice(0,0);return getEnumerableOwnPropertyKeys(Bt).forEach(Gt=>{defineProperty(Wt,Gt,clone$1(Bt[Gt]))}),Wt}function cloneOptionObject(Bt){const Wt=Object.getPrototypeOf(Bt)===null?Object.create(null):{};return getEnumerableOwnPropertyKeys(Bt).forEach(Gt=>{defineProperty(Wt,Gt,clone$1(Bt[Gt]))}),Wt}const mergeKeys=(Bt,Wt,Gt,Yt)=>(Gt.forEach(Xt=>{typeof Wt[Xt]>"u"&&Yt.ignoreUndefined||(Xt in Bt&&Bt[Xt]!==Object.getPrototypeOf(Bt)?defineProperty(Bt,Xt,merge$1(Bt[Xt],Wt[Xt],Yt)):defineProperty(Bt,Xt,clone$1(Wt[Xt])))}),Bt),concatArrays=(Bt,Wt,Gt)=>{let Yt=Bt.slice(0,0),Xt=0;return[Bt,Wt].forEach(Jt=>{const Zt=[];for(let Qt=0;Qt<Jt.length;Qt++)hasOwnProperty$6.call(Jt,Qt)&&(Zt.push(String(Qt)),Jt===Bt?defineProperty(Yt,Xt++,Jt[Qt]):defineProperty(Yt,Xt++,clone$1(Jt[Qt])));Yt=mergeKeys(Yt,Jt,getEnumerableOwnPropertyKeys(Jt).filter(Qt=>!Zt.includes(Qt)),Gt)}),Yt};function merge$1(Bt,Wt,Gt){return Gt.concatArrays&&Array.isArray(Bt)&&Array.isArray(Wt)?concatArrays(Bt,Wt,Gt):!isOptionObject(Wt)||!isOptionObject(Bt)?clone$1(Wt):mergeKeys(Bt,Wt,getEnumerableOwnPropertyKeys(Wt),Gt)}var mergeOptions$1=function(...Bt){const Wt=merge$1(clone$1(defaultMergeOptions),this!==globalThis$1&&this||{},defaultMergeOptions);let Gt={_:{}};for(const Yt of Bt)if(Yt!==void 0){if(!isOptionObject(Yt))throw new TypeError("`"+Yt+"` is not an Option Object");Gt=merge$1(Gt,{_:Yt},Wt)}return Gt._};function assign(Bt,Wt){for(const Gt in Wt)Object.defineProperty(Bt,Gt,{value:Wt[Gt],enumerable:!0,configurable:!0});return Bt}function createError$1(Bt,Wt,Gt){if(!Bt||typeof Bt=="string")throw new TypeError("Please pass an Error to err-code");Gt||(Gt={}),typeof Wt=="object"&&(Gt=Wt,Wt=""),Wt&&(Gt.code=Wt);try{return assign(Bt,Gt)}catch{Gt.message=Bt.message,Gt.stack=Bt.stack;const Xt=function(){};return Xt.prototype=Object.create(Object.getPrototypeOf(Bt)),assign(new Xt,Gt)}}var errCode=createError$1,src$a={exports:{}};function base$1(Bt){if(Bt.length>=255)throw new TypeError("Alphabet too long");for(var Wt=new Uint8Array(256),Gt=0;Gt<Wt.length;Gt++)Wt[Gt]=255;for(var Yt=0;Yt<Bt.length;Yt++){var Xt=Bt.charAt(Yt),Jt=Xt.charCodeAt(0);if(Wt[Jt]!==255)throw new TypeError(Xt+" is ambiguous");Wt[Jt]=Yt}var Zt=Bt.length,Qt=Bt.charAt(0),ur=Math.log(Zt)/Math.log(256),cr=Math.log(256)/Math.log(Zt);function $r(qr){if(qr instanceof Uint8Array||(ArrayBuffer.isView(qr)?qr=new Uint8Array(qr.buffer,qr.byteOffset,qr.byteLength):Array.isArray(qr)&&(qr=Uint8Array.from(qr))),!(qr instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(qr.length===0)return"";for(var Fr=0,Hr=0,Br=0,Wr=qr.length;Br!==Wr&&qr[Br]===0;)Br++,Fr++;for(var Gr=(Wr-Br)*cr+1>>>0,Kr=new Uint8Array(Gr);Br!==Wr;){for(var Yr=qr[Br],hn=0,Qr=Gr-1;(Yr!==0||hn<Hr)&&Qr!==-1;Qr--,hn++)Yr+=256*Kr[Qr]>>>0,Kr[Qr]=Yr%Zt>>>0,Yr=Yr/Zt>>>0;if(Yr!==0)throw new Error("Non-zero carry");Hr=hn,Br++}for(var pn=Gr-Hr;pn!==Gr&&Kr[pn]===0;)pn++;for(var En=Qt.repeat(Fr);pn<Gr;++pn)En+=Bt.charAt(Kr[pn]);return En}function Ar(qr){if(typeof qr!="string")throw new TypeError("Expected String");if(qr.length===0)return new Uint8Array;var Fr=0;if(qr[Fr]!==" "){for(var Hr=0,Br=0;qr[Fr]===Qt;)Hr++,Fr++;for(var Wr=(qr.length-Fr)*ur+1>>>0,Gr=new Uint8Array(Wr);qr[Fr];){var Kr=Wt[qr.charCodeAt(Fr)];if(Kr===255)return;for(var Yr=0,hn=Wr-1;(Kr!==0||Yr<Br)&&hn!==-1;hn--,Yr++)Kr+=Zt*Gr[hn]>>>0,Gr[hn]=Kr%256>>>0,Kr=Kr/256>>>0;if(Kr!==0)throw new Error("Non-zero carry");Br=Yr,Fr++}if(qr[Fr]!==" "){for(var Qr=Wr-Br;Qr!==Wr&&Gr[Qr]===0;)Qr++;for(var pn=new Uint8Array(Hr+(Wr-Qr)),En=Hr;Qr!==Wr;)pn[En++]=Gr[Qr++];return pn}}}function Lr(qr){var Fr=Ar(qr);if(Fr)return Fr;throw new Error("Non-base"+Zt+" character")}return{encode:$r,decodeUnsafe:Ar,decode:Lr}}var src$9=base$1;const textDecoder=new TextDecoder,decodeText$1=Bt=>textDecoder.decode(Bt),textEncoder=new TextEncoder,encodeText$2=Bt=>textEncoder.encode(Bt);function concat(Bt,Wt){const Gt=new Uint8Array(Wt);let Yt=0;for(const Xt of Bt)Gt.set(Xt,Yt),Yt+=Xt.length;return Gt}var util$5={decodeText:decodeText$1,encodeText:encodeText$2,concat};const{encodeText:encodeText$1}=util$5;let Base$1=class{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.code=Gt,this.codeBuf=encodeText$1(this.code),this.alphabet=Xt,this.codec=Yt(Xt)}encode(Wt){return this.codec.encode(Wt)}decode(Wt){for(const Gt of Wt)if(this.alphabet&&this.alphabet.indexOf(Gt)<0)throw new Error(`invalid character '${Gt}' in '${Wt}'`);return this.codec.decode(Wt)}};var base=Base$1;const decode$3=(Bt,Wt,Gt)=>{const Yt={};for(let cr=0;cr<Wt.length;++cr)Yt[Wt[cr]]=cr;let Xt=Bt.length;for(;Bt[Xt-1]==="=";)--Xt;const Jt=new Uint8Array(Xt*Gt/8|0);let Zt=0,Qt=0,ur=0;for(let cr=0;cr<Xt;++cr){const $r=Yt[Bt[cr]];if($r===void 0)throw new SyntaxError("Invalid character "+Bt[cr]);Qt=Qt<<Gt|$r,Zt+=Gt,Zt>=8&&(Zt-=8,Jt[ur++]=255&Qt>>Zt)}if(Zt>=Gt||255&Qt<<8-Zt)throw new SyntaxError("Unexpected end of data");return Jt},encode$3=(Bt,Wt,Gt)=>{const Yt=Wt[Wt.length-1]==="=",Xt=(1<<Gt)-1;let Jt="",Zt=0,Qt=0;for(let ur=0;ur<Bt.length;++ur)for(Qt=Qt<<8|Bt[ur],Zt+=8;Zt>Gt;)Zt-=Gt,Jt+=Wt[Xt&Qt>>Zt];if(Zt&&(Jt+=Wt[Xt&Qt<<Gt-Zt]),Yt)for(;Jt.length*Gt&7;)Jt+="=";return Jt},rfc4648$1=Bt=>Wt=>({encode(Gt){return encode$3(Gt,Wt,Bt)},decode(Gt){return decode$3(Gt,Wt,Bt)}});var rfc4648_1={rfc4648:rfc4648$1};const baseX=src$9,Base=base,{rfc4648}=rfc4648_1,{decodeText,encodeText}=util$5,identity$2=()=>({encode:decodeText,decode:encodeText}),constants$1=[["identity","\0",identity$2,""],["base2","0",rfc4648(1),"01"],["base8","7",rfc4648(3),"01234567"],["base10","9",baseX,"0123456789"],["base16","f",rfc4648(4),"0123456789abcdef"],["base16upper","F",rfc4648(4),"0123456789ABCDEF"],["base32hex","v",rfc4648(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",rfc4648(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",rfc4648(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",rfc4648(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",rfc4648(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",rfc4648(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",rfc4648(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",rfc4648(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",rfc4648(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",baseX,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",baseX,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],names$2=constants$1.reduce((Bt,Wt)=>(Bt[Wt[0]]=new Base(Wt[0],Wt[1],Wt[2],Wt[3]),Bt),{}),codes$1=constants$1.reduce((Bt,Wt)=>(Bt[Wt[1]]=names$2[Wt[0]],Bt),{});var constants_1={names:names$2,codes:codes$1};(function(Bt,Wt){const Gt=constants_1,{encodeText:Yt,decodeText:Xt,concat:Jt}=util$5;function Zt(Hr,Br){if(!Br)throw new Error("requires an encoded Uint8Array");const{name:Wr,codeBuf:Gr}=Ar(Hr);return $r(Wr,Br),Jt([Gr,Br],Gr.length+Br.length)}function Qt(Hr,Br){const Wr=Ar(Hr),Gr=Yt(Wr.encode(Br));return Jt([Wr.codeBuf,Gr],Wr.codeBuf.length+Gr.length)}function ur(Hr){Hr instanceof Uint8Array&&(Hr=Xt(Hr));const Br=Hr[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(Br)&&(Hr=Hr.toLowerCase()),Ar(Hr[0]).decode(Hr.substring(1))}function cr(Hr){if(Hr instanceof Uint8Array&&(Hr=Xt(Hr)),Object.prototype.toString.call(Hr)!=="[object String]")return!1;try{return Ar(Hr[0]).name}catch{return!1}}function $r(Hr,Br){Ar(Hr).decode(Xt(Br))}function Ar(Hr){if(Object.prototype.hasOwnProperty.call(Gt.names,Hr))return Gt.names[Hr];if(Object.prototype.hasOwnProperty.call(Gt.codes,Hr))return Gt.codes[Hr];throw new Error(`Unsupported encoding: ${Hr}`)}function Lr(Hr){return Hr instanceof Uint8Array&&(Hr=Xt(Hr)),Ar(Hr[0])}Wt=Bt.exports=Zt,Wt.encode=Qt,Wt.decode=ur,Wt.isEncoded=cr,Wt.encoding=Ar,Wt.encodingFromData=Lr;const qr=Object.freeze(Gt.names),Fr=Object.freeze(Gt.codes);Wt.names=qr,Wt.codes=Fr})(src$a,src$a.exports);var srcExports=src$a.exports,encode_1$1=encode$2,MSB$1=128,REST$1=127,MSBALL=~REST$1,INT=Math.pow(2,31);function encode$2(Bt,Wt,Gt){Wt=Wt||[],Gt=Gt||0;for(var Yt=Gt;Bt>=INT;)Wt[Gt++]=Bt&255|MSB$1,Bt/=128;for(;Bt&MSBALL;)Wt[Gt++]=Bt&255|MSB$1,Bt>>>=7;return Wt[Gt]=Bt|0,encode$2.bytes=Gt-Yt+1,Wt}var decode$2=read,MSB=128,REST=127;function read(Bt,Yt){var Gt=0,Yt=Yt||0,Xt=0,Jt=Yt,Zt,Qt=Bt.length;do{if(Jt>=Qt)throw read.bytes=0,new RangeError("Could not decode varint");Zt=Bt[Jt++],Gt+=Xt<28?(Zt&REST)<<Xt:(Zt&REST)*Math.pow(2,Xt),Xt+=7}while(Zt>=MSB);return read.bytes=Jt-Yt,Gt}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$1=function(Bt){return Bt<N1?1:Bt<N2?2:Bt<N3?3:Bt<N4?4:Bt<N5?5:Bt<N6?6:Bt<N7?7:Bt<N8?8:Bt<N9?9:10},varint$2={encode:encode_1$1,decode:decode$2,encodingLength:length$1};const names$1=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});var constants={names:names$1};const require$$5$1=getAugmentedNamespace(toString$a),require$$1$4=getAugmentedNamespace(fromString$1),require$$1$3=getAugmentedNamespace(concat$4),multibase=srcExports,varint$1=varint$2,{names}=constants,{toString:uint8ArrayToString}=require$$5$1,{fromString:uint8ArrayFromString$1}=require$$1$4,{concat:uint8ArrayConcat}=require$$1$3,codes={};for(const Bt in names){const Wt=Bt;codes[names[Wt]]=Wt}Object.freeze(codes);function toHexString(Bt){if(!(Bt instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return uint8ArrayToString(Bt,"base16")}function fromHexString(Bt){return uint8ArrayFromString$1(Bt,"base16")}function toB58String(Bt){if(!(Bt instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return uint8ArrayToString(multibase.encode("base58btc",Bt)).slice(1)}function fromB58String(Bt){const Wt=Bt instanceof Uint8Array?uint8ArrayToString(Bt):Bt;return multibase.decode("z"+Wt)}function decode$1(Bt){if(!(Bt instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(Bt.length<2)throw new Error("multihash too short. must be > 2 bytes.");const Wt=varint$1.decode(Bt);if(!isValidCode(Wt))throw new Error(`multihash unknown function code: 0x${Wt.toString(16)}`);Bt=Bt.slice(varint$1.decode.bytes);const Gt=varint$1.decode(Bt);if(Gt<0)throw new Error(`multihash invalid length: ${Gt}`);if(Bt=Bt.slice(varint$1.decode.bytes),Bt.length!==Gt)throw new Error(`multihash length inconsistent: 0x${uint8ArrayToString(Bt,"base16")}`);return{code:Wt,name:codes[Wt],length:Gt,digest:Bt}}function encode$1(Bt,Wt,Gt){if(!Bt||Wt===void 0)throw new Error("multihash encode requires at least two args: digest, code");const Yt=coerceCode(Wt);if(!(Bt instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(Gt==null&&(Gt=Bt.length),Gt&&Bt.length!==Gt)throw new Error("digest length should be equal to specified length.");const Xt=varint$1.encode(Yt),Jt=varint$1.encode(Gt);return uint8ArrayConcat([Xt,Jt,Bt],Xt.length+Jt.length+Bt.length)}function coerceCode(Bt){let Wt=Bt;if(typeof Bt=="string"){if(names[Bt]===void 0)throw new Error(`Unrecognized hash function named: ${Bt}`);Wt=names[Bt]}if(typeof Wt!="number")throw new Error(`Hash function code should be a number. Got: ${Wt}`);if(codes[Wt]===void 0&&!isAppCode(Wt))throw new Error(`Unrecognized function code: ${Wt}`);return Wt}function isAppCode(Bt){return Bt>0&&Bt<16}function isValidCode(Bt){return!!(isAppCode(Bt)||codes[Bt])}function validate(Bt){decode$1(Bt)}function prefix(Bt){return validate(Bt),Bt.subarray(0,2)}var src$8={names,codes,toHexString,fromHexString,toB58String,fromB58String,decode:decode$1,encode:encode$1,coerceCode,isAppCode,validate,prefix,isValidCode},murmurHash3js={exports:{}};(function(Bt,Wt){(function(Gt,Yt){var Xt={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function Jt(Hr){if(!Array.isArray(Hr)&&!ArrayBuffer.isView(Hr))return!1;for(var Br=0;Br<Hr.length;Br++)if(!Number.isInteger(Hr[Br])||Hr[Br]<0||Hr[Br]>255)return!1;return!0}function Zt(Hr,Br){return(Hr&65535)*Br+(((Hr>>>16)*Br&65535)<<16)}function Qt(Hr,Br){return Hr<<Br|Hr>>>32-Br}function ur(Hr){return Hr^=Hr>>>16,Hr=Zt(Hr,2246822507),Hr^=Hr>>>13,Hr=Zt(Hr,3266489909),Hr^=Hr>>>16,Hr}function cr(Hr,Br){Hr=[Hr[0]>>>16,Hr[0]&65535,Hr[1]>>>16,Hr[1]&65535],Br=[Br[0]>>>16,Br[0]&65535,Br[1]>>>16,Br[1]&65535];var Wr=[0,0,0,0];return Wr[3]+=Hr[3]+Br[3],Wr[2]+=Wr[3]>>>16,Wr[3]&=65535,Wr[2]+=Hr[2]+Br[2],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[1]+=Hr[1]+Br[1],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[0]+=Hr[0]+Br[0],Wr[0]&=65535,[Wr[0]<<16|Wr[1],Wr[2]<<16|Wr[3]]}function $r(Hr,Br){Hr=[Hr[0]>>>16,Hr[0]&65535,Hr[1]>>>16,Hr[1]&65535],Br=[Br[0]>>>16,Br[0]&65535,Br[1]>>>16,Br[1]&65535];var Wr=[0,0,0,0];return Wr[3]+=Hr[3]*Br[3],Wr[2]+=Wr[3]>>>16,Wr[3]&=65535,Wr[2]+=Hr[2]*Br[3],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[2]+=Hr[3]*Br[2],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[1]+=Hr[1]*Br[3],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[1]+=Hr[2]*Br[2],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[1]+=Hr[3]*Br[1],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[0]+=Hr[0]*Br[3]+Hr[1]*Br[2]+Hr[2]*Br[1]+Hr[3]*Br[0],Wr[0]&=65535,[Wr[0]<<16|Wr[1],Wr[2]<<16|Wr[3]]}function Ar(Hr,Br){return Br%=64,Br===32?[Hr[1],Hr[0]]:Br<32?[Hr[0]<<Br|Hr[1]>>>32-Br,Hr[1]<<Br|Hr[0]>>>32-Br]:(Br-=32,[Hr[1]<<Br|Hr[0]>>>32-Br,Hr[0]<<Br|Hr[1]>>>32-Br])}function Lr(Hr,Br){return Br%=64,Br===0?Hr:Br<32?[Hr[0]<<Br|Hr[1]>>>32-Br,Hr[1]<<Br]:[Hr[1]<<Br-32,0]}function qr(Hr,Br){return[Hr[0]^Br[0],Hr[1]^Br[1]]}function Fr(Hr){return Hr=qr(Hr,[0,Hr[0]>>>1]),Hr=$r(Hr,[4283543511,3981806797]),Hr=qr(Hr,[0,Hr[0]>>>1]),Hr=$r(Hr,[3301882366,444984403]),Hr=qr(Hr,[0,Hr[0]>>>1]),Hr}Xt.x86.hash32=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%4,Gr=Hr.length-Wr,Kr=Br,Yr=0,hn=3432918353,Qr=461845907,pn=0;pn<Gr;pn=pn+4)Yr=Hr[pn]|Hr[pn+1]<<8|Hr[pn+2]<<16|Hr[pn+3]<<24,Yr=Zt(Yr,hn),Yr=Qt(Yr,15),Yr=Zt(Yr,Qr),Kr^=Yr,Kr=Qt(Kr,13),Kr=Zt(Kr,5)+3864292196;switch(Yr=0,Wr){case 3:Yr^=Hr[pn+2]<<16;case 2:Yr^=Hr[pn+1]<<8;case 1:Yr^=Hr[pn],Yr=Zt(Yr,hn),Yr=Qt(Yr,15),Yr=Zt(Yr,Qr),Kr^=Yr}return Kr^=Hr.length,Kr=ur(Kr),Kr>>>0},Xt.x86.hash128=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%16,Gr=Hr.length-Wr,Kr=Br,Yr=Br,hn=Br,Qr=Br,pn=0,En=0,ga=0,dn=0,Pr=597399067,xr=2869860233,Mr=951274213,Nr=2716044179,Ur=0;Ur<Gr;Ur=Ur+16)pn=Hr[Ur]|Hr[Ur+1]<<8|Hr[Ur+2]<<16|Hr[Ur+3]<<24,En=Hr[Ur+4]|Hr[Ur+5]<<8|Hr[Ur+6]<<16|Hr[Ur+7]<<24,ga=Hr[Ur+8]|Hr[Ur+9]<<8|Hr[Ur+10]<<16|Hr[Ur+11]<<24,dn=Hr[Ur+12]|Hr[Ur+13]<<8|Hr[Ur+14]<<16|Hr[Ur+15]<<24,pn=Zt(pn,Pr),pn=Qt(pn,15),pn=Zt(pn,xr),Kr^=pn,Kr=Qt(Kr,19),Kr+=Yr,Kr=Zt(Kr,5)+1444728091,En=Zt(En,xr),En=Qt(En,16),En=Zt(En,Mr),Yr^=En,Yr=Qt(Yr,17),Yr+=hn,Yr=Zt(Yr,5)+197830471,ga=Zt(ga,Mr),ga=Qt(ga,17),ga=Zt(ga,Nr),hn^=ga,hn=Qt(hn,15),hn+=Qr,hn=Zt(hn,5)+2530024501,dn=Zt(dn,Nr),dn=Qt(dn,18),dn=Zt(dn,Pr),Qr^=dn,Qr=Qt(Qr,13),Qr+=Kr,Qr=Zt(Qr,5)+850148119;switch(pn=0,En=0,ga=0,dn=0,Wr){case 15:dn^=Hr[Ur+14]<<16;case 14:dn^=Hr[Ur+13]<<8;case 13:dn^=Hr[Ur+12],dn=Zt(dn,Nr),dn=Qt(dn,18),dn=Zt(dn,Pr),Qr^=dn;case 12:ga^=Hr[Ur+11]<<24;case 11:ga^=Hr[Ur+10]<<16;case 10:ga^=Hr[Ur+9]<<8;case 9:ga^=Hr[Ur+8],ga=Zt(ga,Mr),ga=Qt(ga,17),ga=Zt(ga,Nr),hn^=ga;case 8:En^=Hr[Ur+7]<<24;case 7:En^=Hr[Ur+6]<<16;case 6:En^=Hr[Ur+5]<<8;case 5:En^=Hr[Ur+4],En=Zt(En,xr),En=Qt(En,16),En=Zt(En,Mr),Yr^=En;case 4:pn^=Hr[Ur+3]<<24;case 3:pn^=Hr[Ur+2]<<16;case 2:pn^=Hr[Ur+1]<<8;case 1:pn^=Hr[Ur],pn=Zt(pn,Pr),pn=Qt(pn,15),pn=Zt(pn,xr),Kr^=pn}return Kr^=Hr.length,Yr^=Hr.length,hn^=Hr.length,Qr^=Hr.length,Kr+=Yr,Kr+=hn,Kr+=Qr,Yr+=Kr,hn+=Kr,Qr+=Kr,Kr=ur(Kr),Yr=ur(Yr),hn=ur(hn),Qr=ur(Qr),Kr+=Yr,Kr+=hn,Kr+=Qr,Yr+=Kr,hn+=Kr,Qr+=Kr,("00000000"+(Kr>>>0).toString(16)).slice(-8)+("00000000"+(Yr>>>0).toString(16)).slice(-8)+("00000000"+(hn>>>0).toString(16)).slice(-8)+("00000000"+(Qr>>>0).toString(16)).slice(-8)},Xt.x64.hash128=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%16,Gr=Hr.length-Wr,Kr=[0,Br],Yr=[0,Br],hn=[0,0],Qr=[0,0],pn=[2277735313,289559509],En=[1291169091,658871167],ga=0;ga<Gr;ga=ga+16)hn=[Hr[ga+4]|Hr[ga+5]<<8|Hr[ga+6]<<16|Hr[ga+7]<<24,Hr[ga]|Hr[ga+1]<<8|Hr[ga+2]<<16|Hr[ga+3]<<24],Qr=[Hr[ga+12]|Hr[ga+13]<<8|Hr[ga+14]<<16|Hr[ga+15]<<24,Hr[ga+8]|Hr[ga+9]<<8|Hr[ga+10]<<16|Hr[ga+11]<<24],hn=$r(hn,pn),hn=Ar(hn,31),hn=$r(hn,En),Kr=qr(Kr,hn),Kr=Ar(Kr,27),Kr=cr(Kr,Yr),Kr=cr($r(Kr,[0,5]),[0,1390208809]),Qr=$r(Qr,En),Qr=Ar(Qr,33),Qr=$r(Qr,pn),Yr=qr(Yr,Qr),Yr=Ar(Yr,31),Yr=cr(Yr,Kr),Yr=cr($r(Yr,[0,5]),[0,944331445]);switch(hn=[0,0],Qr=[0,0],Wr){case 15:Qr=qr(Qr,Lr([0,Hr[ga+14]],48));case 14:Qr=qr(Qr,Lr([0,Hr[ga+13]],40));case 13:Qr=qr(Qr,Lr([0,Hr[ga+12]],32));case 12:Qr=qr(Qr,Lr([0,Hr[ga+11]],24));case 11:Qr=qr(Qr,Lr([0,Hr[ga+10]],16));case 10:Qr=qr(Qr,Lr([0,Hr[ga+9]],8));case 9:Qr=qr(Qr,[0,Hr[ga+8]]),Qr=$r(Qr,En),Qr=Ar(Qr,33),Qr=$r(Qr,pn),Yr=qr(Yr,Qr);case 8:hn=qr(hn,Lr([0,Hr[ga+7]],56));case 7:hn=qr(hn,Lr([0,Hr[ga+6]],48));case 6:hn=qr(hn,Lr([0,Hr[ga+5]],40));case 5:hn=qr(hn,Lr([0,Hr[ga+4]],32));case 4:hn=qr(hn,Lr([0,Hr[ga+3]],24));case 3:hn=qr(hn,Lr([0,Hr[ga+2]],16));case 2:hn=qr(hn,Lr([0,Hr[ga+1]],8));case 1:hn=qr(hn,[0,Hr[ga]]),hn=$r(hn,pn),hn=Ar(hn,31),hn=$r(hn,En),Kr=qr(Kr,hn)}return Kr=qr(Kr,[0,Hr.length]),Yr=qr(Yr,[0,Hr.length]),Kr=cr(Kr,Yr),Yr=cr(Yr,Kr),Kr=Fr(Kr),Yr=Fr(Yr),Kr=cr(Kr,Yr),Yr=cr(Yr,Kr),("00000000"+(Kr[0]>>>0).toString(16)).slice(-8)+("00000000"+(Kr[1]>>>0).toString(16)).slice(-8)+("00000000"+(Yr[0]>>>0).toString(16)).slice(-8)+("00000000"+(Yr[1]>>>0).toString(16)).slice(-8)},Bt.exports&&(Wt=Bt.exports=Xt),Wt.murmurHash3=Xt})()})(murmurHash3js,murmurHash3js.exports);var murmurHash3jsExports=murmurHash3js.exports,murmurhash3jsRevisited=murmurHash3jsExports;const multihash$1=src$8,crypto$5=self.crypto||self.msCrypto,digest=async(Bt,Wt)=>{if(typeof self>"u"||!crypto$5)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");switch(Wt){case"sha1":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-1"},Bt));case"sha2-256":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-256"},Bt));case"sha2-512":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-512"},Bt));case"dbl-sha2-256":{const Gt=await crypto$5.subtle.digest({name:"SHA-256"},Bt);return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-256"},Gt))}default:throw new Error(`${Wt} is not a supported algorithm`)}};var sha_browser={factory:Bt=>async Wt=>digest(Wt,Bt),digest,multihashing:async(Bt,Wt,Gt)=>{const Yt=await digest(Bt,Wt);return multihash$1.encode(Yt,Wt,Gt)}};const fromNumberTo32BitBuf$1=Bt=>{const Wt=new Uint8Array(4);for(let Gt=0;Gt<4;Gt++)Wt[Gt]=Bt&255,Bt=Bt>>8;return Wt};var utils$g={fromNumberTo32BitBuf:fromNumberTo32BitBuf$1},util$4,hasRequiredUtil$3;function requireUtil$3(){if(hasRequiredUtil$3)return util$4;hasRequiredUtil$3=1;const Bt="Input must be an string, Buffer or Uint8Array";function Wt(Zt){let Qt;if(Zt instanceof Uint8Array)Qt=Zt;else if(typeof Zt=="string")Qt=new TextEncoder().encode(Zt);else throw new Error(Bt);return Qt}function Gt(Zt){return Array.prototype.map.call(Zt,function(Qt){return(Qt<16?"0":"")+Qt.toString(16)}).join("")}function Yt(Zt){return(4294967296+Zt).toString(16).substring(1)}function Xt(Zt,Qt,ur){let cr=`
901
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(Bt,Wt){if(Bt){if(typeof Bt=="string")return _arrayLikeToArray(Bt,Wt);var Gt=Object.prototype.toString.call(Bt).slice(8,-1);if(Gt==="Object"&&Bt.constructor&&(Gt=Bt.constructor.name),Gt==="Map"||Gt==="Set")return Array.from(Bt);if(Gt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Gt))return _arrayLikeToArray(Bt,Wt)}}function _arrayLikeToArray(Bt,Wt){(Wt==null||Wt>Bt.length)&&(Wt=Bt.length);for(var Gt=0,Yt=new Array(Wt);Gt<Wt;Gt++)Yt[Gt]=Bt[Gt];return Yt}function _iterableToArrayLimit(Bt,Wt){var Gt=Bt==null?null:typeof Symbol<"u"&&Bt[Symbol.iterator]||Bt["@@iterator"];if(Gt!=null){var Yt,Xt,Jt,Zt,Qt=[],ur=!0,cr=!1;try{if(Jt=(Gt=Gt.call(Bt)).next,Wt===0){if(Object(Gt)!==Gt)return;ur=!1}else for(;!(ur=(Yt=Jt.call(Gt)).done)&&(Qt.push(Yt.value),Qt.length!==Wt);ur=!0);}catch($r){cr=!0,Xt=$r}finally{try{if(!ur&&Gt.return!=null&&(Zt=Gt.return(),Object(Zt)!==Zt))return}finally{if(cr)throw Xt}}return Qt}}function _arrayWithHoles(Bt){if(Array.isArray(Bt))return Bt}function _typeof(Bt){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Wt){return typeof Wt}:function(Wt){return Wt&&typeof Symbol=="function"&&Wt.constructor===Symbol&&Wt!==Symbol.prototype?"symbol":typeof Wt},_typeof(Bt)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt];for(var Yt in Gt)Object.prototype.hasOwnProperty.call(Gt,Yt)&&(Bt[Yt]=Gt[Yt])}return Bt},_extends.apply(this,arguments)}function ownKeys$1(Bt,Wt){var Gt=Object.keys(Bt);if(Object.getOwnPropertySymbols){var Yt=Object.getOwnPropertySymbols(Bt);Wt&&(Yt=Yt.filter(function(Xt){return Object.getOwnPropertyDescriptor(Bt,Xt).enumerable})),Gt.push.apply(Gt,Yt)}return Gt}function _objectSpread(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt]!=null?arguments[Wt]:{};Wt%2?ownKeys$1(Object(Gt),!0).forEach(function(Yt){_defineProperty$1(Bt,Yt,Gt[Yt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Bt,Object.getOwnPropertyDescriptors(Gt)):ownKeys$1(Object(Gt)).forEach(function(Yt){Object.defineProperty(Bt,Yt,Object.getOwnPropertyDescriptor(Gt,Yt))})}return Bt}function _classCallCheck(Bt,Wt){if(!(Bt instanceof Wt))throw new TypeError("Cannot call a class as a function")}function _defineProperties(Bt,Wt){for(var Gt=0;Gt<Wt.length;Gt++){var Yt=Wt[Gt];Yt.enumerable=Yt.enumerable||!1,Yt.configurable=!0,"value"in Yt&&(Yt.writable=!0),Object.defineProperty(Bt,_toPropertyKey(Yt.key),Yt)}}function _createClass(Bt,Wt,Gt){return Wt&&_defineProperties(Bt.prototype,Wt),Gt&&_defineProperties(Bt,Gt),Object.defineProperty(Bt,"prototype",{writable:!1}),Bt}function _inherits(Bt,Wt){if(typeof Wt!="function"&&Wt!==null)throw new TypeError("Super expression must either be null or a function");Bt.prototype=Object.create(Wt&&Wt.prototype,{constructor:{value:Bt,writable:!0,configurable:!0}}),Object.defineProperty(Bt,"prototype",{writable:!1}),Wt&&_setPrototypeOf(Bt,Wt)}function _setPrototypeOf(Bt,Wt){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Yt,Xt){return Yt.__proto__=Xt,Yt},_setPrototypeOf(Bt,Wt)}function _createSuper(Bt){var Wt=_isNativeReflectConstruct();return function(){var Yt=_getPrototypeOf(Bt),Xt;if(Wt){var Jt=_getPrototypeOf(this).constructor;Xt=Reflect.construct(Yt,arguments,Jt)}else Xt=Yt.apply(this,arguments);return _possibleConstructorReturn(this,Xt)}}function _possibleConstructorReturn(Bt,Wt){if(Wt&&(_typeof(Wt)==="object"||typeof Wt=="function"))return Wt;if(Wt!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(Bt)}function _assertThisInitialized(Bt){if(Bt===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Bt}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(Bt){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Gt){return Gt.__proto__||Object.getPrototypeOf(Gt)},_getPrototypeOf(Bt)}function _defineProperty$1(Bt,Wt,Gt){return Wt=_toPropertyKey(Wt),Wt in Bt?Object.defineProperty(Bt,Wt,{value:Gt,enumerable:!0,configurable:!0,writable:!0}):Bt[Wt]=Gt,Bt}function _toPropertyKey(Bt){var Wt=_toPrimitive(Bt,"string");return _typeof(Wt)==="symbol"?Wt:String(Wt)}function _toPrimitive(Bt,Wt){if(_typeof(Bt)!=="object"||Bt===null)return Bt;var Gt=Bt[Symbol.toPrimitive];if(Gt!==void 0){var Yt=Gt.call(Bt,Wt||"default");if(_typeof(Yt)!=="object")return Yt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Wt==="string"?String:Number)(Bt)}var Funnel=function(Bt){_inherits(Gt,Bt);var Wt=_createSuper(Gt);function Gt(){var Yt;_classCallCheck(this,Gt);for(var Xt=arguments.length,Jt=new Array(Xt),Zt=0;Zt<Xt;Zt++)Jt[Zt]=arguments[Zt];return Yt=Wt.call.apply(Wt,[this].concat(Jt)),_defineProperty$1(_assertThisInitialized(Yt),"state",{isAnimationFinished:!1}),_defineProperty$1(_assertThisInitialized(Yt),"handleAnimationEnd",function(){var Qt=Yt.props.onAnimationEnd;Yt.setState({isAnimationFinished:!0}),_isFunction(Qt)&&Qt()}),_defineProperty$1(_assertThisInitialized(Yt),"handleAnimationStart",function(){var Qt=Yt.props.onAnimationStart;Yt.setState({isAnimationFinished:!1}),_isFunction(Qt)&&Qt()}),Yt}return _createClass(Gt,[{key:"isActiveIndex",value:function(Xt){var Jt=this.props.activeIndex;return Array.isArray(Jt)?Jt.indexOf(Xt)!==-1:Xt===Jt}},{key:"renderTrapezoidsStatically",value:function(Xt){var Jt=this,Zt=this.props.activeShape;return Xt.map(function(Qt,ur){var cr=Jt.isActiveIndex(ur)?Zt:null,$r=_objectSpread(_objectSpread({},Qt),{},{stroke:Qt.stroke});return React$W.createElement(Layer,_extends({className:"recharts-funnel-trapezoid"},adaptEventsOfChild(Jt.props,Qt,ur),{key:"trapezoid-".concat(ur),role:"img"}),Gt.renderTrapezoidItem(cr,$r))})}},{key:"renderTrapezoidsWithAnimation",value:function(){var Xt=this,Jt=this.props,Zt=Jt.trapezoids,Qt=Jt.isAnimationActive,ur=Jt.animationBegin,cr=Jt.animationDuration,$r=Jt.animationEasing,Ar=Jt.animationId,Lr=this.state.prevTrapezoids;return React$W.createElement(Animate,{begin:ur,duration:cr,isActive:Qt,easing:$r,from:{t:0},to:{t:1},key:"funnel-".concat(Ar),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(qr){var Fr=qr.t,Hr=Zt.map(function(Br,Wr){var Gr=Lr&&Lr[Wr];if(Gr){var Kr=interpolateNumber$2(Gr.x,Br.x),Yr=interpolateNumber$2(Gr.y,Br.y),hn=interpolateNumber$2(Gr.upperWidth,Br.upperWidth),Qr=interpolateNumber$2(Gr.lowerWidth,Br.lowerWidth),pn=interpolateNumber$2(Gr.height,Br.height);return _objectSpread(_objectSpread({},Br),{},{x:Kr(Fr),y:Yr(Fr),upperWidth:hn(Fr),lowerWidth:Qr(Fr),height:pn(Fr)})}var En=interpolateNumber$2(Br.x+Br.upperWidth/2,Br.x),ga=interpolateNumber$2(Br.y+Br.height/2,Br.y),dn=interpolateNumber$2(0,Br.upperWidth),Pr=interpolateNumber$2(0,Br.lowerWidth),xr=interpolateNumber$2(0,Br.height);return _objectSpread(_objectSpread({},Br),{},{x:En(Fr),y:ga(Fr),upperWidth:dn(Fr),lowerWidth:Pr(Fr),height:xr(Fr)})});return React$W.createElement(Layer,null,Xt.renderTrapezoidsStatically(Hr))})}},{key:"renderTrapezoids",value:function(){var Xt=this.props,Jt=Xt.trapezoids,Zt=Xt.isAnimationActive,Qt=this.state.prevTrapezoids;return Zt&&Jt&&Jt.length&&(!Qt||!_isEqual(Qt,Jt))?this.renderTrapezoidsWithAnimation():this.renderTrapezoidsStatically(Jt)}},{key:"render",value:function(){var Xt=this.props,Jt=Xt.hide,Zt=Xt.trapezoids,Qt=Xt.className,ur=Xt.isAnimationActive,cr=this.state.isAnimationFinished;if(Jt||!Zt||!Zt.length)return null;var $r=classNames("recharts-trapezoids",Qt);return React$W.createElement(Layer,{className:$r},this.renderTrapezoids(),(!ur||cr)&&LabelList.renderCallByParent(this.props,Zt))}}],[{key:"getDerivedStateFromProps",value:function(Xt,Jt){return Xt.animationId!==Jt.prevAnimationId?{prevAnimationId:Xt.animationId,curTrapezoids:Xt.trapezoids,prevTrapezoids:Jt.curTrapezoids}:Xt.trapezoids!==Jt.curTrapezoids?{curTrapezoids:Xt.trapezoids}:null}},{key:"renderTrapezoidItem",value:function(Xt,Jt){return React$W.isValidElement(Xt)?React$W.cloneElement(Xt,Jt):_isFunction(Xt)?Xt(Jt):_isPlainObject(Xt)?React$W.createElement(Trapezoid,_extends({},Jt,Xt)):React$W.createElement(Trapezoid,Jt)}}]),Gt}(reactExports.PureComponent);_defineProperty$1(Funnel,"displayName","Funnel");_defineProperty$1(Funnel,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",labelLine:!0,hide:!1,isAnimationActive:!Global.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",lastShapeType:"triangle"});_defineProperty$1(Funnel,"getRealFunnelData",function(Bt){var Wt=Bt.props,Gt=Wt.data,Yt=Wt.children,Xt=filterProps(Bt.props),Jt=findAllByType(Yt,Cell);return Gt&&Gt.length?Gt.map(function(Zt,Qt){return _objectSpread(_objectSpread(_objectSpread({payload:Zt},Xt),Zt),Jt&&Jt[Qt]&&Jt[Qt].props)}):Jt&&Jt.length?Jt.map(function(Zt){return _objectSpread(_objectSpread({},Xt),Zt.props)}):[]});_defineProperty$1(Funnel,"getRealWidthHeight",function(Bt,Wt){var Gt=Bt.props.width,Yt=Wt.width,Xt=Wt.height,Jt=Wt.left,Zt=Wt.right,Qt=Wt.top,ur=Wt.bottom,cr=Xt,$r=Yt;return _isNumber(Gt)?$r=Gt:_isString(Gt)&&($r=$r*parseFloat(Gt)/100),{realWidth:$r-Jt-Zt-50,realHeight:cr-ur-Qt,offsetX:(Yt-$r)/2,offsetY:(Xt-cr)/2}});_defineProperty$1(Funnel,"getComposedData",function(Bt){var Wt=Bt.item,Gt=Bt.offset,Yt=Funnel.getRealFunnelData(Wt),Xt=Wt.props,Jt=Xt.dataKey,Zt=Xt.nameKey,Qt=Xt.tooltipType,ur=Xt.lastShapeType,cr=Xt.reversed,$r=Gt.left,Ar=Gt.top,Lr=Funnel.getRealWidthHeight(Wt,Gt),qr=Lr.realHeight,Fr=Lr.realWidth,Hr=Lr.offsetX,Br=Lr.offsetY,Wr=Math.max.apply(null,Yt.map(function(Qr){return getValueByDataKey(Qr,Jt,0)})),Gr=Yt.length,Kr=qr/Gr,Yr={x:Gt.left,y:Gt.top,width:Gt.width,height:Gt.height},hn=Yt.map(function(Qr,pn){var En=getValueByDataKey(Qr,Jt,0),ga=getValueByDataKey(Qr,Zt,pn),dn=En,Pr;if(pn!==Gr-1){if(Pr=getValueByDataKey(Yt[pn+1],Jt,0),Pr instanceof Array){var xr=Pr,Mr=_slicedToArray(xr,1);Pr=Mr[0]}}else if(En instanceof Array&&En.length===2){var Nr=_slicedToArray(En,2);dn=Nr[0],Pr=Nr[1]}else ur==="rectangle"?Pr=dn:Pr=0;var Ur=(Wr-dn)*Fr/(2*Wr)+Ar+25+Hr,Vr=Kr*pn+$r+Br,Zr=dn/Wr*Fr,Xr=Pr/Wr*Fr,Or=[{name:ga,value:dn,payload:Qr,dataKey:Jt,type:Qt}],jr={x:Ur+Zr/2,y:Vr+Kr/2};return _objectSpread(_objectSpread({x:Ur,y:Vr,width:Math.max(Zr,Xr),upperWidth:Zr,lowerWidth:Xr,height:Kr,name:ga,val:dn,tooltipPayload:Or,tooltipPosition:jr},_omit(Qr,"width")),{},{payload:Qr,parentViewBox:Yr,labelViewBox:{x:Ur+(Zr-Xr)/4,y:Vr,width:Math.abs(Zr-Xr)/2+Math.min(Zr,Xr),height:Kr}})});return cr&&(hn=hn.map(function(Qr,pn){var En=Qr.y-pn*Kr+(Gr-1-pn)*Kr;return _objectSpread(_objectSpread({},Qr),{},{upperWidth:Qr.lowerWidth,lowerWidth:Qr.upperWidth,x:Qr.x-(Qr.lowerWidth-Qr.upperWidth)/2,y:Qr.y-pn*Kr+(Gr-1-pn)*Kr,tooltipPosition:_objectSpread(_objectSpread({},Qr.tooltipPosition),{},{y:En+Kr/2}),labelViewBox:_objectSpread(_objectSpread({},Qr.labelViewBox),{},{y:En})})})),{trapezoids:hn,data:Yt}});var FunnelChart=generateCategoricalChart({chartName:"FunnelChart",GraphicalChild:Funnel,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",axisComponents:[],defaultProps:{layout:"centric"}});const es6=Object.freeze(Object.defineProperty({__proto__:null,Area,AreaChart,Bar,BarChart:BarChart$2,Brush,CartesianAxis,CartesianGrid,Cell,ComposedChart,Cross,Curve,Customized,DefaultLegendContent,DefaultTooltipContent,Dot,ErrorBar,Funnel,FunnelChart,Global,Label,LabelList,Layer,Legend,Line,LineChart,Pie,PieChart,PolarAngleAxis,PolarGrid,PolarRadiusAxis,Polygon,Radar,RadarChart,RadialBar,RadialBarChart,Rectangle,ReferenceArea,ReferenceDot,ReferenceLine,ResponsiveContainer,Sankey,Scatter,ScatterChart,Sector,Surface,Symbols,Text,Tooltip,Trapezoid,Treemap,XAxis,YAxis,ZAxis},Symbol.toStringTag,{value:"Module"})),require$$2$1=getAugmentedNamespace(es6);var utils$j={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__spreadArray||function(Hr,Br,Wr){if(Wr||arguments.length===2)for(var Gr=0,Kr=Br.length,Yr;Gr<Kr;Gr++)(Yr||!(Gr in Br))&&(Yr||(Yr=Array.prototype.slice.call(Br,0,Gr)),Yr[Gr]=Br[Gr]);return Hr.concat(Yr||Array.prototype.slice.call(Br))};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getDatasetBounds=Bt.getFlooredFixed=Bt.formatValueToLocale=Bt.isValuesInCurrentRange=Bt.getBarChartRanges=Bt.createExponentialRange=Bt.fixedNumber=Bt.roundNumber=Bt.inverseScale=Bt.roundRange=Bt.formatAndRoundNumberString=Bt.numberFormatter=Bt.CHART_LOG_SCALE=Bt.NON_ACTIVE_BAR_COLOR=Bt.ACTIVE_BAR_COLOR=Bt.LOADING_BAR_COLOR=Bt.HOVERED_BAR_COLOR=void 0,Bt.HOVERED_BAR_COLOR="pink",Bt.LOADING_BAR_COLOR="grey",Bt.ACTIVE_BAR_COLOR="#ff2d55",Bt.NON_ACTIVE_BAR_COLOR="#4f1414",Bt.CHART_LOG_SCALE=5;var Gt=24;Bt.numberFormatter=Intl.NumberFormat("en",{notation:"compact"});var Yt=function(Hr){return Bt.numberFormatter.format(Number(Hr))};Bt.formatAndRoundNumberString=Yt;var Xt=function(Hr){return[(0,Bt.roundNumber)(Hr[0]).toString(),(0,Bt.roundNumber)(Hr[1]).toString()]};Bt.roundRange=Xt;var Jt=function(Hr){return(0,Bt.roundNumber)(Number(Hr))},Zt=function(Hr){return Hr!==0?Math.log(Hr)/Math.log(Bt.CHART_LOG_SCALE):0};Bt.inverseScale=Zt;var Qt=function(Hr,Br){Br===void 0&&(Br=2);var Wr=1;return Hr<10?Number(Hr.toFixed(Br)):(Hr>100&&(Wr=100),Hr>1e3&&(Wr=1e3),Math.round(Hr/Wr)*Wr)};Bt.roundNumber=Qt;var ur=function(Hr,Br){var Wr=new RegExp("^([0-9]+((.|,)?([0-9]?){".concat(Br,"})?)"),"g"),Gr=Hr.match(Wr);return Gr?Gr[0]:""};Bt.fixedNumber=ur;var cr=function(Hr,Br,Wr,Gr){for(var Kr=(0,Bt.inverseScale)(Hr),Yr=(0,Bt.inverseScale)(Br),hn=(Yr-Kr)/Gt,Qr=[],pn=0;pn<Gt;pn++){var En=Qr[pn-1];Qr.push(En!==void 0?En+hn:Kr)}return Wt(Wt([],Qr.map(function(ga){return ga!==0?(0,Bt.roundNumber)(Math.pow(Bt.CHART_LOG_SCALE,ga),Gr):ga}),!0),Wr&&Br>Wr?[Wr]:[],!0)};Bt.createExponentialRange=cr;var $r=function(Hr,Br,Wr,Gr,Kr){var Yr=(0,Bt.createExponentialRange)(Br,Wr,Gr,Kr),hn=Yr.reduce(function(xr,Mr){return xr.set(Mr,0),xr},new Map);try{Object.entries(Hr).forEach(function(xr){var Mr=xr[0],Nr=xr[1],Ur=Jt(Mr),Vr=Yr.findIndex(function(Or){return Ur<=Or}),Zr=Yr[Vr>0?Vr-1:Vr];Zr===void 0&&(Zr=Yr[Yr.length-1]);var Xr=hn.get(Zr)||0;hn.set(Zr,Xr+Nr)});for(var Qr=[],pn=hn.entries(),En=pn.next().value;En;){var ga=En[0],dn=En[1],Pr=pn.next().value;Qr.push({values:[Number(ga),Number(Pr?Pr[0]:ga)],amount:dn}),En=Pr}return Qr}catch{throw Error("Error generating bar chart")}};Bt.getBarChartRanges=$r;var Ar=function(Hr,Br,Wr){return(Hr[0]>=Br||Hr[1]>Br)&&(Hr[0]<Wr||Hr[1]<=Wr)};Bt.isValuesInCurrentRange=Ar;var Lr=function(Hr){var Br=Number(Hr[0]).toLocaleString(),Wr=Number(Hr[1]).toLocaleString();return[Br,Wr]};Bt.formatValueToLocale=Lr;var qr=function(Hr,Br){return(Math.floor(Hr*Math.pow(10,Br))/Math.pow(10,Br)).toFixed(Br)};Bt.getFlooredFixed=qr;var Fr=function(Hr){var Br=Object.keys(Hr).map(function(Wr){return Number(Wr)});return{min:Math.min.apply(Math,Br),max:Math.max.apply(Math,Br)}};Bt.getDatasetBounds=Fr})(utils$j);var BarChartTooltip$1={};const BarChart$1="";var __createBinding$7=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$7=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$7=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$7(Wt,Bt,Gt);return __setModuleDefault$7(Wt,Bt),Wt};Object.defineProperty(BarChartTooltip$1,"__esModule",{value:!0});BarChartTooltip$1.BarChartTooltip=void 0;var React$1=__importStar$7(reactExports),Mana_1$1=Mana$2,utils_1$9=utils$j,BarChartTooltip=function(Bt){var Wt=Bt.active,Gt=Bt.payload,Yt=Bt.network,Xt=Bt.isMana;if(Wt&&Gt&&Gt.length&&Gt[0].payload.amount){var Jt=Gt[0].payload.values,Zt=Jt[0]===Jt[1],Qt=(0,utils_1$9.formatAndRoundNumberString)(Jt[0].toString()),ur=React$1.createElement("span",null,Zt?"".concat(Qt,"+"):Qt),cr=React$1.createElement("span",null,(0,utils_1$9.formatAndRoundNumberString)(Jt[1].toString()));return React$1.createElement("div",{className:"custom-tooltip"},Xt?React$1.createElement(Mana_1$1.Mana,{network:Yt},ur):ur,Zt?null:React$1.createElement(React$1.Fragment,null,React$1.createElement("span",{className:"custom-tooltip-separator"},"-"),Xt?React$1.createElement(Mana_1$1.Mana,{network:Yt},cr):cr))}return null};BarChartTooltip$1.BarChartTooltip=BarChartTooltip;var __createBinding$6=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$6=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$6=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$6(Wt,Bt,Gt);return __setModuleDefault$6(Wt,Bt),Wt},__importDefault$a=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(BarChart$3,"__esModule",{value:!0});BarChart$3.BarChart=void 0;var React=__importStar$6(reactExports),react_1$2=reactExports,classnames_1$1=__importDefault$a(classnamesExports),recharts_1=require$$2$1,network_1=network$3,RangeField_1=RangeField$3,SliderField_1=SliderField$1,Mana_1=Mana$2,Loader_1$1=Loader$5,utils_1$8=utils$j,BarChartTooltip_1=BarChartTooltip$1,DEFAULT_SLIDER_STEP=.1,BarChart=function(Bt){var Wt=Bt.height,Gt=Wt===void 0?150:Wt,Yt=Bt.width,Xt=Yt===void 0?"100%":Yt,Jt=Bt.data,Zt=Bt.upperBound,Qt=Bt.loading,ur=Bt.onChange,cr=Bt.min,$r=Bt.max,Ar=Bt.minLabel,Lr=Bt.maxLabel,qr=Bt.isMana,Fr=qr===void 0?!1:qr,Hr=Bt.network,Br=Hr===void 0?network_1.Network.ETHEREUM:Hr,Wr=Bt.sliderStep,Gr=Wr===void 0?DEFAULT_SLIDER_STEP:Wr,Kr=Bt.errorMessage,Yr=Bt.rangeDecimals,hn=Yr===void 0?2:Yr,Qr=Bt.id,pn=Qr===void 0?"bar-chart":Qr,En=(0,react_1$2.useState)([cr,$r]),ga=En[0],dn=En[1],Pr=(0,react_1$2.useState)(),xr=Pr[0],Mr=Pr[1],Nr=(0,react_1$2.useState)(),Ur=Nr[0],Vr=Nr[1],Zr=(0,react_1$2.useState)(),Xr=Zr[0],Or=Zr[1],jr=(0,react_1$2.useState)(),Jr=jr[0],mn=jr[1],gn=(0,react_1$2.useRef)(null);(0,react_1$2.useEffect)(function(){return dn([cr,$r])},[cr,$r]),(0,react_1$2.useEffect)(function(){return function(){gn.current&&clearTimeout(gn.current)}},[]),(0,react_1$2.useEffect)(function(){if(Jt)try{var Bo=Object.keys(Jt).map(function(Do){return Number(Do)}),Mo=Math.max.apply(Math,Bo),bo=Zt&&Zt<Mo?Zt:Mo,yo=Math.min.apply(Math,Bo);Or(bo),mn(yo),Mr((0,utils_1$8.getBarChartRanges)(Jt,yo,bo,Zt,hn))}catch(Do){console.error("error: ",Do)}},[Jt,Zt]);var eo=(0,react_1$2.useMemo)(function(){return Xr!==void 0?(0,utils_1$8.inverseScale)(Xr):void 0},[Xr]),_i=(0,react_1$2.useMemo)(function(){return Jr!==void 0?(0,utils_1$8.inverseScale)(Jr):void 0},[Jr]),ro=(0,react_1$2.useMemo)(function(){var Bo=ga[0]?(0,utils_1$8.inverseScale)(Number(ga[0])):Number(_i);return Bo<_i?_i:Bo>eo?eo:Bo},[_i,ga,eo]),io=(0,react_1$2.useMemo)(function(){var Bo=ga[1]?(0,utils_1$8.inverseScale)(Number(ga[1])):Number(eo);return Bo>eo?eo:Bo<ro?ro:Bo},[eo,ga,_i,ro]),ao=(0,react_1$2.useMemo)(function(){return ga[0]&&ga[1]&&Number(ga[1])<=Number(ga[0])},[ga]),oo=(0,react_1$2.useMemo)(function(){var Bo=ga[0]?Number(ga[0]):Jr||"";return utils_1$8.numberFormatter.format(Number(Bo))},[Jr,ga]),to=(0,react_1$2.useMemo)(function(){if(Jt){var Bo=(0,utils_1$8.getDatasetBounds)(Jt).max,Mo=Number(ga[1]||Xr),bo=Mo===Xr;return"".concat(utils_1$8.numberFormatter.format(Number(Mo))).concat(bo&&Zt&&Zt<Bo?"+":"")}},[Jt,Xr,Zt,ga]),so=(0,react_1$2.useCallback)(function(Bo,Mo,bo){var yo=(0,utils_1$8.fixedNumber)(Bo[0],hn),Do=(0,utils_1$8.fixedNumber)(Bo[1],hn);dn([yo,Do]),gn.current&&clearTimeout(gn.current),gn.current=setTimeout(function(){return ur([yo,Do],bo||"input")},500)},[dn,ur]),lo=(0,react_1$2.useCallback)(function(Bo,Mo){var bo=Mo[0],yo=Mo[1];if(Xr!==void 0&&Jr!==void 0&&eo){var Do=eo-yo,Tu=(0,utils_1$8.getFlooredFixed)(yo,1)===(0,utils_1$8.getFlooredFixed)(Number(eo),1)||Do<=Gr,wu=Math.pow(utils_1$8.CHART_LOG_SCALE,bo),$o=Tu?Xr:Math.pow(utils_1$8.CHART_LOG_SCALE,yo),mo=[(0,utils_1$8.roundNumber)(wu,hn).toString(),(0,utils_1$8.roundNumber)($o,hn).toString()];dn(mo),so(mo,null,"slider")}},[so,eo,Xr,Jr,Gr]),Ro=(0,react_1$2.useCallback)(function(Bo){Vr(Bo.activeTooltipIndex)},[]),Io=(0,react_1$2.useCallback)(function(){Vr(void 0)},[]),Fo=(0,react_1$2.useCallback)(function(Bo){var Mo=Bo.activePayload,bo=Mo[0].payload.values,yo=bo[0]===bo[1];so(yo?[bo[0].toString(),""]:(0,utils_1$8.roundRange)(Mo[0].payload.values),null,"chart")},[so]),xo=(0,react_1$2.useCallback)(function(Bo,Mo){var bo=(0,utils_1$8.isValuesInCurrentRange)(Bo.values,Number(ga[0]||Jr),Number(ga[1]||Xr));return React.createElement(recharts_1.Cell,{key:"cell-".concat(Mo),fill:Ur===Mo?utils_1$8.HOVERED_BAR_COLOR:Qt?utils_1$8.LOADING_BAR_COLOR:bo?utils_1$8.ACTIVE_BAR_COLOR:utils_1$8.NON_ACTIVE_BAR_COLOR})},[Ur,Qt,Xr,Jr,ga]),ho=(0,react_1$2.useCallback)(function(Bo){Bo.target.blur(),Bo.stopPropagation(),gn.current=setTimeout(function(){Bo.target.focus()},0)},[]),po=(0,react_1$2.useCallback)(function(){if(Number.parseFloat(ga[0])>Number.parseFloat(ga[1])){var Bo=[ga[1],ga[0]];dn(Bo),ur(Bo,"input")}},[ur,dn,ga]);function Ao(Bo){return Fr?React.createElement(Mana_1.Mana,{network:Br,className:"slider-label"},Bo):React.createElement("span",{className:"slider-label"},Bo)}return React.createElement("div",{className:"bar-chart"},React.createElement(RangeField_1.RangeField,{minLabel:Ar,maxLabel:Lr,id:"".concat(pn,"-range-field"),minProps:{icon:Fr?React.createElement(Mana_1.Mana,{network:Br}):null,iconPosition:"left",placeholder:0,onWheel:ho},maxProps:{icon:Fr?React.createElement(Mana_1.Mana,{network:Br}):null,iconPosition:"left",placeholder:1e3,onWheel:ho},onChange:so,onBlur:po,value:ga}),Qt?React.createElement("div",{className:(0,classnames_1$1.default)("loader-container",!Jt&&"no-data-loading-layer")},React.createElement("div",{className:"loading-layer"}),React.createElement(Loader_1$1.Loader,{active:!0})):null,!!Jt&&!!xr&&!!eo&&React.createElement(React.Fragment,null,React.createElement(recharts_1.ResponsiveContainer,{width:Xt,height:Gt},React.createElement(recharts_1.BarChart,{data:xr,margin:{top:20,right:12,left:12},onMouseMove:Ro,onMouseLeave:Io,onClick:Fo},React.createElement(recharts_1.Tooltip,{cursor:!1,content:React.createElement(BarChartTooltip_1.BarChartTooltip,{network:Br,isMana:Fr}),position:{y:25}}),React.createElement(recharts_1.Bar,{dataKey:"amount",barSize:8},xr==null?void 0:xr.map(xo)))),React.createElement(SliderField_1.SliderField,{header:"",range:!0,valueFrom:ro,valueTo:io,min:_i,max:eo,step:Gr,onChange:lo,labelFrom:Ao(oo),labelTo:Ao(to)}),Kr&&ao?React.createElement("span",{className:"bar-chart-error"},Kr):null))};BarChart$3.BarChart=BarChart;var MultiStep$3={};const MultiStep$2="";var __importDefault$9=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(MultiStep$3,"__esModule",{value:!0});MultiStep$3.MultiStep=void 0;var react_1$1=__importDefault$9(reactExports),classnames_1=__importDefault$9(classnamesExports),Icon_1=__importDefault$9(requireIcon()),Button_1$1=Button$3,Loader_1=Loader$5;function MultiStep$1(Bt){var Wt=Bt.steps,Gt=Bt.currentStep;return react_1$1.default.createElement("div",{className:"ui-multi-step","data-testid":"multi-step"},Wt.map(function(Yt,Xt){var Jt=Yt.action&&Gt<=Xt&&!Yt.isLoading,Zt=Xt>Gt;return react_1$1.default.createElement("div",{key:"step-".concat(Xt),"data-testid":Yt.testId||"step-".concat(Xt),className:(0,classnames_1.default)("step-container",{disabled:Zt})},react_1$1.default.createElement("div",null,react_1$1.default.createElement("span",{className:"step-position"},Xt+1)),react_1$1.default.createElement("div",{className:"step-info"},react_1$1.default.createElement("p",{className:"step-title"},Yt.title),Yt.description?react_1$1.default.createElement("p",{className:"step-description"},Yt.description):null,Jt?react_1$1.default.createElement("div",{className:"step-action-container"},react_1$1.default.createElement(Button_1$1.Button,{primary:!0,onClick:Yt.onActionClick,className:"step-action",disabled:Zt},Yt.action),Yt.message?react_1$1.default.createElement("span",null,Yt.message):null):react_1$1.default.createElement("div",{className:"step-message"},Yt.isLoading?react_1$1.default.createElement(Loader_1.Loader,{size:"small",active:!0,"data-testid":"step-loader"}):react_1$1.default.createElement(Icon_1.default,{className:"check-icon",name:"check"}),Yt.message?react_1$1.default.createElement("span",null,Yt.message):null)))}))}MultiStep$3.MultiStep=MultiStep$1;var AuthorizationModal$3={},AuthorizationModal$2={},MultiStep={};(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(MultiStep$3,Bt)})(MultiStep);const AuthorizationModal$1="";var __importDefault$8=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(AuthorizationModal$2,"__esModule",{value:!0});AuthorizationModal$2.AuthorizationModal=void 0;var react_1=__importDefault$8(reactExports),Button_1=Button$3,Modal_1=Modal$9,MultiStep_1=MultiStep;function AuthorizationModal(Bt){var Wt=Bt.currentStep,Gt=Bt.header,Yt=Bt.steps,Xt=Bt.onClose;return react_1.default.createElement(Modal_1.Modal,{open:!0,onClose:Xt,"data-testid":"authorization-modal",className:"authorization-modal-container"},react_1.default.createElement("div",{className:"authorization-modal"},react_1.default.createElement(Button_1.Button,{basic:!0,"aria-label":"Close",className:"close-button",onClick:Xt}),react_1.default.createElement("h1",{className:"authorization-header"},Gt),react_1.default.createElement(MultiStep_1.MultiStep,{currentStep:Wt,steps:Yt})))}AuthorizationModal$2.AuthorizationModal=AuthorizationModal;var AuthorizationModal_types$1={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationStepAction=Bt.AuthorizationStepStatus=void 0,function(Wt){Wt.LOADING_INFO="loading_info",Wt.PENDING="pending",Wt.WAITING="waiting",Wt.PROCESSING="processing",Wt.ALLOWANCE_AMOUNT_ERROR="allowance_amount_error",Wt.ERROR="error",Wt.DONE="done"}(Bt.AuthorizationStepStatus||(Bt.AuthorizationStepStatus={})),function(Wt){Wt.REVOKE="revoke",Wt.GRANT="grant",Wt.CONFIRM="confirm"}(Bt.AuthorizationStepAction||(Bt.AuthorizationStepAction={}))})(AuthorizationModal_types$1);(function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(AuthorizationModal$2,Bt),Gt(AuthorizationModal_types$1,Bt)})(AuthorizationModal$3);const require$$73=getAugmentedNamespace(es$2);var colors={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Color=void 0,function(Wt){Wt.NEON_BLUE="#00D3FF",Wt.SUMMER_RED="#FF2D55",Wt.VOID="#16141A",Wt.LUISXVI_VIOLET="#A524B3",Wt.IDONTFEELTHATWELL="#F3F2F5",Wt.SHADOWS="#242129",Wt.NIGHT_TIME="#691FA9",Wt.BLUISH_STEEL="#676370",Wt.INNOCENCE="#FFFFFF",Wt.CANDY_PURPLE="#C640CD",Wt.SUNISH="#FFBC5B",Wt.MILLENIAL_ORANGE="#FC9965",Wt.OJ_NOT_SIMPSON="#FF7439",Wt.DARK="#18141A"}(Bt.Color||(Bt.Color={}))})(colors);var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt);var Qt=Object.getOwnPropertyDescriptor(Xt,Jt);(!Qt||("get"in Qt?!Xt.__esModule:Qt.writable||Qt.configurable))&&(Qt={enumerable:!0,get:function(){return Xt[Jt]}}),Object.defineProperty(Yt,Zt,Qt)}:function(Yt,Xt,Jt,Zt){Zt===void 0&&(Zt=Jt),Yt[Zt]=Xt[Jt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Yt,Xt){for(var Jt in Yt)Jt!=="default"&&!Object.prototype.hasOwnProperty.call(Xt,Jt)&&Wt(Xt,Yt,Jt)};Object.defineProperty(Bt,"__esModule",{value:!0}),Gt(Address$2,Bt),Gt(Atlas$2,Bt),Gt(AvatarFace$2,Bt),Gt(Back$2,Bt),Gt(Badge$2,Bt),Gt(Blockie$2,Bt),Gt(BuyManaWithFiatModal$3,Bt),Gt(Center$2,Bt),Gt(Close$2,Bt),Gt(Column$2,Bt),Gt(EmoteIcon$2,Bt),Gt(Empty$2,Bt),Gt(Filter$2,Bt),Gt(Footer$4,Bt),Gt(HeaderMenu$1,Bt),Gt(Hero$2,Bt),Gt(LanguageIcon$2,Bt),Gt(LanguageDropdown$2,Bt),Gt(LoginModal$2,Bt),Gt(Logo$2,Bt),Gt(Field$2,Bt),Gt(Mana$2,Bt),Gt(Message$3,Bt),Gt(ModalNavigation$2,Bt),Gt(Narrow$2,Bt),Gt(Navbar$5,Bt),Gt(Page$2,Bt),Gt(Parallax$1,Bt),Gt(Profile$4,Bt),Gt(Row$2,Bt),Gt(Section$2,Bt),Gt(SignIn$2,Bt),Gt(SmartIcon$2,Bt),Gt(StarWalletIcon$2,Bt),Gt(Stats$2,Bt),Gt(Tabs$2,Bt),Gt(TagField$2,Bt),Gt(TextAreaField$2,Bt),Gt(Toast$1,Bt),Gt(Toasts$2,Bt),Gt(UserMenu$4,Bt),Gt(WalletIcon$2,Bt),Gt(WearableIcon$2,Bt),Gt(requireWearablePreview(),Bt),Gt(SelectField$2,Bt),Gt(TextFilter$3,Bt),Gt(Responsive$2,Bt),Gt(Media$1,Bt),Gt(Box$3,Bt),Gt(RangeField$3,Bt),Gt(SliderField$1,Bt),Gt(BarChart$3,Bt),Gt(MultiStep$3,Bt),Gt(AuthorizationModal$3,Bt),Gt(require$$73,Bt),Gt(colors,Bt)}(dist$c)),dist$c}var AuthorizationModal_types={};(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationStepAction=Bt.AuthorizationStepStatus=Bt.AuthorizedAction=void 0,function(Wt){Wt.BID="bid",Wt.BUY="buy",Wt.MINT="mint",Wt.RENT="rent",Wt.CLAIM_NAME="claim_name",Wt.SWAP_MANA="swap_mana",Wt.SELL="sell",Wt.PUBLISH_COLLECTION="publish_collection"}(Bt.AuthorizedAction||(Bt.AuthorizedAction={})),function(Wt){Wt.LOADING_INFO="loading_info",Wt.PENDING="pending",Wt.WAITING="waiting",Wt.PROCESSING="processing",Wt.ALLOWANCE_AMOUNT_ERROR="allowance_amount_error",Wt.ERROR="error",Wt.DONE="done"}(Bt.AuthorizationStepStatus||(Bt.AuthorizationStepStatus={})),function(Wt){Wt.REVOKE="revoke",Wt.GRANT="grant",Wt.CONFIRM="confirm"}(Bt.AuthorizationStepAction||(Bt.AuthorizationStepAction={}))})(AuthorizationModal_types);var utils$i={},utils$h={};Object.defineProperty(utils$h,"__esModule",{value:!0});utils$h.getStatus=utils$h.getType=utils$h.removeLast=void 0;function removeLast(Bt,Wt){const Gt=Bt.filter(Wt).pop();return Bt.filter(Yt=>Yt!==Gt)}utils$h.removeLast=removeLast;const ACTION_TYPE_REGEX=/\[(Request|Failure|Success|Clear)\]\s(.+)/,getType=Bt=>{const Wt=ACTION_TYPE_REGEX.exec(Bt.type);return Wt&&Wt.length>2?Wt[2]:""};utils$h.getType=getType;const getStatus=Bt=>{const Wt=ACTION_TYPE_REGEX.exec(Bt.type);return Wt&&Wt.length>2?Wt[1].toUpperCase():""};utils$h.getStatus=getStatus;var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils$i;hasRequiredUtils=1;var Bt=commonjsGlobal&&commonjsGlobal.__importDefault||function(En){return En&&En.__esModule?En:{default:En}};Object.defineProperty(utils$i,"__esModule",{value:!0}),utils$i.getSteps=utils$i.getPriceInMana=utils$i.getStepMessage=utils$i.getStepError=utils$i.getStepStatus=utils$i.getTranslation=utils$i.safeGet=void 0;const Wt=Bt(reactExports),Gt=require$$0$5,Yt=dist$e,Xt=selectors,Jt=types$3,Zt=utils$k,Qt=requireContainers(),ur=selectors$3,cr=utils$h,$r=selectors$1,Ar=utils$l,Lr=utils$W,qr=selectors,Fr=actions$5,Hr=AuthorizationModal_types,Br=150;function Wr(En,ga){const Pr=ga.split(".").reduce((xr,Mr)=>{if(xr!==void 0)return xr[Mr]},En);return typeof Pr!="string"?void 0:Pr}utils$i.safeGet=Wr;function Gr(En,ga,dn){return(0,Lr.t_cond)(Wr(En,ga),`@dapps.authorization_modal.${ga}`,dn)}utils$i.getTranslation=Gr;function Kr(En,ga,dn,Pr){const xr=ga===Jt.AuthorizationAction.REVOKE?Fr.REVOKE_TOKEN_REQUEST:Fr.GRANT_TOKEN_REQUEST;if((0,ur.isLoadingType)((0,Xt.getLoading)(En),xr))return Hr.AuthorizationStepStatus.WAITING;if((0,$r.getTransactions)(En,dn.address).filter(Zr=>(0,Ar.isPending)(Zr.status)&&(0,cr.getType)({type:xr})===(0,cr.getType)({type:Zr.actionType})&&(0,Zt.areEqual)(Zr.payload.authorization,dn)).length)return Hr.AuthorizationStepStatus.PROCESSING;const Nr=(0,Xt.getAuthorizationFlowError)(En);if(Nr===Zt.AuthorizationError.INSUFFICIENT_ALLOWANCE)return Hr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR;if(Nr||(0,Xt.getError)(En))return Hr.AuthorizationStepStatus.ERROR;let Ur=!1;const Vr=(0,qr.getData)(En);return dn.type===Jt.AuthorizationType.ALLOWANCE?Pr?Ur=(0,Zt.hasAuthorizationAndEnoughAllowance)(Vr,dn,Pr.toString()):Ur=!(0,Zt.hasAuthorization)(Vr,dn):Ur=(0,Zt.hasAuthorization)(Vr,dn),Ur?Hr.AuthorizationStepStatus.DONE:(0,ur.isLoadingType)((0,Xt.getLoading)(En),Fr.AUTHORIZATION_FLOW_REQUEST)&&(0,Xt.getLoading)(En).find(Zr=>{var Xr;return((Xr=Zr.payload)===null||Xr===void 0?void 0:Xr.authorizationAction)===ga})?Hr.AuthorizationStepStatus.LOADING_INFO:Hr.AuthorizationStepStatus.PENDING}utils$i.getStepStatus=Kr;function Yr(En,ga,dn){if(En)return ga===Hr.AuthorizationStepAction.REVOKE?Gr(dn,"revoke_cap_error"):En.length>Br?Gr(dn,"generic_error"):En}utils$i.getStepError=Yr;function hn(En,ga,dn,Pr,xr,Mr,Nr){if(En>Pr)return"";if(En<Pr)return Gr(Nr,"done");switch(ga){case Hr.AuthorizationStepStatus.WAITING:return Gr(Nr,"waiting_wallet");case Hr.AuthorizationStepStatus.PROCESSING:return Gr(Nr,"waiting_confirmation");case Hr.AuthorizationStepStatus.ERROR:return Wt.default.createElement("div",{className:"authorization-error"},Yr(dn,Mr,Nr));case Hr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR:return Wt.default.createElement("div",{className:"authorization-error"},Gr(Nr,"spending_cap_error",{price:xr}));case Hr.AuthorizationStepStatus.DONE:return Gr(Nr,"done");default:return}}utils$i.getStepMessage=hn;function Qr(En){if(!En)return"";const ga=Number.parseFloat(Gt.ethers.utils.formatEther(En));return(Math.ceil(ga*100)/100).toString().replace(/\.0+$/,"")}utils$i.getPriceInMana=Qr;function pn({authorization:En,authorizationType:ga,network:dn,requiredAllowance:Pr,authorizedContractLabel:xr,targetContractLabel:Mr,currentAllowance:Nr,translationKeys:Ur}){const Vr=Qr(Pr);return(!Nr||!Nr.isZero())&&ga===Jt.AuthorizationType.ALLOWANCE&&dn===Yt.Network.ETHEREUM?[{title:Gr(Ur,"revoke_cap.title"),description:Gr(Ur,"revoke_cap.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.REVOKE},{title:Gr(Ur,"set_cap.title"),description:Gr(Ur,"set_cap.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.GRANT}]:ga===Jt.AuthorizationType.ALLOWANCE?[{title:Gr(Ur,"authorize_mana.title",{contract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.authorizedAddress||"",chainId:En.chainId,txHash:""},xr||En.authorizedAddress)}),description:Gr(Ur,"authorize_mana.description",{price:Vr}),actionType:Hr.AuthorizationStepAction.GRANT}]:[{title:Gr(Ur,"authorize_nft.title",{contract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.authorizedAddress||"",chainId:En.chainId,txHash:""},xr||En.authorizedAddress),targetContract:()=>Wt.default.createElement(Qt.TransactionLink,{address:En.contractAddress||"",chainId:En.chainId,txHash:""},Mr||En.contractAddress)}),actionType:Hr.AuthorizationStepAction.GRANT}]}return utils$i.getSteps=pn,utils$i}var hasRequiredAuthorizationModal$1;function requireAuthorizationModal$1(){if(hasRequiredAuthorizationModal$1)return AuthorizationModal$4;hasRequiredAuthorizationModal$1=1;var Bt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(qr,Fr,Hr,Br){Br===void 0&&(Br=Hr),Object.defineProperty(qr,Br,{enumerable:!0,get:function(){return Fr[Hr]}})}:function(qr,Fr,Hr,Br){Br===void 0&&(Br=Hr),qr[Br]=Fr[Hr]}),Wt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(qr,Fr){Object.defineProperty(qr,"default",{enumerable:!0,value:Fr})}:function(qr,Fr){qr.default=Fr}),Gt=commonjsGlobal&&commonjsGlobal.__importStar||function(qr){if(qr&&qr.__esModule)return qr;var Fr={};if(qr!=null)for(var Hr in qr)Hr!=="default"&&Object.prototype.hasOwnProperty.call(qr,Hr)&&Bt(Fr,qr,Hr);return Wt(Fr,qr),Fr},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(qr){return qr&&qr.__esModule?qr:{default:qr}};Object.defineProperty(AuthorizationModal$4,"__esModule",{value:!0}),AuthorizationModal$4.AuthorizationModal=void 0;const Xt=Gt(reactExports),Jt=Yt(require$$1$6),Zt=dist$e,Qt=requireDist(),ur=utils$m,cr=AuthorizationModal_types,$r=requireUtils(),Ar=[cr.AuthorizationStepStatus.LOADING_INFO,cr.AuthorizationStepStatus.PROCESSING,cr.AuthorizationStepStatus.WAITING];function Lr({authorization:qr,requiredAllowance:Fr,currentAllowance:Hr,action:Br,authorizationType:Wr,revokeStatus:Gr,grantStatus:Kr,confirmationStatus:Yr,error:hn,confirmationError:Qr,network:pn,authorizedContractLabel:En,targetContractLabel:ga,translationKeys:dn,onClose:Pr,onRevoke:xr,onGrant:Mr,onAuthorized:Nr,onFetchAuthorizations:Ur}){const Vr=(0,ur.getAnalytics)(),[Zr]=(0,Xt.useState)((0,Jt.default)()),[Xr,Or]=(0,Xt.useState)(0),[jr,Jr]=(0,Xt.useState)(),[mn,gn]=(0,Xt.useState)(!1),eo=(0,$r.getPriceInMana)(Fr);(0,Xt.useEffect)(()=>{Vr.track("[Authorization Flow] Modal Opened",{action:Br,requiredAllowance:Fr,traceId:Zr})},[]),(0,Xt.useEffect)(()=>{Ur()},[Ur]);const _i=(0,Xt.useCallback)(()=>{xr(Zr),Vr.track("[Authorization Flow] Authorize Revoke Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.REVOKE)},[xr]),ro=(0,Xt.useCallback)(()=>{Mr(Zr),Vr.track("[Authorization Flow] Authorize Grant Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.GRANT)},[Mr]),io=(0,Xt.useCallback)(()=>{Nr(),Vr.track("[Authorization Flow] Confirm Transaction Click",{action:Br,traceId:Zr}),Jr(cr.AuthorizationStepAction.CONFIRM)},[Nr]),ao=(0,Xt.useMemo)(()=>[...(0,$r.getSteps)({authorizationType:Wr,network:pn,requiredAllowance:Fr,currentAllowance:Hr,authorization:qr,authorizedContractLabel:En,translationKeys:dn,targetContractLabel:ga}),{title:(0,$r.getTranslation)(dn,"confirm_transaction.title",{action:(0,$r.getTranslation)(dn,"action")}),action:(0,$r.getTranslation)(dn,"confirm_transaction.action"),status:Yr,actionType:cr.AuthorizationStepAction.CONFIRM,error:Qr,onActionClick:io}].map(to=>to.actionType===cr.AuthorizationStepAction.GRANT?mn||Kr===cr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR&&pn===Zt.Network.ETHEREUM?Object.assign(Object.assign({},to),{error:(0,$r.getTranslation)(dn,"insufficient_amount_error.message",{price:eo}),action:"Revoke",status:Gr,message:Ar.includes(Gr)?void 0:Xt.default.createElement("div",{className:"authorization-error"},(0,$r.getTranslation)(dn,"insufficient_amount_error.message",{price:eo})),actionType:cr.AuthorizationStepAction.REVOKE,testId:"reauthorize-step",onActionClick:_i}):Object.assign(Object.assign({},to),{action:Kr===cr.AuthorizationStepStatus.DONE?void 0:(0,$r.getTranslation)(dn,"set_cap.action"),error:hn,status:Kr,onActionClick:ro}):to.actionType===cr.AuthorizationStepAction.REVOKE?Object.assign(Object.assign({},to),{action:Gr===cr.AuthorizationStepStatus.DONE?void 0:(0,$r.getTranslation)(dn,"revoke_cap.action"),error:hn,status:Gr,onActionClick:_i}):to).map((to,so)=>Object.assign(Object.assign({},to),{isLoading:so===Xr&&Ar.includes(to.status),message:"message"in to&&to.message?to.message:(0,$r.getStepMessage)(so,to.status,to.error,Xr,eo,to.actionType,dn),testId:"testId"in to?to.testId:`${to.actionType}-step`})),[Kr,Gr,Wr,Fr,Hr,pn,Br,Yr,Qr,En,mn,Xr,hn,ro,_i,io]);return(0,Xt.useEffect)(()=>{const oo=ao[Xr];oo.status===cr.AuthorizationStepStatus.DONE&&oo.actionType===jr&&(mn?gn(!1):(Or(Xr+1),Jr(void 0)))},[ao[Xr].status]),(0,Xt.useEffect)(()=>{Kr===cr.AuthorizationStepStatus.ALLOWANCE_AMOUNT_ERROR&&pn===Zt.Network.ETHEREUM&&gn(!0)},[Kr,pn,gn]),Xt.default.createElement(Qt.AuthorizationModal,{onClose:Pr,currentStep:Xr,steps:ao,header:(0,$r.getTranslation)(dn,"title",{action:(0,$r.getTranslation)(dn,"title_action")})})}return AuthorizationModal$4.AuthorizationModal=Lr,AuthorizationModal$4}var hasRequiredAuthorizationModal_container;function requireAuthorizationModal_container(){if(hasRequiredAuthorizationModal_container)return AuthorizationModal_container;hasRequiredAuthorizationModal_container=1,Object.defineProperty(AuthorizationModal_container,"__esModule",{value:!0});const Bt=require$$0$e,Wt=actions$5,Gt=types$3,Yt=selectors,Xt=requireAuthorizationModal$1(),Jt=AuthorizationModal_types,Zt=requireUtils(),Qt=(cr,$r)=>{const{authorization:Ar,requiredAllowance:Lr,getConfirmationStatus:qr,getConfirmationError:Fr}=$r;return{revokeStatus:(0,Zt.getStepStatus)(cr,Gt.AuthorizationAction.REVOKE,Ar,void 0),grantStatus:(0,Zt.getStepStatus)(cr,Gt.AuthorizationAction.GRANT,Ar,Lr),confirmationStatus:qr?qr(cr):Jt.AuthorizationStepStatus.PENDING,confirmationError:Fr?Fr(cr):null,error:(0,Yt.getAuthorizationFlowError)(cr)||(0,Yt.getError)(cr)||""}},ur=(cr,$r)=>({onRevoke:Ar=>cr((0,Wt.authorizationFlowRequest)($r.authorization,Gt.AuthorizationAction.REVOKE,"",Ar)),onGrant:Ar=>{var Lr;return cr((0,Wt.authorizationFlowRequest)($r.authorization,Gt.AuthorizationAction.GRANT,((Lr=$r.requiredAllowance)===null||Lr===void 0?void 0:Lr.toString())||"",Ar))},onFetchAuthorizations:()=>cr((0,Wt.fetchAuthorizationsRequest)([$r.authorization]))});return AuthorizationModal_container.default=(0,Bt.connect)(Qt,ur)(Xt.AuthorizationModal),AuthorizationModal_container}var hasRequiredAuthorizationModal;function requireAuthorizationModal(){return hasRequiredAuthorizationModal||(hasRequiredAuthorizationModal=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Object.defineProperty(Jt,ur,{enumerable:!0,get:function(){return Zt[Qt]}})}:function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Jt[ur]=Zt[Qt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Jt,Zt){for(var Qt in Jt)Qt!=="default"&&!Object.prototype.hasOwnProperty.call(Zt,Qt)&&Wt(Zt,Jt,Qt)},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Jt){return Jt&&Jt.__esModule?Jt:{default:Jt}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.AuthorizationModal=void 0;const Xt=Yt(requireAuthorizationModal_container());Bt.AuthorizationModal=Xt.default,Gt(AuthorizationModal_types,Bt)}(AuthorizationModal$5)),AuthorizationModal$5}var hasRequiredWithAuthorizedAction$1;function requireWithAuthorizedAction$1(){if(hasRequiredWithAuthorizedAction$1)return withAuthorizedAction;hasRequiredWithAuthorizedAction$1=1;var Bt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Br,Wr,Gr,Kr){Kr===void 0&&(Kr=Gr),Object.defineProperty(Br,Kr,{enumerable:!0,get:function(){return Wr[Gr]}})}:function(Br,Wr,Gr,Kr){Kr===void 0&&(Kr=Gr),Br[Kr]=Wr[Gr]}),Wt=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Br,Wr){Object.defineProperty(Br,"default",{enumerable:!0,value:Wr})}:function(Br,Wr){Br.default=Wr}),Gt=commonjsGlobal&&commonjsGlobal.__importStar||function(Br){if(Br&&Br.__esModule)return Br;var Wr={};if(Br!=null)for(var Gr in Br)Gr!=="default"&&Object.prototype.hasOwnProperty.call(Br,Gr)&&Bt(Wr,Br,Gr);return Wt(Wr,Br),Wr},Yt=commonjsGlobal&&commonjsGlobal.__awaiter||function(Br,Wr,Gr,Kr){function Yr(hn){return hn instanceof Gr?hn:new Gr(function(Qr){Qr(hn)})}return new(Gr||(Gr=Promise))(function(hn,Qr){function pn(dn){try{ga(Kr.next(dn))}catch(Pr){Qr(Pr)}}function En(dn){try{ga(Kr.throw(dn))}catch(Pr){Qr(Pr)}}function ga(dn){dn.done?hn(dn.value):Yr(dn.value).then(pn,En)}ga((Kr=Kr.apply(Br,Wr||[])).next())})};Object.defineProperty(withAuthorizedAction,"__esModule",{value:!0});const Xt=require$$0$e,Jt=Gt(reactExports),Zt=require$$0$5,Qt=types$3,ur=utils$k,cr=eth,$r=selectors$4,Ar=actions$5,Lr=requireAuthorizationModal(),qr=Br=>({address:(0,$r.getAddress)(Br)}),Fr=Br=>({onClearAuthorizationFlow:()=>Br((0,Ar.authorizationFlowClear)())});function Hr(Br,Wr,Gr,Kr,Yr){const hn=Qr=>{const[pn,En]=(0,Jt.useState)(!1),[ga,dn]=(0,Jt.useState)(),[Pr,xr]=(0,Jt.useState)(!1),{address:Mr,onClearAuthorizationFlow:Nr}=Qr,Ur=(0,Jt.useCallback)(Zr=>Yt(this,void 0,void 0,function*(){if(!Mr)return;xr(!0);const{authorizationType:Xr,targetContract:Or,authorizedAddress:jr,targetContractName:Jr,authorizedContractLabel:mn,onAuthorized:gn}=Zr,eo=yield(0,cr.getNetworkProvider)(Or.chainId),_i=new Zt.ethers.providers.Web3Provider(eo),ro={type:Xr,address:Mr,authorizedAddress:jr,contractAddress:Or.address,chainId:Or.chainId,contractName:Jr};try{if(Xr===Qt.AuthorizationType.ALLOWANCE){const{requiredAllowanceInWei:io}=Zr;if(Zt.BigNumber.from(io).isZero()){gn(!0),xr(!1);return}const oo=yield(0,ur.getERC20ContractInstance)(Or.address,_i).allowance(Mr,jr);if(oo.gte(Zt.BigNumber.from(io))){gn(!0),xr(!1);return}dn({translationKeys:Gr,authorization:ro,authorizedContractLabel:mn,currentAllowance:oo,requiredAllowance:Zt.BigNumber.from(io),authorizationType:Xr,action:Wr,network:Or.network,onAuthorized:()=>gn(!1),getConfirmationStatus:Kr,getConfirmationError:Yr})}else{if(yield(0,ur.getERC721ContractInstance)(Or.address,_i).isApprovedForAll(Mr,jr)){gn(!0),xr(!1);return}const{targetContractLabel:oo}=Zr;dn({translationKeys:Gr,authorization:ro,authorizationType:Xr,action:Wr,network:Or.network,authorizedContractLabel:mn,targetContractLabel:oo,onAuthorized:()=>gn(!1),getConfirmationStatus:Kr,getConfirmationError:Yr})}En(!0)}catch(io){console.error(io)}}),[Mr]),Vr=(0,Jt.useCallback)(()=>{xr(!1),En(!1),Nr()},[]);return Jt.default.createElement(Jt.default.Fragment,null,Jt.default.createElement(Br,Object.assign({},Qr,{onAuthorizedAction:Ur,onCloseAuthorization:Vr,isLoadingAuthorization:Pr})),pn&&ga?Jt.default.createElement(Lr.AuthorizationModal,Object.assign({onClose:Vr},ga)):null)};return(0,Xt.connect)(qr,Fr)(hn)}return withAuthorizedAction.default=Hr,withAuthorizedAction}var withAuthorizedAction_types={};Object.defineProperty(withAuthorizedAction_types,"__esModule",{value:!0});var hasRequiredWithAuthorizedAction;function requireWithAuthorizedAction(){return hasRequiredWithAuthorizedAction||(hasRequiredWithAuthorizedAction=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Object.defineProperty(Jt,ur,{enumerable:!0,get:function(){return Zt[Qt]}})}:function(Jt,Zt,Qt,ur){ur===void 0&&(ur=Qt),Jt[ur]=Zt[Qt]}),Gt=commonjsGlobal&&commonjsGlobal.__exportStar||function(Jt,Zt){for(var Qt in Jt)Qt!=="default"&&!Object.prototype.hasOwnProperty.call(Zt,Qt)&&Wt(Zt,Jt,Qt)},Yt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Jt){return Jt&&Jt.__esModule?Jt:{default:Jt}};Object.defineProperty(Bt,"__esModule",{value:!0});const Xt=Yt(requireWithAuthorizedAction$1());Bt.default=Xt.default,Gt(withAuthorizedAction_types,Bt)}(withAuthorizedAction$1)),withAuthorizedAction$1}var hasRequiredContainers;function requireContainers(){return hasRequiredContainers||(hasRequiredContainers=1,function(Bt){var Wt=commonjsGlobal&&commonjsGlobal.__importDefault||function(Br){return Br&&Br.__esModule?Br:{default:Br}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.withAuthorizedAction=Bt.UserMenu=Bt.TransactionLink=Bt.SignInPage=Bt.Profile=Bt.NetworkCheck=Bt.NetworkButton=Bt.Navbar=Bt.Modal=Bt.LoginModal=Bt.Footer=Bt.ChainProvider=Bt.ChainCheck=Bt.ChainButton=void 0;var Gt=ChainButton$2;Object.defineProperty(Bt,"ChainButton",{enumerable:!0,get:function(){return Wt(Gt).default}});var Yt=ChainCheck$2;Object.defineProperty(Bt,"ChainCheck",{enumerable:!0,get:function(){return Wt(Yt).default}});var Xt=ChainProvider$2;Object.defineProperty(Bt,"ChainProvider",{enumerable:!0,get:function(){return Wt(Xt).default}});var Jt=Footer$6;Object.defineProperty(Bt,"Footer",{enumerable:!0,get:function(){return Wt(Jt).default}});var Zt=LoginModal$4;Object.defineProperty(Bt,"LoginModal",{enumerable:!0,get:function(){return Wt(Zt).default}});var Qt=Modal$5;Object.defineProperty(Bt,"Modal",{enumerable:!0,get:function(){return Wt(Qt).default}});var ur=Navbar$7;Object.defineProperty(Bt,"Navbar",{enumerable:!0,get:function(){return Wt(ur).default}});var cr=NetworkButton$2;Object.defineProperty(Bt,"NetworkButton",{enumerable:!0,get:function(){return Wt(cr).default}});var $r=NetworkCheck$2;Object.defineProperty(Bt,"NetworkCheck",{enumerable:!0,get:function(){return Wt($r).default}});var Ar=Profile$6;Object.defineProperty(Bt,"Profile",{enumerable:!0,get:function(){return Wt(Ar).default}});var Lr=SignInPage$4;Object.defineProperty(Bt,"SignInPage",{enumerable:!0,get:function(){return Wt(Lr).default}});var qr=TransactionLink$2;Object.defineProperty(Bt,"TransactionLink",{enumerable:!0,get:function(){return Wt(qr).default}});var Fr=UserMenu$6;Object.defineProperty(Bt,"UserMenu",{enumerable:!0,get:function(){return Wt(Fr).default}});var Hr=requireWithAuthorizedAction();Object.defineProperty(Bt,"withAuthorizedAction",{enumerable:!0,get:function(){return Wt(Hr).default}})}(containers)),containers}var containersExports=requireContainers();const avatar$4={edit:"Edit Avatar"},profile_information$2={friends:"Friends"},worlds_button$2={get_a_name:"Get an unique name",activate_world:"Activate my world",jump:'Jump to "{domain}" World'},tabs$2={assets:"Assets",creations:"Creations",dao_activity:"DAO Activity",lists:"Lists",overview:"Overview",places:"Places"},en$2={avatar:avatar$4,profile_information:profile_information$2,worlds_button:worlds_button$2,tabs:tabs$2},avatar$3={edit:"Editar Avatar"},profile_information$1={friends:"Amigos"},worlds_button$1={get_a_name:"Obtenga un nombre único",activate_world:"Activar mi mundo",jump:'Saltar al mundo "{domain}"'},tabs$1={overview:"Resumen",assets:"Objetos",creations:"Creaciones",lists:"Listas",dao_activity:"Actividad DAO",places:"Places"},es$1={avatar:avatar$3,profile_information:profile_information$1,worlds_button:worlds_button$1,tabs:tabs$1},avatar$2={edit:"編輯頭像"},profile_information={friends:"朋友們"},worlds_button={get_a_name:"取一个独特的名字",activate_world:"创造我的世界",jump:"跳转到“{domain}”世界"},tabs={overview:"概述",assets:"資產",creations:"創作",lists:"列表",dao_activity:"DAO 活動",places:"地點"},zh$1={avatar:avatar$2,profile_information,worlds_button,tabs},locales$1=Object.freeze(Object.defineProperty({__proto__:null,en:en$2,es:es$1,zh:zh$1},Symbol.toStringTag,{value:"Module"})),locales=Object.keys(locales$1),Footer=Bt=>jsxRuntimeExports.jsx(containersExports.Footer,{locales,...Bt}),locations={root:()=>"/",signIn:Bt=>`/sign-in${Bt?`?redirectTo=${encodeURIComponent(Bt)}`:""}`};var network$1={},validation$1={},__importDefault$7=commonjsGlobal&&commonjsGlobal.__importDefault||function(Bt){return Bt&&Bt.__esModule?Bt:{default:Bt}};Object.defineProperty(validation$1,"__esModule",{value:!0});validation$1.validateType=validation$1.generateLazyValidator=validation$1.Ajv=void 0;const ajv_1$1=__importDefault$7(ajvExports);validation$1.Ajv=ajv_1$1.default;const ajv_keywords_1$1=__importDefault$7(distExports$3),ajv_errors_1$1=__importDefault$7(distExports$2);function generateLazyValidator$1(Bt,Wt){let Gt=null;const Yt=(Xt,Jt)=>{if(!Gt){const Zt=new ajv_1$1.default({$data:!0,allErrors:!0});(0,ajv_keywords_1$1.default)(Zt),(0,ajv_errors_1$1.default)(Zt,{singleError:!0}),Wt==null||Wt.forEach(Qt=>Zt.addKeyword(Qt)),Gt=Zt.compile(Bt),Object.defineProperty(Yt,"errors",{get(){return Gt==null?void 0:Gt.errors}})}return Gt(Xt,Jt)};return Yt}validation$1.generateLazyValidator=generateLazyValidator$1;function validateType$1(Bt,Wt){return Bt.validate(Wt)}validation$1.validateType=validateType$1;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Network=void 0;const Wt=validation$1;(function(Gt){Gt.ETHEREUM="ETHEREUM",Gt.MATIC="MATIC"})(Bt.Network||(Bt.Network={})),function(Gt){Gt.schema={type:"string",enum:Object.values(Gt)},Gt.validate=(0,Wt.generateLazyValidator)(Gt.schema)}(Bt.Network||(Bt.Network={}))})(network$1);const mapState$3=Bt=>{const Wt=selectors$4.isConnected(Bt),Gt=selectors$4.getAddress(Bt),Yt=Gt?selectors$2.getData(Bt)[Gt]:void 0,Xt=selectors$4.getNetworks(Bt),Jt={};if(Wt){const Zt=Object.values(network$1.Network);for(const Qt of Zt)(Xt==null?void 0:Xt[Qt])&&(Jt[Qt]=Xt==null?void 0:Xt[Qt].mana)}return{address:Gt,manaBalances:Jt,avatar:Yt?Yt.avatars[0]:void 0,isSignedIn:Wt,isSigningIn:selectors$4.isConnecting(Bt),hasActivity:!1,hasTranslations:selectors$5.isEnabled(Bt)}},mapDispatch$1=Bt=>({onSignOut:()=>Bt(actions$8.disconnectWallet())}),mergeProps=(Bt,Wt)=>({...Bt,...Wt}),UserMenu=connect(mapState$3,mapDispatch$1,mergeProps)(UserMenu_2),Navbar$2="",Navbar$1=Bt=>{const{isConnected:Wt}=Bt,{pathname:Gt,search:Yt}=location,Xt=useNavigate();Wt&&(Bt={...Bt,rightMenu:jsxRuntimeExports.jsx(UserMenu,{})});const Jt=reactExports.useCallback(()=>{const Qt=new URLSearchParams(Yt).get("redirectTo"),ur=Qt||`${Gt}${Yt}`;Xt(locations.signIn(ur))},[Xt,Gt,Yt]);return jsxRuntimeExports.jsx(containersExports.Navbar,{...Bt,activePage:"profile",isFullscreen:Bt.isFullscreen,isSignIn:Gt===locations.signIn(),onSignIn:Jt})},mapState$2=Bt=>({isConnected:selectors$4.isConnected(Bt)}),Navbar=connect(mapState$2)(Navbar$1),page="_page_1glh3_1",content="_content_1glh3_11",navbar="_navbar_1glh3_16",styles$3={page,content,navbar},PageLayout=({children:Bt,className:Wt})=>jsxRuntimeExports.jsxs("div",{className:classNames(styles$3.page,Wt),children:[jsxRuntimeExports.jsx(Navbar,{className:styles$3.navbar,isFullscreen:!0}),jsxRuntimeExports.jsx("div",{className:styles$3.content,children:Bt}),jsxRuntimeExports.jsx(Footer,{className:styles$3.footer})]}),Copy="https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/assets/Copy-0d8d4029.svg",People="https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/assets/People-27bcbb23.svg",Share="https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/assets/Share-40a90bdc.svg",Wallet="https://cdn.decentraland.org/@dcl/profile-site/0.2.1-5588336189.commit-f75e601/assets/Wallet-3bf78fcc.svg";function _defineProperty(Bt,Wt,Gt){return Wt=_toPropertyKey$B(Wt),Wt in Bt?Object.defineProperty(Bt,Wt,{value:Gt,enumerable:!0,configurable:!0,writable:!0}):Bt[Wt]=Gt,Bt}function ownKeys(Bt,Wt){var Gt=Object.keys(Bt);if(Object.getOwnPropertySymbols){var Yt=Object.getOwnPropertySymbols(Bt);Wt&&(Yt=Yt.filter(function(Xt){return Object.getOwnPropertyDescriptor(Bt,Xt).enumerable})),Gt.push.apply(Gt,Yt)}return Gt}function _objectSpread2(Bt){for(var Wt=1;Wt<arguments.length;Wt++){var Gt=arguments[Wt]!=null?arguments[Wt]:{};Wt%2?ownKeys(Object(Gt),!0).forEach(function(Yt){_defineProperty(Bt,Yt,Gt[Yt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Bt,Object.getOwnPropertyDescriptors(Gt)):ownKeys(Object(Gt)).forEach(function(Yt){Object.defineProperty(Bt,Yt,Object.getOwnPropertyDescriptor(Gt,Yt))})}return Bt}function formatProdErrorMessage(Bt){return"Minified Redux error #"+Bt+"; visit https://redux.js.org/Errors?code="+Bt+" for the full message or use the non-minified dev environment for full errors. "}var $$observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),randomString=function(){return Math.random().toString(36).substring(7).split("").join(".")},ActionTypes={INIT:"@@redux/INIT"+randomString(),REPLACE:"@@redux/REPLACE"+randomString(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+randomString()}};function isPlainObject$3(Bt){if(typeof Bt!="object"||Bt===null)return!1;for(var Wt=Bt;Object.getPrototypeOf(Wt)!==null;)Wt=Object.getPrototypeOf(Wt);return Object.getPrototypeOf(Bt)===Wt}function createStore(Bt,Wt,Gt){var Yt;if(typeof Wt=="function"&&typeof Gt=="function"||typeof Gt=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage(0));if(typeof Wt=="function"&&typeof Gt>"u"&&(Gt=Wt,Wt=void 0),typeof Gt<"u"){if(typeof Gt!="function")throw new Error(formatProdErrorMessage(1));return Gt(createStore)(Bt,Wt)}if(typeof Bt!="function")throw new Error(formatProdErrorMessage(2));var Xt=Bt,Jt=Wt,Zt=[],Qt=Zt,ur=!1;function cr(){Qt===Zt&&(Qt=Zt.slice())}function $r(){if(ur)throw new Error(formatProdErrorMessage(3));return Jt}function Ar(Hr){if(typeof Hr!="function")throw new Error(formatProdErrorMessage(4));if(ur)throw new Error(formatProdErrorMessage(5));var Br=!0;return cr(),Qt.push(Hr),function(){if(Br){if(ur)throw new Error(formatProdErrorMessage(6));Br=!1,cr();var Gr=Qt.indexOf(Hr);Qt.splice(Gr,1),Zt=null}}}function Lr(Hr){if(!isPlainObject$3(Hr))throw new Error(formatProdErrorMessage(7));if(typeof Hr.type>"u")throw new Error(formatProdErrorMessage(8));if(ur)throw new Error(formatProdErrorMessage(9));try{ur=!0,Jt=Xt(Jt,Hr)}finally{ur=!1}for(var Br=Zt=Qt,Wr=0;Wr<Br.length;Wr++){var Gr=Br[Wr];Gr()}return Hr}function qr(Hr){if(typeof Hr!="function")throw new Error(formatProdErrorMessage(10));Xt=Hr,Lr({type:ActionTypes.REPLACE})}function Fr(){var Hr,Br=Ar;return Hr={subscribe:function(Gr){if(typeof Gr!="object"||Gr===null)throw new Error(formatProdErrorMessage(11));function Kr(){Gr.next&&Gr.next($r())}Kr();var Yr=Br(Kr);return{unsubscribe:Yr}}},Hr[$$observable]=function(){return this},Hr}return Lr({type:ActionTypes.INIT}),Yt={dispatch:Lr,subscribe:Ar,getState:$r,replaceReducer:qr},Yt[$$observable]=Fr,Yt}function assertReducerShape(Bt){Object.keys(Bt).forEach(function(Wt){var Gt=Bt[Wt],Yt=Gt(void 0,{type:ActionTypes.INIT});if(typeof Yt>"u")throw new Error(formatProdErrorMessage(12));if(typeof Gt(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage(13))})}function combineReducers(Bt){for(var Wt=Object.keys(Bt),Gt={},Yt=0;Yt<Wt.length;Yt++){var Xt=Wt[Yt];typeof Bt[Xt]=="function"&&(Gt[Xt]=Bt[Xt])}var Jt=Object.keys(Gt),Zt;try{assertReducerShape(Gt)}catch(Qt){Zt=Qt}return function(ur,cr){if(ur===void 0&&(ur={}),Zt)throw Zt;for(var $r=!1,Ar={},Lr=0;Lr<Jt.length;Lr++){var qr=Jt[Lr],Fr=Gt[qr],Hr=ur[qr],Br=Fr(Hr,cr);if(typeof Br>"u")throw cr&&cr.type,new Error(formatProdErrorMessage(14));Ar[qr]=Br,$r=$r||Br!==Hr}return $r=$r||Jt.length!==Object.keys(ur).length,$r?Ar:ur}}function bindActionCreator(Bt,Wt){return function(){return Wt(Bt.apply(this,arguments))}}function bindActionCreators(Bt,Wt){if(typeof Bt=="function")return bindActionCreator(Bt,Wt);if(typeof Bt!="object"||Bt===null)throw new Error(formatProdErrorMessage(16));var Gt={};for(var Yt in Bt){var Xt=Bt[Yt];typeof Xt=="function"&&(Gt[Yt]=bindActionCreator(Xt,Wt))}return Gt}function compose(){for(var Bt=arguments.length,Wt=new Array(Bt),Gt=0;Gt<Bt;Gt++)Wt[Gt]=arguments[Gt];return Wt.length===0?function(Yt){return Yt}:Wt.length===1?Wt[0]:Wt.reduce(function(Yt,Xt){return function(){return Yt(Xt.apply(void 0,arguments))}})}function applyMiddleware(){for(var Bt=arguments.length,Wt=new Array(Bt),Gt=0;Gt<Bt;Gt++)Wt[Gt]=arguments[Gt];return function(Yt){return function(){var Xt=Yt.apply(void 0,arguments),Jt=function(){throw new Error(formatProdErrorMessage(15))},Zt={getState:Xt.getState,dispatch:function(){return Jt.apply(void 0,arguments)}},Qt=Wt.map(function(ur){return ur(Zt)});return Jt=compose.apply(void 0,Qt)(Xt.dispatch),_objectSpread2(_objectSpread2({},Xt),{},{dispatch:Jt})}}}function n(Bt){for(var Wt=arguments.length,Gt=Array(Wt>1?Wt-1:0),Yt=1;Yt<Wt;Yt++)Gt[Yt-1]=arguments[Yt];throw Error("[Immer] minified error nr: "+Bt+(Gt.length?" "+Gt.map(function(Xt){return"'"+Xt+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(Bt){return!!Bt&&!!Bt[Q]}function t(Bt){var Wt;return!!Bt&&(function(Gt){if(!Gt||typeof Gt!="object")return!1;var Yt=Object.getPrototypeOf(Gt);if(Yt===null)return!0;var Xt=Object.hasOwnProperty.call(Yt,"constructor")&&Yt.constructor;return Xt===Object||typeof Xt=="function"&&Function.toString.call(Xt)===Z}(Bt)||Array.isArray(Bt)||!!Bt[L]||!!(!((Wt=Bt.constructor)===null||Wt===void 0)&&Wt[L])||s(Bt)||v(Bt))}function i(Bt,Wt,Gt){Gt===void 0&&(Gt=!1),o(Bt)===0?(Gt?Object.keys:nn)(Bt).forEach(function(Yt){Gt&&typeof Yt=="symbol"||Wt(Yt,Bt[Yt],Bt)}):Bt.forEach(function(Yt,Xt){return Wt(Xt,Yt,Bt)})}function o(Bt){var Wt=Bt[Q];return Wt?Wt.i>3?Wt.i-4:Wt.i:Array.isArray(Bt)?1:s(Bt)?2:v(Bt)?3:0}function u(Bt,Wt){return o(Bt)===2?Bt.has(Wt):Object.prototype.hasOwnProperty.call(Bt,Wt)}function a(Bt,Wt){return o(Bt)===2?Bt.get(Wt):Bt[Wt]}function f(Bt,Wt,Gt){var Yt=o(Bt);Yt===2?Bt.set(Wt,Gt):Yt===3?Bt.add(Gt):Bt[Wt]=Gt}function c(Bt,Wt){return Bt===Wt?Bt!==0||1/Bt==1/Wt:Bt!=Bt&&Wt!=Wt}function s(Bt){return X&&Bt instanceof Map}function v(Bt){return q&&Bt instanceof Set}function p(Bt){return Bt.o||Bt.t}function l(Bt){if(Array.isArray(Bt))return Array.prototype.slice.call(Bt);var Wt=rn(Bt);delete Wt[Q];for(var Gt=nn(Wt),Yt=0;Yt<Gt.length;Yt++){var Xt=Gt[Yt],Jt=Wt[Xt];Jt.writable===!1&&(Jt.writable=!0,Jt.configurable=!0),(Jt.get||Jt.set)&&(Wt[Xt]={configurable:!0,writable:!0,enumerable:Jt.enumerable,value:Bt[Xt]})}return Object.create(Object.getPrototypeOf(Bt),Wt)}function d(Bt,Wt){return Wt===void 0&&(Wt=!1),y(Bt)||r(Bt)||!t(Bt)||(o(Bt)>1&&(Bt.set=Bt.add=Bt.clear=Bt.delete=h),Object.freeze(Bt),Wt&&i(Bt,function(Gt,Yt){return d(Yt,!0)},!0)),Bt}function h(){n(2)}function y(Bt){return Bt==null||typeof Bt!="object"||Object.isFrozen(Bt)}function b(Bt){var Wt=tn[Bt];return Wt||n(18,Bt),Wt}function m(Bt,Wt){tn[Bt]||(tn[Bt]=Wt)}function _(){return U}function j(Bt,Wt){Wt&&(b("Patches"),Bt.u=[],Bt.s=[],Bt.v=Wt)}function g(Bt){O(Bt),Bt.p.forEach(S),Bt.p=null}function O(Bt){Bt===U&&(U=Bt.l)}function w(Bt){return U={p:[],l:U,h:Bt,m:!0,_:0}}function S(Bt){var Wt=Bt[Q];Wt.i===0||Wt.i===1?Wt.j():Wt.g=!0}function P(Bt,Wt){Wt._=Wt.p.length;var Gt=Wt.p[0],Yt=Bt!==void 0&&Bt!==Gt;return Wt.h.O||b("ES5").S(Wt,Bt,Yt),Yt?(Gt[Q].P&&(g(Wt),n(4)),t(Bt)&&(Bt=M(Wt,Bt),Wt.l||x(Wt,Bt)),Wt.u&&b("Patches").M(Gt[Q].t,Bt,Wt.u,Wt.s)):Bt=M(Wt,Gt,[]),g(Wt),Wt.u&&Wt.v(Wt.u,Wt.s),Bt!==H?Bt:void 0}function M(Bt,Wt,Gt){if(y(Wt))return Wt;var Yt=Wt[Q];if(!Yt)return i(Wt,function(Qt,ur){return A(Bt,Yt,Wt,Qt,ur,Gt)},!0),Wt;if(Yt.A!==Bt)return Wt;if(!Yt.P)return x(Bt,Yt.t,!0),Yt.t;if(!Yt.I){Yt.I=!0,Yt.A._--;var Xt=Yt.i===4||Yt.i===5?Yt.o=l(Yt.k):Yt.o,Jt=Xt,Zt=!1;Yt.i===3&&(Jt=new Set(Xt),Xt.clear(),Zt=!0),i(Jt,function(Qt,ur){return A(Bt,Yt,Xt,Qt,ur,Gt,Zt)}),x(Bt,Xt,!1),Gt&&Bt.u&&b("Patches").N(Yt,Gt,Bt.u,Bt.s)}return Yt.o}function A(Bt,Wt,Gt,Yt,Xt,Jt,Zt){if(r(Xt)){var Qt=M(Bt,Xt,Jt&&Wt&&Wt.i!==3&&!u(Wt.R,Yt)?Jt.concat(Yt):void 0);if(f(Gt,Yt,Qt),!r(Qt))return;Bt.m=!1}else Zt&&Gt.add(Xt);if(t(Xt)&&!y(Xt)){if(!Bt.h.D&&Bt._<1)return;M(Bt,Xt),Wt&&Wt.A.l||x(Bt,Xt)}}function x(Bt,Wt,Gt){Gt===void 0&&(Gt=!1),!Bt.l&&Bt.h.D&&Bt.m&&d(Wt,Gt)}function z(Bt,Wt){var Gt=Bt[Q];return(Gt?p(Gt):Bt)[Wt]}function I(Bt,Wt){if(Wt in Bt)for(var Gt=Object.getPrototypeOf(Bt);Gt;){var Yt=Object.getOwnPropertyDescriptor(Gt,Wt);if(Yt)return Yt;Gt=Object.getPrototypeOf(Gt)}}function k(Bt){Bt.P||(Bt.P=!0,Bt.l&&k(Bt.l))}function E(Bt){Bt.o||(Bt.o=l(Bt.t))}function N(Bt,Wt,Gt){var Yt=s(Wt)?b("MapSet").F(Wt,Gt):v(Wt)?b("MapSet").T(Wt,Gt):Bt.O?function(Xt,Jt){var Zt=Array.isArray(Xt),Qt={i:Zt?1:0,A:Jt?Jt.A:_(),P:!1,I:!1,R:{},l:Jt,t:Xt,k:null,o:null,j:null,C:!1},ur=Qt,cr=en$1;Zt&&(ur=[Qt],cr=on);var $r=Proxy.revocable(ur,cr),Ar=$r.revoke,Lr=$r.proxy;return Qt.k=Lr,Qt.j=Ar,Lr}(Wt,Gt):b("ES5").J(Wt,Gt);return(Gt?Gt.A:_()).p.push(Yt),Yt}function R(Bt){return r(Bt)||n(22,Bt),function Wt(Gt){if(!t(Gt))return Gt;var Yt,Xt=Gt[Q],Jt=o(Gt);if(Xt){if(!Xt.P&&(Xt.i<4||!b("ES5").K(Xt)))return Xt.t;Xt.I=!0,Yt=D(Gt,Jt),Xt.I=!1}else Yt=D(Gt,Jt);return i(Yt,function(Zt,Qt){Xt&&a(Xt.t,Zt)===Qt||f(Yt,Zt,Wt(Qt))}),Jt===3?new Set(Yt):Yt}(Bt)}function D(Bt,Wt){switch(Wt){case 2:return new Map(Bt);case 3:return Array.from(Bt)}return l(Bt)}function F(){function Bt(Jt,Zt){var Qt=Xt[Jt];return Qt?Qt.enumerable=Zt:Xt[Jt]=Qt={configurable:!0,enumerable:Zt,get:function(){var ur=this[Q];return en$1.get(ur,Jt)},set:function(ur){var cr=this[Q];en$1.set(cr,Jt,ur)}},Qt}function Wt(Jt){for(var Zt=Jt.length-1;Zt>=0;Zt--){var Qt=Jt[Zt][Q];if(!Qt.P)switch(Qt.i){case 5:Yt(Qt)&&k(Qt);break;case 4:Gt(Qt)&&k(Qt)}}}function Gt(Jt){for(var Zt=Jt.t,Qt=Jt.k,ur=nn(Qt),cr=ur.length-1;cr>=0;cr--){var $r=ur[cr];if($r!==Q){var Ar=Zt[$r];if(Ar===void 0&&!u(Zt,$r))return!0;var Lr=Qt[$r],qr=Lr&&Lr[Q];if(qr?qr.t!==Ar:!c(Lr,Ar))return!0}}var Fr=!!Zt[Q];return ur.length!==nn(Zt).length+(Fr?0:1)}function Yt(Jt){var Zt=Jt.k;if(Zt.length!==Jt.t.length)return!0;var Qt=Object.getOwnPropertyDescriptor(Zt,Zt.length-1);if(Qt&&!Qt.get)return!0;for(var ur=0;ur<Zt.length;ur++)if(!Zt.hasOwnProperty(ur))return!0;return!1}var Xt={};m("ES5",{J:function(Jt,Zt){var Qt=Array.isArray(Jt),ur=function($r,Ar){if($r){for(var Lr=Array(Ar.length),qr=0;qr<Ar.length;qr++)Object.defineProperty(Lr,""+qr,Bt(qr,!0));return Lr}var Fr=rn(Ar);delete Fr[Q];for(var Hr=nn(Fr),Br=0;Br<Hr.length;Br++){var Wr=Hr[Br];Fr[Wr]=Bt(Wr,$r||!!Fr[Wr].enumerable)}return Object.create(Object.getPrototypeOf(Ar),Fr)}(Qt,Jt),cr={i:Qt?5:4,A:Zt?Zt.A:_(),P:!1,I:!1,R:{},l:Zt,t:Jt,k:ur,o:null,g:!1,C:!1};return Object.defineProperty(ur,Q,{value:cr,writable:!0}),ur},S:function(Jt,Zt,Qt){Qt?r(Zt)&&Zt[Q].A===Jt&&Wt(Jt.p):(Jt.u&&function ur(cr){if(cr&&typeof cr=="object"){var $r=cr[Q];if($r){var Ar=$r.t,Lr=$r.k,qr=$r.R,Fr=$r.i;if(Fr===4)i(Lr,function(Kr){Kr!==Q&&(Ar[Kr]!==void 0||u(Ar,Kr)?qr[Kr]||ur(Lr[Kr]):(qr[Kr]=!0,k($r)))}),i(Ar,function(Kr){Lr[Kr]!==void 0||u(Lr,Kr)||(qr[Kr]=!1,k($r))});else if(Fr===5){if(Yt($r)&&(k($r),qr.length=!0),Lr.length<Ar.length)for(var Hr=Lr.length;Hr<Ar.length;Hr++)qr[Hr]=!1;else for(var Br=Ar.length;Br<Lr.length;Br++)qr[Br]=!0;for(var Wr=Math.min(Lr.length,Ar.length),Gr=0;Gr<Wr;Gr++)Lr.hasOwnProperty(Gr)||(qr[Gr]=!0),qr[Gr]===void 0&&ur(Lr[Gr])}}}}(Jt.p[0]),Wt(Jt.p))},K:function(Jt){return Jt.i===4?Gt(Jt):Yt(Jt)}})}var G,U,W=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",X=typeof Map<"u",q=typeof Set<"u",B=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Z=""+Object.prototype.constructor,nn=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(Bt){return Object.getOwnPropertyNames(Bt).concat(Object.getOwnPropertySymbols(Bt))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(Bt){var Wt={};return nn(Bt).forEach(function(Gt){Wt[Gt]=Object.getOwnPropertyDescriptor(Bt,Gt)}),Wt},tn={},en$1={get:function(Bt,Wt){if(Wt===Q)return Bt;var Gt=p(Bt);if(!u(Gt,Wt))return function(Xt,Jt,Zt){var Qt,ur=I(Jt,Zt);return ur?"value"in ur?ur.value:(Qt=ur.get)===null||Qt===void 0?void 0:Qt.call(Xt.k):void 0}(Bt,Gt,Wt);var Yt=Gt[Wt];return Bt.I||!t(Yt)?Yt:Yt===z(Bt.t,Wt)?(E(Bt),Bt.o[Wt]=N(Bt.A.h,Yt,Bt)):Yt},has:function(Bt,Wt){return Wt in p(Bt)},ownKeys:function(Bt){return Reflect.ownKeys(p(Bt))},set:function(Bt,Wt,Gt){var Yt=I(p(Bt),Wt);if(Yt!=null&&Yt.set)return Yt.set.call(Bt.k,Gt),!0;if(!Bt.P){var Xt=z(p(Bt),Wt),Jt=Xt==null?void 0:Xt[Q];if(Jt&&Jt.t===Gt)return Bt.o[Wt]=Gt,Bt.R[Wt]=!1,!0;if(c(Gt,Xt)&&(Gt!==void 0||u(Bt.t,Wt)))return!0;E(Bt),k(Bt)}return Bt.o[Wt]===Gt&&(Gt!==void 0||Wt in Bt.o)||Number.isNaN(Gt)&&Number.isNaN(Bt.o[Wt])||(Bt.o[Wt]=Gt,Bt.R[Wt]=!0),!0},deleteProperty:function(Bt,Wt){return z(Bt.t,Wt)!==void 0||Wt in Bt.t?(Bt.R[Wt]=!1,E(Bt),k(Bt)):delete Bt.R[Wt],Bt.o&&delete Bt.o[Wt],!0},getOwnPropertyDescriptor:function(Bt,Wt){var Gt=p(Bt),Yt=Reflect.getOwnPropertyDescriptor(Gt,Wt);return Yt&&{writable:!0,configurable:Bt.i!==1||Wt!=="length",enumerable:Yt.enumerable,value:Gt[Wt]}},defineProperty:function(){n(11)},getPrototypeOf:function(Bt){return Object.getPrototypeOf(Bt.t)},setPrototypeOf:function(){n(12)}},on={};i(en$1,function(Bt,Wt){on[Bt]=function(){return arguments[0]=arguments[0][0],Wt.apply(this,arguments)}}),on.deleteProperty=function(Bt,Wt){return on.set.call(this,Bt,Wt,void 0)},on.set=function(Bt,Wt,Gt){return en$1.set.call(this,Bt[0],Wt,Gt,Bt[0])};var un=function(){function Bt(Gt){var Yt=this;this.O=B,this.D=!0,this.produce=function(Xt,Jt,Zt){if(typeof Xt=="function"&&typeof Jt!="function"){var Qt=Jt;Jt=Xt;var ur=Yt;return function(Hr){var Br=this;Hr===void 0&&(Hr=Qt);for(var Wr=arguments.length,Gr=Array(Wr>1?Wr-1:0),Kr=1;Kr<Wr;Kr++)Gr[Kr-1]=arguments[Kr];return ur.produce(Hr,function(Yr){var hn;return(hn=Jt).call.apply(hn,[Br,Yr].concat(Gr))})}}var cr;if(typeof Jt!="function"&&n(6),Zt!==void 0&&typeof Zt!="function"&&n(7),t(Xt)){var $r=w(Yt),Ar=N(Yt,Xt,void 0),Lr=!0;try{cr=Jt(Ar),Lr=!1}finally{Lr?g($r):O($r)}return typeof Promise<"u"&&cr instanceof Promise?cr.then(function(Hr){return j($r,Zt),P(Hr,$r)},function(Hr){throw g($r),Hr}):(j($r,Zt),P(cr,$r))}if(!Xt||typeof Xt!="object"){if((cr=Jt(Xt))===void 0&&(cr=Xt),cr===H&&(cr=void 0),Yt.D&&d(cr,!0),Zt){var qr=[],Fr=[];b("Patches").M(Xt,cr,qr,Fr),Zt(qr,Fr)}return cr}n(21,Xt)},this.produceWithPatches=function(Xt,Jt){if(typeof Xt=="function")return function(cr){for(var $r=arguments.length,Ar=Array($r>1?$r-1:0),Lr=1;Lr<$r;Lr++)Ar[Lr-1]=arguments[Lr];return Yt.produceWithPatches(cr,function(qr){return Xt.apply(void 0,[qr].concat(Ar))})};var Zt,Qt,ur=Yt.produce(Xt,Jt,function(cr,$r){Zt=cr,Qt=$r});return typeof Promise<"u"&&ur instanceof Promise?ur.then(function(cr){return[cr,Zt,Qt]}):[ur,Zt,Qt]},typeof(Gt==null?void 0:Gt.useProxies)=="boolean"&&this.setUseProxies(Gt.useProxies),typeof(Gt==null?void 0:Gt.autoFreeze)=="boolean"&&this.setAutoFreeze(Gt.autoFreeze)}var Wt=Bt.prototype;return Wt.createDraft=function(Gt){t(Gt)||n(8),r(Gt)&&(Gt=R(Gt));var Yt=w(this),Xt=N(this,Gt,void 0);return Xt[Q].C=!0,O(Yt),Xt},Wt.finishDraft=function(Gt,Yt){var Xt=Gt&&Gt[Q],Jt=Xt.A;return j(Jt,Yt),P(void 0,Jt)},Wt.setAutoFreeze=function(Gt){this.D=Gt},Wt.setUseProxies=function(Gt){Gt&&!B&&n(20),this.O=Gt},Wt.applyPatches=function(Gt,Yt){var Xt;for(Xt=Yt.length-1;Xt>=0;Xt--){var Jt=Yt[Xt];if(Jt.path.length===0&&Jt.op==="replace"){Gt=Jt.value;break}}Xt>-1&&(Yt=Yt.slice(Xt+1));var Zt=b("Patches").$;return r(Gt)?Zt(Gt,Yt):this.produce(Gt,function(Qt){return Zt(Qt,Yt)})},Bt}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);const createNextState3=fn;var NOT_FOUND="NOT_FOUND";function createSingletonCache(Bt){var Wt;return{get:function(Yt){return Wt&&Bt(Wt.key,Yt)?Wt.value:NOT_FOUND},put:function(Yt,Xt){Wt={key:Yt,value:Xt}},getEntries:function(){return Wt?[Wt]:[]},clear:function(){Wt=void 0}}}function createLruCache(Bt,Wt){var Gt=[];function Yt(Qt){var ur=Gt.findIndex(function($r){return Wt(Qt,$r.key)});if(ur>-1){var cr=Gt[ur];return ur>0&&(Gt.splice(ur,1),Gt.unshift(cr)),cr.value}return NOT_FOUND}function Xt(Qt,ur){Yt(Qt)===NOT_FOUND&&(Gt.unshift({key:Qt,value:ur}),Gt.length>Bt&&Gt.pop())}function Jt(){return Gt}function Zt(){Gt=[]}return{get:Yt,put:Xt,getEntries:Jt,clear:Zt}}var defaultEqualityCheck=function(Wt,Gt){return Wt===Gt};function createCacheKeyComparator(Bt){return function(Gt,Yt){if(Gt===null||Yt===null||Gt.length!==Yt.length)return!1;for(var Xt=Gt.length,Jt=0;Jt<Xt;Jt++)if(!Bt(Gt[Jt],Yt[Jt]))return!1;return!0}}function defaultMemoize(Bt,Wt){var Gt=typeof Wt=="object"?Wt:{equalityCheck:Wt},Yt=Gt.equalityCheck,Xt=Yt===void 0?defaultEqualityCheck:Yt,Jt=Gt.maxSize,Zt=Jt===void 0?1:Jt,Qt=Gt.resultEqualityCheck,ur=createCacheKeyComparator(Xt),cr=Zt===1?createSingletonCache(ur):createLruCache(Zt,ur);function $r(){var Ar=cr.get(arguments);if(Ar===NOT_FOUND){if(Ar=Bt.apply(null,arguments),Qt){var Lr=cr.getEntries(),qr=Lr.find(function(Fr){return Qt(Fr.value,Ar)});qr&&(Ar=qr.value)}cr.put(arguments,Ar)}return Ar}return $r.clearCache=function(){return cr.clear()},$r}function getDependencies(Bt){var Wt=Array.isArray(Bt[0])?Bt[0]:Bt;if(!Wt.every(function(Yt){return typeof Yt=="function"})){var Gt=Wt.map(function(Yt){return typeof Yt=="function"?"function "+(Yt.name||"unnamed")+"()":typeof Yt}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+Gt+"]")}return Wt}function createSelectorCreator(Bt){for(var Wt=arguments.length,Gt=new Array(Wt>1?Wt-1:0),Yt=1;Yt<Wt;Yt++)Gt[Yt-1]=arguments[Yt];var Xt=function(){for(var Zt=arguments.length,Qt=new Array(Zt),ur=0;ur<Zt;ur++)Qt[ur]=arguments[ur];var cr=0,$r,Ar={memoizeOptions:void 0},Lr=Qt.pop();if(typeof Lr=="object"&&(Ar=Lr,Lr=Qt.pop()),typeof Lr!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof Lr+"]");var qr=Ar,Fr=qr.memoizeOptions,Hr=Fr===void 0?Gt:Fr,Br=Array.isArray(Hr)?Hr:[Hr],Wr=getDependencies(Qt),Gr=Bt.apply(void 0,[function(){return cr++,Lr.apply(null,arguments)}].concat(Br)),Kr=Bt(function(){for(var hn=[],Qr=Wr.length,pn=0;pn<Qr;pn++)hn.push(Wr[pn].apply(null,arguments));return $r=Gr.apply(null,hn),$r});return Object.assign(Kr,{resultFunc:Lr,memoizedResultFunc:Gr,dependencies:Wr,lastResult:function(){return $r},recomputations:function(){return cr},resetRecomputations:function(){return cr=0}}),Kr};return Xt}var createSelector=createSelectorCreator(defaultMemoize);function createThunkMiddleware(Bt){var Wt=function(Yt){var Xt=Yt.dispatch,Jt=Yt.getState;return function(Zt){return function(Qt){return typeof Qt=="function"?Qt(Xt,Jt,Bt):Zt(Qt)}}};return Wt}var thunk=createThunkMiddleware();thunk.withExtraArgument=createThunkMiddleware;const thunkMiddleware=thunk;var __extends=globalThis&&globalThis.__extends||function(){var Bt=function(Wt,Gt){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Yt,Xt){Yt.__proto__=Xt}||function(Yt,Xt){for(var Jt in Xt)Object.prototype.hasOwnProperty.call(Xt,Jt)&&(Yt[Jt]=Xt[Jt])},Bt(Wt,Gt)};return function(Wt,Gt){if(typeof Gt!="function"&&Gt!==null)throw new TypeError("Class extends value "+String(Gt)+" is not a constructor or null");Bt(Wt,Gt);function Yt(){this.constructor=Wt}Wt.prototype=Gt===null?Object.create(Gt):(Yt.prototype=Gt.prototype,new Yt)}}(),__generator=globalThis&&globalThis.__generator||function(Bt,Wt){var Gt={label:0,sent:function(){if(Jt[0]&1)throw Jt[1];return Jt[1]},trys:[],ops:[]},Yt,Xt,Jt,Zt;return Zt={next:Qt(0),throw:Qt(1),return:Qt(2)},typeof Symbol=="function"&&(Zt[Symbol.iterator]=function(){return this}),Zt;function Qt(cr){return function($r){return ur([cr,$r])}}function ur(cr){if(Yt)throw new TypeError("Generator is already executing.");for(;Gt;)try{if(Yt=1,Xt&&(Jt=cr[0]&2?Xt.return:cr[0]?Xt.throw||((Jt=Xt.return)&&Jt.call(Xt),0):Xt.next)&&!(Jt=Jt.call(Xt,cr[1])).done)return Jt;switch(Xt=0,Jt&&(cr=[cr[0]&2,Jt.value]),cr[0]){case 0:case 1:Jt=cr;break;case 4:return Gt.label++,{value:cr[1],done:!1};case 5:Gt.label++,Xt=cr[1],cr=[0];continue;case 7:cr=Gt.ops.pop(),Gt.trys.pop();continue;default:if(Jt=Gt.trys,!(Jt=Jt.length>0&&Jt[Jt.length-1])&&(cr[0]===6||cr[0]===2)){Gt=0;continue}if(cr[0]===3&&(!Jt||cr[1]>Jt[0]&&cr[1]<Jt[3])){Gt.label=cr[1];break}if(cr[0]===6&&Gt.label<Jt[1]){Gt.label=Jt[1],Jt=cr;break}if(Jt&&Gt.label<Jt[2]){Gt.label=Jt[2],Gt.ops.push(cr);break}Jt[2]&&Gt.ops.pop(),Gt.trys.pop();continue}cr=Wt.call(Bt,Gt)}catch($r){cr=[6,$r],Xt=0}finally{Yt=Jt=0}if(cr[0]&5)throw cr[1];return{value:cr[0]?cr[1]:void 0,done:!0}}},__spreadArray=globalThis&&globalThis.__spreadArray||function(Bt,Wt){for(var Gt=0,Yt=Wt.length,Xt=Bt.length;Gt<Yt;Gt++,Xt++)Bt[Xt]=Wt[Gt];return Bt},__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=function(Bt,Wt,Gt){return Wt in Bt?__defProp(Bt,Wt,{enumerable:!0,configurable:!0,writable:!0,value:Gt}):Bt[Wt]=Gt},__spreadValues=function(Bt,Wt){for(var Gt in Wt||(Wt={}))__hasOwnProp.call(Wt,Gt)&&__defNormalProp(Bt,Gt,Wt[Gt]);if(__getOwnPropSymbols)for(var Yt=0,Xt=__getOwnPropSymbols(Wt);Yt<Xt.length;Yt++){var Gt=Xt[Yt];__propIsEnum.call(Wt,Gt)&&__defNormalProp(Bt,Gt,Wt[Gt])}return Bt},__spreadProps=function(Bt,Wt){return __defProps(Bt,__getOwnPropDescs(Wt))},__async=function(Bt,Wt,Gt){return new Promise(function(Yt,Xt){var Jt=function(ur){try{Qt(Gt.next(ur))}catch(cr){Xt(cr)}},Zt=function(ur){try{Qt(Gt.throw(ur))}catch(cr){Xt(cr)}},Qt=function(ur){return ur.done?Yt(ur.value):Promise.resolve(ur.value).then(Jt,Zt)};Qt((Gt=Gt.apply(Bt,Wt)).next())})},composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function isPlainObject$2(Bt){if(typeof Bt!="object"||Bt===null)return!1;var Wt=Object.getPrototypeOf(Bt);if(Wt===null)return!0;for(var Gt=Wt;Object.getPrototypeOf(Gt)!==null;)Gt=Object.getPrototypeOf(Gt);return Wt===Gt}var MiddlewareArray=function(Bt){__extends(Wt,Bt);function Wt(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];var Xt=Bt.apply(this,Gt)||this;return Object.setPrototypeOf(Xt,Wt.prototype),Xt}return Object.defineProperty(Wt,Symbol.species,{get:function(){return Wt},enumerable:!1,configurable:!0}),Wt.prototype.concat=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Bt.prototype.concat.apply(this,Gt)},Wt.prototype.prepend=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Gt.length===1&&Array.isArray(Gt[0])?new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt[0].concat(this)))):new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt.concat(this))))},Wt}(Array),EnhancerArray=function(Bt){__extends(Wt,Bt);function Wt(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];var Xt=Bt.apply(this,Gt)||this;return Object.setPrototypeOf(Xt,Wt.prototype),Xt}return Object.defineProperty(Wt,Symbol.species,{get:function(){return Wt},enumerable:!1,configurable:!0}),Wt.prototype.concat=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Bt.prototype.concat.apply(this,Gt)},Wt.prototype.prepend=function(){for(var Gt=[],Yt=0;Yt<arguments.length;Yt++)Gt[Yt]=arguments[Yt];return Gt.length===1&&Array.isArray(Gt[0])?new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt[0].concat(this)))):new(Wt.bind.apply(Wt,__spreadArray([void 0],Gt.concat(this))))},Wt}(Array);function freezeDraftable(Bt){return t(Bt)?createNextState3(Bt,function(){}):Bt}function isBoolean(Bt){return typeof Bt=="boolean"}function curryGetDefaultMiddleware(){return function(Wt){return getDefaultMiddleware(Wt)}}function getDefaultMiddleware(Bt){Bt===void 0&&(Bt={});var Wt=Bt.thunk,Gt=Wt===void 0?!0:Wt;Bt.immutableCheck,Bt.serializableCheck;var Yt=new MiddlewareArray;return Gt&&(isBoolean(Gt)?Yt.push(thunkMiddleware):Yt.push(thunkMiddleware.withExtraArgument(Gt.extraArgument))),Yt}var IS_PRODUCTION=!0;function configureStore(Bt){var Wt=curryGetDefaultMiddleware(),Gt=Bt||{},Yt=Gt.reducer,Xt=Yt===void 0?void 0:Yt,Jt=Gt.middleware,Zt=Jt===void 0?Wt():Jt,Qt=Gt.devTools,ur=Qt===void 0?!0:Qt,cr=Gt.preloadedState,$r=cr===void 0?void 0:cr,Ar=Gt.enhancers,Lr=Ar===void 0?void 0:Ar,qr;if(typeof Xt=="function")qr=Xt;else if(isPlainObject$2(Xt))qr=combineReducers(Xt);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var Fr=Zt;typeof Fr=="function"&&(Fr=Fr(Wt));var Hr=applyMiddleware.apply(void 0,Fr),Br=compose;ur&&(Br=composeWithDevTools(__spreadValues({trace:!IS_PRODUCTION},typeof ur=="object"&&ur)));var Wr=new EnhancerArray(Hr),Gr=Wr;Array.isArray(Lr)?Gr=__spreadArray([Hr],Lr):typeof Lr=="function"&&(Gr=Lr(Wr));var Kr=Br.apply(void 0,Gr);return createStore(qr,$r,Kr)}function createAction(Bt,Wt){function Gt(){for(var Yt=[],Xt=0;Xt<arguments.length;Xt++)Yt[Xt]=arguments[Xt];if(Wt){var Jt=Wt.apply(void 0,Yt);if(!Jt)throw new Error("prepareAction did not return an object");return __spreadValues(__spreadValues({type:Bt,payload:Jt.payload},"meta"in Jt&&{meta:Jt.meta}),"error"in Jt&&{error:Jt.error})}return{type:Bt,payload:Yt[0]}}return Gt.toString=function(){return""+Bt},Gt.type=Bt,Gt.match=function(Yt){return Yt.type===Bt},Gt}function executeReducerBuilderCallback(Bt){var Wt={},Gt=[],Yt,Xt={addCase:function(Jt,Zt){var Qt=typeof Jt=="string"?Jt:Jt.type;if(Qt in Wt)throw new Error("addCase cannot be called with two reducers for the same action type");return Wt[Qt]=Zt,Xt},addMatcher:function(Jt,Zt){return Gt.push({matcher:Jt,reducer:Zt}),Xt},addDefaultCase:function(Jt){return Yt=Jt,Xt}};return Bt(Xt),[Wt,Gt,Yt]}function isStateFunction(Bt){return typeof Bt=="function"}function createReducer(Bt,Wt,Gt,Yt){Gt===void 0&&(Gt=[]);var Xt=typeof Wt=="function"?executeReducerBuilderCallback(Wt):[Wt,Gt,Yt],Jt=Xt[0],Zt=Xt[1],Qt=Xt[2],ur;if(isStateFunction(Bt))ur=function(){return freezeDraftable(Bt())};else{var cr=freezeDraftable(Bt);ur=function(){return cr}}function $r(Ar,Lr){Ar===void 0&&(Ar=ur());var qr=__spreadArray([Jt[Lr.type]],Zt.filter(function(Fr){var Hr=Fr.matcher;return Hr(Lr)}).map(function(Fr){var Hr=Fr.reducer;return Hr}));return qr.filter(function(Fr){return!!Fr}).length===0&&(qr=[Qt]),qr.reduce(function(Fr,Hr){if(Hr)if(r(Fr)){var Br=Fr,Wr=Hr(Br,Lr);return Wr===void 0?Fr:Wr}else{if(t(Fr))return createNextState3(Fr,function(Gr){return Hr(Gr,Lr)});var Wr=Hr(Fr,Lr);if(Wr===void 0){if(Fr===null)return Fr;throw Error("A case reducer on a non-draftable value must not return undefined")}return Wr}return Fr},Ar)}return $r.getInitialState=ur,$r}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=function(Bt){Bt===void 0&&(Bt=21);for(var Wt="",Gt=Bt;Gt--;)Wt+=urlAlphabet[Math.random()*64|0];return Wt},commonProperties=["name","message","stack","code"],RejectWithValue=function(){function Bt(Wt,Gt){this.payload=Wt,this.meta=Gt}return Bt}(),FulfillWithMeta=function(){function Bt(Wt,Gt){this.payload=Wt,this.meta=Gt}return Bt}(),miniSerializeError=function(Bt){if(typeof Bt=="object"&&Bt!==null){for(var Wt={},Gt=0,Yt=commonProperties;Gt<Yt.length;Gt++){var Xt=Yt[Gt];typeof Bt[Xt]=="string"&&(Wt[Xt]=Bt[Xt])}return Wt}return{message:String(Bt)}};(function(){function Bt(Wt,Gt,Yt){var Xt=createAction(Wt+"/fulfilled",function(cr,$r,Ar,Lr){return{payload:cr,meta:__spreadProps(__spreadValues({},Lr||{}),{arg:Ar,requestId:$r,requestStatus:"fulfilled"})}}),Jt=createAction(Wt+"/pending",function(cr,$r,Ar){return{payload:void 0,meta:__spreadProps(__spreadValues({},Ar||{}),{arg:$r,requestId:cr,requestStatus:"pending"})}}),Zt=createAction(Wt+"/rejected",function(cr,$r,Ar,Lr,qr){return{payload:Lr,error:(Yt&&Yt.serializeError||miniSerializeError)(cr||"Rejected"),meta:__spreadProps(__spreadValues({},qr||{}),{arg:Ar,requestId:$r,rejectedWithValue:!!Lr,requestStatus:"rejected",aborted:(cr==null?void 0:cr.name)==="AbortError",condition:(cr==null?void 0:cr.name)==="ConditionError"})}}),Qt=typeof AbortController<"u"?AbortController:function(){function cr(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return cr.prototype.abort=function(){},cr}();function ur(cr){return function($r,Ar,Lr){var qr=Yt!=null&&Yt.idGenerator?Yt.idGenerator(cr):nanoid(),Fr=new Qt,Hr;function Br(Gr){Hr=Gr,Fr.abort()}var Wr=function(){return __async(this,null,function(){var Gr,Kr,Yr,hn,Qr,pn,En;return __generator(this,function(ga){switch(ga.label){case 0:return ga.trys.push([0,4,,5]),hn=(Gr=Yt==null?void 0:Yt.condition)==null?void 0:Gr.call(Yt,cr,{getState:Ar,extra:Lr}),isThenable(hn)?[4,hn]:[3,2];case 1:hn=ga.sent(),ga.label=2;case 2:if(hn===!1||Fr.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return Qr=new Promise(function(dn,Pr){return Fr.signal.addEventListener("abort",function(){return Pr({name:"AbortError",message:Hr||"Aborted"})})}),$r(Jt(qr,cr,(Kr=Yt==null?void 0:Yt.getPendingMeta)==null?void 0:Kr.call(Yt,{requestId:qr,arg:cr},{getState:Ar,extra:Lr}))),[4,Promise.race([Qr,Promise.resolve(Gt(cr,{dispatch:$r,getState:Ar,extra:Lr,requestId:qr,signal:Fr.signal,abort:Br,rejectWithValue:function(dn,Pr){return new RejectWithValue(dn,Pr)},fulfillWithValue:function(dn,Pr){return new FulfillWithMeta(dn,Pr)}})).then(function(dn){if(dn instanceof RejectWithValue)throw dn;return dn instanceof FulfillWithMeta?Xt(dn.payload,qr,cr,dn.meta):Xt(dn,qr,cr)})])];case 3:return Yr=ga.sent(),[3,5];case 4:return pn=ga.sent(),Yr=pn instanceof RejectWithValue?Zt(null,qr,cr,pn.payload,pn.meta):Zt(pn,qr,cr),[3,5];case 5:return En=Yt&&!Yt.dispatchConditionRejection&&Zt.match(Yr)&&Yr.meta.condition,En||$r(Yr),[2,Yr]}})})}();return Object.assign(Wr,{abort:Br,requestId:qr,arg:cr,unwrap:function(){return Wr.then(unwrapResult)}})}}return Object.assign(ur,{pending:Jt,rejected:Zt,fulfilled:Xt,typePrefix:Wt})}return Bt.withTypes=function(){return Bt},Bt})();function unwrapResult(Bt){if(Bt.meta&&Bt.meta.rejectedWithValue)throw Bt.payload;if(Bt.error)throw Bt.error;return Bt.payload}function isThenable(Bt){return Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"}var alm="listenerMiddleware";createAction(alm+"/add");createAction(alm+"/removeAll");createAction(alm+"/remove");var promise;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global$1<"u"?global$1:globalThis);F();const fetchWorldsRequest=createAction("[Request] Fetch Worlds"),fetchWorldsSuccess=createAction("[Success] Fetch Worlds"),fetchWorldsFailure=createAction("[Failure] Fetch Worlds"),getState=Bt=>Bt.world,getData$3=Bt=>getState(Bt).data,getLoading=Bt=>getState(Bt).loading,getActiveWorlds=createSelector([getData$3],Bt=>Bt.filter(Wt=>Wt.active)),hasAName=Bt=>getData$3(Bt).length>0,isLoadingWorlds=createSelector([getLoading],Bt=>isLoadingType_1(Bt,fetchWorldsRequest.type));var dist$9={},config$1={},env={},location$1={},hasRequiredLocation;function requireLocation(){if(hasRequiredLocation)return location$1;hasRequiredLocation=1,Object.defineProperty(location$1,"__esModule",{value:!0}),location$1.getEnvFromQueryParam=location$1.getEnvFromTLD=void 0;const Bt=requireEnv();function Wt(Yt){const{host:Xt}=Yt;return Xt.endsWith(".org")?Bt.Env.PRODUCTION:Xt.endsWith(".today")||Xt.endsWith(".net")?Bt.Env.STAGING:Xt.endsWith(".io")||Xt.endsWith(".zone")?Bt.Env.DEVELOPMENT:null}location$1.getEnvFromTLD=Wt;function Gt(Yt){const Xt=new URLSearchParams(Yt.search),Jt=Xt.get("ENV")||Xt.get("env");if(Jt){const Zt=Jt.toLowerCase();if((0,Bt.isEnv)(Zt))return Zt}return null}return location$1.getEnvFromQueryParam=Gt,location$1}var hasRequiredEnv;function requireEnv(){return hasRequiredEnv||(hasRequiredEnv=1,function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getEnv=Bt.getDefaultEnv=Bt.parseEnvVar=Bt.isEnv=Bt.getEnvList=Bt.Env=void 0;const Wt=requireLocation();var Gt;(function(ur){ur.DEVELOPMENT="dev",ur.STAGING="stg",ur.PRODUCTION="prod"})(Gt=Bt.Env||(Bt.Env={}));function Yt(){return Object.values(Gt)}Bt.getEnvList=Yt;function Xt(ur){return Yt().includes(ur)}Bt.isEnv=Xt;function Jt(ur){if(Xt(ur))return ur;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${ur}", possible values are ${Yt().map(cr=>`"${cr}"`).join(", ")}.`)}Bt.parseEnvVar=Jt;function Zt(ur={}){const{DCL_DEFAULT_ENV:cr,REACT_APP_DCL_DEFAULT_ENV:$r,GATSBY_DCL_DEFAULT_ENV:Ar}=ur;if(cr&&$r&&cr!==$r)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(cr&&Ar&&cr!==Ar)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if($r&&Ar&&$r!==Ar)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return cr?Jt(cr):$r?Jt($r):Ar?Jt(Ar):Gt.PRODUCTION}Bt.getDefaultEnv=Zt;function Qt(ur={}){if(typeof window<"u"){const cr=(0,Wt.getEnvFromQueryParam)(window.location);if(cr)return cr;const $r=(0,Wt.getEnvFromTLD)(window.location);if($r)return $r}return Zt(ur)}Bt.getEnv=Qt}(env)),env}Object.defineProperty(config$1,"__esModule",{value:!0});config$1.createConfig=void 0;const env_1=requireEnv();function createConfig(Bt,Wt){const Gt=(0,env_1.getEnv)(Wt==null?void 0:Wt.systemEnvVariables),Yt=Bt[Gt];return{get:(Xt,Jt="")=>{if(!Yt)throw new Error(`Could not find a config for env=${Gt}`);return Xt in Yt?Yt[Xt]:Jt},is:Xt=>Gt===Xt,getEnv:()=>Gt}}config$1.createConfig=createConfig;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getEnv=Bt.Env=Bt.createConfig=void 0;var Wt=config$1;Object.defineProperty(Bt,"createConfig",{enumerable:!0,get:function(){return Wt.createConfig}});var Gt=requireEnv();Object.defineProperty(Bt,"Env",{enumerable:!0,get:function(){return Gt.Env}}),Object.defineProperty(Bt,"getEnv",{enumerable:!0,get:function(){return Gt.getEnv}})})(dist$9);const jumpIcon$1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAClSURBVHgB7ZTbDYAgDEWLcQBHYBUncQZHcNK6gW5QMTFRCX0EwS9OQvwA7mnBANCoAREh8eBzbQfl8exMsE9hbJbKHnt83JEkQGvriXC0COQFcrgvJkiFm/ZbBFx4EYEUfs0jMT+DKtDCTXCCIuGcwBKuHo0iUCvnOj/pQWe9vqNzboUvSJXk7qvx2P0riO9gD2PIOSa47+pF3MHMLVQ4C1ugkcMBxwKeOw0CJyAAAAAASUVORK5CYII=",verifiedIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADgSURBVHgB7ZThDcIgEIVPJ+gIbKAjdAMdgQ3sCHUDN+gIdgNGqRvUDc4jnElTDw4hJv7ol1ya0uM9ehwAbNSCiBYDA4WhaCkcxUxxhBpYcMI4DkpgYb/yO+oMFGeKJlfcYjkfJdvDj5EMnlDOI8fgADrXHUHPcTV+Ss6iGl6Euvp2dIv3nnOlDku3rrxv2PG3XhF/M6YMOmGCFzKLHO1spA8fJdxiJhniFjQwXAUxZkxj1npSF5m4PeSdVsWgBpOV5TcKv7uLrFSeHKNGqfsEtWBo3Zn/puXVOh4zsPH3vAASSlzmB0KCVwAAAABJRU5ErkJggg==",worldIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFNSURBVHgB3VXRjYMwDLU6ASNkg+M24DZgA7IBbFA2KLdBN6Ab3AjoJsgIdAM3UWNhXJNQPvskCyXP8YvtJAB8NBCx8Ga9jd4cLpjiXANH4RfX3mbMw70t5BdcWIA/b603w/hBETrvDX6OC8LuuwQf0AQfNr7kglsWvBScibUn9IwrcSlnnRJw0Unb+ZXVvFL4jm2uSO3ebYgTjJLZILKzWoCR6qpwRhPH50nTcCOfE/M38fsP+0En59fbj7fvOP568SRpLUpsYsCUWyPnTrAPdKLucBT8BOH6UlWMa9i8lVltZUrkKBo14/qpuG5sSBO9aQJWBCeEQL3wrYjLiXKyYIG7OH69MOtSzGyu1UTlwpplUEICuO5ZyTJOv6y4vJTqY8f8KqVXPexBcBQ9aHhG+LzZrejVAO8gNt1hHkGkhqPA5Zc5iazGyBXw0XgAE10YEF/OlCgAAAAASUVORK5CYII=",NETWORK$2="goerli",CHAIN_ID$2="5",PEER_URL$2="https://peer-ap1.decentraland.zone",MARKETPLACE_GRAPH_URL$2="https://api.thegraph.com/subgraphs/name/decentraland/marketplace-goerli",WORLDS_CONTENT_SERVER_URL$3="https://worlds-content-server.decentraland.zone",EXPLORER_URL$3="https://play.decentraland.zone",BUILDER_URL$3="https://builder.decentraland.zone",dev={NETWORK:NETWORK$2,CHAIN_ID:CHAIN_ID$2,PEER_URL:PEER_URL$2,MARKETPLACE_GRAPH_URL:MARKETPLACE_GRAPH_URL$2,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$3,EXPLORER_URL:EXPLORER_URL$3,BUILDER_URL:BUILDER_URL$3},NETWORK$1="mainnet",CHAIN_ID$1="1",PEER_URL$1="https://peer.decentraland.org",MARKETPLACE_GRAPH_URL$1="https://api.thegraph.com/subgraphs/name/decentraland/marketplace-goerli",WORLDS_CONTENT_SERVER_URL$2="https://worlds-content-server.decentraland.zone",EXPLORER_URL$2="https://play.decentraland.zone",BUILDER_URL$2="https://builder.decentraland.zone",prod={NETWORK:NETWORK$1,CHAIN_ID:CHAIN_ID$1,PEER_URL:PEER_URL$1,MARKETPLACE_GRAPH_URL:MARKETPLACE_GRAPH_URL$1,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$2,EXPLORER_URL:EXPLORER_URL$2,BUILDER_URL:BUILDER_URL$2},NETWORK="mainnet",CHAIN_ID="1",PEER_URL="https://peer.decentraland.org",MARKETPLACE_GRAPH_URL="https://api.thegraph.com/subgraphs/name/decentraland/marketplace",WORLDS_CONTENT_SERVER_URL$1="https://worlds-content-server.decentraland.org",EXPLORER_URL$1="https://play.decentraland.org",BUILDER_URL$1="https://builder.decentraland.org",stg={NETWORK,CHAIN_ID,PEER_URL,MARKETPLACE_GRAPH_URL,WORLDS_CONTENT_SERVER_URL:WORLDS_CONTENT_SERVER_URL$1,EXPLORER_URL:EXPLORER_URL$1,BUILDER_URL:BUILDER_URL$1},config=dist$9.createConfig({[dist$9.Env.DEVELOPMENT]:dev,[dist$9.Env.STAGING]:stg,[dist$9.Env.PRODUCTION]:prod},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});console.log({}.VITE_REACT_APP_DCL_DEFAULT_ENV);const jumpIcon="_jumpIcon_lxozy_2",worldItem="_worldItem_lxozy_7",worldDropdown="_worldDropdown_lxozy_12",worldButton="_worldButton_lxozy_25",smallButton$1="_smallButton_lxozy_29",styles$2={jumpIcon,worldItem,worldDropdown,worldButton,smallButton:smallButton$1},EXPLORER_URL=config.get("EXPLORER_URL"),BUILDER_URL=config.get("BUILDER_URL"),WORLDS_CONTENT_SERVER_URL=config.get("WORLDS_CONTENT_SERVER_URL"),isDevelopment=config.getEnv()===dist$9.Env.DEVELOPMENT,WorldsButton$1=Bt=>{const{address:Wt,isLoading:Gt,className:Yt,hasNames:Xt,worlds:Jt,onFetchWorlds:Zt}=Bt,Qt=Jt.length>0,ur=reactExports.useCallback($r=>{window.open(isDevelopment?`${EXPLORER_URL}/?realm=${WORLDS_CONTENT_SERVER_URL}/world/${$r.domain}&NETWORK=goerli`:`${EXPLORER_URL}/world/${$r.domain}`,"_blank,noreferrer")},[]),cr=reactExports.useCallback(()=>{Xt?Xt&&!Qt&&window.open(`${BUILDER_URL}/worlds`,"_blank,noreferrer"):window.open(`${BUILDER_URL}/names`,"_blank,noreferrer")},[Xt,Qt]);return reactExports.useEffect(()=>{Zt(Wt)},[Wt]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Dropdown$4.Dropdown,{className:classNames(Yt,styles$2.worldDropdown),direction:"left",open:!Xt||Xt&&!Qt?!1:void 0,trigger:jsxRuntimeExports.jsx(Button$3.Button,{primary:!0,disabled:Gt,loading:Gt,onClick:cr,className:classNames(Yt,styles$2.worldButton,"customIconButton",{[styles$2.smallButton]:Gt||Qt&&Xt},styles$2.actionButton),children:!Xt&&!Gt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:verifiedIcon})," ",t_1("worlds_button.get_a_name")]}):Xt&&!Qt&&!Gt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:worldIcon})," ",t_1("worlds_button.activate_world")]}):Qt&&!Gt?jsxRuntimeExports.jsx("img",{src:worldIcon}):null}),children:jsxRuntimeExports.jsx(Dropdown$4.Dropdown.Menu,{className:styles$2.worldDropdown,children:Jt.map($r=>jsxRuntimeExports.jsxs(Dropdown$4.Dropdown.Item,{styles:styles$2.worldItem,onClick:()=>ur($r),children:[jsxRuntimeExports.jsx("img",{src:jumpIcon$1,className:styles$2.jumpIcon})," ",t_1("worlds_button.jump",{domain:$r.domain})]},$r.domain))})})})},mapState$1=Bt=>({worlds:getActiveWorlds(Bt),hasNames:hasAName(Bt),isLoading:isLoadingWorlds(Bt)}),mapDispatch=Bt=>bindActionCreators({onFetchWorlds:fetchWorldsRequest},Bt),WorldsButton=connect(mapState$1,mapDispatch)(WorldsButton$1),ProfileInformation$1="_ProfileInformation_1ahco_1",actions$4="_actions_1ahco_9",basicRow="_basicRow_1ahco_16",basicCenteredRow="_basicCenteredRow_1ahco_22",description$2="_description_1ahco_26",userName="_userName_1ahco_30",userNumber="_userNumber_1ahco_36",profileData="_profileData_1ahco_40",wallet="_wallet_1ahco_47",smallButton="_smallButton_1ahco_54",fluidButton="_fluidButton_1ahco_73",Profile="_Profile_1ahco_1",inline="_inline_1ahco_78",dcl="_dcl_1ahco_78",blockie="_blockie_1ahco_78",styles$1={ProfileInformation:ProfileInformation$1,actions:actions$4,basicRow,basicCenteredRow,description:description$2,userName,userNumber,profileData,wallet,smallButton,fluidButton,Profile,inline,dcl,blockie},ProfileInformation=()=>jsxRuntimeExports.jsxs("div",{className:styles$1.ProfileInformation,children:[jsxRuntimeExports.jsxs("div",{className:styles$1.basicRow,children:[jsxRuntimeExports.jsx(Profile_2,{size:"massive",imageOnly:!0,address:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsxs("div",{className:styles$1.profileData,children:[jsxRuntimeExports.jsxs("span",{className:styles$1.userNumber,children:[jsxRuntimeExports.jsx("span",{className:styles$1.userName,children:"Florencia"}),"  #222"]}),jsxRuntimeExports.jsxs("div",{className:styles$1.wallet,children:[jsxRuntimeExports.jsx("img",{src:Wallet,className:"iconSize"}),jsxRuntimeExports.jsx(Profile_2,{textOnly:!0,address:"0xd4fEC88A49EB514e9347eC655D0481D8483a9AE0"}),jsxRuntimeExports.jsx("img",{src:Copy,className:"iconSize"})]}),jsxRuntimeExports.jsxs("div",{className:styles$1.basicCenteredRow,children:[jsxRuntimeExports.jsx("img",{src:People,className:"iconSize"}),"  714 ",t_1("profile_information.friends")]}),jsxRuntimeExports.jsx("span",{className:styles$1.description,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$1.actions,children:[jsxRuntimeExports.jsx(WorldsButton,{address:"0xeDaE96F7739aF8A7fB16E2a888C1E578E1328299"}),jsxRuntimeExports.jsx(Button$3.Button,{primary:!0,className:styles$1.smallButton,children:jsxRuntimeExports.jsx("img",{src:Share,className:"iconSize"})}),jsxRuntimeExports.jsx(Button$3.Button,{inverted:!0,className:styles$1.smallButton,children:jsxRuntimeExports.jsx(default_1$2,{name:"ellipsis horizontal"})})]})]}),MainPage$1="_MainPage_t4kaq_6",infoContainer="_infoContainer_t4kaq_15",tab="_tab_t4kaq_26",styles={MainPage:MainPage$1,infoContainer,tab};function MainPage(){const Bt=[{displayValue:t_1("tabs.overview"),value:t_1("tabs.overview")}],[Wt,Gt]=reactExports.useState(Bt[0].value),Yt=reactExports.useCallback(Xt=>{Gt(Xt)},[Gt]);return jsxRuntimeExports.jsx(PageLayout,{children:jsxRuntimeExports.jsxs("div",{className:styles.MainPage,children:[Wt===Bt[0].value&&jsxRuntimeExports.jsx(Avatar,{}),jsxRuntimeExports.jsxs("div",{className:styles.infoContainer,children:[jsxRuntimeExports.jsx(ProfileInformation,{}),jsxRuntimeExports.jsx(default_1$1,{}),jsxRuntimeExports.jsx(Tabs_2,{children:Bt.map(Xt=>jsxRuntimeExports.jsx(Tabs_2.Tab,{active:Wt===Xt.value,onClick:()=>Yt(Xt.value),children:jsxRuntimeExports.jsx("span",{className:styles.tab,children:Xt.displayValue})},Xt.value))}),jsxRuntimeExports.jsx("div",{children:"content"})]})]})})}const SignInPage$1=Bt=>{const{isConnected:Wt}=Bt,[Gt]=useSearchParams(),Yt=Gt.get("redirectTo"),Xt=useNavigate();return reactExports.useEffect(()=>{Yt&&Wt&&Xt(decodeURIComponent(Yt))},[Yt,Wt,Xt]),jsxRuntimeExports.jsx(PageLayout,{children:jsxRuntimeExports.jsx(_default$3,{})})},mapState=Bt=>({isConnected:selectors$4.isConnected(Bt)}),SignInPage=connect(mapState)(SignInPage$1);var dist$8={},fetcher$1={},__createBinding$5=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt);var Xt=Object.getOwnPropertyDescriptor(Wt,Gt);(!Xt||("get"in Xt?!Wt.__esModule:Xt.writable||Xt.configurable))&&(Xt={enumerable:!0,get:function(){return Wt[Gt]}}),Object.defineProperty(Bt,Yt,Xt)}:function(Bt,Wt,Gt,Yt){Yt===void 0&&(Yt=Gt),Bt[Yt]=Wt[Gt]}),__setModuleDefault$5=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(Bt,Wt){Object.defineProperty(Bt,"default",{enumerable:!0,value:Wt})}:function(Bt,Wt){Bt.default=Wt}),__importStar$5=commonjsGlobal&&commonjsGlobal.__importStar||function(Bt){if(Bt&&Bt.__esModule)return Bt;var Wt={};if(Bt!=null)for(var Gt in Bt)Gt!=="default"&&Object.prototype.hasOwnProperty.call(Bt,Gt)&&__createBinding$5(Wt,Bt,Gt);return __setModuleDefault$5(Wt,Bt),Wt},__rest=commonjsGlobal&&commonjsGlobal.__rest||function(Bt,Wt){var Gt={};for(var Yt in Bt)Object.prototype.hasOwnProperty.call(Bt,Yt)&&Wt.indexOf(Yt)<0&&(Gt[Yt]=Bt[Yt]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Yt=Object.getOwnPropertySymbols(Bt);Xt<Yt.length;Xt++)Wt.indexOf(Yt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Yt[Xt])&&(Gt[Yt[Xt]]=Bt[Yt[Xt]]);return Gt};Object.defineProperty(fetcher$1,"__esModule",{value:!0});fetcher$1.createFetchComponent=void 0;const crossFetch=__importStar$5(browserPonyfillExports),NON_RETRYABLE_STATUS_CODES=[400,401,403,404],IDEMPOTENT_HTTP_METHODS=["GET","HEAD","OPTIONS","PUT","DELETE"];async function fetchWithRetriesAndTimeout(Bt,Wt){const{timeout:Gt,abortController:Yt,signal:Xt,retryDelay:Jt}=Wt;let Zt=Wt.attempts,Qt=null,ur;do try{Gt&&(Qt=setTimeout(()=>{Yt.abort()},Gt));const cr=crossFetch.default(Bt.toString(),Object.assign(Object.assign({},Wt),{signal:Xt})),$r=Promise.race([cr,new Promise((Ar,Lr)=>{Xt.addEventListener("abort",()=>{Ar(new crossFetch.Response("timeout",{status:408,statusText:"Request Timeout"}))})})]);--Zt,ur=await $r,Qt&&clearTimeout(Qt)}finally{if(ur&&(ur.ok||NON_RETRYABLE_STATUS_CODES.includes(ur.status)||Zt===0))break;await new Promise(cr=>setTimeout(cr,Jt))}while((!ur||!ur.ok)&&Zt>0);return ur}function createFetchComponent(Bt){async function Wt(Gt,Yt){const Jt=Object.assign(Object.assign({},Bt==null?void 0:Bt.defaultFetcherOptions),Yt)||{},{timeout:Zt,method:Qt="GET",retryDelay:ur=0,abortController:cr}=Jt,$r=__rest(Jt,["timeout","method","retryDelay","abortController"]);let Ar=$r.attempts||1;const Lr=cr||new AbortController,{signal:qr}=Lr;Bt!=null&&Bt.defaultHeaders&&($r.headers=Object.assign(Object.assign({},Bt==null?void 0:Bt.defaultHeaders),$r.headers||{})),IDEMPOTENT_HTTP_METHODS.includes(Qt.toUpperCase())||(Ar=1);const Fr=await fetchWithRetriesAndTimeout(Gt,Object.assign(Object.assign({},$r),{attempts:Ar,method:Qt,timeout:Zt,retryDelay:ur,signal:qr,abortController:Lr}));if(!(Fr!=null&&Fr.ok)){const Hr=await(Fr==null?void 0:Fr.text());throw new Error(`Failed to fetch ${Gt}. Got status ${Fr==null?void 0:Fr.status}. Response was '${Hr}'`)}return qr.aborted?void 0:Fr}return{fetch:Wt}}fetcher$1.createFetchComponent=createFetchComponent;(function(Bt){Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createFetchComponent=void 0;var Wt=fetcher$1;Object.defineProperty(Bt,"createFetchComponent",{enumerable:!0,get:function(){return Wt.createFetchComponent}})})(dist$8);var dist$7={},CatalystClient={},ContentClient={},dist$6={},node={};const require$$1$5=getAugmentedNamespace(src$b);async function*batch$1(Bt,Wt=1){let Gt=[];Wt<1&&(Wt=1);for await(const Yt of Bt)for(Gt.push(Yt);Gt.length>=Wt;)yield Gt.slice(0,Wt),Gt=Gt.slice(Wt);for(;Gt.length;)yield Gt.slice(0,Wt),Gt=Gt.slice(Wt)}var itBatch=batch$1;const batch=itBatch;async function*parallelBatch$1(Bt,Wt=1){for await(const Gt of batch(Bt,Wt)){const Yt=Gt.map(Xt=>Xt().then(Jt=>({ok:!0,value:Jt}),Jt=>({ok:!1,err:Jt})));for(let Xt=0;Xt<Yt.length;Xt++){const Jt=await Yt[Xt];if(Jt.ok)yield Jt.value;else throw Jt.err}}}var itParallelBatch=parallelBatch$1,isPlainObj=Bt=>{if(Object.prototype.toString.call(Bt)!=="[object Object]")return!1;const Wt=Object.getPrototypeOf(Bt);return Wt===null||Wt===Object.prototype};const isOptionObject=isPlainObj,{hasOwnProperty:hasOwnProperty$6}=Object.prototype,{propertyIsEnumerable}=Object,defineProperty=(Bt,Wt,Gt)=>Object.defineProperty(Bt,Wt,{value:Gt,writable:!0,enumerable:!0,configurable:!0}),globalThis$1=commonjsGlobal,defaultMergeOptions={concatArrays:!1,ignoreUndefined:!1},getEnumerableOwnPropertyKeys=Bt=>{const Wt=[];for(const Gt in Bt)hasOwnProperty$6.call(Bt,Gt)&&Wt.push(Gt);if(Object.getOwnPropertySymbols){const Gt=Object.getOwnPropertySymbols(Bt);for(const Yt of Gt)propertyIsEnumerable.call(Bt,Yt)&&Wt.push(Yt)}return Wt};function clone$1(Bt){return Array.isArray(Bt)?cloneArray$1(Bt):isOptionObject(Bt)?cloneOptionObject(Bt):Bt}function cloneArray$1(Bt){const Wt=Bt.slice(0,0);return getEnumerableOwnPropertyKeys(Bt).forEach(Gt=>{defineProperty(Wt,Gt,clone$1(Bt[Gt]))}),Wt}function cloneOptionObject(Bt){const Wt=Object.getPrototypeOf(Bt)===null?Object.create(null):{};return getEnumerableOwnPropertyKeys(Bt).forEach(Gt=>{defineProperty(Wt,Gt,clone$1(Bt[Gt]))}),Wt}const mergeKeys=(Bt,Wt,Gt,Yt)=>(Gt.forEach(Xt=>{typeof Wt[Xt]>"u"&&Yt.ignoreUndefined||(Xt in Bt&&Bt[Xt]!==Object.getPrototypeOf(Bt)?defineProperty(Bt,Xt,merge$1(Bt[Xt],Wt[Xt],Yt)):defineProperty(Bt,Xt,clone$1(Wt[Xt])))}),Bt),concatArrays=(Bt,Wt,Gt)=>{let Yt=Bt.slice(0,0),Xt=0;return[Bt,Wt].forEach(Jt=>{const Zt=[];for(let Qt=0;Qt<Jt.length;Qt++)hasOwnProperty$6.call(Jt,Qt)&&(Zt.push(String(Qt)),Jt===Bt?defineProperty(Yt,Xt++,Jt[Qt]):defineProperty(Yt,Xt++,clone$1(Jt[Qt])));Yt=mergeKeys(Yt,Jt,getEnumerableOwnPropertyKeys(Jt).filter(Qt=>!Zt.includes(Qt)),Gt)}),Yt};function merge$1(Bt,Wt,Gt){return Gt.concatArrays&&Array.isArray(Bt)&&Array.isArray(Wt)?concatArrays(Bt,Wt,Gt):!isOptionObject(Wt)||!isOptionObject(Bt)?clone$1(Wt):mergeKeys(Bt,Wt,getEnumerableOwnPropertyKeys(Wt),Gt)}var mergeOptions$1=function(...Bt){const Wt=merge$1(clone$1(defaultMergeOptions),this!==globalThis$1&&this||{},defaultMergeOptions);let Gt={_:{}};for(const Yt of Bt)if(Yt!==void 0){if(!isOptionObject(Yt))throw new TypeError("`"+Yt+"` is not an Option Object");Gt=merge$1(Gt,{_:Yt},Wt)}return Gt._};function assign(Bt,Wt){for(const Gt in Wt)Object.defineProperty(Bt,Gt,{value:Wt[Gt],enumerable:!0,configurable:!0});return Bt}function createError$1(Bt,Wt,Gt){if(!Bt||typeof Bt=="string")throw new TypeError("Please pass an Error to err-code");Gt||(Gt={}),typeof Wt=="object"&&(Gt=Wt,Wt=""),Wt&&(Gt.code=Wt);try{return assign(Bt,Gt)}catch{Gt.message=Bt.message,Gt.stack=Bt.stack;const Xt=function(){};return Xt.prototype=Object.create(Object.getPrototypeOf(Bt)),assign(new Xt,Gt)}}var errCode=createError$1,src$a={exports:{}};function base$1(Bt){if(Bt.length>=255)throw new TypeError("Alphabet too long");for(var Wt=new Uint8Array(256),Gt=0;Gt<Wt.length;Gt++)Wt[Gt]=255;for(var Yt=0;Yt<Bt.length;Yt++){var Xt=Bt.charAt(Yt),Jt=Xt.charCodeAt(0);if(Wt[Jt]!==255)throw new TypeError(Xt+" is ambiguous");Wt[Jt]=Yt}var Zt=Bt.length,Qt=Bt.charAt(0),ur=Math.log(Zt)/Math.log(256),cr=Math.log(256)/Math.log(Zt);function $r(qr){if(qr instanceof Uint8Array||(ArrayBuffer.isView(qr)?qr=new Uint8Array(qr.buffer,qr.byteOffset,qr.byteLength):Array.isArray(qr)&&(qr=Uint8Array.from(qr))),!(qr instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(qr.length===0)return"";for(var Fr=0,Hr=0,Br=0,Wr=qr.length;Br!==Wr&&qr[Br]===0;)Br++,Fr++;for(var Gr=(Wr-Br)*cr+1>>>0,Kr=new Uint8Array(Gr);Br!==Wr;){for(var Yr=qr[Br],hn=0,Qr=Gr-1;(Yr!==0||hn<Hr)&&Qr!==-1;Qr--,hn++)Yr+=256*Kr[Qr]>>>0,Kr[Qr]=Yr%Zt>>>0,Yr=Yr/Zt>>>0;if(Yr!==0)throw new Error("Non-zero carry");Hr=hn,Br++}for(var pn=Gr-Hr;pn!==Gr&&Kr[pn]===0;)pn++;for(var En=Qt.repeat(Fr);pn<Gr;++pn)En+=Bt.charAt(Kr[pn]);return En}function Ar(qr){if(typeof qr!="string")throw new TypeError("Expected String");if(qr.length===0)return new Uint8Array;var Fr=0;if(qr[Fr]!==" "){for(var Hr=0,Br=0;qr[Fr]===Qt;)Hr++,Fr++;for(var Wr=(qr.length-Fr)*ur+1>>>0,Gr=new Uint8Array(Wr);qr[Fr];){var Kr=Wt[qr.charCodeAt(Fr)];if(Kr===255)return;for(var Yr=0,hn=Wr-1;(Kr!==0||Yr<Br)&&hn!==-1;hn--,Yr++)Kr+=Zt*Gr[hn]>>>0,Gr[hn]=Kr%256>>>0,Kr=Kr/256>>>0;if(Kr!==0)throw new Error("Non-zero carry");Br=Yr,Fr++}if(qr[Fr]!==" "){for(var Qr=Wr-Br;Qr!==Wr&&Gr[Qr]===0;)Qr++;for(var pn=new Uint8Array(Hr+(Wr-Qr)),En=Hr;Qr!==Wr;)pn[En++]=Gr[Qr++];return pn}}}function Lr(qr){var Fr=Ar(qr);if(Fr)return Fr;throw new Error("Non-base"+Zt+" character")}return{encode:$r,decodeUnsafe:Ar,decode:Lr}}var src$9=base$1;const textDecoder=new TextDecoder,decodeText$1=Bt=>textDecoder.decode(Bt),textEncoder=new TextEncoder,encodeText$2=Bt=>textEncoder.encode(Bt);function concat(Bt,Wt){const Gt=new Uint8Array(Wt);let Yt=0;for(const Xt of Bt)Gt.set(Xt,Yt),Yt+=Xt.length;return Gt}var util$5={decodeText:decodeText$1,encodeText:encodeText$2,concat};const{encodeText:encodeText$1}=util$5;let Base$1=class{constructor(Wt,Gt,Yt,Xt){this.name=Wt,this.code=Gt,this.codeBuf=encodeText$1(this.code),this.alphabet=Xt,this.codec=Yt(Xt)}encode(Wt){return this.codec.encode(Wt)}decode(Wt){for(const Gt of Wt)if(this.alphabet&&this.alphabet.indexOf(Gt)<0)throw new Error(`invalid character '${Gt}' in '${Wt}'`);return this.codec.decode(Wt)}};var base=Base$1;const decode$3=(Bt,Wt,Gt)=>{const Yt={};for(let cr=0;cr<Wt.length;++cr)Yt[Wt[cr]]=cr;let Xt=Bt.length;for(;Bt[Xt-1]==="=";)--Xt;const Jt=new Uint8Array(Xt*Gt/8|0);let Zt=0,Qt=0,ur=0;for(let cr=0;cr<Xt;++cr){const $r=Yt[Bt[cr]];if($r===void 0)throw new SyntaxError("Invalid character "+Bt[cr]);Qt=Qt<<Gt|$r,Zt+=Gt,Zt>=8&&(Zt-=8,Jt[ur++]=255&Qt>>Zt)}if(Zt>=Gt||255&Qt<<8-Zt)throw new SyntaxError("Unexpected end of data");return Jt},encode$3=(Bt,Wt,Gt)=>{const Yt=Wt[Wt.length-1]==="=",Xt=(1<<Gt)-1;let Jt="",Zt=0,Qt=0;for(let ur=0;ur<Bt.length;++ur)for(Qt=Qt<<8|Bt[ur],Zt+=8;Zt>Gt;)Zt-=Gt,Jt+=Wt[Xt&Qt>>Zt];if(Zt&&(Jt+=Wt[Xt&Qt<<Gt-Zt]),Yt)for(;Jt.length*Gt&7;)Jt+="=";return Jt},rfc4648$1=Bt=>Wt=>({encode(Gt){return encode$3(Gt,Wt,Bt)},decode(Gt){return decode$3(Gt,Wt,Bt)}});var rfc4648_1={rfc4648:rfc4648$1};const baseX=src$9,Base=base,{rfc4648}=rfc4648_1,{decodeText,encodeText}=util$5,identity$2=()=>({encode:decodeText,decode:encodeText}),constants$1=[["identity","\0",identity$2,""],["base2","0",rfc4648(1),"01"],["base8","7",rfc4648(3),"01234567"],["base10","9",baseX,"0123456789"],["base16","f",rfc4648(4),"0123456789abcdef"],["base16upper","F",rfc4648(4),"0123456789ABCDEF"],["base32hex","v",rfc4648(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",rfc4648(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",rfc4648(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",rfc4648(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",rfc4648(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",rfc4648(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",rfc4648(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",rfc4648(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",rfc4648(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",baseX,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",baseX,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",baseX,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",baseX,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",rfc4648(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],names$2=constants$1.reduce((Bt,Wt)=>(Bt[Wt[0]]=new Base(Wt[0],Wt[1],Wt[2],Wt[3]),Bt),{}),codes$1=constants$1.reduce((Bt,Wt)=>(Bt[Wt[1]]=names$2[Wt[0]],Bt),{});var constants_1={names:names$2,codes:codes$1};(function(Bt,Wt){const Gt=constants_1,{encodeText:Yt,decodeText:Xt,concat:Jt}=util$5;function Zt(Hr,Br){if(!Br)throw new Error("requires an encoded Uint8Array");const{name:Wr,codeBuf:Gr}=Ar(Hr);return $r(Wr,Br),Jt([Gr,Br],Gr.length+Br.length)}function Qt(Hr,Br){const Wr=Ar(Hr),Gr=Yt(Wr.encode(Br));return Jt([Wr.codeBuf,Gr],Wr.codeBuf.length+Gr.length)}function ur(Hr){Hr instanceof Uint8Array&&(Hr=Xt(Hr));const Br=Hr[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(Br)&&(Hr=Hr.toLowerCase()),Ar(Hr[0]).decode(Hr.substring(1))}function cr(Hr){if(Hr instanceof Uint8Array&&(Hr=Xt(Hr)),Object.prototype.toString.call(Hr)!=="[object String]")return!1;try{return Ar(Hr[0]).name}catch{return!1}}function $r(Hr,Br){Ar(Hr).decode(Xt(Br))}function Ar(Hr){if(Object.prototype.hasOwnProperty.call(Gt.names,Hr))return Gt.names[Hr];if(Object.prototype.hasOwnProperty.call(Gt.codes,Hr))return Gt.codes[Hr];throw new Error(`Unsupported encoding: ${Hr}`)}function Lr(Hr){return Hr instanceof Uint8Array&&(Hr=Xt(Hr)),Ar(Hr[0])}Wt=Bt.exports=Zt,Wt.encode=Qt,Wt.decode=ur,Wt.isEncoded=cr,Wt.encoding=Ar,Wt.encodingFromData=Lr;const qr=Object.freeze(Gt.names),Fr=Object.freeze(Gt.codes);Wt.names=qr,Wt.codes=Fr})(src$a,src$a.exports);var srcExports=src$a.exports,encode_1$1=encode$2,MSB$1=128,REST$1=127,MSBALL=~REST$1,INT=Math.pow(2,31);function encode$2(Bt,Wt,Gt){Wt=Wt||[],Gt=Gt||0;for(var Yt=Gt;Bt>=INT;)Wt[Gt++]=Bt&255|MSB$1,Bt/=128;for(;Bt&MSBALL;)Wt[Gt++]=Bt&255|MSB$1,Bt>>>=7;return Wt[Gt]=Bt|0,encode$2.bytes=Gt-Yt+1,Wt}var decode$2=read,MSB=128,REST=127;function read(Bt,Yt){var Gt=0,Yt=Yt||0,Xt=0,Jt=Yt,Zt,Qt=Bt.length;do{if(Jt>=Qt)throw read.bytes=0,new RangeError("Could not decode varint");Zt=Bt[Jt++],Gt+=Xt<28?(Zt&REST)<<Xt:(Zt&REST)*Math.pow(2,Xt),Xt+=7}while(Zt>=MSB);return read.bytes=Jt-Yt,Gt}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$1=function(Bt){return Bt<N1?1:Bt<N2?2:Bt<N3?3:Bt<N4?4:Bt<N5?5:Bt<N6?6:Bt<N7?7:Bt<N8?8:Bt<N9?9:10},varint$2={encode:encode_1$1,decode:decode$2,encodingLength:length$1};const names$1=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});var constants={names:names$1};const require$$5$1=getAugmentedNamespace(toString$a),require$$1$4=getAugmentedNamespace(fromString$1),require$$1$3=getAugmentedNamespace(concat$4),multibase=srcExports,varint$1=varint$2,{names}=constants,{toString:uint8ArrayToString}=require$$5$1,{fromString:uint8ArrayFromString$1}=require$$1$4,{concat:uint8ArrayConcat}=require$$1$3,codes={};for(const Bt in names){const Wt=Bt;codes[names[Wt]]=Wt}Object.freeze(codes);function toHexString(Bt){if(!(Bt instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return uint8ArrayToString(Bt,"base16")}function fromHexString(Bt){return uint8ArrayFromString$1(Bt,"base16")}function toB58String(Bt){if(!(Bt instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return uint8ArrayToString(multibase.encode("base58btc",Bt)).slice(1)}function fromB58String(Bt){const Wt=Bt instanceof Uint8Array?uint8ArrayToString(Bt):Bt;return multibase.decode("z"+Wt)}function decode$1(Bt){if(!(Bt instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(Bt.length<2)throw new Error("multihash too short. must be > 2 bytes.");const Wt=varint$1.decode(Bt);if(!isValidCode(Wt))throw new Error(`multihash unknown function code: 0x${Wt.toString(16)}`);Bt=Bt.slice(varint$1.decode.bytes);const Gt=varint$1.decode(Bt);if(Gt<0)throw new Error(`multihash invalid length: ${Gt}`);if(Bt=Bt.slice(varint$1.decode.bytes),Bt.length!==Gt)throw new Error(`multihash length inconsistent: 0x${uint8ArrayToString(Bt,"base16")}`);return{code:Wt,name:codes[Wt],length:Gt,digest:Bt}}function encode$1(Bt,Wt,Gt){if(!Bt||Wt===void 0)throw new Error("multihash encode requires at least two args: digest, code");const Yt=coerceCode(Wt);if(!(Bt instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(Gt==null&&(Gt=Bt.length),Gt&&Bt.length!==Gt)throw new Error("digest length should be equal to specified length.");const Xt=varint$1.encode(Yt),Jt=varint$1.encode(Gt);return uint8ArrayConcat([Xt,Jt,Bt],Xt.length+Jt.length+Bt.length)}function coerceCode(Bt){let Wt=Bt;if(typeof Bt=="string"){if(names[Bt]===void 0)throw new Error(`Unrecognized hash function named: ${Bt}`);Wt=names[Bt]}if(typeof Wt!="number")throw new Error(`Hash function code should be a number. Got: ${Wt}`);if(codes[Wt]===void 0&&!isAppCode(Wt))throw new Error(`Unrecognized function code: ${Wt}`);return Wt}function isAppCode(Bt){return Bt>0&&Bt<16}function isValidCode(Bt){return!!(isAppCode(Bt)||codes[Bt])}function validate(Bt){decode$1(Bt)}function prefix(Bt){return validate(Bt),Bt.subarray(0,2)}var src$8={names,codes,toHexString,fromHexString,toB58String,fromB58String,decode:decode$1,encode:encode$1,coerceCode,isAppCode,validate,prefix,isValidCode},murmurHash3js={exports:{}};(function(Bt,Wt){(function(Gt,Yt){var Xt={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function Jt(Hr){if(!Array.isArray(Hr)&&!ArrayBuffer.isView(Hr))return!1;for(var Br=0;Br<Hr.length;Br++)if(!Number.isInteger(Hr[Br])||Hr[Br]<0||Hr[Br]>255)return!1;return!0}function Zt(Hr,Br){return(Hr&65535)*Br+(((Hr>>>16)*Br&65535)<<16)}function Qt(Hr,Br){return Hr<<Br|Hr>>>32-Br}function ur(Hr){return Hr^=Hr>>>16,Hr=Zt(Hr,2246822507),Hr^=Hr>>>13,Hr=Zt(Hr,3266489909),Hr^=Hr>>>16,Hr}function cr(Hr,Br){Hr=[Hr[0]>>>16,Hr[0]&65535,Hr[1]>>>16,Hr[1]&65535],Br=[Br[0]>>>16,Br[0]&65535,Br[1]>>>16,Br[1]&65535];var Wr=[0,0,0,0];return Wr[3]+=Hr[3]+Br[3],Wr[2]+=Wr[3]>>>16,Wr[3]&=65535,Wr[2]+=Hr[2]+Br[2],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[1]+=Hr[1]+Br[1],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[0]+=Hr[0]+Br[0],Wr[0]&=65535,[Wr[0]<<16|Wr[1],Wr[2]<<16|Wr[3]]}function $r(Hr,Br){Hr=[Hr[0]>>>16,Hr[0]&65535,Hr[1]>>>16,Hr[1]&65535],Br=[Br[0]>>>16,Br[0]&65535,Br[1]>>>16,Br[1]&65535];var Wr=[0,0,0,0];return Wr[3]+=Hr[3]*Br[3],Wr[2]+=Wr[3]>>>16,Wr[3]&=65535,Wr[2]+=Hr[2]*Br[3],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[2]+=Hr[3]*Br[2],Wr[1]+=Wr[2]>>>16,Wr[2]&=65535,Wr[1]+=Hr[1]*Br[3],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[1]+=Hr[2]*Br[2],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[1]+=Hr[3]*Br[1],Wr[0]+=Wr[1]>>>16,Wr[1]&=65535,Wr[0]+=Hr[0]*Br[3]+Hr[1]*Br[2]+Hr[2]*Br[1]+Hr[3]*Br[0],Wr[0]&=65535,[Wr[0]<<16|Wr[1],Wr[2]<<16|Wr[3]]}function Ar(Hr,Br){return Br%=64,Br===32?[Hr[1],Hr[0]]:Br<32?[Hr[0]<<Br|Hr[1]>>>32-Br,Hr[1]<<Br|Hr[0]>>>32-Br]:(Br-=32,[Hr[1]<<Br|Hr[0]>>>32-Br,Hr[0]<<Br|Hr[1]>>>32-Br])}function Lr(Hr,Br){return Br%=64,Br===0?Hr:Br<32?[Hr[0]<<Br|Hr[1]>>>32-Br,Hr[1]<<Br]:[Hr[1]<<Br-32,0]}function qr(Hr,Br){return[Hr[0]^Br[0],Hr[1]^Br[1]]}function Fr(Hr){return Hr=qr(Hr,[0,Hr[0]>>>1]),Hr=$r(Hr,[4283543511,3981806797]),Hr=qr(Hr,[0,Hr[0]>>>1]),Hr=$r(Hr,[3301882366,444984403]),Hr=qr(Hr,[0,Hr[0]>>>1]),Hr}Xt.x86.hash32=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%4,Gr=Hr.length-Wr,Kr=Br,Yr=0,hn=3432918353,Qr=461845907,pn=0;pn<Gr;pn=pn+4)Yr=Hr[pn]|Hr[pn+1]<<8|Hr[pn+2]<<16|Hr[pn+3]<<24,Yr=Zt(Yr,hn),Yr=Qt(Yr,15),Yr=Zt(Yr,Qr),Kr^=Yr,Kr=Qt(Kr,13),Kr=Zt(Kr,5)+3864292196;switch(Yr=0,Wr){case 3:Yr^=Hr[pn+2]<<16;case 2:Yr^=Hr[pn+1]<<8;case 1:Yr^=Hr[pn],Yr=Zt(Yr,hn),Yr=Qt(Yr,15),Yr=Zt(Yr,Qr),Kr^=Yr}return Kr^=Hr.length,Kr=ur(Kr),Kr>>>0},Xt.x86.hash128=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%16,Gr=Hr.length-Wr,Kr=Br,Yr=Br,hn=Br,Qr=Br,pn=0,En=0,ga=0,dn=0,Pr=597399067,xr=2869860233,Mr=951274213,Nr=2716044179,Ur=0;Ur<Gr;Ur=Ur+16)pn=Hr[Ur]|Hr[Ur+1]<<8|Hr[Ur+2]<<16|Hr[Ur+3]<<24,En=Hr[Ur+4]|Hr[Ur+5]<<8|Hr[Ur+6]<<16|Hr[Ur+7]<<24,ga=Hr[Ur+8]|Hr[Ur+9]<<8|Hr[Ur+10]<<16|Hr[Ur+11]<<24,dn=Hr[Ur+12]|Hr[Ur+13]<<8|Hr[Ur+14]<<16|Hr[Ur+15]<<24,pn=Zt(pn,Pr),pn=Qt(pn,15),pn=Zt(pn,xr),Kr^=pn,Kr=Qt(Kr,19),Kr+=Yr,Kr=Zt(Kr,5)+1444728091,En=Zt(En,xr),En=Qt(En,16),En=Zt(En,Mr),Yr^=En,Yr=Qt(Yr,17),Yr+=hn,Yr=Zt(Yr,5)+197830471,ga=Zt(ga,Mr),ga=Qt(ga,17),ga=Zt(ga,Nr),hn^=ga,hn=Qt(hn,15),hn+=Qr,hn=Zt(hn,5)+2530024501,dn=Zt(dn,Nr),dn=Qt(dn,18),dn=Zt(dn,Pr),Qr^=dn,Qr=Qt(Qr,13),Qr+=Kr,Qr=Zt(Qr,5)+850148119;switch(pn=0,En=0,ga=0,dn=0,Wr){case 15:dn^=Hr[Ur+14]<<16;case 14:dn^=Hr[Ur+13]<<8;case 13:dn^=Hr[Ur+12],dn=Zt(dn,Nr),dn=Qt(dn,18),dn=Zt(dn,Pr),Qr^=dn;case 12:ga^=Hr[Ur+11]<<24;case 11:ga^=Hr[Ur+10]<<16;case 10:ga^=Hr[Ur+9]<<8;case 9:ga^=Hr[Ur+8],ga=Zt(ga,Mr),ga=Qt(ga,17),ga=Zt(ga,Nr),hn^=ga;case 8:En^=Hr[Ur+7]<<24;case 7:En^=Hr[Ur+6]<<16;case 6:En^=Hr[Ur+5]<<8;case 5:En^=Hr[Ur+4],En=Zt(En,xr),En=Qt(En,16),En=Zt(En,Mr),Yr^=En;case 4:pn^=Hr[Ur+3]<<24;case 3:pn^=Hr[Ur+2]<<16;case 2:pn^=Hr[Ur+1]<<8;case 1:pn^=Hr[Ur],pn=Zt(pn,Pr),pn=Qt(pn,15),pn=Zt(pn,xr),Kr^=pn}return Kr^=Hr.length,Yr^=Hr.length,hn^=Hr.length,Qr^=Hr.length,Kr+=Yr,Kr+=hn,Kr+=Qr,Yr+=Kr,hn+=Kr,Qr+=Kr,Kr=ur(Kr),Yr=ur(Yr),hn=ur(hn),Qr=ur(Qr),Kr+=Yr,Kr+=hn,Kr+=Qr,Yr+=Kr,hn+=Kr,Qr+=Kr,("00000000"+(Kr>>>0).toString(16)).slice(-8)+("00000000"+(Yr>>>0).toString(16)).slice(-8)+("00000000"+(hn>>>0).toString(16)).slice(-8)+("00000000"+(Qr>>>0).toString(16)).slice(-8)},Xt.x64.hash128=function(Hr,Br){if(Xt.inputValidation&&!Jt(Hr))return Yt;Br=Br||0;for(var Wr=Hr.length%16,Gr=Hr.length-Wr,Kr=[0,Br],Yr=[0,Br],hn=[0,0],Qr=[0,0],pn=[2277735313,289559509],En=[1291169091,658871167],ga=0;ga<Gr;ga=ga+16)hn=[Hr[ga+4]|Hr[ga+5]<<8|Hr[ga+6]<<16|Hr[ga+7]<<24,Hr[ga]|Hr[ga+1]<<8|Hr[ga+2]<<16|Hr[ga+3]<<24],Qr=[Hr[ga+12]|Hr[ga+13]<<8|Hr[ga+14]<<16|Hr[ga+15]<<24,Hr[ga+8]|Hr[ga+9]<<8|Hr[ga+10]<<16|Hr[ga+11]<<24],hn=$r(hn,pn),hn=Ar(hn,31),hn=$r(hn,En),Kr=qr(Kr,hn),Kr=Ar(Kr,27),Kr=cr(Kr,Yr),Kr=cr($r(Kr,[0,5]),[0,1390208809]),Qr=$r(Qr,En),Qr=Ar(Qr,33),Qr=$r(Qr,pn),Yr=qr(Yr,Qr),Yr=Ar(Yr,31),Yr=cr(Yr,Kr),Yr=cr($r(Yr,[0,5]),[0,944331445]);switch(hn=[0,0],Qr=[0,0],Wr){case 15:Qr=qr(Qr,Lr([0,Hr[ga+14]],48));case 14:Qr=qr(Qr,Lr([0,Hr[ga+13]],40));case 13:Qr=qr(Qr,Lr([0,Hr[ga+12]],32));case 12:Qr=qr(Qr,Lr([0,Hr[ga+11]],24));case 11:Qr=qr(Qr,Lr([0,Hr[ga+10]],16));case 10:Qr=qr(Qr,Lr([0,Hr[ga+9]],8));case 9:Qr=qr(Qr,[0,Hr[ga+8]]),Qr=$r(Qr,En),Qr=Ar(Qr,33),Qr=$r(Qr,pn),Yr=qr(Yr,Qr);case 8:hn=qr(hn,Lr([0,Hr[ga+7]],56));case 7:hn=qr(hn,Lr([0,Hr[ga+6]],48));case 6:hn=qr(hn,Lr([0,Hr[ga+5]],40));case 5:hn=qr(hn,Lr([0,Hr[ga+4]],32));case 4:hn=qr(hn,Lr([0,Hr[ga+3]],24));case 3:hn=qr(hn,Lr([0,Hr[ga+2]],16));case 2:hn=qr(hn,Lr([0,Hr[ga+1]],8));case 1:hn=qr(hn,[0,Hr[ga]]),hn=$r(hn,pn),hn=Ar(hn,31),hn=$r(hn,En),Kr=qr(Kr,hn)}return Kr=qr(Kr,[0,Hr.length]),Yr=qr(Yr,[0,Hr.length]),Kr=cr(Kr,Yr),Yr=cr(Yr,Kr),Kr=Fr(Kr),Yr=Fr(Yr),Kr=cr(Kr,Yr),Yr=cr(Yr,Kr),("00000000"+(Kr[0]>>>0).toString(16)).slice(-8)+("00000000"+(Kr[1]>>>0).toString(16)).slice(-8)+("00000000"+(Yr[0]>>>0).toString(16)).slice(-8)+("00000000"+(Yr[1]>>>0).toString(16)).slice(-8)},Bt.exports&&(Wt=Bt.exports=Xt),Wt.murmurHash3=Xt})()})(murmurHash3js,murmurHash3js.exports);var murmurHash3jsExports=murmurHash3js.exports,murmurhash3jsRevisited=murmurHash3jsExports;const multihash$1=src$8,crypto$5=self.crypto||self.msCrypto,digest=async(Bt,Wt)=>{if(typeof self>"u"||!crypto$5)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");switch(Wt){case"sha1":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-1"},Bt));case"sha2-256":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-256"},Bt));case"sha2-512":return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-512"},Bt));case"dbl-sha2-256":{const Gt=await crypto$5.subtle.digest({name:"SHA-256"},Bt);return new Uint8Array(await crypto$5.subtle.digest({name:"SHA-256"},Gt))}default:throw new Error(`${Wt} is not a supported algorithm`)}};var sha_browser={factory:Bt=>async Wt=>digest(Wt,Bt),digest,multihashing:async(Bt,Wt,Gt)=>{const Yt=await digest(Bt,Wt);return multihash$1.encode(Yt,Wt,Gt)}};const fromNumberTo32BitBuf$1=Bt=>{const Wt=new Uint8Array(4);for(let Gt=0;Gt<4;Gt++)Wt[Gt]=Bt&255,Bt=Bt>>8;return Wt};var utils$g={fromNumberTo32BitBuf:fromNumberTo32BitBuf$1},util$4,hasRequiredUtil$3;function requireUtil$3(){if(hasRequiredUtil$3)return util$4;hasRequiredUtil$3=1;const Bt="Input must be an string, Buffer or Uint8Array";function Wt(Zt){let Qt;if(Zt instanceof Uint8Array)Qt=Zt;else if(typeof Zt=="string")Qt=new TextEncoder().encode(Zt);else throw new Error(Bt);return Qt}function Gt(Zt){return Array.prototype.map.call(Zt,function(Qt){return(Qt<16?"0":"")+Qt.toString(16)}).join("")}function Yt(Zt){return(4294967296+Zt).toString(16).substring(1)}function Xt(Zt,Qt,ur){let cr=`
902
902
  `+Zt+" = ";for(let $r=0;$r<Qt.length;$r+=2){if(ur===32)cr+=Yt(Qt[$r]).toUpperCase(),cr+=" ",cr+=Yt(Qt[$r+1]).toUpperCase();else if(ur===64)cr+=Yt(Qt[$r+1]).toUpperCase(),cr+=Yt(Qt[$r]).toUpperCase();else throw new Error("Invalid size "+ur);$r%6===4?cr+=`
903
903
  `+new Array(Zt.length+4).join(" "):$r<Qt.length-2&&(cr+=" ")}console.log(cr)}function Jt(Zt,Qt,ur){let cr=new Date().getTime();const $r=new Uint8Array(Qt);for(let Lr=0;Lr<Qt;Lr++)$r[Lr]=Lr%256;const Ar=new Date().getTime();console.log("Generated random input in "+(Ar-cr)+"ms"),cr=Ar;for(let Lr=0;Lr<ur;Lr++){const qr=Zt($r),Fr=new Date().getTime(),Hr=Fr-cr;cr=Fr,console.log("Hashed in "+Hr+"ms: "+qr.substring(0,20)+"..."),console.log(Math.round(Qt/(1<<20)/(Hr/1e3)*100)/100+" MB PER SECOND")}}return util$4={normalizeInput:Wt,toHex:Gt,debugPrint:Xt,testSpeed:Jt},util$4}var blake2b_1,hasRequiredBlake2b;function requireBlake2b(){if(hasRequiredBlake2b)return blake2b_1;hasRequiredBlake2b=1;const Bt=requireUtil$3();function Wt(Wr,Gr,Kr){const Yr=Wr[Gr]+Wr[Kr];let hn=Wr[Gr+1]+Wr[Kr+1];Yr>=4294967296&&hn++,Wr[Gr]=Yr,Wr[Gr+1]=hn}function Gt(Wr,Gr,Kr,Yr){let hn=Wr[Gr]+Kr;Kr<0&&(hn+=4294967296);let Qr=Wr[Gr+1]+Yr;hn>=4294967296&&Qr++,Wr[Gr]=hn,Wr[Gr+1]=Qr}function Yt(Wr,Gr){return Wr[Gr]^Wr[Gr+1]<<8^Wr[Gr+2]<<16^Wr[Gr+3]<<24}function Xt(Wr,Gr,Kr,Yr,hn,Qr){const pn=cr[hn],En=cr[hn+1],ga=cr[Qr],dn=cr[Qr+1];Wt(ur,Wr,Gr),Gt(ur,Wr,pn,En);let Pr=ur[Yr]^ur[Wr],xr=ur[Yr+1]^ur[Wr+1];ur[Yr]=xr,ur[Yr+1]=Pr,Wt(ur,Kr,Yr),Pr=ur[Gr]^ur[Kr],xr=ur[Gr+1]^ur[Kr+1],ur[Gr]=Pr>>>24^xr<<8,ur[Gr+1]=xr>>>24^Pr<<8,Wt(ur,Wr,Gr),Gt(ur,Wr,ga,dn),Pr=ur[Yr]^ur[Wr],xr=ur[Yr+1]^ur[Wr+1],ur[Yr]=Pr>>>16^xr<<16,ur[Yr+1]=xr>>>16^Pr<<16,Wt(ur,Kr,Yr),Pr=ur[Gr]^ur[Kr],xr=ur[Gr+1]^ur[Kr+1],ur[Gr]=xr>>>31^Pr<<1,ur[Gr+1]=Pr>>>31^xr<<1}const Jt=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Zt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],Qt=new Uint8Array(Zt.map(function(Wr){return Wr*2})),ur=new Uint32Array(32),cr=new Uint32Array(32);function $r(Wr,Gr){let Kr=0;for(Kr=0;Kr<16;Kr++)ur[Kr]=Wr.h[Kr],ur[Kr+16]=Jt[Kr];for(ur[24]=ur[24]^Wr.t,ur[25]=ur[25]^Wr.t/4294967296,Gr&&(ur[28]=~ur[28],ur[29]=~ur[29]),Kr=0;Kr<32;Kr++)cr[Kr]=Yt(Wr.b,4*Kr);for(Kr=0;Kr<12;Kr++)Xt(0,8,16,24,Qt[Kr*16+0],Qt[Kr*16+1]),Xt(2,10,18,26,Qt[Kr*16+2],Qt[Kr*16+3]),Xt(4,12,20,28,Qt[Kr*16+4],Qt[Kr*16+5]),Xt(6,14,22,30,Qt[Kr*16+6],Qt[Kr*16+7]),Xt(0,10,20,30,Qt[Kr*16+8],Qt[Kr*16+9]),Xt(2,12,22,24,Qt[Kr*16+10],Qt[Kr*16+11]),Xt(4,14,16,26,Qt[Kr*16+12],Qt[Kr*16+13]),Xt(6,8,18,28,Qt[Kr*16+14],Qt[Kr*16+15]);for(Kr=0;Kr<16;Kr++)Wr.h[Kr]=Wr.h[Kr]^ur[Kr]^ur[Kr+16]}const Ar=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Lr(Wr,Gr,Kr,Yr){if(Wr===0||Wr>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(Gr&&Gr.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(Kr&&Kr.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(Yr&&Yr.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const hn={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:Wr};Ar.fill(0),Ar[0]=Wr,Gr&&(Ar[1]=Gr.length),Ar[2]=1,Ar[3]=1,Kr&&Ar.set(Kr,32),Yr&&Ar.set(Yr,48);for(let Qr=0;Qr<16;Qr++)hn.h[Qr]=Jt[Qr]^Yt(Ar,Qr*4);return Gr&&(qr(hn,Gr),hn.c=128),hn}function qr(Wr,Gr){for(let Kr=0;Kr<Gr.length;Kr++)Wr.c===128&&(Wr.t+=Wr.c,$r(Wr,!1),Wr.c=0),Wr.b[Wr.c++]=Gr[Kr]}function Fr(Wr){for(Wr.t+=Wr.c;Wr.c<128;)Wr.b[Wr.c++]=0;$r(Wr,!0);const Gr=new Uint8Array(Wr.outlen);for(let Kr=0;Kr<Wr.outlen;Kr++)Gr[Kr]=Wr.h[Kr>>2]>>8*(Kr&3);return Gr}function Hr(Wr,Gr,Kr,Yr,hn){Kr=Kr||64,Wr=Bt.normalizeInput(Wr),Yr&&(Yr=Bt.normalizeInput(Yr)),hn&&(hn=Bt.normalizeInput(hn));const Qr=Lr(Kr,Gr,Yr,hn);return qr(Qr,Wr),Fr(Qr)}function Br(Wr,Gr,Kr,Yr,hn){const Qr=Hr(Wr,Gr,Kr,Yr,hn);return Bt.toHex(Qr)}return blake2b_1={blake2b:Hr,blake2bHex:Br,blake2bInit:Lr,blake2bUpdate:qr,blake2bFinal:Fr},blake2b_1}var blake2s_1,hasRequiredBlake2s;function requireBlake2s(){if(hasRequiredBlake2s)return blake2s_1;hasRequiredBlake2s=1;const Bt=requireUtil$3();function Wt(Fr,Hr){return Fr[Hr]^Fr[Hr+1]<<8^Fr[Hr+2]<<16^Fr[Hr+3]<<24}function Gt(Fr,Hr,Br,Wr,Gr,Kr){Zt[Fr]=Zt[Fr]+Zt[Hr]+Gr,Zt[Wr]=Yt(Zt[Wr]^Zt[Fr],16),Zt[Br]=Zt[Br]+Zt[Wr],Zt[Hr]=Yt(Zt[Hr]^Zt[Br],12),Zt[Fr]=Zt[Fr]+Zt[Hr]+Kr,Zt[Wr]=Yt(Zt[Wr]^Zt[Fr],8),Zt[Br]=Zt[Br]+Zt[Wr],Zt[Hr]=Yt(Zt[Hr]^Zt[Br],7)}function Yt(Fr,Hr){return Fr>>>Hr^Fr<<32-Hr}const Xt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Jt=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),Zt=new Uint32Array(16),Qt=new Uint32Array(16);function ur(Fr,Hr){let Br=0;for(Br=0;Br<8;Br++)Zt[Br]=Fr.h[Br],Zt[Br+8]=Xt[Br];for(Zt[12]^=Fr.t,Zt[13]^=Fr.t/4294967296,Hr&&(Zt[14]=~Zt[14]),Br=0;Br<16;Br++)Qt[Br]=Wt(Fr.b,4*Br);for(Br=0;Br<10;Br++)Gt(0,4,8,12,Qt[Jt[Br*16+0]],Qt[Jt[Br*16+1]]),Gt(1,5,9,13,Qt[Jt[Br*16+2]],Qt[Jt[Br*16+3]]),Gt(2,6,10,14,Qt[Jt[Br*16+4]],Qt[Jt[Br*16+5]]),Gt(3,7,11,15,Qt[Jt[Br*16+6]],Qt[Jt[Br*16+7]]),Gt(0,5,10,15,Qt[Jt[Br*16+8]],Qt[Jt[Br*16+9]]),Gt(1,6,11,12,Qt[Jt[Br*16+10]],Qt[Jt[Br*16+11]]),Gt(2,7,8,13,Qt[Jt[Br*16+12]],Qt[Jt[Br*16+13]]),Gt(3,4,9,14,Qt[Jt[Br*16+14]],Qt[Jt[Br*16+15]]);for(Br=0;Br<8;Br++)Fr.h[Br]^=Zt[Br]^Zt[Br+8]}function cr(Fr,Hr){if(!(Fr>0&&Fr<=32))throw new Error("Incorrect output length, should be in [1, 32]");const Br=Hr?Hr.length:0;if(Hr&&!(Br>0&&Br<=32))throw new Error("Incorrect key length, should be in [1, 32]");const Wr={h:new Uint32Array(Xt),b:new Uint8Array(64),c:0,t:0,outlen:Fr};return Wr.h[0]^=16842752^Br<<8^Fr,Br>0&&($r(Wr,Hr),Wr.c=64),Wr}function $r(Fr,Hr){for(let Br=0;Br<Hr.length;Br++)Fr.c===64&&(Fr.t+=Fr.c,ur(Fr,!1),Fr.c=0),Fr.b[Fr.c++]=Hr[Br]}function Ar(Fr){for(Fr.t+=Fr.c;Fr.c<64;)Fr.b[Fr.c++]=0;ur(Fr,!0);const Hr=new Uint8Array(Fr.outlen);for(let Br=0;Br<Fr.outlen;Br++)Hr[Br]=Fr.h[Br>>2]>>8*(Br&3)&255;return Hr}function Lr(Fr,Hr,Br){Br=Br||32,Fr=Bt.normalizeInput(Fr);const Wr=cr(Br,Hr);return $r(Wr,Fr),Ar(Wr)}function qr(Fr,Hr,Br){const Wr=Lr(Fr,Hr,Br);return Bt.toHex(Wr)}return blake2s_1={blake2s:Lr,blake2sHex:qr,blake2sInit:cr,blake2sUpdate:$r,blake2sFinal:Ar},blake2s_1}var blakejs,hasRequiredBlakejs;function requireBlakejs(){if(hasRequiredBlakejs)return blakejs;hasRequiredBlakejs=1;const Bt=requireBlake2b(),Wt=requireBlake2s();return blakejs={blake2b:Bt.blake2b,blake2bHex:Bt.blake2bHex,blake2bInit:Bt.blake2bInit,blake2bUpdate:Bt.blake2bUpdate,blake2bFinal:Bt.blake2bFinal,blake2s:Wt.blake2s,blake2sHex:Wt.blake2sHex,blake2sInit:Wt.blake2sInit,blake2sUpdate:Wt.blake2sUpdate,blake2sFinal:Wt.blake2sFinal},blakejs}var blake_1,hasRequiredBlake;function requireBlake(){if(hasRequiredBlake)return blake_1;hasRequiredBlake=1;const Bt=requireBlakejs(),Wt=45569,Gt=45633,Yt={init:Bt.blake2bInit,update:Bt.blake2bUpdate,digest:Bt.blake2bFinal},Xt={init:Bt.blake2sInit,update:Bt.blake2sUpdate,digest:Bt.blake2sFinal},Jt=(Zt,Qt)=>async ur=>{const cr=Qt.init(Zt,null);return Qt.update(cr,ur),Qt.digest(cr)};return blake_1=Zt=>{for(let Qt=0;Qt<64;Qt++)Zt[Wt+Qt]=Jt(Qt+1,Yt);for(let Qt=0;Qt<32;Qt++)Zt[Gt+Qt]=Jt(Qt+1,Xt)},blake_1}const sha3$1=sha3Exports,mur=murmurhash3jsRevisited,{factory:sha}=sha_browser,{fromNumberTo32BitBuf}=utils$g,{fromString:uint8ArrayFromString}=require$$1$4,hash$1=Bt=>async Wt=>{switch(Bt){case"sha3-224":return new Uint8Array(sha3$1.sha3_224.arrayBuffer(Wt));case"sha3-256":return new Uint8Array(sha3$1.sha3_256.arrayBuffer(Wt));case"sha3-384":return new Uint8Array(sha3$1.sha3_384.arrayBuffer(Wt));case"sha3-512":return new Uint8Array(sha3$1.sha3_512.arrayBuffer(Wt));case"shake-128":return new Uint8Array(sha3$1.shake128.create(128).update(Wt).arrayBuffer());case"shake-256":return new Uint8Array(sha3$1.shake256.create(256).update(Wt).arrayBuffer());case"keccak-224":return new Uint8Array(sha3$1.keccak224.arrayBuffer(Wt));case"keccak-256":return new Uint8Array(sha3$1.keccak256.arrayBuffer(Wt));case"keccak-384":return new Uint8Array(sha3$1.keccak384.arrayBuffer(Wt));case"keccak-512":return new Uint8Array(sha3$1.keccak512.arrayBuffer(Wt));case"murmur3-128":return uint8ArrayFromString(mur.x64.hash128(Wt),"base16");case"murmur3-32":return fromNumberTo32BitBuf(mur.x86.hash32(Wt));default:throw new TypeError(`${Bt} is not a supported algorithm`)}},identity$1=Bt=>Bt;var crypto$4={identity:identity$1,sha1:sha("sha1"),sha2256:sha("sha2-256"),sha2512:sha("sha2-512"),dblSha2256:sha("dbl-sha2-256"),sha3224:hash$1("sha3-224"),sha3256:hash$1("sha3-256"),sha3384:hash$1("sha3-384"),sha3512:hash$1("sha3-512"),shake128:hash$1("shake-128"),shake256:hash$1("shake-256"),keccak224:hash$1("keccak-224"),keccak256:hash$1("keccak-256"),keccak384:hash$1("keccak-384"),keccak512:hash$1("keccak-512"),murmur3128:hash$1("murmur3-128"),murmur332:hash$1("murmur3-32"),addBlake:requireBlake()};const require$$6=getAugmentedNamespace(equals$4),errcode=errCode,multihash=src$8,crypto$3=crypto$4,{equals}=require$$6;async function Multihashing(Bt,Wt,Gt){const Yt=await Multihashing.digest(Bt,Wt,Gt);return multihash.encode(Yt,Wt,Gt)}Multihashing.multihash=multihash;Multihashing.digest=async(Bt,Wt,Gt)=>{const Xt=await Multihashing.createHash(Wt)(Bt);return Gt?Xt.slice(0,Gt):Xt};Multihashing.createHash=function(Bt){if(!Bt)throw errcode(new Error("hash algorithm must be specified"),"ERR_HASH_ALGORITHM_NOT_SPECIFIED");const Wt=multihash.coerceCode(Bt);if(!Multihashing.functions[Wt])throw errcode(new Error(`multihash function '${Bt}' not yet supported`),"ERR_HASH_ALGORITHM_NOT_SUPPORTED");return Multihashing.functions[Wt]};Multihashing.functions={0:crypto$3.identity,17:crypto$3.sha1,18:crypto$3.sha2256,19:crypto$3.sha2512,20:crypto$3.sha3512,21:crypto$3.sha3384,22:crypto$3.sha3256,23:crypto$3.sha3224,24:crypto$3.shake128,25:crypto$3.shake256,26:crypto$3.keccak224,27:crypto$3.keccak256,28:crypto$3.keccak384,29:crypto$3.keccak512,34:crypto$3.murmur3128,35:crypto$3.murmur332,86:crypto$3.dblSha2256};crypto$3.addBlake(Multihashing.functions);Multihashing.validate=async(Bt,Wt)=>{const Gt=await Multihashing(Bt,multihash.decode(Wt).name);return equals(Wt,Gt)};var src$7=Multihashing;const mergeOptions=mergeOptions$1.bind({ignoreUndefined:!0}),multihashing=src$7;async function hamtHashFn(Bt){const Gt=(await multihashing(Bt,"murmur3-128")).slice(2,10),Yt=Gt.length,Xt=new Uint8Array(Yt);for(let Jt=0;Jt<Yt;Jt++)Xt[Yt-Jt-1]=Gt[Jt];return Xt}const defaultOptions$1={chunker:"fixed",strategy:"balanced",rawLeaves:!1,onlyHash:!1,reduceSingleLeafToSelf:!0,hashAlg:"sha2-256",leafType:"file",cidVersion:0,progress:()=>()=>{},shardSplitThreshold:1e3,fileImportConcurrency:50,blockWriteConcurrency:10,minChunkSize:262144,maxChunkSize:262144,avgChunkSize:262144,window:16,polynomial:0x3df305dfb2a804,maxChildrenPerNode:174,layerRepeat:4,wrapWithDirectory:!1,pin:!1,recursive:!1,hidden:!1,preload:!1,timeout:void 0,hamtHashFn,hamtHashCode:34,hamtBucketBits:8};var options=function(Bt={}){return mergeOptions(defaultOptions$1,Bt)},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=Bt;function Bt(Wt,Gt){for(var Yt=new Array(arguments.length-1),Xt=0,Jt=2,Zt=!0;Jt<arguments.length;)Yt[Xt++]=arguments[Jt++];return new Promise(function(ur,cr){Yt[Xt]=function(Ar){if(Zt)if(Zt=!1,Ar)cr(Ar);else{for(var Lr=new Array(arguments.length-1),qr=0;qr<Lr.length;)Lr[qr++]=arguments[qr];ur.apply(null,Lr)}};try{Wt.apply(Gt||null,Yt)}catch($r){Zt&&(Zt=!1,cr($r))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(Bt){var Wt=Bt;Wt.length=function(Qt){var ur=Qt.length;if(!ur)return 0;for(var cr=0;--ur%4>1&&Qt.charAt(ur)==="=";)++cr;return Math.ceil(Qt.length*3)/4-cr};for(var Gt=new Array(64),Yt=new Array(123),Xt=0;Xt<64;)Yt[Gt[Xt]=Xt<26?Xt+65:Xt<52?Xt+71:Xt<62?Xt-4:Xt-59|43]=Xt++;Wt.encode=function(Qt,ur,cr){for(var $r=null,Ar=[],Lr=0,qr=0,Fr;ur<cr;){var Hr=Qt[ur++];switch(qr){case 0:Ar[Lr++]=Gt[Hr>>2],Fr=(Hr&3)<<4,qr=1;break;case 1:Ar[Lr++]=Gt[Fr|Hr>>4],Fr=(Hr&15)<<2,qr=2;break;case 2:Ar[Lr++]=Gt[Fr|Hr>>6],Ar[Lr++]=Gt[Hr&63],qr=0;break}Lr>8191&&(($r||($r=[])).push(String.fromCharCode.apply(String,Ar)),Lr=0)}return qr&&(Ar[Lr++]=Gt[Fr],Ar[Lr++]=61,qr===1&&(Ar[Lr++]=61)),$r?(Lr&&$r.push(String.fromCharCode.apply(String,Ar.slice(0,Lr))),$r.join("")):String.fromCharCode.apply(String,Ar.slice(0,Lr))};var Jt="invalid encoding";Wt.decode=function(Qt,ur,cr){for(var $r=cr,Ar=0,Lr,qr=0;qr<Qt.length;){var Fr=Qt.charCodeAt(qr++);if(Fr===61&&Ar>1)break;if((Fr=Yt[Fr])===void 0)throw Error(Jt);switch(Ar){case 0:Lr=Fr,Ar=1;break;case 1:ur[cr++]=Lr<<2|(Fr&48)>>4,Lr=Fr,Ar=2;break;case 2:ur[cr++]=(Lr&15)<<4|(Fr&60)>>2,Lr=Fr,Ar=3;break;case 3:ur[cr++]=(Lr&3)<<6|Fr,Ar=0;break}}if(Ar===1)throw Error(Jt);return cr-$r},Wt.test=function(Qt){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(Qt)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=Bt;function Bt(){this._listeners={}}return Bt.prototype.on=function(Gt,Yt,Xt){return(this._listeners[Gt]||(this._listeners[Gt]=[])).push({fn:Yt,ctx:Xt||this}),this},Bt.prototype.off=function(Gt,Yt){if(Gt===void 0)this._listeners={};else if(Yt===void 0)this._listeners[Gt]=[];else for(var Xt=this._listeners[Gt],Jt=0;Jt<Xt.length;)Xt[Jt].fn===Yt?Xt.splice(Jt,1):++Jt;return this},Bt.prototype.emit=function(Gt){var Yt=this._listeners[Gt];if(Yt){for(var Xt=[],Jt=1;Jt<arguments.length;)Xt.push(arguments[Jt++]);for(Jt=0;Jt<Yt.length;)Yt[Jt].fn.apply(Yt[Jt++].ctx,Xt)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=Bt(Bt);function Bt(Jt){return typeof Float32Array<"u"?function(){var Zt=new Float32Array([-0]),Qt=new Uint8Array(Zt.buffer),ur=Qt[3]===128;function cr(qr,Fr,Hr){Zt[0]=qr,Fr[Hr]=Qt[0],Fr[Hr+1]=Qt[1],Fr[Hr+2]=Qt[2],Fr[Hr+3]=Qt[3]}function $r(qr,Fr,Hr){Zt[0]=qr,Fr[Hr]=Qt[3],Fr[Hr+1]=Qt[2],Fr[Hr+2]=Qt[1],Fr[Hr+3]=Qt[0]}Jt.writeFloatLE=ur?cr:$r,Jt.writeFloatBE=ur?$r:cr;function Ar(qr,Fr){return Qt[0]=qr[Fr],Qt[1]=qr[Fr+1],Qt[2]=qr[Fr+2],Qt[3]=qr[Fr+3],Zt[0]}function Lr(qr,Fr){return Qt[3]=qr[Fr],Qt[2]=qr[Fr+1],Qt[1]=qr[Fr+2],Qt[0]=qr[Fr+3],Zt[0]}Jt.readFloatLE=ur?Ar:Lr,Jt.readFloatBE=ur?Lr:Ar}():function(){function Zt(ur,cr,$r,Ar){var Lr=cr<0?1:0;if(Lr&&(cr=-cr),cr===0)ur(1/cr>0?0:2147483648,$r,Ar);else if(isNaN(cr))ur(2143289344,$r,Ar);else if(cr>34028234663852886e22)ur((Lr<<31|2139095040)>>>0,$r,Ar);else if(cr<11754943508222875e-54)ur((Lr<<31|Math.round(cr/1401298464324817e-60))>>>0,$r,Ar);else{var qr=Math.floor(Math.log(cr)/Math.LN2),Fr=Math.round(cr*Math.pow(2,-qr)*8388608)&8388607;ur((Lr<<31|qr+127<<23|Fr)>>>0,$r,Ar)}}Jt.writeFloatLE=Zt.bind(null,Wt),Jt.writeFloatBE=Zt.bind(null,Gt);function Qt(ur,cr,$r){var Ar=ur(cr,$r),Lr=(Ar>>31)*2+1,qr=Ar>>>23&255,Fr=Ar&8388607;return qr===255?Fr?NaN:Lr*(1/0):qr===0?Lr*1401298464324817e-60*Fr:Lr*Math.pow(2,qr-150)*(Fr+8388608)}Jt.readFloatLE=Qt.bind(null,Yt),Jt.readFloatBE=Qt.bind(null,Xt)}(),typeof Float64Array<"u"?function(){var Zt=new Float64Array([-0]),Qt=new Uint8Array(Zt.buffer),ur=Qt[7]===128;function cr(qr,Fr,Hr){Zt[0]=qr,Fr[Hr]=Qt[0],Fr[Hr+1]=Qt[1],Fr[Hr+2]=Qt[2],Fr[Hr+3]=Qt[3],Fr[Hr+4]=Qt[4],Fr[Hr+5]=Qt[5],Fr[Hr+6]=Qt[6],Fr[Hr+7]=Qt[7]}function $r(qr,Fr,Hr){Zt[0]=qr,Fr[Hr]=Qt[7],Fr[Hr+1]=Qt[6],Fr[Hr+2]=Qt[5],Fr[Hr+3]=Qt[4],Fr[Hr+4]=Qt[3],Fr[Hr+5]=Qt[2],Fr[Hr+6]=Qt[1],Fr[Hr+7]=Qt[0]}Jt.writeDoubleLE=ur?cr:$r,Jt.writeDoubleBE=ur?$r:cr;function Ar(qr,Fr){return Qt[0]=qr[Fr],Qt[1]=qr[Fr+1],Qt[2]=qr[Fr+2],Qt[3]=qr[Fr+3],Qt[4]=qr[Fr+4],Qt[5]=qr[Fr+5],Qt[6]=qr[Fr+6],Qt[7]=qr[Fr+7],Zt[0]}function Lr(qr,Fr){return Qt[7]=qr[Fr],Qt[6]=qr[Fr+1],Qt[5]=qr[Fr+2],Qt[4]=qr[Fr+3],Qt[3]=qr[Fr+4],Qt[2]=qr[Fr+5],Qt[1]=qr[Fr+6],Qt[0]=qr[Fr+7],Zt[0]}Jt.readDoubleLE=ur?Ar:Lr,Jt.readDoubleBE=ur?Lr:Ar}():function(){function Zt(ur,cr,$r,Ar,Lr,qr){var Fr=Ar<0?1:0;if(Fr&&(Ar=-Ar),Ar===0)ur(0,Lr,qr+cr),ur(1/Ar>0?0:2147483648,Lr,qr+$r);else if(isNaN(Ar))ur(0,Lr,qr+cr),ur(2146959360,Lr,qr+$r);else if(Ar>17976931348623157e292)ur(0,Lr,qr+cr),ur((Fr<<31|2146435072)>>>0,Lr,qr+$r);else{var Hr;if(Ar<22250738585072014e-324)Hr=Ar/5e-324,ur(Hr>>>0,Lr,qr+cr),ur((Fr<<31|Hr/4294967296)>>>0,Lr,qr+$r);else{var Br=Math.floor(Math.log(Ar)/Math.LN2);Br===1024&&(Br=1023),Hr=Ar*Math.pow(2,-Br),ur(Hr*4503599627370496>>>0,Lr,qr+cr),ur((Fr<<31|Br+1023<<20|Hr*1048576&1048575)>>>0,Lr,qr+$r)}}}Jt.writeDoubleLE=Zt.bind(null,Wt,0,4),Jt.writeDoubleBE=Zt.bind(null,Gt,4,0);function Qt(ur,cr,$r,Ar,Lr){var qr=ur(Ar,Lr+cr),Fr=ur(Ar,Lr+$r),Hr=(Fr>>31)*2+1,Br=Fr>>>20&2047,Wr=4294967296*(Fr&1048575)+qr;return Br===2047?Wr?NaN:Hr*(1/0):Br===0?Hr*5e-324*Wr:Hr*Math.pow(2,Br-1075)*(Wr+4503599627370496)}Jt.readDoubleLE=Qt.bind(null,Yt,0,4),Jt.readDoubleBE=Qt.bind(null,Xt,4,0)}(),Jt}function Wt(Jt,Zt,Qt){Zt[Qt]=Jt&255,Zt[Qt+1]=Jt>>>8&255,Zt[Qt+2]=Jt>>>16&255,Zt[Qt+3]=Jt>>>24}function Gt(Jt,Zt,Qt){Zt[Qt]=Jt>>>24,Zt[Qt+1]=Jt>>>16&255,Zt[Qt+2]=Jt>>>8&255,Zt[Qt+3]=Jt&255}function Yt(Jt,Zt){return(Jt[Zt]|Jt[Zt+1]<<8|Jt[Zt+2]<<16|Jt[Zt+3]<<24)>>>0}function Xt(Jt,Zt){return(Jt[Zt]<<24|Jt[Zt+1]<<16|Jt[Zt+2]<<8|Jt[Zt+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(Bt){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(Bt){var Wt=Bt;Wt.length=function(Yt){for(var Xt=0,Jt=0,Zt=0;Zt<Yt.length;++Zt)Jt=Yt.charCodeAt(Zt),Jt<128?Xt+=1:Jt<2048?Xt+=2:(Jt&64512)===55296&&(Yt.charCodeAt(Zt+1)&64512)===56320?(++Zt,Xt+=4):Xt+=3;return Xt},Wt.read=function(Yt,Xt,Jt){var Zt=Jt-Xt;if(Zt<1)return"";for(var Qt=null,ur=[],cr=0,$r;Xt<Jt;)$r=Yt[Xt++],$r<128?ur[cr++]=$r:$r>191&&$r<224?ur[cr++]=($r&31)<<6|Yt[Xt++]&63:$r>239&&$r<365?($r=(($r&7)<<18|(Yt[Xt++]&63)<<12|(Yt[Xt++]&63)<<6|Yt[Xt++]&63)-65536,ur[cr++]=55296+($r>>10),ur[cr++]=56320+($r&1023)):ur[cr++]=($r&15)<<12|(Yt[Xt++]&63)<<6|Yt[Xt++]&63,cr>8191&&((Qt||(Qt=[])).push(String.fromCharCode.apply(String,ur)),cr=0);return Qt?(cr&&Qt.push(String.fromCharCode.apply(String,ur.slice(0,cr))),Qt.join("")):String.fromCharCode.apply(String,ur.slice(0,cr))},Wt.write=function(Yt,Xt,Jt){for(var Zt=Jt,Qt,ur,cr=0;cr<Yt.length;++cr)Qt=Yt.charCodeAt(cr),Qt<128?Xt[Jt++]=Qt:Qt<2048?(Xt[Jt++]=Qt>>6|192,Xt[Jt++]=Qt&63|128):(Qt&64512)===55296&&((ur=Yt.charCodeAt(cr+1))&64512)===56320?(Qt=65536+((Qt&1023)<<10)+(ur&1023),++cr,Xt[Jt++]=Qt>>18|240,Xt[Jt++]=Qt>>12&63|128,Xt[Jt++]=Qt>>6&63|128,Xt[Jt++]=Qt&63|128):(Xt[Jt++]=Qt>>12|224,Xt[Jt++]=Qt>>6&63|128,Xt[Jt++]=Qt&63|128);return Jt-Zt}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=Bt;function Bt(Wt,Gt,Yt){var Xt=Yt||8192,Jt=Xt>>>1,Zt=null,Qt=Xt;return function(cr){if(cr<1||cr>Jt)return Wt(cr);Qt+cr>Xt&&(Zt=Wt(Xt),Qt=0);var $r=Gt.call(Zt,Qt,Qt+=cr);return Qt&7&&(Qt=(Qt|7)+1),$r}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=Wt;var Bt=requireMinimal$1();function Wt(Jt,Zt){this.lo=Jt>>>0,this.hi=Zt>>>0}var Gt=Wt.zero=new Wt(0,0);Gt.toNumber=function(){return 0},Gt.zzEncode=Gt.zzDecode=function(){return this},Gt.length=function(){return 1};var Yt=Wt.zeroHash="\0\0\0\0\0\0\0\0";Wt.fromNumber=function(Zt){if(Zt===0)return Gt;var Qt=Zt<0;Qt&&(Zt=-Zt);var ur=Zt>>>0,cr=(Zt-ur)/4294967296>>>0;return Qt&&(cr=~cr>>>0,ur=~ur>>>0,++ur>4294967295&&(ur=0,++cr>4294967295&&(cr=0))),new Wt(ur,cr)},Wt.from=function(Zt){if(typeof Zt=="number")return Wt.fromNumber(Zt);if(Bt.isString(Zt))if(Bt.Long)Zt=Bt.Long.fromString(Zt);else return Wt.fromNumber(parseInt(Zt,10));return Zt.low||Zt.high?new Wt(Zt.low>>>0,Zt.high>>>0):Gt},Wt.prototype.toNumber=function(Zt){if(!Zt&&this.hi>>>31){var Qt=~this.lo+1>>>0,ur=~this.hi>>>0;return Qt||(ur=ur+1>>>0),-(Qt+ur*4294967296)}return this.lo+this.hi*4294967296},Wt.prototype.toLong=function(Zt){return Bt.Long?new Bt.Long(this.lo|0,this.hi|0,!!Zt):{low:this.lo|0,high:this.hi|0,unsigned:!!Zt}};var Xt=String.prototype.charCodeAt;return Wt.fromHash=function(Zt){return Zt===Yt?Gt:new Wt((Xt.call(Zt,0)|Xt.call(Zt,1)<<8|Xt.call(Zt,2)<<16|Xt.call(Zt,3)<<24)>>>0,(Xt.call(Zt,4)|Xt.call(Zt,5)<<8|Xt.call(Zt,6)<<16|Xt.call(Zt,7)<<24)>>>0)},Wt.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)},Wt.prototype.zzEncode=function(){var Zt=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Zt)>>>0,this.lo=(this.lo<<1^Zt)>>>0,this},Wt.prototype.zzDecode=function(){var Zt=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^Zt)>>>0,this.hi=(this.hi>>>1^Zt)>>>0,this},Wt.prototype.length=function(){var Zt=this.lo,Qt=(this.lo>>>28|this.hi<<4)>>>0,ur=this.hi>>>24;return ur===0?Qt===0?Zt<16384?Zt<128?1:2:Zt<2097152?3:4:Qt<16384?Qt<128?5:6:Qt<2097152?7:8:ur<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(Bt){var Wt=Bt;Wt.asPromise=requireAspromise(),Wt.base64=requireBase64(),Wt.EventEmitter=requireEventemitter(),Wt.float=requireFloat(),Wt.inquire=requireInquire(),Wt.utf8=requireUtf8(),Wt.pool=requirePool(),Wt.LongBits=requireLongbits(),Wt.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),Wt.global=Wt.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,Wt.emptyArray=Object.freeze?Object.freeze([]):[],Wt.emptyObject=Object.freeze?Object.freeze({}):{},Wt.isInteger=Number.isInteger||function(Jt){return typeof Jt=="number"&&isFinite(Jt)&&Math.floor(Jt)===Jt},Wt.isString=function(Jt){return typeof Jt=="string"||Jt instanceof String},Wt.isObject=function(Jt){return Jt&&typeof Jt=="object"},Wt.isset=Wt.isSet=function(Jt,Zt){var Qt=Jt[Zt];return Qt!=null&&Jt.hasOwnProperty(Zt)?typeof Qt!="object"||(Array.isArray(Qt)?Qt.length:Object.keys(Qt).length)>0:!1},Wt.Buffer=function(){try{var Xt=Wt.inquire("buffer").Buffer;return Xt.prototype.utf8Write?Xt:null}catch{return null}}(),Wt._Buffer_from=null,Wt._Buffer_allocUnsafe=null,Wt.newBuffer=function(Jt){return typeof Jt=="number"?Wt.Buffer?Wt._Buffer_allocUnsafe(Jt):new Wt.Array(Jt):Wt.Buffer?Wt._Buffer_from(Jt):typeof Uint8Array>"u"?Jt:new Uint8Array(Jt)},Wt.Array=typeof Uint8Array<"u"?Uint8Array:Array,Wt.Long=Wt.global.dcodeIO&&Wt.global.dcodeIO.Long||Wt.global.Long||Wt.inquire("long"),Wt.key2Re=/^true|false|0|1$/,Wt.key32Re=/^-?(?:0|[1-9][0-9]*)$/,Wt.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,Wt.longToHash=function(Jt){return Jt?Wt.LongBits.from(Jt).toHash():Wt.LongBits.zeroHash},Wt.longFromHash=function(Jt,Zt){var Qt=Wt.LongBits.fromHash(Jt);return Wt.Long?Wt.Long.fromBits(Qt.lo,Qt.hi,Zt):Qt.toNumber(!!Zt)};function Gt(Xt,Jt,Zt){for(var Qt=Object.keys(Jt),ur=0;ur<Qt.length;++ur)(Xt[Qt[ur]]===void 0||!Zt)&&(Xt[Qt[ur]]=Jt[Qt[ur]]);return Xt}Wt.merge=Gt,Wt.lcFirst=function(Jt){return Jt.charAt(0).toLowerCase()+Jt.substring(1)};function Yt(Xt){function Jt(Zt,Qt){if(!(this instanceof Jt))return new Jt(Zt,Qt);Object.defineProperty(this,"message",{get:function(){return Zt}}),Error.captureStackTrace?Error.captureStackTrace(this,Jt):Object.defineProperty(this,"stack",{value:new Error().stack||""}),Qt&&Gt(this,Qt)}return(Jt.prototype=Object.create(Error.prototype)).constructor=Jt,Object.defineProperty(Jt.prototype,"name",{get:function(){return Xt}}),Jt.prototype.toString=function(){return this.name+": "+this.message},Jt}Wt.newError=Yt,Wt.ProtocolError=Yt("ProtocolError"),Wt.oneOfGetter=function(Jt){for(var Zt={},Qt=0;Qt<Jt.length;++Qt)Zt[Jt[Qt]]=1;return function(){for(var ur=Object.keys(this),cr=ur.length-1;cr>-1;--cr)if(Zt[ur[cr]]===1&&this[ur[cr]]!==void 0&&this[ur[cr]]!==null)return ur[cr]}},Wt.oneOfSetter=function(Jt){return function(Zt){for(var Qt=0;Qt<Jt.length;++Qt)Jt[Qt]!==Zt&&delete this[Jt[Qt]]}},Wt.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},Wt._configure=function(){var Xt=Wt.Buffer;if(!Xt){Wt._Buffer_from=Wt._Buffer_allocUnsafe=null;return}Wt._Buffer_from=Xt.from!==Uint8Array.from&&Xt.from||function(Zt,Qt){return new Xt(Zt,Qt)},Wt._Buffer_allocUnsafe=Xt.allocUnsafe||function(Zt){return new Xt(Zt)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=ur;var Bt=requireMinimal$1(),Wt,Gt=Bt.LongBits,Yt=Bt.base64,Xt=Bt.utf8;function Jt(Br,Wr,Gr){this.fn=Br,this.len=Wr,this.next=void 0,this.val=Gr}function Zt(){}function Qt(Br){this.head=Br.head,this.tail=Br.tail,this.len=Br.len,this.next=Br.states}function ur(){this.len=0,this.head=new Jt(Zt,0,0),this.tail=this.head,this.states=null}var cr=function(){return Bt.Buffer?function(){return(ur.create=function(){return new Wt})()}:function(){return new ur}};ur.create=cr(),ur.alloc=function(Wr){return new Bt.Array(Wr)},Bt.Array!==Array&&(ur.alloc=Bt.pool(ur.alloc,Bt.Array.prototype.subarray)),ur.prototype._push=function(Wr,Gr,Kr){return this.tail=this.tail.next=new Jt(Wr,Gr,Kr),this.len+=Gr,this};function $r(Br,Wr,Gr){Wr[Gr]=Br&255}function Ar(Br,Wr,Gr){for(;Br>127;)Wr[Gr++]=Br&127|128,Br>>>=7;Wr[Gr]=Br}function Lr(Br,Wr){this.len=Br,this.next=void 0,this.val=Wr}Lr.prototype=Object.create(Jt.prototype),Lr.prototype.fn=Ar,ur.prototype.uint32=function(Wr){return this.len+=(this.tail=this.tail.next=new Lr((Wr=Wr>>>0)<128?1:Wr<16384?2:Wr<2097152?3:Wr<268435456?4:5,Wr)).len,this},ur.prototype.int32=function(Wr){return Wr<0?this._push(qr,10,Gt.fromNumber(Wr)):this.uint32(Wr)},ur.prototype.sint32=function(Wr){return this.uint32((Wr<<1^Wr>>31)>>>0)};function qr(Br,Wr,Gr){for(;Br.hi;)Wr[Gr++]=Br.lo&127|128,Br.lo=(Br.lo>>>7|Br.hi<<25)>>>0,Br.hi>>>=7;for(;Br.lo>127;)Wr[Gr++]=Br.lo&127|128,Br.lo=Br.lo>>>7;Wr[Gr++]=Br.lo}ur.prototype.uint64=function(Wr){var Gr=Gt.from(Wr);return this._push(qr,Gr.length(),Gr)},ur.prototype.int64=ur.prototype.uint64,ur.prototype.sint64=function(Wr){var Gr=Gt.from(Wr).zzEncode();return this._push(qr,Gr.length(),Gr)},ur.prototype.bool=function(Wr){return this._push($r,1,Wr?1:0)};function Fr(Br,Wr,Gr){Wr[Gr]=Br&255,Wr[Gr+1]=Br>>>8&255,Wr[Gr+2]=Br>>>16&255,Wr[Gr+3]=Br>>>24}ur.prototype.fixed32=function(Wr){return this._push(Fr,4,Wr>>>0)},ur.prototype.sfixed32=ur.prototype.fixed32,ur.prototype.fixed64=function(Wr){var Gr=Gt.from(Wr);return this._push(Fr,4,Gr.lo)._push(Fr,4,Gr.hi)},ur.prototype.sfixed64=ur.prototype.fixed64,ur.prototype.float=function(Wr){return this._push(Bt.float.writeFloatLE,4,Wr)},ur.prototype.double=function(Wr){return this._push(Bt.float.writeDoubleLE,8,Wr)};var Hr=Bt.Array.prototype.set?function(Wr,Gr,Kr){Gr.set(Wr,Kr)}:function(Wr,Gr,Kr){for(var Yr=0;Yr<Wr.length;++Yr)Gr[Kr+Yr]=Wr[Yr]};return ur.prototype.bytes=function(Wr){var Gr=Wr.length>>>0;if(!Gr)return this._push($r,1,0);if(Bt.isString(Wr)){var Kr=ur.alloc(Gr=Yt.length(Wr));Yt.decode(Wr,Kr,0),Wr=Kr}return this.uint32(Gr)._push(Hr,Gr,Wr)},ur.prototype.string=function(Wr){var Gr=Xt.length(Wr);return Gr?this.uint32(Gr)._push(Xt.write,Gr,Wr):this._push($r,1,0)},ur.prototype.fork=function(){return this.states=new Qt(this),this.head=this.tail=new Jt(Zt,0,0),this.len=0,this},ur.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 Jt(Zt,0,0),this.len=0),this},ur.prototype.ldelim=function(){var Wr=this.head,Gr=this.tail,Kr=this.len;return this.reset().uint32(Kr),Kr&&(this.tail.next=Wr.next,this.tail=Gr,this.len+=Kr),this},ur.prototype.finish=function(){for(var Wr=this.head.next,Gr=this.constructor.alloc(this.len),Kr=0;Wr;)Wr.fn(Wr.val,Gr,Kr),Kr+=Wr.len,Wr=Wr.next;return Gr},ur._configure=function(Br){Wt=Br,ur.create=cr(),Wt._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=Gt;var Bt=requireWriter();(Gt.prototype=Object.create(Bt.prototype)).constructor=Gt;var Wt=requireMinimal$1();function Gt(){Bt.call(this)}Gt._configure=function(){Gt.alloc=Wt._Buffer_allocUnsafe,Gt.writeBytesBuffer=Wt.Buffer&&Wt.Buffer.prototype instanceof Uint8Array&&Wt.Buffer.prototype.set.name==="set"?function(Jt,Zt,Qt){Zt.set(Jt,Qt)}:function(Jt,Zt,Qt){if(Jt.copy)Jt.copy(Zt,Qt,0,Jt.length);else for(var ur=0;ur<Jt.length;)Zt[Qt++]=Jt[ur++]}},Gt.prototype.bytes=function(Jt){Wt.isString(Jt)&&(Jt=Wt._Buffer_from(Jt,"base64"));var Zt=Jt.length>>>0;return this.uint32(Zt),Zt&&this._push(Gt.writeBytesBuffer,Zt,Jt),this};function Yt(Xt,Jt,Zt){Xt.length<40?Wt.utf8.write(Xt,Jt,Zt):Jt.utf8Write?Jt.utf8Write(Xt,Zt):Jt.write(Xt,Zt)}return Gt.prototype.string=function(Jt){var Zt=Wt.Buffer.byteLength(Jt);return this.uint32(Zt),Zt&&this._push(Yt,Zt,Jt),this},Gt._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=Jt;var Bt=requireMinimal$1(),Wt,Gt=Bt.LongBits,Yt=Bt.utf8;function Xt(Ar,Lr){return RangeError("index out of range: "+Ar.pos+" + "+(Lr||1)+" > "+Ar.len)}function Jt(Ar){this.buf=Ar,this.pos=0,this.len=Ar.length}var Zt=typeof Uint8Array<"u"?function(Lr){if(Lr instanceof Uint8Array||Array.isArray(Lr))return new Jt(Lr);throw Error("illegal buffer")}:function(Lr){if(Array.isArray(Lr))return new Jt(Lr);throw Error("illegal buffer")},Qt=function(){return Bt.Buffer?function(qr){return(Jt.create=function(Hr){return Bt.Buffer.isBuffer(Hr)?new Wt(Hr):Zt(Hr)})(qr)}:Zt};Jt.create=Qt(),Jt.prototype._slice=Bt.Array.prototype.subarray||Bt.Array.prototype.slice,Jt.prototype.uint32=function(){var Lr=4294967295;return function(){if(Lr=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(Lr=(Lr|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(Lr=(Lr|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(Lr=(Lr|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(Lr=(Lr|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return Lr;if((this.pos+=5)>this.len)throw this.pos=this.len,Xt(this,10);return Lr}}(),Jt.prototype.int32=function(){return this.uint32()|0},Jt.prototype.sint32=function(){var Lr=this.uint32();return Lr>>>1^-(Lr&1)|0};function ur(){var Ar=new Gt(0,0),Lr=0;if(this.len-this.pos>4){for(;Lr<4;++Lr)if(Ar.lo=(Ar.lo|(this.buf[this.pos]&127)<<Lr*7)>>>0,this.buf[this.pos++]<128)return Ar;if(Ar.lo=(Ar.lo|(this.buf[this.pos]&127)<<28)>>>0,Ar.hi=(Ar.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Ar;Lr=0}else{for(;Lr<3;++Lr){if(this.pos>=this.len)throw Xt(this);if(Ar.lo=(Ar.lo|(this.buf[this.pos]&127)<<Lr*7)>>>0,this.buf[this.pos++]<128)return Ar}return Ar.lo=(Ar.lo|(this.buf[this.pos++]&127)<<Lr*7)>>>0,Ar}if(this.len-this.pos>4){for(;Lr<5;++Lr)if(Ar.hi=(Ar.hi|(this.buf[this.pos]&127)<<Lr*7+3)>>>0,this.buf[this.pos++]<128)return Ar}else for(;Lr<5;++Lr){if(this.pos>=this.len)throw Xt(this);if(Ar.hi=(Ar.hi|(this.buf[this.pos]&127)<<Lr*7+3)>>>0,this.buf[this.pos++]<128)return Ar}throw Error("invalid varint encoding")}Jt.prototype.bool=function(){return this.uint32()!==0};function cr(Ar,Lr){return(Ar[Lr-4]|Ar[Lr-3]<<8|Ar[Lr-2]<<16|Ar[Lr-1]<<24)>>>0}Jt.prototype.fixed32=function(){if(this.pos+4>this.len)throw Xt(this,4);return cr(this.buf,this.pos+=4)},Jt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Xt(this,4);return cr(this.buf,this.pos+=4)|0};function $r(){if(this.pos+8>this.len)throw Xt(this,8);return new Gt(cr(this.buf,this.pos+=4),cr(this.buf,this.pos+=4))}return Jt.prototype.float=function(){if(this.pos+4>this.len)throw Xt(this,4);var Lr=Bt.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Lr},Jt.prototype.double=function(){if(this.pos+8>this.len)throw Xt(this,4);var Lr=Bt.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Lr},Jt.prototype.bytes=function(){var Lr=this.uint32(),qr=this.pos,Fr=this.pos+Lr;if(Fr>this.len)throw Xt(this,Lr);return this.pos+=Lr,Array.isArray(this.buf)?this.buf.slice(qr,Fr):qr===Fr?new this.buf.constructor(0):this._slice.call(this.buf,qr,Fr)},Jt.prototype.string=function(){var Lr=this.bytes();return Yt.read(Lr,0,Lr.length)},Jt.prototype.skip=function(Lr){if(typeof Lr=="number"){if(this.pos+Lr>this.len)throw Xt(this,Lr);this.pos+=Lr}else do if(this.pos>=this.len)throw Xt(this);while(this.buf[this.pos++]&128);return this},Jt.prototype.skipType=function(Ar){switch(Ar){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(Ar=this.uint32()&7)!==4;)this.skipType(Ar);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Ar+" at offset "+this.pos)}return this},Jt._configure=function(Ar){Wt=Ar,Jt.create=Qt(),Wt._configure();var Lr=Bt.Long?"toLong":"toNumber";Bt.merge(Jt.prototype,{int64:function(){return ur.call(this)[Lr](!1)},uint64:function(){return ur.call(this)[Lr](!0)},sint64:function(){return ur.call(this).zzDecode()[Lr](!1)},fixed64:function(){return $r.call(this)[Lr](!0)},sfixed64:function(){return $r.call(this)[Lr](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=Gt;var Bt=requireReader();(Gt.prototype=Object.create(Bt.prototype)).constructor=Gt;var Wt=requireMinimal$1();function Gt(Yt){Bt.call(this,Yt)}return Gt._configure=function(){Wt.Buffer&&(Gt.prototype._slice=Wt.Buffer.prototype.slice)},Gt.prototype.string=function(){var Xt=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Xt,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Xt,this.len))},Gt._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=Wt;var Bt=requireMinimal$1();(Wt.prototype=Object.create(Bt.EventEmitter.prototype)).constructor=Wt;function Wt(Gt,Yt,Xt){if(typeof Gt!="function")throw TypeError("rpcImpl must be a function");Bt.EventEmitter.call(this),this.rpcImpl=Gt,this.requestDelimited=!!Yt,this.responseDelimited=!!Xt}return Wt.prototype.rpcCall=function Gt(Yt,Xt,Jt,Zt,Qt){if(!Zt)throw TypeError("request must be specified");var ur=this;if(!Qt)return Bt.asPromise(Gt,ur,Yt,Xt,Jt,Zt);if(!ur.rpcImpl){setTimeout(function(){Qt(Error("already ended"))},0);return}try{return ur.rpcImpl(Yt,Xt[ur.requestDelimited?"encodeDelimited":"encode"](Zt).finish(),function($r,Ar){if($r)return ur.emit("error",$r,Yt),Qt($r);if(Ar===null){ur.end(!0);return}if(!(Ar instanceof Jt))try{Ar=Jt[ur.responseDelimited?"decodeDelimited":"decode"](Ar)}catch(Lr){return ur.emit("error",Lr,Yt),Qt(Lr)}return ur.emit("data",Ar,Yt),Qt(null,Ar)})}catch(cr){ur.emit("error",cr,Yt),setTimeout(function(){Qt(cr)},0);return}},Wt.prototype.end=function(Yt){return this.rpcImpl&&(Yt||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(Bt){var Wt=Bt;Wt.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(Bt){var Wt=Bt;Wt.build="minimal",Wt.Writer=requireWriter(),Wt.BufferWriter=requireWriter_buffer(),Wt.Reader=requireReader(),Wt.BufferReader=requireReader_buffer(),Wt.util=requireMinimal$1(),Wt.rpc=requireRpc(),Wt.roots=requireRoots(),Wt.configure=Gt;function Gt(){Wt.util._configure(),Wt.Writer._configure(Wt.BufferWriter),Wt.Reader._configure(Wt.BufferReader)}Gt()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var unixfs,hasRequiredUnixfs;function requireUnixfs(){if(hasRequiredUnixfs)return unixfs;hasRequiredUnixfs=1;var Bt=requireMinimal(),Wt=Bt.Reader,Gt=Bt.Writer,Yt=Bt.util,Xt=Bt.roots["ipfs-unixfs"]||(Bt.roots["ipfs-unixfs"]={});return Xt.Data=function(){function Jt(Zt){if(this.blocksizes=[],Zt)for(var Qt=Object.keys(Zt),ur=0;ur<Qt.length;++ur)Zt[Qt[ur]]!=null&&(this[Qt[ur]]=Zt[Qt[ur]])}return Jt.prototype.Type=0,Jt.prototype.Data=Yt.newBuffer([]),Jt.prototype.filesize=Yt.Long?Yt.Long.fromBits(0,0,!0):0,Jt.prototype.blocksizes=Yt.emptyArray,Jt.prototype.hashType=Yt.Long?Yt.Long.fromBits(0,0,!0):0,Jt.prototype.fanout=Yt.Long?Yt.Long.fromBits(0,0,!0):0,Jt.prototype.mode=0,Jt.prototype.mtime=null,Jt.encode=function(Qt,ur){if(ur||(ur=Gt.create()),ur.uint32(8).int32(Qt.Type),Qt.Data!=null&&Object.hasOwnProperty.call(Qt,"Data")&&ur.uint32(18).bytes(Qt.Data),Qt.filesize!=null&&Object.hasOwnProperty.call(Qt,"filesize")&&ur.uint32(24).uint64(Qt.filesize),Qt.blocksizes!=null&&Qt.blocksizes.length)for(var cr=0;cr<Qt.blocksizes.length;++cr)ur.uint32(32).uint64(Qt.blocksizes[cr]);return Qt.hashType!=null&&Object.hasOwnProperty.call(Qt,"hashType")&&ur.uint32(40).uint64(Qt.hashType),Qt.fanout!=null&&Object.hasOwnProperty.call(Qt,"fanout")&&ur.uint32(48).uint64(Qt.fanout),Qt.mode!=null&&Object.hasOwnProperty.call(Qt,"mode")&&ur.uint32(56).uint32(Qt.mode),Qt.mtime!=null&&Object.hasOwnProperty.call(Qt,"mtime")&&Xt.UnixTime.encode(Qt.mtime,ur.uint32(66).fork()).ldelim(),ur},Jt.decode=function(Qt,ur){Qt instanceof Wt||(Qt=Wt.create(Qt));for(var cr=ur===void 0?Qt.len:Qt.pos+ur,$r=new Xt.Data;Qt.pos<cr;){var Ar=Qt.uint32();switch(Ar>>>3){case 1:$r.Type=Qt.int32();break;case 2:$r.Data=Qt.bytes();break;case 3:$r.filesize=Qt.uint64();break;case 4:if($r.blocksizes&&$r.blocksizes.length||($r.blocksizes=[]),(Ar&7)===2)for(var Lr=Qt.uint32()+Qt.pos;Qt.pos<Lr;)$r.blocksizes.push(Qt.uint64());else $r.blocksizes.push(Qt.uint64());break;case 5:$r.hashType=Qt.uint64();break;case 6:$r.fanout=Qt.uint64();break;case 7:$r.mode=Qt.uint32();break;case 8:$r.mtime=Xt.UnixTime.decode(Qt,Qt.uint32());break;default:Qt.skipType(Ar&7);break}}if(!$r.hasOwnProperty("Type"))throw Yt.ProtocolError("missing required 'Type'",{instance:$r});return $r},Jt.fromObject=function(Qt){if(Qt instanceof Xt.Data)return Qt;var ur=new Xt.Data;switch(Qt.Type){case"Raw":case 0:ur.Type=0;break;case"Directory":case 1:ur.Type=1;break;case"File":case 2:ur.Type=2;break;case"Metadata":case 3:ur.Type=3;break;case"Symlink":case 4:ur.Type=4;break;case"HAMTShard":case 5:ur.Type=5;break}if(Qt.Data!=null&&(typeof Qt.Data=="string"?Yt.base64.decode(Qt.Data,ur.Data=Yt.newBuffer(Yt.base64.length(Qt.Data)),0):Qt.Data.length&&(ur.Data=Qt.Data)),Qt.filesize!=null&&(Yt.Long?(ur.filesize=Yt.Long.fromValue(Qt.filesize)).unsigned=!0:typeof Qt.filesize=="string"?ur.filesize=parseInt(Qt.filesize,10):typeof Qt.filesize=="number"?ur.filesize=Qt.filesize:typeof Qt.filesize=="object"&&(ur.filesize=new Yt.LongBits(Qt.filesize.low>>>0,Qt.filesize.high>>>0).toNumber(!0))),Qt.blocksizes){if(!Array.isArray(Qt.blocksizes))throw TypeError(".Data.blocksizes: array expected");ur.blocksizes=[];for(var cr=0;cr<Qt.blocksizes.length;++cr)Yt.Long?(ur.blocksizes[cr]=Yt.Long.fromValue(Qt.blocksizes[cr])).unsigned=!0:typeof Qt.blocksizes[cr]=="string"?ur.blocksizes[cr]=parseInt(Qt.blocksizes[cr],10):typeof Qt.blocksizes[cr]=="number"?ur.blocksizes[cr]=Qt.blocksizes[cr]:typeof Qt.blocksizes[cr]=="object"&&(ur.blocksizes[cr]=new Yt.LongBits(Qt.blocksizes[cr].low>>>0,Qt.blocksizes[cr].high>>>0).toNumber(!0))}if(Qt.hashType!=null&&(Yt.Long?(ur.hashType=Yt.Long.fromValue(Qt.hashType)).unsigned=!0:typeof Qt.hashType=="string"?ur.hashType=parseInt(Qt.hashType,10):typeof Qt.hashType=="number"?ur.hashType=Qt.hashType:typeof Qt.hashType=="object"&&(ur.hashType=new Yt.LongBits(Qt.hashType.low>>>0,Qt.hashType.high>>>0).toNumber(!0))),Qt.fanout!=null&&(Yt.Long?(ur.fanout=Yt.Long.fromValue(Qt.fanout)).unsigned=!0:typeof Qt.fanout=="string"?ur.fanout=parseInt(Qt.fanout,10):typeof Qt.fanout=="number"?ur.fanout=Qt.fanout:typeof Qt.fanout=="object"&&(ur.fanout=new Yt.LongBits(Qt.fanout.low>>>0,Qt.fanout.high>>>0).toNumber(!0))),Qt.mode!=null&&(ur.mode=Qt.mode>>>0),Qt.mtime!=null){if(typeof Qt.mtime!="object")throw TypeError(".Data.mtime: object expected");ur.mtime=Xt.UnixTime.fromObject(Qt.mtime)}return ur},Jt.toObject=function(Qt,ur){ur||(ur={});var cr={};if((ur.arrays||ur.defaults)&&(cr.blocksizes=[]),ur.defaults){if(cr.Type=ur.enums===String?"Raw":0,ur.bytes===String?cr.Data="":(cr.Data=[],ur.bytes!==Array&&(cr.Data=Yt.newBuffer(cr.Data))),Yt.Long){var $r=new Yt.Long(0,0,!0);cr.filesize=ur.longs===String?$r.toString():ur.longs===Number?$r.toNumber():$r}else cr.filesize=ur.longs===String?"0":0;if(Yt.Long){var $r=new Yt.Long(0,0,!0);cr.hashType=ur.longs===String?$r.toString():ur.longs===Number?$r.toNumber():$r}else cr.hashType=ur.longs===String?"0":0;if(Yt.Long){var $r=new Yt.Long(0,0,!0);cr.fanout=ur.longs===String?$r.toString():ur.longs===Number?$r.toNumber():$r}else cr.fanout=ur.longs===String?"0":0;cr.mode=0,cr.mtime=null}if(Qt.Type!=null&&Qt.hasOwnProperty("Type")&&(cr.Type=ur.enums===String?Xt.Data.DataType[Qt.Type]:Qt.Type),Qt.Data!=null&&Qt.hasOwnProperty("Data")&&(cr.Data=ur.bytes===String?Yt.base64.encode(Qt.Data,0,Qt.Data.length):ur.bytes===Array?Array.prototype.slice.call(Qt.Data):Qt.Data),Qt.filesize!=null&&Qt.hasOwnProperty("filesize")&&(typeof Qt.filesize=="number"?cr.filesize=ur.longs===String?String(Qt.filesize):Qt.filesize:cr.filesize=ur.longs===String?Yt.Long.prototype.toString.call(Qt.filesize):ur.longs===Number?new Yt.LongBits(Qt.filesize.low>>>0,Qt.filesize.high>>>0).toNumber(!0):Qt.filesize),Qt.blocksizes&&Qt.blocksizes.length){cr.blocksizes=[];for(var Ar=0;Ar<Qt.blocksizes.length;++Ar)typeof Qt.blocksizes[Ar]=="number"?cr.blocksizes[Ar]=ur.longs===String?String(Qt.blocksizes[Ar]):Qt.blocksizes[Ar]:cr.blocksizes[Ar]=ur.longs===String?Yt.Long.prototype.toString.call(Qt.blocksizes[Ar]):ur.longs===Number?new Yt.LongBits(Qt.blocksizes[Ar].low>>>0,Qt.blocksizes[Ar].high>>>0).toNumber(!0):Qt.blocksizes[Ar]}return Qt.hashType!=null&&Qt.hasOwnProperty("hashType")&&(typeof Qt.hashType=="number"?cr.hashType=ur.longs===String?String(Qt.hashType):Qt.hashType:cr.hashType=ur.longs===String?Yt.Long.prototype.toString.call(Qt.hashType):ur.longs===Number?new Yt.LongBits(Qt.hashType.low>>>0,Qt.hashType.high>>>0).toNumber(!0):Qt.hashType),Qt.fanout!=null&&Qt.hasOwnProperty("fanout")&&(typeof Qt.fanout=="number"?cr.fanout=ur.longs===String?String(Qt.fanout):Qt.fanout:cr.fanout=ur.longs===String?Yt.Long.prototype.toString.call(Qt.fanout):ur.longs===Number?new Yt.LongBits(Qt.fanout.low>>>0,Qt.fanout.high>>>0).toNumber(!0):Qt.fanout),Qt.mode!=null&&Qt.hasOwnProperty("mode")&&(cr.mode=Qt.mode),Qt.mtime!=null&&Qt.hasOwnProperty("mtime")&&(cr.mtime=Xt.UnixTime.toObject(Qt.mtime,ur)),cr},Jt.prototype.toJSON=function(){return this.constructor.toObject(this,Bt.util.toJSONOptions)},Jt.DataType=function(){var Zt={},Qt=Object.create(Zt);return Qt[Zt[0]="Raw"]=0,Qt[Zt[1]="Directory"]=1,Qt[Zt[2]="File"]=2,Qt[Zt[3]="Metadata"]=3,Qt[Zt[4]="Symlink"]=4,Qt[Zt[5]="HAMTShard"]=5,Qt}(),Jt}(),Xt.UnixTime=function(){function Jt(Zt){if(Zt)for(var Qt=Object.keys(Zt),ur=0;ur<Qt.length;++ur)Zt[Qt[ur]]!=null&&(this[Qt[ur]]=Zt[Qt[ur]])}return Jt.prototype.Seconds=Yt.Long?Yt.Long.fromBits(0,0,!1):0,Jt.prototype.FractionalNanoseconds=0,Jt.encode=function(Qt,ur){return ur||(ur=Gt.create()),ur.uint32(8).int64(Qt.Seconds),Qt.FractionalNanoseconds!=null&&Object.hasOwnProperty.call(Qt,"FractionalNanoseconds")&&ur.uint32(21).fixed32(Qt.FractionalNanoseconds),ur},Jt.decode=function(Qt,ur){Qt instanceof Wt||(Qt=Wt.create(Qt));for(var cr=ur===void 0?Qt.len:Qt.pos+ur,$r=new Xt.UnixTime;Qt.pos<cr;){var Ar=Qt.uint32();switch(Ar>>>3){case 1:$r.Seconds=Qt.int64();break;case 2:$r.FractionalNanoseconds=Qt.fixed32();break;default:Qt.skipType(Ar&7);break}}if(!$r.hasOwnProperty("Seconds"))throw Yt.ProtocolError("missing required 'Seconds'",{instance:$r});return $r},Jt.fromObject=function(Qt){if(Qt instanceof Xt.UnixTime)return Qt;var ur=new Xt.UnixTime;return Qt.Seconds!=null&&(Yt.Long?(ur.Seconds=Yt.Long.fromValue(Qt.Seconds)).unsigned=!1:typeof Qt.Seconds=="string"?ur.Seconds=parseInt(Qt.Seconds,10):typeof Qt.Seconds=="number"?ur.Seconds=Qt.Seconds:typeof Qt.Seconds=="object"&&(ur.Seconds=new Yt.LongBits(Qt.Seconds.low>>>0,Qt.Seconds.high>>>0).toNumber())),Qt.FractionalNanoseconds!=null&&(ur.FractionalNanoseconds=Qt.FractionalNanoseconds>>>0),ur},Jt.toObject=function(Qt,ur){ur||(ur={});var cr={};if(ur.defaults){if(Yt.Long){var $r=new Yt.Long(0,0,!1);cr.Seconds=ur.longs===String?$r.toString():ur.longs===Number?$r.toNumber():$r}else cr.Seconds=ur.longs===String?"0":0;cr.FractionalNanoseconds=0}return Qt.Seconds!=null&&Qt.hasOwnProperty("Seconds")&&(typeof Qt.Seconds=="number"?cr.Seconds=ur.longs===String?String(Qt.Seconds):Qt.Seconds:cr.Seconds=ur.longs===String?Yt.Long.prototype.toString.call(Qt.Seconds):ur.longs===Number?new Yt.LongBits(Qt.Seconds.low>>>0,Qt.Seconds.high>>>0).toNumber():Qt.Seconds),Qt.FractionalNanoseconds!=null&&Qt.hasOwnProperty("FractionalNanoseconds")&&(cr.FractionalNanoseconds=Qt.FractionalNanoseconds),cr},Jt.prototype.toJSON=function(){return this.constructor.toObject(this,Bt.util.toJSONOptions)},Jt}(),Xt.Metadata=function(){function Jt(Zt){if(Zt)for(var Qt=Object.keys(Zt),ur=0;ur<Qt.length;++ur)Zt[Qt[ur]]!=null&&(this[Qt[ur]]=Zt[Qt[ur]])}return Jt.prototype.MimeType="",Jt.encode=function(Qt,ur){return ur||(ur=Gt.create()),Qt.MimeType!=null&&Object.hasOwnProperty.call(Qt,"MimeType")&&ur.uint32(10).string(Qt.MimeType),ur},Jt.decode=function(Qt,ur){Qt instanceof Wt||(Qt=Wt.create(Qt));for(var cr=ur===void 0?Qt.len:Qt.pos+ur,$r=new Xt.Metadata;Qt.pos<cr;){var Ar=Qt.uint32();switch(Ar>>>3){case 1:$r.MimeType=Qt.string();break;default:Qt.skipType(Ar&7);break}}return $r},Jt.fromObject=function(Qt){if(Qt instanceof Xt.Metadata)return Qt;var ur=new Xt.Metadata;return Qt.MimeType!=null&&(ur.MimeType=String(Qt.MimeType)),ur},Jt.toObject=function(Qt,ur){ur||(ur={});var cr={};return ur.defaults&&(cr.MimeType=""),Qt.MimeType!=null&&Qt.hasOwnProperty("MimeType")&&(cr.MimeType=Qt.MimeType),cr},Jt.prototype.toJSON=function(){return this.constructor.toObject(this,Bt.util.toJSONOptions)},Jt}(),unixfs=Xt,unixfs}var src$6,hasRequiredSrc$5;function requireSrc$5(){if(hasRequiredSrc$5)return src$6;hasRequiredSrc$5=1;const{Data:Bt}=requireUnixfs(),Wt=errCode,Gt=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],Yt=["directory","hamt-sharded-directory"],Xt=parseInt("0644",8),Jt=parseInt("0755",8);function Zt(cr){if(cr!=null)return typeof cr=="number"?cr&4095:(cr=cr.toString(),cr.substring(0,1)==="0"?parseInt(cr,8)&4095:parseInt(cr,10)&4095)}function Qt(cr){if(cr==null)return;let $r;if(cr.secs!=null&&($r={secs:cr.secs,nsecs:cr.nsecs}),cr.Seconds!=null&&($r={secs:cr.Seconds,nsecs:cr.FractionalNanoseconds}),Array.isArray(cr)&&($r={secs:cr[0],nsecs:cr[1]}),cr instanceof Date){const Ar=cr.getTime(),Lr=Math.floor(Ar/1e3);$r={secs:Lr,nsecs:(Ar-Lr*1e3)*1e3}}if(Object.prototype.hasOwnProperty.call($r,"secs")){if($r!=null&&$r.nsecs!=null&&($r.nsecs<0||$r.nsecs>999999999))throw Wt(new Error("mtime-nsecs must be within the range [0,999999999]"),"ERR_INVALID_MTIME_NSECS");return $r}}class ur{static unmarshal($r){const Ar=Bt.decode($r),Lr=Bt.toObject(Ar,{defaults:!1,arrays:!0,longs:Number,objects:!1}),qr=new ur({type:Gt[Lr.Type],data:Lr.Data,blockSizes:Lr.blocksizes,mode:Lr.mode,mtime:Lr.mtime?{secs:Lr.mtime.Seconds,nsecs:Lr.mtime.FractionalNanoseconds}:void 0});return qr._originalMode=Lr.mode||0,qr}constructor($r={type:"file"}){const{type:Ar,data:Lr,blockSizes:qr,hashType:Fr,fanout:Hr,mtime:Br,mode:Wr}=$r;if(Ar&&!Gt.includes(Ar))throw Wt(new Error("Type: "+Ar+" is not valid"),"ERR_INVALID_TYPE");this.type=Ar||"file",this.data=Lr,this.hashType=Fr,this.fanout=Hr,this.blockSizes=qr||[],this._originalMode=0,this.mode=Zt(Wr),Br&&(this.mtime=Qt(Br),this.mtime&&!this.mtime.nsecs&&(this.mtime.nsecs=0))}set mode($r){this._mode=this.isDirectory()?Jt:Xt;const Ar=Zt($r);Ar!==void 0&&(this._mode=Ar)}get mode(){return this._mode}isDirectory(){return!!(this.type&&Yt.includes(this.type))}addBlockSize($r){this.blockSizes.push($r)}removeBlockSize($r){this.blockSizes.splice($r,1)}fileSize(){if(this.isDirectory())return 0;let $r=0;return this.blockSizes.forEach(Ar=>{$r+=Ar}),this.data&&($r+=this.data.length),$r}marshal(){let $r;switch(this.type){case"raw":$r=Bt.DataType.Raw;break;case"directory":$r=Bt.DataType.Directory;break;case"file":$r=Bt.DataType.File;break;case"metadata":$r=Bt.DataType.Metadata;break;case"symlink":$r=Bt.DataType.Symlink;break;case"hamt-sharded-directory":$r=Bt.DataType.HAMTShard;break;default:throw Wt(new Error("Type: "+$r+" is not valid"),"ERR_INVALID_TYPE")}let Ar=this.data;(!this.data||!this.data.length)&&(Ar=void 0);let Lr;this.mode!=null&&(Lr=this._originalMode&4294963200|(Zt(this.mode)||0),Lr===Xt&&!this.isDirectory()&&(Lr=void 0),Lr===Jt&&this.isDirectory()&&(Lr=void 0));let qr;if(this.mtime!=null){const Hr=Qt(this.mtime);Hr&&(qr={Seconds:Hr.secs,FractionalNanoseconds:Hr.nsecs},qr.FractionalNanoseconds===0&&delete qr.FractionalNanoseconds)}const Fr={Type:$r,Data:Ar,filesize:this.isDirectory()?void 0:this.fileSize(),blocksizes:this.blockSizes,hashType:this.hashType,fanout:this.fanout,mode:Lr,mtime:qr};return Bt.encode(Fr).finish()}}return src$6={UnixFS:ur,parseMode:Zt,parseMtime:Qt},src$6}var encode_1,hasRequiredEncode;function requireEncode(){if(hasRequiredEncode)return encode_1;hasRequiredEncode=1,encode_1=Xt;var Bt=128,Wt=127,Gt=~Wt,Yt=Math.pow(2,31);function Xt(Jt,Zt,Qt){if(Number.MAX_SAFE_INTEGER&&Jt>Number.MAX_SAFE_INTEGER)throw Xt.bytes=0,new RangeError("Could not encode varint");Zt=Zt||[],Qt=Qt||0;for(var ur=Qt;Jt>=Yt;)Zt[Qt++]=Jt&255|Bt,Jt/=128;for(;Jt&Gt;)Zt[Qt++]=Jt&255|Bt,Jt>>>=7;return Zt[Qt]=Jt|0,Xt.bytes=Qt-ur+1,Zt}return encode_1}var decode,hasRequiredDecode;function requireDecode(){if(hasRequiredDecode)return decode;hasRequiredDecode=1,decode=Gt;var Bt=128,Wt=127;function Gt(Yt,Zt){var Jt=0,Zt=Zt||0,Qt=0,ur=Zt,cr,$r=Yt.length;do{if(ur>=$r||Qt>49)throw Gt.bytes=0,new RangeError("Could not decode varint");cr=Yt[ur++],Jt+=Qt<28?(cr&Wt)<<Qt:(cr&Wt)*Math.pow(2,Qt),Qt+=7}while(cr>=Bt);return Gt.bytes=ur-Zt,Jt}return decode}var length,hasRequiredLength;function requireLength(){if(hasRequiredLength)return length;hasRequiredLength=1;var Bt=Math.pow(2,7),Wt=Math.pow(2,14),Gt=Math.pow(2,21),Yt=Math.pow(2,28),Xt=Math.pow(2,35),Jt=Math.pow(2,42),Zt=Math.pow(2,49),Qt=Math.pow(2,56),ur=Math.pow(2,63);return length=function(cr){return cr<Bt?1:cr<Wt?2:cr<Gt?3:cr<Yt?4:cr<Xt?5:cr<Jt?6:cr<Zt?7:cr<Qt?8:cr<ur?9:10},length}var varint,hasRequiredVarint;function requireVarint(){return hasRequiredVarint||(hasRequiredVarint=1,varint={encode:requireEncode(),decode:requireDecode(),encodingLength:requireLength()}),varint}var util$3,hasRequiredUtil$2;function requireUtil$2(){if(hasRequiredUtil$2)return util$3;hasRequiredUtil$2=1;const Bt=requireVarint(),{toString:Wt}=require$$5$1,{fromString:Gt}=require$$1$4;util$3={numberToUint8Array:Xt,uint8ArrayToNumber:Yt,varintUint8ArrayEncode:Jt,varintEncode:Zt};function Yt(Qt){return parseInt(Wt(Qt,"base16"),16)}function Xt(Qt){let ur=Qt.toString(16);return ur.length%2===1&&(ur="0"+ur),Gt(ur,"base16")}function Jt(Qt){return Uint8Array.from(Bt.encode(Yt(Qt)))}function Zt(Qt){return Uint8Array.from(Bt.encode(Qt))}return util$3}var generatedTable,hasRequiredGeneratedTable;function requireGeneratedTable(){return hasRequiredGeneratedTable||(hasRequiredGeneratedTable=1,generatedTable={baseTable:Object.freeze({identity:0,cidv1:1,cidv2:2,cidv3:3,ip4:4,tcp:6,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,dccp:33,"murmur3-128":34,"murmur3-32":35,ip6:41,ip6zone:42,path:47,multicodec:48,multihash:49,multiaddr:50,multibase:51,dns:53,dns4:54,dns6:55,dnsaddr:56,protobuf:80,cbor:81,raw:85,"dbl-sha2-256":86,rlp:96,bencode:99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,sctp:132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"eth-receipt-log-trie":153,"eth-reciept-log":154,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"caip-50":202,streamid:206,"stellar-block":208,"stellar-tx":209,md4:212,md5:213,bmt:214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,zeronet:230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"bls12_381-g1g2-pub":238,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,udp:273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,udt:301,utp:302,unix:400,thread:406,p2p:421,ipfs:421,https:443,onion:444,onion3:445,garlic64:446,garlic32:447,tls:448,noise:454,quic:460,ws:477,wss:478,"p2p-websocket-star":479,http:480,"swhid-1-snp":496,json:512,messagepack:513,"libp2p-peer-record":769,"libp2p-relay-rsvp":770,"car-index-sorted":1024,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"p256-pub":4608,"p384-pub":4609,"p521-pub":4610,"ed448-pub":4611,"x448-pub":4612,"ed25519-priv":4864,"secp256k1-priv":4865,"x25519-priv":4866,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332,"skynet-ns":11639056,"arweave-ns":11704592})}),generatedTable}var maps,hasRequiredMaps;function requireMaps(){if(hasRequiredMaps)return maps;hasRequiredMaps=1;const{baseTable:Bt}=requireGeneratedTable(),Wt=requireUtil$2().varintEncode,Gt={},Yt={},Xt={};for(const Zt in Bt){const Qt=Zt,ur=Bt[Qt];Gt[Qt]=Wt(ur);const cr=Qt.toUpperCase().replace(/-/g,"_");Yt[cr]=ur,Xt[ur]||(Xt[ur]=Qt)}Object.freeze(Gt),Object.freeze(Yt),Object.freeze(Xt);const Jt=Object.freeze(Bt);return maps={nameToVarint:Gt,constantToCode:Yt,nameToCode:Jt,codeToName:Xt},maps}var src$5,hasRequiredSrc$4;function requireSrc$4(){if(hasRequiredSrc$4)return src$5;hasRequiredSrc$4=1;const Bt=requireVarint(),{concat:Wt}=require$$1$3,Gt=requireUtil$2(),{nameToVarint:Yt,constantToCode:Xt,nameToCode:Jt,codeToName:Zt}=requireMaps();function Qt(hn,Qr){let pn;if(hn instanceof Uint8Array)pn=Gt.varintUint8ArrayEncode(hn);else if(Yt[hn])pn=Yt[hn];else throw new Error("multicodec not recognized");return Wt([pn,Qr],pn.length+Qr.length)}function ur(hn){return Bt.decode(hn),hn.slice(Bt.decode.bytes)}function cr(hn){const Qr=Bt.decode(hn),pn=Zt[Qr];if(pn===void 0)throw new Error(`Code "${Qr}" not found`);return pn}function $r(hn){return Zt[hn]}function Ar(hn){const Qr=Jt[hn];if(Qr===void 0)throw new Error(`Codec "${hn}" not found`);return Qr}function Lr(hn){return Bt.decode(hn)}function qr(hn){const Qr=Yt[hn];if(Qr===void 0)throw new Error(`Codec "${hn}" not found`);return Qr}function Fr(hn){return Gt.varintEncode(hn)}function Hr(hn){return cr(hn)}function Br(hn){return $r(hn)}function Wr(hn){return Ar(hn)}function Gr(hn){return Lr(hn)}function Kr(hn){return qr(hn)}function Yr(hn){return Array.from(Fr(hn))}return src$5={addPrefix:Qt,rmPrefix:ur,getNameFromData:cr,getNameFromCode:$r,getCodeFromName:Ar,getCodeFromData:Lr,getVarintFromName:qr,getVarintFromCode:Fr,getCodec:Hr,getName:Br,getNumber:Wr,getCode:Gr,getCodeVarint:Kr,getVarint:Yr,...Xt,nameToVarint:Yt,nameToCode:Jt,codeToName:Zt},src$5}var cidUtil,hasRequiredCidUtil;function requireCidUtil(){if(hasRequiredCidUtil)return cidUtil;hasRequiredCidUtil=1;const Bt=src$8;return cidUtil={checkCIDComponents:function(Gt){if(Gt==null)return"null values are not valid CIDs";if(!(Gt.version===0||Gt.version===1))return"Invalid version, must be a number equal to 1 or 0";if(typeof Gt.codec!="string")return"codec must be string";if(Gt.version===0){if(Gt.codec!=="dag-pb")return"codec must be 'dag-pb' for CIDv0";if(Gt.multibaseName!=="base58btc")return"multibaseName must be 'base58btc' for CIDv0"}if(!(Gt.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{Bt.validate(Gt.multihash)}catch(Yt){let Xt=Yt.message;return Xt||(Xt="Multihash validation failed"),Xt}}},cidUtil}var src$4,hasRequiredSrc$3;function requireSrc$3(){if(hasRequiredSrc$3)return src$4;hasRequiredSrc$3=1;const Bt=src$8,Wt=srcExports,Gt=requireSrc$4(),Yt=requireCidUtil(),{concat:Xt}=require$$1$3,{toString:Jt}=require$$5$1,{equals:Zt}=require$$6,Qt=Gt.nameToCode,ur=Object.keys(Qt).reduce((Ar,Lr)=>(Ar[Qt[Lr]]=Lr,Ar),{}),cr=Symbol.for("@ipld/js-cid/CID");class $r{constructor(Lr,qr,Fr,Hr){if(this.version,this.codec,this.multihash,Object.defineProperty(this,cr,{value:!0}),$r.isCID(Lr)){const Br=Lr;this.version=Br.version,this.codec=Br.codec,this.multihash=Br.multihash,this.multibaseName=Br.multibaseName||(Br.version===0?"base58btc":"base32");return}if(typeof Lr=="string"){const Br=Wt.isEncoded(Lr);if(Br){const Wr=Wt.decode(Lr);this.version=parseInt(Wr[0].toString(),16),this.codec=Gt.getCodec(Wr.slice(1)),this.multihash=Gt.rmPrefix(Wr.slice(1)),this.multibaseName=Br}else this.version=0,this.codec="dag-pb",this.multihash=Bt.fromB58String(Lr),this.multibaseName="base58btc";$r.validateCID(this),Object.defineProperty(this,"string",{value:Lr});return}if(Lr instanceof Uint8Array){const Br=parseInt(Lr[0].toString(),16);if(Br===1){const Wr=Lr;this.version=Br,this.codec=Gt.getCodec(Wr.slice(1)),this.multihash=Gt.rmPrefix(Wr.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=Lr,this.multibaseName="base58btc";$r.validateCID(this);return}this.version=Lr,typeof qr=="number"&&(qr=ur[qr]),this.codec=qr,this.multihash=Fr,this.multibaseName=Hr||(Lr===0?"base58btc":"base32"),$r.validateCID(this)}get bytes(){let Lr=this._bytes;if(!Lr){if(this.version===0)Lr=this.multihash;else if(this.version===1){const qr=Gt.getCodeVarint(this.codec);Lr=Xt([[1],qr,this.multihash],1+qr.byteLength+this.multihash.byteLength)}else throw new Error("unsupported version");Object.defineProperty(this,"_bytes",{value:Lr})}return Lr}get prefix(){const Lr=Gt.getCodeVarint(this.codec),qr=Bt.prefix(this.multihash);return Xt([[this.version],Lr,qr],1+Lr.byteLength+qr.byteLength)}get code(){return Qt[this.codec]}toV0(){if(this.codec!=="dag-pb")throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:Lr,length:qr}=Bt.decode(this.multihash);if(Lr!=="sha2-256")throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(qr!==32)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new $r(0,this.codec,this.multihash)}toV1(){return new $r(1,this.codec,this.multihash,this.multibaseName)}toBaseEncodedString(Lr=this.multibaseName){if(this.string&&this.string.length!==0&&Lr===this.multibaseName)return this.string;let qr;if(this.version===0){if(Lr!=="base58btc")throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");qr=Bt.toB58String(this.multihash)}else if(this.version===1)qr=Jt(Wt.encode(Lr,this.bytes));else throw new Error("unsupported version");return Lr===this.multibaseName&&Object.defineProperty(this,"string",{value:qr}),qr}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(Lr){return this.toBaseEncodedString(Lr)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(Lr){return this.codec===Lr.codec&&this.version===Lr.version&&Zt(this.multihash,Lr.multihash)}static validateCID(Lr){const qr=Yt.checkCIDComponents(Lr);if(qr)throw new Error(qr)}static isCID(Lr){return Lr instanceof $r||!!(Lr&&Lr[cr])}}return $r.codecs=Qt,src$4=$r,src$4}var persist_1,hasRequiredPersist;function requirePersist(){if(hasRequiredPersist)return persist_1;hasRequiredPersist=1;const Bt=src$7,Wt=requireSrc$3();return persist_1=async(Yt,Xt,Jt)=>{Jt.codec||(Jt.codec="dag-pb"),Jt.cidVersion||(Jt.cidVersion=0),Jt.hashAlg||(Jt.hashAlg="sha2-256"),Jt.hashAlg!=="sha2-256"&&(Jt.cidVersion=1);const Zt=await Bt(Yt,Jt.hashAlg),Qt=new Wt(Jt.cidVersion,Jt.codec,Zt);return Jt.onlyHash||await Xt.put(Yt,{pin:Jt.pin,preload:Jt.preload,timeout:Jt.timeout,cid:Qt}),Qt},persist_1}var resolver={},dag,hasRequiredDag;function requireDag(){if(hasRequiredDag)return dag;hasRequiredDag=1;var Bt=requireMinimal(),Wt=Bt.Reader,Gt=Bt.Writer,Yt=Bt.util,Xt=Bt.roots.default||(Bt.roots.default={});return Xt.PBLink=function(){function Jt(Zt){if(Zt)for(var Qt=Object.keys(Zt),ur=0;ur<Qt.length;++ur)Zt[Qt[ur]]!=null&&(this[Qt[ur]]=Zt[Qt[ur]])}return Jt.prototype.Hash=Yt.newBuffer([]),Jt.prototype.Name="",Jt.prototype.Tsize=Yt.Long?Yt.Long.fromBits(0,0,!0):0,Jt.encode=function(Qt,ur){return ur||(ur=Gt.create()),Qt.Hash!=null&&Object.hasOwnProperty.call(Qt,"Hash")&&ur.uint32(10).bytes(Qt.Hash),Qt.Name!=null&&Object.hasOwnProperty.call(Qt,"Name")&&ur.uint32(18).string(Qt.Name),Qt.Tsize!=null&&Object.hasOwnProperty.call(Qt,"Tsize")&&ur.uint32(24).uint64(Qt.Tsize),ur},Jt.decode=function(Qt,ur){Qt instanceof Wt||(Qt=Wt.create(Qt));for(var cr=ur===void 0?Qt.len:Qt.pos+ur,$r=new Xt.PBLink;Qt.pos<cr;){var Ar=Qt.uint32();switch(Ar>>>3){case 1:$r.Hash=Qt.bytes();break;case 2:$r.Name=Qt.string();break;case 3:$r.Tsize=Qt.uint64();break;default:Qt.skipType(Ar&7);break}}return $r},Jt.fromObject=function(Qt){if(Qt instanceof Xt.PBLink)return Qt;var ur=new Xt.PBLink;return Qt.Hash!=null&&(typeof Qt.Hash=="string"?Yt.base64.decode(Qt.Hash,ur.Hash=Yt.newBuffer(Yt.base64.length(Qt.Hash)),0):Qt.Hash.length&&(ur.Hash=Qt.Hash)),Qt.Name!=null&&(ur.Name=String(Qt.Name)),Qt.Tsize!=null&&(Yt.Long?(ur.Tsize=Yt.Long.fromValue(Qt.Tsize)).unsigned=!0:typeof Qt.Tsize=="string"?ur.Tsize=parseInt(Qt.Tsize,10):typeof Qt.Tsize=="number"?ur.Tsize=Qt.Tsize:typeof Qt.Tsize=="object"&&(ur.Tsize=new Yt.LongBits(Qt.Tsize.low>>>0,Qt.Tsize.high>>>0).toNumber(!0))),ur},Jt.toObject=function(Qt,ur){ur||(ur={});var cr={};if(ur.defaults)if(ur.bytes===String?cr.Hash="":(cr.Hash=[],ur.bytes!==Array&&(cr.Hash=Yt.newBuffer(cr.Hash))),cr.Name="",Yt.Long){var $r=new Yt.Long(0,0,!0);cr.Tsize=ur.longs===String?$r.toString():ur.longs===Number?$r.toNumber():$r}else cr.Tsize=ur.longs===String?"0":0;return Qt.Hash!=null&&Qt.hasOwnProperty("Hash")&&(cr.Hash=ur.bytes===String?Yt.base64.encode(Qt.Hash,0,Qt.Hash.length):ur.bytes===Array?Array.prototype.slice.call(Qt.Hash):Qt.Hash),Qt.Name!=null&&Qt.hasOwnProperty("Name")&&(cr.Name=Qt.Name),Qt.Tsize!=null&&Qt.hasOwnProperty("Tsize")&&(typeof Qt.Tsize=="number"?cr.Tsize=ur.longs===String?String(Qt.Tsize):Qt.Tsize:cr.Tsize=ur.longs===String?Yt.Long.prototype.toString.call(Qt.Tsize):ur.longs===Number?new Yt.LongBits(Qt.Tsize.low>>>0,Qt.Tsize.high>>>0).toNumber(!0):Qt.Tsize),cr},Jt.prototype.toJSON=function(){return this.constructor.toObject(this,Bt.util.toJSONOptions)},Jt}(),Xt.PBNode=function(){function Jt(Zt){if(this.Links=[],Zt)for(var Qt=Object.keys(Zt),ur=0;ur<Qt.length;++ur)Zt[Qt[ur]]!=null&&(this[Qt[ur]]=Zt[Qt[ur]])}return Jt.prototype.Links=Yt.emptyArray,Jt.prototype.Data=Yt.newBuffer([]),Jt.encode=function(Qt,ur){if(ur||(ur=Gt.create()),Qt.Data!=null&&Object.hasOwnProperty.call(Qt,"Data")&&ur.uint32(10).bytes(Qt.Data),Qt.Links!=null&&Qt.Links.length)for(var cr=0;cr<Qt.Links.length;++cr)Xt.PBLink.encode(Qt.Links[cr],ur.uint32(18).fork()).ldelim();return ur},Jt.decode=function(Qt,ur){Qt instanceof Wt||(Qt=Wt.create(Qt));for(var cr=ur===void 0?Qt.len:Qt.pos+ur,$r=new Xt.PBNode;Qt.pos<cr;){var Ar=Qt.uint32();switch(Ar>>>3){case 2:$r.Links&&$r.Links.length||($r.Links=[]),$r.Links.push(Xt.PBLink.decode(Qt,Qt.uint32()));break;case 1:$r.Data=Qt.bytes();break;default:Qt.skipType(Ar&7);break}}return $r},Jt.fromObject=function(Qt){if(Qt instanceof Xt.PBNode)return Qt;var ur=new Xt.PBNode;if(Qt.Links){if(!Array.isArray(Qt.Links))throw TypeError(".PBNode.Links: array expected");ur.Links=[];for(var cr=0;cr<Qt.Links.length;++cr){if(typeof Qt.Links[cr]!="object")throw TypeError(".PBNode.Links: object expected");ur.Links[cr]=Xt.PBLink.fromObject(Qt.Links[cr])}}return Qt.Data!=null&&(typeof Qt.Data=="string"?Yt.base64.decode(Qt.Data,ur.Data=Yt.newBuffer(Yt.base64.length(Qt.Data)),0):Qt.Data.length&&(ur.Data=Qt.Data)),ur},Jt.toObject=function(Qt,ur){ur||(ur={});var cr={};if((ur.arrays||ur.defaults)&&(cr.Links=[]),ur.defaults&&(ur.bytes===String?cr.Data="":(cr.Data=[],ur.bytes!==Array&&(cr.Data=Yt.newBuffer(cr.Data)))),Qt.Data!=null&&Qt.hasOwnProperty("Data")&&(cr.Data=ur.bytes===String?Yt.base64.encode(Qt.Data,0,Qt.Data.length):ur.bytes===Array?Array.prototype.slice.call(Qt.Data):Qt.Data),Qt.Links&&Qt.Links.length){cr.Links=[];for(var $r=0;$r<Qt.Links.length;++$r)cr.Links[$r]=Xt.PBLink.toObject(Qt.Links[$r],ur)}return cr},Jt.prototype.toJSON=function(){return this.constructor.toObject(this,Bt.util.toJSONOptions)},Jt}(),dag=Xt,dag}const require$$0$2=getAugmentedNamespace(basics);var bases_1$1,hasRequiredBases$1;function requireBases$1(){if(hasRequiredBases$1)return bases_1$1;hasRequiredBases$1=1;const{bases:Bt}=require$$0$2;function Wt(Jt,Zt,Qt,ur){return{name:Jt,prefix:Zt,encoder:{name:Jt,prefix:Zt,encode:Qt},decoder:{decode:ur}}}const Gt=Wt("utf8","u",Jt=>"u"+new TextDecoder("utf8").decode(Jt),Jt=>new TextEncoder().encode(Jt.substring(1))),Yt=Wt("ascii","a",Jt=>{let Zt="a";for(let Qt=0;Qt<Jt.length;Qt++)Zt+=String.fromCharCode(Jt[Qt]);return Zt},Jt=>{Jt=Jt.substring(1);const Zt=new Uint8Array(Jt.length);for(let Qt=0;Qt<Jt.length;Qt++)Zt[Qt]=Jt.charCodeAt(Qt);return Zt});return bases_1$1={utf8:Gt,"utf-8":Gt,hex:Bt.base16,latin1:Yt,ascii:Yt,binary:Yt,...Bt},bases_1$1}var fromString_1$1,hasRequiredFromString$1;function requireFromString$1(){if(hasRequiredFromString$1)return fromString_1$1;hasRequiredFromString$1=1;const Bt=requireBases$1();function Wt(Gt,Yt="utf8"){const Xt=Bt[Yt];if(!Xt)throw new Error(`Unsupported encoding "${Yt}"`);return Xt.decoder.decode(`${Xt.prefix}${Gt}`)}return fromString_1$1=Wt,fromString_1$1}var dagLink,hasRequiredDagLink;function requireDagLink(){if(hasRequiredDagLink)return dagLink;hasRequiredDagLink=1;const Bt=requireSrc$3(),Wt=requireFromString$1();class Gt{constructor(Xt,Jt,Zt){if(!Zt)throw new Error("A link requires a cid to point to");this.Name=Xt||"",this.Tsize=Jt,this.Hash=new Bt(Zt),Object.defineProperties(this,{_nameBuf:{value:null,writable:!0,enumerable:!1}})}toString(){return`DAGLink <${this.Hash.toBaseEncodedString()} - name: "${this.Name}", size: ${this.Tsize}>`}toJSON(){return this._json||(this._json=Object.freeze({name:this.Name,size:this.Tsize,cid:this.Hash.toBaseEncodedString()})),Object.assign({},this._json)}get nameAsBuffer(){return this._nameBuf!=null?this._nameBuf:(this._nameBuf=Wt(this.Name),this._nameBuf)}}return dagLink=Gt,dagLink}var stable={exports:{}},hasRequiredStable;function requireStable(){return hasRequiredStable||(hasRequiredStable=1,function(Bt,Wt){//! stable.js 0.1.8, https://github.com/Two-Screen/stable
904
904
  //! © 2018 Angry Bytes and contributors. MIT licensed.