From 953aaf678c6e6de6c0651ee187ebbd4b45d5754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Sun, 28 Jan 2024 23:50:16 +0100 Subject: [PATCH] update package-lock --- build/elven.js | 5 ++-- example/elven.js | 5 ++-- package-lock.json | 58 +++++++++++++++++++++++++++++++---------------- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/build/elven.js b/build/elven.js index 61415e3..0ff2757 100644 --- a/build/elven.js +++ b/build/elven.js @@ -35,11 +35,12 @@ You are about to issue (register) a new token. This will set the role "ESDTRoleB Once the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).`)}issueSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();let r=["issueSemiFungible",ne.utf8ToHex(e.tokenName),ne.utf8ToHex(e.tokenTicker),ne.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:r})}issueNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();let r=["issueNonFungible",ne.utf8ToHex(e.tokenName),ne.utf8ToHex(e.tokenTicker),ne.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:r})}registerMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();let r=["registerMetaESDT",ne.utf8ToHex(e.tokenName),ne.utf8ToHex(e.tokenTicker),ne.bigIntToHex(e.numDecimals),ne.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,ne.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:r})}registerAndSetAllRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();let r=["registerAndSetAllRoles",ne.utf8ToHex(e.tokenName),ne.utf8ToHex(e.tokenTicker),ne.utf8ToHex(e.tokenType),ne.bigIntToHex(e.numDecimals)];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:r})}setBurnRoleGlobally(e){let r=["setBurnRoleGlobally",ne.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:r})}unsetBurnRoleGlobally(e){let r=["unsetBurnRoleGlobally",ne.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:r})}setSpecialRoleOnFungible(e){let r=["setSpecialRole",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user),...e.addRoleLocalMint?[ne.utf8ToHex("ESDTRoleLocalMint")]:[],...e.addRoleLocalBurn?[ne.utf8ToHex("ESDTRoleLocalBurn")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:r})}setSpecialRoleOnSemiFungible(e){let r=["setSpecialRole",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user),...e.addRoleNFTCreate?[ne.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[ne.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTAddQuantity?[ne.utf8ToHex("ESDTRoleNFTAddQuantity")]:[],...e.addRoleESDTTransferRole?[ne.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:r})}setSpecialRoleOnMetaESDT(e){return this.setSpecialRoleOnSemiFungible(e)}setSpecialRoleOnNonFungible(e){let r=["setSpecialRole",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user),...e.addRoleNFTCreate?[ne.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[ne.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTUpdateAttributes?[ne.utf8ToHex("ESDTRoleNFTUpdateAttributes")]:[],...e.addRoleNFTAddURI?[ne.utf8ToHex("ESDTRoleNFTAddURI")]:[],...e.addRoleESDTTransferRole?[ne.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:r})}nftCreate(e){let r=["ESDTNFTCreate",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.initialQuantity),ne.utf8ToHex(e.name),ne.bigIntToHex(e.royalties),ne.utf8ToHex(e.hash),ne.bufferToHex(e.attributes),...e.uris.map(ne.utf8ToHex)],i=(e.name+e.hash+e.attributes+e.uris.join("")).length*this.config.gasLimitStorePerByte.valueOf();return this.createTransaction({sender:e.creator,receiver:e.creator,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTCreate.valueOf()+i.valueOf(),dataParts:r})}pause(e){let r=["pause",ne.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:r})}unpause(e){let r=["unPause",ne.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:r})}freeze(e){let r=["freeze",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:r})}unfreeze(e){let r=["unFreeze",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:r})}wipe(e){let r=["wipe",ne.utf8ToHex(e.tokenIdentifier),ne.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitWiping,dataParts:r})}localMint(e){let r=["ESDTLocalMint",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.supplyToMint)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalMint,dataParts:r})}localBurn(e){let r=["ESDTLocalBurn",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.supplyToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalBurn,dataParts:r})}updateAttributes(e){let r=["ESDTNFTUpdateAttributes",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.tokenNonce),ne.bufferToHex(e.attributes)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTUpdateAttributes,dataParts:r})}addQuantity(e){let r=["ESDTNFTAddQuantity",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.tokenNonce),ne.bigIntToHex(e.quantityToAdd)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTAddQuantity,dataParts:r})}burnQuantity(e){let r=["ESDTNFTBurn",ne.utf8ToHex(e.tokenIdentifier),ne.bigIntToHex(e.tokenNonce),ne.bigIntToHex(e.quantityToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTBurn,dataParts:r})}createTransaction({sender:e,receiver:r,nonce:n,value:i,gasPrice:s,gasLimitHint:o,executionGasLimit:a,dataParts:u}){let c=this.buildTransactionPayload(u),f=o||this.computeGasLimit(c,a),d=new aL.TransactionVersion(xI.TRANSACTION_VERSION_DEFAULT),g=new aL.TransactionOptions(xI.TRANSACTION_OPTIONS_DEFAULT);return new Vee.Transaction({chainID:this.config.chainID,sender:e,receiver:r,gasLimit:f,gasPrice:s,nonce:n||0,value:i||0,data:c,version:d,options:g})}buildTransactionPayload(e){let r=e.join(xI.ARGUMENTS_SEPARATOR);return new Hee.TransactionPayload(r)}computeGasLimit(e,r){return this.config.minGasLimit.valueOf()+this.config.gasLimitPerByte.valueOf()*e.length()+r.valueOf()}};ny.TokenOperationsFactory=NI});var cL=A(iy=>{"use strict";l();Object.defineProperty(iy,"__esModule",{value:!0});iy.TokenOperationsFactoryConfig=void 0;var kee=pt(),OI=class{constructor(e){this.minGasPrice=1e9,this.minGasLimit=5e4,this.gasLimitPerByte=1500,this.gasLimitIssue=6e7,this.gasLimitToggleBurnRoleGlobally=6e7,this.gasLimitESDTLocalMint=3e5,this.gasLimitESDTLocalBurn=3e5,this.gasLimitSetSpecialRole=6e7,this.gasLimitPausing=6e7,this.gasLimitFreezing=6e7,this.gasLimitWiping=6e7,this.gasLimitESDTNFTCreate=3e6,this.gasLimitESDTNFTUpdateAttributes=1e6,this.gasLimitESDTNFTAddQuantity=1e6,this.gasLimitESDTNFTBurn=1e6,this.gasLimitStorePerByte=5e4,this.issueCost="50000000000000000",this.esdtContractAddress=kee.Address.fromBech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"),this.chainID=e}};iy.TokenOperationsFactoryConfig=OI});var fL=A(sy=>{"use strict";l();Object.defineProperty(sy,"__esModule",{value:!0});sy.TokenOperationsOutcomeParser=void 0;var Gee=pt(),DI=Le(),lL=CI(),PI=class{parseIssueFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issue");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseIssueNonFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issueNonFungible");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseIssueSemiFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issueSemiFungible");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseRegisterMetaESDT(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"registerMetaESDT");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseRegisterAndSetAllRoles(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"registerAndSetAllRoles"),n=this.extractTokenIdentifier(r),s=this.findSingleEventByIdentifier(e,"ESDTSetRole").topics.slice(3).map(o=>o.valueOf().toString());return{tokenIdentifier:n,roles:s}}parseSetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseUnsetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseSetSpecialRole(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTSetRole"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=r.topics.slice(3).map(o=>o.valueOf().toString());return{userAddress:n,tokenIdentifier:i,roles:s}}parseNFTCreate(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTCreate"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,initialQuantity:s}}parseLocalMint(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTLocalMint"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=this.extractNonce(r),o=this.extractAmount(r);return{userAddress:n,tokenIdentifier:i,nonce:s,mintedSupply:o}}parseLocalBurn(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTLocalBurn"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=this.extractNonce(r),o=this.extractAmount(r);return{userAddress:n,tokenIdentifier:i,nonce:s,burntSupply:o}}parsePause(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTPause");return{}}parseUnpause(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTUnPause");return{}}parseFreeze(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTFreeze"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseUnfreeze(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTUnFreeze"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseWipe(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTWipe"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseUpdateAttributes(e){var r;this.ensureNoError(e);let n=this.findSingleEventByIdentifier(e,"ESDTNFTUpdateAttributes"),i=this.extractTokenIdentifier(n),s=this.extractNonce(n),o=(r=n.topics[3])===null||r===void 0?void 0:r.valueOf();return{tokenIdentifier:i,nonce:s,attributes:o}}parseAddQuantity(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTAddQuantity"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,addedQuantity:s}}parseBurnQuantity(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTBurn"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,burntQuantity:s}}ensureNoError(e){var r;for(let n of e.logs.events)if(n.identifier=="signalError"){let i=h.Buffer.from(n.data.substring(1),"hex").toString(),s=(r=n.topics[1])===null||r===void 0?void 0:r.valueOf().toString();throw new DI.ErrCannotParseTransactionOutcome(e.hash,`encountered signalError: ${s} (${i})`)}}findSingleEventByIdentifier(e,r){let n=this.gatherAllEvents(e).filter(i=>i.identifier==r);if(n.length==0)throw new DI.ErrCannotParseTransactionOutcome(e.hash,`cannot find event of type ${r}`);if(n.length>1)throw new DI.ErrCannotParseTransactionOutcome(e.hash,`more than one event of type ${r}`);return n[0]}gatherAllEvents(e){let r=[];r.push(...e.logs.events);for(let n of e.contractResults.items)r.push(...n.logs.events);return r}extractTokenIdentifier(e){var r;return(r=e.topics[0])===null||r===void 0?void 0:r.valueOf().toString()}extractNonce(e){var r;return lL.bufferToBigInt((r=e.topics[1])===null||r===void 0?void 0:r.valueOf()).toFixed(0)}extractAmount(e){var r;return lL.bufferToBigInt((r=e.topics[2])===null||r===void 0?void 0:r.valueOf()).toFixed(0)}extractAddress(e){var r;return Gee.Address.fromBuffer((r=e.topics[3])===null||r===void 0?void 0:r.valueOf()).toString()}};sy.TokenOperationsOutcomeParser=PI});var dL=A(pi=>{"use strict";l();var jee=pi&&pi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RI=pi&&pi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jee(e,t,r)};Object.defineProperty(pi,"__esModule",{value:!0});RI(uL(),pi);RI(cL(),pi);RI(fL(),pi)});var hL=A(rt=>{"use strict";l();var Qee=rt&&rt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dt=rt&&rt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qee(e,t,r)};Object.defineProperty(rt,"__esModule",{value:!0});H8();Dt(ha(),rt);Dt(pt(),rt);Dt(TE(),rt);Dt(Le(),rt);Dt(bE(),rt);Dt(G8(),rt);Dt(Q8(),rt);Dt(pa(),rt);Dt(xc(),rt);Dt(z8(),rt);Dt(iL(),rt);Dt(Wh(),rt);Dt(_I(),rt);Dt(dL(),rt);Dt(Vm(),rt);Dt(Yr(),rt);Dt(Yn(),rt);Dt(Ih(),rt);Dt(vE(),rt);Dt(br(),rt)});var EL=A(Pt=>{"use strict";l();var zee=Pt&&Pt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.sleep=Pt.getMetadata=Pt.applyTransactionSignature=Pt.getAddressFromSession=Pt.addressIsValid=Pt.getConnectionParams=Pt.getCurrentTopic=Pt.getCurrentSession=void 0;var yL=hL(),pL=Rc(),Wee=Dl(),oy=uI(),gi=fI(),BI=hI(),gL=Kg();function mL(t,e){if(!e)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=e.find(wL(t)).filter(n=>n.acknowledged);if(r.length>0){let n=r.length-1;return r[n]}if(e.session.length>0){let n=e.session.keys.length-1;return e.session.get(e.session.keys[n])}throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected)}Pt.getCurrentSession=mL;function $ee(t,e){if(!e)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=mL(t,e);if(!r?.topic)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);return r.topic}Pt.getCurrentTopic=$ee;function wL(t,e){var r,n,i;let s=[...oy.WALLETCONNECT_MULTIVERSX_METHODS,...(r=e?.methods)!==null&&r!==void 0?r:[]];!((n=e?.methods)===null||n===void 0)&&n.includes(gL.OptionalOperation.SIGN_LOGIN_TOKEN)||s.push(gL.OptionalOperation.SIGN_LOGIN_TOKEN);let o=[`${oy.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${t}`],a=(i=e?.events)!==null&&i!==void 0?i:[];return{requiredNamespaces:{[oy.WALLETCONNECT_MULTIVERSX_NAMESPACE]:{methods:s,chains:o,events:a}}}}Pt.getConnectionParams=wL;function Kee(t){try{return!yL.Address.fromBech32(t).isEmpty()}catch{return!1}}Pt.addressIsValid=Kee;function Yee(t){let e=t.namespaces[oy.WALLETCONNECT_MULTIVERSX_NAMESPACE];if(e&&e.accounts){let r=e.accounts[0],[n,i,s]=r.split(":");return s}return""}Pt.getAddressFromSession=Yee;function Jee({transaction:t,response:e}){if(!e)throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);let{signature:r,guardianSignature:n,version:i,options:s,guardian:o}=e,a=t.getGuardian().bech32();if(a&&a!==o)throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidGuardian),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidGuardian);return o&&t.setGuardian(yL.Address.fromBech32(o)),i&&t.setVersion(i),s!=null&&t.setOptions(s),t.applySignature(new pL.Signature(r)),n&&t.applyGuardianSignature(new pL.Signature(n)),t}Pt.applyTransactionSignature=Jee;function Xee(t){if(t)return Object.assign(Object.assign({},t),{url:Wee.getAppMetadata().url})}Pt.getMetadata=Xee;function Zee(t){return zee(this,void 0,void 0,function*(){return yield new Promise(e=>setTimeout(()=>{e()},t))})}Pt.sleep=Zee});var Yl=A(vr=>{"use strict";l();var St=vr&&vr.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},ete=vr&&vr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vr,"__esModule",{value:!0});vr.WalletConnectV2Provider=vr.OptionalOperation=vr.Operation=vr.WalletConnectV2ProviderErrorMessagesEnum=void 0;var tte=Rc(),rte=ete(q8()),LI=Dl(),yo=uI(),we=fI();Object.defineProperty(vr,"WalletConnectV2ProviderErrorMessagesEnum",{enumerable:!0,get:function(){return we.WalletConnectV2ProviderErrorMessagesEnum}});var Fe=hI(),cs=Kg();Object.defineProperty(vr,"Operation",{enumerable:!0,get:function(){return cs.Operation}});Object.defineProperty(vr,"OptionalOperation",{enumerable:!0,get:function(){return cs.OptionalOperation}});var Wt=EL(),FI=class{constructor(e,r,n,i,s){this.chainId="",this.address="",this.signature="",this.isInitializing=!1,this.processingTopic="",this.options={},this.onClientConnect=e,this.chainId=r,this.walletConnectV2Relay=n,this.walletConnectV2ProjectId=i,this.options=s}reset(){this.address="",this.signature="",this.walletConnector=void 0,this.session=void 0,this.pairings=void 0}init(){var e,r;return St(this,void 0,void 0,function*(){if(this.isInitialized())return this.isInitialized();try{if(!this.isInitializing){this.isInitializing=!0,this.reset();let n=!((e=this.options)===null||e===void 0)&&e.metadata?{metadata:Wt.getMetadata((r=this.options)===null||r===void 0?void 0:r.metadata)}:{},i=yield rte.default.init(Object.assign(Object.assign(Object.assign({},this.options),{relayUrl:this.walletConnectV2Relay,projectId:this.walletConnectV2ProjectId}),n));this.walletConnector=i,this.isInitializing=!1,yield this.subscribeToEvents(i),yield this.checkPersistedState(i)}}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToInit)}finally{return this.isInitializing=!1,this.isInitialized()}})}isInitialized(){return!!this.walletConnector&&!this.isInitializing}isConnected(){return new Promise((e,r)=>e(!!(this.isInitialized()&&typeof this.session<"u")))}connect(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=Wt.getConnectionParams(this.chainId,e);try{return yield this.walletConnector.connect(Object.assign({pairingTopic:e?.topic},r))}catch{throw this.reset(),Fe.Logger.error(e?.topic?we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnectExisting:we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnect),new Error(e?.topic?we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnectExisting:we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnect)}})}login(e){var r;return St(this,void 0,void 0,function*(){if(this.isInitializing=!0,typeof this.walletConnector>"u"&&(yield this.connect()),typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);typeof this.session<"u"&&(yield this.logout({topic:(r=this.session)===null||r===void 0?void 0:r.topic}));try{if(e&&e.approval){let n=yield e.approval();if(e.token){yield Wt.sleep(yo.WALLETCONNECT_SIGN_LOGIN_DELAY);let i=Wt.getAddressFromSession(n),o=n.namespaces[yo.WALLETCONNECT_MULTIVERSX_NAMESPACE].methods.includes(cs.OptionalOperation.SIGN_NATIVE_AUTH_TOKEN)?cs.OptionalOperation.SIGN_NATIVE_AUTH_TOKEN:cs.OptionalOperation.SIGN_LOGIN_TOKEN,{signature:a}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:n.topic,request:{method:o,params:{token:e.token,address:i}}});if(!a)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSignLoginToken),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSignLoginToken);return yield this.onSessionConnected({session:n,signature:a})}return yield this.onSessionConnected({session:n,signature:""})}}catch{throw this.reset(),Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToLogin),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToLogin)}finally{this.isInitializing=!1}return""})}logout(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);try{if(this.processingTopic===(e?.topic||Wt.getCurrentTopic(this.chainId,this.walletConnector)))return!0;if(e?.topic)this.processingTopic=e.topic,yield this.walletConnector.disconnect({topic:e.topic,reason:LI.getSdkError("USER_DISCONNECTED")});else{let r=Wt.getCurrentTopic(this.chainId,this.walletConnector);this.processingTopic=r,yield this.walletConnector.disconnect({topic:r,reason:LI.getSdkError("USER_DISCONNECTED")}),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0})}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.alreadyLoggedOut)}finally{this.processingTopic=""}return!0})}getAddress(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return this.address})}getSignature(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return this.signature})}getPairings(){var e,r,n,i,s;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return(s=(i=(n=(r=(e=this.walletConnector)===null||e===void 0?void 0:e.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0?void 0:n.pairings)===null||i===void 0?void 0:i.getAll({active:!0}))!==null&&s!==void 0?s:[]})}signMessage(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);try{let r=yield this.getAddress(),{signature:n}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_MESSAGE,params:{address:r,message:e.message.toString()}}});if(!n)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageResponse),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageResponse);try{e.applySignature(new tte.Signature(n))}catch{throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageSignature),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageSignature)}}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSign)}return e})}signTransaction(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);let r=e.toPlainObject();if(this.chainId!==e.getChainID().valueOf())throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain);try{let n=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_TRANSACTION,params:{transaction:r}}});return Wt.applyTransactionSignature({transaction:e,response:n})}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.transactionError)}})}signTransactions(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);let r=e.map(n=>{if(this.chainId!==n.getChainID().valueOf())throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain);return n.toPlainObject()});try{let{signatures:n}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_TRANSACTIONS,params:{transactions:r}}});if(!n)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);if(!Array.isArray(n)||e.length!==n.length)throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);for(let[i,s]of e.entries()){let o=n[i];Wt.applyTransactionSignature({transaction:s,response:o})}return e}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.transactionError)}})}sendCustomRequest(e){var r;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);if(!((r=e?.request)===null||r===void 0)&&r.method){try{let n=Object.assign({},e.request),{method:i}=n,{response:s}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:Object.assign(Object.assign({},n),{method:i})});s||Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidCustomRequestResponse)}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidCustomRequestResponse)}return}})}ping(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);typeof this.session>"u"&&Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);try{let e=Wt.getCurrentTopic(this.chainId,this.walletConnector);return yield this.walletConnector.ping({topic:e}),!0}catch{return Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.pingFailed),!1}})}loginAccount(e){return St(this,void 0,void 0,function*(){return e?Wt.addressIsValid(e.address)?(this.address=e.address,e.signature&&(this.signature=e.signature),this.onClientConnect.onClientLogin(),this.address):(Fe.Logger.error(`${we.WalletConnectV2ProviderErrorMessagesEnum.invalidAddress} ${e.address}`),this.walletConnector&&(yield this.logout()),""):""})}onSessionConnected(e){return St(this,void 0,void 0,function*(){if(!e)return"";this.session=e.session;let r=Wt.getAddressFromSession(e.session);return r?(yield this.loginAccount({address:r,signature:e.signature}),r):""})}handleTopicUpdateEvent({topic:e}){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u"){Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return}try{let r=yield this.getPairings();if(this.address&&!this.isInitializing&&r)if(r?.length===0)this.onClientConnect.onClientLogout();else{let n=r[r.length-1];n?.topic===e&&this.onClientConnect.onClientLogout()}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleTopic)}finally{this.pairings=yield this.getPairings()}})}handleSessionEvents({topic:e,params:r}){var n;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(this.session&&((n=this.session)===null||n===void 0?void 0:n.topic)!==e)return;let{event:i}=r;if(i?.name&&Wt.getCurrentTopic(this.chainId,this.walletConnector)===e){let s=i.data;this.onClientConnect.onClientEvent(s)}})}subscribeToEvents(e){var r,n,i,s;return St(this,void 0,void 0,function*(){if(typeof e>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);try{e.on("session_update",({topic:o,params:a})=>{var u;if(!this.session||((u=this.session)===null||u===void 0?void 0:u.topic)!==o)return;let{namespaces:c}=a,f=e.session.get(o),d=Object.assign(Object.assign({},f),{namespaces:c});this.onSessionConnected({session:d})}),e.on("session_event",this.handleSessionEvents.bind(this)),e.on("session_delete",({topic:o})=>St(this,void 0,void 0,function*(){var a;this.isInitializing&&(this.onClientConnect.onClientLogout(),this.reset()),!(!this.session||((a=this.session)===null||a===void 0?void 0:a.topic)!==o)&&(Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionDeleted),this.onClientConnect.onClientLogout(),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0}))})),e.on("session_expire",({topic:o})=>St(this,void 0,void 0,function*(){var a;!this.session||((a=this.session)===null||a===void 0?void 0:a.topic)!==o||(Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionExpired),this.onClientConnect.onClientLogout(),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0}))})),(n=(r=e.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0||n.events.on("pairing_delete",this.handleTopicUpdateEvent.bind(this)),(s=(i=e.core)===null||i===void 0?void 0:i.pairing)===null||s===void 0||s.events.on("pairing_expire",this.handleTopicUpdateEvent.bind(this))}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleEvent)}})}checkPersistedState(e){return St(this,void 0,void 0,function*(){if(typeof e>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(this.pairings=yield this.getPairings(),!(typeof this.session<"u")&&e.session.length&&!this.address&&!this.isInitializing){let r=Wt.getCurrentSession(this.chainId,e);if(r)return yield this.onSessionConnected({session:r}),r}})}cleanupPendingPairings(e={}){var r,n,i,s,o,a,u,c;return St(this,void 0,void 0,function*(){if(!(typeof this.walletConnector>"u"))try{let f=(i=(n=(r=this.walletConnector.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0?void 0:n.pairings)===null||i===void 0?void 0:i.getAll({active:!1});if(!LI.isValidArray(f))return;for(let d of f)if(e.deletePairings)(o=(s=this.walletConnector.core)===null||s===void 0?void 0:s.expirer)===null||o===void 0||o.set(d.topic,0);else try{yield(c=(u=(a=this.walletConnector.core)===null||a===void 0?void 0:a.relayer)===null||u===void 0?void 0:u.subscriber)===null||c===void 0?void 0:c.unsubscribe(d.topic)}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleCleanup)}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleCleanup)}})}};vr.WalletConnectV2Provider=FI});var AL=A((dme,vL)=>{"use strict";l();vL.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}});var _L=A((pme,IL)=>{"use strict";l();var bL=typeof Symbol<"u"&&Symbol,nte=AL();IL.exports=function(){return typeof bL!="function"||typeof Symbol!="function"||typeof bL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nte()}});var CL=A((yme,TL)=>{"use strict";l();var SL={foo:{}},ite=Object;TL.exports=function(){return{__proto__:SL}.foo===SL.foo&&!({__proto__:null}instanceof ite)}});var OL=A((wme,NL)=>{"use strict";l();var ste="Function.prototype.bind called on incompatible ",ote=Object.prototype.toString,ate=Math.max,ute="[object Function]",xL=function(e,r){for(var n=[],i=0;i{"use strict";l();var fte=OL();DL.exports=Function.prototype.bind||fte});var RL=A((bme,PL)=>{"use strict";l();var dte=Function.prototype.call,hte=Object.prototype.hasOwnProperty,pte=ay();PL.exports=pte.call(dte,hte)});var ls=A((_me,UL)=>{"use strict";l();var Re,Eu=SyntaxError,ML=Function,wu=TypeError,MI=function(t){try{return ML('"use strict"; return ('+t+").constructor;")()}catch{}},mo=Object.getOwnPropertyDescriptor;if(mo)try{mo({},"")}catch{mo=null}var UI=function(){throw new wu},gte=mo?function(){try{return arguments.callee,UI}catch{try{return mo(arguments,"callee").get}catch{return UI}}}():UI,yu=_L()(),yte=CL()(),Gt=Object.getPrototypeOf||(yte?function(t){return t.__proto__}:null),mu={},mte=typeof Uint8Array>"u"||!Gt?Re:Gt(Uint8Array),wo={"%AggregateError%":typeof AggregateError>"u"?Re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Re:ArrayBuffer,"%ArrayIteratorPrototype%":yu&&Gt?Gt([][Symbol.iterator]()):Re,"%AsyncFromSyncIteratorPrototype%":Re,"%AsyncFunction%":mu,"%AsyncGenerator%":mu,"%AsyncGeneratorFunction%":mu,"%AsyncIteratorPrototype%":mu,"%Atomics%":typeof Atomics>"u"?Re:Atomics,"%BigInt%":typeof BigInt>"u"?Re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Re:FinalizationRegistry,"%Function%":ML,"%GeneratorFunction%":mu,"%Int8Array%":typeof Int8Array>"u"?Re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Re:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yu&&Gt?Gt(Gt([][Symbol.iterator]())):Re,"%JSON%":typeof JSON=="object"?JSON:Re,"%Map%":typeof Map>"u"?Re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!yu||!Gt?Re:Gt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Re:Promise,"%Proxy%":typeof Proxy>"u"?Re:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!yu||!Gt?Re:Gt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yu&&Gt?Gt(""[Symbol.iterator]()):Re,"%Symbol%":yu?Symbol:Re,"%SyntaxError%":Eu,"%ThrowTypeError%":gte,"%TypedArray%":mte,"%TypeError%":wu,"%Uint8Array%":typeof Uint8Array>"u"?Re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Re:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Re:WeakSet};if(Gt)try{null.error}catch(t){BL=Gt(Gt(t)),wo["%Error.prototype%"]=BL}var BL,wte=function t(e){var r;if(e==="%AsyncFunction%")r=MI("async function () {}");else if(e==="%GeneratorFunction%")r=MI("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=MI("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Gt&&(r=Gt(i.prototype))}return wo[e]=r,r},LL={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Jl=ay(),uy=RL(),Ete=Jl.call(Function.call,Array.prototype.concat),vte=Jl.call(Function.apply,Array.prototype.splice),FL=Jl.call(Function.call,String.prototype.replace),cy=Jl.call(Function.call,String.prototype.slice),Ate=Jl.call(Function.call,RegExp.prototype.exec),bte=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ite=/\\(\\)?/g,_te=function(e){var r=cy(e,0,1),n=cy(e,-1);if(r==="%"&&n!=="%")throw new Eu("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Eu("invalid intrinsic syntax, expected opening `%`");var i=[];return FL(e,bte,function(s,o,a,u){i[i.length]=a?FL(u,Ite,"$1"):o||s}),i},Ste=function(e,r){var n=e,i;if(uy(LL,n)&&(i=LL[n],n="%"+i[0]+"%"),uy(wo,n)){var s=wo[n];if(s===mu&&(s=wte(n)),typeof s>"u"&&!r)throw new wu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Eu("intrinsic "+e+" does not exist!")};UL.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new wu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new wu('"allowMissing" argument must be a boolean');if(Ate(/^%?[^%]*%?$/,e)===null)throw new Eu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_te(e),i=n.length>0?n[0]:"",s=Ste("%"+i+"%",r),o=s.name,a=s.value,u=!1,c=s.alias;c&&(i=c[0],vte(n,Ete([0,1],c)));for(var f=1,d=!0;f=n.length){var b=mo(a,g);d=!!b,d&&"get"in b&&!("originalValue"in b.get)?a=b.get:a=a[g]}else d=uy(a,g),a=a[g];d&&!u&&(wo[o]=a)}}return a}});var HI=A((Tme,qL)=>{"use strict";l();var Tte=ls(),qI=Tte("%Object.defineProperty%",!0),VI=function(){if(qI)try{return qI({},"a",{value:1}),!0}catch{return!1}return!1};VI.hasArrayLengthDefineBug=function(){if(!VI())return null;try{return qI([],"length",{value:1}).length!==1}catch{return!0}};qL.exports=VI});var kI=A((xme,VL)=>{"use strict";l();var Cte=ls(),ly=Cte("%Object.getOwnPropertyDescriptor%",!0);if(ly)try{ly([],"length")}catch{ly=null}VL.exports=ly});var GL=A((Ome,kL)=>{"use strict";l();var xte=HI()(),GI=ls(),Xl=xte&&GI("%Object.defineProperty%",!0);if(Xl)try{Xl({},"a",{value:1})}catch{Xl=!1}var Nte=GI("%SyntaxError%"),vu=GI("%TypeError%"),HL=kI();kL.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new vu("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new vu("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new vu("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new vu("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new vu("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new vu("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,u=!!HL&&HL(e,r);if(Xl)Xl(e,r,{configurable:o===null&&u?u.configurable:!o,enumerable:i===null&&u?u.enumerable:!i,value:n,writable:s===null&&u?u.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new Nte("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var KL=A((Pme,$L)=>{"use strict";l();var WL=ls(),jL=GL(),Ote=HI()(),QL=kI(),zL=WL("%TypeError%"),Dte=WL("%Math.floor%");$L.exports=function(e,r){if(typeof e!="function")throw new zL("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Dte(r)!==r)throw new zL("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&QL){var o=QL(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!n)&&(Ote?jL(e,"length",r,!0,!0):jL(e,"length",r)),e}});var eF=A((Bme,fy)=>{"use strict";l();var jI=ay(),Au=ls(),Pte=KL(),Rte=Au("%TypeError%"),JL=Au("%Function.prototype.apply%"),XL=Au("%Function.prototype.call%"),ZL=Au("%Reflect.apply%",!0)||jI.call(XL,JL),Zl=Au("%Object.defineProperty%",!0),Bte=Au("%Math.max%");if(Zl)try{Zl({},"a",{value:1})}catch{Zl=null}fy.exports=function(e){if(typeof e!="function")throw new Rte("a function is required");var r=ZL(jI,XL,arguments);return Pte(r,1+Bte(0,e.length-(arguments.length-1)),!0)};var YL=function(){return ZL(jI,JL,arguments)};Zl?Zl(fy.exports,"apply",{value:YL}):fy.exports.apply=YL});var iF=A((Fme,nF)=>{"use strict";l();var tF=ls(),rF=eF(),Lte=rF(tF("String.prototype.indexOf"));nF.exports=function(e,r){var n=tF(e,!!r);return typeof n=="function"&&Lte(e,".prototype.")>-1?rF(n):n}});var sF=A(()=>{l()});var SF=A((Hme,_F)=>{l();var e_=typeof Map=="function"&&Map.prototype,QI=Object.getOwnPropertyDescriptor&&e_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hy=e_&&QI&&typeof QI.get=="function"?QI.get:null,oF=e_&&Map.prototype.forEach,t_=typeof Set=="function"&&Set.prototype,zI=Object.getOwnPropertyDescriptor&&t_?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,py=t_&&zI&&typeof zI.get=="function"?zI.get:null,aF=t_&&Set.prototype.forEach,Fte=typeof WeakMap=="function"&&WeakMap.prototype,tf=Fte?WeakMap.prototype.has:null,Mte=typeof WeakSet=="function"&&WeakSet.prototype,rf=Mte?WeakSet.prototype.has:null,Ute=typeof WeakRef=="function"&&WeakRef.prototype,uF=Ute?WeakRef.prototype.deref:null,qte=Boolean.prototype.valueOf,Vte=Object.prototype.toString,Hte=Function.prototype.toString,kte=String.prototype.match,r_=String.prototype.slice,ds=String.prototype.replace,Gte=String.prototype.toUpperCase,cF=String.prototype.toLowerCase,wF=RegExp.prototype.test,lF=Array.prototype.concat,qn=Array.prototype.join,jte=Array.prototype.slice,fF=Math.floor,KI=typeof BigInt=="function"?BigInt.prototype.valueOf:null,WI=Object.getOwnPropertySymbols,YI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,bu=typeof Symbol=="function"&&typeof Symbol.iterator=="object",nr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===bu||!0)?Symbol.toStringTag:null,EF=Object.prototype.propertyIsEnumerable,dF=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function hF(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||wF.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-fF(-t):fF(t);if(n!==t){var i=String(n),s=r_.call(e,i.length+1);return ds.call(i,r,"$&_")+"."+ds.call(ds.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ds.call(e,r,"$&_")}var JI=sF(),pF=JI.custom,gF=AF(pF)?pF:null;_F.exports=function t(e,r,n,i){var s=r||{};if(fs(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fs(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=fs(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fs(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fs(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return IF(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return a?hF(e,u):u}if(typeof e=="bigint"){var c=String(e)+"n";return a?hF(e,c):c}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return XI(e)?"[Array]":"[Object]";var d=ure(s,n);if(typeof i>"u")i=[];else if(bF(i,e)>=0)return"[Circular]";function g(j,K,me){if(K&&(i=jte.call(i),i.push(K)),me){var ce={depth:s.depth};return fs(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(j,ce,n+1,i)}return t(j,s,n+1,i)}if(typeof e=="function"&&!yF(e)){var m=Zte(e),y=dy(e,g);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(y.length>0?" { "+qn.call(y,", ")+" }":"")}if(AF(e)){var b=bu?ds.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):YI.call(e);return typeof e=="object"&&!bu?ef(b):b}if(sre(e)){for(var O="<"+cF.call(String(e.nodeName)),R=e.attributes||[],z=0;z",O}if(XI(e)){if(e.length===0)return"[]";var M=dy(e,g);return d&&!are(M)?"["+ZI(M,d)+"]":"[ "+qn.call(M,", ")+" ]"}if(Wte(e)){var E=dy(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!EF.call(e,"cause")?"{ ["+String(e)+"] "+qn.call(lF.call("[cause]: "+g(e.cause),E),", ")+" }":E.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+qn.call(E,", ")+" }"}if(typeof e=="object"&&o){if(gF&&typeof e[gF]=="function"&&JI)return JI(e,{depth:f-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ere(e)){var S=[];return oF&&oF.call(e,function(j,K){S.push(g(K,e,!0)+" => "+g(j,e))}),mF("Map",hy.call(e),S,d)}if(nre(e)){var N=[];return aF&&aF.call(e,function(j){N.push(g(j,e))}),mF("Set",py.call(e),N,d)}if(tre(e))return $I("WeakMap");if(ire(e))return $I("WeakSet");if(rre(e))return $I("WeakRef");if(Kte(e))return ef(g(Number(e)));if(Jte(e))return ef(g(KI.call(e)));if(Yte(e))return ef(qte.call(e));if($te(e))return ef(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===global)return"{ [object globalThis] }";if(!zte(e)&&!yF(e)){var _=dy(e,g),T=dF?dF(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",X=!T&&nr&&Object(e)===e&&nr in e?r_.call(hs(e),8,-1):B?"Object":"",Q=T||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",H=Q+(X||B?"["+qn.call(lF.call([],X||[],B||[]),": ")+"] ":"");return _.length===0?H+"{}":d?H+"{"+ZI(_,d)+"}":H+"{ "+qn.call(_,", ")+" }"}return String(e)};function vF(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qte(t){return ds.call(String(t),/"/g,""")}function XI(t){return hs(t)==="[object Array]"&&(!nr||!(typeof t=="object"&&nr in t))}function zte(t){return hs(t)==="[object Date]"&&(!nr||!(typeof t=="object"&&nr in t))}function yF(t){return hs(t)==="[object RegExp]"&&(!nr||!(typeof t=="object"&&nr in t))}function Wte(t){return hs(t)==="[object Error]"&&(!nr||!(typeof t=="object"&&nr in t))}function $te(t){return hs(t)==="[object String]"&&(!nr||!(typeof t=="object"&&nr in t))}function Kte(t){return hs(t)==="[object Number]"&&(!nr||!(typeof t=="object"&&nr in t))}function Yte(t){return hs(t)==="[object Boolean]"&&(!nr||!(typeof t=="object"&&nr in t))}function AF(t){if(bu)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!YI)return!1;try{return YI.call(t),!0}catch{}return!1}function Jte(t){if(!t||typeof t!="object"||!KI)return!1;try{return KI.call(t),!0}catch{}return!1}var Xte=Object.prototype.hasOwnProperty||function(t){return t in this};function fs(t,e){return Xte.call(t,e)}function hs(t){return Vte.call(t)}function Zte(t){if(t.name)return t.name;var e=kte.call(Hte.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function bF(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return IF(r_.call(t,0,e.maxStringLength),e)+n}var i=ds.call(ds.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ore);return vF(i,"single",e)}function ore(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Gte.call(e.toString(16))}function ef(t){return"Object("+t+")"}function $I(t){return t+" { ? }"}function mF(t,e,r,n){var i=n?ZI(r,n):qn.call(r,", ");return t+" ("+e+") {"+i+"}"}function are(t){for(var e=0;e=0)return!1;return!0}function ure(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=qn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:qn.call(Array(e+1),r)}}function ZI(t,e){if(t.length===0)return"";var r=` `+e.prev+e.base;return r+qn.call(t,","+r)+` -`+e.prev}function dy(t,e){var r=XI(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";l();var n_=ls(),Iu=iF(),cre=SF(),lre=n_("%TypeError%"),gy=n_("%WeakMap%",!0),yy=n_("%Map%",!0),fre=Iu("WeakMap.prototype.get",!0),dre=Iu("WeakMap.prototype.set",!0),hre=Iu("WeakMap.prototype.has",!0),pre=Iu("Map.prototype.get",!0),gre=Iu("Map.prototype.set",!0),yre=Iu("Map.prototype.has",!0),i_=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mre=function(t,e){var r=i_(t,e);return r&&r.value},wre=function(t,e,r){var n=i_(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Ere=function(t,e){return!!i_(t,e)};TF.exports=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new lre("Side channel does not contain "+cre(s))},get:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fre(e,s)}else if(yy){if(r)return pre(r,s)}else if(n)return mre(n,s)},has:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return hre(e,s)}else if(yy){if(r)return yre(r,s)}else if(n)return Ere(n,s);return!1},set:function(s,o){gy&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new gy),dre(e,s,o)):yy?(r||(r=new yy),gre(r,s,o)):(n||(n={key:{},next:null}),wre(n,s,o))}};return i}});var my=A((Qme,xF)=>{"use strict";l();var vre=String.prototype.replace,Are=/%20/g,s_={RFC1738:"RFC1738",RFC3986:"RFC3986"};xF.exports={default:s_.RFC3986,formatters:{RFC1738:function(t){return vre.call(t,Are,"+")},RFC3986:function(t){return String(t)}},RFC1738:s_.RFC1738,RFC3986:s_.RFC3986}});var a_=A((Wme,OF)=>{"use strict";l();var bre=my(),o_=Object.prototype.hasOwnProperty,Eo=Array.isArray,Vn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ire=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Eo(n)){for(var i=[],s=0;s=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||s===bre.RFC1738&&(c===40||c===41)){a+=o.charAt(u);continue}if(c<128){a=a+Vn[c];continue}if(c<2048){a=a+(Vn[192|c>>6]+Vn[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Vn[224|c>>12]+Vn[128|c>>6&63]+Vn[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|o.charCodeAt(u)&1023),a+=Vn[240|c>>18]+Vn[128|c>>12&63]+Vn[128|c>>6&63]+Vn[128|c&63]}return a},xre=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i{"use strict";l();var RF=CF(),c_=a_(),nf=my(),Rre=Object.prototype.hasOwnProperty,DF={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vo=Array.isArray,Bre=String.prototype.split,Lre=Array.prototype.push,BF=function(t,e){Lre.apply(t,vo(e)?e:[e])},Fre=Date.prototype.toISOString,PF=nf.default,$t={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:c_.encode,encodeValuesOnly:!1,format:PF,formatter:nf.formatters[PF],indices:!1,serializeDate:function(e){return Fre.call(e)},skipNulls:!1,strictNullHandling:!1},Mre=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},u_={},Ure=function t(e,r,n,i,s,o,a,u,c,f,d,g,m,y,b){for(var O=e,R=b,z=0,M=!1;(R=R.get(u_))!==void 0&&!M;){var E=R.get(e);if(z+=1,typeof E<"u"){if(E===z)throw new RangeError("Cyclic object value");M=!0}typeof R.get(u_)>"u"&&(z=0)}if(typeof a=="function"?O=a(r,O):O instanceof Date?O=f(O):n==="comma"&&vo(O)&&(O=c_.maybeMap(O,function(ie){return ie instanceof Date?f(ie):ie})),O===null){if(i)return o&&!m?o(r,$t.encoder,y,"key",d):r;O=""}if(Mre(O)||c_.isBuffer(O)){if(o){var S=m?r:o(r,$t.encoder,y,"key",d);if(n==="comma"&&m){for(var N=Bre.call(String(O),","),_="",T=0;T"u")return B;var X;if(n==="comma"&&vo(O))X=[{value:O.length>0?O.join(",")||null:void 0}];else if(vo(a))X=a;else{var Q=Object.keys(O);X=u?Q.sort(u):Q}for(var H=0;H"u"?$t.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:$t.charsetSentinel,delimiter:typeof e.delimiter>"u"?$t.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:$t.encode,encoder:typeof e.encoder=="function"?e.encoder:$t.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:$t.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:$t.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:$t.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:$t.strictNullHandling}};LF.exports=function(t,e){var r=t,n=qre(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vo(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in DF?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=DF[a];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=RF(),f=0;f0?m+g:""}});var qF=A((Jme,UF)=>{"use strict";l();var _u=a_(),l_=Object.prototype.hasOwnProperty,Vre=Array.isArray,jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_u.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hre=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},MF=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},kre="utf8=%26%2310003%3B",Gre="utf8=%E2%9C%93",jre=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,u,c=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(y=Vre(y)?[y]:y),l_.call(n,m)?n[m]=_u.combine(n[m],y):n[m]=y}return n},Qre=function(t,e,r,n){for(var i=n?e:MF(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(o=[],o[c]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},zre=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),c=u?s.slice(0,u.index):s,f=[];if(c){if(!n.plainObjects&&l_.call(Object.prototype,c)&&!n.allowPrototypes)return;f.push(c)}for(var d=0;n.depth>0&&(u=a.exec(s))!==null&&d"u"?jt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?jt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:jt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:jt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:jt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:jt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:jt.comma,decoder:typeof e.decoder=="function"?e.decoder:jt.decoder,delimiter:typeof e.delimiter=="string"||_u.isRegExp(e.delimiter)?e.delimiter:jt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:jt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:jt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:jt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:jt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:jt.strictNullHandling}};UF.exports=function(t,e){var r=Wre(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?jre(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o{"use strict";l();var $re=FF(),Kre=qF(),Yre=my();VF.exports={formats:Yre,parse:Kre,stringify:$re}});var f_=A(Ge=>{"use strict";l();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED=Ge.WALLET_PROVIDER_CALLBACK_PARAM=Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL=Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL=Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL=Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL=Ge.WALLET_PROVIDER_DISCONNECT_URL=Ge.WALLET_PROVIDER_CONNECT_URL=Ge.XALIAS_PROVIDER_TESTNET=Ge.XALIAS_PROVIDER_DEVNET=Ge.XALIAS_PROVIDER_MAINNET=Ge.WALLET_PROVIDER_TESTNET=Ge.WALLET_PROVIDER_DEVNET=Ge.WALLET_PROVIDER_MAINNET=void 0;Ge.WALLET_PROVIDER_MAINNET="https://wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_DEVNET="https://devnet-wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_TESTNET="https://testnet-wallet.multiversx.com/dapp/init";Ge.XALIAS_PROVIDER_MAINNET="https://xalias.com";Ge.XALIAS_PROVIDER_DEVNET="https://devnet.xalias.com";Ge.XALIAS_PROVIDER_TESTNET="https://testnet.xalias.com";Ge.WALLET_PROVIDER_CONNECT_URL="hook/login";Ge.WALLET_PROVIDER_DISCONNECT_URL="hook/logout";Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL="hook/transaction";Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL="hook/sign";Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL="hook/2fa";Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL="hook/sign-message";Ge.WALLET_PROVIDER_CALLBACK_PARAM="walletProviderStatus";Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED="transactionsSigned"});var kF=A(Su=>{"use strict";l();Object.defineProperty(Su,"__esModule",{value:!0});Su.ErrCannotSignedMessage=Su.ErrCannotGetSignedTransactions=void 0;var d_=class extends Error{constructor(){super("Cannot get signed transaction(s)")}};Su.ErrCannotGetSignedTransactions=d_;var h_=class extends Error{constructor(){super("Cannot get signed message")}};Su.ErrCannotSignedMessage=h_});var GF=A(wy=>{"use strict";l();Object.defineProperty(wy,"__esModule",{value:!0});wy.PlainSignedTransaction=void 0;var p_=class{constructor(e){this.nonce=0,this.value="",this.receiver="",this.sender="",this.gasPrice=0,this.gasLimit=0,this.data="",this.chainID="",this.version=0,this.signature="",Object.assign(this,e)}};wy.PlainSignedTransaction=p_});var Tu=A(ys=>{"use strict";l();var ps=ys&&ys.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Jre=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.WalletProvider=void 0;var g_=Jre(HF()),gs=f_(),y_=kF(),Xre=GF(),m_=class t{constructor(e){this.walletUrl=e}login(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_CONNECT_URL,callbackUrl:e?.callbackUrl,params:{token:e?.token}});return yield this.redirect(r,e?.redirectDelayMilliseconds),r})}redirect(e,r){return ps(this,void 0,void 0,function*(){r?yield this.redirectLater(e,r):this.redirectImmediately(e)})}redirectImmediately(e){window.location.href=e}redirectLater(e,r){return ps(this,void 0,void 0,function*(){yield new Promise(n=>{setTimeout(()=>{window.location.href=e,n(!0)},r)})})}logout(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_DISCONNECT_URL,callbackUrl:e?.callbackUrl});return yield this.redirect(r,e?.redirectDelayMilliseconds),!0})}signMessage(e,r){return ps(this,void 0,void 0,function*(){let n=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_SIGN_MESSAGE_URL,callbackUrl:r?.callbackUrl,params:{message:e.message.toString()}});return yield this.redirect(n),n})}getMessageSignatureFromWalletUrl(){var e,r;let n=window.location.search.slice(1);console.info("getMessageSignatureFromWalletUrl(), url:",n);let i=g_.default.parse(n);if((((e=i.status)===null||e===void 0?void 0:e.toString())||"")!=="signed")throw new y_.ErrCannotSignedMessage;return((r=i.signature)===null||r===void 0?void 0:r.toString())||""}guardTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_GUARD_TRANSACTION_URL,e,r)})}signTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_SIGN_TRANSACTION_URL,e,r)})}signTransaction(e,r){return ps(this,void 0,void 0,function*(){yield this.signTransactions([e],r)})}getTransactionsFromWalletUrl(){let e=g_.default.parse(window.location.search.slice(1));return t.isTxSignReturnSuccess(e)?this.getTxSignReturnValue(e):[]}static isTxSignReturnSuccess(e){return e.hasOwnProperty(gs.WALLET_PROVIDER_CALLBACK_PARAM)&&e[gs.WALLET_PROVIDER_CALLBACK_PARAM]===gs.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED}getTxSignReturnValue(e){console.info("getTxSignReturnValue(), urlParams:",e);let r=["nonce","value","receiver","sender","gasPrice","gasLimit","chainID","version","signature"];for(let s of r)if(!e[s]||!Array.isArray(e[s]))throw new y_.ErrCannotGetSignedTransactions;let n=e.nonce.length;for(let s of r)if(e[s].length!==n)throw new y_.ErrCannotGetSignedTransactions;let i=[];for(let s=0;s{let a=t.prepareWalletTransaction(o);for(let u in a)a.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(i[u]=[]),i[u].push(a[u])});let s=this.buildWalletUrl({endpoint:e,callbackUrl:n?.callbackUrl,params:i});window.location.href=s}};ys.WalletProvider=m_});var IM=A((cwe,bM)=>{"use strict";l();function tM(t,e){return function(){return t.apply(e,arguments)}}var{toString:Zre}=Object.prototype,{getPrototypeOf:N_}=Object,by=(t=>e=>{let r=Zre.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kn=t=>(t=t.toLowerCase(),e=>by(e)===t),Iy=t=>e=>typeof e===t,{isArray:Ou}=Array,of=Iy("undefined");function ene(t){return t!==null&&!of(t)&&t.constructor!==null&&!of(t.constructor)&&Qr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var rM=kn("ArrayBuffer");function tne(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rM(t.buffer),e}var rne=Iy("string"),Qr=Iy("function"),nM=Iy("number"),_y=t=>t!==null&&typeof t=="object",nne=t=>t===!0||t===!1,Ey=t=>{if(by(t)!=="object")return!1;let e=N_(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ine=kn("Date"),sne=kn("File"),one=kn("Blob"),ane=kn("FileList"),une=t=>_y(t)&&Qr(t.pipe),cne=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Qr(t.append)&&((e=by(t))==="formdata"||e==="object"&&Qr(t.toString)&&t.toString()==="[object FormData]"))},lne=kn("URLSearchParams"),fne=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function af(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Ou(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}var sM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oM=t=>!of(t)&&t!==sM;function b_(){let{caseless:t}=oM(this)&&this||{},e={},r=(n,i)=>{let s=t&&iM(e,i)||i;Ey(e[s])&&Ey(n)?e[s]=b_(e[s],n):Ey(n)?e[s]=b_({},n):Ou(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(af(e,(i,s)=>{r&&Qr(i)?t[s]=tM(i,r):t[s]=i},{allOwnKeys:n}),t),hne=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),pne=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gne=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&N_(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},yne=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},mne=t=>{if(!t)return null;if(Ou(t))return t;let e=t.length;if(!nM(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wne=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&N_(Uint8Array)),Ene=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},vne=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ane=kn("HTMLFormElement"),bne=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),jF=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ine=kn("RegExp"),aM=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};af(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_ne=t=>{aM(t,(e,r)=>{if(Qr(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Qr(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sne=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ou(t)?n(t):n(String(t).split(e)),r},Tne=()=>{},Cne=(t,e)=>(t=+t,Number.isFinite(t)?t:e),w_="abcdefghijklmnopqrstuvwxyz",QF="0123456789",uM={DIGIT:QF,ALPHA:w_,ALPHA_DIGIT:w_+w_.toUpperCase()+QF},xne=(t=16,e=uM.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Nne(t){return!!(t&&Qr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var One=t=>{let e=new Array(10),r=(n,i)=>{if(_y(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ou(n)?[]:{};return af(n,(o,a)=>{let u=r(o,i+1);!of(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Dne=kn("AsyncFunction"),Pne=t=>t&&(_y(t)||Qr(t))&&Qr(t.then)&&Qr(t.catch),Y={isArray:Ou,isArrayBuffer:rM,isBuffer:ene,isFormData:cne,isArrayBufferView:tne,isString:rne,isNumber:nM,isBoolean:nne,isObject:_y,isPlainObject:Ey,isUndefined:of,isDate:ine,isFile:sne,isBlob:one,isRegExp:Ine,isFunction:Qr,isStream:une,isURLSearchParams:lne,isTypedArray:wne,isFileList:ane,forEach:af,merge:b_,extend:dne,trim:fne,stripBOM:hne,inherits:pne,toFlatObject:gne,kindOf:by,kindOfTest:kn,endsWith:yne,toArray:mne,forEachEntry:Ene,matchAll:vne,isHTMLForm:Ane,hasOwnProperty:jF,hasOwnProp:jF,reduceDescriptors:aM,freezeMethods:_ne,toObjectSet:Sne,toCamelCase:bne,noop:Tne,toFiniteNumber:Cne,findKey:iM,global:sM,isContextDefined:oM,ALPHABET:uM,generateString:xne,isSpecCompliantForm:Nne,toJSONObject:One,isAsyncFn:Dne,isThenable:Pne};function Me(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Y.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var cM=Me.prototype,lM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{lM[t]={value:t}});Object.defineProperties(Me,lM);Object.defineProperty(cM,"isAxiosError",{value:!0});Me.from=(t,e,r,n,i,s)=>{let o=Object.create(cM);return Y.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Me.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Rne=null;function I_(t){return Y.isPlainObject(t)||Y.isArray(t)}function fM(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function zF(t,e,r){return t?t.concat(e).map(function(i,s){return i=fM(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Bne(t){return Y.isArray(t)&&!t.some(I_)}var Lne=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function Sy(t,e,r){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Y.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!Y.isUndefined(O[b])});let n=r.metaTokens,i=r.visitor||f,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(Y.isDate(y))return y.toISOString();if(!u&&Y.isBlob(y))throw new Me("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(y)||Y.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):h.Buffer.from(y):y}function f(y,b,O){let R=y;if(y&&!O&&typeof y=="object"){if(Y.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=JSON.stringify(y);else if(Y.isArray(y)&&Bne(y)||(Y.isFileList(y)||Y.endsWith(b,"[]"))&&(R=Y.toArray(y)))return b=fM(b),R.forEach(function(M,E){!(Y.isUndefined(M)||M===null)&&e.append(o===!0?zF([b],E,s):o===null?b:b+"[]",c(M))}),!1}return I_(y)?!0:(e.append(zF(O,b,s),c(y)),!1)}let d=[],g=Object.assign(Lne,{defaultVisitor:f,convertValue:c,isVisitable:I_});function m(y,b){if(!Y.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),Y.forEach(y,function(R,z){(!(Y.isUndefined(R)||R===null)&&i.call(e,R,Y.isString(z)?z.trim():z,b,g))===!0&&m(R,b?b.concat(z):[z])}),d.pop()}}if(!Y.isObject(t))throw new TypeError("data must be an object");return m(t),e}function WF(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function O_(t,e){this._pairs=[],t&&Sy(t,this,e)}var dM=O_.prototype;dM.append=function(e,r){this._pairs.push([e,r])};dM.toString=function(e){let r=e?function(n){return e.call(this,n,WF)}:WF;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Fne(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hM(t,e,r){if(!e)return t;let n=r&&r.encode||Fne,i=r&&r.serialize,s;if(i?s=i(e,r):s=Y.isURLSearchParams(e)?e.toString():new O_(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var __=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(n){n!==null&&e(n)})}},$F=__,pM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mne=typeof URLSearchParams<"u"?URLSearchParams:O_,Une=typeof FormData<"u"?FormData:null,qne=typeof Blob<"u"?Blob:null,Vne={isBrowser:!0,classes:{URLSearchParams:Mne,FormData:Une,Blob:qne},protocols:["http","https","file","blob","url","data"]},gM=typeof window<"u"&&typeof document<"u",Hne=(t=>gM&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),kne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gne=Object.freeze({__proto__:null,hasBrowserEnv:gM,hasStandardBrowserWebWorkerEnv:kne,hasStandardBrowserEnv:Hne}),Hn={...Gne,...Vne};function jne(t,e){return Sy(t,new Hn.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Hn.isNode&&Y.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Qne(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function zne(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n=r.length;return o=!o&&Y.isArray(i)?i.length:o,u?(Y.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&Y.isArray(i[o])&&(i[o]=zne(i[o])),!a)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){let r={};return Y.forEachEntry(t,(n,i)=>{e(Qne(n),i,r,0)}),r}return null}function Wne(t,e,r){if(Y.isString(t))try{return(e||JSON.parse)(t),Y.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var D_={transitional:pM,adapter:["xhr","http"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=Y.isObject(e);if(s&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return i&&i?JSON.stringify(yM(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jne(e,this.formSerializer).toString();if((a=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Sy(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),Wne(e)):e}],transformResponse:[function(e){let r=this.transitional||D_.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Y.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Me.from(a,Me.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],t=>{D_.headers[t]={}});var P_=D_,$ne=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kne=t=>{let e={},r,n,i;return t&&t.split(` +`+e.prev}function dy(t,e){var r=XI(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";l();var n_=ls(),Iu=iF(),cre=SF(),lre=n_("%TypeError%"),gy=n_("%WeakMap%",!0),yy=n_("%Map%",!0),fre=Iu("WeakMap.prototype.get",!0),dre=Iu("WeakMap.prototype.set",!0),hre=Iu("WeakMap.prototype.has",!0),pre=Iu("Map.prototype.get",!0),gre=Iu("Map.prototype.set",!0),yre=Iu("Map.prototype.has",!0),i_=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mre=function(t,e){var r=i_(t,e);return r&&r.value},wre=function(t,e,r){var n=i_(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Ere=function(t,e){return!!i_(t,e)};TF.exports=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new lre("Side channel does not contain "+cre(s))},get:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fre(e,s)}else if(yy){if(r)return pre(r,s)}else if(n)return mre(n,s)},has:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return hre(e,s)}else if(yy){if(r)return yre(r,s)}else if(n)return Ere(n,s);return!1},set:function(s,o){gy&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new gy),dre(e,s,o)):yy?(r||(r=new yy),gre(r,s,o)):(n||(n={key:{},next:null}),wre(n,s,o))}};return i}});var my=A((Qme,xF)=>{"use strict";l();var vre=String.prototype.replace,Are=/%20/g,s_={RFC1738:"RFC1738",RFC3986:"RFC3986"};xF.exports={default:s_.RFC3986,formatters:{RFC1738:function(t){return vre.call(t,Are,"+")},RFC3986:function(t){return String(t)}},RFC1738:s_.RFC1738,RFC3986:s_.RFC3986}});var a_=A((Wme,OF)=>{"use strict";l();var bre=my(),o_=Object.prototype.hasOwnProperty,Eo=Array.isArray,Vn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ire=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Eo(n)){for(var i=[],s=0;s=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||s===bre.RFC1738&&(c===40||c===41)){a+=o.charAt(u);continue}if(c<128){a=a+Vn[c];continue}if(c<2048){a=a+(Vn[192|c>>6]+Vn[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Vn[224|c>>12]+Vn[128|c>>6&63]+Vn[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|o.charCodeAt(u)&1023),a+=Vn[240|c>>18]+Vn[128|c>>12&63]+Vn[128|c>>6&63]+Vn[128|c&63]}return a},xre=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i{"use strict";l();var RF=CF(),c_=a_(),nf=my(),Rre=Object.prototype.hasOwnProperty,DF={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vo=Array.isArray,Bre=String.prototype.split,Lre=Array.prototype.push,BF=function(t,e){Lre.apply(t,vo(e)?e:[e])},Fre=Date.prototype.toISOString,PF=nf.default,$t={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:c_.encode,encodeValuesOnly:!1,format:PF,formatter:nf.formatters[PF],indices:!1,serializeDate:function(e){return Fre.call(e)},skipNulls:!1,strictNullHandling:!1},Mre=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},u_={},Ure=function t(e,r,n,i,s,o,a,u,c,f,d,g,m,y,b){for(var O=e,R=b,z=0,M=!1;(R=R.get(u_))!==void 0&&!M;){var E=R.get(e);if(z+=1,typeof E<"u"){if(E===z)throw new RangeError("Cyclic object value");M=!0}typeof R.get(u_)>"u"&&(z=0)}if(typeof a=="function"?O=a(r,O):O instanceof Date?O=f(O):n==="comma"&&vo(O)&&(O=c_.maybeMap(O,function(ie){return ie instanceof Date?f(ie):ie})),O===null){if(i)return o&&!m?o(r,$t.encoder,y,"key",d):r;O=""}if(Mre(O)||c_.isBuffer(O)){if(o){var S=m?r:o(r,$t.encoder,y,"key",d);if(n==="comma"&&m){for(var N=Bre.call(String(O),","),_="",T=0;T"u")return B;var X;if(n==="comma"&&vo(O))X=[{value:O.length>0?O.join(",")||null:void 0}];else if(vo(a))X=a;else{var Q=Object.keys(O);X=u?Q.sort(u):Q}for(var H=0;H"u"?$t.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:$t.charsetSentinel,delimiter:typeof e.delimiter>"u"?$t.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:$t.encode,encoder:typeof e.encoder=="function"?e.encoder:$t.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:$t.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:$t.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:$t.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:$t.strictNullHandling}};LF.exports=function(t,e){var r=t,n=qre(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vo(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in DF?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=DF[a];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=RF(),f=0;f0?m+g:""}});var qF=A((Jme,UF)=>{"use strict";l();var _u=a_(),l_=Object.prototype.hasOwnProperty,Vre=Array.isArray,jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_u.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hre=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},MF=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},kre="utf8=%26%2310003%3B",Gre="utf8=%E2%9C%93",jre=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,u,c=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(y=Vre(y)?[y]:y),l_.call(n,m)?n[m]=_u.combine(n[m],y):n[m]=y}return n},Qre=function(t,e,r,n){for(var i=n?e:MF(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(o=[],o[c]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},zre=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),c=u?s.slice(0,u.index):s,f=[];if(c){if(!n.plainObjects&&l_.call(Object.prototype,c)&&!n.allowPrototypes)return;f.push(c)}for(var d=0;n.depth>0&&(u=a.exec(s))!==null&&d"u"?jt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?jt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:jt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:jt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:jt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:jt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:jt.comma,decoder:typeof e.decoder=="function"?e.decoder:jt.decoder,delimiter:typeof e.delimiter=="string"||_u.isRegExp(e.delimiter)?e.delimiter:jt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:jt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:jt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:jt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:jt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:jt.strictNullHandling}};UF.exports=function(t,e){var r=Wre(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?jre(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o{"use strict";l();var $re=FF(),Kre=qF(),Yre=my();VF.exports={formats:Yre,parse:Kre,stringify:$re}});var f_=A(Ge=>{"use strict";l();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED=Ge.WALLET_PROVIDER_CALLBACK_PARAM=Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL=Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL=Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL=Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL=Ge.WALLET_PROVIDER_DISCONNECT_URL=Ge.WALLET_PROVIDER_CONNECT_URL=Ge.XALIAS_PROVIDER_TESTNET=Ge.XALIAS_PROVIDER_DEVNET=Ge.XALIAS_PROVIDER_MAINNET=Ge.WALLET_PROVIDER_TESTNET=Ge.WALLET_PROVIDER_DEVNET=Ge.WALLET_PROVIDER_MAINNET=void 0;Ge.WALLET_PROVIDER_MAINNET="https://wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_DEVNET="https://devnet-wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_TESTNET="https://testnet-wallet.multiversx.com/dapp/init";Ge.XALIAS_PROVIDER_MAINNET="https://xalias.com";Ge.XALIAS_PROVIDER_DEVNET="https://devnet.xalias.com";Ge.XALIAS_PROVIDER_TESTNET="https://testnet.xalias.com";Ge.WALLET_PROVIDER_CONNECT_URL="hook/login";Ge.WALLET_PROVIDER_DISCONNECT_URL="hook/logout";Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL="hook/transaction";Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL="hook/sign";Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL="hook/2fa";Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL="hook/sign-message";Ge.WALLET_PROVIDER_CALLBACK_PARAM="walletProviderStatus";Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED="transactionsSigned"});var kF=A(Su=>{"use strict";l();Object.defineProperty(Su,"__esModule",{value:!0});Su.ErrCannotSignedMessage=Su.ErrCannotGetSignedTransactions=void 0;var d_=class extends Error{constructor(){super("Cannot get signed transaction(s)")}};Su.ErrCannotGetSignedTransactions=d_;var h_=class extends Error{constructor(){super("Cannot get signed message")}};Su.ErrCannotSignedMessage=h_});var GF=A(wy=>{"use strict";l();Object.defineProperty(wy,"__esModule",{value:!0});wy.PlainSignedTransaction=void 0;var p_=class{constructor(e){this.nonce=0,this.value="",this.receiver="",this.sender="",this.gasPrice=0,this.gasLimit=0,this.data="",this.chainID="",this.version=0,this.signature="",Object.assign(this,e)}};wy.PlainSignedTransaction=p_});var Tu=A(ys=>{"use strict";l();var ps=ys&&ys.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Jre=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.WalletProvider=void 0;var g_=Jre(HF()),gs=f_(),y_=kF(),Xre=GF(),m_=class t{constructor(e){this.walletUrl=e}login(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_CONNECT_URL,callbackUrl:e?.callbackUrl,params:{token:e?.token}});return yield this.redirect(r,e?.redirectDelayMilliseconds),r})}redirect(e,r){return ps(this,void 0,void 0,function*(){r?yield this.redirectLater(e,r):this.redirectImmediately(e)})}redirectImmediately(e){window.location.href=e}redirectLater(e,r){return ps(this,void 0,void 0,function*(){yield new Promise(n=>{setTimeout(()=>{window.location.href=e,n(!0)},r)})})}logout(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_DISCONNECT_URL,callbackUrl:e?.callbackUrl});return yield this.redirect(r,e?.redirectDelayMilliseconds),!0})}signMessage(e,r){return ps(this,void 0,void 0,function*(){let n=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_SIGN_MESSAGE_URL,callbackUrl:r?.callbackUrl,params:{message:e.message.toString()}});return yield this.redirect(n),n})}getMessageSignatureFromWalletUrl(){var e,r;let n=window.location.search.slice(1);console.info("getMessageSignatureFromWalletUrl(), url:",n);let i=g_.default.parse(n);if((((e=i.status)===null||e===void 0?void 0:e.toString())||"")!=="signed")throw new y_.ErrCannotSignedMessage;return((r=i.signature)===null||r===void 0?void 0:r.toString())||""}guardTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_GUARD_TRANSACTION_URL,e,r)})}signTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_SIGN_TRANSACTION_URL,e,r)})}signTransaction(e,r){return ps(this,void 0,void 0,function*(){yield this.signTransactions([e],r)})}getTransactionsFromWalletUrl(){let e=g_.default.parse(window.location.search.slice(1));return t.isTxSignReturnSuccess(e)?this.getTxSignReturnValue(e):[]}static isTxSignReturnSuccess(e){return e.hasOwnProperty(gs.WALLET_PROVIDER_CALLBACK_PARAM)&&e[gs.WALLET_PROVIDER_CALLBACK_PARAM]===gs.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED}getTxSignReturnValue(e){console.info("getTxSignReturnValue(), urlParams:",e);let r=["nonce","value","receiver","sender","gasPrice","gasLimit","chainID","version","signature"];for(let s of r)if(!e[s]||!Array.isArray(e[s]))throw new y_.ErrCannotGetSignedTransactions;let n=e.nonce.length;for(let s of r)if(e[s].length!==n)throw new y_.ErrCannotGetSignedTransactions;let i=[];for(let s=0;s{let a=t.prepareWalletTransaction(o);for(let u in a)a.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(i[u]=[]),i[u].push(a[u])});let s=this.buildWalletUrl({endpoint:e,callbackUrl:n?.callbackUrl,params:i});window.location.href=s}};ys.WalletProvider=m_});var IM=A((cwe,bM)=>{"use strict";l();function tM(t,e){return function(){return t.apply(e,arguments)}}var{toString:Zre}=Object.prototype,{getPrototypeOf:N_}=Object,by=(t=>e=>{let r=Zre.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kn=t=>(t=t.toLowerCase(),e=>by(e)===t),Iy=t=>e=>typeof e===t,{isArray:Ou}=Array,of=Iy("undefined");function ene(t){return t!==null&&!of(t)&&t.constructor!==null&&!of(t.constructor)&&Qr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var rM=kn("ArrayBuffer");function tne(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rM(t.buffer),e}var rne=Iy("string"),Qr=Iy("function"),nM=Iy("number"),_y=t=>t!==null&&typeof t=="object",nne=t=>t===!0||t===!1,Ey=t=>{if(by(t)!=="object")return!1;let e=N_(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ine=kn("Date"),sne=kn("File"),one=kn("Blob"),ane=kn("FileList"),une=t=>_y(t)&&Qr(t.pipe),cne=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Qr(t.append)&&((e=by(t))==="formdata"||e==="object"&&Qr(t.toString)&&t.toString()==="[object FormData]"))},lne=kn("URLSearchParams"),fne=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function af(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Ou(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}var sM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oM=t=>!of(t)&&t!==sM;function b_(){let{caseless:t}=oM(this)&&this||{},e={},r=(n,i)=>{let s=t&&iM(e,i)||i;Ey(e[s])&&Ey(n)?e[s]=b_(e[s],n):Ey(n)?e[s]=b_({},n):Ou(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(af(e,(i,s)=>{r&&Qr(i)?t[s]=tM(i,r):t[s]=i},{allOwnKeys:n}),t),hne=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),pne=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gne=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&N_(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},yne=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},mne=t=>{if(!t)return null;if(Ou(t))return t;let e=t.length;if(!nM(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wne=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&N_(Uint8Array)),Ene=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},vne=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ane=kn("HTMLFormElement"),bne=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),jF=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ine=kn("RegExp"),aM=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};af(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_ne=t=>{aM(t,(e,r)=>{if(Qr(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Qr(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sne=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ou(t)?n(t):n(String(t).split(e)),r},Tne=()=>{},Cne=(t,e)=>(t=+t,Number.isFinite(t)?t:e),w_="abcdefghijklmnopqrstuvwxyz",QF="0123456789",uM={DIGIT:QF,ALPHA:w_,ALPHA_DIGIT:w_+w_.toUpperCase()+QF},xne=(t=16,e=uM.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Nne(t){return!!(t&&Qr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var One=t=>{let e=new Array(10),r=(n,i)=>{if(_y(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ou(n)?[]:{};return af(n,(o,a)=>{let u=r(o,i+1);!of(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Dne=kn("AsyncFunction"),Pne=t=>t&&(_y(t)||Qr(t))&&Qr(t.then)&&Qr(t.catch),Y={isArray:Ou,isArrayBuffer:rM,isBuffer:ene,isFormData:cne,isArrayBufferView:tne,isString:rne,isNumber:nM,isBoolean:nne,isObject:_y,isPlainObject:Ey,isUndefined:of,isDate:ine,isFile:sne,isBlob:one,isRegExp:Ine,isFunction:Qr,isStream:une,isURLSearchParams:lne,isTypedArray:wne,isFileList:ane,forEach:af,merge:b_,extend:dne,trim:fne,stripBOM:hne,inherits:pne,toFlatObject:gne,kindOf:by,kindOfTest:kn,endsWith:yne,toArray:mne,forEachEntry:Ene,matchAll:vne,isHTMLForm:Ane,hasOwnProperty:jF,hasOwnProp:jF,reduceDescriptors:aM,freezeMethods:_ne,toObjectSet:Sne,toCamelCase:bne,noop:Tne,toFiniteNumber:Cne,findKey:iM,global:sM,isContextDefined:oM,ALPHABET:uM,generateString:xne,isSpecCompliantForm:Nne,toJSONObject:One,isAsyncFn:Dne,isThenable:Pne};function Me(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Y.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var cM=Me.prototype,lM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{lM[t]={value:t}});Object.defineProperties(Me,lM);Object.defineProperty(cM,"isAxiosError",{value:!0});Me.from=(t,e,r,n,i,s)=>{let o=Object.create(cM);return Y.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Me.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Rne=null;function I_(t){return Y.isPlainObject(t)||Y.isArray(t)}function fM(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function zF(t,e,r){return t?t.concat(e).map(function(i,s){return i=fM(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Bne(t){return Y.isArray(t)&&!t.some(I_)}var Lne=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function Sy(t,e,r){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Y.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!Y.isUndefined(O[b])});let n=r.metaTokens,i=r.visitor||f,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(Y.isDate(y))return y.toISOString();if(!u&&Y.isBlob(y))throw new Me("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(y)||Y.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):h.Buffer.from(y):y}function f(y,b,O){let R=y;if(y&&!O&&typeof y=="object"){if(Y.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=JSON.stringify(y);else if(Y.isArray(y)&&Bne(y)||(Y.isFileList(y)||Y.endsWith(b,"[]"))&&(R=Y.toArray(y)))return b=fM(b),R.forEach(function(M,E){!(Y.isUndefined(M)||M===null)&&e.append(o===!0?zF([b],E,s):o===null?b:b+"[]",c(M))}),!1}return I_(y)?!0:(e.append(zF(O,b,s),c(y)),!1)}let d=[],g=Object.assign(Lne,{defaultVisitor:f,convertValue:c,isVisitable:I_});function m(y,b){if(!Y.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),Y.forEach(y,function(R,z){(!(Y.isUndefined(R)||R===null)&&i.call(e,R,Y.isString(z)?z.trim():z,b,g))===!0&&m(R,b?b.concat(z):[z])}),d.pop()}}if(!Y.isObject(t))throw new TypeError("data must be an object");return m(t),e}function WF(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function O_(t,e){this._pairs=[],t&&Sy(t,this,e)}var dM=O_.prototype;dM.append=function(e,r){this._pairs.push([e,r])};dM.toString=function(e){let r=e?function(n){return e.call(this,n,WF)}:WF;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Fne(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hM(t,e,r){if(!e)return t;let n=r&&r.encode||Fne,i=r&&r.serialize,s;if(i?s=i(e,r):s=Y.isURLSearchParams(e)?e.toString():new O_(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var __=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(n){n!==null&&e(n)})}},$F=__,pM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mne=typeof URLSearchParams<"u"?URLSearchParams:O_,Une=typeof FormData<"u"?FormData:null,qne=typeof Blob<"u"?Blob:null,Vne={isBrowser:!0,classes:{URLSearchParams:Mne,FormData:Une,Blob:qne},protocols:["http","https","file","blob","url","data"]},gM=typeof window<"u"&&typeof document<"u",Hne=(t=>gM&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),kne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gne=Object.freeze({__proto__:null,hasBrowserEnv:gM,hasStandardBrowserWebWorkerEnv:kne,hasStandardBrowserEnv:Hne}),Hn={...Gne,...Vne};function jne(t,e){return Sy(t,new Hn.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Hn.isNode&&Y.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Qne(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function zne(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n=r.length;return o=!o&&Y.isArray(i)?i.length:o,u?(Y.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&Y.isArray(i[o])&&(i[o]=zne(i[o])),!a)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){let r={};return Y.forEachEntry(t,(n,i)=>{e(Qne(n),i,r,0)}),r}return null}function Wne(t,e,r){if(Y.isString(t))try{return(e||JSON.parse)(t),Y.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var D_={transitional:pM,adapter:["xhr","http"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=Y.isObject(e);if(s&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return i?JSON.stringify(yM(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jne(e,this.formSerializer).toString();if((a=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Sy(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),Wne(e)):e}],transformResponse:[function(e){let r=this.transitional||D_.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Y.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Me.from(a,Me.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],t=>{D_.headers[t]={}});var P_=D_,$ne=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kne=t=>{let e={},r,n,i;return t&&t.split(` `).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&$ne[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},KF=Symbol("internals");function sf(t){return t&&String(t).trim().toLowerCase()}function vy(t){return t===!1||t==null?t:Y.isArray(t)?t.map(vy):String(t)}function Yne(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}var Jne=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function E_(t,e,r,n,i){if(Y.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!Y.isString(e)){if(Y.isString(n))return e.indexOf(n)!==-1;if(Y.isRegExp(n))return n.test(e)}}function Xne(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Zne(t,e){let r=Y.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}var Cu=class{constructor(e){e&&this.set(e)}set(e,r,n){let i=this;function s(a,u,c){let f=sf(u);if(!f)throw new Error("header name must be a non-empty string");let d=Y.findKey(i,f);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||u]=vy(a))}let o=(a,u)=>Y.forEach(a,(c,f)=>s(c,f,u));return Y.isPlainObject(e)||e instanceof this.constructor?o(e,r):Y.isString(e)&&(e=e.trim())&&!Jne(e)?o(Kne(e),r):e!=null&&s(r,e,n),this}get(e,r){if(e=sf(e),e){let n=Y.findKey(this,e);if(n){let i=this[n];if(!r)return i;if(r===!0)return Yne(i);if(Y.isFunction(r))return r.call(this,i,n);if(Y.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=sf(e),e){let n=Y.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||E_(this,this[n],n,r)))}return!1}delete(e,r){let n=this,i=!1;function s(o){if(o=sf(o),o){let a=Y.findKey(n,o);a&&(!r||E_(n,n[a],a,r))&&(delete n[a],i=!0)}}return Y.isArray(e)?e.forEach(s):s(e),i}clear(e){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let s=r[n];(!e||E_(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){let r=this,n={};return Y.forEach(this,(i,s)=>{let o=Y.findKey(n,s);if(o){r[o]=vy(i),delete r[s];return}let a=e?Xne(s):String(s).trim();a!==s&&delete r[s],r[a]=vy(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return Y.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&Y.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[KF]=this[KF]={accessors:{}}).accessors,i=this.prototype;function s(o){let a=sf(o);n[a]||(Zne(i,o),n[a]=!0)}return Y.isArray(e)?e.forEach(s):s(e),this}};Cu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Cu.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});Y.freezeMethods(Cu);var yi=Cu;function v_(t,e){let r=this||P_,n=e||r,i=yi.from(n.headers),s=n.data;return Y.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function mM(t){return!!(t&&t.__CANCEL__)}function uf(t,e,r){Me.call(this,t??"canceled",Me.ERR_CANCELED,e,r),this.name="CanceledError"}Y.inherits(uf,Me,{__CANCEL__:!0});function eie(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new Me("Request failed with status code "+r.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var tie=Hn.hasStandardBrowserEnv?{write(t,e,r,n,i,s){let o=[t+"="+encodeURIComponent(e)];Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function rie(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function nie(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wM(t,e){return t&&!rie(e)?nie(t,e):e}var iie=Hn.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(s){let o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){let a=Y.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function sie(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function oie(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,s=0,o;return e=e!==void 0?e:1e3,function(u){let c=Date.now(),f=n[s];o||(o=c),r[i]=u,n[i]=c;let d=s,g=0;for(;d!==i;)g+=r[d++],d=d%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o{let s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-r,u=n(a),c=s<=o;r=s;let f={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:u||void 0,estimated:u&&o&&c?(o-s)/u:void 0,event:i};f[e?"download":"upload"]=!0,t(f)}}var aie=typeof XMLHttpRequest<"u",uie=aie&&function(t){return new Promise(function(r,n){let i=t.data,s=yi.from(t.headers).normalize(),{responseType:o,withXSRFToken:a}=t,u;function c(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}let f;if(Y.isFormData(i)){if(Hn.hasStandardBrowserEnv||Hn.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((f=s.getContentType())!==!1){let[b,...O]=f?f.split(";").map(R=>R.trim()).filter(Boolean):[];s.setContentType([b||"multipart/form-data",...O].join("; "))}}let d=new XMLHttpRequest;if(t.auth){let b=t.auth.username||"",O=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(b+":"+O))}let g=wM(t.baseURL,t.url);d.open(t.method.toUpperCase(),hM(g,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function m(){if(!d)return;let b=yi.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),R={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:t,request:d};eie(function(M){r(M),c()},function(M){n(M),c()},R),d=null}if("onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(m)},d.onabort=function(){d&&(n(new Me("Request aborted",Me.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new Me("Network Error",Me.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let O=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",R=t.transitional||pM;t.timeoutErrorMessage&&(O=t.timeoutErrorMessage),n(new Me(O,R.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,t,d)),d=null},Hn.hasStandardBrowserEnv&&(a&&Y.isFunction(a)&&(a=a(t)),a||a!==!1&&iie(g))){let b=t.xsrfHeaderName&&t.xsrfCookieName&&tie.read(t.xsrfCookieName);b&&s.set(t.xsrfHeaderName,b)}i===void 0&&s.setContentType(null),"setRequestHeader"in d&&Y.forEach(s.toJSON(),function(O,R){d.setRequestHeader(R,O)}),Y.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),o&&o!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",YF(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",YF(t.onUploadProgress)),(t.cancelToken||t.signal)&&(u=b=>{d&&(n(!b||b.type?new uf(null,t,d):b),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u)));let y=sie(g);if(y&&Hn.protocols.indexOf(y)===-1){n(new Me("Unsupported protocol "+y+":",Me.ERR_BAD_REQUEST,t));return}d.send(i||null)})},S_={http:Rne,xhr:uie};Y.forEach(S_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var JF=t=>`- ${t}`,cie=t=>Y.isFunction(t)||t===null||t===!1,EM={getAdapter:t=>{t=Y.isArray(t)?t:[t];let{length:e}=t,r,n,i={};for(let s=0;s`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build")),o=e?s.length>1?`since : `+s.map(JF).join(` -`):" "+JF(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:S_};function A_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new uf(null,t)}function XF(t){return A_(t),t.headers=yi.from(t.headers),t.data=v_.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),EM.getAdapter(t.adapter||P_.adapter)(t).then(function(n){return A_(t),n.data=v_.call(t,t.transformResponse,n),n.headers=yi.from(n.headers),n},function(n){return mM(n)||(A_(t),n&&n.response&&(n.response.data=v_.call(t,t.transformResponse,n.response),n.response.headers=yi.from(n.response.headers))),Promise.reject(n)})}var ZF=t=>t instanceof yi?t.toJSON():t;function xu(t,e){e=e||{};let r={};function n(c,f,d){return Y.isPlainObject(c)&&Y.isPlainObject(f)?Y.merge.call({caseless:d},c,f):Y.isPlainObject(f)?Y.merge({},f):Y.isArray(f)?f.slice():f}function i(c,f,d){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c,d)}else return n(c,f,d)}function s(c,f){if(!Y.isUndefined(f))return n(void 0,f)}function o(c,f){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}function a(c,f,d){if(d in e)return n(c,f);if(d in t)return n(void 0,c)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>i(ZF(c),ZF(f),!0)};return Y.forEach(Object.keys(Object.assign({},t,e)),function(f){let d=u[f]||i,g=d(t[f],e[f],f);Y.isUndefined(g)&&d!==a||(r[f]=g)}),r}var vM="1.6.5",R_={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{R_[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var eM={};R_.transitional=function(e,r,n){function i(s,o){return"[Axios v"+vM+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new Me(i(o," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!eM[o]&&(eM[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function lie(t,e,r){if(typeof t!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let s=n[i],o=e[s];if(o){let a=t[s],u=a===void 0||o(a,s,t);if(u!==!0)throw new Me("option "+s+" must be "+u,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}var T_={assertOptions:lie,validators:R_},ms=T_.validators,Nu=class{constructor(e){this.defaults=e,this.interceptors={request:new $F,response:new $F}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=xu(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&T_.assertOptions(n,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),i!=null&&(Y.isFunction(i)?r.paramsSerializer={serialize:i}:T_.assertOptions(i,{encode:ms.function,serialize:ms.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Y.merge(s.common,s[r.method]);s&&Y.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),r.headers=yi.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});let c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,d=0,g;if(!u){let y=[XF.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,f=Promise.resolve(r);d{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new uf(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},fie=C_;function die(t){return function(r){return t.apply(null,r)}}function hie(t){return Y.isObject(t)&&t.isAxiosError===!0}var x_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(x_).forEach(([t,e])=>{x_[e]=t});var pie=x_;function AM(t){let e=new Ay(t),r=tM(Ay.prototype.request,e);return Y.extend(r,Ay.prototype,e,{allOwnKeys:!0}),Y.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return AM(xu(t,i))},r}var Rt=AM(P_);Rt.Axios=Ay;Rt.CanceledError=uf;Rt.CancelToken=fie;Rt.isCancel=mM;Rt.VERSION=vM;Rt.toFormData=Sy;Rt.AxiosError=Me;Rt.Cancel=Rt.CanceledError;Rt.all=function(e){return Promise.all(e)};Rt.spread=die;Rt.isAxiosError=hie;Rt.mergeConfig=xu;Rt.AxiosHeaders=yi;Rt.formToJSON=t=>yM(Y.isHTMLForm(t)?new FormData(t):t);Rt.getAdapter=EM.getAdapter;Rt.HttpStatusCode=pie;Rt.default=Rt;bM.exports=Rt});var _M=A(Ty=>{"use strict";l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.NativeAuthClientConfig=void 0;var B_=class{constructor(){this.origin=typeof window<"u"&&typeof window.location<"u"?window.location.hostname:"",this.apiUrl="https://api.multiversx.com",this.expirySeconds=60*60*24}};Ty.NativeAuthClientConfig=B_});var F_=A(Du=>{"use strict";l();var Ao=Du&&Du.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Du,"__esModule",{value:!0});Du.NativeAuthClient=void 0;var gie=IM(),yie=_M(),L_=class{constructor(e){this.config=Object.assign(new yie.NativeAuthClientConfig,e)}getToken(e,r,n){let i=this.encodeValue(e),s=this.encodeValue(r);return`${i}.${s}.${n}`}initialize(e={}){return Ao(this,void 0,void 0,function*(){let r=yield this.getCurrentBlockHash(),n=this.encodeValue(JSON.stringify(e));return`${this.encodeValue(this.config.origin)}.${r}.${this.config.expirySeconds}.${n}`})}getCurrentBlockHash(){return Ao(this,void 0,void 0,function*(){return this.config.gatewayUrl?yield this.getCurrentBlockHashWithGateway():yield this.getCurrentBlockHashWithApi()})}getCurrentBlockHashWithGateway(){return Ao(this,void 0,void 0,function*(){let e=yield this.getCurrentRound(),r=`${this.config.gatewayUrl}/blocks/by-round/${e}`;return(yield this.get(r)).data.data.blocks.filter(o=>o.shard===this.config.blockHashShard)[0].hash})}getCurrentRound(){return Ao(this,void 0,void 0,function*(){if(!this.config.gatewayUrl)throw new Error("Gateway URL not set");if(!this.config.blockHashShard)throw new Error("Blockhash shard not set");let e=`${this.config.gatewayUrl}/network/status/${this.config.blockHashShard}`;return(yield this.get(e)).data.data.status.erd_current_round})}getCurrentBlockHashWithApi(){return Ao(this,void 0,void 0,function*(){try{let e=`${this.config.apiUrl}/blocks/latest?ttl=${this.config.expirySeconds}&fields=hash`,r=yield this.get(e);if(r.data[0].hash!==void 0)return r.data[0].hash}catch{}return this.getCurrentBlockHashWithApiFallback()})}getCurrentBlockHashWithApiFallback(){return Ao(this,void 0,void 0,function*(){let e=`${this.config.apiUrl}/blocks?size=1&fields=hash`;return this.config.blockHashShard!==void 0&&(e+=`&shard=${this.config.blockHashShard}`),(yield this.get(e)).data[0].hash})}encodeValue(e){return this.escape(h.Buffer.from(e,"utf8").toString("base64"))}escape(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}get(e){return Ao(this,void 0,void 0,function*(){return yield gie.default.get(e,{headers:this.config.extraRequestHeaders})})}};Du.NativeAuthClient=L_});var OM=A(Ny=>{"use strict";l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.TransactionStatus=void 0;var U_=class t{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new t("unknown")}isPending(){return this.status=="received"||this.status=="pending"}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return this.status=="executed"||this.status=="success"||this.status=="successful"}isFailed(){return this.status=="fail"||this.status=="failed"||this.status=="unsuccessful"||this.isInvalid()}isInvalid(){return this.status=="invalid"}toString(){return this.status}valueOf(){return this.status}equals(e){return e?this.status==e.status:!1}};Ny.TransactionStatus=U_});var PM=A(Oy=>{"use strict";l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.TransactionReceipt=void 0;var DM=Ta(),q_=class t{constructor(){this.value="",this.sender=new DM.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let r=new t;return r.value=(e.value||0).toString(),r.sender=new DM.Address(e.sender),r.data=e.data,r.hash=e.txHash,r}};Oy.TransactionReceipt=q_});var RM=A(Gn=>{"use strict";l();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ErrContractQuery=Gn.ErrNetworkProvider=Gn.ErrUnexpectedCondition=Gn.Err=void 0;var Bu=class extends Error{constructor(e,r){super(e),this.inner=void 0,this.inner=r}};Gn.Err=Bu;var V_=class extends Bu{constructor(e){super(`Unexpected condition: [${e}]`)}};Gn.ErrUnexpectedCondition=V_;var H_=class extends Bu{constructor(e,r,n){let i=`Request error on url [${e}]: [${r}]`;super(i,n)}};Gn.ErrNetworkProvider=H_;var k_=class extends Bu{constructor(e){super(e.message.replace("executeQuery:",""))}};Gn.ErrContractQuery=k_});var LM=A(ws=>{"use strict";l();Object.defineProperty(ws,"__esModule",{value:!0});ws.TransactionEventTopic=ws.TransactionEventData=ws.TransactionEvent=void 0;var BM=Ta(),G_=class t{constructor(e){this.address=new BM.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new Lu(h.Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new BM.Address(e.address),r.identifier=e.identifier||"",r.topics=(e.topics||[]).map(n=>new Dy(n)),r.dataPayload=Lu.fromBase64(e.data),r.additionalData=(e.additionalData||[]).map(Lu.fromBase64),r.data=r.dataPayload.toString(),r}findFirstOrNoneTopic(e){return this.topics.filter(r=>e(r))[0]}getLastTopic(){return this.topics[this.topics.length-1]}};ws.TransactionEvent=G_;var Lu=class t{constructor(e){this.raw=e}static fromBase64(e){return new t(h.Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventData=Lu;var Dy=class{constructor(e){this.raw=h.Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventTopic=Dy});var Q_=A(Py=>{"use strict";l();Object.defineProperty(Py,"__esModule",{value:!0});Py.TransactionLogs=void 0;var Eie=RM(),FM=Ta(),vie=LM(),j_=class t{constructor(e){this.address=new FM.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new FM.Address(e.address),r.events=(e.events||[]).map(n=>vie.TransactionEvent.fromHttpResponse(n)),r}findSingleOrNoneEvent(e,r){let n=this.findEvents(e,r);if(n.length>1)throw new Eie.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,r){return this.findEvents(e,r)[0]}findEvents(e,r){let n=this.events.filter(i=>i.identifier==e);return r&&(n=n.filter(i=>r(i))),n}};Py.TransactionLogs=j_});var UM=A(Fu=>{"use strict";l();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ContractResultItem=Fu.ContractResults=void 0;var MM=Q_(),Ry=Ta(),z_=class t{constructor(e){this.items=e,this.items.sort(function(r,n){return r.nonce.valueOf()-n.nonce.valueOf()})}static fromProxyHttpResponse(e){let r=e.map(n=>cf.fromProxyHttpResponse(n));return new t(r)}static fromApiHttpResponse(e){let r=e.map(n=>cf.fromApiHttpResponse(n));return new t(r)}};Fu.ContractResults=z_;var cf=class t{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new Ry.Address(""),this.sender=new Ry.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new MM.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return t.fromHttpResponse(e)}static fromApiHttpResponse(e){let r=t.fromHttpResponse(e);return r.data=h.Buffer.from(r.data,"base64").toString(),r.callType=Number(r.callType),r}static fromHttpResponse(e){let r=new t;return r.hash=e.hash,r.nonce=Number(e.nonce||0),r.value=(e.value||0).toString(),r.receiver=new Ry.Address(e.receiver),r.sender=new Ry.Address(e.sender),r.previousHash=e.prevTxHash,r.originalHash=e.originalTxHash,r.gasLimit=Number(e.gasLimit||0),r.gasPrice=Number(e.gasPrice||0),r.data=e.data||"",r.callType=e.callType,r.returnMessage=e.returnMessage,r.logs=MM.TransactionLogs.fromHttpResponse(e.logs||{}),r}};Fu.ContractResultItem=cf});var qM=A(By=>{"use strict";l();Object.defineProperty(By,"__esModule",{value:!0});By.ContractQueryRequest=void 0;var W_=class{constructor(e){this.query=e}toHttpRequest(){var e;let r={},n=this.query;return r.scAddress=n.address.bech32(),r.caller=!((e=n.caller)===null||e===void 0)&&e.bech32()?n.caller.bech32():void 0,r.funcName=n.func.toString(),r.value=n.value?n.value.toString():void 0,r.args=n.getEncodedArguments(),r}};By.ContractQueryRequest=W_});var KM=A((pEe,$M)=>{l();$M.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Es=A(bo=>{l();var $_,Aie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];bo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};bo.getSymbolTotalCodewords=function(e){return Aie[e]};bo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};bo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');$_=e};bo.isKanjiModeEnabled=function(){return typeof $_<"u"};bo.toSJIS=function(e){return $_(e)}});var My=A(zr=>{l();zr.L={bit:1};zr.M={bit:0};zr.Q={bit:3};zr.H={bit:2};function bie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return zr.L;case"m":case"medium":return zr.M;case"q":case"quartile":return zr.Q;case"h":case"high":return zr.H;default:throw new Error("Unknown EC Level: "+t)}}zr.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};zr.from=function(e,r){if(zr.isValid(e))return e;try{return bie(e)}catch{return r}}});var XM=A((vEe,JM)=>{l();function YM(){this.buffer=[],this.length=0}YM.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};JM.exports=YM});var eU=A((bEe,ZM)=>{l();function lf(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}lf.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};lf.prototype.get=function(t,e){return this.data[t*this.size+e]};lf.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};lf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};ZM.exports=lf});var tU=A(Uy=>{l();var Iie=Es().getSymbolSize;Uy.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=Iie(e),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,s=[n-7];for(let o=1;o{l();var _ie=Es().getSymbolSize,rU=7;nU.getPositions=function(e){let r=_ie(e);return[[0,0],[r-rU,0],[0,r-rU]]}});var sU=A(nt=>{l();nt.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Io={N1:3,N2:3,N3:40,N4:10};nt.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};nt.from=function(e){return nt.isValid(e)?parseInt(e,10):void 0};nt.getPenaltyN1=function(e){let r=e.size,n=0,i=0,s=0,o=null,a=null;for(let u=0;u=5&&(n+=Io.N1+(i-5)),o=f,i=1),f=e.get(c,u),f===a?s++:(s>=5&&(n+=Io.N1+(s-5)),a=f,s=1)}i>=5&&(n+=Io.N1+(i-5)),s>=5&&(n+=Io.N1+(s-5))}return n};nt.getPenaltyN2=function(e){let r=e.size,n=0;for(let i=0;i=10&&(i===1488||i===93)&&n++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&n++}return n*Io.N3};nt.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let s=0;s{l();var vs=My(),qy=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Vy=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];K_.getBlocksCount=function(e,r){switch(r){case vs.L:return qy[(e-1)*4+0];case vs.M:return qy[(e-1)*4+1];case vs.Q:return qy[(e-1)*4+2];case vs.H:return qy[(e-1)*4+3];default:return}};K_.getTotalCodewordsCount=function(e,r){switch(r){case vs.L:return Vy[(e-1)*4+0];case vs.M:return Vy[(e-1)*4+1];case vs.Q:return Vy[(e-1)*4+2];case vs.H:return Vy[(e-1)*4+3];default:return}}});var oU=A(ky=>{l();var ff=new Uint8Array(512),Hy=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ff[r]=e,Hy[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ff[r]=ff[r-255]})();ky.log=function(e){if(e<1)throw new Error("log("+e+")");return Hy[e]};ky.exp=function(e){return ff[e]};ky.mul=function(e,r){return e===0||r===0?0:ff[Hy[e]+Hy[r]]}});var aU=A(df=>{l();var J_=oU();df.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let i=0;i=0;){let i=n[0];for(let o=0;o{l();var uU=aU();function X_(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}X_.prototype.initialize=function(e){this.degree=e,this.genPoly=uU.generateECPolynomial(this.degree)};X_.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=uU.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let s=new Uint8Array(this.degree);return s.set(n,i),s}return n};cU.exports=X_});var Z_=A(fU=>{l();fU.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var eS=A(wi=>{l();var dU="[0-9]+",Tie="[A-Z $%*+\\-./:]+",hf="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";hf=hf.replace(/u/g,"\\u");var Cie="(?:(?![A-Z0-9 $%*+\\-./:]|"+hf+`)(?:.|[\r +`):" "+JF(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:S_};function A_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new uf(null,t)}function XF(t){return A_(t),t.headers=yi.from(t.headers),t.data=v_.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),EM.getAdapter(t.adapter||P_.adapter)(t).then(function(n){return A_(t),n.data=v_.call(t,t.transformResponse,n),n.headers=yi.from(n.headers),n},function(n){return mM(n)||(A_(t),n&&n.response&&(n.response.data=v_.call(t,t.transformResponse,n.response),n.response.headers=yi.from(n.response.headers))),Promise.reject(n)})}var ZF=t=>t instanceof yi?t.toJSON():t;function xu(t,e){e=e||{};let r={};function n(c,f,d){return Y.isPlainObject(c)&&Y.isPlainObject(f)?Y.merge.call({caseless:d},c,f):Y.isPlainObject(f)?Y.merge({},f):Y.isArray(f)?f.slice():f}function i(c,f,d){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c,d)}else return n(c,f,d)}function s(c,f){if(!Y.isUndefined(f))return n(void 0,f)}function o(c,f){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}function a(c,f,d){if(d in e)return n(c,f);if(d in t)return n(void 0,c)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>i(ZF(c),ZF(f),!0)};return Y.forEach(Object.keys(Object.assign({},t,e)),function(f){let d=u[f]||i,g=d(t[f],e[f],f);Y.isUndefined(g)&&d!==a||(r[f]=g)}),r}var vM="1.6.7",R_={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{R_[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var eM={};R_.transitional=function(e,r,n){function i(s,o){return"[Axios v"+vM+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new Me(i(o," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!eM[o]&&(eM[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function lie(t,e,r){if(typeof t!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let s=n[i],o=e[s];if(o){let a=t[s],u=a===void 0||o(a,s,t);if(u!==!0)throw new Me("option "+s+" must be "+u,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}var T_={assertOptions:lie,validators:R_},ms=T_.validators,Nu=class{constructor(e){this.defaults=e,this.interceptors={request:new $F,response:new $F}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+s):n.stack=s}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=xu(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&T_.assertOptions(n,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),i!=null&&(Y.isFunction(i)?r.paramsSerializer={serialize:i}:T_.assertOptions(i,{encode:ms.function,serialize:ms.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Y.merge(s.common,s[r.method]);s&&Y.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),r.headers=yi.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});let c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,d=0,g;if(!u){let y=[XF.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,f=Promise.resolve(r);d{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new uf(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},fie=C_;function die(t){return function(r){return t.apply(null,r)}}function hie(t){return Y.isObject(t)&&t.isAxiosError===!0}var x_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(x_).forEach(([t,e])=>{x_[e]=t});var pie=x_;function AM(t){let e=new Ay(t),r=tM(Ay.prototype.request,e);return Y.extend(r,Ay.prototype,e,{allOwnKeys:!0}),Y.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return AM(xu(t,i))},r}var Rt=AM(P_);Rt.Axios=Ay;Rt.CanceledError=uf;Rt.CancelToken=fie;Rt.isCancel=mM;Rt.VERSION=vM;Rt.toFormData=Sy;Rt.AxiosError=Me;Rt.Cancel=Rt.CanceledError;Rt.all=function(e){return Promise.all(e)};Rt.spread=die;Rt.isAxiosError=hie;Rt.mergeConfig=xu;Rt.AxiosHeaders=yi;Rt.formToJSON=t=>yM(Y.isHTMLForm(t)?new FormData(t):t);Rt.getAdapter=EM.getAdapter;Rt.HttpStatusCode=pie;Rt.default=Rt;bM.exports=Rt});var _M=A(Ty=>{"use strict";l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.NativeAuthClientConfig=void 0;var B_=class{constructor(){this.origin=typeof window<"u"&&typeof window.location<"u"?window.location.hostname:"",this.apiUrl="https://api.multiversx.com",this.expirySeconds=60*60*24}};Ty.NativeAuthClientConfig=B_});var F_=A(Du=>{"use strict";l();var Ao=Du&&Du.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Du,"__esModule",{value:!0});Du.NativeAuthClient=void 0;var gie=IM(),yie=_M(),L_=class{constructor(e){this.config=Object.assign(new yie.NativeAuthClientConfig,e)}getToken(e,r,n){let i=this.encodeValue(e),s=this.encodeValue(r);return`${i}.${s}.${n}`}initialize(e={}){return Ao(this,void 0,void 0,function*(){let r=yield this.getCurrentBlockHash(),n=this.encodeValue(JSON.stringify(e));return`${this.encodeValue(this.config.origin)}.${r}.${this.config.expirySeconds}.${n}`})}getCurrentBlockHash(){return Ao(this,void 0,void 0,function*(){return this.config.gatewayUrl?yield this.getCurrentBlockHashWithGateway():yield this.getCurrentBlockHashWithApi()})}getCurrentBlockHashWithGateway(){return Ao(this,void 0,void 0,function*(){let e=yield this.getCurrentRound(),r=`${this.config.gatewayUrl}/blocks/by-round/${e}`;return(yield this.get(r)).data.data.blocks.filter(o=>o.shard===this.config.blockHashShard)[0].hash})}getCurrentRound(){return Ao(this,void 0,void 0,function*(){if(!this.config.gatewayUrl)throw new Error("Gateway URL not set");if(!this.config.blockHashShard)throw new Error("Blockhash shard not set");let e=`${this.config.gatewayUrl}/network/status/${this.config.blockHashShard}`;return(yield this.get(e)).data.data.status.erd_current_round})}getCurrentBlockHashWithApi(){return Ao(this,void 0,void 0,function*(){try{let e=`${this.config.apiUrl}/blocks/latest?ttl=${this.config.expirySeconds}&fields=hash`,r=yield this.get(e);if(r.data[0].hash!==void 0)return r.data[0].hash}catch{}return this.getCurrentBlockHashWithApiFallback()})}getCurrentBlockHashWithApiFallback(){return Ao(this,void 0,void 0,function*(){let e=`${this.config.apiUrl}/blocks?size=1&fields=hash`;return this.config.blockHashShard!==void 0&&(e+=`&shard=${this.config.blockHashShard}`),(yield this.get(e)).data[0].hash})}encodeValue(e){return this.escape(h.Buffer.from(e,"utf8").toString("base64"))}escape(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}get(e){return Ao(this,void 0,void 0,function*(){return yield gie.default.get(e,{headers:this.config.extraRequestHeaders})})}};Du.NativeAuthClient=L_});var OM=A(Ny=>{"use strict";l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.TransactionStatus=void 0;var U_=class t{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new t("unknown")}isPending(){return this.status=="received"||this.status=="pending"}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return this.status=="executed"||this.status=="success"||this.status=="successful"}isFailed(){return this.status=="fail"||this.status=="failed"||this.status=="unsuccessful"||this.isInvalid()}isInvalid(){return this.status=="invalid"}toString(){return this.status}valueOf(){return this.status}equals(e){return e?this.status==e.status:!1}};Ny.TransactionStatus=U_});var PM=A(Oy=>{"use strict";l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.TransactionReceipt=void 0;var DM=Ta(),q_=class t{constructor(){this.value="",this.sender=new DM.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let r=new t;return r.value=(e.value||0).toString(),r.sender=new DM.Address(e.sender),r.data=e.data,r.hash=e.txHash,r}};Oy.TransactionReceipt=q_});var RM=A(Gn=>{"use strict";l();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ErrContractQuery=Gn.ErrNetworkProvider=Gn.ErrUnexpectedCondition=Gn.Err=void 0;var Bu=class extends Error{constructor(e,r){super(e),this.inner=void 0,this.inner=r}};Gn.Err=Bu;var V_=class extends Bu{constructor(e){super(`Unexpected condition: [${e}]`)}};Gn.ErrUnexpectedCondition=V_;var H_=class extends Bu{constructor(e,r,n){let i=`Request error on url [${e}]: [${r}]`;super(i,n)}};Gn.ErrNetworkProvider=H_;var k_=class extends Bu{constructor(e){super(e.message.replace("executeQuery:",""))}};Gn.ErrContractQuery=k_});var LM=A(ws=>{"use strict";l();Object.defineProperty(ws,"__esModule",{value:!0});ws.TransactionEventTopic=ws.TransactionEventData=ws.TransactionEvent=void 0;var BM=Ta(),G_=class t{constructor(e){this.address=new BM.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new Lu(h.Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new BM.Address(e.address),r.identifier=e.identifier||"",r.topics=(e.topics||[]).map(n=>new Dy(n)),r.dataPayload=Lu.fromBase64(e.data),r.additionalData=(e.additionalData||[]).map(Lu.fromBase64),r.data=r.dataPayload.toString(),r}findFirstOrNoneTopic(e){return this.topics.filter(r=>e(r))[0]}getLastTopic(){return this.topics[this.topics.length-1]}};ws.TransactionEvent=G_;var Lu=class t{constructor(e){this.raw=e}static fromBase64(e){return new t(h.Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventData=Lu;var Dy=class{constructor(e){this.raw=h.Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventTopic=Dy});var Q_=A(Py=>{"use strict";l();Object.defineProperty(Py,"__esModule",{value:!0});Py.TransactionLogs=void 0;var Eie=RM(),FM=Ta(),vie=LM(),j_=class t{constructor(e){this.address=new FM.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new FM.Address(e.address),r.events=(e.events||[]).map(n=>vie.TransactionEvent.fromHttpResponse(n)),r}findSingleOrNoneEvent(e,r){let n=this.findEvents(e,r);if(n.length>1)throw new Eie.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,r){return this.findEvents(e,r)[0]}findEvents(e,r){let n=this.events.filter(i=>i.identifier==e);return r&&(n=n.filter(i=>r(i))),n}};Py.TransactionLogs=j_});var UM=A(Fu=>{"use strict";l();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ContractResultItem=Fu.ContractResults=void 0;var MM=Q_(),Ry=Ta(),z_=class t{constructor(e){this.items=e,this.items.sort(function(r,n){return r.nonce.valueOf()-n.nonce.valueOf()})}static fromProxyHttpResponse(e){let r=e.map(n=>cf.fromProxyHttpResponse(n));return new t(r)}static fromApiHttpResponse(e){let r=e.map(n=>cf.fromApiHttpResponse(n));return new t(r)}};Fu.ContractResults=z_;var cf=class t{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new Ry.Address(""),this.sender=new Ry.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new MM.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return t.fromHttpResponse(e)}static fromApiHttpResponse(e){let r=t.fromHttpResponse(e);return r.data=h.Buffer.from(r.data,"base64").toString(),r.callType=Number(r.callType),r}static fromHttpResponse(e){let r=new t;return r.hash=e.hash,r.nonce=Number(e.nonce||0),r.value=(e.value||0).toString(),r.receiver=new Ry.Address(e.receiver),r.sender=new Ry.Address(e.sender),r.previousHash=e.prevTxHash,r.originalHash=e.originalTxHash,r.gasLimit=Number(e.gasLimit||0),r.gasPrice=Number(e.gasPrice||0),r.data=e.data||"",r.callType=e.callType,r.returnMessage=e.returnMessage,r.logs=MM.TransactionLogs.fromHttpResponse(e.logs||{}),r}};Fu.ContractResultItem=cf});var qM=A(By=>{"use strict";l();Object.defineProperty(By,"__esModule",{value:!0});By.ContractQueryRequest=void 0;var W_=class{constructor(e){this.query=e}toHttpRequest(){var e;let r={},n=this.query;return r.scAddress=n.address.bech32(),r.caller=!((e=n.caller)===null||e===void 0)&&e.bech32()?n.caller.bech32():void 0,r.funcName=n.func.toString(),r.value=n.value?n.value.toString():void 0,r.args=n.getEncodedArguments(),r}};By.ContractQueryRequest=W_});var KM=A((pEe,$M)=>{l();$M.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Es=A(bo=>{l();var $_,Aie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];bo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};bo.getSymbolTotalCodewords=function(e){return Aie[e]};bo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};bo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');$_=e};bo.isKanjiModeEnabled=function(){return typeof $_<"u"};bo.toSJIS=function(e){return $_(e)}});var My=A(zr=>{l();zr.L={bit:1};zr.M={bit:0};zr.Q={bit:3};zr.H={bit:2};function bie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return zr.L;case"m":case"medium":return zr.M;case"q":case"quartile":return zr.Q;case"h":case"high":return zr.H;default:throw new Error("Unknown EC Level: "+t)}}zr.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};zr.from=function(e,r){if(zr.isValid(e))return e;try{return bie(e)}catch{return r}}});var XM=A((vEe,JM)=>{l();function YM(){this.buffer=[],this.length=0}YM.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};JM.exports=YM});var eU=A((bEe,ZM)=>{l();function lf(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}lf.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};lf.prototype.get=function(t,e){return this.data[t*this.size+e]};lf.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};lf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};ZM.exports=lf});var tU=A(Uy=>{l();var Iie=Es().getSymbolSize;Uy.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=Iie(e),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,s=[n-7];for(let o=1;o{l();var _ie=Es().getSymbolSize,rU=7;nU.getPositions=function(e){let r=_ie(e);return[[0,0],[r-rU,0],[0,r-rU]]}});var sU=A(nt=>{l();nt.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Io={N1:3,N2:3,N3:40,N4:10};nt.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};nt.from=function(e){return nt.isValid(e)?parseInt(e,10):void 0};nt.getPenaltyN1=function(e){let r=e.size,n=0,i=0,s=0,o=null,a=null;for(let u=0;u=5&&(n+=Io.N1+(i-5)),o=f,i=1),f=e.get(c,u),f===a?s++:(s>=5&&(n+=Io.N1+(s-5)),a=f,s=1)}i>=5&&(n+=Io.N1+(i-5)),s>=5&&(n+=Io.N1+(s-5))}return n};nt.getPenaltyN2=function(e){let r=e.size,n=0;for(let i=0;i=10&&(i===1488||i===93)&&n++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&n++}return n*Io.N3};nt.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let s=0;s{l();var vs=My(),qy=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Vy=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];K_.getBlocksCount=function(e,r){switch(r){case vs.L:return qy[(e-1)*4+0];case vs.M:return qy[(e-1)*4+1];case vs.Q:return qy[(e-1)*4+2];case vs.H:return qy[(e-1)*4+3];default:return}};K_.getTotalCodewordsCount=function(e,r){switch(r){case vs.L:return Vy[(e-1)*4+0];case vs.M:return Vy[(e-1)*4+1];case vs.Q:return Vy[(e-1)*4+2];case vs.H:return Vy[(e-1)*4+3];default:return}}});var oU=A(ky=>{l();var ff=new Uint8Array(512),Hy=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ff[r]=e,Hy[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ff[r]=ff[r-255]})();ky.log=function(e){if(e<1)throw new Error("log("+e+")");return Hy[e]};ky.exp=function(e){return ff[e]};ky.mul=function(e,r){return e===0||r===0?0:ff[Hy[e]+Hy[r]]}});var aU=A(df=>{l();var J_=oU();df.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let i=0;i=0;){let i=n[0];for(let o=0;o{l();var uU=aU();function X_(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}X_.prototype.initialize=function(e){this.degree=e,this.genPoly=uU.generateECPolynomial(this.degree)};X_.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=uU.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let s=new Uint8Array(this.degree);return s.set(n,i),s}return n};cU.exports=X_});var Z_=A(fU=>{l();fU.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var eS=A(wi=>{l();var dU="[0-9]+",Tie="[A-Z $%*+\\-./:]+",hf="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";hf=hf.replace(/u/g,"\\u");var Cie="(?:(?![A-Z0-9 $%*+\\-./:]|"+hf+`)(?:.|[\r ]))+`;wi.KANJI=new RegExp(hf,"g");wi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");wi.BYTE=new RegExp(Cie,"g");wi.NUMERIC=new RegExp(dU,"g");wi.ALPHANUMERIC=new RegExp(Tie,"g");var xie=new RegExp("^"+hf+"$"),Nie=new RegExp("^"+dU+"$"),Oie=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");wi.testKanji=function(e){return xie.test(e)};wi.testNumeric=function(e){return Nie.test(e)};wi.testAlphanumeric=function(e){return Oie.test(e)}});var As=A(Bt=>{l();var Die=Z_(),tS=eS();Bt.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Bt.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Bt.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Bt.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Bt.MIXED={bit:-1};Bt.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Die.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]};Bt.getBestModeForData=function(e){return tS.testNumeric(e)?Bt.NUMERIC:tS.testAlphanumeric(e)?Bt.ALPHANUMERIC:tS.testKanji(e)?Bt.KANJI:Bt.BYTE};Bt.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};Bt.isValid=function(e){return e&&e.bit&&e.ccBits};function Pie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return Bt.NUMERIC;case"alphanumeric":return Bt.ALPHANUMERIC;case"kanji":return Bt.KANJI;case"byte":return Bt.BYTE;default:throw new Error("Unknown mode: "+t)}}Bt.from=function(e,r){if(Bt.isValid(e))return e;try{return Pie(e)}catch{return r}}});var mU=A(_o=>{l();var Gy=Es(),Rie=Y_(),hU=My(),bs=As(),rS=Z_(),gU=7973,pU=Gy.getBCHDigit(gU);function Bie(t,e,r){for(let n=1;n<=40;n++)if(e<=_o.getCapacity(n,r,t))return n}function yU(t,e){return bs.getCharCountIndicator(t,e)+4}function Lie(t,e){let r=0;return t.forEach(function(n){let i=yU(n.mode,e);r+=i+n.getBitsLength()}),r}function Fie(t,e){for(let r=1;r<=40;r++)if(Lie(t,r)<=_o.getCapacity(r,e,bs.MIXED))return r}_o.from=function(e,r){return rS.isValid(e)?parseInt(e,10):r};_o.getCapacity=function(e,r,n){if(!rS.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=bs.BYTE);let i=Gy.getSymbolTotalCodewords(e),s=Rie.getTotalCodewordsCount(e,r),o=(i-s)*8;if(n===bs.MIXED)return o;let a=o-yU(n,e);switch(n){case bs.NUMERIC:return Math.floor(a/10*3);case bs.ALPHANUMERIC:return Math.floor(a/11*2);case bs.KANJI:return Math.floor(a/13);case bs.BYTE:default:return Math.floor(a/8)}};_o.getBestVersionForData=function(e,r){let n,i=hU.from(r,hU.M);if(Array.isArray(e)){if(e.length>1)return Fie(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return Bie(n.mode,n.getLength(),i)};_o.getEncodedBits=function(e){if(!rS.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;Gy.getBCHDigit(r)-pU>=0;)r^=gU<{l();var nS=Es(),EU=1335,Mie=21522,wU=nS.getBCHDigit(EU);vU.getEncodedBits=function(e,r){let n=e.bit<<3|r,i=n<<10;for(;nS.getBCHDigit(i)-wU>=0;)i^=EU<{l();var Uie=As();function Mu(t){this.mode=Uie.NUMERIC,this.data=t.toString()}Mu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Mu.prototype.getLength=function(){return this.data.length};Mu.prototype.getBitsLength=function(){return Mu.getBitsLength(this.data.length)};Mu.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);let s=this.data.length-r;s>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};bU.exports=Mu});var SU=A((YEe,_U)=>{l();var qie=As(),iS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Uu(t){this.mode=qie.ALPHANUMERIC,this.data=t}Uu.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Uu.prototype.getLength=function(){return this.data.length};Uu.prototype.getBitsLength=function(){return Uu.getBitsLength(this.data.length)};Uu.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=iS.indexOf(this.data[r])*45;n+=iS.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(iS.indexOf(this.data[r]),6)};_U.exports=Uu});var CU=A((XEe,TU)=>{"use strict";l();TU.exports=function(e){for(var r=[],n=e.length,i=0;i=55296&&s<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}});var NU=A((eve,xU)=>{l();var Vie=CU(),Hie=As();function qu(t){this.mode=Hie.BYTE,typeof t=="string"&&(t=Vie(t)),this.data=new Uint8Array(t)}qu.getBitsLength=function(e){return e*8};qu.prototype.getLength=function(){return this.data.length};qu.prototype.getBitsLength=function(){return qu.getBitsLength(this.data.length)};qu.prototype.write=function(t){for(let e=0,r=this.data.length;e{l();var kie=As(),Gie=Es();function Vu(t){this.mode=kie.KANJI,this.data=t}Vu.getBitsLength=function(e){return e*13};Vu.prototype.getLength=function(){return this.data.length};Vu.prototype.getBitsLength=function(){return Vu.getBitsLength(this.data.length)};Vu.prototype.write=function(t){let e;for(e=0;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};OU.exports=Vu});var PU=A((ive,sS)=>{"use strict";l();var pf={single_source_shortest_paths:function(t,e,r){var n={},i={};i[e]=0;var s=pf.PriorityQueue.make();s.push(e,0);for(var o,a,u,c,f,d,g,m,y;!s.empty();){o=s.pop(),a=o.value,c=o.cost,f=t[a]||{};for(u in f)f.hasOwnProperty(u)&&(d=f[u],g=c+d,m=i[u],y=typeof i[u]>"u",(y||m>g)&&(i[u]=g,s.push(u,g),n[u]=a))}if(typeof r<"u"&&typeof i[r]>"u"){var b=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(b)}return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e,i;n;)r.push(n),i=t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var n=pf.single_source_shortest_paths(t,e,r);return pf.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e=pf.PriorityQueue,r={},n;t=t||{};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r.queue=[],r.sorter=t.sorter||e.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof sS<"u"&&(sS.exports=pf)});var VU=A(Hu=>{l();var je=As(),LU=IU(),FU=SU(),MU=NU(),UU=DU(),gf=eS(),jy=Es(),jie=PU();function RU(t){return unescape(encodeURIComponent(t)).length}function yf(t,e,r){let n=[],i;for(;(i=t.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:e,length:i[0].length});return n}function qU(t){let e=yf(gf.NUMERIC,je.NUMERIC,t),r=yf(gf.ALPHANUMERIC,je.ALPHANUMERIC,t),n,i;return jy.isKanjiModeEnabled()?(n=yf(gf.BYTE,je.BYTE,t),i=yf(gf.KANJI,je.KANJI,t)):(n=yf(gf.BYTE_KANJI,je.BYTE,t),i=[]),e.concat(r,n,i).sort(function(o,a){return o.index-a.index}).map(function(o){return{data:o.data,mode:o.mode,length:o.length}})}function oS(t,e){switch(e){case je.NUMERIC:return LU.getBitsLength(t);case je.ALPHANUMERIC:return FU.getBitsLength(t);case je.KANJI:return UU.getBitsLength(t);case je.BYTE:return MU.getBitsLength(t)}}function Qie(t){return t.reduce(function(e,r){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===r.mode?(e[e.length-1].data+=r.data,e):(e.push(r),e)},[])}function zie(t){let e=[];for(let r=0;r{l();var zy=Es(),aS=My(),$ie=XM(),Kie=eU(),Yie=tU(),Jie=iU(),lS=sU(),fS=Y_(),Xie=lU(),Qy=mU(),Zie=AU(),ese=As(),uS=VU();function tse(t,e){let r=t.size,n=Jie.getPositions(e);for(let i=0;i=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?t.set(s+a,o+u,!0,!0):t.set(s+a,o+u,!1,!0))}}function rse(t){let e=t.size;for(let r=8;r>a&1)===1,t.set(i,s,o,!0),t.set(s,i,o,!0)}function cS(t,e,r){let n=t.size,i=Zie.getEncodedBits(e,r),s,o;for(s=0;s<15;s++)o=(i>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(n-15+s,8,o,!0),s<8?t.set(8,n-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(n-8,8,1,!0)}function sse(t,e){let r=t.size,n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!t.isReserved(i,a-u)){let c=!1;o>>s&1)===1),t.set(i,a-u,c),s--,s===-1&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function ose(t,e,r){let n=new $ie;r.forEach(function(u){n.put(u.mode.bit,4),n.put(u.getLength(),ese.getCharCountIndicator(u.mode,t)),u.write(n)});let i=zy.getSymbolTotalCodewords(t),s=fS.getTotalCodewordsCount(t,e),o=(i-s)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let a=(o-n.getLengthInBits())/8;for(let u=0;u{"use strict";l();Object.defineProperty(iy,"__esModule",{value:!0});iy.TokenOperationsFactoryConfig=void 0;var kee=pt(),OI=class{constructor(e){this.minGasPrice=1e9,this.minGasLimit=5e4,this.gasLimitPerByte=1500,this.gasLimitIssue=6e7,this.gasLimitToggleBurnRoleGlobally=6e7,this.gasLimitESDTLocalMint=3e5,this.gasLimitESDTLocalBurn=3e5,this.gasLimitSetSpecialRole=6e7,this.gasLimitPausing=6e7,this.gasLimitFreezing=6e7,this.gasLimitWiping=6e7,this.gasLimitESDTNFTCreate=3e6,this.gasLimitESDTNFTUpdateAttributes=1e6,this.gasLimitESDTNFTAddQuantity=1e6,this.gasLimitESDTNFTBurn=1e6,this.gasLimitStorePerByte=5e4,this.issueCost="50000000000000000",this.esdtContractAddress=kee.Address.fromBech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"),this.chainID=e}};iy.TokenOperationsFactoryConfig=OI});var fL=A(sy=>{"use strict";l();Object.defineProperty(sy,"__esModule",{value:!0});sy.TokenOperationsOutcomeParser=void 0;var Gee=pt(),DI=Le(),lL=CI(),PI=class{parseIssueFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issue");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseIssueNonFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issueNonFungible");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseIssueSemiFungible(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"issueSemiFungible");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseRegisterMetaESDT(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"registerMetaESDT");return{tokenIdentifier:this.extractTokenIdentifier(r)}}parseRegisterAndSetAllRoles(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"registerAndSetAllRoles"),n=this.extractTokenIdentifier(r),s=this.findSingleEventByIdentifier(e,"ESDTSetRole").topics.slice(3).map(o=>o.valueOf().toString());return{tokenIdentifier:n,roles:s}}parseSetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseUnsetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseSetSpecialRole(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTSetRole"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=r.topics.slice(3).map(o=>o.valueOf().toString());return{userAddress:n,tokenIdentifier:i,roles:s}}parseNFTCreate(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTCreate"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,initialQuantity:s}}parseLocalMint(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTLocalMint"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=this.extractNonce(r),o=this.extractAmount(r);return{userAddress:n,tokenIdentifier:i,nonce:s,mintedSupply:o}}parseLocalBurn(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTLocalBurn"),n=r.address.toString(),i=this.extractTokenIdentifier(r),s=this.extractNonce(r),o=this.extractAmount(r);return{userAddress:n,tokenIdentifier:i,nonce:s,burntSupply:o}}parsePause(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTPause");return{}}parseUnpause(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTUnPause");return{}}parseFreeze(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTFreeze"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseUnfreeze(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTUnFreeze"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseWipe(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTWipe"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{userAddress:this.extractAddress(r),tokenIdentifier:n,nonce:i,balance:s}}parseUpdateAttributes(e){var r;this.ensureNoError(e);let n=this.findSingleEventByIdentifier(e,"ESDTNFTUpdateAttributes"),i=this.extractTokenIdentifier(n),s=this.extractNonce(n),o=(r=n.topics[3])===null||r===void 0?void 0:r.valueOf();return{tokenIdentifier:i,nonce:s,attributes:o}}parseAddQuantity(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTAddQuantity"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,addedQuantity:s}}parseBurnQuantity(e){this.ensureNoError(e);let r=this.findSingleEventByIdentifier(e,"ESDTNFTBurn"),n=this.extractTokenIdentifier(r),i=this.extractNonce(r),s=this.extractAmount(r);return{tokenIdentifier:n,nonce:i,burntQuantity:s}}ensureNoError(e){var r;for(let n of e.logs.events)if(n.identifier=="signalError"){let i=h.Buffer.from(n.data.substring(1),"hex").toString(),s=(r=n.topics[1])===null||r===void 0?void 0:r.valueOf().toString();throw new DI.ErrCannotParseTransactionOutcome(e.hash,`encountered signalError: ${s} (${i})`)}}findSingleEventByIdentifier(e,r){let n=this.gatherAllEvents(e).filter(i=>i.identifier==r);if(n.length==0)throw new DI.ErrCannotParseTransactionOutcome(e.hash,`cannot find event of type ${r}`);if(n.length>1)throw new DI.ErrCannotParseTransactionOutcome(e.hash,`more than one event of type ${r}`);return n[0]}gatherAllEvents(e){let r=[];r.push(...e.logs.events);for(let n of e.contractResults.items)r.push(...n.logs.events);return r}extractTokenIdentifier(e){var r;return(r=e.topics[0])===null||r===void 0?void 0:r.valueOf().toString()}extractNonce(e){var r;return lL.bufferToBigInt((r=e.topics[1])===null||r===void 0?void 0:r.valueOf()).toFixed(0)}extractAmount(e){var r;return lL.bufferToBigInt((r=e.topics[2])===null||r===void 0?void 0:r.valueOf()).toFixed(0)}extractAddress(e){var r;return Gee.Address.fromBuffer((r=e.topics[3])===null||r===void 0?void 0:r.valueOf()).toString()}};sy.TokenOperationsOutcomeParser=PI});var dL=A(pi=>{"use strict";l();var jee=pi&&pi.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RI=pi&&pi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jee(e,t,r)};Object.defineProperty(pi,"__esModule",{value:!0});RI(uL(),pi);RI(cL(),pi);RI(fL(),pi)});var hL=A(rt=>{"use strict";l();var Qee=rt&&rt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dt=rt&&rt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qee(e,t,r)};Object.defineProperty(rt,"__esModule",{value:!0});H8();Dt(ha(),rt);Dt(pt(),rt);Dt(TE(),rt);Dt(Le(),rt);Dt(bE(),rt);Dt(G8(),rt);Dt(Q8(),rt);Dt(pa(),rt);Dt(xc(),rt);Dt(z8(),rt);Dt(iL(),rt);Dt(Wh(),rt);Dt(_I(),rt);Dt(dL(),rt);Dt(Vm(),rt);Dt(Yr(),rt);Dt(Yn(),rt);Dt(Ih(),rt);Dt(vE(),rt);Dt(br(),rt)});var EL=A(Pt=>{"use strict";l();var zee=Pt&&Pt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.sleep=Pt.getMetadata=Pt.applyTransactionSignature=Pt.getAddressFromSession=Pt.addressIsValid=Pt.getConnectionParams=Pt.getCurrentTopic=Pt.getCurrentSession=void 0;var yL=hL(),pL=Rc(),Wee=Dl(),oy=uI(),gi=fI(),BI=hI(),gL=Kg();function mL(t,e){if(!e)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=e.find(wL(t)).filter(n=>n.acknowledged);if(r.length>0){let n=r.length-1;return r[n]}if(e.session.length>0){let n=e.session.keys.length-1;return e.session.get(e.session.keys[n])}throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected)}Pt.getCurrentSession=mL;function $ee(t,e){if(!e)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=mL(t,e);if(!r?.topic)throw new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);return r.topic}Pt.getCurrentTopic=$ee;function wL(t,e){var r,n,i;let s=[...oy.WALLETCONNECT_MULTIVERSX_METHODS,...(r=e?.methods)!==null&&r!==void 0?r:[]];!((n=e?.methods)===null||n===void 0)&&n.includes(gL.OptionalOperation.SIGN_LOGIN_TOKEN)||s.push(gL.OptionalOperation.SIGN_LOGIN_TOKEN);let o=[`${oy.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${t}`],a=(i=e?.events)!==null&&i!==void 0?i:[];return{requiredNamespaces:{[oy.WALLETCONNECT_MULTIVERSX_NAMESPACE]:{methods:s,chains:o,events:a}}}}Pt.getConnectionParams=wL;function Kee(t){try{return!yL.Address.fromBech32(t).isEmpty()}catch{return!1}}Pt.addressIsValid=Kee;function Yee(t){let e=t.namespaces[oy.WALLETCONNECT_MULTIVERSX_NAMESPACE];if(e&&e.accounts){let r=e.accounts[0],[n,i,s]=r.split(":");return s}return""}Pt.getAddressFromSession=Yee;function Jee({transaction:t,response:e}){if(!e)throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);let{signature:r,guardianSignature:n,version:i,options:s,guardian:o}=e,a=t.getGuardian().bech32();if(a&&a!==o)throw BI.Logger.error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidGuardian),new Error(gi.WalletConnectV2ProviderErrorMessagesEnum.invalidGuardian);return o&&t.setGuardian(yL.Address.fromBech32(o)),i&&t.setVersion(i),s!=null&&t.setOptions(s),t.applySignature(new pL.Signature(r)),n&&t.applyGuardianSignature(new pL.Signature(n)),t}Pt.applyTransactionSignature=Jee;function Xee(t){if(t)return Object.assign(Object.assign({},t),{url:Wee.getAppMetadata().url})}Pt.getMetadata=Xee;function Zee(t){return zee(this,void 0,void 0,function*(){return yield new Promise(e=>setTimeout(()=>{e()},t))})}Pt.sleep=Zee});var Yl=A(vr=>{"use strict";l();var St=vr&&vr.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},ete=vr&&vr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vr,"__esModule",{value:!0});vr.WalletConnectV2Provider=vr.OptionalOperation=vr.Operation=vr.WalletConnectV2ProviderErrorMessagesEnum=void 0;var tte=Rc(),rte=ete(q8()),LI=Dl(),yo=uI(),we=fI();Object.defineProperty(vr,"WalletConnectV2ProviderErrorMessagesEnum",{enumerable:!0,get:function(){return we.WalletConnectV2ProviderErrorMessagesEnum}});var Fe=hI(),cs=Kg();Object.defineProperty(vr,"Operation",{enumerable:!0,get:function(){return cs.Operation}});Object.defineProperty(vr,"OptionalOperation",{enumerable:!0,get:function(){return cs.OptionalOperation}});var Wt=EL(),FI=class{constructor(e,r,n,i,s){this.chainId="",this.address="",this.signature="",this.isInitializing=!1,this.processingTopic="",this.options={},this.onClientConnect=e,this.chainId=r,this.walletConnectV2Relay=n,this.walletConnectV2ProjectId=i,this.options=s}reset(){this.address="",this.signature="",this.walletConnector=void 0,this.session=void 0,this.pairings=void 0}init(){var e,r;return St(this,void 0,void 0,function*(){if(this.isInitialized())return this.isInitialized();try{if(!this.isInitializing){this.isInitializing=!0,this.reset();let n=!((e=this.options)===null||e===void 0)&&e.metadata?{metadata:Wt.getMetadata((r=this.options)===null||r===void 0?void 0:r.metadata)}:{},i=yield rte.default.init(Object.assign(Object.assign(Object.assign({},this.options),{relayUrl:this.walletConnectV2Relay,projectId:this.walletConnectV2ProjectId}),n));this.walletConnector=i,this.isInitializing=!1,yield this.subscribeToEvents(i),yield this.checkPersistedState(i)}}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToInit)}finally{return this.isInitializing=!1,this.isInitialized()}})}isInitialized(){return!!this.walletConnector&&!this.isInitializing}isConnected(){return new Promise((e,r)=>e(!!(this.isInitialized()&&typeof this.session<"u")))}connect(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);let r=Wt.getConnectionParams(this.chainId,e);try{return yield this.walletConnector.connect(Object.assign({pairingTopic:e?.topic},r))}catch{throw this.reset(),Fe.Logger.error(e?.topic?we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnectExisting:we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnect),new Error(e?.topic?we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnectExisting:we.WalletConnectV2ProviderErrorMessagesEnum.unableToConnect)}})}login(e){var r;return St(this,void 0,void 0,function*(){if(this.isInitializing=!0,typeof this.walletConnector>"u"&&(yield this.connect()),typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);typeof this.session<"u"&&(yield this.logout({topic:(r=this.session)===null||r===void 0?void 0:r.topic}));try{if(e&&e.approval){let n=yield e.approval();if(e.token){yield Wt.sleep(yo.WALLETCONNECT_SIGN_LOGIN_DELAY);let i=Wt.getAddressFromSession(n),o=n.namespaces[yo.WALLETCONNECT_MULTIVERSX_NAMESPACE].methods.includes(cs.OptionalOperation.SIGN_NATIVE_AUTH_TOKEN)?cs.OptionalOperation.SIGN_NATIVE_AUTH_TOKEN:cs.OptionalOperation.SIGN_LOGIN_TOKEN,{signature:a}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:n.topic,request:{method:o,params:{token:e.token,address:i}}});if(!a)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSignLoginToken),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSignLoginToken);return yield this.onSessionConnected({session:n,signature:a})}return yield this.onSessionConnected({session:n,signature:""})}}catch{throw this.reset(),Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToLogin),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToLogin)}finally{this.isInitializing=!1}return""})}logout(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);try{if(this.processingTopic===(e?.topic||Wt.getCurrentTopic(this.chainId,this.walletConnector)))return!0;if(e?.topic)this.processingTopic=e.topic,yield this.walletConnector.disconnect({topic:e.topic,reason:LI.getSdkError("USER_DISCONNECTED")});else{let r=Wt.getCurrentTopic(this.chainId,this.walletConnector);this.processingTopic=r,yield this.walletConnector.disconnect({topic:r,reason:LI.getSdkError("USER_DISCONNECTED")}),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0})}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.alreadyLoggedOut)}finally{this.processingTopic=""}return!0})}getAddress(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return this.address})}getSignature(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return this.signature})}getPairings(){var e,r,n,i,s;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return(s=(i=(n=(r=(e=this.walletConnector)===null||e===void 0?void 0:e.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0?void 0:n.pairings)===null||i===void 0?void 0:i.getAll({active:!0}))!==null&&s!==void 0?s:[]})}signMessage(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);try{let r=yield this.getAddress(),{signature:n}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_MESSAGE,params:{address:r,message:e.message.toString()}}});if(!n)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageResponse),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageResponse);try{e.applySignature(new tte.Signature(n))}catch{throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageSignature),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidMessageSignature)}}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToSign)}return e})}signTransaction(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);let r=e.toPlainObject();if(this.chainId!==e.getChainID().valueOf())throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain);try{let n=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_TRANSACTION,params:{transaction:r}}});return Wt.applyTransactionSignature({transaction:e,response:n})}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.transactionError)}})}signTransactions(e){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);let r=e.map(n=>{if(this.chainId!==n.getChainID().valueOf())throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.requestDifferentChain);return n.toPlainObject()});try{let{signatures:n}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:{method:cs.Operation.SIGN_TRANSACTIONS,params:{transactions:r}}});if(!n)throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);if(!Array.isArray(n)||e.length!==n.length)throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidTransactionResponse);for(let[i,s]of e.entries()){let o=n[i];Wt.applyTransactionSignature({transaction:s,response:o})}return e}catch{throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.transactionError)}})}sendCustomRequest(e){var r;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(typeof this.session>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected),this.onClientConnect.onClientLogout(),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);if(!((r=e?.request)===null||r===void 0)&&r.method){try{let n=Object.assign({},e.request),{method:i}=n,{response:s}=yield this.walletConnector.request({chainId:`${yo.WALLETCONNECT_MULTIVERSX_NAMESPACE}:${this.chainId}`,topic:Wt.getCurrentTopic(this.chainId,this.walletConnector),request:Object.assign(Object.assign({},n),{method:i})});s||Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidCustomRequestResponse)}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.invalidCustomRequestResponse)}return}})}ping(){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized),new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);typeof this.session>"u"&&Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionNotConnected);try{let e=Wt.getCurrentTopic(this.chainId,this.walletConnector);return yield this.walletConnector.ping({topic:e}),!0}catch{return Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.pingFailed),!1}})}loginAccount(e){return St(this,void 0,void 0,function*(){return e?Wt.addressIsValid(e.address)?(this.address=e.address,e.signature&&(this.signature=e.signature),this.onClientConnect.onClientLogin(),this.address):(Fe.Logger.error(`${we.WalletConnectV2ProviderErrorMessagesEnum.invalidAddress} ${e.address}`),this.walletConnector&&(yield this.logout()),""):""})}onSessionConnected(e){return St(this,void 0,void 0,function*(){if(!e)return"";this.session=e.session;let r=Wt.getAddressFromSession(e.session);return r?(yield this.loginAccount({address:r,signature:e.signature}),r):""})}handleTopicUpdateEvent({topic:e}){return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u"){Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);return}try{let r=yield this.getPairings();if(this.address&&!this.isInitializing&&r)if(r?.length===0)this.onClientConnect.onClientLogout();else{let n=r[r.length-1];n?.topic===e&&this.onClientConnect.onClientLogout()}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleTopic)}finally{this.pairings=yield this.getPairings()}})}handleSessionEvents({topic:e,params:r}){var n;return St(this,void 0,void 0,function*(){if(typeof this.walletConnector>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(this.session&&((n=this.session)===null||n===void 0?void 0:n.topic)!==e)return;let{event:i}=r;if(i?.name&&Wt.getCurrentTopic(this.chainId,this.walletConnector)===e){let s=i.data;this.onClientConnect.onClientEvent(s)}})}subscribeToEvents(e){var r,n,i,s;return St(this,void 0,void 0,function*(){if(typeof e>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);try{e.on("session_update",({topic:o,params:a})=>{var u;if(!this.session||((u=this.session)===null||u===void 0?void 0:u.topic)!==o)return;let{namespaces:c}=a,f=e.session.get(o),d=Object.assign(Object.assign({},f),{namespaces:c});this.onSessionConnected({session:d})}),e.on("session_event",this.handleSessionEvents.bind(this)),e.on("session_delete",({topic:o})=>St(this,void 0,void 0,function*(){var a;this.isInitializing&&(this.onClientConnect.onClientLogout(),this.reset()),!(!this.session||((a=this.session)===null||a===void 0?void 0:a.topic)!==o)&&(Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionDeleted),this.onClientConnect.onClientLogout(),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0}))})),e.on("session_expire",({topic:o})=>St(this,void 0,void 0,function*(){var a;!this.session||((a=this.session)===null||a===void 0?void 0:a.topic)!==o||(Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.sessionExpired),this.onClientConnect.onClientLogout(),this.reset(),yield this.cleanupPendingPairings({deletePairings:!0}))})),(n=(r=e.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0||n.events.on("pairing_delete",this.handleTopicUpdateEvent.bind(this)),(s=(i=e.core)===null||i===void 0?void 0:i.pairing)===null||s===void 0||s.events.on("pairing_expire",this.handleTopicUpdateEvent.bind(this))}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleEvent)}})}checkPersistedState(e){return St(this,void 0,void 0,function*(){if(typeof e>"u")throw new Error(we.WalletConnectV2ProviderErrorMessagesEnum.notInitialized);if(this.pairings=yield this.getPairings(),!(typeof this.session<"u")&&e.session.length&&!this.address&&!this.isInitializing){let r=Wt.getCurrentSession(this.chainId,e);if(r)return yield this.onSessionConnected({session:r}),r}})}cleanupPendingPairings(e={}){var r,n,i,s,o,a,u,c;return St(this,void 0,void 0,function*(){if(!(typeof this.walletConnector>"u"))try{let f=(i=(n=(r=this.walletConnector.core)===null||r===void 0?void 0:r.pairing)===null||n===void 0?void 0:n.pairings)===null||i===void 0?void 0:i.getAll({active:!1});if(!LI.isValidArray(f))return;for(let d of f)if(e.deletePairings)(o=(s=this.walletConnector.core)===null||s===void 0?void 0:s.expirer)===null||o===void 0||o.set(d.topic,0);else try{yield(c=(u=(a=this.walletConnector.core)===null||a===void 0?void 0:a.relayer)===null||u===void 0?void 0:u.subscriber)===null||c===void 0?void 0:c.unsubscribe(d.topic)}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleCleanup)}}catch{Fe.Logger.error(we.WalletConnectV2ProviderErrorMessagesEnum.unableToHandleCleanup)}})}};vr.WalletConnectV2Provider=FI});var AL=A((dme,vL)=>{"use strict";l();vL.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}});var _L=A((pme,IL)=>{"use strict";l();var bL=typeof Symbol<"u"&&Symbol,nte=AL();IL.exports=function(){return typeof bL!="function"||typeof Symbol!="function"||typeof bL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nte()}});var CL=A((yme,TL)=>{"use strict";l();var SL={foo:{}},ite=Object;TL.exports=function(){return{__proto__:SL}.foo===SL.foo&&!({__proto__:null}instanceof ite)}});var OL=A((wme,NL)=>{"use strict";l();var ste="Function.prototype.bind called on incompatible ",ote=Object.prototype.toString,ate=Math.max,ute="[object Function]",xL=function(e,r){for(var n=[],i=0;i{"use strict";l();var fte=OL();DL.exports=Function.prototype.bind||fte});var RL=A((bme,PL)=>{"use strict";l();var dte=Function.prototype.call,hte=Object.prototype.hasOwnProperty,pte=ay();PL.exports=pte.call(dte,hte)});var ls=A((_me,UL)=>{"use strict";l();var Re,Eu=SyntaxError,ML=Function,wu=TypeError,MI=function(t){try{return ML('"use strict"; return ('+t+").constructor;")()}catch{}},mo=Object.getOwnPropertyDescriptor;if(mo)try{mo({},"")}catch{mo=null}var UI=function(){throw new wu},gte=mo?function(){try{return arguments.callee,UI}catch{try{return mo(arguments,"callee").get}catch{return UI}}}():UI,yu=_L()(),yte=CL()(),Gt=Object.getPrototypeOf||(yte?function(t){return t.__proto__}:null),mu={},mte=typeof Uint8Array>"u"||!Gt?Re:Gt(Uint8Array),wo={"%AggregateError%":typeof AggregateError>"u"?Re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Re:ArrayBuffer,"%ArrayIteratorPrototype%":yu&&Gt?Gt([][Symbol.iterator]()):Re,"%AsyncFromSyncIteratorPrototype%":Re,"%AsyncFunction%":mu,"%AsyncGenerator%":mu,"%AsyncGeneratorFunction%":mu,"%AsyncIteratorPrototype%":mu,"%Atomics%":typeof Atomics>"u"?Re:Atomics,"%BigInt%":typeof BigInt>"u"?Re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Re:FinalizationRegistry,"%Function%":ML,"%GeneratorFunction%":mu,"%Int8Array%":typeof Int8Array>"u"?Re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Re:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yu&&Gt?Gt(Gt([][Symbol.iterator]())):Re,"%JSON%":typeof JSON=="object"?JSON:Re,"%Map%":typeof Map>"u"?Re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!yu||!Gt?Re:Gt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Re:Promise,"%Proxy%":typeof Proxy>"u"?Re:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!yu||!Gt?Re:Gt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yu&&Gt?Gt(""[Symbol.iterator]()):Re,"%Symbol%":yu?Symbol:Re,"%SyntaxError%":Eu,"%ThrowTypeError%":gte,"%TypedArray%":mte,"%TypeError%":wu,"%Uint8Array%":typeof Uint8Array>"u"?Re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Re:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Re:WeakSet};if(Gt)try{null.error}catch(t){BL=Gt(Gt(t)),wo["%Error.prototype%"]=BL}var BL,wte=function t(e){var r;if(e==="%AsyncFunction%")r=MI("async function () {}");else if(e==="%GeneratorFunction%")r=MI("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=MI("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Gt&&(r=Gt(i.prototype))}return wo[e]=r,r},LL={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Jl=ay(),uy=RL(),Ete=Jl.call(Function.call,Array.prototype.concat),vte=Jl.call(Function.apply,Array.prototype.splice),FL=Jl.call(Function.call,String.prototype.replace),cy=Jl.call(Function.call,String.prototype.slice),Ate=Jl.call(Function.call,RegExp.prototype.exec),bte=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ite=/\\(\\)?/g,_te=function(e){var r=cy(e,0,1),n=cy(e,-1);if(r==="%"&&n!=="%")throw new Eu("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Eu("invalid intrinsic syntax, expected opening `%`");var i=[];return FL(e,bte,function(s,o,a,u){i[i.length]=a?FL(u,Ite,"$1"):o||s}),i},Ste=function(e,r){var n=e,i;if(uy(LL,n)&&(i=LL[n],n="%"+i[0]+"%"),uy(wo,n)){var s=wo[n];if(s===mu&&(s=wte(n)),typeof s>"u"&&!r)throw new wu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Eu("intrinsic "+e+" does not exist!")};UL.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new wu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new wu('"allowMissing" argument must be a boolean');if(Ate(/^%?[^%]*%?$/,e)===null)throw new Eu("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_te(e),i=n.length>0?n[0]:"",s=Ste("%"+i+"%",r),o=s.name,a=s.value,u=!1,c=s.alias;c&&(i=c[0],vte(n,Ete([0,1],c)));for(var f=1,d=!0;f=n.length){var b=mo(a,g);d=!!b,d&&"get"in b&&!("originalValue"in b.get)?a=b.get:a=a[g]}else d=uy(a,g),a=a[g];d&&!u&&(wo[o]=a)}}return a}});var HI=A((Tme,qL)=>{"use strict";l();var Tte=ls(),qI=Tte("%Object.defineProperty%",!0),VI=function(){if(qI)try{return qI({},"a",{value:1}),!0}catch{return!1}return!1};VI.hasArrayLengthDefineBug=function(){if(!VI())return null;try{return qI([],"length",{value:1}).length!==1}catch{return!0}};qL.exports=VI});var kI=A((xme,VL)=>{"use strict";l();var Cte=ls(),ly=Cte("%Object.getOwnPropertyDescriptor%",!0);if(ly)try{ly([],"length")}catch{ly=null}VL.exports=ly});var GL=A((Ome,kL)=>{"use strict";l();var xte=HI()(),GI=ls(),Xl=xte&&GI("%Object.defineProperty%",!0);if(Xl)try{Xl({},"a",{value:1})}catch{Xl=!1}var Nte=GI("%SyntaxError%"),vu=GI("%TypeError%"),HL=kI();kL.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new vu("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new vu("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new vu("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new vu("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new vu("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new vu("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,u=!!HL&&HL(e,r);if(Xl)Xl(e,r,{configurable:o===null&&u?u.configurable:!o,enumerable:i===null&&u?u.enumerable:!i,value:n,writable:s===null&&u?u.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new Nte("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var KL=A((Pme,$L)=>{"use strict";l();var WL=ls(),jL=GL(),Ote=HI()(),QL=kI(),zL=WL("%TypeError%"),Dte=WL("%Math.floor%");$L.exports=function(e,r){if(typeof e!="function")throw new zL("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Dte(r)!==r)throw new zL("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&QL){var o=QL(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!n)&&(Ote?jL(e,"length",r,!0,!0):jL(e,"length",r)),e}});var eF=A((Bme,fy)=>{"use strict";l();var jI=ay(),Au=ls(),Pte=KL(),Rte=Au("%TypeError%"),JL=Au("%Function.prototype.apply%"),XL=Au("%Function.prototype.call%"),ZL=Au("%Reflect.apply%",!0)||jI.call(XL,JL),Zl=Au("%Object.defineProperty%",!0),Bte=Au("%Math.max%");if(Zl)try{Zl({},"a",{value:1})}catch{Zl=null}fy.exports=function(e){if(typeof e!="function")throw new Rte("a function is required");var r=ZL(jI,XL,arguments);return Pte(r,1+Bte(0,e.length-(arguments.length-1)),!0)};var YL=function(){return ZL(jI,JL,arguments)};Zl?Zl(fy.exports,"apply",{value:YL}):fy.exports.apply=YL});var iF=A((Fme,nF)=>{"use strict";l();var tF=ls(),rF=eF(),Lte=rF(tF("String.prototype.indexOf"));nF.exports=function(e,r){var n=tF(e,!!r);return typeof n=="function"&&Lte(e,".prototype.")>-1?rF(n):n}});var sF=A(()=>{l()});var SF=A((Hme,_F)=>{l();var e_=typeof Map=="function"&&Map.prototype,QI=Object.getOwnPropertyDescriptor&&e_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hy=e_&&QI&&typeof QI.get=="function"?QI.get:null,oF=e_&&Map.prototype.forEach,t_=typeof Set=="function"&&Set.prototype,zI=Object.getOwnPropertyDescriptor&&t_?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,py=t_&&zI&&typeof zI.get=="function"?zI.get:null,aF=t_&&Set.prototype.forEach,Fte=typeof WeakMap=="function"&&WeakMap.prototype,tf=Fte?WeakMap.prototype.has:null,Mte=typeof WeakSet=="function"&&WeakSet.prototype,rf=Mte?WeakSet.prototype.has:null,Ute=typeof WeakRef=="function"&&WeakRef.prototype,uF=Ute?WeakRef.prototype.deref:null,qte=Boolean.prototype.valueOf,Vte=Object.prototype.toString,Hte=Function.prototype.toString,kte=String.prototype.match,r_=String.prototype.slice,ds=String.prototype.replace,Gte=String.prototype.toUpperCase,cF=String.prototype.toLowerCase,wF=RegExp.prototype.test,lF=Array.prototype.concat,qn=Array.prototype.join,jte=Array.prototype.slice,fF=Math.floor,KI=typeof BigInt=="function"?BigInt.prototype.valueOf:null,WI=Object.getOwnPropertySymbols,YI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,bu=typeof Symbol=="function"&&typeof Symbol.iterator=="object",nr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===bu||!0)?Symbol.toStringTag:null,EF=Object.prototype.propertyIsEnumerable,dF=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function hF(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||wF.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-fF(-t):fF(t);if(n!==t){var i=String(n),s=r_.call(e,i.length+1);return ds.call(i,r,"$&_")+"."+ds.call(ds.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ds.call(e,r,"$&_")}var JI=sF(),pF=JI.custom,gF=AF(pF)?pF:null;_F.exports=function t(e,r,n,i){var s=r||{};if(fs(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fs(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=fs(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fs(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(fs(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return IF(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return a?hF(e,u):u}if(typeof e=="bigint"){var c=String(e)+"n";return a?hF(e,c):c}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return XI(e)?"[Array]":"[Object]";var d=ure(s,n);if(typeof i>"u")i=[];else if(bF(i,e)>=0)return"[Circular]";function g(j,K,me){if(K&&(i=jte.call(i),i.push(K)),me){var ce={depth:s.depth};return fs(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(j,ce,n+1,i)}return t(j,s,n+1,i)}if(typeof e=="function"&&!yF(e)){var m=Zte(e),y=dy(e,g);return"[Function"+(m?": "+m:" (anonymous)")+"]"+(y.length>0?" { "+qn.call(y,", ")+" }":"")}if(AF(e)){var b=bu?ds.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):YI.call(e);return typeof e=="object"&&!bu?ef(b):b}if(sre(e)){for(var O="<"+cF.call(String(e.nodeName)),R=e.attributes||[],z=0;z",O}if(XI(e)){if(e.length===0)return"[]";var M=dy(e,g);return d&&!are(M)?"["+ZI(M,d)+"]":"[ "+qn.call(M,", ")+" ]"}if(Wte(e)){var E=dy(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!EF.call(e,"cause")?"{ ["+String(e)+"] "+qn.call(lF.call("[cause]: "+g(e.cause),E),", ")+" }":E.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+qn.call(E,", ")+" }"}if(typeof e=="object"&&o){if(gF&&typeof e[gF]=="function"&&JI)return JI(e,{depth:f-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ere(e)){var S=[];return oF&&oF.call(e,function(j,K){S.push(g(K,e,!0)+" => "+g(j,e))}),mF("Map",hy.call(e),S,d)}if(nre(e)){var N=[];return aF&&aF.call(e,function(j){N.push(g(j,e))}),mF("Set",py.call(e),N,d)}if(tre(e))return $I("WeakMap");if(ire(e))return $I("WeakSet");if(rre(e))return $I("WeakRef");if(Kte(e))return ef(g(Number(e)));if(Jte(e))return ef(g(KI.call(e)));if(Yte(e))return ef(qte.call(e));if($te(e))return ef(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===global)return"{ [object globalThis] }";if(!zte(e)&&!yF(e)){var _=dy(e,g),T=dF?dF(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",X=!T&&nr&&Object(e)===e&&nr in e?r_.call(hs(e),8,-1):B?"Object":"",Q=T||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",H=Q+(X||B?"["+qn.call(lF.call([],X||[],B||[]),": ")+"] ":"");return _.length===0?H+"{}":d?H+"{"+ZI(_,d)+"}":H+"{ "+qn.call(_,", ")+" }"}return String(e)};function vF(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qte(t){return ds.call(String(t),/"/g,""")}function XI(t){return hs(t)==="[object Array]"&&(!nr||!(typeof t=="object"&&nr in t))}function zte(t){return hs(t)==="[object Date]"&&(!nr||!(typeof t=="object"&&nr in t))}function yF(t){return hs(t)==="[object RegExp]"&&(!nr||!(typeof t=="object"&&nr in t))}function Wte(t){return hs(t)==="[object Error]"&&(!nr||!(typeof t=="object"&&nr in t))}function $te(t){return hs(t)==="[object String]"&&(!nr||!(typeof t=="object"&&nr in t))}function Kte(t){return hs(t)==="[object Number]"&&(!nr||!(typeof t=="object"&&nr in t))}function Yte(t){return hs(t)==="[object Boolean]"&&(!nr||!(typeof t=="object"&&nr in t))}function AF(t){if(bu)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!YI)return!1;try{return YI.call(t),!0}catch{}return!1}function Jte(t){if(!t||typeof t!="object"||!KI)return!1;try{return KI.call(t),!0}catch{}return!1}var Xte=Object.prototype.hasOwnProperty||function(t){return t in this};function fs(t,e){return Xte.call(t,e)}function hs(t){return Vte.call(t)}function Zte(t){if(t.name)return t.name;var e=kte.call(Hte.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function bF(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return IF(r_.call(t,0,e.maxStringLength),e)+n}var i=ds.call(ds.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ore);return vF(i,"single",e)}function ore(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Gte.call(e.toString(16))}function ef(t){return"Object("+t+")"}function $I(t){return t+" { ? }"}function mF(t,e,r,n){var i=n?ZI(r,n):qn.call(r,", ");return t+" ("+e+") {"+i+"}"}function are(t){for(var e=0;e=0)return!1;return!0}function ure(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=qn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:qn.call(Array(e+1),r)}}function ZI(t,e){if(t.length===0)return"";var r=` `+e.prev+e.base;return r+qn.call(t,","+r)+` -`+e.prev}function dy(t,e){var r=XI(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";l();var n_=ls(),Iu=iF(),cre=SF(),lre=n_("%TypeError%"),gy=n_("%WeakMap%",!0),yy=n_("%Map%",!0),fre=Iu("WeakMap.prototype.get",!0),dre=Iu("WeakMap.prototype.set",!0),hre=Iu("WeakMap.prototype.has",!0),pre=Iu("Map.prototype.get",!0),gre=Iu("Map.prototype.set",!0),yre=Iu("Map.prototype.has",!0),i_=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mre=function(t,e){var r=i_(t,e);return r&&r.value},wre=function(t,e,r){var n=i_(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Ere=function(t,e){return!!i_(t,e)};TF.exports=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new lre("Side channel does not contain "+cre(s))},get:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fre(e,s)}else if(yy){if(r)return pre(r,s)}else if(n)return mre(n,s)},has:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return hre(e,s)}else if(yy){if(r)return yre(r,s)}else if(n)return Ere(n,s);return!1},set:function(s,o){gy&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new gy),dre(e,s,o)):yy?(r||(r=new yy),gre(r,s,o)):(n||(n={key:{},next:null}),wre(n,s,o))}};return i}});var my=A((Qme,xF)=>{"use strict";l();var vre=String.prototype.replace,Are=/%20/g,s_={RFC1738:"RFC1738",RFC3986:"RFC3986"};xF.exports={default:s_.RFC3986,formatters:{RFC1738:function(t){return vre.call(t,Are,"+")},RFC3986:function(t){return String(t)}},RFC1738:s_.RFC1738,RFC3986:s_.RFC3986}});var a_=A((Wme,OF)=>{"use strict";l();var bre=my(),o_=Object.prototype.hasOwnProperty,Eo=Array.isArray,Vn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ire=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Eo(n)){for(var i=[],s=0;s=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||s===bre.RFC1738&&(c===40||c===41)){a+=o.charAt(u);continue}if(c<128){a=a+Vn[c];continue}if(c<2048){a=a+(Vn[192|c>>6]+Vn[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Vn[224|c>>12]+Vn[128|c>>6&63]+Vn[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|o.charCodeAt(u)&1023),a+=Vn[240|c>>18]+Vn[128|c>>12&63]+Vn[128|c>>6&63]+Vn[128|c&63]}return a},xre=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i{"use strict";l();var RF=CF(),c_=a_(),nf=my(),Rre=Object.prototype.hasOwnProperty,DF={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vo=Array.isArray,Bre=String.prototype.split,Lre=Array.prototype.push,BF=function(t,e){Lre.apply(t,vo(e)?e:[e])},Fre=Date.prototype.toISOString,PF=nf.default,$t={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:c_.encode,encodeValuesOnly:!1,format:PF,formatter:nf.formatters[PF],indices:!1,serializeDate:function(e){return Fre.call(e)},skipNulls:!1,strictNullHandling:!1},Mre=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},u_={},Ure=function t(e,r,n,i,s,o,a,u,c,f,d,g,m,y,b){for(var O=e,R=b,z=0,M=!1;(R=R.get(u_))!==void 0&&!M;){var E=R.get(e);if(z+=1,typeof E<"u"){if(E===z)throw new RangeError("Cyclic object value");M=!0}typeof R.get(u_)>"u"&&(z=0)}if(typeof a=="function"?O=a(r,O):O instanceof Date?O=f(O):n==="comma"&&vo(O)&&(O=c_.maybeMap(O,function(ie){return ie instanceof Date?f(ie):ie})),O===null){if(i)return o&&!m?o(r,$t.encoder,y,"key",d):r;O=""}if(Mre(O)||c_.isBuffer(O)){if(o){var S=m?r:o(r,$t.encoder,y,"key",d);if(n==="comma"&&m){for(var N=Bre.call(String(O),","),_="",T=0;T"u")return B;var X;if(n==="comma"&&vo(O))X=[{value:O.length>0?O.join(",")||null:void 0}];else if(vo(a))X=a;else{var Q=Object.keys(O);X=u?Q.sort(u):Q}for(var H=0;H"u"?$t.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:$t.charsetSentinel,delimiter:typeof e.delimiter>"u"?$t.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:$t.encode,encoder:typeof e.encoder=="function"?e.encoder:$t.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:$t.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:$t.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:$t.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:$t.strictNullHandling}};LF.exports=function(t,e){var r=t,n=qre(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vo(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in DF?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=DF[a];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=RF(),f=0;f0?m+g:""}});var qF=A((Jme,UF)=>{"use strict";l();var _u=a_(),l_=Object.prototype.hasOwnProperty,Vre=Array.isArray,jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_u.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hre=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},MF=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},kre="utf8=%26%2310003%3B",Gre="utf8=%E2%9C%93",jre=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,u,c=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(y=Vre(y)?[y]:y),l_.call(n,m)?n[m]=_u.combine(n[m],y):n[m]=y}return n},Qre=function(t,e,r,n){for(var i=n?e:MF(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(o=[],o[c]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},zre=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),c=u?s.slice(0,u.index):s,f=[];if(c){if(!n.plainObjects&&l_.call(Object.prototype,c)&&!n.allowPrototypes)return;f.push(c)}for(var d=0;n.depth>0&&(u=a.exec(s))!==null&&d"u"?jt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?jt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:jt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:jt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:jt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:jt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:jt.comma,decoder:typeof e.decoder=="function"?e.decoder:jt.decoder,delimiter:typeof e.delimiter=="string"||_u.isRegExp(e.delimiter)?e.delimiter:jt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:jt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:jt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:jt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:jt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:jt.strictNullHandling}};UF.exports=function(t,e){var r=Wre(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?jre(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o{"use strict";l();var $re=FF(),Kre=qF(),Yre=my();VF.exports={formats:Yre,parse:Kre,stringify:$re}});var f_=A(Ge=>{"use strict";l();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED=Ge.WALLET_PROVIDER_CALLBACK_PARAM=Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL=Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL=Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL=Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL=Ge.WALLET_PROVIDER_DISCONNECT_URL=Ge.WALLET_PROVIDER_CONNECT_URL=Ge.XALIAS_PROVIDER_TESTNET=Ge.XALIAS_PROVIDER_DEVNET=Ge.XALIAS_PROVIDER_MAINNET=Ge.WALLET_PROVIDER_TESTNET=Ge.WALLET_PROVIDER_DEVNET=Ge.WALLET_PROVIDER_MAINNET=void 0;Ge.WALLET_PROVIDER_MAINNET="https://wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_DEVNET="https://devnet-wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_TESTNET="https://testnet-wallet.multiversx.com/dapp/init";Ge.XALIAS_PROVIDER_MAINNET="https://xalias.com";Ge.XALIAS_PROVIDER_DEVNET="https://devnet.xalias.com";Ge.XALIAS_PROVIDER_TESTNET="https://testnet.xalias.com";Ge.WALLET_PROVIDER_CONNECT_URL="hook/login";Ge.WALLET_PROVIDER_DISCONNECT_URL="hook/logout";Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL="hook/transaction";Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL="hook/sign";Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL="hook/2fa";Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL="hook/sign-message";Ge.WALLET_PROVIDER_CALLBACK_PARAM="walletProviderStatus";Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED="transactionsSigned"});var kF=A(Su=>{"use strict";l();Object.defineProperty(Su,"__esModule",{value:!0});Su.ErrCannotSignedMessage=Su.ErrCannotGetSignedTransactions=void 0;var d_=class extends Error{constructor(){super("Cannot get signed transaction(s)")}};Su.ErrCannotGetSignedTransactions=d_;var h_=class extends Error{constructor(){super("Cannot get signed message")}};Su.ErrCannotSignedMessage=h_});var GF=A(wy=>{"use strict";l();Object.defineProperty(wy,"__esModule",{value:!0});wy.PlainSignedTransaction=void 0;var p_=class{constructor(e){this.nonce=0,this.value="",this.receiver="",this.sender="",this.gasPrice=0,this.gasLimit=0,this.data="",this.chainID="",this.version=0,this.signature="",Object.assign(this,e)}};wy.PlainSignedTransaction=p_});var Tu=A(ys=>{"use strict";l();var ps=ys&&ys.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Jre=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.WalletProvider=void 0;var g_=Jre(HF()),gs=f_(),y_=kF(),Xre=GF(),m_=class t{constructor(e){this.walletUrl=e}login(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_CONNECT_URL,callbackUrl:e?.callbackUrl,params:{token:e?.token}});return yield this.redirect(r,e?.redirectDelayMilliseconds),r})}redirect(e,r){return ps(this,void 0,void 0,function*(){r?yield this.redirectLater(e,r):this.redirectImmediately(e)})}redirectImmediately(e){window.location.href=e}redirectLater(e,r){return ps(this,void 0,void 0,function*(){yield new Promise(n=>{setTimeout(()=>{window.location.href=e,n(!0)},r)})})}logout(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_DISCONNECT_URL,callbackUrl:e?.callbackUrl});return yield this.redirect(r,e?.redirectDelayMilliseconds),!0})}signMessage(e,r){return ps(this,void 0,void 0,function*(){let n=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_SIGN_MESSAGE_URL,callbackUrl:r?.callbackUrl,params:{message:e.message.toString()}});return yield this.redirect(n),n})}getMessageSignatureFromWalletUrl(){var e,r;let n=window.location.search.slice(1);console.info("getMessageSignatureFromWalletUrl(), url:",n);let i=g_.default.parse(n);if((((e=i.status)===null||e===void 0?void 0:e.toString())||"")!=="signed")throw new y_.ErrCannotSignedMessage;return((r=i.signature)===null||r===void 0?void 0:r.toString())||""}guardTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_GUARD_TRANSACTION_URL,e,r)})}signTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_SIGN_TRANSACTION_URL,e,r)})}signTransaction(e,r){return ps(this,void 0,void 0,function*(){yield this.signTransactions([e],r)})}getTransactionsFromWalletUrl(){let e=g_.default.parse(window.location.search.slice(1));return t.isTxSignReturnSuccess(e)?this.getTxSignReturnValue(e):[]}static isTxSignReturnSuccess(e){return e.hasOwnProperty(gs.WALLET_PROVIDER_CALLBACK_PARAM)&&e[gs.WALLET_PROVIDER_CALLBACK_PARAM]===gs.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED}getTxSignReturnValue(e){console.info("getTxSignReturnValue(), urlParams:",e);let r=["nonce","value","receiver","sender","gasPrice","gasLimit","chainID","version","signature"];for(let s of r)if(!e[s]||!Array.isArray(e[s]))throw new y_.ErrCannotGetSignedTransactions;let n=e.nonce.length;for(let s of r)if(e[s].length!==n)throw new y_.ErrCannotGetSignedTransactions;let i=[];for(let s=0;s{let a=t.prepareWalletTransaction(o);for(let u in a)a.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(i[u]=[]),i[u].push(a[u])});let s=this.buildWalletUrl({endpoint:e,callbackUrl:n?.callbackUrl,params:i});window.location.href=s}};ys.WalletProvider=m_});var IM=A((cwe,bM)=>{"use strict";l();function tM(t,e){return function(){return t.apply(e,arguments)}}var{toString:Zre}=Object.prototype,{getPrototypeOf:N_}=Object,by=(t=>e=>{let r=Zre.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kn=t=>(t=t.toLowerCase(),e=>by(e)===t),Iy=t=>e=>typeof e===t,{isArray:Ou}=Array,of=Iy("undefined");function ene(t){return t!==null&&!of(t)&&t.constructor!==null&&!of(t.constructor)&&Qr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var rM=kn("ArrayBuffer");function tne(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rM(t.buffer),e}var rne=Iy("string"),Qr=Iy("function"),nM=Iy("number"),_y=t=>t!==null&&typeof t=="object",nne=t=>t===!0||t===!1,Ey=t=>{if(by(t)!=="object")return!1;let e=N_(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ine=kn("Date"),sne=kn("File"),one=kn("Blob"),ane=kn("FileList"),une=t=>_y(t)&&Qr(t.pipe),cne=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Qr(t.append)&&((e=by(t))==="formdata"||e==="object"&&Qr(t.toString)&&t.toString()==="[object FormData]"))},lne=kn("URLSearchParams"),fne=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function af(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Ou(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}var sM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oM=t=>!of(t)&&t!==sM;function b_(){let{caseless:t}=oM(this)&&this||{},e={},r=(n,i)=>{let s=t&&iM(e,i)||i;Ey(e[s])&&Ey(n)?e[s]=b_(e[s],n):Ey(n)?e[s]=b_({},n):Ou(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(af(e,(i,s)=>{r&&Qr(i)?t[s]=tM(i,r):t[s]=i},{allOwnKeys:n}),t),hne=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),pne=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gne=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&N_(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},yne=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},mne=t=>{if(!t)return null;if(Ou(t))return t;let e=t.length;if(!nM(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wne=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&N_(Uint8Array)),Ene=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},vne=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ane=kn("HTMLFormElement"),bne=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),jF=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ine=kn("RegExp"),aM=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};af(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_ne=t=>{aM(t,(e,r)=>{if(Qr(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Qr(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sne=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ou(t)?n(t):n(String(t).split(e)),r},Tne=()=>{},Cne=(t,e)=>(t=+t,Number.isFinite(t)?t:e),w_="abcdefghijklmnopqrstuvwxyz",QF="0123456789",uM={DIGIT:QF,ALPHA:w_,ALPHA_DIGIT:w_+w_.toUpperCase()+QF},xne=(t=16,e=uM.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Nne(t){return!!(t&&Qr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var One=t=>{let e=new Array(10),r=(n,i)=>{if(_y(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ou(n)?[]:{};return af(n,(o,a)=>{let u=r(o,i+1);!of(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Dne=kn("AsyncFunction"),Pne=t=>t&&(_y(t)||Qr(t))&&Qr(t.then)&&Qr(t.catch),Y={isArray:Ou,isArrayBuffer:rM,isBuffer:ene,isFormData:cne,isArrayBufferView:tne,isString:rne,isNumber:nM,isBoolean:nne,isObject:_y,isPlainObject:Ey,isUndefined:of,isDate:ine,isFile:sne,isBlob:one,isRegExp:Ine,isFunction:Qr,isStream:une,isURLSearchParams:lne,isTypedArray:wne,isFileList:ane,forEach:af,merge:b_,extend:dne,trim:fne,stripBOM:hne,inherits:pne,toFlatObject:gne,kindOf:by,kindOfTest:kn,endsWith:yne,toArray:mne,forEachEntry:Ene,matchAll:vne,isHTMLForm:Ane,hasOwnProperty:jF,hasOwnProp:jF,reduceDescriptors:aM,freezeMethods:_ne,toObjectSet:Sne,toCamelCase:bne,noop:Tne,toFiniteNumber:Cne,findKey:iM,global:sM,isContextDefined:oM,ALPHABET:uM,generateString:xne,isSpecCompliantForm:Nne,toJSONObject:One,isAsyncFn:Dne,isThenable:Pne};function Me(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Y.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var cM=Me.prototype,lM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{lM[t]={value:t}});Object.defineProperties(Me,lM);Object.defineProperty(cM,"isAxiosError",{value:!0});Me.from=(t,e,r,n,i,s)=>{let o=Object.create(cM);return Y.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Me.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Rne=null;function I_(t){return Y.isPlainObject(t)||Y.isArray(t)}function fM(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function zF(t,e,r){return t?t.concat(e).map(function(i,s){return i=fM(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Bne(t){return Y.isArray(t)&&!t.some(I_)}var Lne=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function Sy(t,e,r){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Y.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!Y.isUndefined(O[b])});let n=r.metaTokens,i=r.visitor||f,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(Y.isDate(y))return y.toISOString();if(!u&&Y.isBlob(y))throw new Me("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(y)||Y.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):h.Buffer.from(y):y}function f(y,b,O){let R=y;if(y&&!O&&typeof y=="object"){if(Y.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=JSON.stringify(y);else if(Y.isArray(y)&&Bne(y)||(Y.isFileList(y)||Y.endsWith(b,"[]"))&&(R=Y.toArray(y)))return b=fM(b),R.forEach(function(M,E){!(Y.isUndefined(M)||M===null)&&e.append(o===!0?zF([b],E,s):o===null?b:b+"[]",c(M))}),!1}return I_(y)?!0:(e.append(zF(O,b,s),c(y)),!1)}let d=[],g=Object.assign(Lne,{defaultVisitor:f,convertValue:c,isVisitable:I_});function m(y,b){if(!Y.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),Y.forEach(y,function(R,z){(!(Y.isUndefined(R)||R===null)&&i.call(e,R,Y.isString(z)?z.trim():z,b,g))===!0&&m(R,b?b.concat(z):[z])}),d.pop()}}if(!Y.isObject(t))throw new TypeError("data must be an object");return m(t),e}function WF(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function O_(t,e){this._pairs=[],t&&Sy(t,this,e)}var dM=O_.prototype;dM.append=function(e,r){this._pairs.push([e,r])};dM.toString=function(e){let r=e?function(n){return e.call(this,n,WF)}:WF;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Fne(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hM(t,e,r){if(!e)return t;let n=r&&r.encode||Fne,i=r&&r.serialize,s;if(i?s=i(e,r):s=Y.isURLSearchParams(e)?e.toString():new O_(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var __=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(n){n!==null&&e(n)})}},$F=__,pM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mne=typeof URLSearchParams<"u"?URLSearchParams:O_,Une=typeof FormData<"u"?FormData:null,qne=typeof Blob<"u"?Blob:null,Vne={isBrowser:!0,classes:{URLSearchParams:Mne,FormData:Une,Blob:qne},protocols:["http","https","file","blob","url","data"]},gM=typeof window<"u"&&typeof document<"u",Hne=(t=>gM&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),kne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gne=Object.freeze({__proto__:null,hasBrowserEnv:gM,hasStandardBrowserWebWorkerEnv:kne,hasStandardBrowserEnv:Hne}),Hn={...Gne,...Vne};function jne(t,e){return Sy(t,new Hn.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Hn.isNode&&Y.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Qne(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function zne(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n=r.length;return o=!o&&Y.isArray(i)?i.length:o,u?(Y.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&Y.isArray(i[o])&&(i[o]=zne(i[o])),!a)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){let r={};return Y.forEachEntry(t,(n,i)=>{e(Qne(n),i,r,0)}),r}return null}function Wne(t,e,r){if(Y.isString(t))try{return(e||JSON.parse)(t),Y.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var D_={transitional:pM,adapter:["xhr","http"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=Y.isObject(e);if(s&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return i&&i?JSON.stringify(yM(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jne(e,this.formSerializer).toString();if((a=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Sy(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),Wne(e)):e}],transformResponse:[function(e){let r=this.transitional||D_.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Y.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Me.from(a,Me.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],t=>{D_.headers[t]={}});var P_=D_,$ne=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kne=t=>{let e={},r,n,i;return t&&t.split(` +`+e.prev}function dy(t,e){var r=XI(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";l();var n_=ls(),Iu=iF(),cre=SF(),lre=n_("%TypeError%"),gy=n_("%WeakMap%",!0),yy=n_("%Map%",!0),fre=Iu("WeakMap.prototype.get",!0),dre=Iu("WeakMap.prototype.set",!0),hre=Iu("WeakMap.prototype.has",!0),pre=Iu("Map.prototype.get",!0),gre=Iu("Map.prototype.set",!0),yre=Iu("Map.prototype.has",!0),i_=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mre=function(t,e){var r=i_(t,e);return r&&r.value},wre=function(t,e,r){var n=i_(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Ere=function(t,e){return!!i_(t,e)};TF.exports=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new lre("Side channel does not contain "+cre(s))},get:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fre(e,s)}else if(yy){if(r)return pre(r,s)}else if(n)return mre(n,s)},has:function(s){if(gy&&s&&(typeof s=="object"||typeof s=="function")){if(e)return hre(e,s)}else if(yy){if(r)return yre(r,s)}else if(n)return Ere(n,s);return!1},set:function(s,o){gy&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new gy),dre(e,s,o)):yy?(r||(r=new yy),gre(r,s,o)):(n||(n={key:{},next:null}),wre(n,s,o))}};return i}});var my=A((Qme,xF)=>{"use strict";l();var vre=String.prototype.replace,Are=/%20/g,s_={RFC1738:"RFC1738",RFC3986:"RFC3986"};xF.exports={default:s_.RFC3986,formatters:{RFC1738:function(t){return vre.call(t,Are,"+")},RFC3986:function(t){return String(t)}},RFC1738:s_.RFC1738,RFC3986:s_.RFC3986}});var a_=A((Wme,OF)=>{"use strict";l();var bre=my(),o_=Object.prototype.hasOwnProperty,Eo=Array.isArray,Vn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ire=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Eo(n)){for(var i=[],s=0;s=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||s===bre.RFC1738&&(c===40||c===41)){a+=o.charAt(u);continue}if(c<128){a=a+Vn[c];continue}if(c<2048){a=a+(Vn[192|c>>6]+Vn[128|c&63]);continue}if(c<55296||c>=57344){a=a+(Vn[224|c>>12]+Vn[128|c>>6&63]+Vn[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|o.charCodeAt(u)&1023),a+=Vn[240|c>>18]+Vn[128|c>>12&63]+Vn[128|c>>6&63]+Vn[128|c&63]}return a},xre=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i{"use strict";l();var RF=CF(),c_=a_(),nf=my(),Rre=Object.prototype.hasOwnProperty,DF={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vo=Array.isArray,Bre=String.prototype.split,Lre=Array.prototype.push,BF=function(t,e){Lre.apply(t,vo(e)?e:[e])},Fre=Date.prototype.toISOString,PF=nf.default,$t={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:c_.encode,encodeValuesOnly:!1,format:PF,formatter:nf.formatters[PF],indices:!1,serializeDate:function(e){return Fre.call(e)},skipNulls:!1,strictNullHandling:!1},Mre=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},u_={},Ure=function t(e,r,n,i,s,o,a,u,c,f,d,g,m,y,b){for(var O=e,R=b,z=0,M=!1;(R=R.get(u_))!==void 0&&!M;){var E=R.get(e);if(z+=1,typeof E<"u"){if(E===z)throw new RangeError("Cyclic object value");M=!0}typeof R.get(u_)>"u"&&(z=0)}if(typeof a=="function"?O=a(r,O):O instanceof Date?O=f(O):n==="comma"&&vo(O)&&(O=c_.maybeMap(O,function(ie){return ie instanceof Date?f(ie):ie})),O===null){if(i)return o&&!m?o(r,$t.encoder,y,"key",d):r;O=""}if(Mre(O)||c_.isBuffer(O)){if(o){var S=m?r:o(r,$t.encoder,y,"key",d);if(n==="comma"&&m){for(var N=Bre.call(String(O),","),_="",T=0;T"u")return B;var X;if(n==="comma"&&vo(O))X=[{value:O.length>0?O.join(",")||null:void 0}];else if(vo(a))X=a;else{var Q=Object.keys(O);X=u?Q.sort(u):Q}for(var H=0;H"u"?$t.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:$t.charsetSentinel,delimiter:typeof e.delimiter>"u"?$t.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:$t.encode,encoder:typeof e.encoder=="function"?e.encoder:$t.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:$t.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:$t.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:$t.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:$t.strictNullHandling}};LF.exports=function(t,e){var r=t,n=qre(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vo(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in DF?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=DF[a];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=RF(),f=0;f0?m+g:""}});var qF=A((Jme,UF)=>{"use strict";l();var _u=a_(),l_=Object.prototype.hasOwnProperty,Vre=Array.isArray,jt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_u.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hre=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},MF=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},kre="utf8=%26%2310003%3B",Gre="utf8=%E2%9C%93",jre=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,u,c=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(y=Vre(y)?[y]:y),l_.call(n,m)?n[m]=_u.combine(n[m],y):n[m]=y}return n},Qre=function(t,e,r,n){for(var i=n?e:MF(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(o=[],o[c]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},zre=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),c=u?s.slice(0,u.index):s,f=[];if(c){if(!n.plainObjects&&l_.call(Object.prototype,c)&&!n.allowPrototypes)return;f.push(c)}for(var d=0;n.depth>0&&(u=a.exec(s))!==null&&d"u"?jt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?jt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:jt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:jt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:jt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:jt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:jt.comma,decoder:typeof e.decoder=="function"?e.decoder:jt.decoder,delimiter:typeof e.delimiter=="string"||_u.isRegExp(e.delimiter)?e.delimiter:jt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:jt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:jt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:jt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:jt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:jt.strictNullHandling}};UF.exports=function(t,e){var r=Wre(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?jre(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o{"use strict";l();var $re=FF(),Kre=qF(),Yre=my();VF.exports={formats:Yre,parse:Kre,stringify:$re}});var f_=A(Ge=>{"use strict";l();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED=Ge.WALLET_PROVIDER_CALLBACK_PARAM=Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL=Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL=Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL=Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL=Ge.WALLET_PROVIDER_DISCONNECT_URL=Ge.WALLET_PROVIDER_CONNECT_URL=Ge.XALIAS_PROVIDER_TESTNET=Ge.XALIAS_PROVIDER_DEVNET=Ge.XALIAS_PROVIDER_MAINNET=Ge.WALLET_PROVIDER_TESTNET=Ge.WALLET_PROVIDER_DEVNET=Ge.WALLET_PROVIDER_MAINNET=void 0;Ge.WALLET_PROVIDER_MAINNET="https://wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_DEVNET="https://devnet-wallet.multiversx.com/dapp/init";Ge.WALLET_PROVIDER_TESTNET="https://testnet-wallet.multiversx.com/dapp/init";Ge.XALIAS_PROVIDER_MAINNET="https://xalias.com";Ge.XALIAS_PROVIDER_DEVNET="https://devnet.xalias.com";Ge.XALIAS_PROVIDER_TESTNET="https://testnet.xalias.com";Ge.WALLET_PROVIDER_CONNECT_URL="hook/login";Ge.WALLET_PROVIDER_DISCONNECT_URL="hook/logout";Ge.WALLET_PROVIDER_SEND_TRANSACTION_URL="hook/transaction";Ge.WALLET_PROVIDER_SIGN_TRANSACTION_URL="hook/sign";Ge.WALLET_PROVIDER_GUARD_TRANSACTION_URL="hook/2fa";Ge.WALLET_PROVIDER_SIGN_MESSAGE_URL="hook/sign-message";Ge.WALLET_PROVIDER_CALLBACK_PARAM="walletProviderStatus";Ge.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED="transactionsSigned"});var kF=A(Su=>{"use strict";l();Object.defineProperty(Su,"__esModule",{value:!0});Su.ErrCannotSignedMessage=Su.ErrCannotGetSignedTransactions=void 0;var d_=class extends Error{constructor(){super("Cannot get signed transaction(s)")}};Su.ErrCannotGetSignedTransactions=d_;var h_=class extends Error{constructor(){super("Cannot get signed message")}};Su.ErrCannotSignedMessage=h_});var GF=A(wy=>{"use strict";l();Object.defineProperty(wy,"__esModule",{value:!0});wy.PlainSignedTransaction=void 0;var p_=class{constructor(e){this.nonce=0,this.value="",this.receiver="",this.sender="",this.gasPrice=0,this.gasLimit=0,this.data="",this.chainID="",this.version=0,this.signature="",Object.assign(this,e)}};wy.PlainSignedTransaction=p_});var Tu=A(ys=>{"use strict";l();var ps=ys&&ys.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})},Jre=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.WalletProvider=void 0;var g_=Jre(HF()),gs=f_(),y_=kF(),Xre=GF(),m_=class t{constructor(e){this.walletUrl=e}login(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_CONNECT_URL,callbackUrl:e?.callbackUrl,params:{token:e?.token}});return yield this.redirect(r,e?.redirectDelayMilliseconds),r})}redirect(e,r){return ps(this,void 0,void 0,function*(){r?yield this.redirectLater(e,r):this.redirectImmediately(e)})}redirectImmediately(e){window.location.href=e}redirectLater(e,r){return ps(this,void 0,void 0,function*(){yield new Promise(n=>{setTimeout(()=>{window.location.href=e,n(!0)},r)})})}logout(e){return ps(this,void 0,void 0,function*(){let r=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_DISCONNECT_URL,callbackUrl:e?.callbackUrl});return yield this.redirect(r,e?.redirectDelayMilliseconds),!0})}signMessage(e,r){return ps(this,void 0,void 0,function*(){let n=this.buildWalletUrl({endpoint:gs.WALLET_PROVIDER_SIGN_MESSAGE_URL,callbackUrl:r?.callbackUrl,params:{message:e.message.toString()}});return yield this.redirect(n),n})}getMessageSignatureFromWalletUrl(){var e,r;let n=window.location.search.slice(1);console.info("getMessageSignatureFromWalletUrl(), url:",n);let i=g_.default.parse(n);if((((e=i.status)===null||e===void 0?void 0:e.toString())||"")!=="signed")throw new y_.ErrCannotSignedMessage;return((r=i.signature)===null||r===void 0?void 0:r.toString())||""}guardTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_GUARD_TRANSACTION_URL,e,r)})}signTransactions(e,r){return ps(this,void 0,void 0,function*(){this.redirectTransactionsToEndpoint(gs.WALLET_PROVIDER_SIGN_TRANSACTION_URL,e,r)})}signTransaction(e,r){return ps(this,void 0,void 0,function*(){yield this.signTransactions([e],r)})}getTransactionsFromWalletUrl(){let e=g_.default.parse(window.location.search.slice(1));return t.isTxSignReturnSuccess(e)?this.getTxSignReturnValue(e):[]}static isTxSignReturnSuccess(e){return e.hasOwnProperty(gs.WALLET_PROVIDER_CALLBACK_PARAM)&&e[gs.WALLET_PROVIDER_CALLBACK_PARAM]===gs.WALLET_PROVIDER_CALLBACK_PARAM_TX_SIGNED}getTxSignReturnValue(e){console.info("getTxSignReturnValue(), urlParams:",e);let r=["nonce","value","receiver","sender","gasPrice","gasLimit","chainID","version","signature"];for(let s of r)if(!e[s]||!Array.isArray(e[s]))throw new y_.ErrCannotGetSignedTransactions;let n=e.nonce.length;for(let s of r)if(e[s].length!==n)throw new y_.ErrCannotGetSignedTransactions;let i=[];for(let s=0;s{let a=t.prepareWalletTransaction(o);for(let u in a)a.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(i[u]=[]),i[u].push(a[u])});let s=this.buildWalletUrl({endpoint:e,callbackUrl:n?.callbackUrl,params:i});window.location.href=s}};ys.WalletProvider=m_});var IM=A((cwe,bM)=>{"use strict";l();function tM(t,e){return function(){return t.apply(e,arguments)}}var{toString:Zre}=Object.prototype,{getPrototypeOf:N_}=Object,by=(t=>e=>{let r=Zre.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),kn=t=>(t=t.toLowerCase(),e=>by(e)===t),Iy=t=>e=>typeof e===t,{isArray:Ou}=Array,of=Iy("undefined");function ene(t){return t!==null&&!of(t)&&t.constructor!==null&&!of(t.constructor)&&Qr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var rM=kn("ArrayBuffer");function tne(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rM(t.buffer),e}var rne=Iy("string"),Qr=Iy("function"),nM=Iy("number"),_y=t=>t!==null&&typeof t=="object",nne=t=>t===!0||t===!1,Ey=t=>{if(by(t)!=="object")return!1;let e=N_(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},ine=kn("Date"),sne=kn("File"),one=kn("Blob"),ane=kn("FileList"),une=t=>_y(t)&&Qr(t.pipe),cne=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Qr(t.append)&&((e=by(t))==="formdata"||e==="object"&&Qr(t.toString)&&t.toString()==="[object FormData]"))},lne=kn("URLSearchParams"),fne=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function af(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Ou(t))for(n=0,i=t.length;n0;)if(i=r[n],e===i.toLowerCase())return i;return null}var sM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oM=t=>!of(t)&&t!==sM;function b_(){let{caseless:t}=oM(this)&&this||{},e={},r=(n,i)=>{let s=t&&iM(e,i)||i;Ey(e[s])&&Ey(n)?e[s]=b_(e[s],n):Ey(n)?e[s]=b_({},n):Ou(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(af(e,(i,s)=>{r&&Qr(i)?t[s]=tM(i,r):t[s]=i},{allOwnKeys:n}),t),hne=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),pne=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gne=(t,e,r,n)=>{let i,s,o,a={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&N_(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},yne=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},mne=t=>{if(!t)return null;if(Ou(t))return t;let e=t.length;if(!nM(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},wne=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&N_(Uint8Array)),Ene=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let s=i.value;e.call(t,s[0],s[1])}},vne=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Ane=kn("HTMLFormElement"),bne=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),jF=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ine=kn("RegExp"),aM=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};af(r,(i,s)=>{let o;(o=e(i,s,t))!==!1&&(n[s]=o||i)}),Object.defineProperties(t,n)},_ne=t=>{aM(t,(e,r)=>{if(Qr(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=t[r];if(Qr(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sne=(t,e)=>{let r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Ou(t)?n(t):n(String(t).split(e)),r},Tne=()=>{},Cne=(t,e)=>(t=+t,Number.isFinite(t)?t:e),w_="abcdefghijklmnopqrstuvwxyz",QF="0123456789",uM={DIGIT:QF,ALPHA:w_,ALPHA_DIGIT:w_+w_.toUpperCase()+QF},xne=(t=16,e=uM.ALPHA_DIGIT)=>{let r="",{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r};function Nne(t){return!!(t&&Qr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}var One=t=>{let e=new Array(10),r=(n,i)=>{if(_y(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;let s=Ou(n)?[]:{};return af(n,(o,a)=>{let u=r(o,i+1);!of(u)&&(s[a]=u)}),e[i]=void 0,s}}return n};return r(t,0)},Dne=kn("AsyncFunction"),Pne=t=>t&&(_y(t)||Qr(t))&&Qr(t.then)&&Qr(t.catch),Y={isArray:Ou,isArrayBuffer:rM,isBuffer:ene,isFormData:cne,isArrayBufferView:tne,isString:rne,isNumber:nM,isBoolean:nne,isObject:_y,isPlainObject:Ey,isUndefined:of,isDate:ine,isFile:sne,isBlob:one,isRegExp:Ine,isFunction:Qr,isStream:une,isURLSearchParams:lne,isTypedArray:wne,isFileList:ane,forEach:af,merge:b_,extend:dne,trim:fne,stripBOM:hne,inherits:pne,toFlatObject:gne,kindOf:by,kindOfTest:kn,endsWith:yne,toArray:mne,forEachEntry:Ene,matchAll:vne,isHTMLForm:Ane,hasOwnProperty:jF,hasOwnProp:jF,reduceDescriptors:aM,freezeMethods:_ne,toObjectSet:Sne,toCamelCase:bne,noop:Tne,toFiniteNumber:Cne,findKey:iM,global:sM,isContextDefined:oM,ALPHABET:uM,generateString:xne,isSpecCompliantForm:Nne,toJSONObject:One,isAsyncFn:Dne,isThenable:Pne};function Me(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Y.inherits(Me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var cM=Me.prototype,lM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{lM[t]={value:t}});Object.defineProperties(Me,lM);Object.defineProperty(cM,"isAxiosError",{value:!0});Me.from=(t,e,r,n,i,s)=>{let o=Object.create(cM);return Y.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Me.call(o,t.message,e,r,n,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};var Rne=null;function I_(t){return Y.isPlainObject(t)||Y.isArray(t)}function fM(t){return Y.endsWith(t,"[]")?t.slice(0,-2):t}function zF(t,e,r){return t?t.concat(e).map(function(i,s){return i=fM(i),!r&&s?"["+i+"]":i}).join(r?".":""):e}function Bne(t){return Y.isArray(t)&&!t.some(I_)}var Lne=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function Sy(t,e,r){if(!Y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=Y.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!Y.isUndefined(O[b])});let n=r.metaTokens,i=r.visitor||f,s=r.dots,o=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(Y.isDate(y))return y.toISOString();if(!u&&Y.isBlob(y))throw new Me("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(y)||Y.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):h.Buffer.from(y):y}function f(y,b,O){let R=y;if(y&&!O&&typeof y=="object"){if(Y.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=JSON.stringify(y);else if(Y.isArray(y)&&Bne(y)||(Y.isFileList(y)||Y.endsWith(b,"[]"))&&(R=Y.toArray(y)))return b=fM(b),R.forEach(function(M,E){!(Y.isUndefined(M)||M===null)&&e.append(o===!0?zF([b],E,s):o===null?b:b+"[]",c(M))}),!1}return I_(y)?!0:(e.append(zF(O,b,s),c(y)),!1)}let d=[],g=Object.assign(Lne,{defaultVisitor:f,convertValue:c,isVisitable:I_});function m(y,b){if(!Y.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(y),Y.forEach(y,function(R,z){(!(Y.isUndefined(R)||R===null)&&i.call(e,R,Y.isString(z)?z.trim():z,b,g))===!0&&m(R,b?b.concat(z):[z])}),d.pop()}}if(!Y.isObject(t))throw new TypeError("data must be an object");return m(t),e}function WF(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function O_(t,e){this._pairs=[],t&&Sy(t,this,e)}var dM=O_.prototype;dM.append=function(e,r){this._pairs.push([e,r])};dM.toString=function(e){let r=e?function(n){return e.call(this,n,WF)}:WF;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Fne(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hM(t,e,r){if(!e)return t;let n=r&&r.encode||Fne,i=r&&r.serialize,s;if(i?s=i(e,r):s=Y.isURLSearchParams(e)?e.toString():new O_(e,r).toString(n),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var __=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(n){n!==null&&e(n)})}},$F=__,pM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mne=typeof URLSearchParams<"u"?URLSearchParams:O_,Une=typeof FormData<"u"?FormData:null,qne=typeof Blob<"u"?Blob:null,Vne={isBrowser:!0,classes:{URLSearchParams:Mne,FormData:Une,Blob:qne},protocols:["http","https","file","blob","url","data"]},gM=typeof window<"u"&&typeof document<"u",Hne=(t=>gM&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),kne=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gne=Object.freeze({__proto__:null,hasBrowserEnv:gM,hasStandardBrowserWebWorkerEnv:kne,hasStandardBrowserEnv:Hne}),Hn={...Gne,...Vne};function jne(t,e){return Sy(t,new Hn.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Hn.isNode&&Y.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Qne(t){return Y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function zne(t){let e={},r=Object.keys(t),n,i=r.length,s;for(n=0;n=r.length;return o=!o&&Y.isArray(i)?i.length:o,u?(Y.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),e(r,n,i[o],s)&&Y.isArray(i[o])&&(i[o]=zne(i[o])),!a)}if(Y.isFormData(t)&&Y.isFunction(t.entries)){let r={};return Y.forEachEntry(t,(n,i)=>{e(Qne(n),i,r,0)}),r}return null}function Wne(t,e,r){if(Y.isString(t))try{return(e||JSON.parse)(t),Y.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var D_={transitional:pM,adapter:["xhr","http"],transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=Y.isObject(e);if(s&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return i?JSON.stringify(yM(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jne(e,this.formSerializer).toString();if((a=Y.isFileList(e))||n.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Sy(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),Wne(e)):e}],transformResponse:[function(e){let r=this.transitional||D_.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&Y.isString(e)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?Me.from(a,Me.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hn.classes.FormData,Blob:Hn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],t=>{D_.headers[t]={}});var P_=D_,$ne=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kne=t=>{let e={},r,n,i;return t&&t.split(` `).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||e[r]&&$ne[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},KF=Symbol("internals");function sf(t){return t&&String(t).trim().toLowerCase()}function vy(t){return t===!1||t==null?t:Y.isArray(t)?t.map(vy):String(t)}function Yne(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}var Jne=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function E_(t,e,r,n,i){if(Y.isFunction(n))return n.call(this,e,r);if(i&&(e=r),!!Y.isString(e)){if(Y.isString(n))return e.indexOf(n)!==-1;if(Y.isRegExp(n))return n.test(e)}}function Xne(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Zne(t,e){let r=Y.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}var Cu=class{constructor(e){e&&this.set(e)}set(e,r,n){let i=this;function s(a,u,c){let f=sf(u);if(!f)throw new Error("header name must be a non-empty string");let d=Y.findKey(i,f);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||u]=vy(a))}let o=(a,u)=>Y.forEach(a,(c,f)=>s(c,f,u));return Y.isPlainObject(e)||e instanceof this.constructor?o(e,r):Y.isString(e)&&(e=e.trim())&&!Jne(e)?o(Kne(e),r):e!=null&&s(r,e,n),this}get(e,r){if(e=sf(e),e){let n=Y.findKey(this,e);if(n){let i=this[n];if(!r)return i;if(r===!0)return Yne(i);if(Y.isFunction(r))return r.call(this,i,n);if(Y.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=sf(e),e){let n=Y.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||E_(this,this[n],n,r)))}return!1}delete(e,r){let n=this,i=!1;function s(o){if(o=sf(o),o){let a=Y.findKey(n,o);a&&(!r||E_(n,n[a],a,r))&&(delete n[a],i=!0)}}return Y.isArray(e)?e.forEach(s):s(e),i}clear(e){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let s=r[n];(!e||E_(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){let r=this,n={};return Y.forEach(this,(i,s)=>{let o=Y.findKey(n,s);if(o){r[o]=vy(i),delete r[s];return}let a=e?Xne(s):String(s).trim();a!==s&&delete r[s],r[a]=vy(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return Y.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=e&&Y.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){let n=new this(e);return r.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[KF]=this[KF]={accessors:{}}).accessors,i=this.prototype;function s(o){let a=sf(o);n[a]||(Zne(i,o),n[a]=!0)}return Y.isArray(e)?e.forEach(s):s(e),this}};Cu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Cu.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}});Y.freezeMethods(Cu);var yi=Cu;function v_(t,e){let r=this||P_,n=e||r,i=yi.from(n.headers),s=n.data;return Y.forEach(t,function(a){s=a.call(r,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function mM(t){return!!(t&&t.__CANCEL__)}function uf(t,e,r){Me.call(this,t??"canceled",Me.ERR_CANCELED,e,r),this.name="CanceledError"}Y.inherits(uf,Me,{__CANCEL__:!0});function eie(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new Me("Request failed with status code "+r.status,[Me.ERR_BAD_REQUEST,Me.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var tie=Hn.hasStandardBrowserEnv?{write(t,e,r,n,i,s){let o=[t+"="+encodeURIComponent(e)];Y.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Y.isString(n)&&o.push("path="+n),Y.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function rie(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function nie(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wM(t,e){return t&&!rie(e)?nie(t,e):e}var iie=Hn.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(s){let o=s;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(o){let a=Y.isString(o)?i(o):o;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function sie(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function oie(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,s=0,o;return e=e!==void 0?e:1e3,function(u){let c=Date.now(),f=n[s];o||(o=c),r[i]=u,n[i]=c;let d=s,g=0;for(;d!==i;)g+=r[d++],d=d%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o{let s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-r,u=n(a),c=s<=o;r=s;let f={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:u||void 0,estimated:u&&o&&c?(o-s)/u:void 0,event:i};f[e?"download":"upload"]=!0,t(f)}}var aie=typeof XMLHttpRequest<"u",uie=aie&&function(t){return new Promise(function(r,n){let i=t.data,s=yi.from(t.headers).normalize(),{responseType:o,withXSRFToken:a}=t,u;function c(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}let f;if(Y.isFormData(i)){if(Hn.hasStandardBrowserEnv||Hn.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((f=s.getContentType())!==!1){let[b,...O]=f?f.split(";").map(R=>R.trim()).filter(Boolean):[];s.setContentType([b||"multipart/form-data",...O].join("; "))}}let d=new XMLHttpRequest;if(t.auth){let b=t.auth.username||"",O=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(b+":"+O))}let g=wM(t.baseURL,t.url);d.open(t.method.toUpperCase(),hM(g,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function m(){if(!d)return;let b=yi.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),R={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:b,config:t,request:d};eie(function(M){r(M),c()},function(M){n(M),c()},R),d=null}if("onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(m)},d.onabort=function(){d&&(n(new Me("Request aborted",Me.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new Me("Network Error",Me.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let O=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",R=t.transitional||pM;t.timeoutErrorMessage&&(O=t.timeoutErrorMessage),n(new Me(O,R.clarifyTimeoutError?Me.ETIMEDOUT:Me.ECONNABORTED,t,d)),d=null},Hn.hasStandardBrowserEnv&&(a&&Y.isFunction(a)&&(a=a(t)),a||a!==!1&&iie(g))){let b=t.xsrfHeaderName&&t.xsrfCookieName&&tie.read(t.xsrfCookieName);b&&s.set(t.xsrfHeaderName,b)}i===void 0&&s.setContentType(null),"setRequestHeader"in d&&Y.forEach(s.toJSON(),function(O,R){d.setRequestHeader(R,O)}),Y.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),o&&o!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",YF(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",YF(t.onUploadProgress)),(t.cancelToken||t.signal)&&(u=b=>{d&&(n(!b||b.type?new uf(null,t,d):b),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u)));let y=sie(g);if(y&&Hn.protocols.indexOf(y)===-1){n(new Me("Unsupported protocol "+y+":",Me.ERR_BAD_REQUEST,t));return}d.send(i||null)})},S_={http:Rne,xhr:uie};Y.forEach(S_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var JF=t=>`- ${t}`,cie=t=>Y.isFunction(t)||t===null||t===!1,EM={getAdapter:t=>{t=Y.isArray(t)?t:[t];let{length:e}=t,r,n,i={};for(let s=0;s`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build")),o=e?s.length>1?`since : `+s.map(JF).join(` -`):" "+JF(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:S_};function A_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new uf(null,t)}function XF(t){return A_(t),t.headers=yi.from(t.headers),t.data=v_.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),EM.getAdapter(t.adapter||P_.adapter)(t).then(function(n){return A_(t),n.data=v_.call(t,t.transformResponse,n),n.headers=yi.from(n.headers),n},function(n){return mM(n)||(A_(t),n&&n.response&&(n.response.data=v_.call(t,t.transformResponse,n.response),n.response.headers=yi.from(n.response.headers))),Promise.reject(n)})}var ZF=t=>t instanceof yi?t.toJSON():t;function xu(t,e){e=e||{};let r={};function n(c,f,d){return Y.isPlainObject(c)&&Y.isPlainObject(f)?Y.merge.call({caseless:d},c,f):Y.isPlainObject(f)?Y.merge({},f):Y.isArray(f)?f.slice():f}function i(c,f,d){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c,d)}else return n(c,f,d)}function s(c,f){if(!Y.isUndefined(f))return n(void 0,f)}function o(c,f){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}function a(c,f,d){if(d in e)return n(c,f);if(d in t)return n(void 0,c)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>i(ZF(c),ZF(f),!0)};return Y.forEach(Object.keys(Object.assign({},t,e)),function(f){let d=u[f]||i,g=d(t[f],e[f],f);Y.isUndefined(g)&&d!==a||(r[f]=g)}),r}var vM="1.6.5",R_={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{R_[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var eM={};R_.transitional=function(e,r,n){function i(s,o){return"[Axios v"+vM+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new Me(i(o," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!eM[o]&&(eM[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function lie(t,e,r){if(typeof t!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let s=n[i],o=e[s];if(o){let a=t[s],u=a===void 0||o(a,s,t);if(u!==!0)throw new Me("option "+s+" must be "+u,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}var T_={assertOptions:lie,validators:R_},ms=T_.validators,Nu=class{constructor(e){this.defaults=e,this.interceptors={request:new $F,response:new $F}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=xu(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&T_.assertOptions(n,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),i!=null&&(Y.isFunction(i)?r.paramsSerializer={serialize:i}:T_.assertOptions(i,{encode:ms.function,serialize:ms.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Y.merge(s.common,s[r.method]);s&&Y.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),r.headers=yi.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});let c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,d=0,g;if(!u){let y=[XF.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,f=Promise.resolve(r);d{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new uf(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},fie=C_;function die(t){return function(r){return t.apply(null,r)}}function hie(t){return Y.isObject(t)&&t.isAxiosError===!0}var x_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(x_).forEach(([t,e])=>{x_[e]=t});var pie=x_;function AM(t){let e=new Ay(t),r=tM(Ay.prototype.request,e);return Y.extend(r,Ay.prototype,e,{allOwnKeys:!0}),Y.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return AM(xu(t,i))},r}var Rt=AM(P_);Rt.Axios=Ay;Rt.CanceledError=uf;Rt.CancelToken=fie;Rt.isCancel=mM;Rt.VERSION=vM;Rt.toFormData=Sy;Rt.AxiosError=Me;Rt.Cancel=Rt.CanceledError;Rt.all=function(e){return Promise.all(e)};Rt.spread=die;Rt.isAxiosError=hie;Rt.mergeConfig=xu;Rt.AxiosHeaders=yi;Rt.formToJSON=t=>yM(Y.isHTMLForm(t)?new FormData(t):t);Rt.getAdapter=EM.getAdapter;Rt.HttpStatusCode=pie;Rt.default=Rt;bM.exports=Rt});var _M=A(Ty=>{"use strict";l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.NativeAuthClientConfig=void 0;var B_=class{constructor(){this.origin=typeof window<"u"&&typeof window.location<"u"?window.location.hostname:"",this.apiUrl="https://api.multiversx.com",this.expirySeconds=60*60*24}};Ty.NativeAuthClientConfig=B_});var F_=A(Du=>{"use strict";l();var Ao=Du&&Du.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Du,"__esModule",{value:!0});Du.NativeAuthClient=void 0;var gie=IM(),yie=_M(),L_=class{constructor(e){this.config=Object.assign(new yie.NativeAuthClientConfig,e)}getToken(e,r,n){let i=this.encodeValue(e),s=this.encodeValue(r);return`${i}.${s}.${n}`}initialize(e={}){return Ao(this,void 0,void 0,function*(){let r=yield this.getCurrentBlockHash(),n=this.encodeValue(JSON.stringify(e));return`${this.encodeValue(this.config.origin)}.${r}.${this.config.expirySeconds}.${n}`})}getCurrentBlockHash(){return Ao(this,void 0,void 0,function*(){return this.config.gatewayUrl?yield this.getCurrentBlockHashWithGateway():yield this.getCurrentBlockHashWithApi()})}getCurrentBlockHashWithGateway(){return Ao(this,void 0,void 0,function*(){let e=yield this.getCurrentRound(),r=`${this.config.gatewayUrl}/blocks/by-round/${e}`;return(yield this.get(r)).data.data.blocks.filter(o=>o.shard===this.config.blockHashShard)[0].hash})}getCurrentRound(){return Ao(this,void 0,void 0,function*(){if(!this.config.gatewayUrl)throw new Error("Gateway URL not set");if(!this.config.blockHashShard)throw new Error("Blockhash shard not set");let e=`${this.config.gatewayUrl}/network/status/${this.config.blockHashShard}`;return(yield this.get(e)).data.data.status.erd_current_round})}getCurrentBlockHashWithApi(){return Ao(this,void 0,void 0,function*(){try{let e=`${this.config.apiUrl}/blocks/latest?ttl=${this.config.expirySeconds}&fields=hash`,r=yield this.get(e);if(r.data[0].hash!==void 0)return r.data[0].hash}catch{}return this.getCurrentBlockHashWithApiFallback()})}getCurrentBlockHashWithApiFallback(){return Ao(this,void 0,void 0,function*(){let e=`${this.config.apiUrl}/blocks?size=1&fields=hash`;return this.config.blockHashShard!==void 0&&(e+=`&shard=${this.config.blockHashShard}`),(yield this.get(e)).data[0].hash})}encodeValue(e){return this.escape(h.Buffer.from(e,"utf8").toString("base64"))}escape(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}get(e){return Ao(this,void 0,void 0,function*(){return yield gie.default.get(e,{headers:this.config.extraRequestHeaders})})}};Du.NativeAuthClient=L_});var OM=A(Ny=>{"use strict";l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.TransactionStatus=void 0;var U_=class t{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new t("unknown")}isPending(){return this.status=="received"||this.status=="pending"}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return this.status=="executed"||this.status=="success"||this.status=="successful"}isFailed(){return this.status=="fail"||this.status=="failed"||this.status=="unsuccessful"||this.isInvalid()}isInvalid(){return this.status=="invalid"}toString(){return this.status}valueOf(){return this.status}equals(e){return e?this.status==e.status:!1}};Ny.TransactionStatus=U_});var PM=A(Oy=>{"use strict";l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.TransactionReceipt=void 0;var DM=Ta(),q_=class t{constructor(){this.value="",this.sender=new DM.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let r=new t;return r.value=(e.value||0).toString(),r.sender=new DM.Address(e.sender),r.data=e.data,r.hash=e.txHash,r}};Oy.TransactionReceipt=q_});var RM=A(Gn=>{"use strict";l();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ErrContractQuery=Gn.ErrNetworkProvider=Gn.ErrUnexpectedCondition=Gn.Err=void 0;var Bu=class extends Error{constructor(e,r){super(e),this.inner=void 0,this.inner=r}};Gn.Err=Bu;var V_=class extends Bu{constructor(e){super(`Unexpected condition: [${e}]`)}};Gn.ErrUnexpectedCondition=V_;var H_=class extends Bu{constructor(e,r,n){let i=`Request error on url [${e}]: [${r}]`;super(i,n)}};Gn.ErrNetworkProvider=H_;var k_=class extends Bu{constructor(e){super(e.message.replace("executeQuery:",""))}};Gn.ErrContractQuery=k_});var LM=A(ws=>{"use strict";l();Object.defineProperty(ws,"__esModule",{value:!0});ws.TransactionEventTopic=ws.TransactionEventData=ws.TransactionEvent=void 0;var BM=Ta(),G_=class t{constructor(e){this.address=new BM.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new Lu(h.Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new BM.Address(e.address),r.identifier=e.identifier||"",r.topics=(e.topics||[]).map(n=>new Dy(n)),r.dataPayload=Lu.fromBase64(e.data),r.additionalData=(e.additionalData||[]).map(Lu.fromBase64),r.data=r.dataPayload.toString(),r}findFirstOrNoneTopic(e){return this.topics.filter(r=>e(r))[0]}getLastTopic(){return this.topics[this.topics.length-1]}};ws.TransactionEvent=G_;var Lu=class t{constructor(e){this.raw=e}static fromBase64(e){return new t(h.Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventData=Lu;var Dy=class{constructor(e){this.raw=h.Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventTopic=Dy});var Q_=A(Py=>{"use strict";l();Object.defineProperty(Py,"__esModule",{value:!0});Py.TransactionLogs=void 0;var Eie=RM(),FM=Ta(),vie=LM(),j_=class t{constructor(e){this.address=new FM.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new FM.Address(e.address),r.events=(e.events||[]).map(n=>vie.TransactionEvent.fromHttpResponse(n)),r}findSingleOrNoneEvent(e,r){let n=this.findEvents(e,r);if(n.length>1)throw new Eie.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,r){return this.findEvents(e,r)[0]}findEvents(e,r){let n=this.events.filter(i=>i.identifier==e);return r&&(n=n.filter(i=>r(i))),n}};Py.TransactionLogs=j_});var UM=A(Fu=>{"use strict";l();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ContractResultItem=Fu.ContractResults=void 0;var MM=Q_(),Ry=Ta(),z_=class t{constructor(e){this.items=e,this.items.sort(function(r,n){return r.nonce.valueOf()-n.nonce.valueOf()})}static fromProxyHttpResponse(e){let r=e.map(n=>cf.fromProxyHttpResponse(n));return new t(r)}static fromApiHttpResponse(e){let r=e.map(n=>cf.fromApiHttpResponse(n));return new t(r)}};Fu.ContractResults=z_;var cf=class t{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new Ry.Address(""),this.sender=new Ry.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new MM.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return t.fromHttpResponse(e)}static fromApiHttpResponse(e){let r=t.fromHttpResponse(e);return r.data=h.Buffer.from(r.data,"base64").toString(),r.callType=Number(r.callType),r}static fromHttpResponse(e){let r=new t;return r.hash=e.hash,r.nonce=Number(e.nonce||0),r.value=(e.value||0).toString(),r.receiver=new Ry.Address(e.receiver),r.sender=new Ry.Address(e.sender),r.previousHash=e.prevTxHash,r.originalHash=e.originalTxHash,r.gasLimit=Number(e.gasLimit||0),r.gasPrice=Number(e.gasPrice||0),r.data=e.data||"",r.callType=e.callType,r.returnMessage=e.returnMessage,r.logs=MM.TransactionLogs.fromHttpResponse(e.logs||{}),r}};Fu.ContractResultItem=cf});var qM=A(By=>{"use strict";l();Object.defineProperty(By,"__esModule",{value:!0});By.ContractQueryRequest=void 0;var W_=class{constructor(e){this.query=e}toHttpRequest(){var e;let r={},n=this.query;return r.scAddress=n.address.bech32(),r.caller=!((e=n.caller)===null||e===void 0)&&e.bech32()?n.caller.bech32():void 0,r.funcName=n.func.toString(),r.value=n.value?n.value.toString():void 0,r.args=n.getEncodedArguments(),r}};By.ContractQueryRequest=W_});var KM=A((pEe,$M)=>{l();$M.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Es=A(bo=>{l();var $_,Aie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];bo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};bo.getSymbolTotalCodewords=function(e){return Aie[e]};bo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};bo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');$_=e};bo.isKanjiModeEnabled=function(){return typeof $_<"u"};bo.toSJIS=function(e){return $_(e)}});var My=A(zr=>{l();zr.L={bit:1};zr.M={bit:0};zr.Q={bit:3};zr.H={bit:2};function bie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return zr.L;case"m":case"medium":return zr.M;case"q":case"quartile":return zr.Q;case"h":case"high":return zr.H;default:throw new Error("Unknown EC Level: "+t)}}zr.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};zr.from=function(e,r){if(zr.isValid(e))return e;try{return bie(e)}catch{return r}}});var XM=A((vEe,JM)=>{l();function YM(){this.buffer=[],this.length=0}YM.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};JM.exports=YM});var eU=A((bEe,ZM)=>{l();function lf(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}lf.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};lf.prototype.get=function(t,e){return this.data[t*this.size+e]};lf.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};lf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};ZM.exports=lf});var tU=A(Uy=>{l();var Iie=Es().getSymbolSize;Uy.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=Iie(e),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,s=[n-7];for(let o=1;o{l();var _ie=Es().getSymbolSize,rU=7;nU.getPositions=function(e){let r=_ie(e);return[[0,0],[r-rU,0],[0,r-rU]]}});var sU=A(nt=>{l();nt.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Io={N1:3,N2:3,N3:40,N4:10};nt.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};nt.from=function(e){return nt.isValid(e)?parseInt(e,10):void 0};nt.getPenaltyN1=function(e){let r=e.size,n=0,i=0,s=0,o=null,a=null;for(let u=0;u=5&&(n+=Io.N1+(i-5)),o=f,i=1),f=e.get(c,u),f===a?s++:(s>=5&&(n+=Io.N1+(s-5)),a=f,s=1)}i>=5&&(n+=Io.N1+(i-5)),s>=5&&(n+=Io.N1+(s-5))}return n};nt.getPenaltyN2=function(e){let r=e.size,n=0;for(let i=0;i=10&&(i===1488||i===93)&&n++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&n++}return n*Io.N3};nt.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let s=0;s{l();var vs=My(),qy=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Vy=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];K_.getBlocksCount=function(e,r){switch(r){case vs.L:return qy[(e-1)*4+0];case vs.M:return qy[(e-1)*4+1];case vs.Q:return qy[(e-1)*4+2];case vs.H:return qy[(e-1)*4+3];default:return}};K_.getTotalCodewordsCount=function(e,r){switch(r){case vs.L:return Vy[(e-1)*4+0];case vs.M:return Vy[(e-1)*4+1];case vs.Q:return Vy[(e-1)*4+2];case vs.H:return Vy[(e-1)*4+3];default:return}}});var oU=A(ky=>{l();var ff=new Uint8Array(512),Hy=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ff[r]=e,Hy[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ff[r]=ff[r-255]})();ky.log=function(e){if(e<1)throw new Error("log("+e+")");return Hy[e]};ky.exp=function(e){return ff[e]};ky.mul=function(e,r){return e===0||r===0?0:ff[Hy[e]+Hy[r]]}});var aU=A(df=>{l();var J_=oU();df.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let i=0;i=0;){let i=n[0];for(let o=0;o{l();var uU=aU();function X_(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}X_.prototype.initialize=function(e){this.degree=e,this.genPoly=uU.generateECPolynomial(this.degree)};X_.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=uU.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let s=new Uint8Array(this.degree);return s.set(n,i),s}return n};cU.exports=X_});var Z_=A(fU=>{l();fU.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var eS=A(wi=>{l();var dU="[0-9]+",Tie="[A-Z $%*+\\-./:]+",hf="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";hf=hf.replace(/u/g,"\\u");var Cie="(?:(?![A-Z0-9 $%*+\\-./:]|"+hf+`)(?:.|[\r +`):" "+JF(s[0]):"as no adapter specified";throw new Me("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:S_};function A_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new uf(null,t)}function XF(t){return A_(t),t.headers=yi.from(t.headers),t.data=v_.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),EM.getAdapter(t.adapter||P_.adapter)(t).then(function(n){return A_(t),n.data=v_.call(t,t.transformResponse,n),n.headers=yi.from(n.headers),n},function(n){return mM(n)||(A_(t),n&&n.response&&(n.response.data=v_.call(t,t.transformResponse,n.response),n.response.headers=yi.from(n.response.headers))),Promise.reject(n)})}var ZF=t=>t instanceof yi?t.toJSON():t;function xu(t,e){e=e||{};let r={};function n(c,f,d){return Y.isPlainObject(c)&&Y.isPlainObject(f)?Y.merge.call({caseless:d},c,f):Y.isPlainObject(f)?Y.merge({},f):Y.isArray(f)?f.slice():f}function i(c,f,d){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c,d)}else return n(c,f,d)}function s(c,f){if(!Y.isUndefined(f))return n(void 0,f)}function o(c,f){if(Y.isUndefined(f)){if(!Y.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}function a(c,f,d){if(d in e)return n(c,f);if(d in t)return n(void 0,c)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,f)=>i(ZF(c),ZF(f),!0)};return Y.forEach(Object.keys(Object.assign({},t,e)),function(f){let d=u[f]||i,g=d(t[f],e[f],f);Y.isUndefined(g)&&d!==a||(r[f]=g)}),r}var vM="1.6.7",R_={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{R_[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var eM={};R_.transitional=function(e,r,n){function i(s,o){return"[Axios v"+vM+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new Me(i(o," has been removed"+(r?" in "+r:"")),Me.ERR_DEPRECATED);return r&&!eM[o]&&(eM[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(s,o,a):!0}};function lie(t,e,r){if(typeof t!="object")throw new Me("options must be an object",Me.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let s=n[i],o=e[s];if(o){let a=t[s],u=a===void 0||o(a,s,t);if(u!==!0)throw new Me("option "+s+" must be "+u,Me.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Me("Unknown option "+s,Me.ERR_BAD_OPTION)}}var T_={assertOptions:lie,validators:R_},ms=T_.validators,Nu=class{constructor(e){this.defaults=e,this.interceptors={request:new $F,response:new $F}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+s):n.stack=s}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=xu(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&T_.assertOptions(n,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),i!=null&&(Y.isFunction(i)?r.paramsSerializer={serialize:i}:T_.assertOptions(i,{encode:ms.function,serialize:ms.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Y.merge(s.common,s[r.method]);s&&Y.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),r.headers=yi.concat(o,s);let a=[],u=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});let c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let f,d=0,g;if(!u){let y=[XF.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),g=y.length,f=Promise.resolve(r);d{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new uf(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}},fie=C_;function die(t){return function(r){return t.apply(null,r)}}function hie(t){return Y.isObject(t)&&t.isAxiosError===!0}var x_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(x_).forEach(([t,e])=>{x_[e]=t});var pie=x_;function AM(t){let e=new Ay(t),r=tM(Ay.prototype.request,e);return Y.extend(r,Ay.prototype,e,{allOwnKeys:!0}),Y.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return AM(xu(t,i))},r}var Rt=AM(P_);Rt.Axios=Ay;Rt.CanceledError=uf;Rt.CancelToken=fie;Rt.isCancel=mM;Rt.VERSION=vM;Rt.toFormData=Sy;Rt.AxiosError=Me;Rt.Cancel=Rt.CanceledError;Rt.all=function(e){return Promise.all(e)};Rt.spread=die;Rt.isAxiosError=hie;Rt.mergeConfig=xu;Rt.AxiosHeaders=yi;Rt.formToJSON=t=>yM(Y.isHTMLForm(t)?new FormData(t):t);Rt.getAdapter=EM.getAdapter;Rt.HttpStatusCode=pie;Rt.default=Rt;bM.exports=Rt});var _M=A(Ty=>{"use strict";l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.NativeAuthClientConfig=void 0;var B_=class{constructor(){this.origin=typeof window<"u"&&typeof window.location<"u"?window.location.hostname:"",this.apiUrl="https://api.multiversx.com",this.expirySeconds=60*60*24}};Ty.NativeAuthClientConfig=B_});var F_=A(Du=>{"use strict";l();var Ao=Du&&Du.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{c(n.next(f))}catch(d){o(d)}}function u(f){try{c(n.throw(f))}catch(d){o(d)}}function c(f){f.done?s(f.value):i(f.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Du,"__esModule",{value:!0});Du.NativeAuthClient=void 0;var gie=IM(),yie=_M(),L_=class{constructor(e){this.config=Object.assign(new yie.NativeAuthClientConfig,e)}getToken(e,r,n){let i=this.encodeValue(e),s=this.encodeValue(r);return`${i}.${s}.${n}`}initialize(e={}){return Ao(this,void 0,void 0,function*(){let r=yield this.getCurrentBlockHash(),n=this.encodeValue(JSON.stringify(e));return`${this.encodeValue(this.config.origin)}.${r}.${this.config.expirySeconds}.${n}`})}getCurrentBlockHash(){return Ao(this,void 0,void 0,function*(){return this.config.gatewayUrl?yield this.getCurrentBlockHashWithGateway():yield this.getCurrentBlockHashWithApi()})}getCurrentBlockHashWithGateway(){return Ao(this,void 0,void 0,function*(){let e=yield this.getCurrentRound(),r=`${this.config.gatewayUrl}/blocks/by-round/${e}`;return(yield this.get(r)).data.data.blocks.filter(o=>o.shard===this.config.blockHashShard)[0].hash})}getCurrentRound(){return Ao(this,void 0,void 0,function*(){if(!this.config.gatewayUrl)throw new Error("Gateway URL not set");if(!this.config.blockHashShard)throw new Error("Blockhash shard not set");let e=`${this.config.gatewayUrl}/network/status/${this.config.blockHashShard}`;return(yield this.get(e)).data.data.status.erd_current_round})}getCurrentBlockHashWithApi(){return Ao(this,void 0,void 0,function*(){try{let e=`${this.config.apiUrl}/blocks/latest?ttl=${this.config.expirySeconds}&fields=hash`,r=yield this.get(e);if(r.data[0].hash!==void 0)return r.data[0].hash}catch{}return this.getCurrentBlockHashWithApiFallback()})}getCurrentBlockHashWithApiFallback(){return Ao(this,void 0,void 0,function*(){let e=`${this.config.apiUrl}/blocks?size=1&fields=hash`;return this.config.blockHashShard!==void 0&&(e+=`&shard=${this.config.blockHashShard}`),(yield this.get(e)).data[0].hash})}encodeValue(e){return this.escape(h.Buffer.from(e,"utf8").toString("base64"))}escape(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}get(e){return Ao(this,void 0,void 0,function*(){return yield gie.default.get(e,{headers:this.config.extraRequestHeaders})})}};Du.NativeAuthClient=L_});var OM=A(Ny=>{"use strict";l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.TransactionStatus=void 0;var U_=class t{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new t("unknown")}isPending(){return this.status=="received"||this.status=="pending"}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return this.status=="executed"||this.status=="success"||this.status=="successful"}isFailed(){return this.status=="fail"||this.status=="failed"||this.status=="unsuccessful"||this.isInvalid()}isInvalid(){return this.status=="invalid"}toString(){return this.status}valueOf(){return this.status}equals(e){return e?this.status==e.status:!1}};Ny.TransactionStatus=U_});var PM=A(Oy=>{"use strict";l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.TransactionReceipt=void 0;var DM=Ta(),q_=class t{constructor(){this.value="",this.sender=new DM.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let r=new t;return r.value=(e.value||0).toString(),r.sender=new DM.Address(e.sender),r.data=e.data,r.hash=e.txHash,r}};Oy.TransactionReceipt=q_});var RM=A(Gn=>{"use strict";l();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ErrContractQuery=Gn.ErrNetworkProvider=Gn.ErrUnexpectedCondition=Gn.Err=void 0;var Bu=class extends Error{constructor(e,r){super(e),this.inner=void 0,this.inner=r}};Gn.Err=Bu;var V_=class extends Bu{constructor(e){super(`Unexpected condition: [${e}]`)}};Gn.ErrUnexpectedCondition=V_;var H_=class extends Bu{constructor(e,r,n){let i=`Request error on url [${e}]: [${r}]`;super(i,n)}};Gn.ErrNetworkProvider=H_;var k_=class extends Bu{constructor(e){super(e.message.replace("executeQuery:",""))}};Gn.ErrContractQuery=k_});var LM=A(ws=>{"use strict";l();Object.defineProperty(ws,"__esModule",{value:!0});ws.TransactionEventTopic=ws.TransactionEventData=ws.TransactionEvent=void 0;var BM=Ta(),G_=class t{constructor(e){this.address=new BM.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new Lu(h.Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new BM.Address(e.address),r.identifier=e.identifier||"",r.topics=(e.topics||[]).map(n=>new Dy(n)),r.dataPayload=Lu.fromBase64(e.data),r.additionalData=(e.additionalData||[]).map(Lu.fromBase64),r.data=r.dataPayload.toString(),r}findFirstOrNoneTopic(e){return this.topics.filter(r=>e(r))[0]}getLastTopic(){return this.topics[this.topics.length-1]}};ws.TransactionEvent=G_;var Lu=class t{constructor(e){this.raw=e}static fromBase64(e){return new t(h.Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventData=Lu;var Dy=class{constructor(e){this.raw=h.Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}};ws.TransactionEventTopic=Dy});var Q_=A(Py=>{"use strict";l();Object.defineProperty(Py,"__esModule",{value:!0});Py.TransactionLogs=void 0;var Eie=RM(),FM=Ta(),vie=LM(),j_=class t{constructor(e){this.address=new FM.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let r=new t;return r.address=new FM.Address(e.address),r.events=(e.events||[]).map(n=>vie.TransactionEvent.fromHttpResponse(n)),r}findSingleOrNoneEvent(e,r){let n=this.findEvents(e,r);if(n.length>1)throw new Eie.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,r){return this.findEvents(e,r)[0]}findEvents(e,r){let n=this.events.filter(i=>i.identifier==e);return r&&(n=n.filter(i=>r(i))),n}};Py.TransactionLogs=j_});var UM=A(Fu=>{"use strict";l();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ContractResultItem=Fu.ContractResults=void 0;var MM=Q_(),Ry=Ta(),z_=class t{constructor(e){this.items=e,this.items.sort(function(r,n){return r.nonce.valueOf()-n.nonce.valueOf()})}static fromProxyHttpResponse(e){let r=e.map(n=>cf.fromProxyHttpResponse(n));return new t(r)}static fromApiHttpResponse(e){let r=e.map(n=>cf.fromApiHttpResponse(n));return new t(r)}};Fu.ContractResults=z_;var cf=class t{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new Ry.Address(""),this.sender=new Ry.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new MM.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return t.fromHttpResponse(e)}static fromApiHttpResponse(e){let r=t.fromHttpResponse(e);return r.data=h.Buffer.from(r.data,"base64").toString(),r.callType=Number(r.callType),r}static fromHttpResponse(e){let r=new t;return r.hash=e.hash,r.nonce=Number(e.nonce||0),r.value=(e.value||0).toString(),r.receiver=new Ry.Address(e.receiver),r.sender=new Ry.Address(e.sender),r.previousHash=e.prevTxHash,r.originalHash=e.originalTxHash,r.gasLimit=Number(e.gasLimit||0),r.gasPrice=Number(e.gasPrice||0),r.data=e.data||"",r.callType=e.callType,r.returnMessage=e.returnMessage,r.logs=MM.TransactionLogs.fromHttpResponse(e.logs||{}),r}};Fu.ContractResultItem=cf});var qM=A(By=>{"use strict";l();Object.defineProperty(By,"__esModule",{value:!0});By.ContractQueryRequest=void 0;var W_=class{constructor(e){this.query=e}toHttpRequest(){var e;let r={},n=this.query;return r.scAddress=n.address.bech32(),r.caller=!((e=n.caller)===null||e===void 0)&&e.bech32()?n.caller.bech32():void 0,r.funcName=n.func.toString(),r.value=n.value?n.value.toString():void 0,r.args=n.getEncodedArguments(),r}};By.ContractQueryRequest=W_});var KM=A((pEe,$M)=>{l();$M.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Es=A(bo=>{l();var $_,Aie=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];bo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};bo.getSymbolTotalCodewords=function(e){return Aie[e]};bo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};bo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');$_=e};bo.isKanjiModeEnabled=function(){return typeof $_<"u"};bo.toSJIS=function(e){return $_(e)}});var My=A(zr=>{l();zr.L={bit:1};zr.M={bit:0};zr.Q={bit:3};zr.H={bit:2};function bie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return zr.L;case"m":case"medium":return zr.M;case"q":case"quartile":return zr.Q;case"h":case"high":return zr.H;default:throw new Error("Unknown EC Level: "+t)}}zr.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4};zr.from=function(e,r){if(zr.isValid(e))return e;try{return bie(e)}catch{return r}}});var XM=A((vEe,JM)=>{l();function YM(){this.buffer=[],this.length=0}YM.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};JM.exports=YM});var eU=A((bEe,ZM)=>{l();function lf(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}lf.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};lf.prototype.get=function(t,e){return this.data[t*this.size+e]};lf.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};lf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};ZM.exports=lf});var tU=A(Uy=>{l();var Iie=Es().getSymbolSize;Uy.getRowColCoords=function(e){if(e===1)return[];let r=Math.floor(e/7)+2,n=Iie(e),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,s=[n-7];for(let o=1;o{l();var _ie=Es().getSymbolSize,rU=7;nU.getPositions=function(e){let r=_ie(e);return[[0,0],[r-rU,0],[0,r-rU]]}});var sU=A(nt=>{l();nt.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Io={N1:3,N2:3,N3:40,N4:10};nt.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7};nt.from=function(e){return nt.isValid(e)?parseInt(e,10):void 0};nt.getPenaltyN1=function(e){let r=e.size,n=0,i=0,s=0,o=null,a=null;for(let u=0;u=5&&(n+=Io.N1+(i-5)),o=f,i=1),f=e.get(c,u),f===a?s++:(s>=5&&(n+=Io.N1+(s-5)),a=f,s=1)}i>=5&&(n+=Io.N1+(i-5)),s>=5&&(n+=Io.N1+(s-5))}return n};nt.getPenaltyN2=function(e){let r=e.size,n=0;for(let i=0;i=10&&(i===1488||i===93)&&n++,s=s<<1&2047|e.get(a,o),a>=10&&(s===1488||s===93)&&n++}return n*Io.N3};nt.getPenaltyN4=function(e){let r=0,n=e.data.length;for(let s=0;s{l();var vs=My(),qy=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Vy=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];K_.getBlocksCount=function(e,r){switch(r){case vs.L:return qy[(e-1)*4+0];case vs.M:return qy[(e-1)*4+1];case vs.Q:return qy[(e-1)*4+2];case vs.H:return qy[(e-1)*4+3];default:return}};K_.getTotalCodewordsCount=function(e,r){switch(r){case vs.L:return Vy[(e-1)*4+0];case vs.M:return Vy[(e-1)*4+1];case vs.Q:return Vy[(e-1)*4+2];case vs.H:return Vy[(e-1)*4+3];default:return}}});var oU=A(ky=>{l();var ff=new Uint8Array(512),Hy=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)ff[r]=e,Hy[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)ff[r]=ff[r-255]})();ky.log=function(e){if(e<1)throw new Error("log("+e+")");return Hy[e]};ky.exp=function(e){return ff[e]};ky.mul=function(e,r){return e===0||r===0?0:ff[Hy[e]+Hy[r]]}});var aU=A(df=>{l();var J_=oU();df.mul=function(e,r){let n=new Uint8Array(e.length+r.length-1);for(let i=0;i=0;){let i=n[0];for(let o=0;o{l();var uU=aU();function X_(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}X_.prototype.initialize=function(e){this.degree=e,this.genPoly=uU.generateECPolynomial(this.degree)};X_.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(e.length+this.degree);r.set(e);let n=uU.mod(r,this.genPoly),i=this.degree-n.length;if(i>0){let s=new Uint8Array(this.degree);return s.set(n,i),s}return n};cU.exports=X_});var Z_=A(fU=>{l();fU.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}});var eS=A(wi=>{l();var dU="[0-9]+",Tie="[A-Z $%*+\\-./:]+",hf="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";hf=hf.replace(/u/g,"\\u");var Cie="(?:(?![A-Z0-9 $%*+\\-./:]|"+hf+`)(?:.|[\r ]))+`;wi.KANJI=new RegExp(hf,"g");wi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");wi.BYTE=new RegExp(Cie,"g");wi.NUMERIC=new RegExp(dU,"g");wi.ALPHANUMERIC=new RegExp(Tie,"g");var xie=new RegExp("^"+hf+"$"),Nie=new RegExp("^"+dU+"$"),Oie=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");wi.testKanji=function(e){return xie.test(e)};wi.testNumeric=function(e){return Nie.test(e)};wi.testAlphanumeric=function(e){return Oie.test(e)}});var As=A(Bt=>{l();var Die=Z_(),tS=eS();Bt.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Bt.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Bt.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Bt.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Bt.MIXED={bit:-1};Bt.getCharCountIndicator=function(e,r){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Die.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?e.ccBits[0]:r<27?e.ccBits[1]:e.ccBits[2]};Bt.getBestModeForData=function(e){return tS.testNumeric(e)?Bt.NUMERIC:tS.testAlphanumeric(e)?Bt.ALPHANUMERIC:tS.testKanji(e)?Bt.KANJI:Bt.BYTE};Bt.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")};Bt.isValid=function(e){return e&&e.bit&&e.ccBits};function Pie(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return Bt.NUMERIC;case"alphanumeric":return Bt.ALPHANUMERIC;case"kanji":return Bt.KANJI;case"byte":return Bt.BYTE;default:throw new Error("Unknown mode: "+t)}}Bt.from=function(e,r){if(Bt.isValid(e))return e;try{return Pie(e)}catch{return r}}});var mU=A(_o=>{l();var Gy=Es(),Rie=Y_(),hU=My(),bs=As(),rS=Z_(),gU=7973,pU=Gy.getBCHDigit(gU);function Bie(t,e,r){for(let n=1;n<=40;n++)if(e<=_o.getCapacity(n,r,t))return n}function yU(t,e){return bs.getCharCountIndicator(t,e)+4}function Lie(t,e){let r=0;return t.forEach(function(n){let i=yU(n.mode,e);r+=i+n.getBitsLength()}),r}function Fie(t,e){for(let r=1;r<=40;r++)if(Lie(t,r)<=_o.getCapacity(r,e,bs.MIXED))return r}_o.from=function(e,r){return rS.isValid(e)?parseInt(e,10):r};_o.getCapacity=function(e,r,n){if(!rS.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=bs.BYTE);let i=Gy.getSymbolTotalCodewords(e),s=Rie.getTotalCodewordsCount(e,r),o=(i-s)*8;if(n===bs.MIXED)return o;let a=o-yU(n,e);switch(n){case bs.NUMERIC:return Math.floor(a/10*3);case bs.ALPHANUMERIC:return Math.floor(a/11*2);case bs.KANJI:return Math.floor(a/13);case bs.BYTE:default:return Math.floor(a/8)}};_o.getBestVersionForData=function(e,r){let n,i=hU.from(r,hU.M);if(Array.isArray(e)){if(e.length>1)return Fie(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return Bie(n.mode,n.getLength(),i)};_o.getEncodedBits=function(e){if(!rS.isValid(e)||e<7)throw new Error("Invalid QR Code version");let r=e<<12;for(;Gy.getBCHDigit(r)-pU>=0;)r^=gU<{l();var nS=Es(),EU=1335,Mie=21522,wU=nS.getBCHDigit(EU);vU.getEncodedBits=function(e,r){let n=e.bit<<3|r,i=n<<10;for(;nS.getBCHDigit(i)-wU>=0;)i^=EU<{l();var Uie=As();function Mu(t){this.mode=Uie.NUMERIC,this.data=t.toString()}Mu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Mu.prototype.getLength=function(){return this.data.length};Mu.prototype.getBitsLength=function(){return Mu.getBitsLength(this.data.length)};Mu.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);let s=this.data.length-r;s>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};bU.exports=Mu});var SU=A((YEe,_U)=>{l();var qie=As(),iS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Uu(t){this.mode=qie.ALPHANUMERIC,this.data=t}Uu.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Uu.prototype.getLength=function(){return this.data.length};Uu.prototype.getBitsLength=function(){return Uu.getBitsLength(this.data.length)};Uu.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=iS.indexOf(this.data[r])*45;n+=iS.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(iS.indexOf(this.data[r]),6)};_U.exports=Uu});var CU=A((XEe,TU)=>{"use strict";l();TU.exports=function(e){for(var r=[],n=e.length,i=0;i=55296&&s<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}});var NU=A((eve,xU)=>{l();var Vie=CU(),Hie=As();function qu(t){this.mode=Hie.BYTE,typeof t=="string"&&(t=Vie(t)),this.data=new Uint8Array(t)}qu.getBitsLength=function(e){return e*8};qu.prototype.getLength=function(){return this.data.length};qu.prototype.getBitsLength=function(){return qu.getBitsLength(this.data.length)};qu.prototype.write=function(t){for(let e=0,r=this.data.length;e{l();var kie=As(),Gie=Es();function Vu(t){this.mode=kie.KANJI,this.data=t}Vu.getBitsLength=function(e){return e*13};Vu.prototype.getLength=function(){return this.data.length};Vu.prototype.getBitsLength=function(){return Vu.getBitsLength(this.data.length)};Vu.prototype.write=function(t){let e;for(e=0;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};OU.exports=Vu});var PU=A((ive,sS)=>{"use strict";l();var pf={single_source_shortest_paths:function(t,e,r){var n={},i={};i[e]=0;var s=pf.PriorityQueue.make();s.push(e,0);for(var o,a,u,c,f,d,g,m,y;!s.empty();){o=s.pop(),a=o.value,c=o.cost,f=t[a]||{};for(u in f)f.hasOwnProperty(u)&&(d=f[u],g=c+d,m=i[u],y=typeof i[u]>"u",(y||m>g)&&(i[u]=g,s.push(u,g),n[u]=a))}if(typeof r<"u"&&typeof i[r]>"u"){var b=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(b)}return n},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e,i;n;)r.push(n),i=t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var n=pf.single_source_shortest_paths(t,e,r);return pf.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(t){var e=pf.PriorityQueue,r={},n;t=t||{};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r.queue=[],r.sorter=t.sorter||e.default_sorter,r},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof sS<"u"&&(sS.exports=pf)});var VU=A(Hu=>{l();var je=As(),LU=IU(),FU=SU(),MU=NU(),UU=DU(),gf=eS(),jy=Es(),jie=PU();function RU(t){return unescape(encodeURIComponent(t)).length}function yf(t,e,r){let n=[],i;for(;(i=t.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:e,length:i[0].length});return n}function qU(t){let e=yf(gf.NUMERIC,je.NUMERIC,t),r=yf(gf.ALPHANUMERIC,je.ALPHANUMERIC,t),n,i;return jy.isKanjiModeEnabled()?(n=yf(gf.BYTE,je.BYTE,t),i=yf(gf.KANJI,je.KANJI,t)):(n=yf(gf.BYTE_KANJI,je.BYTE,t),i=[]),e.concat(r,n,i).sort(function(o,a){return o.index-a.index}).map(function(o){return{data:o.data,mode:o.mode,length:o.length}})}function oS(t,e){switch(e){case je.NUMERIC:return LU.getBitsLength(t);case je.ALPHANUMERIC:return FU.getBitsLength(t);case je.KANJI:return UU.getBitsLength(t);case je.BYTE:return MU.getBitsLength(t)}}function Qie(t){return t.reduce(function(e,r){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===r.mode?(e[e.length-1].data+=r.data,e):(e.push(r),e)},[])}function zie(t){let e=[];for(let r=0;r{l();var zy=Es(),aS=My(),$ie=XM(),Kie=eU(),Yie=tU(),Jie=iU(),lS=sU(),fS=Y_(),Xie=lU(),Qy=mU(),Zie=AU(),ese=As(),uS=VU();function tse(t,e){let r=t.size,n=Jie.getPositions(e);for(let i=0;i=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?t.set(s+a,o+u,!0,!0):t.set(s+a,o+u,!1,!0))}}function rse(t){let e=t.size;for(let r=8;r>a&1)===1,t.set(i,s,o,!0),t.set(s,i,o,!0)}function cS(t,e,r){let n=t.size,i=Zie.getEncodedBits(e,r),s,o;for(s=0;s<15;s++)o=(i>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(n-15+s,8,o,!0),s<8?t.set(8,n-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(n-8,8,1,!0)}function sse(t,e){let r=t.size,n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!t.isReserved(i,a-u)){let c=!1;o>>s&1)===1),t.set(i,a-u,c),s--,s===-1&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function ose(t,e,r){let n=new $ie;r.forEach(function(u){n.put(u.mode.bit,4),n.put(u.getLength(),ese.getCharCountIndicator(u.mode,t)),u.write(n)});let i=zy.getSymbolTotalCodewords(t),s=fS.getTotalCodewordsCount(t,e),o=(i-s)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let a=(o-n.getLengthInBits())/8;for(let u=0;u=16.14" @@ -4557,6 +4569,12 @@ "ufo": "^1.3.0" } }, + "node_modules/ohash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.3.tgz", + "integrity": "sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==", + "dev": true + }, "node_modules/on-exit-leak-free": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz",