@dcl/profile-site 0.6.3-5895493311.commit-255ec34 → 0.6.3-5895692123.commit-fc3ae7c

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.
@@ -1,19 +1,19 @@
1
- import{G as El,d as L,e as Or,B as U,u as Vn,b as Yi,H as Lr,g as Cl}from"./index-21d487c4.js";import{f as Il,b as xl,j as kl,c as jr,g as qa,p as Rl,e as Ml,l as Tl,d as Ja}from"./index-e228a79b.js";import{_ as b}from"./tslib.es6-c2094241.js";function Al(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ps={},$n={},$r={};Object.defineProperty($r,"__esModule",{value:!0});$r.walletLogo=void 0;const Nl=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};$r.walletLogo=Nl;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ScopedLocalStorage=void 0;class Ol{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}Dr.ScopedLocalStorage=Ol;var nn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.EVENTS=void 0;bn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Hn={},K={},Pr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Pr);Object.defineProperty(K,"__esModule",{value:!0});K.EthereumAddressFromSignedMessageResponse=K.SubmitEthereumTransactionResponse=K.SignEthereumTransactionResponse=K.SignEthereumMessageResponse=K.isRequestEthereumAccountsResponse=K.SelectProviderResponse=K.WatchAssetReponse=K.RequestEthereumAccountsResponse=K.SwitchEthereumChainResponse=K.AddEthereumChainResponse=K.isErrorResponse=void 0;const ot=Pr;function Ll(t){var e,n;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((n=t)===null||n===void 0?void 0:n.errorMessage)!==void 0}K.isErrorResponse=Ll;function jl(t){return{method:ot.Web3Method.addEthereumChain,result:t}}K.AddEthereumChainResponse=jl;function $l(t){return{method:ot.Web3Method.switchEthereumChain,result:t}}K.SwitchEthereumChainResponse=$l;function Dl(t){return{method:ot.Web3Method.requestEthereumAccounts,result:t}}K.RequestEthereumAccountsResponse=Dl;function Pl(t){return{method:ot.Web3Method.watchAsset,result:t}}K.WatchAssetReponse=Pl;function Fl(t){return{method:ot.Web3Method.selectProvider,result:t}}K.SelectProviderResponse=Fl;function Bl(t){return t&&t.method===ot.Web3Method.requestEthereumAccounts}K.isRequestEthereumAccountsResponse=Bl;function Vl(t){return{method:ot.Web3Method.signEthereumMessage,result:t}}K.SignEthereumMessageResponse=Vl;function Hl(t){return{method:ot.Web3Method.signEthereumTransaction,result:t}}K.SignEthereumTransactionResponse=Hl;function Wl(t){return{method:ot.Web3Method.submitEthereumTransaction,result:t}}K.SubmitEthereumTransactionResponse=Wl;function Ul(t){return{method:ot.Web3Method.ethereumAddressFromSignedMessage,result:t}}K.EthereumAddressFromSignedMessageResponse=Ul;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.LIB_VERSION=void 0;Wn.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Il,n=K,r=Wn;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(h){return h!==void 0?(0,e.getMessageFromCode)(h):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(h="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${h}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(h,u){const f=(0,e.serializeError)(o(h),{shouldIncludeStack:!0}),d=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");d.searchParams.set("version",r.LIB_VERSION),d.searchParams.set("code",f.code.toString());const p=a(f.data,u);return p&&d.searchParams.set("method",p),d.searchParams.set("message",f.message),Object.assign(Object.assign({},f),{docUrl:d.href})}t.serializeError=s;function o(h){return typeof h=="string"?{message:h,code:t.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(h)?Object.assign(Object.assign({},h),{message:h.errorMessage,code:h.errorCode,data:{method:h.method,result:h.result}}):h}function a(h,u){var f;const d=(f=h)===null||f===void 0?void 0:f.method;if(d)return d;if(u!==void 0)return typeof u=="string"?u:Array.isArray(u)?u.length>0?u[0].method:void 0:u.method}function c(h){var u;if(typeof h=="number")return h;if(l(h))return(u=h.code)!==null&&u!==void 0?u:h.errorCode}t.getErrorCode=c;function l(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}})(Hn);var gn={},x={},zl=String.prototype.replace,Gl=/%20/g,Ii={RFC1738:"RFC1738",RFC3986:"RFC3986"},bs={default:Ii.RFC3986,formatters:{RFC1738:function(t){return zl.call(t,Gl,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ii.RFC1738,RFC3986:Ii.RFC3986},ql=bs,xi=Object.prototype.hasOwnProperty,kt=Array.isArray,Qe=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Jl=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(kt(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},Qa=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},Ql=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(kt(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!xi.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return kt(e)&&!kt(n)&&(i=Qa(e,r)),kt(e)&&kt(n)?(n.forEach(function(s,o){if(xi.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return xi.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},Zl=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Yl=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Kl=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var l=o.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===ql.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+Qe[l];continue}if(l<2048){a=a+(Qe[192|l>>6]+Qe[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Qe[224|l>>12]+Qe[128|l>>6&63]+Qe[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=Qe[240|l>>18]+Qe[128|l>>12&63]+Qe[128|l>>6&63]+Qe[128|l&63]}return a},Xl=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var l=a[c],h=o[l];typeof h=="object"&&h!==null&&r.indexOf(h)===-1&&(n.push({obj:o,prop:l}),r.push(h))}return Jl(n),e},eh=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},th=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},nh=function(e,n){return[].concat(e,n)},rh=function(e,n){if(kt(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Za={arrayToObject:Qa,assign:Zl,combine:nh,compact:Xl,decode:Yl,encode:Kl,isBuffer:th,isRegExp:eh,maybeMap:rh,merge:Ql},Ya=El,vr=Za,Tn=bs,ih=Object.prototype.hasOwnProperty,ho={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},ct=Array.isArray,sh=Array.prototype.push,Ka=function(t,e){sh.apply(t,ct(e)?e:[e])},oh=Date.prototype.toISOString,fo=Tn.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:vr.encode,encodeValuesOnly:!1,format:fo,formatter:Tn.formatters[fo],indices:!1,serializeDate:function(e){return oh.call(e)},skipNulls:!1,strictNullHandling:!1},ah=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ki={},ch=function t(e,n,r,i,s,o,a,c,l,h,u,f,d,p,g,S){for(var v=e,m=S,E=0,C=!1;(m=m.get(ki))!==void 0&&!C;){var w=m.get(e);if(E+=1,typeof w<"u"){if(w===E)throw new RangeError("Cyclic object value");C=!0}typeof m.get(ki)>"u"&&(E=0)}if(typeof c=="function"?v=c(n,v):v instanceof Date?v=u(v):r==="comma"&&ct(v)&&(v=vr.maybeMap(v,function(k){return k instanceof Date?u(k):k})),v===null){if(s)return a&&!p?a(n,_e.encoder,g,"key",f):n;v=""}if(ah(v)||vr.isBuffer(v)){if(a){var I=p?n:a(n,_e.encoder,g,"key",f);return[d(I)+"="+d(a(v,_e.encoder,g,"value",f))]}return[d(n)+"="+d(String(v))]}var B=[];if(typeof v>"u")return B;var Y;if(r==="comma"&&ct(v))p&&a&&(v=vr.maybeMap(v,a)),Y=[{value:v.length>0?v.join(",")||null:void 0}];else if(ct(c))Y=c;else{var A=Object.keys(v);Y=l?A.sort(l):A}for(var V=i&&ct(v)&&v.length===1?n+"[]":n,fe=0;fe<Y.length;++fe){var G=Y[fe],_=typeof G=="object"&&typeof G.value<"u"?G.value:v[G];if(!(o&&_===null)){var y=ct(v)?typeof r=="function"?r(V,G):V:V+(h?"."+G:"["+G+"]");S.set(e,E);var T=Ya();T.set(ki,S),Ka(B,t(_,y,r,i,s,o,r==="comma"&&p&&ct(v)?null:a,c,l,h,u,f,d,p,g,T))}}return B},uh=function(e){if(!e)return _e;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||_e.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Tn.default;if(typeof e.format<"u"){if(!ih.call(Tn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Tn.formatters[r],s=_e.filter;return(typeof e.filter=="function"||ct(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_e.addQueryPrefix,allowDots:typeof e.allowDots>"u"?_e.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_e.charsetSentinel,delimiter:typeof e.delimiter>"u"?_e.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_e.encode,encoder:typeof e.encoder=="function"?e.encoder:_e.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_e.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_e.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_e.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_e.strictNullHandling}},lh=function(t,e){var n=t,r=uh(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):ct(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in ho?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=ho[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var h=Ya(),u=0;u<i.length;++u){var f=i[u];r.skipNulls&&n[f]===null||Ka(o,ch(n[f],f,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,h))}var d=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},rn=Za,Ki=Object.prototype.hasOwnProperty,hh=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:rn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fh=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},Xa=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},dh="utf8=%26%2310003%3B",ph="utf8=%E2%9C%93",bh=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ph?l="utf-8":o[c]===dh&&(l="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var h=o[c],u=h.indexOf("]="),f=u===-1?h.indexOf("="):u+1,d,p;f===-1?(d=n.decoder(h,de.decoder,l,"key"),p=n.strictNullHandling?null:""):(d=n.decoder(h.slice(0,f),de.decoder,l,"key"),p=rn.maybeMap(Xa(h.slice(f+1),n),function(g){return n.decoder(g,de.decoder,l,"value")})),p&&n.interpretNumericEntities&&l==="iso-8859-1"&&(p=fh(p)),h.indexOf("[]=")>-1&&(p=hh(p)?[p]:p),Ki.call(r,d)?r[d]=rn.combine(r[d],p):r[d]=p}return r},gh=function(t,e,n,r){for(var i=r?e:Xa(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},mh=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,h=[];if(l){if(!r.plainObjects&&Ki.call(Object.prototype,l)&&!r.allowPrototypes)return;h.push(l)}for(var u=0;r.depth>0&&(c=a.exec(s))!==null&&u<r.depth;){if(u+=1,!r.plainObjects&&Ki.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(c[1])}return c&&h.push("["+s.slice(c.index)+"]"),gh(h,n,r,i)}},vh=function(e){if(!e)return de;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?de.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?de.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:de.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:de.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:de.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:de.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:de.comma,decoder:typeof e.decoder=="function"?e.decoder:de.decoder,delimiter:typeof e.delimiter=="string"||rn.isRegExp(e.delimiter)?e.delimiter:de.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:de.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:de.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:de.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:de.strictNullHandling}},yh=function(t,e){var n=vh(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?bh(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=mh(a,r[a],n,typeof t=="string");i=rn.merge(i,c,n)}return n.allowSparse===!0?i:rn.compact(i)},wh=lh,_h=yh,Sh=bs,Eh={formats:Sh,parse:_h,stringify:wh},Un={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(Un);var Ch=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(x,"__esModule",{value:!0});x.isInIFrame=x.createQrUrl=x.getFavicon=x.range=x.isBigNumber=x.ensureParsedJSONObject=x.ensureBN=x.ensureRegExpString=x.ensureIntNumber=x.ensureBuffer=x.ensureAddressString=x.ensureEvenLengthHexString=x.ensureHexString=x.isHexString=x.prepend0x=x.strip0x=x.has0xPrefix=x.hexStringFromIntNumber=x.intNumberFromHexString=x.bigIntStringFromBN=x.hexStringFromBuffer=x.hexStringToUint8Array=x.uint8ArrayToHex=x.randomBytesHex=void 0;const vt=Ch(Or),Ih=Eh,Pt=Hn,Pe=Un,ec=/^[0-9]*$/,tc=/^[a-f0-9]*$/;function xh(t){return nc(crypto.getRandomValues(new Uint8Array(t)))}x.randomBytesHex=xh;function nc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}x.uint8ArrayToHex=nc;function kh(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}x.hexStringToUint8Array=kh;function Rh(t,e=!1){const n=t.toString("hex");return(0,Pe.HexString)(e?"0x"+n:n)}x.hexStringFromBuffer=Rh;function Mh(t){return(0,Pe.BigIntString)(t.toString(10))}x.bigIntStringFromBN=Mh;function Th(t){return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}x.intNumberFromHexString=Th;function Ah(t){return(0,Pe.HexString)("0x"+new vt.default(t).toString(16))}x.hexStringFromIntNumber=Ah;function gs(t){return t.startsWith("0x")||t.startsWith("0X")}x.has0xPrefix=gs;function Fr(t){return gs(t)?t.slice(2):t}x.strip0x=Fr;function rc(t){return gs(t)?"0x"+t.slice(2):"0x"+t}x.prepend0x=rc;function zn(t){if(typeof t!="string")return!1;const e=Fr(t).toLowerCase();return tc.test(e)}x.isHexString=zn;function ic(t,e=!1){if(typeof t=="string"){const n=Fr(t).toLowerCase();if(tc.test(n))return(0,Pe.HexString)(e?"0x"+n:n)}throw Pt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}x.ensureHexString=ic;function Gn(t,e=!1){let n=ic(t,!1);return n.length%2===1&&(n=(0,Pe.HexString)("0"+n)),e?(0,Pe.HexString)("0x"+n):n}x.ensureEvenLengthHexString=Gn;function Nh(t){if(typeof t=="string"){const e=Fr(t).toLowerCase();if(zn(e)&&e.length===40)return(0,Pe.AddressString)(rc(e))}throw Pt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}x.ensureAddressString=Nh;function Oh(t){if(U.isBuffer(t))return t;if(typeof t=="string")if(zn(t)){const e=Gn(t,!1);return U.from(e,"hex")}else return U.from(t,"utf8");throw Pt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}x.ensureBuffer=Oh;function sc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Pe.IntNumber)(t);if(typeof t=="string"){if(ec.test(t))return(0,Pe.IntNumber)(Number(t));if(zn(t))return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}x.ensureIntNumber=sc;function Lh(t){if(t instanceof RegExp)return(0,Pe.RegExpString)(t.toString());throw Pt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}x.ensureRegExpString=Lh;function jh(t){if(t!==null&&(vt.default.isBN(t)||oc(t)))return new vt.default(t.toString(10),10);if(typeof t=="number")return new vt.default(sc(t));if(typeof t=="string"){if(ec.test(t))return new vt.default(t,10);if(zn(t))return new vt.default(Gn(t,!1),16)}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}x.ensureBN=jh;function $h(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Pt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}x.ensureParsedJSONObject=$h;function oc(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}x.isBigNumber=oc;function Dh(t,e){return Array.from({length:e-t},(n,r)=>t+r)}x.range=Dh;function Ph(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}x.getFavicon=Ph;function Fh(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,Ih.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}x.createQrUrl=Fh;function Bh(){try{return window.frameElement!==null}catch{return!1}}x.isInIFrame=Bh;Object.defineProperty(gn,"__esModule",{value:!0});gn.Session=void 0;const po=xl,bo=x,go="session:id",mo="session:secret",vo="session:linked";class ms{constructor(e,n,r,i){this._storage=e,this._id=n||(0,bo.randomBytesHex)(16),this._secret=r||(0,bo.randomBytesHex)(32),this._key=new po.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(go),r=e.getItem(vo),i=e.getItem(mo);return n&&i?new ms(e,n,i,r==="1"):null}static hash(e){return new po.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(go,this._id),this._storage.setItem(mo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(vo,this._linked?"1":"0")}}gn.Session=ms;var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WalletSDKRelayAbstract=Ge.APP_VERSION_KEY=Ge.LOCAL_STORAGE_ADDRESSES_KEY=Ge.WALLET_USER_NAME_KEY=void 0;const yo=Hn;Ge.WALLET_USER_NAME_KEY="walletUsername";Ge.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ge.APP_VERSION_KEY="AppVersion";class Vh{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw yo.standardErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,yo.serializeError)(s,e.method);return i})}}Ge.WalletSDKRelayAbstract=Vh;const Hh=kl,Wh=Or;function ac(t){return U.allocUnsafe(t).fill(0)}function cc(t,e,n){const r=ac(e);return t=Br(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Uh(t,e){return cc(t,e,!0)}function Br(t){if(!U.isBuffer(t))if(Array.isArray(t))t=U.from(t);else if(typeof t=="string")uc(t)?t=U.from(qh(lc(t)),"hex"):t=U.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=U.allocUnsafe(0);else if(Wh.isBN(t))t=t.toArrayLike(U);else if(t.toArray)t=U.from(t.toArray());else throw new Error("invalid type");return t}function zh(t){return t=Br(t),"0x"+t.toString("hex")}function Gh(t,e){return t=Br(t),e||(e=256),Hh("keccak"+e).update(t).digest()}function qh(t){return t.length%2?"0"+t:t}function uc(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function lc(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var hc={zeros:ac,setLength:cc,setLengthRight:Uh,isHexString:uc,stripHexPrefix:lc,toBuffer:Br,bufferToHex:zh,keccak:Gh};const Lt=hc,Nt=Or;function fc(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Yt(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function wo(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function dc(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Rt(t){var e=typeof t;if(e==="string")return Lt.isHexString(t)?new Nt(Lt.stripHexPrefix(t),16):new Nt(t,10);if(e==="number")return new Nt(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Xe(t,e){var n,r,i,s;if(t==="address")return Xe("uint160",Rt(e));if(t==="bool")return Xe("uint8",e?1:0);if(t==="string")return Xe("bytes",new U(e,"utf8"));if(Qh(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=dc(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Xe(t,e[s]));if(n==="dynamic"){var o=Xe("uint256",e.length);i.unshift(o)}return U.concat(i)}else{if(t==="bytes")return e=new U(e),i=U.concat([Xe("uint256",e.length),e]),e.length%32!==0&&(i=U.concat([i,Lt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=Yt(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return Lt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(U,"be",32)}else if(t.startsWith("int")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(U,"be",32)}else if(t.startsWith("ufixed")){if(n=wo(t),r=Rt(e),r<0)throw new Error("Supplied ufixed is negative");return Xe("uint256",r.mul(new Nt(2).pow(new Nt(n[1]))))}else if(t.startsWith("fixed"))return n=wo(t),Xe("int256",Rt(e).mul(new Nt(2).pow(new Nt(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Jh(t){return t==="string"||t==="bytes"||dc(t)==="dynamic"}function Qh(t){return t.lastIndexOf("]")===t.length-1}function Zh(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=fc(t[s]),a=e[s],c=Xe(o,a);Jh(o)?(n.push(Xe("uint256",i)),r.push(c),i+=c.length):n.push(c)}return U.concat(n.concat(r))}function pc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=fc(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new U(a,"utf8"));else if(o==="bool")i.push(new U(a?"01":"00","hex"));else if(o==="address")i.push(Lt.setLength(a,20));else if(o.startsWith("bytes")){if(n=Yt(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(Lt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(U,"be",n/8))}else if(o.startsWith("int")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(U,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return U.concat(i)}function Yh(t,e){return Lt.keccak(pc(t,e))}var Kh={rawEncode:Zh,solidityPack:pc,soliditySHA3:Yh};const We=hc,An=Kh,bc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Ri={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,l)=>{if(n[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":We.keccak(this.encodeData(c,l,n,r))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",We.keccak(l)];if(c==="string")return typeof l=="string"&&(l=U.from(l,"utf8")),["bytes32",We.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),u=l.map(f=>o(a,h,f));return["bytes32",We.keccak(An.rawEncode(u.map(([f])=>f),u.map(([,f])=>f)))]}return[c,l]};for(const a of n[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=We.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=U.from(a,"utf8")),a=We.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=We.keccak(this.encodeData(o.type,a,n,r)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return An.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return We.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return We.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in bc.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[U.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),We.keccak(U.concat(r))}};var Xh={TYPED_MESSAGE_SCHEMA:bc,TypedDataUtils:Ri,hashForSignTypedDataLegacy:function(t){return ef(t.data)},hashForSignTypedData_v3:function(t){return Ri.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ri.hash(t.data)}};function ef(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?We.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return An.soliditySHA3(["bytes32","bytes32"],[An.soliditySHA3(new Array(t.length).fill("string"),i),An.soliditySHA3(r,n)])}var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.filterFromParam=sn.FilterPolyfill=void 0;const Jt=Un,Se=x,tf=5*60*1e3,Mt={jsonrpc:"2.0",id:0};class nf{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Jt.IntNumber)(1),this.provider=e}async newFilter(e){const n=gc(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,Se.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,Se.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,Se.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(ar())}async getFilterLogs(e){const n=(0,Se.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[_o(r)]})):ar()}makeFilterId(){return(0,Jt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return ar();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return cr();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[_o(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Se.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const l=(0,Jt.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return ar();const r=await this.getCurrentBlockHeight();if(n>r)return cr();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,Se.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,Jt.IntNumber)(o))))).filter(o=>!!o),s=(0,Jt.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Mt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(cr())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},tf);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_blockNumber",params:[]}));return(0,Se.intNumberFromHexString)((0,Se.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getBlockByNumber",params:[(0,Se.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,Se.ensureHexString)(n.result.hash):null}}sn.FilterPolyfill=nf;function gc(t){return{fromBlock:So(t.fromBlock),toBlock:So(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}sn.filterFromParam=gc;function _o(t){const e={fromBlock:Eo(t.fromBlock),toBlock:Eo(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function So(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Jt.IntNumber)(0);if((0,Se.isHexString)(t))return(0,Se.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Eo(t){return t==="latest"?t:(0,Se.hexStringFromIntNumber)(t)}function ar(){return Object.assign(Object.assign({},Mt),{error:{code:-32e3,message:"filter not found"}})}function cr(){return Object.assign(Object.assign({},Mt),{result:[]})}var mc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(mc);var Vr={},vc={},Hr={},qn={},rf=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qn,"__esModule",{value:!0});qn.BaseBlockTracker=void 0;const sf=rf(jr),of=1e3,af=(t,e)=>t+e,Co=["sync","latest"];class cf extends sf.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*of,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Co.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Co.map(e=>this.listenerCount(e)).reduce(af)}_newPotentialLatest(e){const n=this._currentBlock;n&&Io(e)<=Io(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}qn.BaseBlockTracker=cf;function Io(t){return Number.parseInt(t,16)}var yc={},wc={},ye={};class _c extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function uf(t){return Fe(t)&&typeof t[Symbol.iterator]=="function"}function Fe(t){return typeof t=="object"&&t!=null}function xo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function he(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function lf(t){const{done:e,value:n}=t.next();return e?void 0:n}function hf(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${he(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Xi(t,e,n,r){uf(t)||(t=[t]);for(const i of t){const s=hf(i,e,n,r);s&&(yield s)}}function*vs(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Fe(e.schema)&&Fe(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,h,u]of e.entries(t,a)){const f=vs(h,u,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,h],coerce:s,mask:o,message:n.message});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):s&&(h=d[1],l===void 0?t=h:t instanceof Map?t.set(l,h):t instanceof Set?t.add(h):Fe(t)&&(h!==void 0||l in t)&&(t[l]=h))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ae{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const h=i(c,l);return Xi(h,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const h=s(c,l);return Xi(h,l,this,c)}:this.refiner=()=>[]}assert(e,n){return Sc(e,this,n)}create(e,n){return Ec(e,this,n)}is(e){return ys(e,this)}mask(e,n){return Cc(e,this,n)}validate(e,n={}){return mn(e,this,n)}}function Sc(t,e,n){const r=mn(t,e,{message:n});if(r[0])throw r[0]}function Ec(t,e,n){const r=mn(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Cc(t,e,n){const r=mn(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ys(t,e){return!mn(t,e)[0]}function mn(t,e,n={}){const r=vs(t,e,n),i=lf(r);return i[0]?[new _c(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function ff(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?_s(r):Jn(r)}function Re(t,e){return new ae({type:t,schema:null,validator:e})}function df(t,e){return new ae({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function pf(t){return new ae({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function bf(t){let e;return new ae({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function gf(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return _s(r);default:return Jn(r)}}function mf(t){const e=t instanceof ae?{...t.schema}:{...t};for(const n in e)e[n]=Ic(e[n]);return Jn(e)}function vf(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return Jn(r)}function yf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Re(t,e)}function wf(){return Re("any",()=>!0)}function _f(t){return new ae({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${he(e)}`}})}function Sf(){return Re("bigint",t=>typeof t=="bigint")}function Ef(){return Re("boolean",t=>typeof t=="boolean")}function Cf(){return Re("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${he(t)}`)}function If(t){const e={},n=t.map(r=>he(r)).join();for(const r of t)e[r]=r;return new ae({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${he(r)}`}})}function xf(){return Re("func",t=>typeof t=="function"||`Expected a function, but received: ${he(t)}`)}function kf(t){return Re("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${he(e)}`)}function Rf(){return Re("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${he(t)}`)}function Mf(t){return new ae({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function Tf(t){const e=he(t),n=typeof t;return new ae({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${he(r)}`}})}function Af(t,e){return new ae({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${he(n)}`}})}function ws(){return Re("never",()=>!1)}function Nf(t){return new ae({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Of(){return Re("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${he(t)}`)}function Jn(t){const e=t?Object.keys(t):[],n=ws();return new ae({type:"object",schema:t||null,*entries(r){if(t&&Fe(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Fe(r)||`Expected an object, but received: ${he(r)}`},coercer(r){return Fe(r)?{...r}:r}})}function Ic(t){return new ae({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Lf(t,e){return new ae({type:"record",schema:null,*entries(n){if(Fe(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`}})}function jf(){return Re("regexp",t=>t instanceof RegExp)}function $f(t){return new ae({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${he(e)}`}})}function xc(){return Re("string",t=>typeof t=="string"||`Expected a string, but received: ${he(t)}`)}function Df(t){const e=ws();return new ae({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${he(n)}`}})}function _s(t){const e=Object.keys(t);return new ae({type:"type",schema:t,*entries(n){if(Fe(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`},coercer(n){return Fe(n)?{...n}:n}})}function Pf(t){const e=t.map(n=>n.type).join(" | ");return new ae({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=vs(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${he(n)}`,...i]}})}function kc(){return Re("unknown",()=>!0)}function Ss(t,e,n){return new ae({...t,coercer:(r,i)=>ys(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function Ff(t,e,n={}){return Ss(t,kc(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&xo(r)&&xo(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function Bf(t){return Ss(t,xc(),e=>e.trim())}function Vf(t){return Ft(t,"empty",e=>{const n=Rc(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Rc(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Hf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Wf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Uf(t){return Ft(t,"nonempty",e=>Rc(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function zf(t,e){return Ft(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function Gf(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Ft(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Ft(t,e,n){return new ae({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=Xi(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const qf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ae,StructError:_c,any:wf,array:_f,assert:Sc,assign:ff,bigint:Sf,boolean:Ef,coerce:Ss,create:Ec,date:Cf,defaulted:Ff,define:Re,deprecated:df,dynamic:pf,empty:Vf,enums:If,func:xf,instance:kf,integer:Rf,intersection:Mf,is:ys,lazy:bf,literal:Tf,map:Af,mask:Cc,max:Hf,min:Wf,never:ws,nonempty:Uf,nullable:Nf,number:Of,object:Jn,omit:gf,optional:Ic,partial:mf,pattern:zf,pick:vf,record:Lf,refine:Ft,regexp:jf,set:$f,size:Gf,string:xc,struct:yf,trimmed:Bf,tuple:Df,type:_s,union:Pf,unknown:kc,validate:mn},Symbol.toStringTag,{value:"Module"})),Bt=Vn(qf);Object.defineProperty(ye,"__esModule",{value:!0});ye.assertExhaustive=ye.assertStruct=ye.assert=ye.AssertionError=void 0;const Jf=Bt;function Qf(t){return typeof t=="object"&&t!==null&&"message"in t}function Zf(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function Yf(t){const e=Qf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Mc(t,e){return Zf(t)?new t({message:e}):t({message:e})}class Es extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ye.AssertionError=Es;function Kf(t,e="Assertion failed.",n=Es){if(!t)throw e instanceof Error?e:Mc(n,e)}ye.assert=Kf;function Xf(t,e,n="Assertion failed",r=Es){try{(0,Jf.assert)(t,e)}catch(i){throw Mc(r,`${n}: ${Yf(i)}.`)}}ye.assertStruct=Xf;function ed(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ye.assertExhaustive=ed;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.base64=void 0;const td=Bt,nd=ye,rd=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,nd.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,td.pattern)(t,a)};Qn.base64=rd;var W={},Zn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Bt,n=ye;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=r;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,n.assert)(r(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,n.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(Zn);Object.defineProperty(W,"__esModule",{value:!0});W.createDataView=W.concatBytes=W.valueToBytes=W.stringToBytes=W.numberToBytes=W.signedBigIntToBytes=W.bigIntToBytes=W.hexToBytes=W.bytesToString=W.bytesToNumber=W.bytesToSignedBigInt=W.bytesToBigInt=W.bytesToHex=W.assertIsBytes=W.isBytes=void 0;const Ae=ye,es=Zn,ko=48,Ro=58,Mo=87;function id(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const sd=id();function Cs(t){return t instanceof Uint8Array}W.isBytes=Cs;function vn(t){(0,Ae.assert)(Cs(t),"Value must be a Uint8Array.")}W.assertIsBytes=vn;function Tc(t){if(vn(t),t.length===0)return"0x";const e=sd(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,es.add0x)(n.join(""))}W.bytesToHex=Tc;function Ac(t){vn(t);const e=Tc(t);return BigInt(e)}W.bytesToBigInt=Ac;function od(t){vn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}W.bytesToSignedBigInt=od;function ad(t){vn(t);const e=Ac(t);return(0,Ae.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}W.bytesToNumber=ad;function cd(t){return vn(t),new TextDecoder().decode(t)}W.bytesToString=cd;function Wr(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,es.assertIsHexString)(t);const n=(0,es.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Ro?ko:Mo),l=a-(a<Ro?ko:Mo);i[s]=c*16+l}return i}W.hexToBytes=Wr;function Nc(t){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Wr(e)}W.bigIntToBytes=Nc;function ud(t,e){(0,Ae.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ld(t,e){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(typeof e=="number","Byte length must be a number."),(0,Ae.assert)(e>0,"Byte length must be greater than 0."),(0,Ae.assert)(ud(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}W.signedBigIntToBytes=ld;function Oc(t){(0,Ae.assert)(typeof t=="number","Value must be a number."),(0,Ae.assert)(t>=0,"Value must be a non-negative number."),(0,Ae.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Wr(e)}W.numberToBytes=Oc;function Lc(t){return(0,Ae.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}W.stringToBytes=Lc;function jc(t){if(typeof t=="bigint")return Nc(t);if(typeof t=="number")return Oc(t);if(typeof t=="string")return t.startsWith("0x")?Wr(t):Lc(t);if(Cs(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}W.valueToBytes=jc;function hd(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=jc(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}W.concatBytes=hd;function fd(t){if(typeof U<"u"&&t instanceof U){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}W.createDataView=fd;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ChecksumStruct=void 0;const To=Bt,dd=Qn;Ur.ChecksumStruct=(0,To.size)((0,dd.base64)((0,To.string)(),{paddingRequired:!0}),44,44);var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.createHex=nt.createBytes=nt.createBigInt=nt.createNumber=void 0;const ne=Bt,pd=ye,$c=W,zr=Zn,Dc=(0,ne.union)([(0,ne.number)(),(0,ne.bigint)(),(0,ne.string)(),zr.StrictHexStruct]),bd=(0,ne.coerce)((0,ne.number)(),Dc,Number),gd=(0,ne.coerce)((0,ne.bigint)(),Dc,BigInt);(0,ne.union)([zr.StrictHexStruct,(0,ne.instance)(Uint8Array)]);const md=(0,ne.coerce)((0,ne.instance)(Uint8Array),(0,ne.union)([zr.StrictHexStruct]),$c.hexToBytes),vd=(0,ne.coerce)(zr.StrictHexStruct,(0,ne.instance)(Uint8Array),$c.bytesToHex);function yd(t){try{const e=(0,ne.create)(t,bd);return(0,pd.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}nt.createNumber=yd;function wd(t){try{return(0,ne.create)(t,gd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}nt.createBigInt=wd;function _d(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ne.create)(t,md)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createBytes=_d;function Sd(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ne.create)(t,vd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createHex=Sd;var on={},Pc=L&&L.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Ee=L&&L.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ve,Ze;Object.defineProperty(on,"__esModule",{value:!0});on.FrozenSet=on.FrozenMap=void 0;class Is{constructor(e){Ve.set(this,void 0),Pc(this,Ve,new Map(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ve,"f").size}[(Ve=new WeakMap,Symbol.iterator)](){return Ee(this,Ve,"f")[Symbol.iterator]()}entries(){return Ee(this,Ve,"f").entries()}forEach(e,n){return Ee(this,Ve,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Ee(this,Ve,"f").get(e)}has(e){return Ee(this,Ve,"f").has(e)}keys(){return Ee(this,Ve,"f").keys()}values(){return Ee(this,Ve,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}on.FrozenMap=Is;class xs{constructor(e){Ze.set(this,void 0),Pc(this,Ze,new Set(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ze,"f").size}[(Ze=new WeakMap,Symbol.iterator)](){return Ee(this,Ze,"f")[Symbol.iterator]()}entries(){return Ee(this,Ze,"f").entries()}forEach(e,n){return Ee(this,Ze,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Ee(this,Ze,"f").has(e)}keys(){return Ee(this,Ze,"f").keys()}values(){return Ee(this,Ze,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}on.FrozenSet=xs;Object.freeze(Is);Object.freeze(Is.prototype);Object.freeze(xs);Object.freeze(xs.prototype);var Fc={},ks={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function n(l){return l==null}t.isNullOrUndefined=n;function r(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=r;const i=(l,h)=>Object.hasOwnProperty.call(l,h);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let h=l;for(;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(l)===h}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var h;return l.split("").reduce((f,d)=>o(d)?f+1:f+2,0)+((h=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&h!==void 0?h:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(ks);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Bt,n=ye,r=ks;t.JsonStruct=(0,e.define)("Json",w=>{const[I]=C(w,!0);return I?!0:"Expected a valid JSON-serializable value"});function i(w){return(0,e.is)(w,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(w){return(0,e.is)(w,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(w,I){(0,n.assertStruct)(w,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",I)}t.assertIsJsonRpcNotification=o;function a(w){return(0,e.is)(w,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(w,I){(0,n.assertStruct)(w,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",I)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(w){return(0,e.is)(w,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function h(w,I){(0,n.assertStruct)(w,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",I)}t.assertIsPendingJsonRpcResponse=h;function u(w){return(0,e.is)(w,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=u;function f(w,I){(0,n.assertStruct)(w,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",I)}t.assertIsJsonRpcResponse=f;function d(w){return(0,e.is)(w,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=d;function p(w,I){(0,n.assertStruct)(w,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",I)}t.assertIsJsonRpcSuccess=p;function g(w){return(0,e.is)(w,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=g;function S(w,I){(0,n.assertStruct)(w,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",I)}t.assertIsJsonRpcFailure=S;function v(w){return(0,e.is)(w,t.JsonRpcErrorStruct)}t.isJsonRpcError=v;function m(w,I){(0,n.assertStruct)(w,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",I)}t.assertIsJsonRpcError=m;function E(w){const{permitEmptyString:I,permitFractions:B,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},w);return V=>!!(typeof V=="number"&&(B||Number.isInteger(V))||typeof V=="string"&&(I||V.length>0)||Y&&V===null)}t.getJsonRpcIdValidator=E;function C(w,I=!1){const B=new Set;function Y(A,V){if(A===void 0)return[!1,0];if(A===null)return[!0,V?0:r.JsonSize.Null];const fe=typeof A;try{if(fe==="function")return[!1,0];if(fe==="string"||A instanceof String)return[!0,V?0:(0,r.calculateStringSize)(A)+r.JsonSize.Quote*2];if(fe==="boolean"||A instanceof Boolean)return V?[!0,0]:[!0,A==!0?r.JsonSize.True:r.JsonSize.False];if(fe==="number"||A instanceof Number)return V?[!0,0]:[!0,(0,r.calculateNumberSize)(A)];if(A instanceof Date)return V?[!0,0]:[!0,isNaN(A.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(A)&&!Array.isArray(A))return[!1,0];if(B.has(A))return[!1,0];B.add(A);try{return[!0,Object.entries(A).reduce((G,[_,y],T,k)=>{let[N,R]=Y(y,V);if(!N)throw new Error("JSON validation did not pass. Validation process stopped.");if(B.delete(A),V)return 0;const $=Array.isArray(A)?0:_.length+r.JsonSize.Comma+r.JsonSize.Colon*2,q=T<k.length-1?r.JsonSize.Comma:0;return G+$+R+q},V?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return Y(w,I)}t.validateJsonAndGetSize=C})(Fc);var an={},ts={exports:{}},Mi,Ao;function Ed(){if(Ao)return Mi;Ao=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;Mi=function(h,u){u=u||{};var f=typeof h;if(f==="string"&&h.length>0)return o(h);if(f==="number"&&isFinite(h))return u.long?c(h):a(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function o(h){if(h=String(h),!(h.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(u){var f=parseFloat(u[1]),d=(u[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(h){var u=Math.abs(h);return u>=r?Math.round(h/r)+"d":u>=n?Math.round(h/n)+"h":u>=e?Math.round(h/e)+"m":u>=t?Math.round(h/t)+"s":h+"ms"}function c(h){var u=Math.abs(h);return u>=r?l(h,u,r,"day"):u>=n?l(h,u,n,"hour"):u>=e?l(h,u,e,"minute"):u>=t?l(h,u,t,"second"):h+" ms"}function l(h,u,f,d){var p=u>=f*1.5;return Math.round(h/f)+" "+d+(p?"s":"")}return Mi}function Cd(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=Ed(),n.destroy=l,Object.keys(t).forEach(h=>{n[h]=t[h]}),n.names=[],n.skips=[],n.formatters={};function e(h){let u=0;for(let f=0;f<h.length;f++)u=(u<<5)-u+h.charCodeAt(f),u|=0;return n.colors[Math.abs(u)%n.colors.length]}n.selectColor=e;function n(h){let u,f=null,d,p;function g(...S){if(!g.enabled)return;const v=g,m=Number(new Date),E=m-(u||m);v.diff=E,v.prev=u,v.curr=m,u=m,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let C=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(I,B)=>{if(I==="%%")return"%";C++;const Y=n.formatters[B];if(typeof Y=="function"){const A=S[C];I=Y.call(v,A),S.splice(C,1),C--}return I}),n.formatArgs.call(v,S),(v.log||n.log).apply(v,S)}return g.namespace=h,g.useColors=n.useColors(),g.color=n.selectColor(h),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(h)),p),set:S=>{f=S}}),typeof n.init=="function"&&n.init(g),g}function r(h,u){const f=n(this.namespace+(typeof u>"u"?":":u)+h);return f.log=this.log,f}function i(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let u;const f=(typeof h=="string"?h:"").split(/[\s,]+/),d=f.length;for(u=0;u<d;u++)f[u]&&(h=f[u].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function s(){const h=[...n.names.map(a),...n.skips.map(a).map(u=>"-"+u)].join(",");return n.enable(""),h}function o(h){if(h[h.length-1]==="*")return!0;let u,f;for(u=0,f=n.skips.length;u<f;u++)if(n.skips[u].test(h))return!1;for(u=0,f=n.names.length;u<f;u++)if(n.names[u].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Id=Cd;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,u=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(h++,f==="%c"&&(u=h))}),c.splice(u,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof Yi<"u"&&"env"in Yi&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Id(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ts,ts.exports);var xd=ts.exports,kd=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(an,"__esModule",{value:!0});an.createModuleLogger=an.createProjectLogger=void 0;const Rd=kd(xd),Md=(0,Rd.default)("metamask");function Td(t){return Md.extend(t)}an.createProjectLogger=Td;function Ad(t,e){return t.extend(e)}an.createModuleLogger=Ad;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.hexToBigInt=rt.hexToNumber=rt.bigIntToHex=rt.numberToHex=void 0;const Kt=ye,Dn=Zn,Nd=t=>((0,Kt.assert)(typeof t=="number","Value must be a number."),(0,Kt.assert)(t>=0,"Value must be a non-negative number."),(0,Kt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Dn.add0x)(t.toString(16)));rt.numberToHex=Nd;const Od=t=>((0,Kt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kt.assert)(t>=0,"Value must be a non-negative bigint."),(0,Dn.add0x)(t.toString(16)));rt.bigIntToHex=Od;const Ld=t=>{(0,Dn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};rt.hexToNumber=Ld;const jd=t=>((0,Dn.assertIsHexString)(t),BigInt((0,Dn.add0x)(t)));rt.hexToBigInt=jd;var Bc={};Object.defineProperty(Bc,"__esModule",{value:!0});var Vc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(Vc);var Hc={},ns={exports:{}};const $d="2.0.0",Wc=256,Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Pd=16,Fd=Wc-6,Bd=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Gr={MAX_LENGTH:Wc,MAX_SAFE_COMPONENT_LENGTH:Pd,MAX_SAFE_BUILD_LENGTH:Fd,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Bd,SEMVER_SPEC_VERSION:$d,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Vd=typeof Yi=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var qr=Vd;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r}=Gr,i=qr;e=t.exports={};const s=e.re=[],o=e.safeRe=[],a=e.src=[],c=e.t={};let l=0;const h="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[h,r]],f=p=>{for(const[g,S]of u)p=p.split(`${g}*`).join(`${g}{0,${S}}`).split(`${g}+`).join(`${g}{1,${S}}`);return p},d=(p,g,S)=>{const v=f(g),m=l++;i(p,m,g),c[p]=m,a[m]=g,s[m]=new RegExp(g,S?"g":void 0),o[m]=new RegExp(v,S?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),d("FULL",`^${a[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),d("LOOSE",`^${a[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),d("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",a[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",d("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",d("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ns,ns.exports);var Yn=ns.exports;const Hd=Object.freeze({loose:!0}),Wd=Object.freeze({}),Ud=t=>t?typeof t!="object"?Hd:t:Wd;var Rs=Ud;const No=/^[0-9]+$/,Uc=(t,e)=>{const n=No.test(t),r=No.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},zd=(t,e)=>Uc(e,t);var zc={compareIdentifiers:Uc,rcompareIdentifiers:zd};const ur=qr,{MAX_LENGTH:Oo,MAX_SAFE_INTEGER:lr}=Gr,{safeRe:Lo,t:jo}=Yn,Gd=Rs,{compareIdentifiers:Wt}=zc;let qd=class Ke{constructor(e,n){if(n=Gd(n),e instanceof Ke){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Oo)throw new TypeError(`version is longer than ${Oo} characters`);ur("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Lo[jo.LOOSE]:Lo[jo.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>lr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<lr)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(ur("SemVer.compare",this.version,this.options,e),!(e instanceof Ke)){if(typeof e=="string"&&e===this.version)return 0;e=new Ke(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Ke||(e=new Ke(e,this.options)),Wt(this.major,e.major)||Wt(this.minor,e.minor)||Wt(this.patch,e.patch)}comparePre(e){if(e instanceof Ke||(e=new Ke(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(ur("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}compareBuild(e){e instanceof Ke||(e=new Ke(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(ur("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),Wt(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var xe=qd;const $o=xe,Jd=(t,e,n=!1)=>{if(t instanceof $o)return t;try{return new $o(t,e)}catch(r){if(!n)return null;throw r}};var yn=Jd;const Qd=yn,Zd=(t,e)=>{const n=Qd(t,e);return n?n.version:null};var Yd=Zd;const Kd=yn,Xd=(t,e)=>{const n=Kd(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var ep=Xd;const Do=xe,tp=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Do(t instanceof Do?t.version:t,n).inc(e,r,i).version}catch{return null}};var np=tp;const Po=yn,rp=(t,e)=>{const n=Po(t,null,!0),r=Po(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const h=c?"pre":"";return n.major!==r.major?h+"major":n.minor!==r.minor?h+"minor":n.patch!==r.patch?h+"patch":"prerelease"};var ip=rp;const sp=xe,op=(t,e)=>new sp(t,e).major;var ap=op;const cp=xe,up=(t,e)=>new cp(t,e).minor;var lp=up;const hp=xe,fp=(t,e)=>new hp(t,e).patch;var dp=fp;const pp=yn,bp=(t,e)=>{const n=pp(t,e);return n&&n.prerelease.length?n.prerelease:null};var gp=bp;const Fo=xe,mp=(t,e,n)=>new Fo(t,n).compare(new Fo(e,n));var qe=mp;const vp=qe,yp=(t,e,n)=>vp(e,t,n);var wp=yp;const _p=qe,Sp=(t,e)=>_p(t,e,!0);var Ep=Sp;const Bo=xe,Cp=(t,e,n)=>{const r=new Bo(t,n),i=new Bo(e,n);return r.compare(i)||r.compareBuild(i)};var Ms=Cp;const Ip=Ms,xp=(t,e)=>t.sort((n,r)=>Ip(n,r,e));var kp=xp;const Rp=Ms,Mp=(t,e)=>t.sort((n,r)=>Rp(r,n,e));var Tp=Mp;const Ap=qe,Np=(t,e,n)=>Ap(t,e,n)>0;var Jr=Np;const Op=qe,Lp=(t,e,n)=>Op(t,e,n)<0;var Ts=Lp;const jp=qe,$p=(t,e,n)=>jp(t,e,n)===0;var Gc=$p;const Dp=qe,Pp=(t,e,n)=>Dp(t,e,n)!==0;var qc=Pp;const Fp=qe,Bp=(t,e,n)=>Fp(t,e,n)>=0;var As=Bp;const Vp=qe,Hp=(t,e,n)=>Vp(t,e,n)<=0;var Ns=Hp;const Wp=Gc,Up=qc,zp=Jr,Gp=As,qp=Ts,Jp=Ns,Qp=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Wp(t,n,r);case"!=":return Up(t,n,r);case">":return zp(t,n,r);case">=":return Gp(t,n,r);case"<":return qp(t,n,r);case"<=":return Jp(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var Jc=Qp;const Zp=xe,Yp=yn,{safeRe:hr,t:fr}=Yn,Kp=(t,e)=>{if(t instanceof Zp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(hr[fr.COERCE]);else{let r;for(;(r=hr[fr.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),hr[fr.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;hr[fr.COERCERTL].lastIndex=-1}return n===null?null:Yp(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)};var Xp=Kp,Ti,Vo;function e0(){return Vo||(Vo=1,Ti=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ti}var t0=z;z.Node=jt;z.create=z;function z(t){var e=this;if(e instanceof z||(e=new z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)r0(this,arguments[t]);return this.length};z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)i0(this,arguments[t]);return this.length};z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};z.prototype.map=function(t,e){e=e||this;for(var n=new z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=n0(this,i,n[r]);return s};z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function n0(t,e,n){var r=e===t.head?new jt(n,null,e,t):new jt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function r0(t,e){t.tail=new jt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function i0(t,e){t.head=new jt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function jt(t,e,n,r){if(!(this instanceof jt))return new jt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{e0()(z)}catch{}const s0=t0,Tt=Symbol("max"),ut=Symbol("length"),Ut=Symbol("lengthCalculator"),Nn=Symbol("allowStale"),Ot=Symbol("maxAge"),at=Symbol("dispose"),Ho=Symbol("noDisposeOnSet"),pe=Symbol("lruList"),Ue=Symbol("cache"),Qc=Symbol("updateAgeOnGet"),Ai=()=>1;class o0{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Tt]=e.max||1/0;const n=e.length||Ai;if(this[Ut]=typeof n!="function"?Ai:n,this[Nn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ot]=e.maxAge||0,this[at]=e.dispose,this[Ho]=e.noDisposeOnSet||!1,this[Qc]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Tt]=e||1/0,In(this)}get max(){return this[Tt]}set allowStale(e){this[Nn]=!!e}get allowStale(){return this[Nn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Ot]=e,In(this)}get maxAge(){return this[Ot]}set lengthCalculator(e){typeof e!="function"&&(e=Ai),e!==this[Ut]&&(this[Ut]=e,this[ut]=0,this[pe].forEach(n=>{n.length=this[Ut](n.value,n.key),this[ut]+=n.length})),In(this)}get lengthCalculator(){return this[Ut]}get length(){return this[ut]}get itemCount(){return this[pe].length}rforEach(e,n){n=n||this;for(let r=this[pe].tail;r!==null;){const i=r.prev;Wo(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[pe].head;r!==null;){const i=r.next;Wo(this,e,r,n),r=i}}keys(){return this[pe].toArray().map(e=>e.key)}values(){return this[pe].toArray().map(e=>e.value)}reset(){this[at]&&this[pe]&&this[pe].length&&this[pe].forEach(e=>this[at](e.key,e.value)),this[Ue]=new Map,this[pe]=new s0,this[ut]=0}dump(){return this[pe].map(e=>Er(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[pe]}set(e,n,r){if(r=r||this[Ot],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Ut](n,e);if(this[Ue].has(e)){if(s>this[Tt])return Xt(this,this[Ue].get(e)),!1;const c=this[Ue].get(e).value;return this[at]&&(this[Ho]||this[at](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[ut]+=s-c.length,c.length=s,this.get(e),In(this),!0}const o=new a0(e,n,s,i,r);return o.length>this[Tt]?(this[at]&&this[at](e,n),!1):(this[ut]+=o.length,this[pe].unshift(o),this[Ue].set(e,this[pe].head),In(this),!0)}has(e){if(!this[Ue].has(e))return!1;const n=this[Ue].get(e).value;return!Er(this,n)}get(e){return Ni(this,e,!0)}peek(e){return Ni(this,e,!1)}pop(){const e=this[pe].tail;return e?(Xt(this,e),e.value):null}del(e){Xt(this,this[Ue].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ue].forEach((e,n)=>Ni(this,n,!1))}}const Ni=(t,e,n)=>{const r=t[Ue].get(e);if(r){const i=r.value;if(Er(t,i)){if(Xt(t,r),!t[Nn])return}else n&&(t[Qc]&&(r.value.now=Date.now()),t[pe].unshiftNode(r));return i.value}},Er=(t,e)=>{if(!e||!e.maxAge&&!t[Ot])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ot]&&n>t[Ot]},In=t=>{if(t[ut]>t[Tt])for(let e=t[pe].tail;t[ut]>t[Tt]&&e!==null;){const n=e.prev;Xt(t,e),e=n}},Xt=(t,e)=>{if(e){const n=e.value;t[at]&&t[at](n.key,n.value),t[ut]-=n.length,t[Ue].delete(n.key),t[pe].removeNode(e)}};class a0{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Wo=(t,e,n,r)=>{let i=n.value;Er(t,i)&&(Xt(t,n),t[Nn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var c0=o0,Oi,Uo;function Je(){if(Uo)return Oi;Uo=1;class t{constructor(y,T){if(T=r(T),y instanceof t)return y.loose===!!T.loose&&y.includePrerelease===!!T.includePrerelease?y:new t(y.raw,T);if(y instanceof i)return this.raw=y.value,this.set=[[y]],this.format(),this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=y.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k)).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(N=>!p(N[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&g(N[0])){this.set=[N];break}}}this.format()}format(){return this.range=this.set.map(y=>y.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(y){const k=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+y,N=n.get(k);if(N)return N;const R=this.options.loose,$=R?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];y=y.replace($,fe(this.options.includePrerelease)),s("hyphen replace",y),y=y.replace(a[c.COMPARATORTRIM],l),s("comparator trim",y),y=y.replace(a[c.TILDETRIM],h),s("tilde trim",y),y=y.replace(a[c.CARETTRIM],u),s("caret trim",y);let q=y.split(" ").map(ce=>v(ce,this.options)).join(" ").split(/\s+/).map(ce=>V(ce,this.options));R&&(q=q.filter(ce=>(s("loose invalid filter",ce,this.options),!!ce.match(a[c.COMPARATORLOOSE])))),s("range list",q);const F=new Map,ee=q.map(ce=>new i(ce,this.options));for(const ce of ee){if(p(ce))return[ce];F.set(ce.value,ce)}F.size>1&&F.has("")&&F.delete("");const Me=[...F.values()];return n.set(k,Me),Me}intersects(y,T){if(!(y instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>S(k,T)&&y.set.some(N=>S(N,T)&&k.every(R=>N.every($=>R.intersects($,T)))))}test(y){if(!y)return!1;if(typeof y=="string")try{y=new o(y,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(G(this.set[T],y,this.options))return!0;return!1}}Oi=t;const e=c0,n=new e({max:1e3}),r=Rs,i=Qr(),s=qr,o=xe,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:h,caretTrimReplace:u}=Yn,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=Gr,p=_=>_.value==="<0.0.0-0",g=_=>_.value==="",S=(_,y)=>{let T=!0;const k=_.slice();let N=k.pop();for(;T&&k.length;)T=k.every(R=>N.intersects(R,y)),N=k.pop();return T},v=(_,y)=>(s("comp",_,y),_=w(_,y),s("caret",_),_=E(_,y),s("tildes",_),_=B(_,y),s("xrange",_),_=A(_,y),s("stars",_),_),m=_=>!_||_.toLowerCase()==="x"||_==="*",E=(_,y)=>_.trim().split(/\s+/).map(T=>C(T,y)).join(" "),C=(_,y)=>{const T=y.loose?a[c.TILDELOOSE]:a[c.TILDE];return _.replace(T,(k,N,R,$,q)=>{s("tilde",_,k,N,R,$,q);let F;return m(N)?F="":m(R)?F=`>=${N}.0.0 <${+N+1}.0.0-0`:m($)?F=`>=${N}.${R}.0 <${N}.${+R+1}.0-0`:q?(s("replaceTilde pr",q),F=`>=${N}.${R}.${$}-${q} <${N}.${+R+1}.0-0`):F=`>=${N}.${R}.${$} <${N}.${+R+1}.0-0`,s("tilde return",F),F})},w=(_,y)=>_.trim().split(/\s+/).map(T=>I(T,y)).join(" "),I=(_,y)=>{s("caret",_,y);const T=y.loose?a[c.CARETLOOSE]:a[c.CARET],k=y.includePrerelease?"-0":"";return _.replace(T,(N,R,$,q,F)=>{s("caret",_,N,R,$,q,F);let ee;return m(R)?ee="":m($)?ee=`>=${R}.0.0${k} <${+R+1}.0.0-0`:m(q)?R==="0"?ee=`>=${R}.${$}.0${k} <${R}.${+$+1}.0-0`:ee=`>=${R}.${$}.0${k} <${+R+1}.0.0-0`:F?(s("replaceCaret pr",F),R==="0"?$==="0"?ee=`>=${R}.${$}.${q}-${F} <${R}.${$}.${+q+1}-0`:ee=`>=${R}.${$}.${q}-${F} <${R}.${+$+1}.0-0`:ee=`>=${R}.${$}.${q}-${F} <${+R+1}.0.0-0`):(s("no pr"),R==="0"?$==="0"?ee=`>=${R}.${$}.${q}${k} <${R}.${$}.${+q+1}-0`:ee=`>=${R}.${$}.${q}${k} <${R}.${+$+1}.0-0`:ee=`>=${R}.${$}.${q} <${+R+1}.0.0-0`),s("caret return",ee),ee})},B=(_,y)=>(s("replaceXRanges",_,y),_.split(/\s+/).map(T=>Y(T,y)).join(" ")),Y=(_,y)=>{_=_.trim();const T=y.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return _.replace(T,(k,N,R,$,q,F)=>{s("xRange",_,k,N,R,$,q,F);const ee=m(R),Me=ee||m($),ce=Me||m(q),Cn=ce;return N==="="&&Cn&&(N=""),F=y.includePrerelease?"-0":"",ee?N===">"||N==="<"?k="<0.0.0-0":k="*":N&&Cn?(Me&&($=0),q=0,N===">"?(N=">=",Me?(R=+R+1,$=0,q=0):($=+$+1,q=0)):N==="<="&&(N="<",Me?R=+R+1:$=+$+1),N==="<"&&(F="-0"),k=`${N+R}.${$}.${q}${F}`):Me?k=`>=${R}.0.0${F} <${+R+1}.0.0-0`:ce&&(k=`>=${R}.${$}.0${F} <${R}.${+$+1}.0-0`),s("xRange return",k),k})},A=(_,y)=>(s("replaceStars",_,y),_.trim().replace(a[c.STAR],"")),V=(_,y)=>(s("replaceGTE0",_,y),_.trim().replace(a[y.includePrerelease?c.GTE0PRE:c.GTE0],"")),fe=_=>(y,T,k,N,R,$,q,F,ee,Me,ce,Cn,j2)=>(m(k)?T="":m(N)?T=`>=${k}.0.0${_?"-0":""}`:m(R)?T=`>=${k}.${N}.0${_?"-0":""}`:$?T=`>=${T}`:T=`>=${T}${_?"-0":""}`,m(ee)?F="":m(Me)?F=`<${+ee+1}.0.0-0`:m(ce)?F=`<${ee}.${+Me+1}.0-0`:Cn?F=`<=${ee}.${Me}.${ce}-${Cn}`:_?F=`<${ee}.${Me}.${+ce+1}-0`:F=`<=${F}`,`${T} ${F}`.trim()),G=(_,y,T)=>{for(let k=0;k<_.length;k++)if(!_[k].test(y))return!1;if(y.prerelease.length&&!T.includePrerelease){for(let k=0;k<_.length;k++)if(s(_[k].semver),_[k].semver!==i.ANY&&_[k].semver.prerelease.length>0){const N=_[k].semver;if(N.major===y.major&&N.minor===y.minor&&N.patch===y.patch)return!0}return!1}return!0};return Oi}var Li,zo;function Qr(){if(zo)return Li;zo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,u){if(u=n(u),h instanceof e){if(h.loose===!!u.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),o("comparator",h,u),this.options=u,this.loose=!!u.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(h){const u=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=h.match(u);if(!f)throw new TypeError(`Invalid comparator: ${h}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(o("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new a(h,this.options)}catch{return!1}return s(h,this.operator,this.semver,this.options)}intersects(h,u){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(h.value,u).test(this.value):h.operator===""?h.value===""?!0:new c(this.value,u).test(h.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||s(this.semver,"<",h.semver,u)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||s(this.semver,">",h.semver,u)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Li=e;const n=Rs,{safeRe:r,t:i}=Yn,s=Jc,o=qr,a=xe,c=Je();return Li}const u0=Je(),l0=(t,e,n)=>{try{e=new u0(e,n)}catch{return!1}return e.test(t)};var Zr=l0;const h0=Je(),f0=(t,e)=>new h0(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var d0=f0;const p0=xe,b0=Je(),g0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new b0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new p0(r,n))}),r};var m0=g0;const v0=xe,y0=Je(),w0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new y0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new v0(r,n))}),r};var _0=w0;const ji=xe,S0=Je(),Go=Jr,E0=(t,e)=>{t=new S0(t,e);let n=new ji("0.0.0");if(t.test(n)||(n=new ji("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new ji(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Go(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||Go(n,s))&&(n=s)}return n&&t.test(n)?n:null};var C0=E0;const I0=Je(),x0=(t,e)=>{try{return new I0(t,e).range||"*"}catch{return null}};var k0=x0;const R0=xe,Zc=Qr(),{ANY:M0}=Zc,T0=Je(),A0=Zr,qo=Jr,Jo=Ts,N0=Ns,O0=As,L0=(t,e,n,r)=>{t=new R0(t,r),e=new T0(e,r);let i,s,o,a,c;switch(n){case">":i=qo,s=N0,o=Jo,a=">",c=">=";break;case"<":i=Jo,s=O0,o=qo,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A0(t,e,r))return!1;for(let l=0;l<e.set.length;++l){const h=e.set[l];let u=null,f=null;if(h.forEach(d=>{d.semver===M0&&(d=new Zc(">=0.0.0")),u=u||d,f=f||d,i(d.semver,u.semver,r)?u=d:o(d.semver,f.semver,r)&&(f=d)}),u.operator===a||u.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};var Os=L0;const j0=Os,$0=(t,e,n)=>j0(t,e,">",n);var D0=$0;const P0=Os,F0=(t,e,n)=>P0(t,e,"<",n);var B0=F0;const Qo=Je(),V0=(t,e,n)=>(t=new Qo(t,n),e=new Qo(e,n),t.intersects(e,n));var H0=V0;const W0=Zr,U0=qe;var z0=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((h,u)=>U0(h,u,n));for(const h of o)W0(h,e,n)?(s=h,i||(i=h)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[h,u]of r)h===u?a.push(h):!u&&h===o[0]?a.push("*"):u?h===o[0]?a.push(`<=${u}`):a.push(`${h} - ${u}`):a.push(`>=${h}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e};const Zo=Je(),Ls=Qr(),{ANY:$i}=Ls,xn=Zr,js=qe,G0=(t,e,n={})=>{if(t===e)return!0;t=new Zo(t,n),e=new Zo(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=J0(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},q0=[new Ls(">=0.0.0-0")],Yo=[new Ls(">=0.0.0")],J0=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===$i){if(e.length===1&&e[0].semver===$i)return!0;n.includePrerelease?t=q0:t=Yo}if(e.length===1&&e[0].semver===$i){if(n.includePrerelease)return!0;e=Yo}const r=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=Ko(i,d,n):d.operator==="<"||d.operator==="<="?s=Xo(s,d,n):r.add(d.semver);if(r.size>1)return null;let o;if(i&&s){if(o=js(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of r){if(i&&!xn(d,String(i),n)||s&&!xn(d,String(s),n))return null;for(const p of e)if(!xn(d,String(p),n))return!1;return!0}let a,c,l,h,u=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const d of e){if(h=h||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=Ko(i,d,n),a===d&&a!==i)return!1}else if(i.operator===">="&&!xn(i.semver,String(d),n))return!1}if(s){if(u&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===u.major&&d.semver.minor===u.minor&&d.semver.patch===u.patch&&(u=!1),d.operator==="<"||d.operator==="<="){if(c=Xo(s,d,n),c===d&&c!==s)return!1}else if(s.operator==="<="&&!xn(s.semver,String(d),n))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&h&&!i&&o!==0||f||u)},Ko=(t,e,n)=>{if(!t)return e;const r=js(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},Xo=(t,e,n)=>{if(!t)return e;const r=js(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var Q0=G0;const Di=Yn,ea=Gr,Z0=xe,ta=zc,Y0=yn,K0=Yd,X0=ep,eb=np,tb=ip,nb=ap,rb=lp,ib=dp,sb=gp,ob=qe,ab=wp,cb=Ep,ub=Ms,lb=kp,hb=Tp,fb=Jr,db=Ts,pb=Gc,bb=qc,gb=As,mb=Ns,vb=Jc,yb=Xp,wb=Qr(),_b=Je(),Sb=Zr,Eb=d0,Cb=m0,Ib=_0,xb=C0,kb=k0,Rb=Os,Mb=D0,Tb=B0,Ab=H0,Nb=z0,Ob=Q0;var Lb={parse:Y0,valid:K0,clean:X0,inc:eb,diff:tb,major:nb,minor:rb,patch:ib,prerelease:sb,compare:ob,rcompare:ab,compareLoose:cb,compareBuild:ub,sort:lb,rsort:hb,gt:fb,lt:db,eq:pb,neq:bb,gte:gb,lte:mb,cmp:vb,coerce:yb,Comparator:wb,Range:_b,satisfies:Sb,toComparators:Eb,maxSatisfying:Cb,minSatisfying:Ib,minVersion:xb,validRange:kb,outside:Rb,gtr:Mb,ltr:Tb,intersects:Ab,simplifyRange:Nb,subset:Ob,SemVer:Z0,re:Di.re,src:Di.src,tokens:Di.t,SEMVER_SPEC_VERSION:ea.SEMVER_SPEC_VERSION,RELEASE_TYPES:ea.RELEASE_TYPES,compareIdentifiers:ta.compareIdentifiers,rcompareIdentifiers:ta.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=Lb,n=Bt,r=ye;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",u=>(0,e.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",u=>(0,e.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function i(u){return(0,n.is)(u,t.VersionStruct)}t.isValidSemVerVersion=i;function s(u){return(0,n.is)(u,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(u){(0,r.assertStruct)(u,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(u){(0,r.assertStruct)(u,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(u,f){return(0,e.gt)(u,f)}t.gtVersion=c;function l(u,f){return(0,e.gtr)(u,f)}t.gtRange=l;function h(u,f){return(0,e.satisfies)(u,f,{includePrerelease:!0})}t.satisfiesVersionRange=h})(Hc);(function(t){var e=L&&L.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=L&&L.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ye,t),n(Qn,t),n(W,t),n(Ur,t),n(nt,t),n(on,t),n(Zn,t),n(Fc,t),n(an,t),n(ks,t),n(rt,t),n(Bc,t),n(Vc,t),n(Hc,t)})(wc);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=wc;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(yc);var Yc=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.PollingBlockTracker=void 0;const jb=Yc(qa),$b=Yc(Rl),Db=qn,na=yc,ra=(0,na.createModuleLogger)(na.projectLogger,"polling-block-tracker"),Pb=(0,jb.default)(),Fb=1e3;class Bb extends Db.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Fb,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=ia(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
2
- ${(e=n.stack)!==null&&e!==void 0?e:n}`);try{this.emit("error",r)}catch{console.error(r)}const i=ia(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:Pb(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),ra("Making request",e);const n=await(0,$b.default)(r=>this._provider.sendAsync(e,r))();if(ra("Got response",n),n.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
3
- ${n.error.message}`);return n.result}}Hr.PollingBlockTracker=Bb;function ia(t,e){return new Promise(n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()})}var Yr={},Vb=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.SubscribeBlockTracker=void 0;const Hb=Vb(qa),Wb=qn,Ub=(0,Hb.default)();class zb extends Wb.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...n){return new Promise((r,i)=>{this._provider.sendAsync({id:Ub(),method:e,params:n,jsonrpc:"2.0"},(s,o)=>{s?i(s):r(o.result)})})}_handleSubData(e,n){var r;n.method==="eth_subscription"&&((r=n.params)===null||r===void 0?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(n.params.result.number)}}Yr.SubscribeBlockTracker=zb;var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});(function(t){var e=L&&L.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=L&&L.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(Hr,t),n(Yr,t),n(Kc,t)})(vc);const sa=(t,e,n,r)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,h)=>{l?a(l):o(h)}):i.push(o),Reflect.apply(t,this===n?r:this,i)})},oa=new WeakMap;var Gb=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(!(t!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":n}\``);const r=(o,a)=>{let c=oa.get(o);if(c||(c={},oa.set(o,c)),a in c)return c[a];const l=p=>typeof p=="string"||typeof a=="symbol"?a===p:p.test(a),h=Reflect.getOwnPropertyDescriptor(o,a),u=h===void 0||h.writable||h.configurable,d=(e.include?e.include.some(l):!e.exclude.some(l))&&u;return c[a]=d,d},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const h=e.excludeMain?o:sa(o,e,s,o);return i.set(o,h),Reflect.apply(h,a,c)},get(o,a){const c=o[a];if(!r(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const h=sa(c,e,s,o);return i.set(c,h),h}return c}});return s};const qb=jr.default;let Jb=class extends qb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(n=>this.emit("update",n))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var $s=Jb;const Qb=$s;let Zb=class extends Qb{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var Yb=Zb,Kn={minBlockRef:Kb,maxBlockRef:Xb,sortBlockRefs:Ds,bnToHex:eg,blockRefIsNumber:tg,hexToInt:Cr,incrementHexInt:ng,intToHex:Xc,unsafeRandomBytes:rg};function Kb(...t){return Ds(t)[0]}function Xb(...t){const e=Ds(t);return e[e.length-1]}function Ds(t){return t.sort((e,n)=>e==="latest"||n==="earliest"?1:n==="latest"||e==="earliest"?-1:Cr(e)-Cr(n))}function eg(t){return"0x"+t.toString(16)}function tg(t){return t&&!["earliest","latest","pending"].includes(t)}function Cr(t){return t==null?t:Number.parseInt(t,16)}function ng(t){if(t==null)return t;const e=Cr(t);return Xc(e+1)}function Xc(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function rg(t){let e="0x";for(let n=0;n<t;n++)e+=aa(),e+=aa();return e}function aa(){return Math.floor(Math.random()*16).toString(16)}const ig=Ml,sg=Gb,og=Yb,{bnToHex:V2,hexToInt:dr,incrementHexInt:ag,minBlockRef:cg,blockRefIsNumber:ug}=Kn;let lg=class extends og{constructor({provider:e,params:n}){super(),this.type="log",this.ethQuery=new ig(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},n),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(r=>r.toLowerCase()))}async initialize({currentBlock:e}){let n=this.params.fromBlock;["latest","pending"].includes(n)&&(n=e),n==="earliest"&&(n="0x0"),this.params.fromBlock=n;const r=cg(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:r}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:n}){const r=n;let i;e?i=ag(e):i=n;const s=Object.assign({},this.params,{fromBlock:i,toBlock:r}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await sg(r=>this.ethQuery.getLogs(e,r))()}matchLog(e){if(dr(this.params.fromBlock)>=dr(e.blockNumber)||ug(this.params.toBlock)&&dr(this.params.toBlock)<=dr(e.blockNumber))return!1;const n=e.address&&e.address.toLowerCase();return this.params.address&&n&&!this.params.address.includes(n)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(h=>h.toLowerCase()),a.includes(o))})}};var hg=lg,Ps=fg;async function fg({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=ca(e),s=ca(n)-r+1,o=Array(s).fill().map((c,l)=>r+l).map(dg);return await Promise.all(o.map(c=>bg(t,"eth_getBlockByNumber",[c,!1])))}function ca(t){return t==null?t:Number.parseInt(t,16)}function dg(t){return t==null?t:"0x"+t.toString(16)}function pg(t,e){return new Promise((n,r)=>{t.sendAsync(e,(i,s)=>{i?r(i):s.error?r(s.error):s.result?n(s.result):r(new Error("Result was empty"))})})}async function bg(t,e,n){for(let r=0;r<3;r++)try{return await pg(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}const gg=$s,mg=Ps,{incrementHexInt:vg}=Kn;let yg=class extends gg{constructor({provider:e,params:n}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:n}){const r=n,i=vg(e),o=(await mg({provider:this.provider,fromBlock:i,toBlock:r})).map(a=>a.hash);this.addResults(o)}};var wg=yg;const _g=$s,Sg=Ps,{incrementHexInt:Eg}=Kn;let Cg=class extends _g{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const n=e,r=Eg(e),i=await Sg({provider:this.provider,fromBlock:r,toBlock:n}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ig=Cg;const xg=Tl.Mutex,{createAsyncMiddleware:kg,createScaffoldMiddleware:Rg}=Ja,Mg=hg,Tg=wg,Ag=Ig,{intToHex:eu,hexToInt:Pi}=Kn;var Ng=Og;function Og({blockTracker:t,provider:e}){let n=0,r={};const i=new xg,s=Lg({mutex:i}),o=Rg({eth_newFilter:s(Fi(c)),eth_newBlockFilter:s(Fi(l)),eth_newPendingTransactionFilter:s(Fi(h)),eth_uninstallFilter:s(yr(d)),eth_getFilterChanges:s(yr(u)),eth_getFilterLogs:s(yr(f))}),a=async({oldBlock:m,newBlock:E})=>{if(r.length===0)return;const C=await i.acquire();try{await Promise.all(zt(r).map(async w=>{try{await w.update({oldBlock:m,newBlock:E})}catch(I){console.error(I)}}))}catch(w){console.error(w)}C()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=h,o.uninstallFilter=d,o.getFilterChanges=u,o.getFilterLogs=f,o.destroy=()=>{S()},o;async function c(m){const E=new Mg({provider:e,params:m});return await p(E),E}async function l(){const m=new Tg({provider:e});return await p(m),m}async function h(){const m=new Ag({provider:e});return await p(m),m}async function u(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);return C.getChangesAndClear()}async function f(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);let w=[];return C.type==="log"&&(w=C.getAllResults()),w}async function d(m){const E=Pi(m),w=!!r[E];return w&&await g(E),w}async function p(m){const E=zt(r).length,C=await t.getLatestBlock();await m.initialize({currentBlock:C}),n++,r[n]=m,m.id=n,m.idHex=eu(n);const w=zt(r).length;return v({prevFilterCount:E,newFilterCount:w}),n}async function g(m){const E=zt(r).length;delete r[m];const C=zt(r).length;v({prevFilterCount:E,newFilterCount:C})}async function S(){const m=zt(r).length;r={},v({prevFilterCount:m,newFilterCount:0})}function v({prevFilterCount:m,newFilterCount:E}){if(m===0&&E>0){t.on("sync",a);return}if(m>0&&E===0){t.removeListener("sync",a);return}}}function Fi(t){return yr(async(...e)=>{const n=await t(...e);return eu(n.id)})}function yr(t){return kg(async(e,n)=>{const r=await t.apply(null,e.params);n.result=r})}function Lg({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}function zt(t,e){const n=[];for(let r in t)n.push(t[r]);return n}const jg=jr.default,{createAsyncMiddleware:ua,createScaffoldMiddleware:$g}=Ja,Dg=Ng,{unsafeRandomBytes:Pg,incrementHexInt:Fg}=Kn,Bg=Ps;var Vg=Hg;function Hg({blockTracker:t,provider:e}){const n={},r=Dg({blockTracker:t,provider:e});let i=!1;const s=new jg,o=$g({eth_subscribe:ua(a),eth_unsubscribe:ua(c)});return o.destroy=h,{events:s,middleware:o};async function a(u,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=u.params[0],p=Pg(16);let g;switch(d){case"newHeads":g=S({subId:p});break;case"logs":const m=u.params[1],E=await r.newLogFilter(m);g=v({subId:p,filter:E});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${d}"`)}n[p]=g,f.result=p;return;function S({subId:m}){const E={type:d,destroy:async()=>{t.removeListener("sync",E.update)},update:async({oldBlock:C,newBlock:w})=>{const I=w,B=Fg(C);(await Bg({provider:e,fromBlock:B,toBlock:I})).map(Wg).filter(V=>V!==null).forEach(V=>{l(m,V)})}};return t.on("sync",E.update),E}function v({subId:m,filter:E}){return E.on("update",w=>l(m,w)),{type:d,destroy:async()=>await r.uninstallFilter(E.idHex)}}}async function c(u,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const d=u.params[0],p=n[d];if(!p){f.result=!1;return}delete n[d],await p.destroy(),f.result=!0}function l(u,f){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:u,result:f}})}function h(){s.removeAllListeners();for(const u in n)n[u].destroy(),delete n[u];i=!0}}function Wg(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Vr,"__esModule",{value:!0});Vr.SubscriptionManager=void 0;const Ug=vc,zg=Vg,la=()=>{};class Gg{constructor(e){const n=new Ug.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:i}=zg({blockTracker:n,provider:e});this.events=r,this.subscriptionMiddleware=i}async handleRequest(e){const n={};return await this.subscriptionMiddleware(e,n,la,la),n}destroy(){this.subscriptionMiddleware.destroy()}}Vr.SubscriptionManager=Gg;var Fs=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nn,"__esModule",{value:!0});nn.CoinbaseWalletProvider=void 0;const qg=Fs(jr),Jg=Fs(Or),Bi=bn,Q=Hn,ha=gn,fa=Ge,Vi=Pr,Qg=K,D=x,Hi=Fs(Xh),Zg=sn,J=mc,Yg=Vr,da="DefaultChainId",pa="DefaultJsonRpcUrl";class Kg extends qg.default{constructor(e){var n,r;super(),this._filterPolyfill=new Zg.FilterPolyfill(this),this._subscriptionManager=new Yg.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this.isCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,D.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(fa.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,D.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,h=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(h,Number(l))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,D.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(pa))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(pa,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,n){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=n,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,n){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(da,n.toString(10)),((0,D.ensureIntNumber)(n)!==r||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,n,r,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,n,r,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,n,r,i,s,o){var a,c;if((0,D.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),h=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!h&&await l.requestEthereumAccounts().promise;const u=await l.addEthereumChain(e.toString(),n,s,r,i,o).promise;return((a=u.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(n[0],e),((c=u.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const r=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Qg.isErrorResponse)(r)&&r.errorCode)throw r.errorCode===Q.standardErrorCodes.provider.unsupportedChain?Q.standardErrors.provider.unsupportedChain(e):Q.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});const i=r.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,n){this.initializeRelay().then(r=>r.setAppInfo(e,n))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?ha.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(J.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,n){try{const r=this._send(e,n);if(r instanceof Promise)return r.catch(i=>{throw(0,Q.serializeError)(i,e)})}catch(r){throw(0,Q.serializeError)(r,e)}}_send(e,n){if(typeof e=="string"){const i=e,s=Array.isArray(n)?n:n!==void 0?[n]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof n=="function"){const i=e,s=n;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const r=e;return this._sendRequest(r)}async sendAsync(e,n){try{return this._sendAsync(e,n).catch(r=>{throw(0,Q.serializeError)(r,e)})}catch(r){return Promise.reject((0,Q.serializeError)(r,e))}}async _sendAsync(e,n){if(typeof n!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=n;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const r=n;return this._sendRequestAsync(e).then(i=>r(null,i)).catch(i=>r(i,null))}async request(e){try{return this._request(e).catch(n=>{throw(0,Q.serializeError)(n,e.method)})}catch(n){return Promise.reject((0,Q.serializeError)(n,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Q.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:n,params:r}=e;if(typeof n!="string"||n.length===0)throw Q.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw Q.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=r===void 0?[]:r,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:n,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var n;const i=await(await this.initializeRelay()).scanQRCode((0,D.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.scanQRCode);return i.result}async genericRequest(e,n){var r;const s=await(await this.initializeRelay()).genericRequest(e,n).promise;if(typeof s.result!="string")throw(0,Q.serializeError)((r=s.errorMessage)!==null&&r!==void 0?r:"result was not a string",Vi.Web3Method.generic);return s.result}async selectProvider(e){var n;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const n={jsonrpc:"2.0",id:e.id},{method:r}=e;if(n.result=this._handleSynchronousMethods(e),n.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return n}_setAddresses(e,n){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>(0,D.ensureAddressString)(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!n||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(fa.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(e){return new Promise((n,r)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return n({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>n(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>r(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>n({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>r(a));return}}catch(i){return r(i)}this._handleAsynchronousMethods(e).then(i=>i&&n(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>r(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(n=>this._sendRequestAsync(n)))}_handleSynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_accounts:return this._eth_accounts();case J.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case J.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case J.JSONRPCMethod.net_version:return this._net_version();case J.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case J.JSONRPCMethod.eth_sign:return this._eth_sign(r);case J.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case J.JSONRPCMethod.personal_sign:return this._personal_sign(r);case J.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case J.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case J.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case J.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case J.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case J.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case J.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case J.JSONRPCMethod.eth_signTypedData_v4:case J.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case J.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case J.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case J.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case J.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case J.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case J.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case J.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case J.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case J.JSONRPCMethod.eth_subscribe:case J.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const n=(0,D.ensureAddressString)(e);return this._addresses.map(i=>(0,D.ensureAddressString)(i)).includes(n)}catch{}return!1}_ensureKnownAddress(e){var n;if(!this._isKnownAddress(e))throw(n=this.diagnostic)===null||n===void 0||n.log(Bi.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?(0,D.ensureAddressString)(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?(0,D.ensureAddressString)(e.to):null,i=e.value!=null?(0,D.ensureBN)(e.value):new Jg.default(0),s=e.data?(0,D.ensureBuffer)(e.data):U.alloc(0),o=e.nonce!=null?(0,D.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,D.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,D.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,D.ensureBN)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,D.ensureBN)(e.gas):null,u=this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:u}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Q.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Q.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,n,r,i){this._ensureKnownAddress(n);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,n,r,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,n,r){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,n,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,D.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(da);if(!e)return(0,D.ensureIntNumber)(this._chainIdFromOpts);const n=parseInt(e,10);return(0,D.ensureIntNumber)(n)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?ha.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let n;try{n=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._signEthereumMessage(r,n,!1)}_eth_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!1)}_personal_sign(e){this._requireAuthorization();const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureAddressString)(e[1]);return this._signEthereumMessage(n,r,!0)}_personal_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const n=(0,D.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(n,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const n=(0,D.ensureParsedJSONObject)(e[0]),r=(0,D.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const i=Hi.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _cbwallet_arbitrary(e){const n=e[0],r=e[1];if(typeof r!="string")throw new Error("parameter must be a string");if(typeof n!="object"||n===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(n,r)}}async _wallet_addEthereumChain(e){var n,r,i,s;const o=e[0];if(((n=o.rpcUrls)===null||n===void 0?void 0:n.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw Q.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Q.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(r=o.rpcUrls)!==null&&r!==void 0?r:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const n=e[0];return await this.switchEthereumChain(parseInt(n.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Q.standardErrors.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw Q.standardErrors.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw Q.standardErrors.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw Q.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=n.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(n.type,i,s,a,o,r)}}_eth_uninstallFilter(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(n)}async _eth_newFilter(e){const n=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(n)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(n)}_eth_getFilterLogs(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(n)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((n,r)=>this._setAddresses(n,r)),e.setChainCallback((n,r)=>{this.updateProviderInfo(r,parseInt(n,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}nn.CoinbaseWalletProvider=Kg;var Kr={},Xr={},Xn,j,tu,nu,At,ba,ru,rs,iu,en={},su=[],Xg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ei=Array.isArray;function lt(t,e){for(var n in e)t[n]=e[n];return t}function ou(t){var e=t.parentNode;e&&e.removeChild(t)}function is(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Xn.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return On(t,o,r,i,null)}function On(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++tu};return i==null&&j.vnode!=null&&j.vnode(s),s}function em(){return{current:null}}function er(t){return t.children}function Ln(t,e){this.props=t,this.context=e}function Ir(t,e){if(e==null)return t.__?Ir(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Ir(t):null}function au(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return au(t)}}function ss(t){(!t.__d&&(t.__d=!0)&&At.push(t)&&!xr.__r++||ba!==j.debounceRendering)&&((ba=j.debounceRendering)||ru)(xr)}function xr(){var t,e,n,r,i,s,o,a,c;for(At.sort(rs);t=At.shift();)t.__d&&(e=At.length,r=void 0,i=void 0,s=void 0,a=(o=(n=t).__v).__e,(c=n.__P)&&(r=[],i=[],(s=lt({},o)).__v=o.__v+1,Bs(c,o,s,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,r,a??Ir(o),o.__h,i),fu(r,o,i),o.__e!=a&&au(o)),At.length>e&&At.sort(rs));xr.__r=0}function cu(t,e,n,r,i,s,o,a,c,l,h){var u,f,d,p,g,S,v,m,E,C,w=0,I=r&&r.__k||su,B=I.length,Y=B,A=e.length;for(n.__k=[],u=0;u<A;u++)(p=n.__k[u]=(p=e[u])==null||typeof p=="boolean"||typeof p=="function"?null:typeof p=="string"||typeof p=="number"||typeof p=="bigint"?On(null,p,null,null,p):ei(p)?On(er,{children:p},null,null,null):p.__b>0?On(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null&&(p.__=n,p.__b=n.__b+1,(m=tm(p,I,v=u+w,Y))===-1?d=en:(d=I[m]||en,I[m]=void 0,Y--),Bs(t,p,d,i,s,o,a,c,l,h),g=p.__e,(f=p.ref)&&d.ref!=f&&(d.ref&&Vs(d.ref,null,p),h.push(f,p.__c||g,p)),g!=null&&(S==null&&(S=g),C=!(E=d===en||d.__v===null)&&m===v,E?m==-1&&w--:m!==v&&(m===v+1?(w++,C=!0):m>v?Y>A-v?(w+=m-v,C=!0):w--:w=m<v&&m==v-1?m-v:0),v=u+w,C=C||m==u&&!E,typeof p.type!="function"||m===v&&d.__k!==p.__k?typeof p.type=="function"||C?p.__d!==void 0?(c=p.__d,p.__d=void 0):c=g.nextSibling:c=hu(t,g,c):c=uu(p,c,t),typeof n.type=="function"&&(n.__d=c)));for(n.__e=S,u=B;u--;)I[u]!=null&&(typeof n.type=="function"&&I[u].__e!=null&&I[u].__e==n.__d&&(n.__d=I[u].__e.nextSibling),du(I[u],I[u]))}function uu(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?uu(r,e,n):hu(n,r.__e,e));return e}function lu(t,e){return e=e||[],t==null||typeof t=="boolean"||(ei(t)?t.some(function(n){lu(n,e)}):e.push(t)),e}function hu(t,e,n){return n==null||n.parentNode!==t?t.insertBefore(e,null):e==n&&e.parentNode!=null||t.insertBefore(e,n),e.nextSibling}function tm(t,e,n,r){var i=t.key,s=t.type,o=n-1,a=n+1,c=e[n];if(c===null||c&&i==c.key&&s===c.type)return n;if(r>(c!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((c=e[o])&&i==c.key&&s===c.type)return o;o--}if(a<e.length){if((c=e[a])&&i==c.key&&s===c.type)return a;a++}}return-1}function nm(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||kr(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||kr(t,s,e[s],n[s],r)}function ga(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Xg.test(e)?n:n+"px"}function kr(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ga(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ga(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?va:ma,s):t.removeEventListener(e,s?va:ma,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function ma(t){return this.l[t.type+!1](j.event?j.event(t):t)}function va(t){return this.l[t.type+!0](j.event?j.event(t):t)}function Bs(t,e,n,r,i,s,o,a,c,l){var h,u,f,d,p,g,S,v,m,E,C,w,I,B,Y,A=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(h=j.__b)&&h(e);try{e:if(typeof A=="function"){if(v=e.props,m=(h=A.contextType)&&r[h.__c],E=h?m?m.props.value:h.__:r,n.__c?S=(u=e.__c=n.__c).__=u.__E:("prototype"in A&&A.prototype.render?e.__c=u=new A(v,E):(e.__c=u=new Ln(v,E),u.constructor=A,u.render=im),m&&m.sub(u),u.props=v,u.state||(u.state={}),u.context=E,u.__n=r,f=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),A.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=lt({},u.__s)),lt(u.__s,A.getDerivedStateFromProps(v,u.__s))),d=u.props,p=u.state,u.__v=e,f)A.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(A.getDerivedStateFromProps==null&&v!==d&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(v,E),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(v,u.__s,E)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=v,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(v,u.__s,E),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(d,p,g)})}if(u.context=E,u.props=v,u.__P=t,u.__e=!1,w=j.__r,I=0,"prototype"in A&&A.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(e),h=u.render(u.props,u.state,u.context),B=0;B<u._sb.length;B++)u.__h.push(u._sb[B]);u._sb=[]}else do u.__d=!1,w&&w(e),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++I<25);u.state=u.__s,u.getChildContext!=null&&(r=lt(lt({},r),u.getChildContext())),f||u.getSnapshotBeforeUpdate==null||(g=u.getSnapshotBeforeUpdate(d,p)),cu(t,ei(Y=h!=null&&h.type===er&&h.key==null?h.props.children:h)?Y:[Y],e,n,r,i,s,o,a,c,l),u.base=e.__e,e.__h=null,u.__h.length&&o.push(u),S&&(u.__E=u.__=null)}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=rm(n.__e,e,n,r,i,s,o,c,l);(h=j.diffed)&&h(e)}catch(V){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),j.__e(V,e,n)}}function fu(t,e,n){for(var r=0;r<n.length;r++)Vs(n[r],n[++r],n[++r]);j.__c&&j.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){j.__e(s,i.__v)}})}function rm(t,e,n,r,i,s,o,a,c){var l,h,u,f=n.props,d=e.props,p=e.type,g=0;if(p==="svg"&&(i=!0),s!=null){for(;g<s.length;g++)if((l=s[g])&&"setAttribute"in l==!!p&&(p?l.localName===p:l.nodeType===3)){t=l,s[g]=null;break}}if(t==null){if(p===null)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,d.is&&d),s=null,a=!1}if(p===null)f===d||a&&t.data===d||(t.data=d);else{if(s=s&&Xn.call(t.childNodes),h=(f=n.props||en).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(s!=null)for(f={},g=0;g<t.attributes.length;g++)f[t.attributes[g].name]=t.attributes[g].value;(u||h)&&(u&&(h&&u.__html==h.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(nm(t,d,f,i,a),u)e.__k=[];else if(cu(t,ei(g=e.props.children)?g:[g],e,n,r,i&&p!=="foreignObject",s,o,s?s[0]:n.__k&&Ir(n,0),a,c),s!=null)for(g=s.length;g--;)s[g]!=null&&ou(s[g]);a||("value"in d&&(g=d.value)!==void 0&&(g!==t.value||p==="progress"&&!g||p==="option"&&g!==f.value)&&kr(t,"value",g,f.value,!1),"checked"in d&&(g=d.checked)!==void 0&&g!==t.checked&&kr(t,"checked",g,f.checked,!1))}return t}function Vs(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){j.__e(r,n)}}function du(t,e,n){var r,i;if(j.unmount&&j.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Vs(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){j.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&du(r[i],e,n||typeof t.type!="function");n||t.__e==null||ou(t.__e),t.__=t.__e=t.__d=void 0}function im(t,e,n){return this.constructor(t,n)}function pu(t,e,n){var r,i,s,o;j.__&&j.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],Bs(e,t=(!r&&n||e).__k=is(er,null,[t]),i||en,en,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?Xn.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,o),fu(s,t,o)}function bu(t,e){pu(t,e,bu)}function sm(t,e,n){var r,i,s,o,a=lt({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Xn.call(arguments,2):n),On(t.type,a,r||t.key,i||t.ref,null)}function om(t,e){var n={__c:e="__cC"+iu++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,ss(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Xn=su.slice,j={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},tu=0,nu=function(t){return t!=null&&t.constructor===void 0},Ln.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=lt({},this.state),typeof t=="function"&&(t=t(lt({},n),this.props)),t&&lt(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ss(this))},Ln.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ss(this))},Ln.prototype.render=er,At=[],ru=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rs=function(t,e){return t.__v.__b-e.__v.__b},xr.__r=0,iu=0;const am=Object.freeze(Object.defineProperty({__proto__:null,Component:Ln,Fragment:er,cloneElement:sm,createContext:om,createElement:is,createRef:em,h:is,hydrate:bu,get isValidElement(){return nu},get options(){return j},render:pu,toChildArray:lu},Symbol.toStringTag,{value:"Module"})),Oe=Vn(am);function cn(t){return typeof t=="function"}var ya=!1,je={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}ya=t},get useDeprecatedSynchronousErrorHandling(){return ya}};function Qt(t){setTimeout(function(){throw t},0)}var Rr={closed:!0,next:function(t){},error:function(t){if(je.useDeprecatedSynchronousErrorHandling)throw t;Qt(t)},complete:function(){}},Ce=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Hs(t){return t!==null&&typeof t=="object"}var cm=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
1
+ import{d as El,s as Cl,c as O,b as Or,B as U,a as Il,j as kl,e as Lr,g as Hn,f as Yi,h as Ja,p as xl,i as Rl,l as Ml,k as Qa,_ as b,r as jr,m as Tl}from"./index-0d31b363.js";function Al(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var bs={},$n={},$r={};Object.defineProperty($r,"__esModule",{value:!0});$r.walletLogo=void 0;const Nl=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};$r.walletLogo=Nl;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ScopedLocalStorage=void 0;class Ol{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}Dr.ScopedLocalStorage=Ol;var nn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.EVENTS=void 0;bn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Wn={},Y={},Pr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Pr);Object.defineProperty(Y,"__esModule",{value:!0});Y.EthereumAddressFromSignedMessageResponse=Y.SubmitEthereumTransactionResponse=Y.SignEthereumTransactionResponse=Y.SignEthereumMessageResponse=Y.isRequestEthereumAccountsResponse=Y.SelectProviderResponse=Y.WatchAssetReponse=Y.RequestEthereumAccountsResponse=Y.SwitchEthereumChainResponse=Y.AddEthereumChainResponse=Y.isErrorResponse=void 0;const ot=Pr;function Ll(t){var e,n;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((n=t)===null||n===void 0?void 0:n.errorMessage)!==void 0}Y.isErrorResponse=Ll;function jl(t){return{method:ot.Web3Method.addEthereumChain,result:t}}Y.AddEthereumChainResponse=jl;function $l(t){return{method:ot.Web3Method.switchEthereumChain,result:t}}Y.SwitchEthereumChainResponse=$l;function Dl(t){return{method:ot.Web3Method.requestEthereumAccounts,result:t}}Y.RequestEthereumAccountsResponse=Dl;function Pl(t){return{method:ot.Web3Method.watchAsset,result:t}}Y.WatchAssetReponse=Pl;function Fl(t){return{method:ot.Web3Method.selectProvider,result:t}}Y.SelectProviderResponse=Fl;function Bl(t){return t&&t.method===ot.Web3Method.requestEthereumAccounts}Y.isRequestEthereumAccountsResponse=Bl;function Vl(t){return{method:ot.Web3Method.signEthereumMessage,result:t}}Y.SignEthereumMessageResponse=Vl;function Hl(t){return{method:ot.Web3Method.signEthereumTransaction,result:t}}Y.SignEthereumTransactionResponse=Hl;function Wl(t){return{method:ot.Web3Method.submitEthereumTransaction,result:t}}Y.SubmitEthereumTransactionResponse=Wl;function Ul(t){return{method:ot.Web3Method.ethereumAddressFromSignedMessage,result:t}}Y.EthereumAddressFromSignedMessageResponse=Ul;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.LIB_VERSION=void 0;Un.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=El,n=Y,r=Un;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(h){return h!==void 0?(0,e.getMessageFromCode)(h):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(h="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${h}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(h,u){const d=(0,e.serializeError)(o(h),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",r.LIB_VERSION),f.searchParams.set("code",d.code.toString());const p=a(d.data,u);return p&&f.searchParams.set("method",p),f.searchParams.set("message",d.message),Object.assign(Object.assign({},d),{docUrl:f.href})}t.serializeError=s;function o(h){return typeof h=="string"?{message:h,code:t.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(h)?Object.assign(Object.assign({},h),{message:h.errorMessage,code:h.errorCode,data:{method:h.method,result:h.result}}):h}function a(h,u){var d;const f=(d=h)===null||d===void 0?void 0:d.method;if(f)return f;if(u!==void 0)return typeof u=="string"?u:Array.isArray(u)?u.length>0?u[0].method:void 0:u.method}function c(h){var u;if(typeof h=="number")return h;if(l(h))return(u=h.code)!==null&&u!==void 0?u:h.errorCode}t.getErrorCode=c;function l(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}})(Wn);var gn={},I={},zl=String.prototype.replace,ql=/%20/g,Ii={RFC1738:"RFC1738",RFC3986:"RFC3986"},gs={default:Ii.RFC3986,formatters:{RFC1738:function(t){return zl.call(t,ql,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ii.RFC1738,RFC3986:Ii.RFC3986},Gl=gs,ki=Object.prototype.hasOwnProperty,xt=Array.isArray,Qe=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Jl=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(xt(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},Za=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},Ql=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(xt(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!ki.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return xt(e)&&!xt(n)&&(i=Za(e,r)),xt(e)&&xt(n)?(n.forEach(function(s,o){if(ki.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return ki.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},Zl=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Yl=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Kl=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var l=o.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Gl.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+Qe[l];continue}if(l<2048){a=a+(Qe[192|l>>6]+Qe[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Qe[224|l>>12]+Qe[128|l>>6&63]+Qe[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=Qe[240|l>>18]+Qe[128|l>>12&63]+Qe[128|l>>6&63]+Qe[128|l&63]}return a},Xl=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var l=a[c],h=o[l];typeof h=="object"&&h!==null&&r.indexOf(h)===-1&&(n.push({obj:o,prop:l}),r.push(h))}return Jl(n),e},eh=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},th=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},nh=function(e,n){return[].concat(e,n)},rh=function(e,n){if(xt(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Ya={arrayToObject:Za,assign:Zl,combine:nh,compact:Xl,decode:Yl,encode:Kl,isBuffer:th,isRegExp:eh,maybeMap:rh,merge:Ql},Ka=Cl,yr=Ya,Tn=gs,ih=Object.prototype.hasOwnProperty,fo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},ct=Array.isArray,sh=Array.prototype.push,Xa=function(t,e){sh.apply(t,ct(e)?e:[e])},oh=Date.prototype.toISOString,po=Tn.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yr.encode,encodeValuesOnly:!1,format:po,formatter:Tn.formatters[po],indices:!1,serializeDate:function(e){return oh.call(e)},skipNulls:!1,strictNullHandling:!1},ah=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},xi={},ch=function t(e,n,r,i,s,o,a,c,l,h,u,d,f,p,g,S){for(var v=e,m=S,E=0,C=!1;(m=m.get(xi))!==void 0&&!C;){var y=m.get(e);if(E+=1,typeof y<"u"){if(y===E)throw new RangeError("Cyclic object value");C=!0}typeof m.get(xi)>"u"&&(E=0)}if(typeof c=="function"?v=c(n,v):v instanceof Date?v=u(v):r==="comma"&&ct(v)&&(v=yr.maybeMap(v,function(k){return k instanceof Date?u(k):k})),v===null){if(s)return a&&!p?a(n,_e.encoder,g,"key",d):n;v=""}if(ah(v)||yr.isBuffer(v)){if(a){var T=p?n:a(n,_e.encoder,g,"key",d);return[f(T)+"="+f(a(v,_e.encoder,g,"value",d))]}return[f(n)+"="+f(String(v))]}var F=[];if(typeof v>"u")return F;var K;if(r==="comma"&&ct(v))p&&a&&(v=yr.maybeMap(v,a)),K=[{value:v.length>0?v.join(",")||null:void 0}];else if(ct(c))K=c;else{var L=Object.keys(v);K=l?L.sort(l):L}for(var V=i&&ct(v)&&v.length===1?n+"[]":n,fe=0;fe<K.length;++fe){var q=K[fe],_=typeof q=="object"&&typeof q.value<"u"?q.value:v[q];if(!(o&&_===null)){var w=ct(v)?typeof r=="function"?r(V,q):V:V+(h?"."+q:"["+q+"]");S.set(e,E);var M=Ka();M.set(xi,S),Xa(F,t(_,w,r,i,s,o,r==="comma"&&p&&ct(v)?null:a,c,l,h,u,d,f,p,g,M))}}return F},uh=function(e){if(!e)return _e;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||_e.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Tn.default;if(typeof e.format<"u"){if(!ih.call(Tn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Tn.formatters[r],s=_e.filter;return(typeof e.filter=="function"||ct(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_e.addQueryPrefix,allowDots:typeof e.allowDots>"u"?_e.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_e.charsetSentinel,delimiter:typeof e.delimiter>"u"?_e.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_e.encode,encoder:typeof e.encoder=="function"?e.encoder:_e.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_e.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_e.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_e.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_e.strictNullHandling}},lh=function(t,e){var n=t,r=uh(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):ct(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in fo?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=fo[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var h=Ka(),u=0;u<i.length;++u){var d=i[u];r.skipNulls&&n[d]===null||Xa(o,ch(n[d],d,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,h))}var f=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},rn=Ya,Ki=Object.prototype.hasOwnProperty,hh=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:rn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fh=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ec=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},dh="utf8=%26%2310003%3B",ph="utf8=%E2%9C%93",bh=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ph?l="utf-8":o[c]===dh&&(l="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var h=o[c],u=h.indexOf("]="),d=u===-1?h.indexOf("="):u+1,f,p;d===-1?(f=n.decoder(h,de.decoder,l,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(h.slice(0,d),de.decoder,l,"key"),p=rn.maybeMap(ec(h.slice(d+1),n),function(g){return n.decoder(g,de.decoder,l,"value")})),p&&n.interpretNumericEntities&&l==="iso-8859-1"&&(p=fh(p)),h.indexOf("[]=")>-1&&(p=hh(p)?[p]:p),Ki.call(r,f)?r[f]=rn.combine(r[f],p):r[f]=p}return r},gh=function(t,e,n,r){for(var i=r?e:ec(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},mh=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,h=[];if(l){if(!r.plainObjects&&Ki.call(Object.prototype,l)&&!r.allowPrototypes)return;h.push(l)}for(var u=0;r.depth>0&&(c=a.exec(s))!==null&&u<r.depth;){if(u+=1,!r.plainObjects&&Ki.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(c[1])}return c&&h.push("["+s.slice(c.index)+"]"),gh(h,n,r,i)}},vh=function(e){if(!e)return de;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?de.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?de.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:de.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:de.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:de.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:de.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:de.comma,decoder:typeof e.decoder=="function"?e.decoder:de.decoder,delimiter:typeof e.delimiter=="string"||rn.isRegExp(e.delimiter)?e.delimiter:de.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:de.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:de.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:de.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:de.strictNullHandling}},yh=function(t,e){var n=vh(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?bh(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=mh(a,r[a],n,typeof t=="string");i=rn.merge(i,c,n)}return n.allowSparse===!0?i:rn.compact(i)},wh=lh,_h=yh,Sh=gs,Eh={formats:Sh,parse:_h,stringify:wh},zn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(zn);var Ch=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(I,"__esModule",{value:!0});I.isInIFrame=I.createQrUrl=I.getFavicon=I.range=I.isBigNumber=I.ensureParsedJSONObject=I.ensureBN=I.ensureRegExpString=I.ensureIntNumber=I.ensureBuffer=I.ensureAddressString=I.ensureEvenLengthHexString=I.ensureHexString=I.isHexString=I.prepend0x=I.strip0x=I.has0xPrefix=I.hexStringFromIntNumber=I.intNumberFromHexString=I.bigIntStringFromBN=I.hexStringFromBuffer=I.hexStringToUint8Array=I.uint8ArrayToHex=I.randomBytesHex=void 0;const vt=Ch(Or),Ih=Eh,Pt=Wn,Pe=zn,tc=/^[0-9]*$/,nc=/^[a-f0-9]*$/;function kh(t){return rc(crypto.getRandomValues(new Uint8Array(t)))}I.randomBytesHex=kh;function rc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}I.uint8ArrayToHex=rc;function xh(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}I.hexStringToUint8Array=xh;function Rh(t,e=!1){const n=t.toString("hex");return(0,Pe.HexString)(e?"0x"+n:n)}I.hexStringFromBuffer=Rh;function Mh(t){return(0,Pe.BigIntString)(t.toString(10))}I.bigIntStringFromBN=Mh;function Th(t){return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}I.intNumberFromHexString=Th;function Ah(t){return(0,Pe.HexString)("0x"+new vt.default(t).toString(16))}I.hexStringFromIntNumber=Ah;function ms(t){return t.startsWith("0x")||t.startsWith("0X")}I.has0xPrefix=ms;function Fr(t){return ms(t)?t.slice(2):t}I.strip0x=Fr;function ic(t){return ms(t)?"0x"+t.slice(2):"0x"+t}I.prepend0x=ic;function qn(t){if(typeof t!="string")return!1;const e=Fr(t).toLowerCase();return nc.test(e)}I.isHexString=qn;function sc(t,e=!1){if(typeof t=="string"){const n=Fr(t).toLowerCase();if(nc.test(n))return(0,Pe.HexString)(e?"0x"+n:n)}throw Pt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}I.ensureHexString=sc;function Gn(t,e=!1){let n=sc(t,!1);return n.length%2===1&&(n=(0,Pe.HexString)("0"+n)),e?(0,Pe.HexString)("0x"+n):n}I.ensureEvenLengthHexString=Gn;function Nh(t){if(typeof t=="string"){const e=Fr(t).toLowerCase();if(qn(e)&&e.length===40)return(0,Pe.AddressString)(ic(e))}throw Pt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}I.ensureAddressString=Nh;function Oh(t){if(U.isBuffer(t))return t;if(typeof t=="string")if(qn(t)){const e=Gn(t,!1);return U.from(e,"hex")}else return U.from(t,"utf8");throw Pt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}I.ensureBuffer=Oh;function oc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Pe.IntNumber)(t);if(typeof t=="string"){if(tc.test(t))return(0,Pe.IntNumber)(Number(t));if(qn(t))return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureIntNumber=oc;function Lh(t){if(t instanceof RegExp)return(0,Pe.RegExpString)(t.toString());throw Pt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}I.ensureRegExpString=Lh;function jh(t){if(t!==null&&(vt.default.isBN(t)||ac(t)))return new vt.default(t.toString(10),10);if(typeof t=="number")return new vt.default(oc(t));if(typeof t=="string"){if(tc.test(t))return new vt.default(t,10);if(qn(t))return new vt.default(Gn(t,!1),16)}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureBN=jh;function $h(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Pt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}I.ensureParsedJSONObject=$h;function ac(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}I.isBigNumber=ac;function Dh(t,e){return Array.from({length:e-t},(n,r)=>t+r)}I.range=Dh;function Ph(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}I.getFavicon=Ph;function Fh(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,Ih.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}I.createQrUrl=Fh;function Bh(){try{return window.frameElement!==null}catch{return!1}}I.isInIFrame=Bh;Object.defineProperty(gn,"__esModule",{value:!0});gn.Session=void 0;const bo=Il,go=I,mo="session:id",vo="session:secret",yo="session:linked";class vs{constructor(e,n,r,i){this._storage=e,this._id=n||(0,go.randomBytesHex)(16),this._secret=r||(0,go.randomBytesHex)(32),this._key=new bo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(mo),r=e.getItem(yo),i=e.getItem(vo);return n&&i?new vs(e,n,i,r==="1"):null}static hash(e){return new bo.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(mo,this._id),this._storage.setItem(vo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(yo,this._linked?"1":"0")}}gn.Session=vs;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.WalletSDKRelayAbstract=qe.APP_VERSION_KEY=qe.LOCAL_STORAGE_ADDRESSES_KEY=qe.WALLET_USER_NAME_KEY=void 0;const wo=Wn;qe.WALLET_USER_NAME_KEY="walletUsername";qe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";qe.APP_VERSION_KEY="AppVersion";class Vh{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw wo.standardErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,wo.serializeError)(s,e.method);return i})}}qe.WalletSDKRelayAbstract=Vh;const Hh=kl,Wh=Or;function cc(t){return U.allocUnsafe(t).fill(0)}function uc(t,e,n){const r=cc(e);return t=Br(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Uh(t,e){return uc(t,e,!0)}function Br(t){if(!U.isBuffer(t))if(Array.isArray(t))t=U.from(t);else if(typeof t=="string")lc(t)?t=U.from(Gh(hc(t)),"hex"):t=U.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=U.allocUnsafe(0);else if(Wh.isBN(t))t=t.toArrayLike(U);else if(t.toArray)t=U.from(t.toArray());else throw new Error("invalid type");return t}function zh(t){return t=Br(t),"0x"+t.toString("hex")}function qh(t,e){return t=Br(t),e||(e=256),Hh("keccak"+e).update(t).digest()}function Gh(t){return t.length%2?"0"+t:t}function lc(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function hc(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var fc={zeros:cc,setLength:uc,setLengthRight:Uh,isHexString:lc,stripHexPrefix:hc,toBuffer:Br,bufferToHex:zh,keccak:qh};const Lt=fc,Nt=Or;function dc(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Yt(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function _o(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function pc(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Rt(t){var e=typeof t;if(e==="string")return Lt.isHexString(t)?new Nt(Lt.stripHexPrefix(t),16):new Nt(t,10);if(e==="number")return new Nt(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Xe(t,e){var n,r,i,s;if(t==="address")return Xe("uint160",Rt(e));if(t==="bool")return Xe("uint8",e?1:0);if(t==="string")return Xe("bytes",new U(e,"utf8"));if(Qh(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=pc(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Xe(t,e[s]));if(n==="dynamic"){var o=Xe("uint256",e.length);i.unshift(o)}return U.concat(i)}else{if(t==="bytes")return e=new U(e),i=U.concat([Xe("uint256",e.length),e]),e.length%32!==0&&(i=U.concat([i,Lt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=Yt(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return Lt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(U,"be",32)}else if(t.startsWith("int")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(U,"be",32)}else if(t.startsWith("ufixed")){if(n=_o(t),r=Rt(e),r<0)throw new Error("Supplied ufixed is negative");return Xe("uint256",r.mul(new Nt(2).pow(new Nt(n[1]))))}else if(t.startsWith("fixed"))return n=_o(t),Xe("int256",Rt(e).mul(new Nt(2).pow(new Nt(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Jh(t){return t==="string"||t==="bytes"||pc(t)==="dynamic"}function Qh(t){return t.lastIndexOf("]")===t.length-1}function Zh(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=dc(t[s]),a=e[s],c=Xe(o,a);Jh(o)?(n.push(Xe("uint256",i)),r.push(c),i+=c.length):n.push(c)}return U.concat(n.concat(r))}function bc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=dc(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new U(a,"utf8"));else if(o==="bool")i.push(new U(a?"01":"00","hex"));else if(o==="address")i.push(Lt.setLength(a,20));else if(o.startsWith("bytes")){if(n=Yt(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(Lt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(U,"be",n/8))}else if(o.startsWith("int")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(U,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return U.concat(i)}function Yh(t,e){return Lt.keccak(bc(t,e))}var Kh={rawEncode:Zh,solidityPack:bc,soliditySHA3:Yh};const We=fc,An=Kh,gc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Ri={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,l)=>{if(n[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":We.keccak(this.encodeData(c,l,n,r))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",We.keccak(l)];if(c==="string")return typeof l=="string"&&(l=U.from(l,"utf8")),["bytes32",We.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),u=l.map(d=>o(a,h,d));return["bytes32",We.keccak(An.rawEncode(u.map(([d])=>d),u.map(([,d])=>d)))]}return[c,l]};for(const a of n[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=We.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=U.from(a,"utf8")),a=We.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=We.keccak(this.encodeData(o.type,a,n,r)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return An.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return We.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return We.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in gc.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[U.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),We.keccak(U.concat(r))}};var Xh={TYPED_MESSAGE_SCHEMA:gc,TypedDataUtils:Ri,hashForSignTypedDataLegacy:function(t){return ef(t.data)},hashForSignTypedData_v3:function(t){return Ri.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ri.hash(t.data)}};function ef(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?We.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return An.soliditySHA3(["bytes32","bytes32"],[An.soliditySHA3(new Array(t.length).fill("string"),i),An.soliditySHA3(r,n)])}var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.filterFromParam=sn.FilterPolyfill=void 0;const Jt=zn,Se=I,tf=5*60*1e3,Mt={jsonrpc:"2.0",id:0};class nf{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Jt.IntNumber)(1),this.provider=e}async newFilter(e){const n=mc(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,Se.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,Se.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,Se.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(cr())}async getFilterLogs(e){const n=(0,Se.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(r)]})):cr()}makeFilterId(){return(0,Jt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return ur();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Se.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const l=(0,Jt.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return cr();const r=await this.getCurrentBlockHeight();if(n>r)return ur();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,Se.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,Jt.IntNumber)(o))))).filter(o=>!!o),s=(0,Jt.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Mt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(ur())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},tf);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_blockNumber",params:[]}));return(0,Se.intNumberFromHexString)((0,Se.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getBlockByNumber",params:[(0,Se.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,Se.ensureHexString)(n.result.hash):null}}sn.FilterPolyfill=nf;function mc(t){return{fromBlock:Eo(t.fromBlock),toBlock:Eo(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}sn.filterFromParam=mc;function So(t){const e={fromBlock:Co(t.fromBlock),toBlock:Co(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Eo(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Jt.IntNumber)(0);if((0,Se.isHexString)(t))return(0,Se.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Co(t){return t==="latest"?t:(0,Se.hexStringFromIntNumber)(t)}function cr(){return Object.assign(Object.assign({},Mt),{error:{code:-32e3,message:"filter not found"}})}function ur(){return Object.assign(Object.assign({},Mt),{result:[]})}var vc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(vc);var Vr={},yc={},Hr={},Jn={},rf=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.BaseBlockTracker=void 0;const sf=rf(Lr),of=1e3,af=(t,e)=>t+e,Io=["sync","latest"];class cf extends sf.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*of,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Io.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Io.map(e=>this.listenerCount(e)).reduce(af)}_newPotentialLatest(e){const n=this._currentBlock;n&&ko(e)<=ko(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Jn.BaseBlockTracker=cf;function ko(t){return Number.parseInt(t,16)}var wc={},_c={},ye={};class Sc extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function uf(t){return Fe(t)&&typeof t[Symbol.iterator]=="function"}function Fe(t){return typeof t=="object"&&t!=null}function xo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function he(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function lf(t){const{done:e,value:n}=t.next();return e?void 0:n}function hf(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${he(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Xi(t,e,n,r){uf(t)||(t=[t]);for(const i of t){const s=hf(i,e,n,r);s&&(yield s)}}function*ys(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Fe(e.schema)&&Fe(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,h,u]of e.entries(t,a)){const d=ys(h,u,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,h],coerce:s,mask:o,message:n.message});for(const f of d)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):s&&(h=f[1],l===void 0?t=h:t instanceof Map?t.set(l,h):t instanceof Set?t.add(h):Fe(t)&&(h!==void 0||l in t)&&(t[l]=h))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ae{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const h=i(c,l);return Xi(h,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const h=s(c,l);return Xi(h,l,this,c)}:this.refiner=()=>[]}assert(e,n){return Ec(e,this,n)}create(e,n){return Cc(e,this,n)}is(e){return ws(e,this)}mask(e,n){return Ic(e,this,n)}validate(e,n={}){return mn(e,this,n)}}function Ec(t,e,n){const r=mn(t,e,{message:n});if(r[0])throw r[0]}function Cc(t,e,n){const r=mn(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Ic(t,e,n){const r=mn(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ws(t,e){return!mn(t,e)[0]}function mn(t,e,n={}){const r=ys(t,e,n),i=lf(r);return i[0]?[new Sc(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function ff(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?Ss(r):Qn(r)}function Re(t,e){return new ae({type:t,schema:null,validator:e})}function df(t,e){return new ae({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function pf(t){return new ae({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function bf(t){let e;return new ae({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function gf(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return Ss(r);default:return Qn(r)}}function mf(t){const e=t instanceof ae?{...t.schema}:{...t};for(const n in e)e[n]=kc(e[n]);return Qn(e)}function vf(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return Qn(r)}function yf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Re(t,e)}function wf(){return Re("any",()=>!0)}function _f(t){return new ae({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${he(e)}`}})}function Sf(){return Re("bigint",t=>typeof t=="bigint")}function Ef(){return Re("boolean",t=>typeof t=="boolean")}function Cf(){return Re("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${he(t)}`)}function If(t){const e={},n=t.map(r=>he(r)).join();for(const r of t)e[r]=r;return new ae({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${he(r)}`}})}function kf(){return Re("func",t=>typeof t=="function"||`Expected a function, but received: ${he(t)}`)}function xf(t){return Re("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${he(e)}`)}function Rf(){return Re("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${he(t)}`)}function Mf(t){return new ae({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function Tf(t){const e=he(t),n=typeof t;return new ae({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${he(r)}`}})}function Af(t,e){return new ae({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${he(n)}`}})}function _s(){return Re("never",()=>!1)}function Nf(t){return new ae({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Of(){return Re("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${he(t)}`)}function Qn(t){const e=t?Object.keys(t):[],n=_s();return new ae({type:"object",schema:t||null,*entries(r){if(t&&Fe(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Fe(r)||`Expected an object, but received: ${he(r)}`},coercer(r){return Fe(r)?{...r}:r}})}function kc(t){return new ae({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Lf(t,e){return new ae({type:"record",schema:null,*entries(n){if(Fe(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`}})}function jf(){return Re("regexp",t=>t instanceof RegExp)}function $f(t){return new ae({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${he(e)}`}})}function xc(){return Re("string",t=>typeof t=="string"||`Expected a string, but received: ${he(t)}`)}function Df(t){const e=_s();return new ae({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${he(n)}`}})}function Ss(t){const e=Object.keys(t);return new ae({type:"type",schema:t,*entries(n){if(Fe(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`},coercer(n){return Fe(n)?{...n}:n}})}function Pf(t){const e=t.map(n=>n.type).join(" | ");return new ae({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ys(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${he(n)}`,...i]}})}function Rc(){return Re("unknown",()=>!0)}function Es(t,e,n){return new ae({...t,coercer:(r,i)=>ws(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function Ff(t,e,n={}){return Es(t,Rc(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&xo(r)&&xo(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function Bf(t){return Es(t,xc(),e=>e.trim())}function Vf(t){return Ft(t,"empty",e=>{const n=Mc(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Mc(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Hf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Wf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Uf(t){return Ft(t,"nonempty",e=>Mc(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function zf(t,e){return Ft(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function qf(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Ft(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Ft(t,e,n){return new ae({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=Xi(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const Gf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ae,StructError:Sc,any:wf,array:_f,assert:Ec,assign:ff,bigint:Sf,boolean:Ef,coerce:Es,create:Cc,date:Cf,defaulted:Ff,define:Re,deprecated:df,dynamic:pf,empty:Vf,enums:If,func:kf,instance:xf,integer:Rf,intersection:Mf,is:ws,lazy:bf,literal:Tf,map:Af,mask:Ic,max:Hf,min:Wf,never:_s,nonempty:Uf,nullable:Nf,number:Of,object:Qn,omit:gf,optional:kc,partial:mf,pattern:zf,pick:vf,record:Lf,refine:Ft,regexp:jf,set:$f,size:qf,string:xc,struct:yf,trimmed:Bf,tuple:Df,type:Ss,union:Pf,unknown:Rc,validate:mn},Symbol.toStringTag,{value:"Module"})),Bt=Hn(Gf);Object.defineProperty(ye,"__esModule",{value:!0});ye.assertExhaustive=ye.assertStruct=ye.assert=ye.AssertionError=void 0;const Jf=Bt;function Qf(t){return typeof t=="object"&&t!==null&&"message"in t}function Zf(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function Yf(t){const e=Qf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Tc(t,e){return Zf(t)?new t({message:e}):t({message:e})}class Cs extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ye.AssertionError=Cs;function Kf(t,e="Assertion failed.",n=Cs){if(!t)throw e instanceof Error?e:Tc(n,e)}ye.assert=Kf;function Xf(t,e,n="Assertion failed",r=Cs){try{(0,Jf.assert)(t,e)}catch(i){throw Tc(r,`${n}: ${Yf(i)}.`)}}ye.assertStruct=Xf;function ed(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ye.assertExhaustive=ed;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.base64=void 0;const td=Bt,nd=ye,rd=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,nd.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,td.pattern)(t,a)};Zn.base64=rd;var W={},Yn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Bt,n=ye;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=r;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,n.assert)(r(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,n.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(Yn);Object.defineProperty(W,"__esModule",{value:!0});W.createDataView=W.concatBytes=W.valueToBytes=W.stringToBytes=W.numberToBytes=W.signedBigIntToBytes=W.bigIntToBytes=W.hexToBytes=W.bytesToString=W.bytesToNumber=W.bytesToSignedBigInt=W.bytesToBigInt=W.bytesToHex=W.assertIsBytes=W.isBytes=void 0;const Ae=ye,es=Yn,Ro=48,Mo=58,To=87;function id(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const sd=id();function Is(t){return t instanceof Uint8Array}W.isBytes=Is;function vn(t){(0,Ae.assert)(Is(t),"Value must be a Uint8Array.")}W.assertIsBytes=vn;function Ac(t){if(vn(t),t.length===0)return"0x";const e=sd(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,es.add0x)(n.join(""))}W.bytesToHex=Ac;function Nc(t){vn(t);const e=Ac(t);return BigInt(e)}W.bytesToBigInt=Nc;function od(t){vn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}W.bytesToSignedBigInt=od;function ad(t){vn(t);const e=Nc(t);return(0,Ae.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}W.bytesToNumber=ad;function cd(t){return vn(t),new TextDecoder().decode(t)}W.bytesToString=cd;function Wr(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,es.assertIsHexString)(t);const n=(0,es.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Mo?Ro:To),l=a-(a<Mo?Ro:To);i[s]=c*16+l}return i}W.hexToBytes=Wr;function Oc(t){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Wr(e)}W.bigIntToBytes=Oc;function ud(t,e){(0,Ae.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ld(t,e){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(typeof e=="number","Byte length must be a number."),(0,Ae.assert)(e>0,"Byte length must be greater than 0."),(0,Ae.assert)(ud(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}W.signedBigIntToBytes=ld;function Lc(t){(0,Ae.assert)(typeof t=="number","Value must be a number."),(0,Ae.assert)(t>=0,"Value must be a non-negative number."),(0,Ae.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Wr(e)}W.numberToBytes=Lc;function jc(t){return(0,Ae.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}W.stringToBytes=jc;function $c(t){if(typeof t=="bigint")return Oc(t);if(typeof t=="number")return Lc(t);if(typeof t=="string")return t.startsWith("0x")?Wr(t):jc(t);if(Is(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}W.valueToBytes=$c;function hd(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=$c(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}W.concatBytes=hd;function fd(t){if(typeof U<"u"&&t instanceof U){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}W.createDataView=fd;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ChecksumStruct=void 0;const Ao=Bt,dd=Zn;Ur.ChecksumStruct=(0,Ao.size)((0,dd.base64)((0,Ao.string)(),{paddingRequired:!0}),44,44);var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.createHex=nt.createBytes=nt.createBigInt=nt.createNumber=void 0;const ne=Bt,pd=ye,Dc=W,zr=Yn,Pc=(0,ne.union)([(0,ne.number)(),(0,ne.bigint)(),(0,ne.string)(),zr.StrictHexStruct]),bd=(0,ne.coerce)((0,ne.number)(),Pc,Number),gd=(0,ne.coerce)((0,ne.bigint)(),Pc,BigInt);(0,ne.union)([zr.StrictHexStruct,(0,ne.instance)(Uint8Array)]);const md=(0,ne.coerce)((0,ne.instance)(Uint8Array),(0,ne.union)([zr.StrictHexStruct]),Dc.hexToBytes),vd=(0,ne.coerce)(zr.StrictHexStruct,(0,ne.instance)(Uint8Array),Dc.bytesToHex);function yd(t){try{const e=(0,ne.create)(t,bd);return(0,pd.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}nt.createNumber=yd;function wd(t){try{return(0,ne.create)(t,gd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}nt.createBigInt=wd;function _d(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ne.create)(t,md)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createBytes=_d;function Sd(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ne.create)(t,vd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createHex=Sd;var on={},Fc=O&&O.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Ee=O&&O.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ve,Ze;Object.defineProperty(on,"__esModule",{value:!0});on.FrozenSet=on.FrozenMap=void 0;class ks{constructor(e){Ve.set(this,void 0),Fc(this,Ve,new Map(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ve,"f").size}[(Ve=new WeakMap,Symbol.iterator)](){return Ee(this,Ve,"f")[Symbol.iterator]()}entries(){return Ee(this,Ve,"f").entries()}forEach(e,n){return Ee(this,Ve,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Ee(this,Ve,"f").get(e)}has(e){return Ee(this,Ve,"f").has(e)}keys(){return Ee(this,Ve,"f").keys()}values(){return Ee(this,Ve,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}on.FrozenMap=ks;class xs{constructor(e){Ze.set(this,void 0),Fc(this,Ze,new Set(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ze,"f").size}[(Ze=new WeakMap,Symbol.iterator)](){return Ee(this,Ze,"f")[Symbol.iterator]()}entries(){return Ee(this,Ze,"f").entries()}forEach(e,n){return Ee(this,Ze,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Ee(this,Ze,"f").has(e)}keys(){return Ee(this,Ze,"f").keys()}values(){return Ee(this,Ze,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}on.FrozenSet=xs;Object.freeze(ks);Object.freeze(ks.prototype);Object.freeze(xs);Object.freeze(xs.prototype);var Bc={},Rs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function n(l){return l==null}t.isNullOrUndefined=n;function r(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=r;const i=(l,h)=>Object.hasOwnProperty.call(l,h);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let h=l;for(;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(l)===h}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var h;return l.split("").reduce((d,f)=>o(f)?d+1:d+2,0)+((h=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&h!==void 0?h:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(Rs);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Bt,n=ye,r=Rs;t.JsonStruct=(0,e.define)("Json",y=>{const[T]=C(y,!0);return T?!0:"Expected a valid JSON-serializable value"});function i(y){return(0,e.is)(y,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(y){return(0,e.is)(y,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(y,T){(0,n.assertStruct)(y,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}t.assertIsJsonRpcNotification=o;function a(y){return(0,e.is)(y,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(y,T){(0,n.assertStruct)(y,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(y){return(0,e.is)(y,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function h(y,T){(0,n.assertStruct)(y,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}t.assertIsPendingJsonRpcResponse=h;function u(y){return(0,e.is)(y,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=u;function d(y,T){(0,n.assertStruct)(y,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}t.assertIsJsonRpcResponse=d;function f(y){return(0,e.is)(y,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=f;function p(y,T){(0,n.assertStruct)(y,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}t.assertIsJsonRpcSuccess=p;function g(y){return(0,e.is)(y,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=g;function S(y,T){(0,n.assertStruct)(y,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}t.assertIsJsonRpcFailure=S;function v(y){return(0,e.is)(y,t.JsonRpcErrorStruct)}t.isJsonRpcError=v;function m(y,T){(0,n.assertStruct)(y,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}t.assertIsJsonRpcError=m;function E(y){const{permitEmptyString:T,permitFractions:F,permitNull:K}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},y);return V=>!!(typeof V=="number"&&(F||Number.isInteger(V))||typeof V=="string"&&(T||V.length>0)||K&&V===null)}t.getJsonRpcIdValidator=E;function C(y,T=!1){const F=new Set;function K(L,V){if(L===void 0)return[!1,0];if(L===null)return[!0,V?0:r.JsonSize.Null];const fe=typeof L;try{if(fe==="function")return[!1,0];if(fe==="string"||L instanceof String)return[!0,V?0:(0,r.calculateStringSize)(L)+r.JsonSize.Quote*2];if(fe==="boolean"||L instanceof Boolean)return V?[!0,0]:[!0,L==!0?r.JsonSize.True:r.JsonSize.False];if(fe==="number"||L instanceof Number)return V?[!0,0]:[!0,(0,r.calculateNumberSize)(L)];if(L instanceof Date)return V?[!0,0]:[!0,isNaN(L.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(L)&&!Array.isArray(L))return[!1,0];if(F.has(L))return[!1,0];F.add(L);try{return[!0,Object.entries(L).reduce((q,[_,w],M,k)=>{let[A,x]=K(w,V);if(!A)throw new Error("JSON validation did not pass. Validation process stopped.");if(F.delete(L),V)return 0;const $=Array.isArray(L)?0:_.length+r.JsonSize.Comma+r.JsonSize.Colon*2,G=M<k.length-1?r.JsonSize.Comma:0;return q+$+x+G},V?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return K(y,T)}t.validateJsonAndGetSize=C})(Bc);var an={},ts={exports:{}},Mi,No;function Ed(){if(No)return Mi;No=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;Mi=function(h,u){u=u||{};var d=typeof h;if(d==="string"&&h.length>0)return o(h);if(d==="number"&&isFinite(h))return u.long?c(h):a(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function o(h){if(h=String(h),!(h.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(u){var d=parseFloat(u[1]),f=(u[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*n;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function a(h){var u=Math.abs(h);return u>=r?Math.round(h/r)+"d":u>=n?Math.round(h/n)+"h":u>=e?Math.round(h/e)+"m":u>=t?Math.round(h/t)+"s":h+"ms"}function c(h){var u=Math.abs(h);return u>=r?l(h,u,r,"day"):u>=n?l(h,u,n,"hour"):u>=e?l(h,u,e,"minute"):u>=t?l(h,u,t,"second"):h+" ms"}function l(h,u,d,f){var p=u>=d*1.5;return Math.round(h/d)+" "+f+(p?"s":"")}return Mi}function Cd(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=Ed(),n.destroy=l,Object.keys(t).forEach(h=>{n[h]=t[h]}),n.names=[],n.skips=[],n.formatters={};function e(h){let u=0;for(let d=0;d<h.length;d++)u=(u<<5)-u+h.charCodeAt(d),u|=0;return n.colors[Math.abs(u)%n.colors.length]}n.selectColor=e;function n(h){let u,d=null,f,p;function g(...S){if(!g.enabled)return;const v=g,m=Number(new Date),E=m-(u||m);v.diff=E,v.prev=u,v.curr=m,u=m,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let C=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(T,F)=>{if(T==="%%")return"%";C++;const K=n.formatters[F];if(typeof K=="function"){const L=S[C];T=K.call(v,L),S.splice(C,1),C--}return T}),n.formatArgs.call(v,S),(v.log||n.log).apply(v,S)}return g.namespace=h,g.useColors=n.useColors(),g.color=n.selectColor(h),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(h)),p),set:S=>{d=S}}),typeof n.init=="function"&&n.init(g),g}function r(h,u){const d=n(this.namespace+(typeof u>"u"?":":u)+h);return d.log=this.log,d}function i(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let u;const d=(typeof h=="string"?h:"").split(/[\s,]+/),f=d.length;for(u=0;u<f;u++)d[u]&&(h=d[u].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function s(){const h=[...n.names.map(a),...n.skips.map(a).map(u=>"-"+u)].join(",");return n.enable(""),h}function o(h){if(h[h.length-1]==="*")return!0;let u,d;for(u=0,d=n.skips.length;u<d;u++)if(n.skips[u].test(h))return!1;for(u=0,d=n.names.length;u<d;u++)if(n.names[u].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Id=Cd;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,u=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(h++,d==="%c"&&(u=h))}),c.splice(u,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof Yi<"u"&&"env"in Yi&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Id(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ts,ts.exports);var kd=ts.exports,xd=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(an,"__esModule",{value:!0});an.createModuleLogger=an.createProjectLogger=void 0;const Rd=xd(kd),Md=(0,Rd.default)("metamask");function Td(t){return Md.extend(t)}an.createProjectLogger=Td;function Ad(t,e){return t.extend(e)}an.createModuleLogger=Ad;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.hexToBigInt=rt.hexToNumber=rt.bigIntToHex=rt.numberToHex=void 0;const Kt=ye,Dn=Yn,Nd=t=>((0,Kt.assert)(typeof t=="number","Value must be a number."),(0,Kt.assert)(t>=0,"Value must be a non-negative number."),(0,Kt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Dn.add0x)(t.toString(16)));rt.numberToHex=Nd;const Od=t=>((0,Kt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kt.assert)(t>=0,"Value must be a non-negative bigint."),(0,Dn.add0x)(t.toString(16)));rt.bigIntToHex=Od;const Ld=t=>{(0,Dn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};rt.hexToNumber=Ld;const jd=t=>((0,Dn.assertIsHexString)(t),BigInt((0,Dn.add0x)(t)));rt.hexToBigInt=jd;var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});var Hc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(Hc);var Wc={},ns={exports:{}};const $d="2.0.0",Uc=256,Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Pd=16,Fd=Uc-6,Bd=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var qr={MAX_LENGTH:Uc,MAX_SAFE_COMPONENT_LENGTH:Pd,MAX_SAFE_BUILD_LENGTH:Fd,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Bd,SEMVER_SPEC_VERSION:$d,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Vd=typeof Yi=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Gr=Vd;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r}=qr,i=Gr;e=t.exports={};const s=e.re=[],o=e.safeRe=[],a=e.src=[],c=e.t={};let l=0;const h="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[h,r]],d=p=>{for(const[g,S]of u)p=p.split(`${g}*`).join(`${g}{0,${S}}`).split(`${g}+`).join(`${g}{1,${S}}`);return p},f=(p,g,S)=>{const v=d(g),m=l++;i(p,m,g),c[p]=m,a[m]=g,s[m]=new RegExp(g,S?"g":void 0),o[m]=new RegExp(v,S?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),f("FULL",`^${a[c.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),f("LOOSE",`^${a[c.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),f("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),f("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),f("COERCERTL",a[c.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",f("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",f("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ns,ns.exports);var Kn=ns.exports;const Hd=Object.freeze({loose:!0}),Wd=Object.freeze({}),Ud=t=>t?typeof t!="object"?Hd:t:Wd;var Ms=Ud;const Oo=/^[0-9]+$/,zc=(t,e)=>{const n=Oo.test(t),r=Oo.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},zd=(t,e)=>zc(e,t);var qc={compareIdentifiers:zc,rcompareIdentifiers:zd};const lr=Gr,{MAX_LENGTH:Lo,MAX_SAFE_INTEGER:hr}=qr,{safeRe:jo,t:$o}=Kn,qd=Ms,{compareIdentifiers:Wt}=qc;let Gd=class Ke{constructor(e,n){if(n=qd(n),e instanceof Ke){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lo)throw new TypeError(`version is longer than ${Lo} characters`);lr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?jo[$o.LOOSE]:jo[$o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>hr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<hr)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(lr("SemVer.compare",this.version,this.options,e),!(e instanceof Ke)){if(typeof e=="string"&&e===this.version)return 0;e=new Ke(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Ke||(e=new Ke(e,this.options)),Wt(this.major,e.major)||Wt(this.minor,e.minor)||Wt(this.patch,e.patch)}comparePre(e){if(e instanceof Ke||(e=new Ke(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}compareBuild(e){e instanceof Ke||(e=new Ke(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),Wt(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ke=Gd;const Do=ke,Jd=(t,e,n=!1)=>{if(t instanceof Do)return t;try{return new Do(t,e)}catch(r){if(!n)return null;throw r}};var yn=Jd;const Qd=yn,Zd=(t,e)=>{const n=Qd(t,e);return n?n.version:null};var Yd=Zd;const Kd=yn,Xd=(t,e)=>{const n=Kd(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var ep=Xd;const Po=ke,tp=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Po(t instanceof Po?t.version:t,n).inc(e,r,i).version}catch{return null}};var np=tp;const Fo=yn,rp=(t,e)=>{const n=Fo(t,null,!0),r=Fo(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const h=c?"pre":"";return n.major!==r.major?h+"major":n.minor!==r.minor?h+"minor":n.patch!==r.patch?h+"patch":"prerelease"};var ip=rp;const sp=ke,op=(t,e)=>new sp(t,e).major;var ap=op;const cp=ke,up=(t,e)=>new cp(t,e).minor;var lp=up;const hp=ke,fp=(t,e)=>new hp(t,e).patch;var dp=fp;const pp=yn,bp=(t,e)=>{const n=pp(t,e);return n&&n.prerelease.length?n.prerelease:null};var gp=bp;const Bo=ke,mp=(t,e,n)=>new Bo(t,n).compare(new Bo(e,n));var Ge=mp;const vp=Ge,yp=(t,e,n)=>vp(e,t,n);var wp=yp;const _p=Ge,Sp=(t,e)=>_p(t,e,!0);var Ep=Sp;const Vo=ke,Cp=(t,e,n)=>{const r=new Vo(t,n),i=new Vo(e,n);return r.compare(i)||r.compareBuild(i)};var Ts=Cp;const Ip=Ts,kp=(t,e)=>t.sort((n,r)=>Ip(n,r,e));var xp=kp;const Rp=Ts,Mp=(t,e)=>t.sort((n,r)=>Rp(r,n,e));var Tp=Mp;const Ap=Ge,Np=(t,e,n)=>Ap(t,e,n)>0;var Jr=Np;const Op=Ge,Lp=(t,e,n)=>Op(t,e,n)<0;var As=Lp;const jp=Ge,$p=(t,e,n)=>jp(t,e,n)===0;var Gc=$p;const Dp=Ge,Pp=(t,e,n)=>Dp(t,e,n)!==0;var Jc=Pp;const Fp=Ge,Bp=(t,e,n)=>Fp(t,e,n)>=0;var Ns=Bp;const Vp=Ge,Hp=(t,e,n)=>Vp(t,e,n)<=0;var Os=Hp;const Wp=Gc,Up=Jc,zp=Jr,qp=Ns,Gp=As,Jp=Os,Qp=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Wp(t,n,r);case"!=":return Up(t,n,r);case">":return zp(t,n,r);case">=":return qp(t,n,r);case"<":return Gp(t,n,r);case"<=":return Jp(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var Qc=Qp;const Zp=ke,Yp=yn,{safeRe:fr,t:dr}=Kn,Kp=(t,e)=>{if(t instanceof Zp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(fr[dr.COERCE]);else{let r;for(;(r=fr[dr.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),fr[dr.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;fr[dr.COERCERTL].lastIndex=-1}return n===null?null:Yp(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)};var Xp=Kp,Ti,Ho;function e0(){return Ho||(Ho=1,Ti=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ti}var t0=z;z.Node=jt;z.create=z;function z(t){var e=this;if(e instanceof z||(e=new z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)r0(this,arguments[t]);return this.length};z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)i0(this,arguments[t]);return this.length};z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};z.prototype.map=function(t,e){e=e||this;for(var n=new z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=n0(this,i,n[r]);return s};z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function n0(t,e,n){var r=e===t.head?new jt(n,null,e,t):new jt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function r0(t,e){t.tail=new jt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function i0(t,e){t.head=new jt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function jt(t,e,n,r){if(!(this instanceof jt))return new jt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{e0()(z)}catch{}const s0=t0,Tt=Symbol("max"),ut=Symbol("length"),Ut=Symbol("lengthCalculator"),Nn=Symbol("allowStale"),Ot=Symbol("maxAge"),at=Symbol("dispose"),Wo=Symbol("noDisposeOnSet"),pe=Symbol("lruList"),Ue=Symbol("cache"),Zc=Symbol("updateAgeOnGet"),Ai=()=>1;class o0{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Tt]=e.max||1/0;const n=e.length||Ai;if(this[Ut]=typeof n!="function"?Ai:n,this[Nn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ot]=e.maxAge||0,this[at]=e.dispose,this[Wo]=e.noDisposeOnSet||!1,this[Zc]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Tt]=e||1/0,In(this)}get max(){return this[Tt]}set allowStale(e){this[Nn]=!!e}get allowStale(){return this[Nn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Ot]=e,In(this)}get maxAge(){return this[Ot]}set lengthCalculator(e){typeof e!="function"&&(e=Ai),e!==this[Ut]&&(this[Ut]=e,this[ut]=0,this[pe].forEach(n=>{n.length=this[Ut](n.value,n.key),this[ut]+=n.length})),In(this)}get lengthCalculator(){return this[Ut]}get length(){return this[ut]}get itemCount(){return this[pe].length}rforEach(e,n){n=n||this;for(let r=this[pe].tail;r!==null;){const i=r.prev;Uo(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[pe].head;r!==null;){const i=r.next;Uo(this,e,r,n),r=i}}keys(){return this[pe].toArray().map(e=>e.key)}values(){return this[pe].toArray().map(e=>e.value)}reset(){this[at]&&this[pe]&&this[pe].length&&this[pe].forEach(e=>this[at](e.key,e.value)),this[Ue]=new Map,this[pe]=new s0,this[ut]=0}dump(){return this[pe].map(e=>Cr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[pe]}set(e,n,r){if(r=r||this[Ot],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Ut](n,e);if(this[Ue].has(e)){if(s>this[Tt])return Xt(this,this[Ue].get(e)),!1;const c=this[Ue].get(e).value;return this[at]&&(this[Wo]||this[at](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[ut]+=s-c.length,c.length=s,this.get(e),In(this),!0}const o=new a0(e,n,s,i,r);return o.length>this[Tt]?(this[at]&&this[at](e,n),!1):(this[ut]+=o.length,this[pe].unshift(o),this[Ue].set(e,this[pe].head),In(this),!0)}has(e){if(!this[Ue].has(e))return!1;const n=this[Ue].get(e).value;return!Cr(this,n)}get(e){return Ni(this,e,!0)}peek(e){return Ni(this,e,!1)}pop(){const e=this[pe].tail;return e?(Xt(this,e),e.value):null}del(e){Xt(this,this[Ue].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ue].forEach((e,n)=>Ni(this,n,!1))}}const Ni=(t,e,n)=>{const r=t[Ue].get(e);if(r){const i=r.value;if(Cr(t,i)){if(Xt(t,r),!t[Nn])return}else n&&(t[Zc]&&(r.value.now=Date.now()),t[pe].unshiftNode(r));return i.value}},Cr=(t,e)=>{if(!e||!e.maxAge&&!t[Ot])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ot]&&n>t[Ot]},In=t=>{if(t[ut]>t[Tt])for(let e=t[pe].tail;t[ut]>t[Tt]&&e!==null;){const n=e.prev;Xt(t,e),e=n}},Xt=(t,e)=>{if(e){const n=e.value;t[at]&&t[at](n.key,n.value),t[ut]-=n.length,t[Ue].delete(n.key),t[pe].removeNode(e)}};class a0{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Uo=(t,e,n,r)=>{let i=n.value;Cr(t,i)&&(Xt(t,n),t[Nn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var c0=o0,Oi,zo;function Je(){if(zo)return Oi;zo=1;class t{constructor(w,M){if(M=r(M),w instanceof t)return w.loose===!!M.loose&&w.includePrerelease===!!M.includePrerelease?w:new t(w.raw,M);if(w instanceof i)return this.raw=w.value,this.set=[[w]],this.format(),this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=w.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k)).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(A=>!p(A[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const A of this.set)if(A.length===1&&g(A[0])){this.set=[A];break}}}this.format()}format(){return this.range=this.set.map(w=>w.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&d)|(this.options.loose&&f))+":"+w,A=n.get(k);if(A)return A;const x=this.options.loose,$=x?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];w=w.replace($,fe(this.options.includePrerelease)),s("hyphen replace",w),w=w.replace(a[c.COMPARATORTRIM],l),s("comparator trim",w),w=w.replace(a[c.TILDETRIM],h),s("tilde trim",w),w=w.replace(a[c.CARETTRIM],u),s("caret trim",w);let G=w.split(" ").map(ce=>v(ce,this.options)).join(" ").split(/\s+/).map(ce=>V(ce,this.options));x&&(G=G.filter(ce=>(s("loose invalid filter",ce,this.options),!!ce.match(a[c.COMPARATORLOOSE])))),s("range list",G);const B=new Map,ee=G.map(ce=>new i(ce,this.options));for(const ce of ee){if(p(ce))return[ce];B.set(ce.value,ce)}B.size>1&&B.has("")&&B.delete("");const Me=[...B.values()];return n.set(k,Me),Me}intersects(w,M){if(!(w instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>S(k,M)&&w.set.some(A=>S(A,M)&&k.every(x=>A.every($=>x.intersects($,M)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new o(w,this.options)}catch{return!1}for(let M=0;M<this.set.length;M++)if(q(this.set[M],w,this.options))return!0;return!1}}Oi=t;const e=c0,n=new e({max:1e3}),r=Ms,i=Qr(),s=Gr,o=ke,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:h,caretTrimReplace:u}=Kn,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:f}=qr,p=_=>_.value==="<0.0.0-0",g=_=>_.value==="",S=(_,w)=>{let M=!0;const k=_.slice();let A=k.pop();for(;M&&k.length;)M=k.every(x=>A.intersects(x,w)),A=k.pop();return M},v=(_,w)=>(s("comp",_,w),_=y(_,w),s("caret",_),_=E(_,w),s("tildes",_),_=F(_,w),s("xrange",_),_=L(_,w),s("stars",_),_),m=_=>!_||_.toLowerCase()==="x"||_==="*",E=(_,w)=>_.trim().split(/\s+/).map(M=>C(M,w)).join(" "),C=(_,w)=>{const M=w.loose?a[c.TILDELOOSE]:a[c.TILDE];return _.replace(M,(k,A,x,$,G)=>{s("tilde",_,k,A,x,$,G);let B;return m(A)?B="":m(x)?B=`>=${A}.0.0 <${+A+1}.0.0-0`:m($)?B=`>=${A}.${x}.0 <${A}.${+x+1}.0-0`:G?(s("replaceTilde pr",G),B=`>=${A}.${x}.${$}-${G} <${A}.${+x+1}.0-0`):B=`>=${A}.${x}.${$} <${A}.${+x+1}.0-0`,s("tilde return",B),B})},y=(_,w)=>_.trim().split(/\s+/).map(M=>T(M,w)).join(" "),T=(_,w)=>{s("caret",_,w);const M=w.loose?a[c.CARETLOOSE]:a[c.CARET],k=w.includePrerelease?"-0":"";return _.replace(M,(A,x,$,G,B)=>{s("caret",_,A,x,$,G,B);let ee;return m(x)?ee="":m($)?ee=`>=${x}.0.0${k} <${+x+1}.0.0-0`:m(G)?x==="0"?ee=`>=${x}.${$}.0${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.0${k} <${+x+1}.0.0-0`:B?(s("replaceCaret pr",B),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}-${B} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}-${B} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G}-${B} <${+x+1}.0.0-0`):(s("no pr"),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}${k} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G} <${+x+1}.0.0-0`),s("caret return",ee),ee})},F=(_,w)=>(s("replaceXRanges",_,w),_.split(/\s+/).map(M=>K(M,w)).join(" ")),K=(_,w)=>{_=_.trim();const M=w.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return _.replace(M,(k,A,x,$,G,B)=>{s("xRange",_,k,A,x,$,G,B);const ee=m(x),Me=ee||m($),ce=Me||m(G),Cn=ce;return A==="="&&Cn&&(A=""),B=w.includePrerelease?"-0":"",ee?A===">"||A==="<"?k="<0.0.0-0":k="*":A&&Cn?(Me&&($=0),G=0,A===">"?(A=">=",Me?(x=+x+1,$=0,G=0):($=+$+1,G=0)):A==="<="&&(A="<",Me?x=+x+1:$=+$+1),A==="<"&&(B="-0"),k=`${A+x}.${$}.${G}${B}`):Me?k=`>=${x}.0.0${B} <${+x+1}.0.0-0`:ce&&(k=`>=${x}.${$}.0${B} <${x}.${+$+1}.0-0`),s("xRange return",k),k})},L=(_,w)=>(s("replaceStars",_,w),_.trim().replace(a[c.STAR],"")),V=(_,w)=>(s("replaceGTE0",_,w),_.trim().replace(a[w.includePrerelease?c.GTE0PRE:c.GTE0],"")),fe=_=>(w,M,k,A,x,$,G,B,ee,Me,ce,Cn,j2)=>(m(k)?M="":m(A)?M=`>=${k}.0.0${_?"-0":""}`:m(x)?M=`>=${k}.${A}.0${_?"-0":""}`:$?M=`>=${M}`:M=`>=${M}${_?"-0":""}`,m(ee)?B="":m(Me)?B=`<${+ee+1}.0.0-0`:m(ce)?B=`<${ee}.${+Me+1}.0-0`:Cn?B=`<=${ee}.${Me}.${ce}-${Cn}`:_?B=`<${ee}.${Me}.${+ce+1}-0`:B=`<=${B}`,`${M} ${B}`.trim()),q=(_,w,M)=>{for(let k=0;k<_.length;k++)if(!_[k].test(w))return!1;if(w.prerelease.length&&!M.includePrerelease){for(let k=0;k<_.length;k++)if(s(_[k].semver),_[k].semver!==i.ANY&&_[k].semver.prerelease.length>0){const A=_[k].semver;if(A.major===w.major&&A.minor===w.minor&&A.patch===w.patch)return!0}return!1}return!0};return Oi}var Li,qo;function Qr(){if(qo)return Li;qo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,u){if(u=n(u),h instanceof e){if(h.loose===!!u.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),o("comparator",h,u),this.options=u,this.loose=!!u.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(h){const u=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=h.match(u);if(!d)throw new TypeError(`Invalid comparator: ${h}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(o("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new a(h,this.options)}catch{return!1}return s(h,this.operator,this.semver,this.options)}intersects(h,u){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(h.value,u).test(this.value):h.operator===""?h.value===""?!0:new c(this.value,u).test(h.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||s(this.semver,"<",h.semver,u)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||s(this.semver,">",h.semver,u)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Li=e;const n=Ms,{safeRe:r,t:i}=Kn,s=Qc,o=Gr,a=ke,c=Je();return Li}const u0=Je(),l0=(t,e,n)=>{try{e=new u0(e,n)}catch{return!1}return e.test(t)};var Zr=l0;const h0=Je(),f0=(t,e)=>new h0(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var d0=f0;const p0=ke,b0=Je(),g0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new b0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new p0(r,n))}),r};var m0=g0;const v0=ke,y0=Je(),w0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new y0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new v0(r,n))}),r};var _0=w0;const ji=ke,S0=Je(),Go=Jr,E0=(t,e)=>{t=new S0(t,e);let n=new ji("0.0.0");if(t.test(n)||(n=new ji("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new ji(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Go(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||Go(n,s))&&(n=s)}return n&&t.test(n)?n:null};var C0=E0;const I0=Je(),k0=(t,e)=>{try{return new I0(t,e).range||"*"}catch{return null}};var x0=k0;const R0=ke,Yc=Qr(),{ANY:M0}=Yc,T0=Je(),A0=Zr,Jo=Jr,Qo=As,N0=Os,O0=Ns,L0=(t,e,n,r)=>{t=new R0(t,r),e=new T0(e,r);let i,s,o,a,c;switch(n){case">":i=Jo,s=N0,o=Qo,a=">",c=">=";break;case"<":i=Qo,s=O0,o=Jo,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A0(t,e,r))return!1;for(let l=0;l<e.set.length;++l){const h=e.set[l];let u=null,d=null;if(h.forEach(f=>{f.semver===M0&&(f=new Yc(">=0.0.0")),u=u||f,d=d||f,i(f.semver,u.semver,r)?u=f:o(f.semver,d.semver,r)&&(d=f)}),u.operator===a||u.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&o(t,d.semver))return!1}return!0};var Ls=L0;const j0=Ls,$0=(t,e,n)=>j0(t,e,">",n);var D0=$0;const P0=Ls,F0=(t,e,n)=>P0(t,e,"<",n);var B0=F0;const Zo=Je(),V0=(t,e,n)=>(t=new Zo(t,n),e=new Zo(e,n),t.intersects(e,n));var H0=V0;const W0=Zr,U0=Ge;var z0=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((h,u)=>U0(h,u,n));for(const h of o)W0(h,e,n)?(s=h,i||(i=h)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[h,u]of r)h===u?a.push(h):!u&&h===o[0]?a.push("*"):u?h===o[0]?a.push(`<=${u}`):a.push(`${h} - ${u}`):a.push(`>=${h}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e};const Yo=Je(),js=Qr(),{ANY:$i}=js,kn=Zr,$s=Ge,q0=(t,e,n={})=>{if(t===e)return!0;t=new Yo(t,n),e=new Yo(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=J0(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},G0=[new js(">=0.0.0-0")],Ko=[new js(">=0.0.0")],J0=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===$i){if(e.length===1&&e[0].semver===$i)return!0;n.includePrerelease?t=G0:t=Ko}if(e.length===1&&e[0].semver===$i){if(n.includePrerelease)return!0;e=Ko}const r=new Set;let i,s;for(const f of t)f.operator===">"||f.operator===">="?i=Xo(i,f,n):f.operator==="<"||f.operator==="<="?s=ea(s,f,n):r.add(f.semver);if(r.size>1)return null;let o;if(i&&s){if(o=$s(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const f of r){if(i&&!kn(f,String(i),n)||s&&!kn(f,String(s),n))return null;for(const p of e)if(!kn(f,String(p),n))return!1;return!0}let a,c,l,h,u=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const f of e){if(h=h||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=Xo(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(f),n))return!1}if(s){if(u&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===u.major&&f.semver.minor===u.minor&&f.semver.patch===u.patch&&(u=!1),f.operator==="<"||f.operator==="<="){if(c=ea(s,f,n),c===f&&c!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(f),n))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&h&&!i&&o!==0||d||u)},Xo=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},ea=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var Q0=q0;const Di=Kn,ta=qr,Z0=ke,na=qc,Y0=yn,K0=Yd,X0=ep,eb=np,tb=ip,nb=ap,rb=lp,ib=dp,sb=gp,ob=Ge,ab=wp,cb=Ep,ub=Ts,lb=xp,hb=Tp,fb=Jr,db=As,pb=Gc,bb=Jc,gb=Ns,mb=Os,vb=Qc,yb=Xp,wb=Qr(),_b=Je(),Sb=Zr,Eb=d0,Cb=m0,Ib=_0,kb=C0,xb=x0,Rb=Ls,Mb=D0,Tb=B0,Ab=H0,Nb=z0,Ob=Q0;var Lb={parse:Y0,valid:K0,clean:X0,inc:eb,diff:tb,major:nb,minor:rb,patch:ib,prerelease:sb,compare:ob,rcompare:ab,compareLoose:cb,compareBuild:ub,sort:lb,rsort:hb,gt:fb,lt:db,eq:pb,neq:bb,gte:gb,lte:mb,cmp:vb,coerce:yb,Comparator:wb,Range:_b,satisfies:Sb,toComparators:Eb,maxSatisfying:Cb,minSatisfying:Ib,minVersion:kb,validRange:xb,outside:Rb,gtr:Mb,ltr:Tb,intersects:Ab,simplifyRange:Nb,subset:Ob,SemVer:Z0,re:Di.re,src:Di.src,tokens:Di.t,SEMVER_SPEC_VERSION:ta.SEMVER_SPEC_VERSION,RELEASE_TYPES:ta.RELEASE_TYPES,compareIdentifiers:na.compareIdentifiers,rcompareIdentifiers:na.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=Lb,n=Bt,r=ye;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",u=>(0,e.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",u=>(0,e.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function i(u){return(0,n.is)(u,t.VersionStruct)}t.isValidSemVerVersion=i;function s(u){return(0,n.is)(u,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(u){(0,r.assertStruct)(u,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(u){(0,r.assertStruct)(u,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(u,d){return(0,e.gt)(u,d)}t.gtVersion=c;function l(u,d){return(0,e.gtr)(u,d)}t.gtRange=l;function h(u,d){return(0,e.satisfies)(u,d,{includePrerelease:!0})}t.satisfiesVersionRange=h})(Wc);(function(t){var e=O&&O.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=O&&O.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ye,t),n(Zn,t),n(W,t),n(Ur,t),n(nt,t),n(on,t),n(Yn,t),n(Bc,t),n(an,t),n(Rs,t),n(rt,t),n(Vc,t),n(Hc,t),n(Wc,t)})(_c);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=_c;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(wc);var Kc=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.PollingBlockTracker=void 0;const jb=Kc(Ja),$b=Kc(xl),Db=Jn,ra=wc,ia=(0,ra.createModuleLogger)(ra.projectLogger,"polling-block-tracker"),Pb=(0,jb.default)(),Fb=1e3;class Bb extends Db.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Fb,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=sa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
2
+ ${(e=n.stack)!==null&&e!==void 0?e:n}`);try{this.emit("error",r)}catch{console.error(r)}const i=sa(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:Pb(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),ia("Making request",e);const n=await(0,$b.default)(r=>this._provider.sendAsync(e,r))();if(ia("Got response",n),n.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
3
+ ${n.error.message}`);return n.result}}Hr.PollingBlockTracker=Bb;function sa(t,e){return new Promise(n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()})}var Yr={},Vb=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.SubscribeBlockTracker=void 0;const Hb=Vb(Ja),Wb=Jn,Ub=(0,Hb.default)();class zb extends Wb.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...n){return new Promise((r,i)=>{this._provider.sendAsync({id:Ub(),method:e,params:n,jsonrpc:"2.0"},(s,o)=>{s?i(s):r(o.result)})})}_handleSubData(e,n){var r;n.method==="eth_subscription"&&((r=n.params)===null||r===void 0?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(n.params.result.number)}}Yr.SubscribeBlockTracker=zb;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});(function(t){var e=O&&O.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=O&&O.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(Hr,t),n(Yr,t),n(Xc,t)})(yc);const oa=(t,e,n,r)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,h)=>{l?a(l):o(h)}):i.push(o),Reflect.apply(t,this===n?r:this,i)})},aa=new WeakMap;var qb=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(!(t!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":n}\``);const r=(o,a)=>{let c=aa.get(o);if(c||(c={},aa.set(o,c)),a in c)return c[a];const l=p=>typeof p=="string"||typeof a=="symbol"?a===p:p.test(a),h=Reflect.getOwnPropertyDescriptor(o,a),u=h===void 0||h.writable||h.configurable,f=(e.include?e.include.some(l):!e.exclude.some(l))&&u;return c[a]=f,f},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const h=e.excludeMain?o:oa(o,e,s,o);return i.set(o,h),Reflect.apply(h,a,c)},get(o,a){const c=o[a];if(!r(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const h=oa(c,e,s,o);return i.set(c,h),h}return c}});return s};const Gb=Lr.default;let Jb=class extends Gb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(n=>this.emit("update",n))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Ds=Jb;const Qb=Ds;let Zb=class extends Qb{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var Yb=Zb,Xn={minBlockRef:Kb,maxBlockRef:Xb,sortBlockRefs:Ps,bnToHex:eg,blockRefIsNumber:tg,hexToInt:Ir,incrementHexInt:ng,intToHex:eu,unsafeRandomBytes:rg};function Kb(...t){return Ps(t)[0]}function Xb(...t){const e=Ps(t);return e[e.length-1]}function Ps(t){return t.sort((e,n)=>e==="latest"||n==="earliest"?1:n==="latest"||e==="earliest"?-1:Ir(e)-Ir(n))}function eg(t){return"0x"+t.toString(16)}function tg(t){return t&&!["earliest","latest","pending"].includes(t)}function Ir(t){return t==null?t:Number.parseInt(t,16)}function ng(t){if(t==null)return t;const e=Ir(t);return eu(e+1)}function eu(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function rg(t){let e="0x";for(let n=0;n<t;n++)e+=ca(),e+=ca();return e}function ca(){return Math.floor(Math.random()*16).toString(16)}const ig=Rl,sg=qb,og=Yb,{bnToHex:F2,hexToInt:pr,incrementHexInt:ag,minBlockRef:cg,blockRefIsNumber:ug}=Xn;let lg=class extends og{constructor({provider:e,params:n}){super(),this.type="log",this.ethQuery=new ig(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},n),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(r=>r.toLowerCase()))}async initialize({currentBlock:e}){let n=this.params.fromBlock;["latest","pending"].includes(n)&&(n=e),n==="earliest"&&(n="0x0"),this.params.fromBlock=n;const r=cg(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:r}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:n}){const r=n;let i;e?i=ag(e):i=n;const s=Object.assign({},this.params,{fromBlock:i,toBlock:r}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await sg(r=>this.ethQuery.getLogs(e,r))()}matchLog(e){if(pr(this.params.fromBlock)>=pr(e.blockNumber)||ug(this.params.toBlock)&&pr(this.params.toBlock)<=pr(e.blockNumber))return!1;const n=e.address&&e.address.toLowerCase();return this.params.address&&n&&!this.params.address.includes(n)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(h=>h.toLowerCase()),a.includes(o))})}};var hg=lg,Fs=fg;async function fg({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=ua(e),s=ua(n)-r+1,o=Array(s).fill().map((c,l)=>r+l).map(dg);return await Promise.all(o.map(c=>bg(t,"eth_getBlockByNumber",[c,!1])))}function ua(t){return t==null?t:Number.parseInt(t,16)}function dg(t){return t==null?t:"0x"+t.toString(16)}function pg(t,e){return new Promise((n,r)=>{t.sendAsync(e,(i,s)=>{i?r(i):s.error?r(s.error):s.result?n(s.result):r(new Error("Result was empty"))})})}async function bg(t,e,n){for(let r=0;r<3;r++)try{return await pg(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}const gg=Ds,mg=Fs,{incrementHexInt:vg}=Xn;let yg=class extends gg{constructor({provider:e,params:n}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:n}){const r=n,i=vg(e),o=(await mg({provider:this.provider,fromBlock:i,toBlock:r})).map(a=>a.hash);this.addResults(o)}};var wg=yg;const _g=Ds,Sg=Fs,{incrementHexInt:Eg}=Xn;let Cg=class extends _g{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const n=e,r=Eg(e),i=await Sg({provider:this.provider,fromBlock:r,toBlock:n}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ig=Cg;const kg=Ml.Mutex,{createAsyncMiddleware:xg,createScaffoldMiddleware:Rg}=Qa,Mg=hg,Tg=wg,Ag=Ig,{intToHex:tu,hexToInt:Pi}=Xn;var Ng=Og;function Og({blockTracker:t,provider:e}){let n=0,r={};const i=new kg,s=Lg({mutex:i}),o=Rg({eth_newFilter:s(Fi(c)),eth_newBlockFilter:s(Fi(l)),eth_newPendingTransactionFilter:s(Fi(h)),eth_uninstallFilter:s(wr(f)),eth_getFilterChanges:s(wr(u)),eth_getFilterLogs:s(wr(d))}),a=async({oldBlock:m,newBlock:E})=>{if(r.length===0)return;const C=await i.acquire();try{await Promise.all(zt(r).map(async y=>{try{await y.update({oldBlock:m,newBlock:E})}catch(T){console.error(T)}}))}catch(y){console.error(y)}C()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=h,o.uninstallFilter=f,o.getFilterChanges=u,o.getFilterLogs=d,o.destroy=()=>{S()},o;async function c(m){const E=new Mg({provider:e,params:m});return await p(E),E}async function l(){const m=new Tg({provider:e});return await p(m),m}async function h(){const m=new Ag({provider:e});return await p(m),m}async function u(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);return C.getChangesAndClear()}async function d(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);let y=[];return C.type==="log"&&(y=C.getAllResults()),y}async function f(m){const E=Pi(m),y=!!r[E];return y&&await g(E),y}async function p(m){const E=zt(r).length,C=await t.getLatestBlock();await m.initialize({currentBlock:C}),n++,r[n]=m,m.id=n,m.idHex=tu(n);const y=zt(r).length;return v({prevFilterCount:E,newFilterCount:y}),n}async function g(m){const E=zt(r).length;delete r[m];const C=zt(r).length;v({prevFilterCount:E,newFilterCount:C})}async function S(){const m=zt(r).length;r={},v({prevFilterCount:m,newFilterCount:0})}function v({prevFilterCount:m,newFilterCount:E}){if(m===0&&E>0){t.on("sync",a);return}if(m>0&&E===0){t.removeListener("sync",a);return}}}function Fi(t){return wr(async(...e)=>{const n=await t(...e);return tu(n.id)})}function wr(t){return xg(async(e,n)=>{const r=await t.apply(null,e.params);n.result=r})}function Lg({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}function zt(t,e){const n=[];for(let r in t)n.push(t[r]);return n}const jg=Lr.default,{createAsyncMiddleware:la,createScaffoldMiddleware:$g}=Qa,Dg=Ng,{unsafeRandomBytes:Pg,incrementHexInt:Fg}=Xn,Bg=Fs;var Vg=Hg;function Hg({blockTracker:t,provider:e}){const n={},r=Dg({blockTracker:t,provider:e});let i=!1;const s=new jg,o=$g({eth_subscribe:la(a),eth_unsubscribe:la(c)});return o.destroy=h,{events:s,middleware:o};async function a(u,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=Pg(16);let g;switch(f){case"newHeads":g=S({subId:p});break;case"logs":const m=u.params[1],E=await r.newLogFilter(m);g=v({subId:p,filter:E});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}n[p]=g,d.result=p;return;function S({subId:m}){const E={type:f,destroy:async()=>{t.removeListener("sync",E.update)},update:async({oldBlock:C,newBlock:y})=>{const T=y,F=Fg(C);(await Bg({provider:e,fromBlock:F,toBlock:T})).map(Wg).filter(V=>V!==null).forEach(V=>{l(m,V)})}};return t.on("sync",E.update),E}function v({subId:m,filter:E}){return E.on("update",y=>l(m,y)),{type:f,destroy:async()=>await r.uninstallFilter(E.idHex)}}}async function c(u,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=n[f];if(!p){d.result=!1;return}delete n[f],await p.destroy(),d.result=!0}function l(u,d){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:u,result:d}})}function h(){s.removeAllListeners();for(const u in n)n[u].destroy(),delete n[u];i=!0}}function Wg(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Vr,"__esModule",{value:!0});Vr.SubscriptionManager=void 0;const Ug=yc,zg=Vg,ha=()=>{};class qg{constructor(e){const n=new Ug.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:i}=zg({blockTracker:n,provider:e});this.events=r,this.subscriptionMiddleware=i}async handleRequest(e){const n={};return await this.subscriptionMiddleware(e,n,ha,ha),n}destroy(){this.subscriptionMiddleware.destroy()}}Vr.SubscriptionManager=qg;var Bs=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nn,"__esModule",{value:!0});nn.CoinbaseWalletProvider=void 0;const Gg=Bs(Lr),Jg=Bs(Or),Bi=bn,Q=Wn,fa=gn,da=qe,Vi=Pr,Qg=Y,D=I,Hi=Bs(Xh),Zg=sn,J=vc,Yg=Vr,pa="DefaultChainId",ba="DefaultJsonRpcUrl";class Kg extends Gg.default{constructor(e){var n,r;super(),this._filterPolyfill=new Zg.FilterPolyfill(this),this._subscriptionManager=new Yg.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this.isCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,D.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(da.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,D.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,h=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(h,Number(l))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,D.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(ba))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(ba,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,n){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=n,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,n){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(pa,n.toString(10)),((0,D.ensureIntNumber)(n)!==r||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,n,r,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,n,r,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,n,r,i,s,o){var a,c;if((0,D.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),h=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!h&&await l.requestEthereumAccounts().promise;const u=await l.addEthereumChain(e.toString(),n,s,r,i,o).promise;return((a=u.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(n[0],e),((c=u.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const r=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Qg.isErrorResponse)(r)&&r.errorCode)throw r.errorCode===Q.standardErrorCodes.provider.unsupportedChain?Q.standardErrors.provider.unsupportedChain(e):Q.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});const i=r.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,n){this.initializeRelay().then(r=>r.setAppInfo(e,n))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?fa.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(J.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,n){try{const r=this._send(e,n);if(r instanceof Promise)return r.catch(i=>{throw(0,Q.serializeError)(i,e)})}catch(r){throw(0,Q.serializeError)(r,e)}}_send(e,n){if(typeof e=="string"){const i=e,s=Array.isArray(n)?n:n!==void 0?[n]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof n=="function"){const i=e,s=n;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const r=e;return this._sendRequest(r)}async sendAsync(e,n){try{return this._sendAsync(e,n).catch(r=>{throw(0,Q.serializeError)(r,e)})}catch(r){return Promise.reject((0,Q.serializeError)(r,e))}}async _sendAsync(e,n){if(typeof n!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=n;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const r=n;return this._sendRequestAsync(e).then(i=>r(null,i)).catch(i=>r(i,null))}async request(e){try{return this._request(e).catch(n=>{throw(0,Q.serializeError)(n,e.method)})}catch(n){return Promise.reject((0,Q.serializeError)(n,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Q.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:n,params:r}=e;if(typeof n!="string"||n.length===0)throw Q.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw Q.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=r===void 0?[]:r,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:n,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var n;const i=await(await this.initializeRelay()).scanQRCode((0,D.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.scanQRCode);return i.result}async genericRequest(e,n){var r;const s=await(await this.initializeRelay()).genericRequest(e,n).promise;if(typeof s.result!="string")throw(0,Q.serializeError)((r=s.errorMessage)!==null&&r!==void 0?r:"result was not a string",Vi.Web3Method.generic);return s.result}async selectProvider(e){var n;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const n={jsonrpc:"2.0",id:e.id},{method:r}=e;if(n.result=this._handleSynchronousMethods(e),n.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return n}_setAddresses(e,n){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>(0,D.ensureAddressString)(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!n||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(da.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(e){return new Promise((n,r)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return n({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>n(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>r(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>n({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>r(a));return}}catch(i){return r(i)}this._handleAsynchronousMethods(e).then(i=>i&&n(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>r(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(n=>this._sendRequestAsync(n)))}_handleSynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_accounts:return this._eth_accounts();case J.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case J.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case J.JSONRPCMethod.net_version:return this._net_version();case J.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case J.JSONRPCMethod.eth_sign:return this._eth_sign(r);case J.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case J.JSONRPCMethod.personal_sign:return this._personal_sign(r);case J.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case J.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case J.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case J.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case J.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case J.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case J.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case J.JSONRPCMethod.eth_signTypedData_v4:case J.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case J.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case J.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case J.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case J.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case J.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case J.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case J.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case J.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case J.JSONRPCMethod.eth_subscribe:case J.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const n=(0,D.ensureAddressString)(e);return this._addresses.map(i=>(0,D.ensureAddressString)(i)).includes(n)}catch{}return!1}_ensureKnownAddress(e){var n;if(!this._isKnownAddress(e))throw(n=this.diagnostic)===null||n===void 0||n.log(Bi.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?(0,D.ensureAddressString)(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?(0,D.ensureAddressString)(e.to):null,i=e.value!=null?(0,D.ensureBN)(e.value):new Jg.default(0),s=e.data?(0,D.ensureBuffer)(e.data):U.alloc(0),o=e.nonce!=null?(0,D.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,D.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,D.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,D.ensureBN)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,D.ensureBN)(e.gas):null,u=this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:u}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Q.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Q.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,n,r,i){this._ensureKnownAddress(n);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,n,r,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,n,r){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,n,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,D.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(pa);if(!e)return(0,D.ensureIntNumber)(this._chainIdFromOpts);const n=parseInt(e,10);return(0,D.ensureIntNumber)(n)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?fa.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let n;try{n=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._signEthereumMessage(r,n,!1)}_eth_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!1)}_personal_sign(e){this._requireAuthorization();const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureAddressString)(e[1]);return this._signEthereumMessage(n,r,!0)}_personal_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const n=(0,D.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(n,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const n=(0,D.ensureParsedJSONObject)(e[0]),r=(0,D.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const i=Hi.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _cbwallet_arbitrary(e){const n=e[0],r=e[1];if(typeof r!="string")throw new Error("parameter must be a string");if(typeof n!="object"||n===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(n,r)}}async _wallet_addEthereumChain(e){var n,r,i,s;const o=e[0];if(((n=o.rpcUrls)===null||n===void 0?void 0:n.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw Q.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Q.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(r=o.rpcUrls)!==null&&r!==void 0?r:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const n=e[0];return await this.switchEthereumChain(parseInt(n.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Q.standardErrors.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw Q.standardErrors.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw Q.standardErrors.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw Q.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=n.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(n.type,i,s,a,o,r)}}_eth_uninstallFilter(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(n)}async _eth_newFilter(e){const n=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(n)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(n)}_eth_getFilterLogs(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(n)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((n,r)=>this._setAddresses(n,r)),e.setChainCallback((n,r)=>{this.updateProviderInfo(r,parseInt(n,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}nn.CoinbaseWalletProvider=Kg;var Kr={},Xr={},er,j,nu,ru,At,ga,iu,rs,su,en={},ou=[],Xg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ei=Array.isArray;function lt(t,e){for(var n in e)t[n]=e[n];return t}function au(t){var e=t.parentNode;e&&e.removeChild(t)}function is(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?er.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return On(t,o,r,i,null)}function On(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++nu};return i==null&&j.vnode!=null&&j.vnode(s),s}function em(){return{current:null}}function tr(t){return t.children}function Ln(t,e){this.props=t,this.context=e}function Pn(t,e){if(e==null)return t.__?Pn(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Pn(t):null}function cu(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return cu(t)}}function ss(t){(!t.__d&&(t.__d=!0)&&At.push(t)&&!kr.__r++||ga!==j.debounceRendering)&&((ga=j.debounceRendering)||iu)(kr)}function kr(){var t,e,n,r,i,s,o,a,c;for(At.sort(rs);t=At.shift();)t.__d&&(e=At.length,r=void 0,i=void 0,s=void 0,a=(o=(n=t).__v).__e,(c=n.__P)&&(r=[],i=[],(s=lt({},o)).__v=o.__v+1,Vs(c,o,s,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,r,a??Pn(o),o.__h,i),du(r,o,i),o.__e!=a&&cu(o)),At.length>e&&At.sort(rs));kr.__r=0}function uu(t,e,n,r,i,s,o,a,c,l,h){var u,d,f,p,g,S,v,m,E,C=0,y=r&&r.__k||ou,T=y.length,F=T,K=e.length;for(n.__k=[],u=0;u<K;u++)(p=n.__k[u]=(p=e[u])==null||typeof p=="boolean"||typeof p=="function"?null:typeof p=="string"||typeof p=="number"||typeof p=="bigint"?On(null,p,null,null,p):ei(p)?On(tr,{children:p},null,null,null):p.__b>0?On(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null?(p.__=n,p.__b=n.__b+1,(m=tm(p,y,v=u+C,F))===-1?f=en:(f=y[m]||en,y[m]=void 0,F--),Vs(t,p,f,i,s,o,a,c,l,h),g=p.__e,(d=p.ref)&&f.ref!=d&&(f.ref&&Hs(f.ref,null,p),h.push(d,p.__c||g,p)),g!=null&&(S==null&&(S=g),(E=f===en||f.__v===null)?m==-1&&C--:m!==v&&(m===v+1?C++:m>v?F>K-v?C+=m-v:C--:C=m<v&&m==v-1?m-v:0),v=u+C,typeof p.type!="function"||m===v&&f.__k!==p.__k?typeof p.type=="function"||m===v&&!E?p.__d!==void 0?(c=p.__d,p.__d=void 0):c=g.nextSibling:c=fu(t,g,c):c=lu(p,c,t),typeof n.type=="function"&&(n.__d=c))):(f=y[u])&&f.key==null&&f.__e&&(f.__e==c&&(c=Pn(f)),os(f,f,!1));for(n.__e=S,u=T;u--;)y[u]!=null&&(typeof n.type=="function"&&y[u].__e!=null&&y[u].__e==n.__d&&(n.__d=y[u].__e.nextSibling),os(y[u],y[u]))}function lu(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?lu(r,e,n):fu(n,r.__e,e));return e}function hu(t,e){return e=e||[],t==null||typeof t=="boolean"||(ei(t)?t.some(function(n){hu(n,e)}):e.push(t)),e}function fu(t,e,n){return n==null||n.parentNode!==t?t.insertBefore(e,null):e==n&&e.parentNode!=null||t.insertBefore(e,n),e.nextSibling}function tm(t,e,n,r){var i=t.key,s=t.type,o=n-1,a=n+1,c=e[n];if(c===null||c&&i==c.key&&s===c.type)return n;if(r>(c!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((c=e[o])&&i==c.key&&s===c.type)return o;o--}if(a<e.length){if((c=e[a])&&i==c.key&&s===c.type)return a;a++}}return-1}function nm(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||xr(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||xr(t,s,e[s],n[s],r)}function ma(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Xg.test(e)?n:n+"px"}function xr(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ma(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ma(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?ya:va,s):t.removeEventListener(e,s?ya:va,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function va(t){return this.l[t.type+!1](j.event?j.event(t):t)}function ya(t){return this.l[t.type+!0](j.event?j.event(t):t)}function Vs(t,e,n,r,i,s,o,a,c,l){var h,u,d,f,p,g,S,v,m,E,C,y,T,F,K,L=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(h=j.__b)&&h(e);e:if(typeof L=="function")try{if(v=e.props,m=(h=L.contextType)&&r[h.__c],E=h?m?m.props.value:h.__:r,n.__c?S=(u=e.__c=n.__c).__=u.__E:("prototype"in L&&L.prototype.render?e.__c=u=new L(v,E):(e.__c=u=new Ln(v,E),u.constructor=L,u.render=im),m&&m.sub(u),u.props=v,u.state||(u.state={}),u.context=E,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),L.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=lt({},u.__s)),lt(u.__s,L.getDerivedStateFromProps(v,u.__s))),f=u.props,p=u.state,u.__v=e,d)L.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(L.getDerivedStateFromProps==null&&v!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(v,E),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(v,u.__s,E)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=v,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(v,u.__s,E),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,g)})}if(u.context=E,u.props=v,u.__P=t,u.__e=!1,y=j.__r,T=0,"prototype"in L&&L.prototype.render){for(u.state=u.__s,u.__d=!1,y&&y(e),h=u.render(u.props,u.state,u.context),F=0;F<u._sb.length;F++)u.__h.push(u._sb[F]);u._sb=[]}else do u.__d=!1,y&&y(e),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++T<25);u.state=u.__s,u.getChildContext!=null&&(r=lt(lt({},r),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(g=u.getSnapshotBeforeUpdate(f,p)),uu(t,ei(K=h!=null&&h.type===tr&&h.key==null?h.props.children:h)?K:[K],e,n,r,i,s,o,a,c,l),u.base=e.__e,e.__h=null,u.__h.length&&o.push(u),S&&(u.__E=u.__=null)}catch(V){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),j.__e(V,e,n)}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=rm(n.__e,e,n,r,i,s,o,c,l);(h=j.diffed)&&h(e)}function du(t,e,n){for(var r=0;r<n.length;r++)Hs(n[r],n[++r],n[++r]);j.__c&&j.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){j.__e(s,i.__v)}})}function rm(t,e,n,r,i,s,o,a,c){var l,h,u,d=n.props,f=e.props,p=e.type,g=0;if(p==="svg"&&(i=!0),s!=null){for(;g<s.length;g++)if((l=s[g])&&"setAttribute"in l==!!p&&(p?l.localName===p:l.nodeType===3)){t=l,s[g]=null;break}}if(t==null){if(p===null)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),s=null,a=!1}if(p===null)d===f||a&&t.data===f||(t.data=f);else{if(s=s&&er.call(t.childNodes),h=(d=n.props||en).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!a){if(s!=null)for(d={},g=0;g<t.attributes.length;g++)d[t.attributes[g].name]=t.attributes[g].value;(u||h)&&(u&&(h&&u.__html==h.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(nm(t,f,d,i,a),u)e.__k=[];else if(uu(t,ei(g=e.props.children)?g:[g],e,n,r,i&&p!=="foreignObject",s,o,s?s[0]:n.__k&&Pn(n,0),a,c),s!=null)for(g=s.length;g--;)s[g]!=null&&au(s[g]);a||("value"in f&&(g=f.value)!==void 0&&(g!==t.value||p==="progress"&&!g||p==="option"&&g!==d.value)&&xr(t,"value",g,d.value,!1),"checked"in f&&(g=f.checked)!==void 0&&g!==t.checked&&xr(t,"checked",g,d.checked,!1))}return t}function Hs(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){j.__e(r,n)}}function os(t,e,n){var r,i;if(j.unmount&&j.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Hs(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){j.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&os(r[i],e,n||typeof t.type!="function");n||t.__e==null||au(t.__e),t.__=t.__e=t.__d=void 0}function im(t,e,n){return this.constructor(t,n)}function pu(t,e,n){var r,i,s,o;j.__&&j.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],Vs(e,t=(!r&&n||e).__k=is(tr,null,[t]),i||en,en,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?er.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,o),du(s,t,o)}function bu(t,e){pu(t,e,bu)}function sm(t,e,n){var r,i,s,o,a=lt({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?er.call(arguments,2):n),On(t.type,a,r||t.key,i||t.ref,null)}function om(t,e){var n={__c:e="__cC"+su++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,ss(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}er=ou.slice,j={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},nu=0,ru=function(t){return t!=null&&t.constructor===void 0},Ln.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=lt({},this.state),typeof t=="function"&&(t=t(lt({},n),this.props)),t&&lt(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ss(this))},Ln.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ss(this))},Ln.prototype.render=tr,At=[],iu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rs=function(t,e){return t.__v.__b-e.__v.__b},kr.__r=0,su=0;const am=Object.freeze(Object.defineProperty({__proto__:null,Component:Ln,Fragment:tr,cloneElement:sm,createContext:om,createElement:is,createRef:em,h:is,hydrate:bu,get isValidElement(){return ru},get options(){return j},render:pu,toChildArray:hu},Symbol.toStringTag,{value:"Module"})),Oe=Hn(am);function cn(t){return typeof t=="function"}var wa=!1,je={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}wa=t},get useDeprecatedSynchronousErrorHandling(){return wa}};function Qt(t){setTimeout(function(){throw t},0)}var Rr={closed:!0,next:function(t){},error:function(t){if(je.useDeprecatedSynchronousErrorHandling)throw t;Qt(t)},complete:function(){}},Ce=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Ws(t){return t!==null&&typeof t=="object"}var cm=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
4
4
  `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
5
- `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),jn=cm,re=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,s=n._unsubscribe,o=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(r!==null)for(var a=0;a<r.length;++a){var c=r[a];c.remove(this)}if(cn(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(u){e=u instanceof jn?wa(u.errors):[u]}}if(Ce(o))for(var a=-1,l=o.length;++a<l;){var h=o[a];if(Hs(h))try{h.unsubscribe()}catch(f){e=e||[],f instanceof jn?e=e.concat(wa(f.errors)):e.push(f)}}if(e)throw new jn(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||typeof n.unsubscribe!="function")return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;n=new t,n._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(i===null)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return n;var s=this._subscriptions;return s===null?this._subscriptions=[n]:s.push(n),n},t.prototype.remove=function(e){var n=this._subscriptions;if(n){var r=n.indexOf(e);r!==-1&&n.splice(r,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function wa(t){return t.reduce(function(e,n){return e.concat(n instanceof jn?n.errors:n)},[])}var Mr=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),M=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=Rr;break;case 1:if(!n){s.destination=Rr;break}if(typeof n=="object"){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new _a(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new _a(s,n,r,i);break}return s}return e.prototype[Mr]=function(){return this},e.create=function(n,r,i){var s=new e(n,r,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var n=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=n,this},e}(re),_a=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this)||this;o._parentSubscriber=n;var a,c=o;return cn(r)?a=r:r&&(a=r.next,i=r.error,s=r.complete,r!==Rr&&(c=Object.create(r),cn(c.unsubscribe)&&o.add(c.unsubscribe.bind(c)),c.unsubscribe=o.unsubscribe.bind(o))),o._context=c,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(n){if(!this.isStopped&&this._next){var r=this._parentSubscriber;!je.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?this.__tryOrUnsub(this._next,n):this.__tryOrSetError(r,this._next,n)&&this.unsubscribe()}},e.prototype.error=function(n){if(!this.isStopped){var r=this._parentSubscriber,i=je.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!r.syncErrorThrowable?(this.__tryOrUnsub(this._error,n),this.unsubscribe()):(this.__tryOrSetError(r,this._error,n),this.unsubscribe());else if(r.syncErrorThrowable)i?(r.syncErrorValue=n,r.syncErrorThrown=!0):Qt(n),this.unsubscribe();else{if(this.unsubscribe(),i)throw n;Qt(n)}}},e.prototype.complete=function(){var n=this;if(!this.isStopped){var r=this._parentSubscriber;if(this._complete){var i=function(){return n._complete.call(n._context)};!je.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(r,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(n,r){try{n.call(this._context,r)}catch(i){if(this.unsubscribe(),je.useDeprecatedSynchronousErrorHandling)throw i;Qt(i)}},e.prototype.__tryOrSetError=function(n,r,i){if(!je.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,i)}catch(s){return je.useDeprecatedSynchronousErrorHandling?(n.syncErrorValue=s,n.syncErrorThrown=!0,!0):(Qt(s),!0)}return!1},e.prototype._unsubscribe=function(){var n=this._parentSubscriber;this._context=null,this._parentSubscriber=null,n.unsubscribe()},e}(M);function Ws(t){for(;t;){var e=t,n=e.closed,r=e.destination,i=e.isStopped;if(n||i)return!1;r&&r instanceof M?t=r:t=null}return!0}function um(t,e,n){if(t){if(t instanceof M)return t;if(t[Mr])return t[Mr]()}return!t&&!e&&!n?new M(Rr):new M(t,e,n)}var wn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function os(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return gu(t)}function gu(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var P=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this.operator,s=um(e,n,r);if(i?s.add(i.call(s,this.source)):s.add(this.source||je.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),je.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){je.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),Ws(e)?e.error(n):console.warn(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Sa(n),new n(function(i,s){var o;o=r.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},t.prototype[wn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length===0?this:gu(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Sa(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t}();function Sa(t){if(t||(t=je.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var lm=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),yt=lm,mu=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.subject=n,i.subscriber=r,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var n=this.subject,r=n.observers;if(this.subject=null,!(!r||r.length===0||n.isStopped||n.closed)){var i=r.indexOf(this.subscriber);i!==-1&&r.splice(i,1)}}},e}(re),vu=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.destination=n,r}return e}(M),ge=function(t){b(e,t);function e(){var n=t.call(this)||this;return n.observers=[],n.closed=!1,n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype[Mr]=function(){return new vu(this)},e.prototype.lift=function(n){var r=new Ea(this,this);return r.operator=n,r},e.prototype.next=function(n){if(this.closed)throw new yt;if(!this.isStopped)for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].next(n)},e.prototype.error=function(n){if(this.closed)throw new yt;this.hasError=!0,this.thrownError=n,this.isStopped=!0;for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].error(n);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new yt;this.isStopped=!0;for(var n=this.observers,r=n.length,i=n.slice(),s=0;s<r;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(n){if(this.closed)throw new yt;return t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){if(this.closed)throw new yt;return this.hasError?(n.error(this.thrownError),re.EMPTY):this.isStopped?(n.complete(),re.EMPTY):(this.observers.push(n),new mu(this,n))},e.prototype.asObservable=function(){var n=new P;return n.source=this,n},e.create=function(n,r){return new Ea(n,r)},e}(P),Ea=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r=this.destination;r&&r.next&&r.next(n)},e.prototype.error=function(n){var r=this.destination;r&&r.error&&this.destination.error(n)},e.prototype.complete=function(){var n=this.destination;n&&n.complete&&this.destination.complete()},e.prototype._subscribe=function(n){var r=this.source;return r?this.source.subscribe(n):re.EMPTY},e}(ge);function Us(){return function(e){return e.lift(new hm(e))}}var hm=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,n){var r=this.connectable;r._refCount++;var i=new fm(e,r),s=n.subscribe(i);return i.closed||(i.connection=r.connect()),s},t}(),fm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._unsubscribe=function(){var n=this.connectable;if(!n){this.connection=null;return}this.connectable=null;var r=n._refCount;if(r<=0){this.connection=null;return}if(n._refCount=r-1,r>1){this.connection=null;return}var i=this.connection,s=n._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(M),yu=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(n){return this.getSubject().subscribe(n)},e.prototype.getSubject=function(){var n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var n=this._connection;return n||(this._isComplete=!1,n=this._connection=new re,n.add(this.source.subscribe(new pm(this.getSubject(),this))),n.closed&&(this._connection=null,n=re.EMPTY)),n},e.prototype.refCount=function(){return Us()(this)},e}(P),dm=function(){var t=yu.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),pm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._error=function(n){this._unsubscribe(),t.prototype._error.call(this,n)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.connectable;if(n){this.connectable=null;var r=n._connection;n._refCount=0,n._subject=null,n._connection=null,r&&r.unsubscribe()}},e}(vu);function bm(t,e,n,r){return function(i){return i.lift(new gm(t,e,n,r))}}var gm=function(){function t(e,n,r,i){this.keySelector=e,this.elementSelector=n,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(e,n){return n.subscribe(new mm(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),mm=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.keySelector=r,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(n){var r;try{r=this.keySelector(n)}catch(i){this.error(i);return}this._group(n,r)},e.prototype._group=function(n,r){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(r),o;if(this.elementSelector)try{o=this.elementSelector(n)}catch(l){this.error(l)}else o=n;if(!s){s=this.subjectSelector?this.subjectSelector():new ge,i.set(r,s);var a=new as(r,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new as(r,s))}catch(l){this.error(l);return}this.add(c.subscribe(new vm(r,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(n){var r=this.groups;r&&(r.forEach(function(i,s){i.error(n)}),r.clear()),this.destination.error(n)},e.prototype._complete=function(){var n=this.groups;n&&(n.forEach(function(r,i){r.complete()}),n.clear()),this.destination.complete()},e.prototype.removeGroup=function(n){this.groups.delete(n)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(M),vm=function(t){b(e,t);function e(n,r,i){var s=t.call(this,r)||this;return s.key=n,s.group=r,s.parent=i,s}return e.prototype._next=function(n){this.complete()},e.prototype._unsubscribe=function(){var n=this,r=n.parent,i=n.key;this.key=this.parent=null,r&&r.removeGroup(i)},e}(M),as=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;return s.key=n,s.groupSubject=r,s.refCountSubscription=i,s}return e.prototype._subscribe=function(n){var r=new re,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&r.add(new ym(s)),r.add(o.subscribe(n)),r},e}(P),ym=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,n.count++,r}return e.prototype.unsubscribe=function(){var n=this.parent;!n.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),n.count-=1,n.count===0&&n.attemptedToUnsubscribe&&n.unsubscribe())},e}(re),wu=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return r&&!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new yt;return this._value},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(ge),wm=function(t){b(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(re),tr=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),this.closed)return this;this.state=n;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=this.id||this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return r;clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s=void 0;try{this.work(n)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var n=this.id,r=this.scheduler,i=r.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null},e}(wm),_m=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.schedule=function(n,r){return r===void 0&&(r=0),r>0?t.prototype.schedule.call(this,n,r):(this.delay=r,this.state=n,this.scheduler.flush(this),this)},e.prototype.execute=function(n,r){return r>0||this.closed?t.prototype.execute.call(this,n,r):this._execute(n,r)},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,n,r,i):n.flush(this)},e}(tr),cs=function(){function t(e,n){n===void 0&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.SchedulerAction(this,e).schedule(r,n)},t.now=function(){return Date.now()},t}(),nr=function(t){b(e,t);function e(n,r){r===void 0&&(r=cs.now);var i=t.call(this,n,function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(n,r,i){return r===void 0&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(n){var r=this.actions;if(this.active){r.push(n);return}var i;this.active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this.active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(cs),Sm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(nr),_u=new Sm(_m),Su=_u,un=new P(function(t){return t.complete()});function _n(t){return t?Em(t):un}function Em(t){return new P(function(e){return t.schedule(function(){return e.complete()})})}function Ne(t){return t&&typeof t.schedule=="function"}var Eu=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function zs(t,e){return new P(function(n){var r=new re,i=0;return r.add(e.schedule(function(){if(i===t.length){n.complete();return}n.next(t[i++]),n.closed||r.add(this.schedule())})),r})}function rr(t,e){return e?zs(t,e):new P(Eu(t))}function ti(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Ne(n)?(t.pop(),zs(t,n)):rr(t)}function Gs(t,e){return e?new P(function(n){return e.schedule(Cm,0,{error:t,subscriber:n})}):new P(function(n){return n.error(t)})}function Cm(t){var e=t.error,n=t.subscriber;n.error(e)}var us;us||(us={});var ht=function(){function t(e,n,r){this.kind=e,this.value=n,this.error=r,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,n,r){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return n&&n(this.error);case"C":return r&&r()}},t.prototype.accept=function(e,n,r){return e&&typeof e.next=="function"?this.observe(e):this.do(e,n,r)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return ti(this.value);case"E":return Gs(this.error);case"C":return _n()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function Im(t,e){return e===void 0&&(e=0),function(r){return r.lift(new xm(t,e))}}var xm=function(){function t(e,n){n===void 0&&(n=0),this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return n.subscribe(new Cu(e,this.scheduler,this.delay))},t}(),Cu=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=0);var s=t.call(this,n)||this;return s.scheduler=r,s.delay=i,s}return e.dispatch=function(n){var r=n.notification,i=n.destination;r.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(n){var r=this.destination;r.add(this.scheduler.schedule(e.dispatch,this.delay,new km(n,this.destination)))},e.prototype._next=function(n){this.scheduleMessage(ht.createNext(n))},e.prototype._error=function(n){this.scheduleMessage(ht.createError(n)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(ht.createComplete()),this.unsubscribe()},e}(M),km=function(){function t(e,n){this.notification=e,this.destination=n}return t}(),qs=function(t){b(e,t);function e(n,r,i){n===void 0&&(n=Number.POSITIVE_INFINITY),r===void 0&&(r=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=n<1?1:n,s._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(n){if(!this.isStopped){var r=this._events;r.push(n),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,n)},e.prototype.nextTimeWindow=function(n){this.isStopped||(this._events.push(new Rm(this._getNow(),n)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){var r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new yt;if(this.isStopped||this.hasError?a=re.EMPTY:(this.observers.push(n),a=new mu(this,n)),s&&n.add(n=new Cu(n,s)),r)for(var c=0;c<o&&!n.closed;c++)n.next(i[c]);else for(var c=0;c<o&&!n.closed;c++)n.next(i[c].value);return this.hasError?n.error(this.thrownError):this.isStopped&&n.complete(),a},e.prototype._getNow=function(){return(this.scheduler||Su).now()},e.prototype._trimBufferThenGetEvents=function(){for(var n=this._getNow(),r=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(n-s[a].time<i);)a++;return o>r&&(a=Math.max(a,o-r)),a>0&&s.splice(0,a),s},e}(ge),Rm=function(){function t(e,n){this.time=e,this.value=n}return t}(),Sn=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.value=null,n.hasNext=!1,n.hasCompleted=!1,n}return e.prototype._subscribe=function(n){return this.hasError?(n.error(this.thrownError),re.EMPTY):this.hasCompleted&&this.hasNext?(n.next(this.value),n.complete(),re.EMPTY):t.prototype._subscribe.call(this,n)},e.prototype.next=function(n){this.hasCompleted||(this.value=n,this.hasNext=!0)},e.prototype.error=function(n){this.hasCompleted||t.prototype.error.call(this,n)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(ge),Mm=1,Tm=function(){return Promise.resolve()}(),ls={};function Ca(t){return t in ls?(delete ls[t],!0):!1}var Ia={setImmediate:function(t){var e=Mm++;return ls[e]=!0,Tm.then(function(){return Ca(e)&&t()}),e},clearImmediate:function(t){Ca(t)}},Am=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=Ia.setImmediate(n.flush.bind(n,null))))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&(Ia.clearImmediate(r),n.scheduled=void 0)},e}(tr),Nm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(nr),Iu=new Nm(Am),wr=Iu,xu=new nr(tr),Ie=xu,Om=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=requestAnimationFrame(function(){return n.flush(null)})))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&(cancelAnimationFrame(r),n.scheduled=void 0)},e}(tr),Lm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(nr),ku=new Lm(Om),jm=ku,$m=function(t){b(e,t);function e(n,r){n===void 0&&(n=Ru),r===void 0&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,n,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var n=this,r=n.actions,i=n.maxFrames,s,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=r.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(nr),Ru=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=n.index+=1);var s=t.call(this,n,r)||this;return s.scheduler=n,s.work=r,s.index=i,s.active=!0,s.index=n.index=i,s}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(n,r,i){i===void 0&&(i=0),this.delay=n.frame+i;var s=n.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(n,r,i){},e.prototype._execute=function(n,r){if(this.active===!0)return t.prototype._execute.call(this,n,r)},e.sortActions=function(n,r){return n.delay===r.delay?n.index===r.index?0:n.index>r.index?1:-1:n.delay>r.delay?1:-1},e}(tr);function et(){}function Dm(t){return!!t&&(t instanceof P||typeof t.lift=="function"&&typeof t.subscribe=="function")}var Pm=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),ln=Pm,Fm=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),ir=Fm,Bm=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),Mu=Bm;function Be(t,e){return function(r){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Vm(t,e))}}var Vm=function(){function t(e,n){this.project=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new Hm(e,this.project,this.thisArg))},t}(),Hm=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.project=r,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(n){var r;try{r=this.project.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(M);function Tu(t,e,n){if(e)if(Ne(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Tu(t,n).apply(void 0,r).pipe(Be(function(s){return Ce(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:n};return new P(function(c){if(n){var h={args:r,subscriber:c,params:a};return n.schedule(Wm,0,h)}else{if(!o){o=new Sn;var l=function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];o.next(u.length<=1?u[0]:u),o.complete()};try{t.apply(s,r.concat([l]))}catch(u){Ws(o)?o.error(u):console.warn(u)}}return o.subscribe(c)}})}}function Wm(t){var e=this,n=t.args,r=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var f=h.length<=1?h[0]:h;e.add(a.schedule(Um,0,{value:f,subject:c}))};try{s.apply(o,n.concat([l]))}catch(h){c.error(h)}}this.add(c.subscribe(r))}function Um(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Au(t,e,n){if(e)if(Ne(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Au(t,n).apply(void 0,r).pipe(Be(function(s){return Ce(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s={subject:void 0,args:r,callbackFunc:t,scheduler:n,context:this};return new P(function(o){var a=s.context,c=s.subject;if(n)return n.schedule(zm,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var f=h.shift();if(f){c.error(f);return}c.next(h.length<=1?h[0]:h),c.complete()};try{t.apply(a,r.concat([l]))}catch(h){Ws(c)?c.error(h):console.warn(h)}}return c.subscribe(o)})}}function zm(t){var e=this,n=t.params,r=t.subscriber,i=t.context,s=n.callbackFunc,o=n.args,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var f=h.shift();if(f)e.add(a.schedule(xa,0,{err:f,subject:c}));else{var d=h.length<=1?h[0]:h;e.add(a.schedule(Gm,0,{value:d,subject:c}))}};try{s.apply(i,o.concat([l]))}catch(h){this.add(a.schedule(xa,0,{err:h,subject:c}))}}this.add(c.subscribe(r))}function Gm(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function xa(t){var e=t.err,n=t.subject;n.error(e)}var Vt=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(r)},e.prototype.notifyError=function(n,r){this.destination.error(n)},e.prototype.notifyComplete=function(n){this.destination.complete()},e}(M),qm=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;return s.parent=n,s.outerValue=r,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(n){this.parent.notifyNext(this.outerValue,n,this.outerIndex,this.index++,this)},e.prototype._error=function(n){this.parent.notifyError(n,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(M),Jm=function(t){return function(e){return t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Qt),e}};function Qm(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var St=Qm(),Zm=function(t){return function(e){var n=t[St]();do{var r=void 0;try{r=n.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}while(!0);return typeof n.return=="function"&&e.add(function(){n.return&&n.return()}),e}},Ym=function(t){return function(e){var n=t[wn]();if(typeof n.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},Nu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Ou(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Pn=function(t){if(t&&typeof t[wn]=="function")return Ym(t);if(Nu(t))return Eu(t);if(Ou(t))return Jm(t);if(t&&typeof t[St]=="function")return Zm(t);var e=Hs(t)?"an invalid object":"'"+t+"'",n="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(n)};function ft(t,e,n,r,i){if(i===void 0&&(i=new qm(t,n,r)),!i.closed)return e instanceof P?e.subscribe(i):Pn(e)(i)}var ka={};function Km(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return Ne(t[t.length-1])&&(r=t.pop()),typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Ce(t[0])&&(t=t[0]),rr(t,r).lift(new Js(n))}var Js=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Xm(e,this.resultSelector))},t}(),Xm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(n){this.values.push(ka),this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{this.active=r,this.toRespond=r;for(var i=0;i<r;i++){var s=n[i];this.add(ft(this,s,void 0,i))}}},e.prototype.notifyComplete=function(n){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(n,r,i){var s=this.values,o=s[i],a=this.toRespond?o===ka?--this.toRespond:this.toRespond:0;s[i]=r,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Vt);function ev(t,e){return new P(function(n){var r=new re;return r.add(e.schedule(function(){var i=t[wn]();r.add(i.subscribe({next:function(s){r.add(e.schedule(function(){return n.next(s)}))},error:function(s){r.add(e.schedule(function(){return n.error(s)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}function tv(t,e){return new P(function(n){var r=new re;return r.add(e.schedule(function(){return t.then(function(i){r.add(e.schedule(function(){n.next(i),r.add(e.schedule(function(){return n.complete()}))}))},function(i){r.add(e.schedule(function(){return n.error(i)}))})})),r})}function nv(t,e){if(!t)throw new Error("Iterable cannot be null");return new P(function(n){var r=new re,i;return r.add(function(){i&&typeof i.return=="function"&&i.return()}),r.add(e.schedule(function(){i=t[St](),r.add(e.schedule(function(){if(!n.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){n.error(c);return}o?n.complete():(n.next(s),this.schedule())}}))})),r})}function rv(t){return t&&typeof t[wn]=="function"}function iv(t){return t&&typeof t[St]=="function"}function Lu(t,e){if(t!=null){if(rv(t))return ev(t,e);if(Ou(t))return tv(t,e);if(Nu(t))return zs(t,e);if(iv(t)||typeof t=="string")return nv(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function pt(t,e){return e?Lu(t,e):t instanceof P?t:new P(Pn(t))}var ie=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,r}return e.prototype._next=function(n){this.parent.notifyNext(n)},e.prototype._error=function(n){this.parent.notifyError(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(M),se=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(M);function oe(t,e){if(!e.closed){if(t instanceof P)return t.subscribe(e);var n;try{n=Pn(t)(e)}catch(r){e.error(r)}return n}}function $t(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?function(r){return r.pipe($t(function(i,s){return pt(t(i,s)).pipe(Be(function(o,a){return e(i,o,s,a)}))},n))}:(typeof e=="number"&&(n=e),function(r){return r.lift(new sv(t,n))})}var sv=function(){function t(e,n){n===void 0&&(n=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=n}return t.prototype.call=function(e,n){return n.subscribe(new ov(e,this.project,this.concurrent))},t}(),ov=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,n)||this;return s.project=r,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(n){this.active<this.concurrent?this._tryNext(n):this.buffer.push(n)},e.prototype._tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(se),av=$t;function Qs(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),$t(_t,t)}function ju(){return Qs(1)}function Fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ju()(ti.apply(void 0,t))}function Zs(t){return new P(function(e){var n;try{n=t()}catch(i){e.error(i);return}var r=n?pt(n):_n();return r.subscribe(e)})}function cv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var n=t[0];if(Ce(n))return pr(n,null);if(Hs(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return pr(r.map(function(s){return n[s]}),r)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&Ce(t[0])?t[0]:t,pr(t,null).pipe(Be(function(s){return i.apply(void 0,s)}))}return pr(t,null)}function pr(t,e){return new P(function(n){var r=t.length;if(r===0){n.complete();return}for(var i=new Array(r),s=0,o=0,a=function(l){var h=pt(t[l]),u=!1;n.add(h.subscribe({next:function(f){u||(u=!0,o++),i[l]=f},error:function(f){return n.error(f)},complete:function(){s++,(s===r||!u)&&(o===r&&n.next(e?e.reduce(function(f,d,p){return f[d]=i[p],f},{}):i),n.complete())}}))},c=0;c<r;c++)a(c)})}function $u(t,e,n,r){return cn(n)&&(r=n,n=void 0),r?$u(t,e,n).pipe(Be(function(i){return Ce(i)?r.apply(void 0,i):r(i)})):new P(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Du(t,e,s,i,n)})}function Du(t,e,n,r,i){var s;if(hv(t)){var o=t;t.addEventListener(e,n,i),s=function(){return o.removeEventListener(e,n,i)}}else if(lv(t)){var a=t;t.on(e,n),s=function(){return a.off(e,n)}}else if(uv(t)){var c=t;t.addListener(e,n),s=function(){return c.removeListener(e,n)}}else if(t&&t.length)for(var l=0,h=t.length;l<h;l++)Du(t[l],e,n,r,i);else throw new TypeError("Invalid event target");r.add(s)}function uv(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function lv(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function hv(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function Pu(t,e,n){return n?Pu(t,e).pipe(Be(function(r){return Ce(r)?n.apply(void 0,r):n(r)})):new P(function(r){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return r.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){r.error(o);return}if(cn(e))return function(){return e(i,s)}})}function fv(t,e,n,r,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,n=a.iterate,s=a.resultSelector||_t,i=a.scheduler}else r===void 0||Ne(r)?(o=t,s=_t,i=r):(o=t,s=r);return new P(function(c){var l=o;if(i)return i.schedule(dv,0,{subscriber:c,iterate:n,condition:e,resultSelector:s,state:l});do{if(e){var h=void 0;try{h=e(l)}catch(f){c.error(f);return}if(!h){c.complete();break}}var u=void 0;try{u=s(l)}catch(f){c.error(f);return}if(c.next(u),c.closed)break;try{l=n(l)}catch(f){c.error(f);return}}while(!0)})}function dv(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(s){e.error(s);return}if(!r){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function pv(t,e,n){return e===void 0&&(e=un),n===void 0&&(n=un),Zs(function(){return t()?e:n})}function hn(t){return!Ce(t)&&t-parseFloat(t)+1>=0}function bv(t,e){return t===void 0&&(t=0),e===void 0&&(e=Ie),(!hn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Ie),new P(function(n){return n.add(e.schedule(gv,t,{subscriber:n,counter:0,period:t})),n})}function gv(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Fu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return Ne(i)?(r=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(n=t.pop())):typeof i=="number"&&(n=t.pop()),r===null&&t.length===1&&t[0]instanceof P?t[0]:Qs(n)(rr(t,r))}var Bu=new P(et);function mv(){return Bu}function hs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return un;var n=t[0],r=t.slice(1);return t.length===1&&Ce(n)?hs.apply(void 0,n):new P(function(i){var s=function(){return i.add(hs.apply(void 0,r).subscribe(i))};return pt(n).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function vv(t,e){return e?new P(function(n){var r=Object.keys(t),i=new re;return i.add(e.schedule(yv,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i}):new P(function(n){for(var r=Object.keys(t),i=0;i<r.length&&!n.closed;i++){var s=r[i];t.hasOwnProperty(s)&&n.next([s,t[s]])}n.complete()})}function yv(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,s=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,s[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:s}))}else r.complete()}function Vu(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function Et(t,e){return function(r){return r.lift(new wv(t,e))}}var wv=function(){function t(e,n){this.predicate=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new _v(e,this.predicate,this.thisArg))},t}(),_v=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.thisArg=i,s.count=0,s}return e.prototype._next=function(n){var r;try{r=this.predicate.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}r&&this.destination.next(n)},e}(M);function Sv(t,e,n){return[Et(e,n)(new P(Pn(t))),Et(Vu(e,n))(new P(Pn(t)))]}function Hu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(Ce(t[0]))t=t[0];else return t[0];return rr(t,void 0).lift(new Ev)}var Ev=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Cv(e))},t}(),Cv=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return e.prototype._next=function(n){this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{for(var i=0;i<r&&!this.hasFirst;i++){var s=n[i],o=ft(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(r)},e}(Vt);function Iv(t,e,n){return t===void 0&&(t=0),new P(function(r){e===void 0&&(e=t,t=0);var i=0,s=t;if(n)return n.schedule(xv,0,{index:i,count:e,start:t,subscriber:r});do{if(i++>=e){r.complete();break}if(r.next(s++),r.closed)break}while(!0)})}function xv(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;if(n>=r){i.complete();return}i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t))}function Wu(t,e,n){t===void 0&&(t=0);var r=-1;return hn(e)?r=Number(e)<1&&1||Number(e):Ne(e)&&(n=e),Ne(n)||(n=Ie),new P(function(i){var s=hn(t)?t:+t-n.now();return n.schedule(kv,s,{index:0,period:r,subscriber:i})})}function kv(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(n===-1)return r.complete();t.index=e+1,this.schedule(t,n)}}function Rv(t,e){return new P(function(n){var r;try{r=t()}catch(a){n.error(a);return}var i;try{i=e(r)}catch(a){n.error(a);return}var s=i?pt(i):un,o=s.subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}})}function Uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return typeof n=="function"&&t.pop(),rr(t,void 0).lift(new zu(n))}var zu=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Mv(e,this.resultSelector))},t}(),Mv=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.resultSelector=r,s.iterators=[],s.active=0,s.resultSelector=typeof r=="function"?r:void 0,s}return e.prototype._next=function(n){var r=this.iterators;Ce(n)?r.push(new Av(n)):typeof n[St]=="function"?r.push(new Tv(n[St]())):r.push(new Nv(this.destination,this,n))},e.prototype._complete=function(){var n=this.iterators,r=n.length;if(this.unsubscribe(),r===0){this.destination.complete();return}this.active=r;for(var i=0;i<r;i++){var s=n[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var n=this.iterators,r=n.length,i=this.destination,s=0;s<r;s++){var o=n[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<r;s++){var o=n[s],l=o.next();if(o.hasCompleted()&&(a=!0),l.done){i.complete();return}c.push(l.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(M),Tv=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),Av=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[St]=function(){return this},t.prototype.next=function(e){var n=this.index++,r=this.array;return n<this.length?{value:r[n],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Nv=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.parent=r,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[St]=function(){return this},e.prototype.next=function(){var n=this.buffer;return n.length===0&&this.isComplete?{value:null,done:!0}:{value:n.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(n){this.buffer.push(n),this.parent.checkIterators()},e.prototype.subscribe=function(){return oe(this.observable,new ie(this))},e}(se);const Ov=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:ln,AsyncSubject:Sn,BehaviorSubject:wu,ConnectableObservable:yu,EMPTY:un,EmptyError:ir,GroupedObservable:as,NEVER:Bu,Notification:ht,get NotificationKind(){return us},ObjectUnsubscribedError:yt,Observable:P,ReplaySubject:qs,Scheduler:cs,Subject:ge,Subscriber:M,Subscription:re,TimeoutError:Mu,UnsubscriptionError:jn,VirtualAction:Ru,VirtualTimeScheduler:$m,animationFrame:jm,animationFrameScheduler:ku,asap:wr,asapScheduler:Iu,async:Ie,asyncScheduler:xu,bindCallback:Tu,bindNodeCallback:Au,combineLatest:Km,concat:Fn,config:je,defer:Zs,empty:_n,forkJoin:cv,from:pt,fromEvent:$u,fromEventPattern:Pu,generate:fv,identity:_t,iif:pv,interval:bv,isObservable:Dm,merge:Fu,never:mv,noop:et,observable:wn,of:ti,onErrorResumeNext:hs,pairs:vv,partition:Sv,pipe:os,queue:Su,queueScheduler:_u,race:Hu,range:Iv,scheduled:Lu,throwError:Gs,timer:Wu,using:Rv,zip:Uu},Symbol.toStringTag,{value:"Module"})),ni=Vn(Ov);var ri={},dt,Z,Wi,Ra,fn=0,Gu=[],_r=[],Ma=j.__b,Ta=j.__r,Aa=j.diffed,Na=j.__c,Oa=j.unmount;function Ht(t,e){j.__h&&j.__h(Z,t,fn||e),fn=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:_r}),n.__[t]}function qu(t){return fn=1,Ju(Zu,t)}function Ju(t,e,n){var r=Ht(dt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Zu(void 0,e),function(a){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,a);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.u)){var i=function(a,c,l){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(f){return f.__c});if(h.every(function(f){return!f.__N}))return!s||s.call(this,a,c,l);var u=!1;return h.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(u=!0)}}),!(!u&&r.__c.props===a)&&(!s||s.call(this,a,c,l))};Z.u=!0;var s=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(a,c,l){if(this.__e){var h=s;s=void 0,i(a,c,l),s=h}o&&o.call(this,a,c,l)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Lv(t,e){var n=Ht(dt++,3);!j.__s&&Ks(n.__H,e)&&(n.__=t,n.i=e,Z.__H.__h.push(n))}function Qu(t,e){var n=Ht(dt++,4);!j.__s&&Ks(n.__H,e)&&(n.__=t,n.i=e,Z.__h.push(n))}function jv(t){return fn=5,Ys(function(){return{current:t}},[])}function $v(t,e,n){fn=6,Qu(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function Ys(t,e){var n=Ht(dt++,7);return Ks(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Dv(t,e){return fn=8,Ys(function(){return t},e)}function Pv(t){var e=Z.context[t.__c],n=Ht(dt++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(Z)),e.props.value):t.__}function Fv(t,e){j.useDebugValue&&j.useDebugValue(e?e(t):t)}function Bv(t){var e=Ht(dt++,10),n=qu();return e.__=t,Z.componentDidCatch||(Z.componentDidCatch=function(r,i){e.__&&e.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Vv(){var t=Ht(dt++,11);if(!t.__){for(var e=Z.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function Hv(){for(var t;t=Gu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Sr),t.__H.__h.forEach(fs),t.__H.__h=[]}catch(e){t.__H.__h=[],j.__e(e,t.__v)}}j.__b=function(t){Z=null,Ma&&Ma(t)},j.__r=function(t){Ta&&Ta(t),dt=0;var e=(Z=t.__c).__H;e&&(Wi===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=_r,n.__N=n.i=void 0})):(e.__h.forEach(Sr),e.__h.forEach(fs),e.__h=[],dt=0)),Wi=Z},j.diffed=function(t){Aa&&Aa(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Gu.push(e)!==1&&Ra===j.requestAnimationFrame||((Ra=j.requestAnimationFrame)||Wv)(Hv)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==_r&&(n.__=n.__V),n.i=void 0,n.__V=_r})),Wi=Z=null},j.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Sr),n.__h=n.__h.filter(function(r){return!r.__||fs(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],j.__e(r,n.__v)}}),Na&&Na(t,e)},j.unmount=function(t){Oa&&Oa(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Sr(r)}catch(i){e=i}}),n.__H=void 0,e&&j.__e(e,n.__v))};var La=typeof requestAnimationFrame=="function";function Wv(t){var e,n=function(){clearTimeout(r),La&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);La&&(e=requestAnimationFrame(n))}function Sr(t){var e=Z,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Z=e}function fs(t){var e=Z;t.__c=t.__(),Z=e}function Ks(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Zu(t,e){return typeof e=="function"?e(t):e}const Uv=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Dv,useContext:Pv,useDebugValue:Fv,useEffect:Lv,useErrorBoundary:Bv,useId:Vv,useImperativeHandle:$v,useLayoutEffect:Qu,useMemo:Ys,useReducer:Ju,useRef:jv,useState:qu},Symbol.toStringTag,{value:"Module"})),sr=Vn(Uv);var it={},ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.CloseIcon=void 0;const ja=Oe;function zv(t){return(0,ja.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,ja.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}ii.CloseIcon=zv;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var si={};Object.defineProperty(si,"__esModule",{value:!0});si.QRCodeIcon=void 0;const Ye=Oe;function Gv(t){return(0,Ye.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ye.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ye.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ye.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ye.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ye.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ye.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ye.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ye.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ye.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}si.QRCodeIcon=Gv;var to={};Object.defineProperty(to,"__esModule",{value:!0});const qv=`
5
+ `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),jn=cm,re=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,s=n._unsubscribe,o=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(r!==null)for(var a=0;a<r.length;++a){var c=r[a];c.remove(this)}if(cn(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(u){e=u instanceof jn?_a(u.errors):[u]}}if(Ce(o))for(var a=-1,l=o.length;++a<l;){var h=o[a];if(Ws(h))try{h.unsubscribe()}catch(d){e=e||[],d instanceof jn?e=e.concat(_a(d.errors)):e.push(d)}}if(e)throw new jn(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||typeof n.unsubscribe!="function")return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;n=new t,n._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(i===null)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return n;var s=this._subscriptions;return s===null?this._subscriptions=[n]:s.push(n),n},t.prototype.remove=function(e){var n=this._subscriptions;if(n){var r=n.indexOf(e);r!==-1&&n.splice(r,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function _a(t){return t.reduce(function(e,n){return e.concat(n instanceof jn?n.errors:n)},[])}var Mr=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),R=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=Rr;break;case 1:if(!n){s.destination=Rr;break}if(typeof n=="object"){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new Sa(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new Sa(s,n,r,i);break}return s}return e.prototype[Mr]=function(){return this},e.create=function(n,r,i){var s=new e(n,r,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var n=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=n,this},e}(re),Sa=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this)||this;o._parentSubscriber=n;var a,c=o;return cn(r)?a=r:r&&(a=r.next,i=r.error,s=r.complete,r!==Rr&&(c=Object.create(r),cn(c.unsubscribe)&&o.add(c.unsubscribe.bind(c)),c.unsubscribe=o.unsubscribe.bind(o))),o._context=c,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(n){if(!this.isStopped&&this._next){var r=this._parentSubscriber;!je.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?this.__tryOrUnsub(this._next,n):this.__tryOrSetError(r,this._next,n)&&this.unsubscribe()}},e.prototype.error=function(n){if(!this.isStopped){var r=this._parentSubscriber,i=je.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!r.syncErrorThrowable?(this.__tryOrUnsub(this._error,n),this.unsubscribe()):(this.__tryOrSetError(r,this._error,n),this.unsubscribe());else if(r.syncErrorThrowable)i?(r.syncErrorValue=n,r.syncErrorThrown=!0):Qt(n),this.unsubscribe();else{if(this.unsubscribe(),i)throw n;Qt(n)}}},e.prototype.complete=function(){var n=this;if(!this.isStopped){var r=this._parentSubscriber;if(this._complete){var i=function(){return n._complete.call(n._context)};!je.useDeprecatedSynchronousErrorHandling||!r.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(r,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(n,r){try{n.call(this._context,r)}catch(i){if(this.unsubscribe(),je.useDeprecatedSynchronousErrorHandling)throw i;Qt(i)}},e.prototype.__tryOrSetError=function(n,r,i){if(!je.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,i)}catch(s){return je.useDeprecatedSynchronousErrorHandling?(n.syncErrorValue=s,n.syncErrorThrown=!0,!0):(Qt(s),!0)}return!1},e.prototype._unsubscribe=function(){var n=this._parentSubscriber;this._context=null,this._parentSubscriber=null,n.unsubscribe()},e}(R);function Us(t){for(;t;){var e=t,n=e.closed,r=e.destination,i=e.isStopped;if(n||i)return!1;r&&r instanceof R?t=r:t=null}return!0}function um(t,e,n){if(t){if(t instanceof R)return t;if(t[Mr])return t[Mr]()}return!t&&!e&&!n?new R(Rr):new R(t,e,n)}var wn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function as(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return gu(t)}function gu(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var P=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this.operator,s=um(e,n,r);if(i?s.add(i.call(s,this.source)):s.add(this.source||je.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),je.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){je.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=n),Us(e)?e.error(n):console.warn(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Ea(n),new n(function(i,s){var o;o=r.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var n=this.source;return n&&n.subscribe(e)},t.prototype[wn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length===0?this:gu(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Ea(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t}();function Ea(t){if(t||(t=je.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var lm=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),yt=lm,mu=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.subject=n,i.subscriber=r,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var n=this.subject,r=n.observers;if(this.subject=null,!(!r||r.length===0||n.isStopped||n.closed)){var i=r.indexOf(this.subscriber);i!==-1&&r.splice(i,1)}}},e}(re),vu=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.destination=n,r}return e}(R),ge=function(t){b(e,t);function e(){var n=t.call(this)||this;return n.observers=[],n.closed=!1,n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype[Mr]=function(){return new vu(this)},e.prototype.lift=function(n){var r=new Ca(this,this);return r.operator=n,r},e.prototype.next=function(n){if(this.closed)throw new yt;if(!this.isStopped)for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].next(n)},e.prototype.error=function(n){if(this.closed)throw new yt;this.hasError=!0,this.thrownError=n,this.isStopped=!0;for(var r=this.observers,i=r.length,s=r.slice(),o=0;o<i;o++)s[o].error(n);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new yt;this.isStopped=!0;for(var n=this.observers,r=n.length,i=n.slice(),s=0;s<r;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(n){if(this.closed)throw new yt;return t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){if(this.closed)throw new yt;return this.hasError?(n.error(this.thrownError),re.EMPTY):this.isStopped?(n.complete(),re.EMPTY):(this.observers.push(n),new mu(this,n))},e.prototype.asObservable=function(){var n=new P;return n.source=this,n},e.create=function(n,r){return new Ca(n,r)},e}(P),Ca=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r=this.destination;r&&r.next&&r.next(n)},e.prototype.error=function(n){var r=this.destination;r&&r.error&&this.destination.error(n)},e.prototype.complete=function(){var n=this.destination;n&&n.complete&&this.destination.complete()},e.prototype._subscribe=function(n){var r=this.source;return r?this.source.subscribe(n):re.EMPTY},e}(ge);function zs(){return function(e){return e.lift(new hm(e))}}var hm=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,n){var r=this.connectable;r._refCount++;var i=new fm(e,r),s=n.subscribe(i);return i.closed||(i.connection=r.connect()),s},t}(),fm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._unsubscribe=function(){var n=this.connectable;if(!n){this.connection=null;return}this.connectable=null;var r=n._refCount;if(r<=0){this.connection=null;return}if(n._refCount=r-1,r>1){this.connection=null;return}var i=this.connection,s=n._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(R),yu=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(n){return this.getSubject().subscribe(n)},e.prototype.getSubject=function(){var n=this._subject;return(!n||n.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var n=this._connection;return n||(this._isComplete=!1,n=this._connection=new re,n.add(this.source.subscribe(new pm(this.getSubject(),this))),n.closed&&(this._connection=null,n=re.EMPTY)),n},e.prototype.refCount=function(){return zs()(this)},e}(P),dm=function(){var t=yu.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),pm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.connectable=r,i}return e.prototype._error=function(n){this._unsubscribe(),t.prototype._error.call(this,n)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.connectable;if(n){this.connectable=null;var r=n._connection;n._refCount=0,n._subject=null,n._connection=null,r&&r.unsubscribe()}},e}(vu);function bm(t,e,n,r){return function(i){return i.lift(new gm(t,e,n,r))}}var gm=function(){function t(e,n,r,i){this.keySelector=e,this.elementSelector=n,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(e,n){return n.subscribe(new mm(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),mm=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.keySelector=r,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(n){var r;try{r=this.keySelector(n)}catch(i){this.error(i);return}this._group(n,r)},e.prototype._group=function(n,r){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(r),o;if(this.elementSelector)try{o=this.elementSelector(n)}catch(l){this.error(l)}else o=n;if(!s){s=this.subjectSelector?this.subjectSelector():new ge,i.set(r,s);var a=new cs(r,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new cs(r,s))}catch(l){this.error(l);return}this.add(c.subscribe(new vm(r,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(n){var r=this.groups;r&&(r.forEach(function(i,s){i.error(n)}),r.clear()),this.destination.error(n)},e.prototype._complete=function(){var n=this.groups;n&&(n.forEach(function(r,i){r.complete()}),n.clear()),this.destination.complete()},e.prototype.removeGroup=function(n){this.groups.delete(n)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(R),vm=function(t){b(e,t);function e(n,r,i){var s=t.call(this,r)||this;return s.key=n,s.group=r,s.parent=i,s}return e.prototype._next=function(n){this.complete()},e.prototype._unsubscribe=function(){var n=this,r=n.parent,i=n.key;this.key=this.parent=null,r&&r.removeGroup(i)},e}(R),cs=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;return s.key=n,s.groupSubject=r,s.refCountSubscription=i,s}return e.prototype._subscribe=function(n){var r=new re,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&r.add(new ym(s)),r.add(o.subscribe(n)),r},e}(P),ym=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,n.count++,r}return e.prototype.unsubscribe=function(){var n=this.parent;!n.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),n.count-=1,n.count===0&&n.attemptedToUnsubscribe&&n.unsubscribe())},e}(re),wu=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return r&&!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new yt;return this._value},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(ge),wm=function(t){b(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(re),nr=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),this.closed)return this;this.state=n;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=this.id||this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return r;clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s=void 0;try{this.work(n)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var n=this.id,r=this.scheduler,i=r.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null},e}(wm),_m=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.schedule=function(n,r){return r===void 0&&(r=0),r>0?t.prototype.schedule.call(this,n,r):(this.delay=r,this.state=n,this.scheduler.flush(this),this)},e.prototype.execute=function(n,r){return r>0||this.closed?t.prototype.execute.call(this,n,r):this._execute(n,r)},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,n,r,i):n.flush(this)},e}(nr),us=function(){function t(e,n){n===void 0&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.SchedulerAction(this,e).schedule(r,n)},t.now=function(){return Date.now()},t}(),rr=function(t){b(e,t);function e(n,r){r===void 0&&(r=us.now);var i=t.call(this,n,function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(n,r,i){return r===void 0&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(n){var r=this.actions;if(this.active){r.push(n);return}var i;this.active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this.active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(us),Sm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(rr),_u=new Sm(_m),Su=_u,un=new P(function(t){return t.complete()});function _n(t){return t?Em(t):un}function Em(t){return new P(function(e){return t.schedule(function(){return e.complete()})})}function Ne(t){return t&&typeof t.schedule=="function"}var Eu=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function qs(t,e){return new P(function(n){var r=new re,i=0;return r.add(e.schedule(function(){if(i===t.length){n.complete();return}n.next(t[i++]),n.closed||r.add(this.schedule())})),r})}function ir(t,e){return e?qs(t,e):new P(Eu(t))}function ti(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Ne(n)?(t.pop(),qs(t,n)):ir(t)}function Gs(t,e){return e?new P(function(n){return e.schedule(Cm,0,{error:t,subscriber:n})}):new P(function(n){return n.error(t)})}function Cm(t){var e=t.error,n=t.subscriber;n.error(e)}var ls;ls||(ls={});var ht=function(){function t(e,n,r){this.kind=e,this.value=n,this.error=r,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,n,r){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return n&&n(this.error);case"C":return r&&r()}},t.prototype.accept=function(e,n,r){return e&&typeof e.next=="function"?this.observe(e):this.do(e,n,r)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return ti(this.value);case"E":return Gs(this.error);case"C":return _n()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function Im(t,e){return e===void 0&&(e=0),function(r){return r.lift(new km(t,e))}}var km=function(){function t(e,n){n===void 0&&(n=0),this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return n.subscribe(new Cu(e,this.scheduler,this.delay))},t}(),Cu=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=0);var s=t.call(this,n)||this;return s.scheduler=r,s.delay=i,s}return e.dispatch=function(n){var r=n.notification,i=n.destination;r.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(n){var r=this.destination;r.add(this.scheduler.schedule(e.dispatch,this.delay,new xm(n,this.destination)))},e.prototype._next=function(n){this.scheduleMessage(ht.createNext(n))},e.prototype._error=function(n){this.scheduleMessage(ht.createError(n)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(ht.createComplete()),this.unsubscribe()},e}(R),xm=function(){function t(e,n){this.notification=e,this.destination=n}return t}(),Js=function(t){b(e,t);function e(n,r,i){n===void 0&&(n=Number.POSITIVE_INFINITY),r===void 0&&(r=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=n<1?1:n,s._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(n){if(!this.isStopped){var r=this._events;r.push(n),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,n)},e.prototype.nextTimeWindow=function(n){this.isStopped||(this._events.push(new Rm(this._getNow(),n)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){var r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new yt;if(this.isStopped||this.hasError?a=re.EMPTY:(this.observers.push(n),a=new mu(this,n)),s&&n.add(n=new Cu(n,s)),r)for(var c=0;c<o&&!n.closed;c++)n.next(i[c]);else for(var c=0;c<o&&!n.closed;c++)n.next(i[c].value);return this.hasError?n.error(this.thrownError):this.isStopped&&n.complete(),a},e.prototype._getNow=function(){return(this.scheduler||Su).now()},e.prototype._trimBufferThenGetEvents=function(){for(var n=this._getNow(),r=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(n-s[a].time<i);)a++;return o>r&&(a=Math.max(a,o-r)),a>0&&s.splice(0,a),s},e}(ge),Rm=function(){function t(e,n){this.time=e,this.value=n}return t}(),Sn=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.value=null,n.hasNext=!1,n.hasCompleted=!1,n}return e.prototype._subscribe=function(n){return this.hasError?(n.error(this.thrownError),re.EMPTY):this.hasCompleted&&this.hasNext?(n.next(this.value),n.complete(),re.EMPTY):t.prototype._subscribe.call(this,n)},e.prototype.next=function(n){this.hasCompleted||(this.value=n,this.hasNext=!0)},e.prototype.error=function(n){this.hasCompleted||t.prototype.error.call(this,n)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(ge),Mm=1,Tm=function(){return Promise.resolve()}(),hs={};function Ia(t){return t in hs?(delete hs[t],!0):!1}var ka={setImmediate:function(t){var e=Mm++;return hs[e]=!0,Tm.then(function(){return Ia(e)&&t()}),e},clearImmediate:function(t){Ia(t)}},Am=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=ka.setImmediate(n.flush.bind(n,null))))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&(ka.clearImmediate(r),n.scheduled=void 0)},e}(nr),Nm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(rr),Iu=new Nm(Am),_r=Iu,ku=new rr(nr),Ie=ku,Om=function(t){b(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n.scheduled||(n.scheduled=requestAnimationFrame(function(){return n.flush(null)})))},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,n,r,i);n.actions.length===0&&(cancelAnimationFrame(r),n.scheduled=void 0)},e}(nr),Lm=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(n){this.active=!0,this.scheduled=void 0;var r=this.actions,i,s=-1,o=r.length;n=n||r.shift();do if(i=n.execute(n.state,n.delay))break;while(++s<o&&(n=r.shift()));if(this.active=!1,i){for(;++s<o&&(n=r.shift());)n.unsubscribe();throw i}},e}(rr),xu=new Lm(Om),jm=xu,$m=function(t){b(e,t);function e(n,r){n===void 0&&(n=Ru),r===void 0&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,n,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var n=this,r=n.actions,i=n.maxFrames,s,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=r.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(rr),Ru=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=n.index+=1);var s=t.call(this,n,r)||this;return s.scheduler=n,s.work=r,s.index=i,s.active=!0,s.index=n.index=i,s}return e.prototype.schedule=function(n,r){if(r===void 0&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(n,r,i){i===void 0&&(i=0),this.delay=n.frame+i;var s=n.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(n,r,i){},e.prototype._execute=function(n,r){if(this.active===!0)return t.prototype._execute.call(this,n,r)},e.sortActions=function(n,r){return n.delay===r.delay?n.index===r.index?0:n.index>r.index?1:-1:n.delay>r.delay?1:-1},e}(nr);function et(){}function Dm(t){return!!t&&(t instanceof P||typeof t.lift=="function"&&typeof t.subscribe=="function")}var Pm=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),ln=Pm,Fm=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),sr=Fm,Bm=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),Mu=Bm;function Be(t,e){return function(r){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Vm(t,e))}}var Vm=function(){function t(e,n){this.project=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new Hm(e,this.project,this.thisArg))},t}(),Hm=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.project=r,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(n){var r;try{r=this.project.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(R);function Tu(t,e,n){if(e)if(Ne(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Tu(t,n).apply(void 0,r).pipe(Be(function(s){return Ce(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:n};return new P(function(c){if(n){var h={args:r,subscriber:c,params:a};return n.schedule(Wm,0,h)}else{if(!o){o=new Sn;var l=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];o.next(u.length<=1?u[0]:u),o.complete()};try{t.apply(s,r.concat([l]))}catch(u){Us(o)?o.error(u):console.warn(u)}}return o.subscribe(c)}})}}function Wm(t){var e=this,n=t.args,r=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var d=h.length<=1?h[0]:h;e.add(a.schedule(Um,0,{value:d,subject:c}))};try{s.apply(o,n.concat([l]))}catch(h){c.error(h)}}this.add(c.subscribe(r))}function Um(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Au(t,e,n){if(e)if(Ne(e))n=e;else return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return Au(t,n).apply(void 0,r).pipe(Be(function(s){return Ce(s)?e.apply(void 0,s):e(s)}))};return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s={subject:void 0,args:r,callbackFunc:t,scheduler:n,context:this};return new P(function(o){var a=s.context,c=s.subject;if(n)return n.schedule(zm,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var d=h.shift();if(d){c.error(d);return}c.next(h.length<=1?h[0]:h),c.complete()};try{t.apply(a,r.concat([l]))}catch(h){Us(c)?c.error(h):console.warn(h)}}return c.subscribe(o)})}}function zm(t){var e=this,n=t.params,r=t.subscriber,i=t.context,s=n.callbackFunc,o=n.args,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new Sn;var l=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];var d=h.shift();if(d)e.add(a.schedule(xa,0,{err:d,subject:c}));else{var f=h.length<=1?h[0]:h;e.add(a.schedule(qm,0,{value:f,subject:c}))}};try{s.apply(i,o.concat([l]))}catch(h){this.add(a.schedule(xa,0,{err:h,subject:c}))}}this.add(c.subscribe(r))}function qm(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function xa(t){var e=t.err,n=t.subject;n.error(e)}var Vt=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(r)},e.prototype.notifyError=function(n,r){this.destination.error(n)},e.prototype.notifyComplete=function(n){this.destination.complete()},e}(R),Gm=function(t){b(e,t);function e(n,r,i){var s=t.call(this)||this;return s.parent=n,s.outerValue=r,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(n){this.parent.notifyNext(this.outerValue,n,this.outerIndex,this.index++,this)},e.prototype._error=function(n){this.parent.notifyError(n,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(R),Jm=function(t){return function(e){return t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Qt),e}};function Qm(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var St=Qm(),Zm=function(t){return function(e){var n=t[St]();do{var r=void 0;try{r=n.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}while(!0);return typeof n.return=="function"&&e.add(function(){n.return&&n.return()}),e}},Ym=function(t){return function(e){var n=t[wn]();if(typeof n.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},Nu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Ou(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Fn=function(t){if(t&&typeof t[wn]=="function")return Ym(t);if(Nu(t))return Eu(t);if(Ou(t))return Jm(t);if(t&&typeof t[St]=="function")return Zm(t);var e=Ws(t)?"an invalid object":"'"+t+"'",n="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(n)};function ft(t,e,n,r,i){if(i===void 0&&(i=new Gm(t,n,r)),!i.closed)return e instanceof P?e.subscribe(i):Fn(e)(i)}var Ra={};function Km(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return Ne(t[t.length-1])&&(r=t.pop()),typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Ce(t[0])&&(t=t[0]),ir(t,r).lift(new Qs(n))}var Qs=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Xm(e,this.resultSelector))},t}(),Xm=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(n){this.values.push(Ra),this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{this.active=r,this.toRespond=r;for(var i=0;i<r;i++){var s=n[i];this.add(ft(this,s,void 0,i))}}},e.prototype.notifyComplete=function(n){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(n,r,i){var s=this.values,o=s[i],a=this.toRespond?o===Ra?--this.toRespond:this.toRespond:0;s[i]=r,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Vt);function ev(t,e){return new P(function(n){var r=new re;return r.add(e.schedule(function(){var i=t[wn]();r.add(i.subscribe({next:function(s){r.add(e.schedule(function(){return n.next(s)}))},error:function(s){r.add(e.schedule(function(){return n.error(s)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}function tv(t,e){return new P(function(n){var r=new re;return r.add(e.schedule(function(){return t.then(function(i){r.add(e.schedule(function(){n.next(i),r.add(e.schedule(function(){return n.complete()}))}))},function(i){r.add(e.schedule(function(){return n.error(i)}))})})),r})}function nv(t,e){if(!t)throw new Error("Iterable cannot be null");return new P(function(n){var r=new re,i;return r.add(function(){i&&typeof i.return=="function"&&i.return()}),r.add(e.schedule(function(){i=t[St](),r.add(e.schedule(function(){if(!n.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){n.error(c);return}o?n.complete():(n.next(s),this.schedule())}}))})),r})}function rv(t){return t&&typeof t[wn]=="function"}function iv(t){return t&&typeof t[St]=="function"}function Lu(t,e){if(t!=null){if(rv(t))return ev(t,e);if(Ou(t))return tv(t,e);if(Nu(t))return qs(t,e);if(iv(t)||typeof t=="string")return nv(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function pt(t,e){return e?Lu(t,e):t instanceof P?t:new P(Fn(t))}var ie=function(t){b(e,t);function e(n){var r=t.call(this)||this;return r.parent=n,r}return e.prototype._next=function(n){this.parent.notifyNext(n)},e.prototype._error=function(n){this.parent.notifyError(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(R),se=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(R);function oe(t,e){if(!e.closed){if(t instanceof P)return t.subscribe(e);var n;try{n=Fn(t)(e)}catch(r){e.error(r)}return n}}function $t(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?function(r){return r.pipe($t(function(i,s){return pt(t(i,s)).pipe(Be(function(o,a){return e(i,o,s,a)}))},n))}:(typeof e=="number"&&(n=e),function(r){return r.lift(new sv(t,n))})}var sv=function(){function t(e,n){n===void 0&&(n=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=n}return t.prototype.call=function(e,n){return n.subscribe(new ov(e,this.project,this.concurrent))},t}(),ov=function(t){b(e,t);function e(n,r,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,n)||this;return s.project=r,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(n){this.active<this.concurrent?this._tryNext(n):this.buffer.push(n)},e.prototype._tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(se),av=$t;function Zs(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),$t(_t,t)}function ju(){return Zs(1)}function Bn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ju()(ti.apply(void 0,t))}function Ys(t){return new P(function(e){var n;try{n=t()}catch(i){e.error(i);return}var r=n?pt(n):_n();return r.subscribe(e)})}function cv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var n=t[0];if(Ce(n))return br(n,null);if(Ws(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return br(r.map(function(s){return n[s]}),r)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&Ce(t[0])?t[0]:t,br(t,null).pipe(Be(function(s){return i.apply(void 0,s)}))}return br(t,null)}function br(t,e){return new P(function(n){var r=t.length;if(r===0){n.complete();return}for(var i=new Array(r),s=0,o=0,a=function(l){var h=pt(t[l]),u=!1;n.add(h.subscribe({next:function(d){u||(u=!0,o++),i[l]=d},error:function(d){return n.error(d)},complete:function(){s++,(s===r||!u)&&(o===r&&n.next(e?e.reduce(function(d,f,p){return d[f]=i[p],d},{}):i),n.complete())}}))},c=0;c<r;c++)a(c)})}function $u(t,e,n,r){return cn(n)&&(r=n,n=void 0),r?$u(t,e,n).pipe(Be(function(i){return Ce(i)?r.apply(void 0,i):r(i)})):new P(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Du(t,e,s,i,n)})}function Du(t,e,n,r,i){var s;if(hv(t)){var o=t;t.addEventListener(e,n,i),s=function(){return o.removeEventListener(e,n,i)}}else if(lv(t)){var a=t;t.on(e,n),s=function(){return a.off(e,n)}}else if(uv(t)){var c=t;t.addListener(e,n),s=function(){return c.removeListener(e,n)}}else if(t&&t.length)for(var l=0,h=t.length;l<h;l++)Du(t[l],e,n,r,i);else throw new TypeError("Invalid event target");r.add(s)}function uv(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function lv(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function hv(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function Pu(t,e,n){return n?Pu(t,e).pipe(Be(function(r){return Ce(r)?n.apply(void 0,r):n(r)})):new P(function(r){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return r.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){r.error(o);return}if(cn(e))return function(){return e(i,s)}})}function fv(t,e,n,r,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,n=a.iterate,s=a.resultSelector||_t,i=a.scheduler}else r===void 0||Ne(r)?(o=t,s=_t,i=r):(o=t,s=r);return new P(function(c){var l=o;if(i)return i.schedule(dv,0,{subscriber:c,iterate:n,condition:e,resultSelector:s,state:l});do{if(e){var h=void 0;try{h=e(l)}catch(d){c.error(d);return}if(!h){c.complete();break}}var u=void 0;try{u=s(l)}catch(d){c.error(d);return}if(c.next(u),c.closed)break;try{l=n(l)}catch(d){c.error(d);return}}while(!0)})}function dv(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(s){e.error(s);return}if(!r){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function pv(t,e,n){return e===void 0&&(e=un),n===void 0&&(n=un),Ys(function(){return t()?e:n})}function hn(t){return!Ce(t)&&t-parseFloat(t)+1>=0}function bv(t,e){return t===void 0&&(t=0),e===void 0&&(e=Ie),(!hn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Ie),new P(function(n){return n.add(e.schedule(gv,t,{subscriber:n,counter:0,period:t})),n})}function gv(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Fu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return Ne(i)?(r=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(n=t.pop())):typeof i=="number"&&(n=t.pop()),r===null&&t.length===1&&t[0]instanceof P?t[0]:Zs(n)(ir(t,r))}var Bu=new P(et);function mv(){return Bu}function fs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return un;var n=t[0],r=t.slice(1);return t.length===1&&Ce(n)?fs.apply(void 0,n):new P(function(i){var s=function(){return i.add(fs.apply(void 0,r).subscribe(i))};return pt(n).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function vv(t,e){return e?new P(function(n){var r=Object.keys(t),i=new re;return i.add(e.schedule(yv,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i}):new P(function(n){for(var r=Object.keys(t),i=0;i<r.length&&!n.closed;i++){var s=r[i];t.hasOwnProperty(s)&&n.next([s,t[s]])}n.complete()})}function yv(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,s=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,s[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:s}))}else r.complete()}function Vu(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function Et(t,e){return function(r){return r.lift(new wv(t,e))}}var wv=function(){function t(e,n){this.predicate=e,this.thisArg=n}return t.prototype.call=function(e,n){return n.subscribe(new _v(e,this.predicate,this.thisArg))},t}(),_v=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.thisArg=i,s.count=0,s}return e.prototype._next=function(n){var r;try{r=this.predicate.call(this.thisArg,n,this.count++)}catch(i){this.destination.error(i);return}r&&this.destination.next(n)},e}(R);function Sv(t,e,n){return[Et(e,n)(new P(Fn(t))),Et(Vu(e,n))(new P(Fn(t)))]}function Hu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(Ce(t[0]))t=t[0];else return t[0];return ir(t,void 0).lift(new Ev)}var Ev=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Cv(e))},t}(),Cv=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return e.prototype._next=function(n){this.observables.push(n)},e.prototype._complete=function(){var n=this.observables,r=n.length;if(r===0)this.destination.complete();else{for(var i=0;i<r&&!this.hasFirst;i++){var s=n[i],o=ft(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(r)},e}(Vt);function Iv(t,e,n){return t===void 0&&(t=0),new P(function(r){e===void 0&&(e=t,t=0);var i=0,s=t;if(n)return n.schedule(kv,0,{index:i,count:e,start:t,subscriber:r});do{if(i++>=e){r.complete();break}if(r.next(s++),r.closed)break}while(!0)})}function kv(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;if(n>=r){i.complete();return}i.next(e),!i.closed&&(t.index=n+1,t.start=e+1,this.schedule(t))}function Wu(t,e,n){t===void 0&&(t=0);var r=-1;return hn(e)?r=Number(e)<1&&1||Number(e):Ne(e)&&(n=e),Ne(n)||(n=Ie),new P(function(i){var s=hn(t)?t:+t-n.now();return n.schedule(xv,s,{index:0,period:r,subscriber:i})})}function xv(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(n===-1)return r.complete();t.index=e+1,this.schedule(t,n)}}function Rv(t,e){return new P(function(n){var r;try{r=t()}catch(a){n.error(a);return}var i;try{i=e(r)}catch(a){n.error(a);return}var s=i?pt(i):un,o=s.subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}})}function Uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return typeof n=="function"&&t.pop(),ir(t,void 0).lift(new zu(n))}var zu=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Mv(e,this.resultSelector))},t}(),Mv=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.resultSelector=r,s.iterators=[],s.active=0,s.resultSelector=typeof r=="function"?r:void 0,s}return e.prototype._next=function(n){var r=this.iterators;Ce(n)?r.push(new Av(n)):typeof n[St]=="function"?r.push(new Tv(n[St]())):r.push(new Nv(this.destination,this,n))},e.prototype._complete=function(){var n=this.iterators,r=n.length;if(this.unsubscribe(),r===0){this.destination.complete();return}this.active=r;for(var i=0;i<r;i++){var s=n[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var n=this.iterators,r=n.length,i=this.destination,s=0;s<r;s++){var o=n[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<r;s++){var o=n[s],l=o.next();if(o.hasCompleted()&&(a=!0),l.done){i.complete();return}c.push(l.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(n){var r;try{r=this.resultSelector.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(R),Tv=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),Av=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[St]=function(){return this},t.prototype.next=function(e){var n=this.index++,r=this.array;return n<this.length?{value:r[n],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Nv=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.parent=r,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[St]=function(){return this},e.prototype.next=function(){var n=this.buffer;return n.length===0&&this.isComplete?{value:null,done:!0}:{value:n.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(n){this.buffer.push(n),this.parent.checkIterators()},e.prototype.subscribe=function(){return oe(this.observable,new ie(this))},e}(se);const Ov=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:ln,AsyncSubject:Sn,BehaviorSubject:wu,ConnectableObservable:yu,EMPTY:un,EmptyError:sr,GroupedObservable:cs,NEVER:Bu,Notification:ht,get NotificationKind(){return ls},ObjectUnsubscribedError:yt,Observable:P,ReplaySubject:Js,Scheduler:us,Subject:ge,Subscriber:R,Subscription:re,TimeoutError:Mu,UnsubscriptionError:jn,VirtualAction:Ru,VirtualTimeScheduler:$m,animationFrame:jm,animationFrameScheduler:xu,asap:_r,asapScheduler:Iu,async:Ie,asyncScheduler:ku,bindCallback:Tu,bindNodeCallback:Au,combineLatest:Km,concat:Bn,config:je,defer:Ys,empty:_n,forkJoin:cv,from:pt,fromEvent:$u,fromEventPattern:Pu,generate:fv,identity:_t,iif:pv,interval:bv,isObservable:Dm,merge:Fu,never:mv,noop:et,observable:wn,of:ti,onErrorResumeNext:fs,pairs:vv,partition:Sv,pipe:as,queue:Su,queueScheduler:_u,race:Hu,range:Iv,scheduled:Lu,throwError:Gs,timer:Wu,using:Rv,zip:Uu},Symbol.toStringTag,{value:"Module"})),ni=Hn(Ov);var ri={},dt,Z,Wi,Ma,fn=0,qu=[],Sr=[],Ta=j.__b,Aa=j.__r,Na=j.diffed,Oa=j.__c,La=j.unmount;function Ht(t,e){j.__h&&j.__h(Z,t,fn||e),fn=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:Sr}),n.__[t]}function Gu(t){return fn=1,Ju(Zu,t)}function Ju(t,e,n){var r=Ht(dt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Zu(void 0,e),function(a){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,a);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.u)){var i=function(a,c,l){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(d){return d.__c});if(h.every(function(d){return!d.__N}))return!s||s.call(this,a,c,l);var u=!1;return h.forEach(function(d){if(d.__N){var f=d.__[0];d.__=d.__N,d.__N=void 0,f!==d.__[0]&&(u=!0)}}),!(!u&&r.__c.props===a)&&(!s||s.call(this,a,c,l))};Z.u=!0;var s=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(a,c,l){if(this.__e){var h=s;s=void 0,i(a,c,l),s=h}o&&o.call(this,a,c,l)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Lv(t,e){var n=Ht(dt++,3);!j.__s&&Xs(n.__H,e)&&(n.__=t,n.i=e,Z.__H.__h.push(n))}function Qu(t,e){var n=Ht(dt++,4);!j.__s&&Xs(n.__H,e)&&(n.__=t,n.i=e,Z.__h.push(n))}function jv(t){return fn=5,Ks(function(){return{current:t}},[])}function $v(t,e,n){fn=6,Qu(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function Ks(t,e){var n=Ht(dt++,7);return Xs(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Dv(t,e){return fn=8,Ks(function(){return t},e)}function Pv(t){var e=Z.context[t.__c],n=Ht(dt++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(Z)),e.props.value):t.__}function Fv(t,e){j.useDebugValue&&j.useDebugValue(e?e(t):t)}function Bv(t){var e=Ht(dt++,10),n=Gu();return e.__=t,Z.componentDidCatch||(Z.componentDidCatch=function(r,i){e.__&&e.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Vv(){var t=Ht(dt++,11);if(!t.__){for(var e=Z.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function Hv(){for(var t;t=qu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Er),t.__H.__h.forEach(ds),t.__H.__h=[]}catch(e){t.__H.__h=[],j.__e(e,t.__v)}}j.__b=function(t){Z=null,Ta&&Ta(t)},j.__r=function(t){Aa&&Aa(t),dt=0;var e=(Z=t.__c).__H;e&&(Wi===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Sr,n.__N=n.i=void 0})):(e.__h.forEach(Er),e.__h.forEach(ds),e.__h=[],dt=0)),Wi=Z},j.diffed=function(t){Na&&Na(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(qu.push(e)!==1&&Ma===j.requestAnimationFrame||((Ma=j.requestAnimationFrame)||Wv)(Hv)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Sr&&(n.__=n.__V),n.i=void 0,n.__V=Sr})),Wi=Z=null},j.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Er),n.__h=n.__h.filter(function(r){return!r.__||ds(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],j.__e(r,n.__v)}}),Oa&&Oa(t,e)},j.unmount=function(t){La&&La(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Er(r)}catch(i){e=i}}),n.__H=void 0,e&&j.__e(e,n.__v))};var ja=typeof requestAnimationFrame=="function";function Wv(t){var e,n=function(){clearTimeout(r),ja&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);ja&&(e=requestAnimationFrame(n))}function Er(t){var e=Z,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Z=e}function ds(t){var e=Z;t.__c=t.__(),Z=e}function Xs(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Zu(t,e){return typeof e=="function"?e(t):e}const Uv=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Dv,useContext:Pv,useDebugValue:Fv,useEffect:Lv,useErrorBoundary:Bv,useId:Vv,useImperativeHandle:$v,useLayoutEffect:Qu,useMemo:Ks,useReducer:Ju,useRef:jv,useState:Gu},Symbol.toStringTag,{value:"Module"})),or=Hn(Uv);var it={},ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.CloseIcon=void 0;const $a=Oe;function zv(t){return(0,$a.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,$a.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}ii.CloseIcon=zv;var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var to={};Object.defineProperty(to,"__esModule",{value:!0});to.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var si={};Object.defineProperty(si,"__esModule",{value:!0});si.QRCodeIcon=void 0;const Ye=Oe;function qv(t){return(0,Ye.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ye.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ye.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ye.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ye.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ye.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ye.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ye.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ye.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ye.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}si.QRCodeIcon=qv;var no={};Object.defineProperty(no,"__esModule",{value:!0});const Gv=`
6
6
  <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
8
8
  <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
9
9
  <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
10
10
  </svg>
11
- `;to.default=qv;var no={};Object.defineProperty(no,"__esModule",{value:!0});no.default=`
11
+ `;no.default=Gv;var ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.default=`
12
12
  <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
13
13
  <circle cx="50" cy="50" r="50" fill="white"/>
14
14
  <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
15
15
  <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
16
16
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
17
17
  </svg>
18
- `;var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.StatusDotIcon=void 0;const $a=Oe;function Jv(t){return(0,$a.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,$a.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}oi.StatusDotIcon=Jv;var ai={};function Yu(t){this.mode=Te.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var r=[],i=this.data.charCodeAt(e);i>65536?(r[0]=240|(i&1835008)>>>18,r[1]=128|(i&258048)>>>12,r[2]=128|(i&4032)>>>6,r[3]=128|i&63):i>2048?(r[0]=224|(i&61440)>>>12,r[1]=128|(i&4032)>>>6,r[2]=128|i&63):i>128?(r[0]=192|(i&1984)>>>6,r[1]=128|i&63):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Yu.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e<n;e++)t.put(this.parsedData[e],8)}};function st(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}st.prototype={addData:function(t){var e=new Yu(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=st.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=te.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,l=this.modules[s][a];l&&(r.beginFill(0,100),r.moveTo(c,o),r.lineTo(c+i,o),r.lineTo(c+i,o+i),r.lineTo(c,o+i),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=te.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(this.modules[r][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[r+s][i+o]=!0:this.modules[r+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=te.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=te.getBCHTypeInfo(n),i=0;i<15;i++){var s=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[r][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var l=te.getMask(e,r,o-a);l&&(c=!c),this.modules[r][o-a]=c,i--,i==-1&&(s++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}};st.PAD0=236;st.PAD1=17;st.createData=function(t,e,n){for(var r=tt.getRSBlocks(t,e),i=new Ku,s=0;s<n.length;s++){var o=n[s];i.put(o.mode,4),i.put(o.getLength(),te.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<r.length;s++)a+=r[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(st.PAD0,8),i.getLengthInBits()>=a*8));)i.put(st.PAD1,8);return st.createBytes(i,r)};st.createBytes=function(t,e){for(var n=0,r=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,l=e[a].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),s[a]=new Array(c);for(var h=0;h<s[a].length;h++)s[a][h]=255&t.buffer[h+n];n+=c;var u=te.getErrorCorrectPolynomial(l),f=new tn(s[a],u.getLength()-1),d=f.mod(u);o[a]=new Array(u.getLength()-1);for(var h=0;h<o[a].length;h++){var p=h+d.getLength()-o[a].length;o[a][h]=p>=0?d.get(p):0}}for(var g=0,h=0;h<e.length;h++)g+=e[h].totalCount;for(var S=new Array(g),v=0,h=0;h<r;h++)for(var a=0;a<e.length;a++)h<s[a].length&&(S[v++]=s[a][h]);for(var h=0;h<i;h++)for(var a=0;a<e.length;a++)h<o[a].length&&(S[v++]=o[a][h]);return S};var Te={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},wt={L:1,M:0,Q:3,H:2},bt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},te={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;te.getBCHDigit(e)-te.getBCHDigit(te.G15)>=0;)e^=te.G15<<te.getBCHDigit(e)-te.getBCHDigit(te.G15);return(t<<10|e)^te.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;te.getBCHDigit(e)-te.getBCHDigit(te.G18)>=0;)e^=te.G18<<te.getBCHDigit(e)-te.getBCHDigit(te.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return te.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case bt.PATTERN000:return(e+n)%2==0;case bt.PATTERN001:return e%2==0;case bt.PATTERN010:return n%3==0;case bt.PATTERN011:return(e+n)%3==0;case bt.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case bt.PATTERN101:return e*n%2+e*n%3==0;case bt.PATTERN110:return(e*n%2+e*n%3)%2==0;case bt.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new tn([1],0),n=0;n<t;n++)e=e.multiply(new tn([1,be.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Te.MODE_NUMBER:return 10;case Te.MODE_ALPHA_NUM:return 9;case Te.MODE_8BIT_BYTE:return 8;case Te.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Te.MODE_NUMBER:return 12;case Te.MODE_ALPHA_NUM:return 11;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Te.MODE_NUMBER:return 14;case Te.MODE_ALPHA_NUM:return 13;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(r+a,i+c)&&s++;s>5&&(n+=3+s-5)}for(var r=0;r<e-1;r++)for(var i=0;i<e-1;i++){var l=0;t.isDark(r,i)&&l++,t.isDark(r+1,i)&&l++,t.isDark(r,i+1)&&l++,t.isDark(r+1,i+1)&&l++,(l==0||l==4)&&(n+=3)}for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);for(var h=0,i=0;i<e;i++)for(var r=0;r<e;r++)t.isDark(r,i)&&h++;var u=Math.abs(100*h/e/e-50)/5;return n+=u*10,n}},be={glog:function(t){if(t<1)throw new Error("glog("+t+")");return be.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return be.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ve=0;ve<8;ve++)be.EXP_TABLE[ve]=1<<ve;for(var ve=8;ve<256;ve++)be.EXP_TABLE[ve]=be.EXP_TABLE[ve-4]^be.EXP_TABLE[ve-5]^be.EXP_TABLE[ve-6]^be.EXP_TABLE[ve-8];for(var ve=0;ve<255;ve++)be.LOG_TABLE[be.EXP_TABLE[ve]]=ve;function tn(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}tn.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<t.getLength();r++)e[n+r]^=be.gexp(be.glog(this.get(n))+be.glog(t.get(r)));return new tn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=be.glog(this.get(0))-be.glog(t.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(var r=0;r<t.getLength();r++)n[r]^=be.gexp(be.glog(t.get(r))+e);return new tn(n,0).mod(t)}};function tt(t,e){this.totalCount=t,this.dataCount=e}tt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];tt.getRSBlocks=function(t,e){var n=tt.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,i=[],s=0;s<r;s++)for(var o=n[s*3+0],a=n[s*3+1],c=n[s*3+2],l=0;l<o;l++)i.push(new tt(a,c));return i};tt.getRsBlockTable=function(t,e){switch(e){case wt.L:return tt.RS_BLOCK_TABLE[(t-1)*4+0];case wt.M:return tt.RS_BLOCK_TABLE[(t-1)*4+1];case wt.Q:return tt.RS_BLOCK_TABLE[(t-1)*4+2];case wt.H:return tt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function Ku(){this.buffer=[],this.length=0}Ku.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ui=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Xu(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function n(c){switch(c){case"L":return wt.L;case"M":return wt.M;case"Q":return wt.Q;case"H":return wt.H;default:throw new Error("Unknwon error correction level: "+c)}}function r(c,l){for(var h=i(c),u=1,f=0,d=0,p=Ui.length;d<=p;d++){var g=Ui[d];if(!g)throw new Error("Content too long: expected "+f+" but got "+h);switch(l){case"L":f=g[0];break;case"M":f=g[1];break;case"Q":f=g[2];break;case"H":f=g[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(h<=f)break;u++}if(u>Ui.length)throw new Error("Content too long");return u}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=r(s,this.options.ecl),a=n(this.options.ecl);this.qrcode=new st(o,a),this.qrcode.addData(s),this.qrcode.make()}Xu.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var r=typeof e.pretty<"u"?!!e.pretty:!0,i=r?" ":"",s=r?`\r
19
- `:"",o=e.width,a=e.height,c=n.length,l=o/(c+2*e.padding),h=a/(c+2*e.padding),u=typeof e.join<"u"?!!e.join:!1,f=typeof e.swap<"u"?!!e.swap:!1,d=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,p=typeof e.predefined<"u"?!!e.predefined:!1,g=p?i+'<defs><path id="qrmodule" d="M0 0 h'+h+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",S=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,v="",m="",E=0;E<c;E++)for(var C=0;C<c;C++){var w=n[C][E];if(w){var I=C*l+e.padding*l,B=E*h+e.padding*h;if(f){var Y=I;I=B,B=Y}if(u){var A=l+I,V=h+B;I=Number.isInteger(I)?Number(I):I.toFixed(2),B=Number.isInteger(B)?Number(B):B.toFixed(2),A=Number.isInteger(A)?Number(A):A.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),m+="M"+I+","+B+" V"+V+" H"+A+" V"+B+" H"+I+" Z "}else p?v+=i+'<use x="'+I.toString()+'" y="'+B.toString()+'" href="#qrmodule" />'+s:v+=i+'<rect x="'+I.toString()+'" y="'+B.toString()+'" width="'+l+'" height="'+h+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}u&&(v=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let fe="";if(this.options.image!==void 0&&this.options.image.svg){const _=o*this.options.image.width/100,y=a*this.options.image.height/100,T=o/2-_/2,k=a/2-y/2;fe+=`<svg x="${T}" y="${k}" width="${_}" height="${y}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,fe+=this.options.image.svg+s,fe+="</svg>"}var G="";switch(t.container){case"svg":d&&(G+='<?xml version="1.0" standalone="yes"?>'+s),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,G+=g+S+v,G+=fe,G+="</svg>";break;case"svg-viewbox":d&&(G+='<?xml version="1.0" standalone="yes"?>'+s),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,G+=g+S+v,G+=fe,G+="</svg>";break;case"g":G+='<g width="'+o+'" height="'+a+'">'+s,G+=g+S+v,G+=fe,G+="</g>";break;default:G+=(g+S+v+fe).replace(/^\s+/,"");break}return G};var Qv=Xu,Zv=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0});ai.QRCode=void 0;const Yv=Oe,Da=sr,Kv=Zv(Qv),Xv=t=>{const[e,n]=(0,Da.useState)("");return(0,Da.useEffect)(()=>{var r,i;const s=new Kv.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(r=t.width)!==null&&r!==void 0?r:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=U.from(s.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${o}`)}),e?(0,Yv.h)("img",{src:e,alt:"QR Code"}):null};ai.QRCode=Xv;var ci={},ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var e1=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ci,"__esModule",{value:!0});ci.Spinner=void 0;const br=Oe,t1=e1(ro),n1=t=>{var e;const n=(e=t.size)!==null&&e!==void 0?e:64,r=t.color||"#000";return(0,br.h)("div",{class:"-cbwsdk-spinner"},(0,br.h)("style",null,t1.default),(0,br.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,br.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};ci.Spinner=n1;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var En=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(it,"__esModule",{value:!0});it.CoinbaseAppSteps=it.CoinbaseWalletSteps=it.ConnectItem=it.ConnectContent=void 0;const De=En(Lr),O=Oe,Pa=sr,r1=x,i1=Wn,s1=ii,o1=En(Xs),a1=En(eo),el=si,c1=En(to),u1=En(no),l1=oi,h1=ai,f1=ci,d1=En(io),Fa={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:a1.default,steps:nl},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:o1.default,steps:rl}},p1=t=>{switch(t){case"coinbase-app":return c1.default;case"coinbase-wallet-app":default:return u1.default}},ds=t=>t==="light"?"#FFFFFF":"#0A0B0D";function b1(t){const{theme:e}=t,[n,r]=(0,Pa.useState)("coinbase-wallet-app"),i=(0,Pa.useCallback)(l=>{r(l)},[]),s=(0,r1.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Fa[n];if(!n)return null;const a=o.steps,c=n==="coinbase-app";return(0,O.h)("div",{"data-testid":"connect-content",class:(0,De.default)("-cbwsdk-connect-content",e)},(0,O.h)("style",null,d1.default),(0,O.h)("div",{class:"-cbwsdk-connect-content-header"},(0,O.h)("h2",{class:(0,De.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,O.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,O.h)(s1.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,O.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,O.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,O.h)("div",null,Object.entries(Fa).map(([l,h])=>(0,O.h)(tl,{key:l,title:h.title,description:h.description,icon:h.icon,selected:n===l,onClick:()=>i(l),theme:e}))),c&&(0,O.h)("div",{class:(0,De.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,O.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,O.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,O.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,O.h)(h1.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:p1(n),width:25,height:25}}),(0,O.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:i1.LIB_VERSION}),(0,O.h)("input",{type:"hidden",value:s})),(0,O.h)(a,{theme:e}),!t.isConnected&&(0,O.h)("div",{"data-testid":"connecting-spinner",class:(0,De.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,O.h)(f1.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,O.h)("p",null,"Connecting...")))))}it.ConnectContent=b1;function tl({title:t,description:e,icon:n,selected:r,theme:i,onClick:s}){return(0,O.h)("div",{onClick:s,class:(0,De.default)("-cbwsdk-connect-item",i,{selected:r})},(0,O.h)("div",null,(0,O.h)("img",{src:n,alt:t})),(0,O.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,O.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,O.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}it.ConnectItem=tl;function nl({theme:t}){return(0,O.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,O.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,O.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,O.h)("span",null,"Tap ",(0,O.h)("strong",null,"Scan")," "),(0,O.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(el.QRCodeIcon,{fill:ds(t)})))))}it.CoinbaseWalletSteps=nl;function rl({theme:t}){return(0,O.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,O.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,O.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,O.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,O.h)("span",null,"Tap ",(0,O.h)("strong",null,"More")),(0,O.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(l1.StatusDotIcon,{fill:ds(t)})),(0,O.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,O.h)("strong",null,"Scan")),(0,O.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,O.h)(el.QRCodeIcon,{fill:ds(t)})))))}it.CoinbaseAppSteps=rl;var ui={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.ArrowLeftIcon=void 0;const Ba=Oe;function g1(t){return(0,Ba.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ba.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}li.ArrowLeftIcon=g1;var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.LaptopIcon=void 0;const zi=Oe;function m1(t){return(0,zi.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,zi.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,zi.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}hi.LaptopIcon=m1;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.SafeIcon=void 0;const Va=Oe;function v1(t){return(0,Va.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Va.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}fi.SafeIcon=v1;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var il=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.TryExtensionContent=void 0;const Ct=il(Lr),ue=Oe,Gi=sr,y1=li,w1=hi,_1=fi,S1=il(so);function E1({theme:t}){const[e,n]=(0,Gi.useState)(!1),r=(0,Gi.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Gi.useCallback)(()=>{e?window.location.reload():(r(),n(!0))},[r,e]);return(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension",t)},(0,ue.h)("style",null,S1.default),(0,ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ue.h)("h3",{class:(0,Ct.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,ue.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ue.h)("button",{class:(0,Ct.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,ue.h)("div",null,!e&&(0,ue.h)(y1.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ue.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ue.h)("span",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ue.h)(w1.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ue.h)("span",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ue.h)(_1.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ui.TryExtensionContent=E1;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var sl=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});ri.ConnectDialog=void 0;const qi=sl(Lr),It=Oe,Ji=sr,C1=it,I1=ui,x1=sl(oo),k1=t=>{const{isOpen:e,darkMode:n}=t,[r,i]=(0,Ji.useState)(!e),[s,o]=(0,Ji.useState)(!e);(0,Ji.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=n?"dark":"light";return(0,It.h)("div",{class:(0,qi.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,It.h)("style",null,x1.default),(0,It.h)("div",{class:(0,qi.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,It.h)("div",{class:"-cbwsdk-connect-dialog"},(0,It.h)("div",{class:(0,qi.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,It.h)(C1.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,It.h)(I1.TryExtensionContent,{theme:a}))))};ri.ConnectDialog=k1;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LinkFlow=void 0;const Qi=Oe,Ha=ni,R1=ri;class M1{constructor(e){this.extensionUI$=new Ha.BehaviorSubject({}),this.subscriptions=new Ha.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(n=>{this.isConnected!==n&&(this.isConnected=n,this.render())})),this.subscriptions.add(this.chainId$.subscribe(n=>{this.chainId!==n&&(this.chainId=n,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Qi.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Qi.render)((0,Qi.h)(R1.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Xr.LinkFlow=M1;var ol={},ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=L&&L.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const n=e(Lr),r=Oe,i=sr,s=e(ao),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(u){switch(u){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(f){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=f.darkMode}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const d=this.nextItemKey++;return this.items.set(d,f),this.render(),()=>{this.items.delete(d),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,d])=>(0,r.h)(t.SnackbarInstance,Object.assign({},d,{key:f}))))),this.root)}}t.Snackbar=c;const l=u=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,s.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},u.children));t.SnackbarContainer=l;const h=({autoExpand:u,message:f,menuItems:d,appSrc:p})=>{const[g,S]=(0,i.useState)(!0),[v,m]=(0,i.useState)(u??!1);(0,i.useEffect)(()=>{const C=[window.setTimeout(()=>{S(!1)},1),window.setTimeout(()=>{m(!0)},1e4)];return()=>{C.forEach(window.clearTimeout)}});const E=()=>{m(!v)};return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",g&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:E},(0,r.h)("img",{src:a(p),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,r.h)("div",{class:"-gear-container"},!v&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),d&&d.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},d.map((C,w)=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:C.onClick,key:w},(0,r.h)("svg",{width:C.svgWidth,height:C.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":C.defaultFillRule,"clip-rule":C.defaultClipRule,d:C.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},C.info)))))};t.SnackbarInstance=h})(ol);var di={},co={};Object.defineProperty(co,"__esModule",{value:!0});co.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var T1=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});di.injectCssReset=void 0;const A1=T1(co);function N1(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(A1.default)),document.documentElement.appendChild(t)}di.injectCssReset=N1;Object.defineProperty(Kr,"__esModule",{value:!0});Kr.WalletSDKUI=void 0;const O1=Xr,L1=ol,j1=di;class $1{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new L1.Snackbar({darkMode:e.darkMode}),this.linkFlow=new O1.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.linkFlow.attach(n),this.snackbar.attach(n),this.attached=!0,(0,j1.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Kr.WalletSDKUI=$1;var pi={},bi={};Object.defineProperty(bi,"__esModule",{value:!0});var Zt;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Zt||(Zt={}));function al(t,e,n){if(!n||typeof n.value!==Zt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Zt.boolTrue,get:function(){var r=n.value.bind(this);return Object.defineProperty(this,e,{value:r,configurable:Zt.boolTrue,writable:Zt.boolTrue}),r}}}bi.bind=al;bi.default=al;function cl(t){return function(n){return n.lift(new D1(t))}}var D1=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new P1(e,this.durationSelector))},t}(),P1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){if(this.value=n,this.hasValue=!0,!this.throttled){var r=void 0;try{var i=this.durationSelector;r=i(n)}catch(o){return this.destination.error(o)}var s=oe(r,new ie(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var n=this,r=n.value,i=n.hasValue,s=n.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(r))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(se);function F1(t,e){return e===void 0&&(e=Ie),cl(function(){return Wu(t,e)})}function B1(t){return function(n){return n.lift(new V1(t))}}var V1=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,n){return n.subscribe(new H1(e,this.closingNotifier))},t}(),H1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.buffer=[],i.add(oe(r,new ie(i))),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype.notifyNext=function(){var n=this.buffer;this.buffer=[],this.destination.next(n)},e}(se);function W1(t,e){return e===void 0&&(e=null),function(r){return r.lift(new U1(t,e))}}var U1=function(){function t(e,n){this.bufferSize=e,this.startBufferEvery=n,!n||e===n?this.subscriberClass=z1:this.subscriberClass=G1}return t.prototype.call=function(e,n){return n.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),z1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.bufferSize=r,i.buffer=[],i}return e.prototype._next=function(n){var r=this.buffer;r.push(n),r.length==this.bufferSize&&(this.destination.next(r),this.buffer=[])},e.prototype._complete=function(){var n=this.buffer;n.length>0&&this.destination.next(n),t.prototype._complete.call(this)},e}(M),G1=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.bufferSize=r,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(n){var r=this,i=r.bufferSize,s=r.startBufferEvery,o=r.buffers,a=r.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var l=o[c];l.push(n),l.length===i&&(o.splice(c,1),this.destination.next(l))}},e.prototype._complete=function(){for(var n=this,r=n.buffers,i=n.destination;r.length>0;){var s=r.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(M);function q1(t){var e=arguments.length,n=Ie;Ne(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new J1(t,r,i,n))}}var J1=function(){function t(e,n,r,i){this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new Z1(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Q1=function(){function t(){this.buffer=[]}return t}(),Z1=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:c,bufferTimeSpan:r};a.add(c.closeAction=o.schedule(Wa,r,l))}else{var h={subscriber:a,context:c},u={bufferTimeSpan:r,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(ul,r,h)),a.add(o.schedule(Y1,i,u))}return a}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s,o=0;o<i;o++){var a=r[o],c=a.buffer;c.push(n),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(n){this.contexts.length=0,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this,r=n.contexts,i=n.destination;r.length>0;){var s=r.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(n){this.closeContext(n);var r=n.closeAction;if(r.unsubscribe(),this.remove(r),!this.closed&&this.timespanOnly){n=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:n,bufferTimeSpan:i};this.add(n.closeAction=this.scheduler.schedule(Wa,i,s))}},e.prototype.openContext=function(){var n=new Q1;return this.contexts.push(n),n},e.prototype.closeContext=function(n){this.destination.next(n.buffer);var r=this.contexts,i=r?r.indexOf(n):-1;i>=0&&r.splice(r.indexOf(n),1)},e}(M);function Wa(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Y1(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,s=r.openContext(),o=this;r.closed||(r.add(s.closeAction=i.schedule(ul,n,{subscriber:r,context:s})),o.schedule(t,e))}function ul(t){var e=t.subscriber,n=t.context;e.closeContext(n)}function K1(t,e){return function(r){return r.lift(new X1(t,e))}}var X1=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new ey(e,this.openings,this.closingSelector))},t}(),ey=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.closingSelector=i,s.contexts=[],s.add(ft(s,r)),s}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s=0;s<i;s++)r[s].buffer.push(n)},e.prototype._error=function(n){for(var r=this.contexts;r.length>0;){var i=r.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this.contexts;n.length>0;){var r=n.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(n,r){n?this.closeBuffer(n):this.openBuffer(r)},e.prototype.notifyComplete=function(n){this.closeBuffer(n.context)},e.prototype.openBuffer=function(n){try{var r=this.closingSelector,i=r.call(this,n);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(n){var r=this.contexts;if(r&&n){var i=n.buffer,s=n.subscription;this.destination.next(i),r.splice(r.indexOf(n),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(n){var r=this.contexts,i=[],s=new re,o={buffer:i,subscription:s};r.push(o);var a=ft(this,n,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Vt);function ty(t){return function(e){return e.lift(new ny(t))}}var ny=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new ry(e,this.closingSelector))},t}(),ry=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.closingSelector=r,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype._complete=function(){var n=this.buffer;n&&this.destination.next(n),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var n=this.closingSubscription;n&&(this.remove(n),n.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}n=new re,this.closingSubscription=n,this.add(n),this.subscribing=!0,n.add(oe(i,new ie(this))),this.subscribing=!1},e}(se);function iy(t){return function(n){var r=new sy(t),i=n.lift(r);return r.caught=i}}var sy=function(){function t(e){this.selector=e}return t.prototype.call=function(e,n){return n.subscribe(new oy(e,this.selector,this.caught))},t}(),oy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.selector=r,s.caught=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=void 0;try{r=this.selector(n,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new ie(this);this.add(i);var s=oe(r,i);s!==i&&this.add(s)}},e}(se);function ay(t){return function(e){return e.lift(new Js(t))}}function cy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Ce(t[0])&&(t=t[0].slice()),function(r){return r.lift.call(pt([r].concat(t)),new Js(n))}}function uy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Fn.apply(void 0,[n].concat(t)))}}function ll(t,e){return $t(t,e,1)}function ly(t,e){return ll(function(){return t},e)}function hy(t){return function(e){return e.lift(new fy(t,e))}}var fy=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new dy(e,this.predicate,this.source))},t}(),dy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(n){this.predicate?this._tryPredicate(n):this.count++},e.prototype._tryPredicate=function(n){var r;try{r=this.predicate(n,this.index++,this.source)}catch(i){this.destination.error(i);return}r&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(M);function py(t){return function(e){return e.lift(new by(t))}}var by=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new gy(e,this.durationSelector))},t}(),gy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){try{var r=this.durationSelector.call(this,n);r&&this._tryNext(n,r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(n,r){var i=this.durationSubscription;this.value=n,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=oe(r,new ie(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var n=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,n)}},e}(se);function my(t,e){return e===void 0&&(e=Ie),function(n){return n.lift(new vy(t,e))}}var vy=function(){function t(e,n){this.dueTime=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new yy(e,this.dueTime,this.scheduler))},t}(),yy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.dueTime=r,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(n){this.clearDebounce(),this.lastValue=n,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(wy,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var n=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(n)}},e.prototype.clearDebounce=function(){var n=this.debouncedSubscription;n!==null&&(this.remove(n),n.unsubscribe(),this.debouncedSubscription=null)},e}(M);function wy(t){t.debouncedNext()}function or(t){return t===void 0&&(t=null),function(e){return e.lift(new _y(t))}}var _y=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,n){return n.subscribe(new Sy(e,this.defaultValue))},t}(),Sy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.defaultValue=r,i.isEmpty=!0,i}return e.prototype._next=function(n){this.isEmpty=!1,this.destination.next(n)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(M);function hl(t){return t instanceof Date&&!isNaN(+t)}function Ey(t,e){e===void 0&&(e=Ie);var n=hl(t),r=n?+t-e.now():Math.abs(t);return function(i){return i.lift(new Cy(r,e))}}var Cy=function(){function t(e,n){this.delay=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new Iy(e,this.delay,this.scheduler))},t}(),Iy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.delay=r,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(n){for(var r=n.source,i=r.queue,s=n.scheduler,o=n.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(n,a)}else this.unsubscribe(),r.active=!1},e.prototype._schedule=function(n){this.active=!0;var r=this.destination;r.add(n.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:n}))},e.prototype.scheduleNotification=function(n){if(this.errored!==!0){var r=this.scheduler,i=new xy(r.now()+this.delay,n);this.queue.push(i),this.active===!1&&this._schedule(r)}},e.prototype._next=function(n){this.scheduleNotification(ht.createNext(n))},e.prototype._error=function(n){this.errored=!0,this.queue=[],this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ht.createComplete()),this.unsubscribe()},e}(M),xy=function(){function t(e,n){this.time=e,this.notification=n}return t}();function ky(t,e){return e?function(n){return new My(n,e).lift(new Ua(t))}:function(n){return n.lift(new Ua(t))}}var Ua=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Ry(e,this.delayDurationSelector))},t}(),Ry=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(n),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(n,r){this._error(n)},e.prototype.notifyComplete=function(n){var r=this.removeSubscription(n);r&&this.destination.next(r),this.tryComplete()},e.prototype._next=function(n){var r=this.index++;try{var i=this.delayDurationSelector(n,r);i&&this.tryDelay(i,n)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(n){n.unsubscribe();var r=this.delayNotifierSubscriptions.indexOf(n);return r!==-1&&this.delayNotifierSubscriptions.splice(r,1),n.outerValue},e.prototype.tryDelay=function(n,r){var i=ft(this,n,r);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Vt),My=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subscriptionDelay=r,i}return e.prototype._subscribe=function(n){this.subscriptionDelay.subscribe(new Ty(n,this.source))},e}(P),Ty=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.parent=n,i.source=r,i.sourceSubscribed=!1,i}return e.prototype._next=function(n){this.subscribeToSource()},e.prototype._error=function(n){this.unsubscribe(),this.parent.error(n)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(M);function Ay(){return function(e){return e.lift(new Ny)}}var Ny=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Oy(e))},t}(),Oy=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){n.observe(this.destination)},e}(M);function Ly(t,e){return function(n){return n.lift(new jy(t,e))}}var jy=function(){function t(e,n){this.keySelector=e,this.flushes=n}return t.prototype.call=function(e,n){return n.subscribe(new $y(e,this.keySelector,this.flushes))},t}(),$y=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=r,s.values=new Set,i&&s.add(oe(i,new ie(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(n){this._error(n)},e.prototype._next=function(n){this.keySelector?this._useKeySelector(n):this._finalizeNext(n,n)},e.prototype._useKeySelector=function(n){var r,i=this.destination;try{r=this.keySelector(n)}catch(s){i.error(s);return}this._finalizeNext(r,n)},e.prototype._finalizeNext=function(n,r){var i=this.values;i.has(n)||(i.add(n),this.destination.next(r))},e}(se);function fl(t,e){return function(n){return n.lift(new Dy(t,e))}}var Dy=function(){function t(e,n){this.compare=e,this.keySelector=n}return t.prototype.call=function(e,n){return n.subscribe(new Py(e,this.compare,this.keySelector))},t}(),Py=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=i,s.hasKey=!1,typeof r=="function"&&(s.compare=r),s}return e.prototype.compare=function(n,r){return n===r},e.prototype._next=function(n){var r;try{var i=this.keySelector;r=i?i(n):n}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,r)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=r,this.destination.next(n))},e}(M);function Fy(t,e){return fl(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}function gi(t){return t===void 0&&(t=Hy),function(e){return e.lift(new By(t))}}var By=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,n){return n.subscribe(new Vy(e,this.errorFactory))},t}(),Vy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.errorFactory=r,i.hasValue=!1,i}return e.prototype._next=function(n){this.hasValue=!0,this.destination.next(n)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var n=void 0;try{n=this.errorFactory()}catch(r){n=r}this.destination.error(n)},e}(M);function Hy(){return new ir}function uo(t){return function(e){return t===0?_n():e.lift(new Wy(t))}}var Wy=function(){function t(e){if(this.total=e,this.total<0)throw new ln}return t.prototype.call=function(e,n){return n.subscribe(new Uy(e,this.total))},t}(),Uy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){var r=this.total,i=++this.count;i<=r&&(this.destination.next(n),i===r&&(this.destination.complete(),this.unsubscribe()))},e}(M);function zy(t,e){if(t<0)throw new ln;var n=arguments.length>=2;return function(r){return r.pipe(Et(function(i,s){return s===t}),uo(1),n?or(e):gi(function(){return new ln}))}}function Gy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return Fn(n,ti.apply(void 0,t))}}function qy(t,e){return function(n){return n.lift(new Jy(t,e,n))}}var Jy=function(){function t(e,n,r){this.predicate=e,this.thisArg=n,this.source=r}return t.prototype.call=function(e,n){return n.subscribe(new Qy(e,this.predicate,this.thisArg,this.source))},t}(),Qy=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.predicate=r,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(n){this.destination.next(n),this.destination.complete()},e.prototype._next=function(n){var r=!1;try{r=this.predicate.call(this.thisArg,n,this.index++,this.source)}catch(i){this.destination.error(i);return}r||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(M);function Zy(){return function(t){return t.lift(new Yy)}}var Yy=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Ky(e))},t}(),Ky=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return e.prototype._next=function(n){this.hasSubscription||(this.hasSubscription=!0,this.add(oe(n,new ie(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(se);function dl(t,e){return e?function(n){return n.pipe(dl(function(r,i){return pt(t(r,i)).pipe(Be(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new Xy(t))}}var Xy=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new ew(e,this.project))},t}(),ew=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(n){this.hasSubscription||this.tryNext(n)},e.prototype.tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(se);function tw(t,e,n){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new nw(t,e,n))}}var nw=function(){function t(e,n,r){this.project=e,this.concurrent=n,this.scheduler=r}return t.prototype.call=function(e,n){return n.subscribe(new rw(e,this.project,this.concurrent,this.scheduler))},t}(),rw=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.project=r,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(n){var r=n.subscriber,i=n.result,s=n.value,o=n.index;r.subscribeToProjection(i,s,o)},e.prototype._next=function(n){var r=this.destination;if(r.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){r.next(n);try{var s=this.project,o=s(n,i);if(!this.scheduler)this.subscribeToProjection(o,n,i);else{var a={subscriber:this,result:o,value:n,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(l){r.error(l)}}else this.buffer.push(n)},e.prototype.subscribeToProjection=function(n,r,i){this.active++;var s=this.destination;s.add(oe(n,new ie(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this._next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n&&n.length>0&&this._next(n.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(se);function iw(t){return function(e){return e.lift(new sw(t))}}var sw=function(){function t(e){this.callback=e}return t.prototype.call=function(e,n){return n.subscribe(new ow(e,this.callback))},t}(),ow=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.add(new re(r)),i}return e}(M);function aw(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(n){return n.lift(new pl(t,n,!1,e))}}var pl=function(){function t(e,n,r,i){this.predicate=e,this.source=n,this.yieldIndex=r,this.thisArg=i}return t.prototype.call=function(e,n){return n.subscribe(new cw(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),cw=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.predicate=r,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete(),this.unsubscribe()},e.prototype._next=function(n){var r=this,i=r.predicate,s=r.thisArg,o=this.index++;try{var a=i.call(s||this,n,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:n)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(M);function uw(t,e){return function(n){return n.lift(new pl(t,n,!0,e))}}function lw(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Et(function(i,s){return t(i,s,r)}):_t,uo(1),n?or(e):gi(function(){return new ir}))}}function hw(){return function(e){return e.lift(new fw)}}var fw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new dw(e))},t}(),dw=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(n){},e}(M);function pw(){return function(t){return t.lift(new bw)}}var bw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new gw(e))},t}(),gw=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete()},e.prototype._next=function(n){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(M);function Tr(t){return function(n){return t===0?_n():n.lift(new mw(t))}}var mw=function(){function t(e){if(this.total=e,this.total<0)throw new ln}return t.prototype.call=function(e,n){return n.subscribe(new vw(e,this.total))},t}(),vw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.ring=new Array,i.count=0,i}return e.prototype._next=function(n){var r=this.ring,i=this.total,s=this.count++;if(r.length<i)r.push(n);else{var o=s%i;r[o]=n}},e.prototype._complete=function(){var n=this.destination,r=this.count;if(r>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=r++%i;n.next(s[a])}n.complete()},e}(M);function yw(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Et(function(i,s){return t(i,s,r)}):_t,Tr(1),n?or(e):gi(function(){return new ir}))}}function ww(t){return function(e){return e.lift(new _w(t))}}var _w=function(){function t(e){this.value=e}return t.prototype.call=function(e,n){return n.subscribe(new Sw(e,this.value))},t}(),Sw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.value=r,i}return e.prototype._next=function(n){this.destination.next(this.value)},e}(M);function Ew(){return function(e){return e.lift(new Cw)}}var Cw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Iw(e))},t}(),Iw=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){this.destination.next(ht.createNext(n))},e.prototype._error=function(n){var r=this.destination;r.next(ht.createError(n)),r.complete()},e.prototype._complete=function(){var n=this.destination;n.next(ht.createComplete()),n.complete()},e}(M);function Ar(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new xw(t,e,n))}}var xw=function(){function t(e,n,r){r===void 0&&(r=!1),this.accumulator=e,this.seed=n,this.hasSeed=r}return t.prototype.call=function(e,n){return n.subscribe(new kw(e,this.accumulator,this.seed,this.hasSeed))},t}(),kw=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(n){this.hasSeed=!0,this._seed=n},enumerable:!0,configurable:!0}),e.prototype._next=function(n){if(!this.hasSeed)this.seed=n,this.destination.next(n);else return this._tryNext(n)},e.prototype._tryNext=function(n){var r=this.index++,i;try{i=this.accumulator(this.seed,n,r)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(M);function mi(t,e){return arguments.length>=2?function(r){return os(Ar(t,e),Tr(1),or(e))(r)}:function(r){return os(Ar(function(i,s,o){return t(i,s,o+1)}),Tr(1))(r)}}function Rw(t){var e=typeof t=="function"?function(n,r){return t(n,r)>0?n:r}:function(n,r){return n>r?n:r};return mi(e)}function Mw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Fu.apply(void 0,[n].concat(t)))}}function Tw(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?$t(function(){return t},e,n):(typeof e=="number"&&(n=e),$t(function(){return t},n))}function Aw(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Nw(t,e,n))}}var Nw=function(){function t(e,n,r){this.accumulator=e,this.seed=n,this.concurrent=r}return t.prototype.call=function(e,n){return n.subscribe(new Ow(e,this.accumulator,this.seed,this.concurrent))},t}(),Ow=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(n){if(this.active<this.concurrent){var r=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,n,r)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(n)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(n){var r=this.destination;this.acc=n,this.hasValue=!0,r.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(se);function Lw(t){var e=typeof t=="function"?function(n,r){return t(n,r)<0?n:r}:function(n,r){return n<r?n:r};return mi(e)}function Dt(t,e){return function(r){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return r.lift(new jw(i,e));var s=Object.create(r,dm);return s.source=r,s.subjectFactory=i,s}}var jw=function(){function t(e,n){this.subjectFactory=e,this.selector=n}return t.prototype.call=function(e,n){var r=this.selector,i=this.subjectFactory(),s=r(i).subscribe(e);return s.add(n.subscribe(i)),s},t}();function $w(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&Ce(t[0])&&(t=t[0]),function(n){return n.lift(new Dw(t))}}var Dw=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,n){return n.subscribe(new Pw(e,this.nextSources))},t}(),Pw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.nextSources=r,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(n){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var n=this.nextSources.shift();if(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)}else this.destination.complete()},e}(se);function Fw(){return function(t){return t.lift(new Bw)}}var Bw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Vw(e))},t}(),Vw=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasPrev=!1,r}return e.prototype._next=function(n){var r;this.hasPrev?r=[this.prev,n]:this.hasPrev=!0,this.prev=n,r&&this.destination.next(r)},e}(M);function Hw(t,e){return function(n){return[Et(t,e)(n),Et(Vu(t,e))(n)]}}function Ww(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(n===0)throw new Error("list of properties cannot be empty.");return function(r){return Be(Uw(t,n))(r)}}function Uw(t,e){var n=function(r){for(var i=r,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return n}function zw(t){return t?Dt(function(){return new ge},t):Dt(new ge)}function Gw(t){return function(e){return Dt(new wu(t))(e)}}function qw(){return function(t){return Dt(new Sn)(t)}}function Jw(t,e,n,r){n&&typeof n!="function"&&(r=n);var i=typeof n=="function"?n:void 0,s=new qs(t,e,r);return function(o){return Dt(function(){return s},i)(o)}}function Qw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return t.length===1&&Ce(t[0])&&(t=t[0]),r.lift.call(Hu.apply(void 0,[r].concat(t)))}}function Zw(t){return t===void 0&&(t=-1),function(e){return t===0?_n():t<0?e.lift(new za(-1,e)):e.lift(new za(t-1,e))}}var za=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new Yw(e,this.count,this.source))},t}(),Yw=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var n=this,r=n.source,i=n.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(M);function Kw(t){return function(e){return e.lift(new Xw(t))}}var Xw=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new e_(e,this.notifier,n))},t}(),e_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var n=this,r=n.notifications,i=n.retriesSubscription;r&&(r.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var n=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=n,this},e.prototype.subscribeToRetries=function(){this.notifications=new ge;var n;try{var r=this.notifier;n=r(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=n,this.retriesSubscription=oe(n,new ie(this))},e}(se);function t_(t){return t===void 0&&(t=-1),function(e){return e.lift(new n_(t,e))}}var n_=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new r_(e,this.count,this.source))},t}(),r_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this,i=r.source,s=r.count;if(s===0)return t.prototype.error.call(this,n);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(M);function i_(t){return function(e){return e.lift(new s_(t,e))}}var s_=function(){function t(e,n){this.notifier=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new o_(e,this.notifier,this.source))},t}(),o_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{r=new ge;try{var o=this.notifier;i=o(r)}catch(a){return t.prototype.error.call(this,a)}s=oe(i,new ie(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=i,this.retriesSubscription=s,r.next(n)}},e.prototype._unsubscribe=function(){var n=this,r=n.errors,i=n.retriesSubscription;r&&(r.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var n=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=n,this.source.subscribe(this)},e}(se);function a_(t){return function(e){return e.lift(new c_(t))}}var c_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new u_(e),i=n.subscribe(r);return i.add(oe(this.notifier,new ie(r))),i},t}(),u_=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.hasValue=!1,n}return e.prototype._next=function(n){this.value=n,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(se);function l_(t,e){return e===void 0&&(e=Ie),function(n){return n.lift(new h_(t,e))}}var h_=function(){function t(e,n){this.period=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new f_(e,this.period,this.scheduler))},t}(),f_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.period=r,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(d_,r,{subscriber:s,period:r})),s}return e.prototype._next=function(n){this.lastValue=n,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(M);function d_(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function p_(t,e){return function(n){return n.lift(new b_(t,e))}}var b_=function(){function t(e,n){this.compareTo=e,this.comparator=n}return t.prototype.call=function(e,n){return n.subscribe(new g_(e,this.compareTo,this.comparator))},t}(),g_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.compareTo=r,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(r.subscribe(new m_(n,s))),s}return e.prototype._next=function(n){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(n),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var n=this,r=n._a,i=n._b,s=n.comparator;r.length>0&&i.length>0;){var o=r.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(l){this.destination.error(l)}c||this.emit(!1)}},e.prototype.emit=function(n){var r=this.destination;r.next(n),r.complete()},e.prototype.nextB=function(n){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(n),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(M),m_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.parent=r,i}return e.prototype._next=function(n){this.parent.nextB(n)},e.prototype._error=function(n){this.parent.error(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(M);function v_(){return new ge}function y_(){return function(t){return Us()(Dt(v_)(t))}}function w_(t,e,n){var r;return t&&typeof t=="object"?r=t:r={bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(i){return i.lift(__(r))}}function __(t){var e=t.bufferSize,n=e===void 0?Number.POSITIVE_INFINITY:e,r=t.windowTime,i=r===void 0?Number.POSITIVE_INFINITY:r,s=t.refCount,o=t.scheduler,a,c=0,l,h=!1,u=!1;return function(d){c++;var p;!a||h?(h=!1,a=new qs(n,i,o),p=a.subscribe(this),l=d.subscribe({next:function(g){a.next(g)},error:function(g){h=!0,a.error(g)},complete:function(){u=!0,l=void 0,a.complete()}}),u&&(l=void 0)):p=a.subscribe(this),this.add(function(){c--,p.unsubscribe(),p=void 0,l&&!u&&s&&c===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function S_(t){return function(e){return e.lift(new E_(t,e))}}var E_=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new C_(e,this.predicate,this.source))},t}(),C_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(n){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=n)},e.prototype._next=function(n){var r=this.index++;this.predicate?this.tryNext(n,r):this.applySingleValue(n)},e.prototype.tryNext=function(n,r){try{this.predicate(n,r,this.source)&&this.applySingleValue(n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var n=this.destination;this.index>0?(n.next(this.seenValue?this.singleValue:void 0),n.complete()):n.error(new ir)},e}(M);function I_(t){return function(e){return e.lift(new x_(t))}}var x_=function(){function t(e){this.total=e}return t.prototype.call=function(e,n){return n.subscribe(new k_(e,this.total))},t}(),k_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){++this.count>this.total&&this.destination.next(n)},e}(M);function R_(t){return function(e){return e.lift(new M_(t))}}var M_=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new ln}return t.prototype.call=function(e,n){return this._skipCount===0?n.subscribe(new M(e)):n.subscribe(new T_(e,this._skipCount))},t}(),T_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i._skipCount=r,i._count=0,i._ring=new Array(r),i}return e.prototype._next=function(n){var r=this._skipCount,i=this._count++;if(i<r)this._ring[i]=n;else{var s=i%r,o=this._ring,a=o[s];o[s]=n,this.destination.next(a)}},e}(M);function A_(t){return function(e){return e.lift(new N_(t))}}var N_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new O_(e,this.notifier))},t}(),O_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;i.hasValue=!1;var s=new ie(i);i.add(s),i.innerSubscription=s;var o=oe(r,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(n){this.hasValue&&t.prototype._next.call(this,n)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(se);function L_(t){return function(e){return e.lift(new j_(t))}}var j_=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,n){return n.subscribe(new $_(e,this.predicate))},t}(),$_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.predicate=r,i.skipping=!0,i.index=0,i}return e.prototype._next=function(n){var r=this.destination;this.skipping&&this.tryCallPredicate(n),this.skipping||r.next(n)},e.prototype.tryCallPredicate=function(n){try{var r=this.predicate(n,this.index++);this.skipping=!!r}catch(i){this.destination.error(i)}},e}(M);function D_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Ne(n)?(t.pop(),function(r){return Fn(t,r,n)}):function(r){return Fn(t,r)}}var P_=function(t){b(e,t);function e(n,r,i){r===void 0&&(r=0),i===void 0&&(i=wr);var s=t.call(this)||this;return s.source=n,s.delayTime=r,s.scheduler=i,(!hn(r)||r<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=wr),s}return e.create=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=wr),new e(n,r,i)},e.dispatch=function(n){var r=n.source,i=n.subscriber;return this.add(r.subscribe(i))},e.prototype._subscribe=function(n){var r=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,r,{source:i,subscriber:n})},e}(P);function F_(t,e){return e===void 0&&(e=0),function(r){return r.lift(new B_(t,e))}}var B_=function(){function t(e,n){this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return new P_(n,this.delay,this.scheduler).subscribe(e)},t}();function Bn(t,e){return typeof e=="function"?function(n){return n.pipe(Bn(function(r,i){return pt(t(r,i)).pipe(Be(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new V_(t))}}var V_=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new H_(e,this.project))},t}(),H_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.index=0,i}return e.prototype._next=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this._innerSub(r)},e.prototype._innerSub=function(n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new ie(this),s=this.destination;s.add(i),this.innerSubscription=oe(n,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var n=this.innerSubscription;(!n||n.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(n){this.destination.next(n)},e}(se);function W_(){return Bn(_t)}function U_(t,e){return e?Bn(function(){return t},e):Bn(function(){return t})}function z_(t){return function(e){return e.lift(new G_(t))}}var G_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new q_(e),i=oe(this.notifier,new ie(r));return i&&!r.seenValue?(r.add(i),n.subscribe(r)):r},t}(),q_=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.seenValue=!1,r}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(se);function J_(t,e){return e===void 0&&(e=!1),function(n){return n.lift(new Q_(t,e))}}var Q_=function(){function t(e,n){this.predicate=e,this.inclusive=n}return t.prototype.call=function(e,n){return n.subscribe(new Z_(e,this.predicate,this.inclusive))},t}(),Z_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.inclusive=i,s.index=0,s}return e.prototype._next=function(n){var r=this.destination,i;try{i=this.predicate(n,this.index++)}catch(s){r.error(s);return}this.nextOrComplete(n,i)},e.prototype.nextOrComplete=function(n,r){var i=this.destination;r?i.next(n):(this.inclusive&&i.next(n),i.complete())},e}(M);function Y_(t,e,n){return function(i){return i.lift(new K_(t,e,n))}}var K_=function(){function t(e,n,r){this.nextOrObserver=e,this.error=n,this.complete=r}return t.prototype.call=function(e,n){return n.subscribe(new X_(e,this.nextOrObserver,this.error,this.complete))},t}(),X_=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o._tapNext=et,o._tapError=et,o._tapComplete=et,o._tapError=i||et,o._tapComplete=s||et,cn(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||et,o._tapError=r.error||et,o._tapComplete=r.complete||et),o}return e.prototype._next=function(n){try{this._tapNext.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.next(n)},e.prototype._error=function(n){try{this._tapError.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.error(n)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(n){this.destination.error(n);return}return this.destination.complete()},e}(M),bl={leading:!0,trailing:!1};function eS(t,e){return e===void 0&&(e=bl),function(n){return n.lift(new tS(t,!!e.leading,!!e.trailing))}}var tS=function(){function t(e,n,r){this.durationSelector=e,this.leading=n,this.trailing=r}return t.prototype.call=function(e,n){return n.subscribe(new nS(e,this.durationSelector,this.leading,this.trailing))},t}(),nS=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.destination=n,o.durationSelector=r,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(n){this._hasValue=!0,this._sendValue=n,this._throttled||(this._leading?this.send():this.throttle(n))},e.prototype.send=function(){var n=this,r=n._hasValue,i=n._sendValue;r&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(n){var r=this.tryDurationSelector(n);r&&this.add(this._throttled=oe(r,new ie(this)))},e.prototype.tryDurationSelector=function(n){try{return this.durationSelector(n)}catch(r){return this.destination.error(r),null}},e.prototype.throttlingDone=function(){var n=this,r=n._throttled,i=n._trailing;r&&r.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(se);function rS(t,e,n){return e===void 0&&(e=Ie),n===void 0&&(n=bl),function(r){return r.lift(new iS(t,e,n.leading,n.trailing))}}var iS=function(){function t(e,n,r,i){this.duration=e,this.scheduler=n,this.leading=r,this.trailing=i}return t.prototype.call=function(e,n){return n.subscribe(new sS(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),sS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.duration=r,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(n){this.throttled?this.trailing&&(this._trailingValue=n,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(oS,this.duration,{subscriber:this})),this.leading?this.destination.next(n):this.trailing&&(this._trailingValue=n,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var n=this.throttled;n&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),n.unsubscribe(),this.remove(n),this.throttled=null)},e}(M);function oS(t){var e=t.subscriber;e.clearThrottle()}function aS(t){return t===void 0&&(t=Ie),function(e){return Zs(function(){return e.pipe(Ar(function(n,r){var i=n.current;return{value:r,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),Be(function(n){var r=n.current,i=n.last,s=n.value;return new cS(s,r-i)}))})}}var cS=function(){function t(e,n){this.value=e,this.interval=n}return t}();function gl(t,e,n){return n===void 0&&(n=Ie),function(r){var i=hl(t),s=i?+t-n.now():Math.abs(t);return r.lift(new uS(s,i,e,n))}}var uS=function(){function t(e,n,r,i){this.waitFor=e,this.absoluteTimeout=n,this.withObservable=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new lS(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),lS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.absoluteTimeout=r,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(n){var r=n.withObservable;n._unsubscribeAndRecycle(),n.add(oe(r,new ie(n)))},e.prototype.scheduleTimeout=function(){var n=this.action;n?this.action=n.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(n){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,n)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(se);function hS(t,e){return e===void 0&&(e=Ie),gl(t,Gs(new Mu),e)}function fS(t){return t===void 0&&(t=Ie),Be(function(e){return new dS(e,t.now())})}var dS=function(){function t(e,n){this.value=e,this.timestamp=n}return t}();function pS(t,e,n){return n===0?[e]:(t.push(e),t)}function bS(){return mi(pS,[])}function gS(t){return function(n){return n.lift(new mS(t))}}var mS=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,n){var r=new vS(e),i=n.subscribe(r);return i.closed||r.add(oe(this.windowBoundaries,new ie(r))),i},t}(),vS=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.window=new ge,n.next(r.window),r}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var n=this.window;n&&n.complete();var r=this.destination,i=this.window=new ge;r.next(i)},e}(se);function yS(t,e){return e===void 0&&(e=0),function(r){return r.lift(new wS(t,e))}}var wS=function(){function t(e,n){this.windowSize=e,this.startWindowEvery=n}return t.prototype.call=function(e,n){return n.subscribe(new _S(e,this.windowSize,this.startWindowEvery))},t}(),_S=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.destination=n,s.windowSize=r,s.startWindowEvery=i,s.windows=[new ge],s.count=0,n.next(s.windows[0]),s}return e.prototype._next=function(n){for(var r=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(n);var l=this.count-s+1;if(l>=0&&l%r===0&&!this.closed&&o.shift().complete(),++this.count%r===0&&!this.closed){var h=new ge;o.push(h),i.next(h)}},e.prototype._error=function(n){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(M);function SS(t){var e=Ie,n=null,r=Number.POSITIVE_INFINITY;return Ne(arguments[3])&&(e=arguments[3]),Ne(arguments[2])?e=arguments[2]:hn(arguments[2])&&(r=Number(arguments[2])),Ne(arguments[1])?e=arguments[1]:hn(arguments[1])&&(n=Number(arguments[1])),function(s){return s.lift(new ES(t,n,r,e))}}var ES=function(){function t(e,n,r,i){this.windowTimeSpan=e,this.windowCreationInterval=n,this.maxWindowSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new IS(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),CS=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._numberOfNextedValues=0,n}return e.prototype.next=function(n){this._numberOfNextedValues++,t.prototype.next.call(this,n)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(ge),IS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.destination=n,a.windowTimeSpan=r,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:c,context:null},h={windowTimeSpan:r,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(ml,r,l)),a.add(o.schedule(kS,i,h))}else{var u={subscriber:a,window:c,windowTimeSpan:r};a.add(o.schedule(xS,r,u))}return a}return e.prototype._next=function(n){for(var r=this.windows,i=r.length,s=0;s<i;s++){var o=r[s];o.closed||(o.next(n),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(n){for(var r=this.windows;r.length>0;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){for(var n=this.windows;n.length>0;){var r=n.shift();r.closed||r.complete()}this.destination.complete()},e.prototype.openWindow=function(){var n=new CS;this.windows.push(n);var r=this.destination;return r.next(n),n},e.prototype.closeWindow=function(n){n.complete();var r=this.windows;r.splice(r.indexOf(n),1)},e}(M);function xS(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function kS(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:n,window:s,context:a};a.subscription=r.schedule(ml,e,c),o.add(a.subscription),o.schedule(t,i)}function ml(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function RS(t,e){return function(n){return n.lift(new MS(t,e))}}var MS=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new TS(e,this.openings,this.closingSelector))},t}(),TS=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.openings=r,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=ft(s,r,r)),s}return e.prototype._next=function(n){var r=this.contexts;if(r)for(var i=r.length,s=0;s<i;s++)r[s].window.next(n)},e.prototype._error=function(n){var r=this.contexts;if(this.contexts=null,r)for(var i=r.length,s=-1;++s<i;){var o=r[s];o.window.error(n),o.subscription.unsubscribe()}t.prototype._error.call(this,n)},e.prototype._complete=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(n,r,i,s,o){if(n===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(r)}catch(d){return this.error(d)}var l=new ge,h=new re,u={window:l,subscription:h};this.contexts.push(u);var f=ft(this,a,u);f.closed?this.closeWindow(this.contexts.length-1):(f.context=u,h.add(f)),this.destination.next(l)}else this.closeWindow(this.contexts.indexOf(n))},e.prototype.notifyError=function(n){this.error(n)},e.prototype.notifyComplete=function(n){n!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(n.context))},e.prototype.closeWindow=function(n){if(n!==-1){var r=this.contexts,i=r[n],s=i.window,o=i.subscription;r.splice(n,1),s.complete(),o.unsubscribe()}},e}(Vt);function AS(t){return function(n){return n.lift(new NS(t))}}var NS=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new OS(e,this.closingSelector))},t}(),OS=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.closingSelector=r,i.openWindow(),i}return e.prototype.notifyNext=function(n,r,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(n){this.openWindow(n)},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(n){n===void 0&&(n=null),n&&(this.remove(n),n.unsubscribe());var r=this.window;r&&r.complete();var i=this.window=new ge;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=ft(this,s))},e}(Vt);function LS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){var r;typeof t[t.length-1]=="function"&&(r=t.pop());var i=t;return n.lift(new jS(i,r))}}var jS=function(){function t(e,n){this.observables=e,this.project=n}return t.prototype.call=function(e,n){return n.subscribe(new $S(e,this.observables,this.project))},t}(),$S=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;s.observables=r,s.project=i,s.toRespond=[];var o=r.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=r[a];s.add(ft(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(n,r,i){this.values[i]=r;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(n){if(this.toRespond.length===0){var r=[n].concat(this.values);this.project?this._tryProject(r):this.destination.next(r)}},e.prototype._tryProject=function(n){var r;try{r=this.project.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Vt);function DS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Uu.apply(void 0,[r].concat(t)))}}function PS(t){return function(e){return e.lift(new zu(t))}}const FS=Object.freeze(Object.defineProperty({__proto__:null,audit:cl,auditTime:F1,buffer:B1,bufferCount:W1,bufferTime:q1,bufferToggle:K1,bufferWhen:ty,catchError:iy,combineAll:ay,combineLatest:cy,concat:uy,concatAll:ju,concatMap:ll,concatMapTo:ly,count:hy,debounce:py,debounceTime:my,defaultIfEmpty:or,delay:Ey,delayWhen:ky,dematerialize:Ay,distinct:Ly,distinctUntilChanged:fl,distinctUntilKeyChanged:Fy,elementAt:zy,endWith:Gy,every:qy,exhaust:Zy,exhaustMap:dl,expand:tw,filter:Et,finalize:iw,find:aw,findIndex:uw,first:lw,flatMap:av,groupBy:bm,ignoreElements:hw,isEmpty:pw,last:yw,map:Be,mapTo:ww,materialize:Ew,max:Rw,merge:Mw,mergeAll:Qs,mergeMap:$t,mergeMapTo:Tw,mergeScan:Aw,min:Lw,multicast:Dt,observeOn:Im,onErrorResumeNext:$w,pairwise:Fw,partition:Hw,pluck:Ww,publish:zw,publishBehavior:Gw,publishLast:qw,publishReplay:Jw,race:Qw,reduce:mi,refCount:Us,repeat:Zw,repeatWhen:Kw,retry:t_,retryWhen:i_,sample:a_,sampleTime:l_,scan:Ar,sequenceEqual:p_,share:y_,shareReplay:w_,single:S_,skip:I_,skipLast:R_,skipUntil:A_,skipWhile:L_,startWith:D_,subscribeOn:F_,switchAll:W_,switchMap:Bn,switchMapTo:U_,take:uo,takeLast:Tr,takeUntil:z_,takeWhile:J_,tap:Y_,throttle:eS,throttleTime:rS,throwIfEmpty:gi,timeInterval:aS,timeout:hS,timeoutWith:gl,timestamp:fS,toArray:bS,window:gS,windowCount:yS,windowTime:SS,windowToggle:RS,windowWhen:AS,withLatestFrom:LS,zip:DS,zipAll:PS},Symbol.toStringTag,{value:"Module"})),lo=Vn(FS);var vi={},$e={};Object.defineProperty($e,"__esModule",{value:!0});$e.ClientMessagePublishEvent=$e.ClientMessageSetSessionConfig=$e.ClientMessageGetSessionConfig=$e.ClientMessageIsLinked=$e.ClientMessageHostSession=void 0;function BS(t){return Object.assign({type:"HostSession"},t)}$e.ClientMessageHostSession=BS;function VS(t){return Object.assign({type:"IsLinked"},t)}$e.ClientMessageIsLinked=VS;function HS(t){return Object.assign({type:"GetSessionConfig"},t)}$e.ClientMessageGetSessionConfig=HS;function WS(t){return Object.assign({type:"SetSessionConfig"},t)}$e.ClientMessageSetSessionConfig=WS;function US(t){return Object.assign({type:"PublishEvent"},t)}$e.ClientMessagePublishEvent=US;var vl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=ni,n=lo;var r;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(r=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(r.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(r.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,n.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(vl);var yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.isServerMessageFail=void 0;function zS(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}yi.isServerMessageFail=zS;Object.defineProperty(vi,"__esModule",{value:!0});vi.WalletSDKConnection=void 0;const He=ni,H=lo,kn=gn,Gt=Un,Rn=$e,Mn=bn,gr=vl,Zi=yi,Ga=1e4,GS=6e4;class qS{constructor(e,n,r,i,s=WebSocket){this.sessionId=e,this.sessionKey=n,this.diagnostic=i,this.subscriptions=new He.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Gt.IntNumber)(1),this.connectedSubject=new He.BehaviorSubject(!1),this.linkedSubject=new He.BehaviorSubject(!1),this.sessionConfigSubject=new He.ReplaySubject(1);const o=new gr.RxWebSocket(r+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,H.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Mn.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:kn.Session.hash(e)})}),(0,H.skip)(1),(0,H.filter)(a=>a===gr.ConnectionState.DISCONNECTED&&!this.destroyed),(0,H.delay)(5e3),(0,H.filter)(a=>!this.destroyed),(0,H.flatMap)(a=>o.connect()),(0,H.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,H.skip)(2),(0,H.switchMap)(a=>(0,He.iif)(()=>a===gr.ConnectionState.CONNECTED,this.authenticate().pipe((0,H.tap)(c=>this.sendIsLinked()),(0,H.tap)(c=>this.sendGetSessionConfig()),(0,H.map)(c=>!0)),(0,He.of)(!1))),(0,H.distinctUntilChanged)(),(0,H.catchError)(a=>(0,He.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,H.skip)(1),(0,H.switchMap)(a=>(0,He.iif)(()=>a===gr.ConnectionState.CONNECTED,(0,He.timer)(0,Ga)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,H.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,H.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Mn.EVENTS.LINKED,{sessionIdHash:kn.Session.hash(e),linked:l.linked,type:a.type,onlineGuests:l.onlineGuests}),this.linkedSubject.next(l.linked||l.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,H.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Mn.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:kn.Session.hash(e),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.sessionConfigSubject.next({webhookId:l.webhookId,webhookUrl:l.webhookUrl,metadata:l.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Mn.EVENTS.STARTED_CONNECTING,{sessionIdHash:kn.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Mn.EVENTS.DISCONNECTED,{sessionIdHash:kn.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,H.filter)(e=>e),(0,H.take)(1),(0,H.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,H.filter)(e=>e),(0,H.take)(1),(0,H.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,H.filter)(e=>{if(e.type!=="Event")return!1;const n=e;return typeof n.sessionId=="string"&&typeof n.eventId=="string"&&typeof n.event=="string"&&typeof n.data=="string"}),(0,H.map)(e=>e))}setSessionMetadata(e,n){const r=(0,Rn.ClientMessageSetSessionConfig)({id:(0,Gt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:n}});return this.onceConnected$.pipe((0,H.flatMap)(i=>this.makeRequest(r)),(0,H.map)(i=>{if((0,Zi.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,n,r=!1){const i=(0,Rn.ClientMessagePublishEvent)({id:(0,Gt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:n,callWebhook:r});return this.onceLinked$.pipe((0,H.flatMap)(s=>this.makeRequest(i)),(0,H.map)(s=>{if((0,Zi.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ga*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,n=GS){const r=e.id;try{this.sendData(e)}catch(i){return(0,He.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,H.timeoutWith)(n,(0,He.throwError)(new Error(`request ${r} timed out`))),(0,H.filter)(i=>i.id===r),(0,H.take)(1))}authenticate(){const e=(0,Rn.ClientMessageHostSession)({id:(0,Gt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,H.map)(n=>{if((0,Zi.isServerMessageFail)(n))throw new Error(n.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Rn.ClientMessageIsLinked)({id:(0,Gt.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Rn.ClientMessageGetSessionConfig)({id:(0,Gt.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}vi.WalletSDKConnection=qS;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.decrypt=dn.encrypt=void 0;const Nr=x;async function JS(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,Nr.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),l=new Uint8Array(a),h=new Uint8Array(c),u=new Uint8Array([...n,...l,...h]);return(0,Nr.uint8ArrayToHex)(u)}dn.encrypt=JS;function QS(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((n,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Nr.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Nr.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),h={name:"AES-GCM",iv:new Uint8Array(o)};try{const u=await window.crypto.subtle.decrypt(h,i,l),f=new TextDecoder;n(f.decode(u))}catch(u){r(u)}})()})}dn.decrypt=QS;var wi={},_i={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(_i);Object.defineProperty(wi,"__esModule",{value:!0});wi.Web3RequestCanceledMessage=void 0;const ZS=_i;function YS(t){return{type:ZS.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}wi.Web3RequestCanceledMessage=YS;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.Web3RequestMessage=void 0;const KS=_i;function XS(t){return Object.assign({type:KS.RelayMessageType.WEB3_REQUEST},t)}Si.Web3RequestMessage=XS;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.isWeb3ResponseMessage=pn.Web3ResponseMessage=void 0;const yl=_i;function e2(t){return Object.assign({type:yl.RelayMessageType.WEB3_RESPONSE},t)}pn.Web3ResponseMessage=e2;function t2(t){return t&&t.type===yl.RelayMessageType.WEB3_RESPONSE}pn.isWeb3ResponseMessage=t2;var n2=L&&L.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),r2=L&&L.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wl=L&&L.__decorate||function(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},i2=L&&L.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&n2(e,t,n);return r2(e,t),e},s2=L&&L.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});pi.WalletSDKRelay=void 0;const _l=s2(bi),xt=ni,le=lo,we=bn,o2=vi,qt=Hn,a2=Un,X=x,gt=i2(dn),mt=gn,mr=Ge,me=Pr,c2=wi,u2=Si,Le=K,ke=pn;class ze extends mr.WalletSDKRelayAbstract{constructor(e){var n;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new xt.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new xt.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:r,ui:i,connection:s}=this.subscribe();if(this._session=r,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(n=e.reloadOnDisconnect)!==null&&n!==void 0?n:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=mt.Session.load(this.storage)||new mt.Session(this.storage).save(),n=new o2.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(n.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(n.incomingEvent$.pipe((0,le.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(n.linked$.pipe((0,le.skip)(1),(0,le.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(mr.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(we.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=n.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(mr.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(mr.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,le.mergeMap)(i=>(0,xt.zip)(gt.decrypt(i.metadata.ChainId,e.secret),gt.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,le.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),ze.accountRequestCallbackIds.size>0&&(Array.from(ze.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,ke.Web3ResponseMessage)({id:s,response:(0,Le.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),ze.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:n.connected$,chainId$:this.dappDefaultChainSubject});return n.connect(),{session:e,ui:r,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,le.timeout)(1e3),(0,le.catchError)(e=>(0,xt.of)(null))).subscribe(e=>{var n,r,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(r=this.diagnostic)===null||r===void 0||r.log(we.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=mt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:mt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new xt.Subscription;const{session:a,ui:c,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var n;(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,n){this.appName=e,this.appLogoUrl=n}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,n){this.storage.setItem(e,n)}signEthereumMessage(e,n,r,i){return this.sendRequest({method:me.Web3Method.signEthereumMessage,params:{message:(0,X.hexStringFromBuffer)(e,!0),address:n,addPrefix:r,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,n,r){return this.sendRequest({method:me.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,X.hexStringFromBuffer)(e,!0),signature:(0,X.hexStringFromBuffer)(n,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:me.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,X.bigIntStringFromBN)(e.weiValue),data:(0,X.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,X.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:me.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,X.bigIntStringFromBN)(e.weiValue),data:(0,X.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,X.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,X.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,X.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:me.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,X.hexStringFromBuffer)(e,!0),chainId:n}})}scanQRCode(e){return this.sendRequest({method:me.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,X.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,n){return this.sendRequest({method:me.Web3Method.generic,params:{action:n,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let n=null;const r=(0,X.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,o),n==null||n()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,c=>{if(n==null||n(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,n){var r;const i=(0,u2.Web3RequestMessage)({id:e,request:n}),s=mt.Session.load(this.storage);(r=this.diagnostic)===null||r===void 0||r.log(we.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(we.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const n=(0,c2.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",n,!1).subscribe())}publishEvent(e,n,r){const i=this.session.secret;return new xt.Observable(s=>{gt.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,le.mergeMap)(s=>this.connection.publishEvent(e,s,r)))}handleIncomingEvent(e){try{this.subscriptions.add((0,xt.from)(gt.decrypt(e.data,this.session.secret)).pipe((0,le.map)(n=>JSON.parse(n))).subscribe({next:n=>{const r=(0,ke.isWeb3ResponseMessage)(n)?n:null;r&&this.handleWeb3ResponseMessage(r)},error:()=>{var n;(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var n;const{response:r}=e;if((n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Le.isRequestEthereumAccountsResponse)(r)){ze.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),ze.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,n,r,i){var s;const o=(s=r==null?void 0:r.message)!==null&&s!==void 0?s:(0,qt.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:e,response:{method:n,errorMessage:o,errorCode:i}}))}invokeCallback(e){const n=this.relayEventManager.callbacks.get(e.id);n&&(n(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:me.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},n=(0,X.randomBytesHex)(8),r=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(n,l=>{if(this.ui.hideRequestEthereumAccounts(),l.errorMessage)return o(new Error(l.errorMessage));s(l)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let l;try{(0,X.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){const l=h=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:n,response:(0,Le.RequestEthereumAccountsResponse)(h)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:l})}else{const l=qt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(l)})}ze.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,e)}),cancel:r}}selectProvider(e){const n={method:me.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,X.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(r,h=>{if(h.errorMessage)return a(new Error(h.errorMessage));o(h)});const c=h=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:r,response:(0,Le.SelectProviderResponse)(a2.ProviderType.Unselected)}))},l=h=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:r,response:(0,Le.SelectProviderResponse)(h)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,n,r,i,s,o){const a={method:me.Web3Method.watchAsset,params:{type:e,options:{address:n,symbol:r,decimals:i,image:s},chainId:o}};let c=null;const l=(0,X.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,f),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}));const u=new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,S=>{if(c==null||c(),S.errorMessage)return d(new Error(S.errorMessage));f(S)});const p=S=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:l,response:(0,Le.WatchAssetReponse)(!1)}))},g=()=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:l,response:(0,Le.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:g,onCancel:p,type:e,address:n,symbol:r,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:h,promise:u}}addEthereumChain(e,n,r,i,s,o){const a={method:me.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:s,iconUrls:r,nativeCurrency:o}};let c=null;const l=(0,X.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,f),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload})),{promise:new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,S=>{if(c==null||c(),S.errorMessage)return d(new Error(S.errorMessage));f(S)});const p=S=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:l,response:(0,Le.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},g=S=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:l,response:(0,Le.AddEthereumChainResponse)({isApproved:!0,rpcUrl:S})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:p,onApprove:g,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:h}}switchEthereumChain(e,n){const r={method:me.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:n})},i=(0,X.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,r.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,u=>{if((0,Le.isErrorResponse)(u)&&u.errorCode)return c(qt.standardErrors.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(u.errorMessage)return c(new Error(u.errorMessage));a(u)});const l=u=>{var f;if(u){const d=(f=(0,qt.getErrorCode)(u))!==null&&f!==void 0?f:qt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,me.Web3Method.switchEthereumChain,u instanceof Error?u:qt.standardErrors.provider.unsupportedChain(e),d)}else this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:i,response:(0,Le.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},h=u=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:i,response:(0,Le.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:u})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:h,chainId:r.params.chainId,address:r.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,r)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return mt.Session.hash(this._session.id)}sendRequestStandalone(e,n){const r=s=>{this.handleErrorResponse(e,n.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,ke.Web3ResponseMessage)({id:e,response:s}))};switch(n.method){case me.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:n,onSuccess:i});break;default:r();break}}onSessionConfigChanged(e){}}ze.accountRequestCallbackIds=new Set;wl([_l.default],ze.prototype,"resetAndReload",null);wl([_l.default],ze.prototype,"handleIncomingEvent",null);pi.WalletSDKRelay=ze;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.WalletSDKRelayEventManager=void 0;const l2=x;class h2{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=(0,l2.prepend0x)(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}Ei.WalletSDKRelayEventManager=h2;const f2="@coinbase/wallet-sdk",d2="3.7.1",p2="Coinbase Wallet JavaScript SDK",b2=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],g2="dist/index.js",m2="dist/index.d.ts",v2="https://github.com/coinbase/coinbase-wallet-sdk.git",y2="Coinbase, Inc.",w2="Apache-2.0",_2={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},S2={"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"6.1.0","eth-json-rpc-filters":"5.1.0","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},E2={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.4.0","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.76.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},C2={node:">= 10.0.0"},I2={name:f2,version:d2,description:p2,keywords:b2,main:g2,types:m2,repository:v2,author:y2,license:w2,scripts:_2,dependencies:S2,devDependencies:E2,engines:C2};Object.defineProperty($n,"__esModule",{value:!0});$n.CoinbaseWalletSDK=void 0;const x2=$r,k2=Dr,R2=nn,M2=Kr,T2=pi,A2=Ei,N2=x,O2={}.LINK_API_URL||"https://www.walletlink.org",Sl={}.SDK_VERSION||I2.version||"unknown";class Ci{constructor(e){var n,r,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||O2;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new M2.WalletSDKUI(l),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this._overrideIsCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new k2.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Ci.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new A2.WalletSDKRelayEventManager,this._relay=new T2.WalletSDKRelay({linkAPIUrl:s,version:Sl,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",n=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,n),this._reloadOnDisconnect===!1&&typeof r.disableReloadOnDisconnect=="function"&&r.disableReloadOnDisconnect(),r;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new R2.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:n,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,n){var r;this._appName=e||"DApp",this._appLogoUrl=n||(0,N2.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(r=this._relay)===null||r===void 0||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const n=this.walletExtension;n?n.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,n;return(n=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&n!==void 0?n:null}getCoinbaseWalletLogo(e,n=240){return(0,x2.walletLogo)(e,n)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,n;try{const r=(e=window.ethereum)!==null&&e!==void 0?e:(n=window.top)===null||n===void 0?void 0:n.ethereum;return r&&"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}$n.CoinbaseWalletSDK=Ci;Ci.VERSION=Sl;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=$n,n=nn;var r=$n;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=nn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)})(ps);const L2=Cl(ps),z2=Al({__proto__:null,default:L2},[ps]);export{z2 as i};
18
+ `;var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.StatusDotIcon=void 0;const Da=Oe;function Jv(t){return(0,Da.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Da.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}oi.StatusDotIcon=Jv;var ai={};function Yu(t){this.mode=Te.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var r=[],i=this.data.charCodeAt(e);i>65536?(r[0]=240|(i&1835008)>>>18,r[1]=128|(i&258048)>>>12,r[2]=128|(i&4032)>>>6,r[3]=128|i&63):i>2048?(r[0]=224|(i&61440)>>>12,r[1]=128|(i&4032)>>>6,r[2]=128|i&63):i>128?(r[0]=192|(i&1984)>>>6,r[1]=128|i&63):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Yu.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e<n;e++)t.put(this.parsedData[e],8)}};function st(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}st.prototype={addData:function(t){var e=new Yu(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=st.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=te.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,l=this.modules[s][a];l&&(r.beginFill(0,100),r.moveTo(c,o),r.lineTo(c+i,o),r.lineTo(c+i,o+i),r.lineTo(c,o+i),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=te.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(this.modules[r][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[r+s][i+o]=!0:this.modules[r+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=te.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=te.getBCHTypeInfo(n),i=0;i<15;i++){var s=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[r][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var l=te.getMask(e,r,o-a);l&&(c=!c),this.modules[r][o-a]=c,i--,i==-1&&(s++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}};st.PAD0=236;st.PAD1=17;st.createData=function(t,e,n){for(var r=tt.getRSBlocks(t,e),i=new Ku,s=0;s<n.length;s++){var o=n[s];i.put(o.mode,4),i.put(o.getLength(),te.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<r.length;s++)a+=r[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(st.PAD0,8),i.getLengthInBits()>=a*8));)i.put(st.PAD1,8);return st.createBytes(i,r)};st.createBytes=function(t,e){for(var n=0,r=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,l=e[a].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),s[a]=new Array(c);for(var h=0;h<s[a].length;h++)s[a][h]=255&t.buffer[h+n];n+=c;var u=te.getErrorCorrectPolynomial(l),d=new tn(s[a],u.getLength()-1),f=d.mod(u);o[a]=new Array(u.getLength()-1);for(var h=0;h<o[a].length;h++){var p=h+f.getLength()-o[a].length;o[a][h]=p>=0?f.get(p):0}}for(var g=0,h=0;h<e.length;h++)g+=e[h].totalCount;for(var S=new Array(g),v=0,h=0;h<r;h++)for(var a=0;a<e.length;a++)h<s[a].length&&(S[v++]=s[a][h]);for(var h=0;h<i;h++)for(var a=0;a<e.length;a++)h<o[a].length&&(S[v++]=o[a][h]);return S};var Te={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},wt={L:1,M:0,Q:3,H:2},bt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},te={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;te.getBCHDigit(e)-te.getBCHDigit(te.G15)>=0;)e^=te.G15<<te.getBCHDigit(e)-te.getBCHDigit(te.G15);return(t<<10|e)^te.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;te.getBCHDigit(e)-te.getBCHDigit(te.G18)>=0;)e^=te.G18<<te.getBCHDigit(e)-te.getBCHDigit(te.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return te.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case bt.PATTERN000:return(e+n)%2==0;case bt.PATTERN001:return e%2==0;case bt.PATTERN010:return n%3==0;case bt.PATTERN011:return(e+n)%3==0;case bt.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case bt.PATTERN101:return e*n%2+e*n%3==0;case bt.PATTERN110:return(e*n%2+e*n%3)%2==0;case bt.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new tn([1],0),n=0;n<t;n++)e=e.multiply(new tn([1,be.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Te.MODE_NUMBER:return 10;case Te.MODE_ALPHA_NUM:return 9;case Te.MODE_8BIT_BYTE:return 8;case Te.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Te.MODE_NUMBER:return 12;case Te.MODE_ALPHA_NUM:return 11;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Te.MODE_NUMBER:return 14;case Te.MODE_ALPHA_NUM:return 13;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(r+a,i+c)&&s++;s>5&&(n+=3+s-5)}for(var r=0;r<e-1;r++)for(var i=0;i<e-1;i++){var l=0;t.isDark(r,i)&&l++,t.isDark(r+1,i)&&l++,t.isDark(r,i+1)&&l++,t.isDark(r+1,i+1)&&l++,(l==0||l==4)&&(n+=3)}for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);for(var h=0,i=0;i<e;i++)for(var r=0;r<e;r++)t.isDark(r,i)&&h++;var u=Math.abs(100*h/e/e-50)/5;return n+=u*10,n}},be={glog:function(t){if(t<1)throw new Error("glog("+t+")");return be.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return be.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ve=0;ve<8;ve++)be.EXP_TABLE[ve]=1<<ve;for(var ve=8;ve<256;ve++)be.EXP_TABLE[ve]=be.EXP_TABLE[ve-4]^be.EXP_TABLE[ve-5]^be.EXP_TABLE[ve-6]^be.EXP_TABLE[ve-8];for(var ve=0;ve<255;ve++)be.LOG_TABLE[be.EXP_TABLE[ve]]=ve;function tn(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}tn.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<t.getLength();r++)e[n+r]^=be.gexp(be.glog(this.get(n))+be.glog(t.get(r)));return new tn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=be.glog(this.get(0))-be.glog(t.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(var r=0;r<t.getLength();r++)n[r]^=be.gexp(be.glog(t.get(r))+e);return new tn(n,0).mod(t)}};function tt(t,e){this.totalCount=t,this.dataCount=e}tt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];tt.getRSBlocks=function(t,e){var n=tt.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,i=[],s=0;s<r;s++)for(var o=n[s*3+0],a=n[s*3+1],c=n[s*3+2],l=0;l<o;l++)i.push(new tt(a,c));return i};tt.getRsBlockTable=function(t,e){switch(e){case wt.L:return tt.RS_BLOCK_TABLE[(t-1)*4+0];case wt.M:return tt.RS_BLOCK_TABLE[(t-1)*4+1];case wt.Q:return tt.RS_BLOCK_TABLE[(t-1)*4+2];case wt.H:return tt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function Ku(){this.buffer=[],this.length=0}Ku.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ui=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Xu(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function n(c){switch(c){case"L":return wt.L;case"M":return wt.M;case"Q":return wt.Q;case"H":return wt.H;default:throw new Error("Unknwon error correction level: "+c)}}function r(c,l){for(var h=i(c),u=1,d=0,f=0,p=Ui.length;f<=p;f++){var g=Ui[f];if(!g)throw new Error("Content too long: expected "+d+" but got "+h);switch(l){case"L":d=g[0];break;case"M":d=g[1];break;case"Q":d=g[2];break;case"H":d=g[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(h<=d)break;u++}if(u>Ui.length)throw new Error("Content too long");return u}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=r(s,this.options.ecl),a=n(this.options.ecl);this.qrcode=new st(o,a),this.qrcode.addData(s),this.qrcode.make()}Xu.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var r=typeof e.pretty<"u"?!!e.pretty:!0,i=r?" ":"",s=r?`\r
19
+ `:"",o=e.width,a=e.height,c=n.length,l=o/(c+2*e.padding),h=a/(c+2*e.padding),u=typeof e.join<"u"?!!e.join:!1,d=typeof e.swap<"u"?!!e.swap:!1,f=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,p=typeof e.predefined<"u"?!!e.predefined:!1,g=p?i+'<defs><path id="qrmodule" d="M0 0 h'+h+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",S=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,v="",m="",E=0;E<c;E++)for(var C=0;C<c;C++){var y=n[C][E];if(y){var T=C*l+e.padding*l,F=E*h+e.padding*h;if(d){var K=T;T=F,F=K}if(u){var L=l+T,V=h+F;T=Number.isInteger(T)?Number(T):T.toFixed(2),F=Number.isInteger(F)?Number(F):F.toFixed(2),L=Number.isInteger(L)?Number(L):L.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),m+="M"+T+","+F+" V"+V+" H"+L+" V"+F+" H"+T+" Z "}else p?v+=i+'<use x="'+T.toString()+'" y="'+F.toString()+'" href="#qrmodule" />'+s:v+=i+'<rect x="'+T.toString()+'" y="'+F.toString()+'" width="'+l+'" height="'+h+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}u&&(v=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let fe="";if(this.options.image!==void 0&&this.options.image.svg){const _=o*this.options.image.width/100,w=a*this.options.image.height/100,M=o/2-_/2,k=a/2-w/2;fe+=`<svg x="${M}" y="${k}" width="${_}" height="${w}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,fe+=this.options.image.svg+s,fe+="</svg>"}var q="";switch(t.container){case"svg":f&&(q+='<?xml version="1.0" standalone="yes"?>'+s),q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,q+=g+S+v,q+=fe,q+="</svg>";break;case"svg-viewbox":f&&(q+='<?xml version="1.0" standalone="yes"?>'+s),q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,q+=g+S+v,q+=fe,q+="</svg>";break;case"g":q+='<g width="'+o+'" height="'+a+'">'+s,q+=g+S+v,q+=fe,q+="</g>";break;default:q+=(g+S+v+fe).replace(/^\s+/,"");break}return q};var Qv=Xu,Zv=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0});ai.QRCode=void 0;const Yv=Oe,Pa=or,Kv=Zv(Qv),Xv=t=>{const[e,n]=(0,Pa.useState)("");return(0,Pa.useEffect)(()=>{var r,i;const s=new Kv.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(r=t.width)!==null&&r!==void 0?r:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=U.from(s.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${o}`)}),e?(0,Yv.h)("img",{src:e,alt:"QR Code"}):null};ai.QRCode=Xv;var ci={},io={};Object.defineProperty(io,"__esModule",{value:!0});io.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var e1=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ci,"__esModule",{value:!0});ci.Spinner=void 0;const gr=Oe,t1=e1(io),n1=t=>{var e;const n=(e=t.size)!==null&&e!==void 0?e:64,r=t.color||"#000";return(0,gr.h)("div",{class:"-cbwsdk-spinner"},(0,gr.h)("style",null,t1.default),(0,gr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,gr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};ci.Spinner=n1;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var En=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(it,"__esModule",{value:!0});it.CoinbaseAppSteps=it.CoinbaseWalletSteps=it.ConnectItem=it.ConnectContent=void 0;const De=En(jr),N=Oe,Fa=or,r1=I,i1=Un,s1=ii,o1=En(eo),a1=En(to),el=si,c1=En(no),u1=En(ro),l1=oi,h1=ai,f1=ci,d1=En(so),Ba={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:a1.default,steps:nl},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:o1.default,steps:rl}},p1=t=>{switch(t){case"coinbase-app":return c1.default;case"coinbase-wallet-app":default:return u1.default}},ps=t=>t==="light"?"#FFFFFF":"#0A0B0D";function b1(t){const{theme:e}=t,[n,r]=(0,Fa.useState)("coinbase-wallet-app"),i=(0,Fa.useCallback)(l=>{r(l)},[]),s=(0,r1.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Ba[n];if(!n)return null;const a=o.steps,c=n==="coinbase-app";return(0,N.h)("div",{"data-testid":"connect-content",class:(0,De.default)("-cbwsdk-connect-content",e)},(0,N.h)("style",null,d1.default),(0,N.h)("div",{class:"-cbwsdk-connect-content-header"},(0,N.h)("h2",{class:(0,De.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,N.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,N.h)(s1.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,N.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,N.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,N.h)("div",null,Object.entries(Ba).map(([l,h])=>(0,N.h)(tl,{key:l,title:h.title,description:h.description,icon:h.icon,selected:n===l,onClick:()=>i(l),theme:e}))),c&&(0,N.h)("div",{class:(0,De.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,N.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,N.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,N.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,N.h)(h1.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:p1(n),width:25,height:25}}),(0,N.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:i1.LIB_VERSION}),(0,N.h)("input",{type:"hidden",value:s})),(0,N.h)(a,{theme:e}),!t.isConnected&&(0,N.h)("div",{"data-testid":"connecting-spinner",class:(0,De.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,N.h)(f1.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,N.h)("p",null,"Connecting...")))))}it.ConnectContent=b1;function tl({title:t,description:e,icon:n,selected:r,theme:i,onClick:s}){return(0,N.h)("div",{onClick:s,class:(0,De.default)("-cbwsdk-connect-item",i,{selected:r})},(0,N.h)("div",null,(0,N.h)("img",{src:n,alt:t})),(0,N.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,N.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,N.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}it.ConnectItem=tl;function nl({theme:t}){return(0,N.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,N.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,N.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,N.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,N.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,N.h)("span",null,"Tap ",(0,N.h)("strong",null,"Scan")," "),(0,N.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,N.h)(el.QRCodeIcon,{fill:ps(t)})))))}it.CoinbaseWalletSteps=nl;function rl({theme:t}){return(0,N.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,N.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,N.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,N.h)("li",{class:(0,De.default)("-cbwsdk-wallet-steps-item",t)},(0,N.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,N.h)("span",null,"Tap ",(0,N.h)("strong",null,"More")),(0,N.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,N.h)(l1.StatusDotIcon,{fill:ps(t)})),(0,N.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,N.h)("strong",null,"Scan")),(0,N.h)("span",{class:(0,De.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,N.h)(el.QRCodeIcon,{fill:ps(t)})))))}it.CoinbaseAppSteps=rl;var ui={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.ArrowLeftIcon=void 0;const Va=Oe;function g1(t){return(0,Va.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Va.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}li.ArrowLeftIcon=g1;var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.LaptopIcon=void 0;const zi=Oe;function m1(t){return(0,zi.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,zi.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,zi.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}hi.LaptopIcon=m1;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.SafeIcon=void 0;const Ha=Oe;function v1(t){return(0,Ha.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ha.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}fi.SafeIcon=v1;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var il=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.TryExtensionContent=void 0;const Ct=il(jr),ue=Oe,qi=or,y1=li,w1=hi,_1=fi,S1=il(oo);function E1({theme:t}){const[e,n]=(0,qi.useState)(!1),r=(0,qi.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,qi.useCallback)(()=>{e?window.location.reload():(r(),n(!0))},[r,e]);return(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension",t)},(0,ue.h)("style",null,S1.default),(0,ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ue.h)("h3",{class:(0,Ct.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,ue.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ue.h)("button",{class:(0,Ct.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,ue.h)("div",null,!e&&(0,ue.h)(y1.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,ue.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ue.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ue.h)("span",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ue.h)(w1.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,ue.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ue.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ue.h)("span",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ue.h)(_1.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ue.h)("div",{class:(0,Ct.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ui.TryExtensionContent=E1;var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var sl=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});ri.ConnectDialog=void 0;const Gi=sl(jr),It=Oe,Ji=or,C1=it,I1=ui,k1=sl(ao),x1=t=>{const{isOpen:e,darkMode:n}=t,[r,i]=(0,Ji.useState)(!e),[s,o]=(0,Ji.useState)(!e);(0,Ji.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=n?"dark":"light";return(0,It.h)("div",{class:(0,Gi.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,It.h)("style",null,k1.default),(0,It.h)("div",{class:(0,Gi.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,It.h)("div",{class:"-cbwsdk-connect-dialog"},(0,It.h)("div",{class:(0,Gi.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,It.h)(C1.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,It.h)(I1.TryExtensionContent,{theme:a}))))};ri.ConnectDialog=x1;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LinkFlow=void 0;const Qi=Oe,Wa=ni,R1=ri;class M1{constructor(e){this.extensionUI$=new Wa.BehaviorSubject({}),this.subscriptions=new Wa.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(n=>{this.isConnected!==n&&(this.isConnected=n,this.render())})),this.subscriptions.add(this.chainId$.subscribe(n=>{this.chainId!==n&&(this.chainId=n,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Qi.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Qi.render)((0,Qi.h)(R1.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Xr.LinkFlow=M1;var ol={},co={};Object.defineProperty(co,"__esModule",{value:!0});co.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=O&&O.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const n=e(jr),r=Oe,i=or,s=e(co),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(u){switch(u){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(d){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=d.darkMode}attach(d){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",d.appendChild(this.root),this.render()}presentItem(d){const f=this.nextItemKey++;return this.items.set(f,d),this.render(),()=>{this.items.delete(f),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([d,f])=>(0,r.h)(t.SnackbarInstance,Object.assign({},f,{key:d}))))),this.root)}}t.Snackbar=c;const l=u=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,s.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},u.children));t.SnackbarContainer=l;const h=({autoExpand:u,message:d,menuItems:f,appSrc:p})=>{const[g,S]=(0,i.useState)(!0),[v,m]=(0,i.useState)(u??!1);(0,i.useEffect)(()=>{const C=[window.setTimeout(()=>{S(!1)},1),window.setTimeout(()=>{m(!0)},1e4)];return()=>{C.forEach(window.clearTimeout)}});const E=()=>{m(!v)};return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",g&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:E},(0,r.h)("img",{src:a(p),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},d),(0,r.h)("div",{class:"-gear-container"},!v&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),f&&f.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},f.map((C,y)=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:C.onClick,key:y},(0,r.h)("svg",{width:C.svgWidth,height:C.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":C.defaultFillRule,"clip-rule":C.defaultClipRule,d:C.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},C.info)))))};t.SnackbarInstance=h})(ol);var di={},uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var T1=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});di.injectCssReset=void 0;const A1=T1(uo);function N1(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(A1.default)),document.documentElement.appendChild(t)}di.injectCssReset=N1;Object.defineProperty(Kr,"__esModule",{value:!0});Kr.WalletSDKUI=void 0;const O1=Xr,L1=ol,j1=di;class $1{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new L1.Snackbar({darkMode:e.darkMode}),this.linkFlow=new O1.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.linkFlow.attach(n),this.snackbar.attach(n),this.attached=!0,(0,j1.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Kr.WalletSDKUI=$1;var pi={},bi={};Object.defineProperty(bi,"__esModule",{value:!0});var Zt;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Zt||(Zt={}));function al(t,e,n){if(!n||typeof n.value!==Zt.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Zt.boolTrue,get:function(){var r=n.value.bind(this);return Object.defineProperty(this,e,{value:r,configurable:Zt.boolTrue,writable:Zt.boolTrue}),r}}}bi.bind=al;bi.default=al;function cl(t){return function(n){return n.lift(new D1(t))}}var D1=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new P1(e,this.durationSelector))},t}(),P1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){if(this.value=n,this.hasValue=!0,!this.throttled){var r=void 0;try{var i=this.durationSelector;r=i(n)}catch(o){return this.destination.error(o)}var s=oe(r,new ie(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var n=this,r=n.value,i=n.hasValue,s=n.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(r))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(se);function F1(t,e){return e===void 0&&(e=Ie),cl(function(){return Wu(t,e)})}function B1(t){return function(n){return n.lift(new V1(t))}}var V1=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,n){return n.subscribe(new H1(e,this.closingNotifier))},t}(),H1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.buffer=[],i.add(oe(r,new ie(i))),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype.notifyNext=function(){var n=this.buffer;this.buffer=[],this.destination.next(n)},e}(se);function W1(t,e){return e===void 0&&(e=null),function(r){return r.lift(new U1(t,e))}}var U1=function(){function t(e,n){this.bufferSize=e,this.startBufferEvery=n,!n||e===n?this.subscriberClass=z1:this.subscriberClass=q1}return t.prototype.call=function(e,n){return n.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),z1=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.bufferSize=r,i.buffer=[],i}return e.prototype._next=function(n){var r=this.buffer;r.push(n),r.length==this.bufferSize&&(this.destination.next(r),this.buffer=[])},e.prototype._complete=function(){var n=this.buffer;n.length>0&&this.destination.next(n),t.prototype._complete.call(this)},e}(R),q1=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.bufferSize=r,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(n){var r=this,i=r.bufferSize,s=r.startBufferEvery,o=r.buffers,a=r.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var l=o[c];l.push(n),l.length===i&&(o.splice(c,1),this.destination.next(l))}},e.prototype._complete=function(){for(var n=this,r=n.buffers,i=n.destination;r.length>0;){var s=r.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(R);function G1(t){var e=arguments.length,n=Ie;Ne(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new J1(t,r,i,n))}}var J1=function(){function t(e,n,r,i){this.bufferTimeSpan=e,this.bufferCreationInterval=n,this.maxBufferSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new Z1(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Q1=function(){function t(){this.buffer=[]}return t}(),Z1=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:c,bufferTimeSpan:r};a.add(c.closeAction=o.schedule(Ua,r,l))}else{var h={subscriber:a,context:c},u={bufferTimeSpan:r,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(ul,r,h)),a.add(o.schedule(Y1,i,u))}return a}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s,o=0;o<i;o++){var a=r[o],c=a.buffer;c.push(n),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(n){this.contexts.length=0,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this,r=n.contexts,i=n.destination;r.length>0;){var s=r.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(n){this.closeContext(n);var r=n.closeAction;if(r.unsubscribe(),this.remove(r),!this.closed&&this.timespanOnly){n=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:n,bufferTimeSpan:i};this.add(n.closeAction=this.scheduler.schedule(Ua,i,s))}},e.prototype.openContext=function(){var n=new Q1;return this.contexts.push(n),n},e.prototype.closeContext=function(n){this.destination.next(n.buffer);var r=this.contexts,i=r?r.indexOf(n):-1;i>=0&&r.splice(r.indexOf(n),1)},e}(R);function Ua(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Y1(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,s=r.openContext(),o=this;r.closed||(r.add(s.closeAction=i.schedule(ul,n,{subscriber:r,context:s})),o.schedule(t,e))}function ul(t){var e=t.subscriber,n=t.context;e.closeContext(n)}function K1(t,e){return function(r){return r.lift(new X1(t,e))}}var X1=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new ey(e,this.openings,this.closingSelector))},t}(),ey=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.closingSelector=i,s.contexts=[],s.add(ft(s,r)),s}return e.prototype._next=function(n){for(var r=this.contexts,i=r.length,s=0;s<i;s++)r[s].buffer.push(n)},e.prototype._error=function(n){for(var r=this.contexts;r.length>0;){var i=r.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,n)},e.prototype._complete=function(){for(var n=this.contexts;n.length>0;){var r=n.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(n,r){n?this.closeBuffer(n):this.openBuffer(r)},e.prototype.notifyComplete=function(n){this.closeBuffer(n.context)},e.prototype.openBuffer=function(n){try{var r=this.closingSelector,i=r.call(this,n);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(n){var r=this.contexts;if(r&&n){var i=n.buffer,s=n.subscription;this.destination.next(i),r.splice(r.indexOf(n),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(n){var r=this.contexts,i=[],s=new re,o={buffer:i,subscription:s};r.push(o);var a=ft(this,n,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Vt);function ty(t){return function(e){return e.lift(new ny(t))}}var ny=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new ry(e,this.closingSelector))},t}(),ry=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.closingSelector=r,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(n){this.buffer.push(n)},e.prototype._complete=function(){var n=this.buffer;n&&this.destination.next(n),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var n=this.closingSubscription;n&&(this.remove(n),n.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}n=new re,this.closingSubscription=n,this.add(n),this.subscribing=!0,n.add(oe(i,new ie(this))),this.subscribing=!1},e}(se);function iy(t){return function(n){var r=new sy(t),i=n.lift(r);return r.caught=i}}var sy=function(){function t(e){this.selector=e}return t.prototype.call=function(e,n){return n.subscribe(new oy(e,this.selector,this.caught))},t}(),oy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.selector=r,s.caught=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=void 0;try{r=this.selector(n,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new ie(this);this.add(i);var s=oe(r,i);s!==i&&this.add(s)}},e}(se);function ay(t){return function(e){return e.lift(new Qs(t))}}function cy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return typeof t[t.length-1]=="function"&&(n=t.pop()),t.length===1&&Ce(t[0])&&(t=t[0].slice()),function(r){return r.lift.call(pt([r].concat(t)),new Qs(n))}}function uy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Bn.apply(void 0,[n].concat(t)))}}function ll(t,e){return $t(t,e,1)}function ly(t,e){return ll(function(){return t},e)}function hy(t){return function(e){return e.lift(new fy(t,e))}}var fy=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new dy(e,this.predicate,this.source))},t}(),dy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(n){this.predicate?this._tryPredicate(n):this.count++},e.prototype._tryPredicate=function(n){var r;try{r=this.predicate(n,this.index++,this.source)}catch(i){this.destination.error(i);return}r&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(R);function py(t){return function(e){return e.lift(new by(t))}}var by=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new gy(e,this.durationSelector))},t}(),gy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.durationSelector=r,i.hasValue=!1,i}return e.prototype._next=function(n){try{var r=this.durationSelector.call(this,n);r&&this._tryNext(n,r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(n,r){var i=this.durationSubscription;this.value=n,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=oe(r,new ie(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var n=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,n)}},e}(se);function my(t,e){return e===void 0&&(e=Ie),function(n){return n.lift(new vy(t,e))}}var vy=function(){function t(e,n){this.dueTime=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new yy(e,this.dueTime,this.scheduler))},t}(),yy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.dueTime=r,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(n){this.clearDebounce(),this.lastValue=n,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(wy,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var n=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(n)}},e.prototype.clearDebounce=function(){var n=this.debouncedSubscription;n!==null&&(this.remove(n),n.unsubscribe(),this.debouncedSubscription=null)},e}(R);function wy(t){t.debouncedNext()}function ar(t){return t===void 0&&(t=null),function(e){return e.lift(new _y(t))}}var _y=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,n){return n.subscribe(new Sy(e,this.defaultValue))},t}(),Sy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.defaultValue=r,i.isEmpty=!0,i}return e.prototype._next=function(n){this.isEmpty=!1,this.destination.next(n)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(R);function hl(t){return t instanceof Date&&!isNaN(+t)}function Ey(t,e){e===void 0&&(e=Ie);var n=hl(t),r=n?+t-e.now():Math.abs(t);return function(i){return i.lift(new Cy(r,e))}}var Cy=function(){function t(e,n){this.delay=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new Iy(e,this.delay,this.scheduler))},t}(),Iy=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.delay=r,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(n){for(var r=n.source,i=r.queue,s=n.scheduler,o=n.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(n,a)}else this.unsubscribe(),r.active=!1},e.prototype._schedule=function(n){this.active=!0;var r=this.destination;r.add(n.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:n}))},e.prototype.scheduleNotification=function(n){if(this.errored!==!0){var r=this.scheduler,i=new ky(r.now()+this.delay,n);this.queue.push(i),this.active===!1&&this._schedule(r)}},e.prototype._next=function(n){this.scheduleNotification(ht.createNext(n))},e.prototype._error=function(n){this.errored=!0,this.queue=[],this.destination.error(n),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ht.createComplete()),this.unsubscribe()},e}(R),ky=function(){function t(e,n){this.time=e,this.notification=n}return t}();function xy(t,e){return e?function(n){return new My(n,e).lift(new za(t))}:function(n){return n.lift(new za(t))}}var za=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new Ry(e,this.delayDurationSelector))},t}(),Ry=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.delayDurationSelector=r,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(n,r,i,s,o){this.destination.next(n),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(n,r){this._error(n)},e.prototype.notifyComplete=function(n){var r=this.removeSubscription(n);r&&this.destination.next(r),this.tryComplete()},e.prototype._next=function(n){var r=this.index++;try{var i=this.delayDurationSelector(n,r);i&&this.tryDelay(i,n)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(n){n.unsubscribe();var r=this.delayNotifierSubscriptions.indexOf(n);return r!==-1&&this.delayNotifierSubscriptions.splice(r,1),n.outerValue},e.prototype.tryDelay=function(n,r){var i=ft(this,n,r);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Vt),My=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.source=n,i.subscriptionDelay=r,i}return e.prototype._subscribe=function(n){this.subscriptionDelay.subscribe(new Ty(n,this.source))},e}(P),Ty=function(t){b(e,t);function e(n,r){var i=t.call(this)||this;return i.parent=n,i.source=r,i.sourceSubscribed=!1,i}return e.prototype._next=function(n){this.subscribeToSource()},e.prototype._error=function(n){this.unsubscribe(),this.parent.error(n)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(R);function Ay(){return function(e){return e.lift(new Ny)}}var Ny=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Oy(e))},t}(),Oy=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){n.observe(this.destination)},e}(R);function Ly(t,e){return function(n){return n.lift(new jy(t,e))}}var jy=function(){function t(e,n){this.keySelector=e,this.flushes=n}return t.prototype.call=function(e,n){return n.subscribe(new $y(e,this.keySelector,this.flushes))},t}(),$y=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=r,s.values=new Set,i&&s.add(oe(i,new ie(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(n){this._error(n)},e.prototype._next=function(n){this.keySelector?this._useKeySelector(n):this._finalizeNext(n,n)},e.prototype._useKeySelector=function(n){var r,i=this.destination;try{r=this.keySelector(n)}catch(s){i.error(s);return}this._finalizeNext(r,n)},e.prototype._finalizeNext=function(n,r){var i=this.values;i.has(n)||(i.add(n),this.destination.next(r))},e}(se);function fl(t,e){return function(n){return n.lift(new Dy(t,e))}}var Dy=function(){function t(e,n){this.compare=e,this.keySelector=n}return t.prototype.call=function(e,n){return n.subscribe(new Py(e,this.compare,this.keySelector))},t}(),Py=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.keySelector=i,s.hasKey=!1,typeof r=="function"&&(s.compare=r),s}return e.prototype.compare=function(n,r){return n===r},e.prototype._next=function(n){var r;try{var i=this.keySelector;r=i?i(n):n}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,r)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=r,this.destination.next(n))},e}(R);function Fy(t,e){return fl(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}function gi(t){return t===void 0&&(t=Hy),function(e){return e.lift(new By(t))}}var By=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,n){return n.subscribe(new Vy(e,this.errorFactory))},t}(),Vy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.errorFactory=r,i.hasValue=!1,i}return e.prototype._next=function(n){this.hasValue=!0,this.destination.next(n)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var n=void 0;try{n=this.errorFactory()}catch(r){n=r}this.destination.error(n)},e}(R);function Hy(){return new sr}function lo(t){return function(e){return t===0?_n():e.lift(new Wy(t))}}var Wy=function(){function t(e){if(this.total=e,this.total<0)throw new ln}return t.prototype.call=function(e,n){return n.subscribe(new Uy(e,this.total))},t}(),Uy=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){var r=this.total,i=++this.count;i<=r&&(this.destination.next(n),i===r&&(this.destination.complete(),this.unsubscribe()))},e}(R);function zy(t,e){if(t<0)throw new ln;var n=arguments.length>=2;return function(r){return r.pipe(Et(function(i,s){return s===t}),lo(1),n?ar(e):gi(function(){return new ln}))}}function qy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return Bn(n,ti.apply(void 0,t))}}function Gy(t,e){return function(n){return n.lift(new Jy(t,e,n))}}var Jy=function(){function t(e,n,r){this.predicate=e,this.thisArg=n,this.source=r}return t.prototype.call=function(e,n){return n.subscribe(new Qy(e,this.predicate,this.thisArg,this.source))},t}(),Qy=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.predicate=r,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(n){this.destination.next(n),this.destination.complete()},e.prototype._next=function(n){var r=!1;try{r=this.predicate.call(this.thisArg,n,this.index++,this.source)}catch(i){this.destination.error(i);return}r||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(R);function Zy(){return function(t){return t.lift(new Yy)}}var Yy=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Ky(e))},t}(),Ky=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return e.prototype._next=function(n){this.hasSubscription||(this.hasSubscription=!0,this.add(oe(n,new ie(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(se);function dl(t,e){return e?function(n){return n.pipe(dl(function(r,i){return pt(t(r,i)).pipe(Be(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new Xy(t))}}var Xy=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new ew(e,this.project))},t}(),ew=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(n){this.hasSubscription||this.tryNext(n)},e.prototype.tryNext=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(r)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this.destination.next(n)},e.prototype.notifyError=function(n){this.destination.error(n)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(se);function tw(t,e,n){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new nw(t,e,n))}}var nw=function(){function t(e,n,r){this.project=e,this.concurrent=n,this.scheduler=r}return t.prototype.call=function(e,n){return n.subscribe(new rw(e,this.project,this.concurrent,this.scheduler))},t}(),rw=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.project=r,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(n){var r=n.subscriber,i=n.result,s=n.value,o=n.index;r.subscribeToProjection(i,s,o)},e.prototype._next=function(n){var r=this.destination;if(r.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){r.next(n);try{var s=this.project,o=s(n,i);if(!this.scheduler)this.subscribeToProjection(o,n,i);else{var a={subscriber:this,result:o,value:n,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(l){r.error(l)}}else this.buffer.push(n)},e.prototype.subscribeToProjection=function(n,r,i){this.active++;var s=this.destination;s.add(oe(n,new ie(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(n){this._next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n&&n.length>0&&this._next(n.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(se);function iw(t){return function(e){return e.lift(new sw(t))}}var sw=function(){function t(e){this.callback=e}return t.prototype.call=function(e,n){return n.subscribe(new ow(e,this.callback))},t}(),ow=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.add(new re(r)),i}return e}(R);function aw(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(n){return n.lift(new pl(t,n,!1,e))}}var pl=function(){function t(e,n,r,i){this.predicate=e,this.source=n,this.yieldIndex=r,this.thisArg=i}return t.prototype.call=function(e,n){return n.subscribe(new cw(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),cw=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.predicate=r,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete(),this.unsubscribe()},e.prototype._next=function(n){var r=this,i=r.predicate,s=r.thisArg,o=this.index++;try{var a=i.call(s||this,n,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:n)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(R);function uw(t,e){return function(n){return n.lift(new pl(t,n,!0,e))}}function lw(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Et(function(i,s){return t(i,s,r)}):_t,lo(1),n?ar(e):gi(function(){return new sr}))}}function hw(){return function(e){return e.lift(new fw)}}var fw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new dw(e))},t}(),dw=function(t){b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(n){},e}(R);function pw(){return function(t){return t.lift(new bw)}}var bw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new gw(e))},t}(),gw=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype.notifyComplete=function(n){var r=this.destination;r.next(n),r.complete()},e.prototype._next=function(n){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(R);function Tr(t){return function(n){return t===0?_n():n.lift(new mw(t))}}var mw=function(){function t(e){if(this.total=e,this.total<0)throw new ln}return t.prototype.call=function(e,n){return n.subscribe(new vw(e,this.total))},t}(),vw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.ring=new Array,i.count=0,i}return e.prototype._next=function(n){var r=this.ring,i=this.total,s=this.count++;if(r.length<i)r.push(n);else{var o=s%i;r[o]=n}},e.prototype._complete=function(){var n=this.destination,r=this.count;if(r>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=r++%i;n.next(s[a])}n.complete()},e}(R);function yw(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Et(function(i,s){return t(i,s,r)}):_t,Tr(1),n?ar(e):gi(function(){return new sr}))}}function ww(t){return function(e){return e.lift(new _w(t))}}var _w=function(){function t(e){this.value=e}return t.prototype.call=function(e,n){return n.subscribe(new Sw(e,this.value))},t}(),Sw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.value=r,i}return e.prototype._next=function(n){this.destination.next(this.value)},e}(R);function Ew(){return function(e){return e.lift(new Cw)}}var Cw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Iw(e))},t}(),Iw=function(t){b(e,t);function e(n){return t.call(this,n)||this}return e.prototype._next=function(n){this.destination.next(ht.createNext(n))},e.prototype._error=function(n){var r=this.destination;r.next(ht.createError(n)),r.complete()},e.prototype._complete=function(){var n=this.destination;n.next(ht.createComplete()),n.complete()},e}(R);function Ar(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(i){return i.lift(new kw(t,e,n))}}var kw=function(){function t(e,n,r){r===void 0&&(r=!1),this.accumulator=e,this.seed=n,this.hasSeed=r}return t.prototype.call=function(e,n){return n.subscribe(new xw(e,this.accumulator,this.seed,this.hasSeed))},t}(),xw=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(n){this.hasSeed=!0,this._seed=n},enumerable:!0,configurable:!0}),e.prototype._next=function(n){if(!this.hasSeed)this.seed=n,this.destination.next(n);else return this._tryNext(n)},e.prototype._tryNext=function(n){var r=this.index++,i;try{i=this.accumulator(this.seed,n,r)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(R);function mi(t,e){return arguments.length>=2?function(r){return as(Ar(t,e),Tr(1),ar(e))(r)}:function(r){return as(Ar(function(i,s,o){return t(i,s,o+1)}),Tr(1))(r)}}function Rw(t){var e=typeof t=="function"?function(n,r){return t(n,r)>0?n:r}:function(n,r){return n>r?n:r};return mi(e)}function Mw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Fu.apply(void 0,[n].concat(t)))}}function Tw(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),typeof e=="function"?$t(function(){return t},e,n):(typeof e=="number"&&(n=e),$t(function(){return t},n))}function Aw(t,e,n){return n===void 0&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Nw(t,e,n))}}var Nw=function(){function t(e,n,r){this.accumulator=e,this.seed=n,this.concurrent=r}return t.prototype.call=function(e,n){return n.subscribe(new Ow(e,this.accumulator,this.seed,this.concurrent))},t}(),Ow=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.accumulator=r,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(n){if(this.active<this.concurrent){var r=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,n,r)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(n)},e.prototype._innerSub=function(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(n){var r=this.destination;this.acc=n,this.hasValue=!0,r.next(n)},e.prototype.notifyComplete=function(){var n=this.buffer;this.active--,n.length>0?this._next(n.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(se);function Lw(t){var e=typeof t=="function"?function(n,r){return t(n,r)<0?n:r}:function(n,r){return n<r?n:r};return mi(e)}function Dt(t,e){return function(r){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return r.lift(new jw(i,e));var s=Object.create(r,dm);return s.source=r,s.subjectFactory=i,s}}var jw=function(){function t(e,n){this.subjectFactory=e,this.selector=n}return t.prototype.call=function(e,n){var r=this.selector,i=this.subjectFactory(),s=r(i).subscribe(e);return s.add(n.subscribe(i)),s},t}();function $w(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&Ce(t[0])&&(t=t[0]),function(n){return n.lift(new Dw(t))}}var Dw=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,n){return n.subscribe(new Pw(e,this.nextSources))},t}(),Pw=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.nextSources=r,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(n){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var n=this.nextSources.shift();if(n){var r=new ie(this),i=this.destination;i.add(r);var s=oe(n,r);s!==r&&i.add(s)}else this.destination.complete()},e}(se);function Fw(){return function(t){return t.lift(new Bw)}}var Bw=function(){function t(){}return t.prototype.call=function(e,n){return n.subscribe(new Vw(e))},t}(),Vw=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.hasPrev=!1,r}return e.prototype._next=function(n){var r;this.hasPrev?r=[this.prev,n]:this.hasPrev=!0,this.prev=n,r&&this.destination.next(r)},e}(R);function Hw(t,e){return function(n){return[Et(t,e)(n),Et(Vu(t,e))(n)]}}function Ww(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(n===0)throw new Error("list of properties cannot be empty.");return function(r){return Be(Uw(t,n))(r)}}function Uw(t,e){var n=function(r){for(var i=r,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return n}function zw(t){return t?Dt(function(){return new ge},t):Dt(new ge)}function qw(t){return function(e){return Dt(new wu(t))(e)}}function Gw(){return function(t){return Dt(new Sn)(t)}}function Jw(t,e,n,r){n&&typeof n!="function"&&(r=n);var i=typeof n=="function"?n:void 0,s=new Js(t,e,r);return function(o){return Dt(function(){return s},i)(o)}}function Qw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return t.length===1&&Ce(t[0])&&(t=t[0]),r.lift.call(Hu.apply(void 0,[r].concat(t)))}}function Zw(t){return t===void 0&&(t=-1),function(e){return t===0?_n():t<0?e.lift(new qa(-1,e)):e.lift(new qa(t-1,e))}}var qa=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new Yw(e,this.count,this.source))},t}(),Yw=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var n=this,r=n.source,i=n.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(R);function Kw(t){return function(e){return e.lift(new Xw(t))}}var Xw=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new e_(e,this.notifier,n))},t}(),e_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var n=this,r=n.notifications,i=n.retriesSubscription;r&&(r.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var n=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=n,this},e.prototype.subscribeToRetries=function(){this.notifications=new ge;var n;try{var r=this.notifier;n=r(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=n,this.retriesSubscription=oe(n,new ie(this))},e}(se);function t_(t){return t===void 0&&(t=-1),function(e){return e.lift(new n_(t,e))}}var n_=function(){function t(e,n){this.count=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new r_(e,this.count,this.source))},t}(),r_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.count=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this,i=r.source,s=r.count;if(s===0)return t.prototype.error.call(this,n);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(R);function i_(t){return function(e){return e.lift(new s_(t,e))}}var s_=function(){function t(e,n){this.notifier=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new o_(e,this.notifier,this.source))},t}(),o_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.notifier=r,s.source=i,s}return e.prototype.error=function(n){if(!this.isStopped){var r=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{r=new ge;try{var o=this.notifier;i=o(r)}catch(a){return t.prototype.error.call(this,a)}s=oe(i,new ie(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=i,this.retriesSubscription=s,r.next(n)}},e.prototype._unsubscribe=function(){var n=this,r=n.errors,i=n.retriesSubscription;r&&(r.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var n=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=n,this.source.subscribe(this)},e}(se);function a_(t){return function(e){return e.lift(new c_(t))}}var c_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new u_(e),i=n.subscribe(r);return i.add(oe(this.notifier,new ie(r))),i},t}(),u_=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.hasValue=!1,n}return e.prototype._next=function(n){this.value=n,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(se);function l_(t,e){return e===void 0&&(e=Ie),function(n){return n.lift(new h_(t,e))}}var h_=function(){function t(e,n){this.period=e,this.scheduler=n}return t.prototype.call=function(e,n){return n.subscribe(new f_(e,this.period,this.scheduler))},t}(),f_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.period=r,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(d_,r,{subscriber:s,period:r})),s}return e.prototype._next=function(n){this.lastValue=n,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(R);function d_(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function p_(t,e){return function(n){return n.lift(new b_(t,e))}}var b_=function(){function t(e,n){this.compareTo=e,this.comparator=n}return t.prototype.call=function(e,n){return n.subscribe(new g_(e,this.compareTo,this.comparator))},t}(),g_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.compareTo=r,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(r.subscribe(new m_(n,s))),s}return e.prototype._next=function(n){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(n),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var n=this,r=n._a,i=n._b,s=n.comparator;r.length>0&&i.length>0;){var o=r.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(l){this.destination.error(l)}c||this.emit(!1)}},e.prototype.emit=function(n){var r=this.destination;r.next(n),r.complete()},e.prototype.nextB=function(n){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(n),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(R),m_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.parent=r,i}return e.prototype._next=function(n){this.parent.nextB(n)},e.prototype._error=function(n){this.parent.error(n),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(R);function v_(){return new ge}function y_(){return function(t){return zs()(Dt(v_)(t))}}function w_(t,e,n){var r;return t&&typeof t=="object"?r=t:r={bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(i){return i.lift(__(r))}}function __(t){var e=t.bufferSize,n=e===void 0?Number.POSITIVE_INFINITY:e,r=t.windowTime,i=r===void 0?Number.POSITIVE_INFINITY:r,s=t.refCount,o=t.scheduler,a,c=0,l,h=!1,u=!1;return function(f){c++;var p;!a||h?(h=!1,a=new Js(n,i,o),p=a.subscribe(this),l=f.subscribe({next:function(g){a.next(g)},error:function(g){h=!0,a.error(g)},complete:function(){u=!0,l=void 0,a.complete()}}),u&&(l=void 0)):p=a.subscribe(this),this.add(function(){c--,p.unsubscribe(),p=void 0,l&&!u&&s&&c===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function S_(t){return function(e){return e.lift(new E_(t,e))}}var E_=function(){function t(e,n){this.predicate=e,this.source=n}return t.prototype.call=function(e,n){return n.subscribe(new C_(e,this.predicate,this.source))},t}(),C_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(n){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=n)},e.prototype._next=function(n){var r=this.index++;this.predicate?this.tryNext(n,r):this.applySingleValue(n)},e.prototype.tryNext=function(n,r){try{this.predicate(n,r,this.source)&&this.applySingleValue(n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var n=this.destination;this.index>0?(n.next(this.seenValue?this.singleValue:void 0),n.complete()):n.error(new sr)},e}(R);function I_(t){return function(e){return e.lift(new k_(t))}}var k_=function(){function t(e){this.total=e}return t.prototype.call=function(e,n){return n.subscribe(new x_(e,this.total))},t}(),x_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.total=r,i.count=0,i}return e.prototype._next=function(n){++this.count>this.total&&this.destination.next(n)},e}(R);function R_(t){return function(e){return e.lift(new M_(t))}}var M_=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new ln}return t.prototype.call=function(e,n){return this._skipCount===0?n.subscribe(new R(e)):n.subscribe(new T_(e,this._skipCount))},t}(),T_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i._skipCount=r,i._count=0,i._ring=new Array(r),i}return e.prototype._next=function(n){var r=this._skipCount,i=this._count++;if(i<r)this._ring[i]=n;else{var s=i%r,o=this._ring,a=o[s];o[s]=n,this.destination.next(a)}},e}(R);function A_(t){return function(e){return e.lift(new N_(t))}}var N_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){return n.subscribe(new O_(e,this.notifier))},t}(),O_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;i.hasValue=!1;var s=new ie(i);i.add(s),i.innerSubscription=s;var o=oe(r,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(n){this.hasValue&&t.prototype._next.call(this,n)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(se);function L_(t){return function(e){return e.lift(new j_(t))}}var j_=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,n){return n.subscribe(new $_(e,this.predicate))},t}(),$_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.predicate=r,i.skipping=!0,i.index=0,i}return e.prototype._next=function(n){var r=this.destination;this.skipping&&this.tryCallPredicate(n),this.skipping||r.next(n)},e.prototype.tryCallPredicate=function(n){try{var r=this.predicate(n,this.index++);this.skipping=!!r}catch(i){this.destination.error(i)}},e}(R);function D_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Ne(n)?(t.pop(),function(r){return Bn(t,r,n)}):function(r){return Bn(t,r)}}var P_=function(t){b(e,t);function e(n,r,i){r===void 0&&(r=0),i===void 0&&(i=_r);var s=t.call(this)||this;return s.source=n,s.delayTime=r,s.scheduler=i,(!hn(r)||r<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=_r),s}return e.create=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=_r),new e(n,r,i)},e.dispatch=function(n){var r=n.source,i=n.subscriber;return this.add(r.subscribe(i))},e.prototype._subscribe=function(n){var r=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,r,{source:i,subscriber:n})},e}(P);function F_(t,e){return e===void 0&&(e=0),function(r){return r.lift(new B_(t,e))}}var B_=function(){function t(e,n){this.scheduler=e,this.delay=n}return t.prototype.call=function(e,n){return new P_(n,this.delay,this.scheduler).subscribe(e)},t}();function Vn(t,e){return typeof e=="function"?function(n){return n.pipe(Vn(function(r,i){return pt(t(r,i)).pipe(Be(function(s,o){return e(r,s,i,o)}))}))}:function(n){return n.lift(new V_(t))}}var V_=function(){function t(e){this.project=e}return t.prototype.call=function(e,n){return n.subscribe(new H_(e,this.project))},t}(),H_=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.project=r,i.index=0,i}return e.prototype._next=function(n){var r,i=this.index++;try{r=this.project(n,i)}catch(s){this.destination.error(s);return}this._innerSub(r)},e.prototype._innerSub=function(n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new ie(this),s=this.destination;s.add(i),this.innerSubscription=oe(n,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var n=this.innerSubscription;(!n||n.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(n){this.destination.next(n)},e}(se);function W_(){return Vn(_t)}function U_(t,e){return e?Vn(function(){return t},e):Vn(function(){return t})}function z_(t){return function(e){return e.lift(new q_(t))}}var q_=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,n){var r=new G_(e),i=oe(this.notifier,new ie(r));return i&&!r.seenValue?(r.add(i),n.subscribe(r)):r},t}(),G_=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.seenValue=!1,r}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(se);function J_(t,e){return e===void 0&&(e=!1),function(n){return n.lift(new Q_(t,e))}}var Q_=function(){function t(e,n){this.predicate=e,this.inclusive=n}return t.prototype.call=function(e,n){return n.subscribe(new Z_(e,this.predicate,this.inclusive))},t}(),Z_=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.predicate=r,s.inclusive=i,s.index=0,s}return e.prototype._next=function(n){var r=this.destination,i;try{i=this.predicate(n,this.index++)}catch(s){r.error(s);return}this.nextOrComplete(n,i)},e.prototype.nextOrComplete=function(n,r){var i=this.destination;r?i.next(n):(this.inclusive&&i.next(n),i.complete())},e}(R);function Y_(t,e,n){return function(i){return i.lift(new K_(t,e,n))}}var K_=function(){function t(e,n,r){this.nextOrObserver=e,this.error=n,this.complete=r}return t.prototype.call=function(e,n){return n.subscribe(new X_(e,this.nextOrObserver,this.error,this.complete))},t}(),X_=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o._tapNext=et,o._tapError=et,o._tapComplete=et,o._tapError=i||et,o._tapComplete=s||et,cn(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||et,o._tapError=r.error||et,o._tapComplete=r.complete||et),o}return e.prototype._next=function(n){try{this._tapNext.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.next(n)},e.prototype._error=function(n){try{this._tapError.call(this._context,n)}catch(r){this.destination.error(r);return}this.destination.error(n)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(n){this.destination.error(n);return}return this.destination.complete()},e}(R),bl={leading:!0,trailing:!1};function eS(t,e){return e===void 0&&(e=bl),function(n){return n.lift(new tS(t,!!e.leading,!!e.trailing))}}var tS=function(){function t(e,n,r){this.durationSelector=e,this.leading=n,this.trailing=r}return t.prototype.call=function(e,n){return n.subscribe(new nS(e,this.durationSelector,this.leading,this.trailing))},t}(),nS=function(t){b(e,t);function e(n,r,i,s){var o=t.call(this,n)||this;return o.destination=n,o.durationSelector=r,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(n){this._hasValue=!0,this._sendValue=n,this._throttled||(this._leading?this.send():this.throttle(n))},e.prototype.send=function(){var n=this,r=n._hasValue,i=n._sendValue;r&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(n){var r=this.tryDurationSelector(n);r&&this.add(this._throttled=oe(r,new ie(this)))},e.prototype.tryDurationSelector=function(n){try{return this.durationSelector(n)}catch(r){return this.destination.error(r),null}},e.prototype.throttlingDone=function(){var n=this,r=n._throttled,i=n._trailing;r&&r.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(se);function rS(t,e,n){return e===void 0&&(e=Ie),n===void 0&&(n=bl),function(r){return r.lift(new iS(t,e,n.leading,n.trailing))}}var iS=function(){function t(e,n,r,i){this.duration=e,this.scheduler=n,this.leading=r,this.trailing=i}return t.prototype.call=function(e,n){return n.subscribe(new sS(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),sS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.duration=r,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(n){this.throttled?this.trailing&&(this._trailingValue=n,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(oS,this.duration,{subscriber:this})),this.leading?this.destination.next(n):this.trailing&&(this._trailingValue=n,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var n=this.throttled;n&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),n.unsubscribe(),this.remove(n),this.throttled=null)},e}(R);function oS(t){var e=t.subscriber;e.clearThrottle()}function aS(t){return t===void 0&&(t=Ie),function(e){return Ys(function(){return e.pipe(Ar(function(n,r){var i=n.current;return{value:r,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),Be(function(n){var r=n.current,i=n.last,s=n.value;return new cS(s,r-i)}))})}}var cS=function(){function t(e,n){this.value=e,this.interval=n}return t}();function gl(t,e,n){return n===void 0&&(n=Ie),function(r){var i=hl(t),s=i?+t-n.now():Math.abs(t);return r.lift(new uS(s,i,e,n))}}var uS=function(){function t(e,n,r,i){this.waitFor=e,this.absoluteTimeout=n,this.withObservable=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new lS(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),lS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;return a.absoluteTimeout=r,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(n){var r=n.withObservable;n._unsubscribeAndRecycle(),n.add(oe(r,new ie(n)))},e.prototype.scheduleTimeout=function(){var n=this.action;n?this.action=n.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(n){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,n)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(se);function hS(t,e){return e===void 0&&(e=Ie),gl(t,Gs(new Mu),e)}function fS(t){return t===void 0&&(t=Ie),Be(function(e){return new dS(e,t.now())})}var dS=function(){function t(e,n){this.value=e,this.timestamp=n}return t}();function pS(t,e,n){return n===0?[e]:(t.push(e),t)}function bS(){return mi(pS,[])}function gS(t){return function(n){return n.lift(new mS(t))}}var mS=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,n){var r=new vS(e),i=n.subscribe(r);return i.closed||r.add(oe(this.windowBoundaries,new ie(r))),i},t}(),vS=function(t){b(e,t);function e(n){var r=t.call(this,n)||this;return r.window=new ge,n.next(r.window),r}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var n=this.window;n&&n.complete();var r=this.destination,i=this.window=new ge;r.next(i)},e}(se);function yS(t,e){return e===void 0&&(e=0),function(r){return r.lift(new wS(t,e))}}var wS=function(){function t(e,n){this.windowSize=e,this.startWindowEvery=n}return t.prototype.call=function(e,n){return n.subscribe(new _S(e,this.windowSize,this.startWindowEvery))},t}(),_S=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.destination=n,s.windowSize=r,s.startWindowEvery=i,s.windows=[new ge],s.count=0,n.next(s.windows[0]),s}return e.prototype._next=function(n){for(var r=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(n);var l=this.count-s+1;if(l>=0&&l%r===0&&!this.closed&&o.shift().complete(),++this.count%r===0&&!this.closed){var h=new ge;o.push(h),i.next(h)}},e.prototype._error=function(n){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(R);function SS(t){var e=Ie,n=null,r=Number.POSITIVE_INFINITY;return Ne(arguments[3])&&(e=arguments[3]),Ne(arguments[2])?e=arguments[2]:hn(arguments[2])&&(r=Number(arguments[2])),Ne(arguments[1])?e=arguments[1]:hn(arguments[1])&&(n=Number(arguments[1])),function(s){return s.lift(new ES(t,n,r,e))}}var ES=function(){function t(e,n,r,i){this.windowTimeSpan=e,this.windowCreationInterval=n,this.maxWindowSize=r,this.scheduler=i}return t.prototype.call=function(e,n){return n.subscribe(new IS(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),CS=function(t){b(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._numberOfNextedValues=0,n}return e.prototype.next=function(n){this._numberOfNextedValues++,t.prototype.next.call(this,n)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(ge),IS=function(t){b(e,t);function e(n,r,i,s,o){var a=t.call(this,n)||this;a.destination=n,a.windowTimeSpan=r,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:c,context:null},h={windowTimeSpan:r,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(ml,r,l)),a.add(o.schedule(xS,i,h))}else{var u={subscriber:a,window:c,windowTimeSpan:r};a.add(o.schedule(kS,r,u))}return a}return e.prototype._next=function(n){for(var r=this.windows,i=r.length,s=0;s<i;s++){var o=r[s];o.closed||(o.next(n),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(n){for(var r=this.windows;r.length>0;)r.shift().error(n);this.destination.error(n)},e.prototype._complete=function(){for(var n=this.windows;n.length>0;){var r=n.shift();r.closed||r.complete()}this.destination.complete()},e.prototype.openWindow=function(){var n=new CS;this.windows.push(n);var r=this.destination;return r.next(n),n},e.prototype.closeWindow=function(n){n.complete();var r=this.windows;r.splice(r.indexOf(n),1)},e}(R);function kS(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function xS(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:n,window:s,context:a};a.subscription=r.schedule(ml,e,c),o.add(a.subscription),o.schedule(t,i)}function ml(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function RS(t,e){return function(n){return n.lift(new MS(t,e))}}var MS=function(){function t(e,n){this.openings=e,this.closingSelector=n}return t.prototype.call=function(e,n){return n.subscribe(new TS(e,this.openings,this.closingSelector))},t}(),TS=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;return s.openings=r,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=ft(s,r,r)),s}return e.prototype._next=function(n){var r=this.contexts;if(r)for(var i=r.length,s=0;s<i;s++)r[s].window.next(n)},e.prototype._error=function(n){var r=this.contexts;if(this.contexts=null,r)for(var i=r.length,s=-1;++s<i;){var o=r[s];o.window.error(n),o.subscription.unsubscribe()}t.prototype._error.call(this,n)},e.prototype._complete=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(n,r,i,s,o){if(n===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(r)}catch(f){return this.error(f)}var l=new ge,h=new re,u={window:l,subscription:h};this.contexts.push(u);var d=ft(this,a,u);d.closed?this.closeWindow(this.contexts.length-1):(d.context=u,h.add(d)),this.destination.next(l)}else this.closeWindow(this.contexts.indexOf(n))},e.prototype.notifyError=function(n){this.error(n)},e.prototype.notifyComplete=function(n){n!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(n.context))},e.prototype.closeWindow=function(n){if(n!==-1){var r=this.contexts,i=r[n],s=i.window,o=i.subscription;r.splice(n,1),s.complete(),o.unsubscribe()}},e}(Vt);function AS(t){return function(n){return n.lift(new NS(t))}}var NS=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,n){return n.subscribe(new OS(e,this.closingSelector))},t}(),OS=function(t){b(e,t);function e(n,r){var i=t.call(this,n)||this;return i.destination=n,i.closingSelector=r,i.openWindow(),i}return e.prototype.notifyNext=function(n,r,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(n){this._error(n)},e.prototype.notifyComplete=function(n){this.openWindow(n)},e.prototype._next=function(n){this.window.next(n)},e.prototype._error=function(n){this.window.error(n),this.destination.error(n),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(n){n===void 0&&(n=null),n&&(this.remove(n),n.unsubscribe());var r=this.window;r&&r.complete();var i=this.window=new ge;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=ft(this,s))},e}(Vt);function LS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){var r;typeof t[t.length-1]=="function"&&(r=t.pop());var i=t;return n.lift(new jS(i,r))}}var jS=function(){function t(e,n){this.observables=e,this.project=n}return t.prototype.call=function(e,n){return n.subscribe(new $S(e,this.observables,this.project))},t}(),$S=function(t){b(e,t);function e(n,r,i){var s=t.call(this,n)||this;s.observables=r,s.project=i,s.toRespond=[];var o=r.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=r[a];s.add(ft(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(n,r,i){this.values[i]=r;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(n){if(this.toRespond.length===0){var r=[n].concat(this.values);this.project?this._tryProject(r):this.destination.next(r)}},e.prototype._tryProject=function(n){var r;try{r=this.project.apply(this,n)}catch(i){this.destination.error(i);return}this.destination.next(r)},e}(Vt);function DS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Uu.apply(void 0,[r].concat(t)))}}function PS(t){return function(e){return e.lift(new zu(t))}}const FS=Object.freeze(Object.defineProperty({__proto__:null,audit:cl,auditTime:F1,buffer:B1,bufferCount:W1,bufferTime:G1,bufferToggle:K1,bufferWhen:ty,catchError:iy,combineAll:ay,combineLatest:cy,concat:uy,concatAll:ju,concatMap:ll,concatMapTo:ly,count:hy,debounce:py,debounceTime:my,defaultIfEmpty:ar,delay:Ey,delayWhen:xy,dematerialize:Ay,distinct:Ly,distinctUntilChanged:fl,distinctUntilKeyChanged:Fy,elementAt:zy,endWith:qy,every:Gy,exhaust:Zy,exhaustMap:dl,expand:tw,filter:Et,finalize:iw,find:aw,findIndex:uw,first:lw,flatMap:av,groupBy:bm,ignoreElements:hw,isEmpty:pw,last:yw,map:Be,mapTo:ww,materialize:Ew,max:Rw,merge:Mw,mergeAll:Zs,mergeMap:$t,mergeMapTo:Tw,mergeScan:Aw,min:Lw,multicast:Dt,observeOn:Im,onErrorResumeNext:$w,pairwise:Fw,partition:Hw,pluck:Ww,publish:zw,publishBehavior:qw,publishLast:Gw,publishReplay:Jw,race:Qw,reduce:mi,refCount:zs,repeat:Zw,repeatWhen:Kw,retry:t_,retryWhen:i_,sample:a_,sampleTime:l_,scan:Ar,sequenceEqual:p_,share:y_,shareReplay:w_,single:S_,skip:I_,skipLast:R_,skipUntil:A_,skipWhile:L_,startWith:D_,subscribeOn:F_,switchAll:W_,switchMap:Vn,switchMapTo:U_,take:lo,takeLast:Tr,takeUntil:z_,takeWhile:J_,tap:Y_,throttle:eS,throttleTime:rS,throwIfEmpty:gi,timeInterval:aS,timeout:hS,timeoutWith:gl,timestamp:fS,toArray:bS,window:gS,windowCount:yS,windowTime:SS,windowToggle:RS,windowWhen:AS,withLatestFrom:LS,zip:DS,zipAll:PS},Symbol.toStringTag,{value:"Module"})),ho=Hn(FS);var vi={},$e={};Object.defineProperty($e,"__esModule",{value:!0});$e.ClientMessagePublishEvent=$e.ClientMessageSetSessionConfig=$e.ClientMessageGetSessionConfig=$e.ClientMessageIsLinked=$e.ClientMessageHostSession=void 0;function BS(t){return Object.assign({type:"HostSession"},t)}$e.ClientMessageHostSession=BS;function VS(t){return Object.assign({type:"IsLinked"},t)}$e.ClientMessageIsLinked=VS;function HS(t){return Object.assign({type:"GetSessionConfig"},t)}$e.ClientMessageGetSessionConfig=HS;function WS(t){return Object.assign({type:"SetSessionConfig"},t)}$e.ClientMessageSetSessionConfig=WS;function US(t){return Object.assign({type:"PublishEvent"},t)}$e.ClientMessagePublishEvent=US;var vl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=ni,n=ho;var r;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(r=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(r.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(r.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,n.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(vl);var yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.isServerMessageFail=void 0;function zS(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}yi.isServerMessageFail=zS;Object.defineProperty(vi,"__esModule",{value:!0});vi.WalletSDKConnection=void 0;const He=ni,H=ho,xn=gn,qt=zn,Rn=$e,Mn=bn,mr=vl,Zi=yi,Ga=1e4,qS=6e4;class GS{constructor(e,n,r,i,s=WebSocket){this.sessionId=e,this.sessionKey=n,this.diagnostic=i,this.subscriptions=new He.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,qt.IntNumber)(1),this.connectedSubject=new He.BehaviorSubject(!1),this.linkedSubject=new He.BehaviorSubject(!1),this.sessionConfigSubject=new He.ReplaySubject(1);const o=new mr.RxWebSocket(r+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,H.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Mn.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:xn.Session.hash(e)})}),(0,H.skip)(1),(0,H.filter)(a=>a===mr.ConnectionState.DISCONNECTED&&!this.destroyed),(0,H.delay)(5e3),(0,H.filter)(a=>!this.destroyed),(0,H.flatMap)(a=>o.connect()),(0,H.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,H.skip)(2),(0,H.switchMap)(a=>(0,He.iif)(()=>a===mr.ConnectionState.CONNECTED,this.authenticate().pipe((0,H.tap)(c=>this.sendIsLinked()),(0,H.tap)(c=>this.sendGetSessionConfig()),(0,H.map)(c=>!0)),(0,He.of)(!1))),(0,H.distinctUntilChanged)(),(0,H.catchError)(a=>(0,He.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,H.skip)(1),(0,H.switchMap)(a=>(0,He.iif)(()=>a===mr.ConnectionState.CONNECTED,(0,He.timer)(0,Ga)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,H.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,H.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Mn.EVENTS.LINKED,{sessionIdHash:xn.Session.hash(e),linked:l.linked,type:a.type,onlineGuests:l.onlineGuests}),this.linkedSubject.next(l.linked||l.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,H.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Mn.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xn.Session.hash(e),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.sessionConfigSubject.next({webhookId:l.webhookId,webhookUrl:l.webhookUrl,metadata:l.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Mn.EVENTS.STARTED_CONNECTING,{sessionIdHash:xn.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Mn.EVENTS.DISCONNECTED,{sessionIdHash:xn.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,H.filter)(e=>e),(0,H.take)(1),(0,H.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,H.filter)(e=>e),(0,H.take)(1),(0,H.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,H.filter)(e=>{if(e.type!=="Event")return!1;const n=e;return typeof n.sessionId=="string"&&typeof n.eventId=="string"&&typeof n.event=="string"&&typeof n.data=="string"}),(0,H.map)(e=>e))}setSessionMetadata(e,n){const r=(0,Rn.ClientMessageSetSessionConfig)({id:(0,qt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:n}});return this.onceConnected$.pipe((0,H.flatMap)(i=>this.makeRequest(r)),(0,H.map)(i=>{if((0,Zi.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,n,r=!1){const i=(0,Rn.ClientMessagePublishEvent)({id:(0,qt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:n,callWebhook:r});return this.onceLinked$.pipe((0,H.flatMap)(s=>this.makeRequest(i)),(0,H.map)(s=>{if((0,Zi.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ga*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,n=qS){const r=e.id;try{this.sendData(e)}catch(i){return(0,He.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,H.timeoutWith)(n,(0,He.throwError)(new Error(`request ${r} timed out`))),(0,H.filter)(i=>i.id===r),(0,H.take)(1))}authenticate(){const e=(0,Rn.ClientMessageHostSession)({id:(0,qt.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,H.map)(n=>{if((0,Zi.isServerMessageFail)(n))throw new Error(n.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Rn.ClientMessageIsLinked)({id:(0,qt.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Rn.ClientMessageGetSessionConfig)({id:(0,qt.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}vi.WalletSDKConnection=GS;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.decrypt=dn.encrypt=void 0;const Nr=I;async function JS(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,Nr.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),l=new Uint8Array(a),h=new Uint8Array(c),u=new Uint8Array([...n,...l,...h]);return(0,Nr.uint8ArrayToHex)(u)}dn.encrypt=JS;function QS(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((n,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Nr.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Nr.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),h={name:"AES-GCM",iv:new Uint8Array(o)};try{const u=await window.crypto.subtle.decrypt(h,i,l),d=new TextDecoder;n(d.decode(u))}catch(u){r(u)}})()})}dn.decrypt=QS;var wi={},_i={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(_i);Object.defineProperty(wi,"__esModule",{value:!0});wi.Web3RequestCanceledMessage=void 0;const ZS=_i;function YS(t){return{type:ZS.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}wi.Web3RequestCanceledMessage=YS;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.Web3RequestMessage=void 0;const KS=_i;function XS(t){return Object.assign({type:KS.RelayMessageType.WEB3_REQUEST},t)}Si.Web3RequestMessage=XS;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.isWeb3ResponseMessage=pn.Web3ResponseMessage=void 0;const yl=_i;function e2(t){return Object.assign({type:yl.RelayMessageType.WEB3_RESPONSE},t)}pn.Web3ResponseMessage=e2;function t2(t){return t&&t.type===yl.RelayMessageType.WEB3_RESPONSE}pn.isWeb3ResponseMessage=t2;var n2=O&&O.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),r2=O&&O.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wl=O&&O.__decorate||function(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},i2=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&n2(e,t,n);return r2(e,t),e},s2=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});pi.WalletSDKRelay=void 0;const _l=s2(bi),kt=ni,le=ho,we=bn,o2=vi,Gt=Wn,a2=zn,X=I,gt=i2(dn),mt=gn,vr=qe,me=Pr,c2=wi,u2=Si,Le=Y,xe=pn;class ze extends vr.WalletSDKRelayAbstract{constructor(e){var n;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new kt.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new kt.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:r,ui:i,connection:s}=this.subscribe();if(this._session=r,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(n=e.reloadOnDisconnect)!==null&&n!==void 0?n:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=mt.Session.load(this.storage)||new mt.Session(this.storage).save(),n=new o2.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(n.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(n.incomingEvent$.pipe((0,le.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(n.linked$.pipe((0,le.skip)(1),(0,le.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(vr.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(we.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=n.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(vr.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(vr.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,le.mergeMap)(i=>(0,kt.zip)(gt.decrypt(i.metadata.ChainId,e.secret),gt.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,le.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),ze.accountRequestCallbackIds.size>0&&(Array.from(ze.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,xe.Web3ResponseMessage)({id:s,response:(0,Le.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),ze.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(n.sessionConfig$.pipe((0,le.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,le.mergeMap)(i=>gt.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:n.connected$,chainId$:this.dappDefaultChainSubject});return n.connect(),{session:e,ui:r,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,le.timeout)(1e3),(0,le.catchError)(e=>(0,kt.of)(null))).subscribe(e=>{var n,r,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(r=this.diagnostic)===null||r===void 0||r.log(we.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=mt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(we.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:mt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new kt.Subscription;const{session:a,ui:c,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var n;(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,n){this.appName=e,this.appLogoUrl=n}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,n){this.storage.setItem(e,n)}signEthereumMessage(e,n,r,i){return this.sendRequest({method:me.Web3Method.signEthereumMessage,params:{message:(0,X.hexStringFromBuffer)(e,!0),address:n,addPrefix:r,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,n,r){return this.sendRequest({method:me.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,X.hexStringFromBuffer)(e,!0),signature:(0,X.hexStringFromBuffer)(n,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:me.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,X.bigIntStringFromBN)(e.weiValue),data:(0,X.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,X.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:me.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,X.bigIntStringFromBN)(e.weiValue),data:(0,X.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,X.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,X.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,X.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,X.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:me.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,X.hexStringFromBuffer)(e,!0),chainId:n}})}scanQRCode(e){return this.sendRequest({method:me.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,X.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,n){return this.sendRequest({method:me.Web3Method.generic,params:{action:n,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let n=null;const r=(0,X.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,o),n==null||n()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,c=>{if(n==null||n(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,n){var r;const i=(0,u2.Web3RequestMessage)({id:e,request:n}),s=mt.Session.load(this.storage);(r=this.diagnostic)===null||r===void 0||r.log(we.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(we.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?mt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const n=(0,c2.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",n,!1).subscribe())}publishEvent(e,n,r){const i=this.session.secret;return new kt.Observable(s=>{gt.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,le.mergeMap)(s=>this.connection.publishEvent(e,s,r)))}handleIncomingEvent(e){try{this.subscriptions.add((0,kt.from)(gt.decrypt(e.data,this.session.secret)).pipe((0,le.map)(n=>JSON.parse(n))).subscribe({next:n=>{const r=(0,xe.isWeb3ResponseMessage)(n)?n:null;r&&this.handleWeb3ResponseMessage(r)},error:()=>{var n;(n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var n;const{response:r}=e;if((n=this.diagnostic)===null||n===void 0||n.log(we.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Le.isRequestEthereumAccountsResponse)(r)){ze.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),ze.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,n,r,i){var s;const o=(s=r==null?void 0:r.message)!==null&&s!==void 0?s:(0,Gt.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:e,response:{method:n,errorMessage:o,errorCode:i}}))}invokeCallback(e){const n=this.relayEventManager.callbacks.get(e.id);n&&(n(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:me.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},n=(0,X.randomBytesHex)(8),r=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(n,l=>{if(this.ui.hideRequestEthereumAccounts(),l.errorMessage)return o(new Error(l.errorMessage));s(l)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let l;try{(0,X.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){const l=h=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:n,response:(0,Le.RequestEthereumAccountsResponse)(h)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:l})}else{const l=Gt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(l)})}ze.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,e)}),cancel:r}}selectProvider(e){const n={method:me.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,X.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(r,h=>{if(h.errorMessage)return a(new Error(h.errorMessage));o(h)});const c=h=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:r,response:(0,Le.SelectProviderResponse)(a2.ProviderType.Unselected)}))},l=h=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:r,response:(0,Le.SelectProviderResponse)(h)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,n,r,i,s,o){const a={method:me.Web3Method.watchAsset,params:{type:e,options:{address:n,symbol:r,decimals:i,image:s},chainId:o}};let c=null;const l=(0,X.randomBytesHex)(8),h=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}));const u=new Promise((d,f)=>{this.relayEventManager.callbacks.set(l,S=>{if(c==null||c(),S.errorMessage)return f(new Error(S.errorMessage));d(S)});const p=S=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:l,response:(0,Le.WatchAssetReponse)(!1)}))},g=()=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:l,response:(0,Le.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:g,onCancel:p,type:e,address:n,symbol:r,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:h,promise:u}}addEthereumChain(e,n,r,i,s,o){const a={method:me.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:s,iconUrls:r,nativeCurrency:o}};let c=null;const l=(0,X.randomBytesHex)(8),h=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload})),{promise:new Promise((d,f)=>{this.relayEventManager.callbacks.set(l,S=>{if(c==null||c(),S.errorMessage)return f(new Error(S.errorMessage));d(S)});const p=S=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:l,response:(0,Le.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},g=S=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:l,response:(0,Le.AddEthereumChainResponse)({isApproved:!0,rpcUrl:S})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:p,onApprove:g,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:h}}switchEthereumChain(e,n){const r={method:me.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:n})},i=(0,X.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,r.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,u=>{if((0,Le.isErrorResponse)(u)&&u.errorCode)return c(Gt.standardErrors.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(u.errorMessage)return c(new Error(u.errorMessage));a(u)});const l=u=>{var d;if(u){const f=(d=(0,Gt.getErrorCode)(u))!==null&&d!==void 0?d:Gt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,me.Web3Method.switchEthereumChain,u instanceof Error?u:Gt.standardErrors.provider.unsupportedChain(e),f)}else this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i,response:(0,Le.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},h=u=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:i,response:(0,Le.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:u})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:h,chainId:r.params.chainId,address:r.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,r)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return mt.Session.hash(this._session.id)}sendRequestStandalone(e,n){const r=s=>{this.handleErrorResponse(e,n.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,xe.Web3ResponseMessage)({id:e,response:s}))};switch(n.method){case me.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:n,onSuccess:i,onCancel:r});break;case me.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:n,onSuccess:i});break;default:r();break}}onSessionConfigChanged(e){}}ze.accountRequestCallbackIds=new Set;wl([_l.default],ze.prototype,"resetAndReload",null);wl([_l.default],ze.prototype,"handleIncomingEvent",null);pi.WalletSDKRelay=ze;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.WalletSDKRelayEventManager=void 0;const l2=I;class h2{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=(0,l2.prepend0x)(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}Ei.WalletSDKRelayEventManager=h2;const f2="@coinbase/wallet-sdk",d2="3.7.1",p2="Coinbase Wallet JavaScript SDK",b2=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],g2="dist/index.js",m2="dist/index.d.ts",v2="https://github.com/coinbase/coinbase-wallet-sdk.git",y2="Coinbase, Inc.",w2="Apache-2.0",_2={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},S2={"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"6.1.0","eth-json-rpc-filters":"5.1.0","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},E2={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.4.0","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.76.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},C2={node:">= 10.0.0"},I2={name:f2,version:d2,description:p2,keywords:b2,main:g2,types:m2,repository:v2,author:y2,license:w2,scripts:_2,dependencies:S2,devDependencies:E2,engines:C2};Object.defineProperty($n,"__esModule",{value:!0});$n.CoinbaseWalletSDK=void 0;const k2=$r,x2=Dr,R2=nn,M2=Kr,T2=pi,A2=Ei,N2=I,O2={}.LINK_API_URL||"https://www.walletlink.org",Sl={}.SDK_VERSION||I2.version||"unknown";class Ci{constructor(e){var n,r,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||O2;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new M2.WalletSDKUI(l),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this._overrideIsCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new x2.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Ci.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new A2.WalletSDKRelayEventManager,this._relay=new T2.WalletSDKRelay({linkAPIUrl:s,version:Sl,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",n=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,n),this._reloadOnDisconnect===!1&&typeof r.disableReloadOnDisconnect=="function"&&r.disableReloadOnDisconnect(),r;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new R2.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:n,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,n){var r;this._appName=e||"DApp",this._appLogoUrl=n||(0,N2.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(r=this._relay)===null||r===void 0||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const n=this.walletExtension;n?n.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,n;return(n=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&n!==void 0?n:null}getCoinbaseWalletLogo(e,n=240){return(0,k2.walletLogo)(e,n)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,n;try{const r=(e=window.ethereum)!==null&&e!==void 0?e:(n=window.top)===null||n===void 0?void 0:n.ethereum;return r&&"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}$n.CoinbaseWalletSDK=Ci;Ci.VERSION=Sl;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=$n,n=nn;var r=$n;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=nn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)})(bs);const L2=Tl(bs),W2=Al({__proto__:null,default:L2},[bs]);export{W2 as i};