@bluxcc/core 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.d.ts +11 -0
- package/dist/components/Link/index.d.ts +8 -0
- package/dist/constants/cdnFiles.d.ts +1 -0
- package/dist/constants/consts.d.ts +1 -1
- package/dist/enums.d.ts +3 -1
- package/dist/exports/blux.d.ts +6 -0
- package/dist/index.cjs.js +14 -14
- package/dist/index.esm.js +14 -14
- package/dist/pages/FundMe/FundMeCrypto/index.d.ts +1 -1
- package/dist/stellar/handleSignAuthEntry.d.ts +3 -0
- package/dist/stellar/processes/signAuthEntryProcess.d.ts +3 -0
- package/dist/store.d.ts +4 -2
- package/dist/types.d.ts +7 -0
- package/dist/utils/checkRecentLogins.d.ts +1 -1
- package/dist/utils/walletLogos.d.ts +1 -1
- package/dist/wallets/bitget.d.ts +2 -0
- package/dist/wallets/onekey.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@stellar/stellar-sdk"),t=require("@albedo-link/intent"),r=require("@lobstrco/signer-extension-api"),n=require("@stellar/freighter-api"),i=require("zustand"),o=require("zustand/vanilla"),s=require("@ledgerhq/hw-app-str"),a=require("react"),c=require("react-dom/client"),u=require("react/jsx-runtime"),l=require("@walletconnect/core"),d=require("@walletconnect/sign-client"),f=require("qrcode.react");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var b,m,g,v,y=p(e),x=h(t),w=h(r),A=h(n),E=p(s),S=h(a),_=h(l),I=h(d),N=function(){return N=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},N.apply(this,arguments)};function M(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function C(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function T(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function k(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.Api="API",e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.WalletConnect="Wallet Connect",e.Hot="Hot",e.Klever="Klever",e.Ledger="Ledger"}(b||(b={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(m||(m={})),function(e){e.ONBOARDING="ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.FAILED="FAILED",e.PROFILE="PROFILE",e.SEND_TRANSACTION="SEND_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP",e.RECEIVE="RECEIVE",e.BALANCES="BALANCES",e.SWAP="SWAP",e.BALANCE_DETAILS="BALANCE_DETAILS",e.ABOUT="ABOUT",e.ADD_TOKEN="ADD_TOKEN",e.SIGN_MESSAGE="SIGN_MESSAGE",e.WALLET_CONNECT="WALLET_CONNECT",e.SELECT_ASSET="SELECT_ASSET",e.FUND_ME="FUND_ME",e.FUND_ME_CRYPTO="FUND_ME_CRYPTO",e.ACCEPT_TERMS_AND_PRIVACY="ACCEPT_TERMS_AND_PRIVACY"}(g||(g={})),function(e){e.SmallEmail="smallemail.svg",e.Email="email.svg",e.Albedo="albedo.svg",e.Stellar="stellar.svg"}(v||(v={}));var R={assetIssuer:"",assetCode:"XLM",assetBalance:"0",assetType:"native"},B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function j(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var L,P={},F={},U={},D={},z={};function W(){return L||(L=1,z.__esModule=!0,z.integers=void 0,z.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),z}var $,q={};function K(){if($)return q;$=1,q.__esModule=!0,q.DecodeBuffer=q.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();q.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return q.DecodeBuffer=t,q}var H,V,G={};function X(){if(H)return G;H=1;var e,t=G&&G.__extends||(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});G.__esModule=!0,G.validate_schema=G.ErrorSchema=G.expect_enum=G.expect_same_size=G.expect_bigint=G.expect_type=G.isArrayLike=void 0;var r=W();G.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},G.expect_type=function(e,t,r){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))},G.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},G.expect_same_size=function(e,t,r){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))},G.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=r.integers.concat(["bool","string"]),i=["option","enum","array","set","map","struct"],o=function(e){function r(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return t(r,e),r}(Error);function s(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&i.includes(t[0])){var r=t[0];if("option"===r)return s(e[r]);if("enum"===r)return function(e){if(!Array.isArray(e))throw new o(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw new Error('The "struct" in each enum must have a single key');s({struct:n.struct})}}(e[r]);if("array"===r)return function(e){if("object"!=typeof e)throw new o(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return s(e.type);throw new o(e,"{ type, len? }")}(e[r]);if("set"===r)return s(e[r]);if("map"===r)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new o(e,"{ key, value }");s(e.key),s(e.value)}(e[r]);if("struct"===r)return function(e){if("object"!=typeof e)throw new o(e,"object");for(var t in e)s(e[t])}(e[r])}}throw new o(e,i.join(", ")+" or "+n.join(", "))}}return G.ErrorSchema=o,G.validate_schema=s,G}var Y,Z,J={};var Q,ee={exports:{}},te=j(Object.freeze({__proto__:null,default:{}}));var re,ne={},ie={};function oe(){return re||(re=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.KeySize=ie.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(ie.KeyType=e={})),ie.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),ie;var e}var se,ae={},ce={};function ue(){if(se)return ce;se=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.KeyPairBase=void 0;return ce.KeyPairBase=class{},ce}var le,de={},fe={},he={};var pe,be={},me={},ge={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function ve(){if(pe)return me;pe=1;var e=me&&me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(me,"__esModule",{value:!0}),me.ErrorMessages=void 0;const t=e(ge);return me.ErrorMessages=t.default,me}var ye,xe={},we={},Ae={};var Ee,Se={};var _e,Ie={};var Ne,Me={},Ce={};var Te,ke,Re,Be={};function Oe(){return ke||(ke=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,r=(Ne||(Ne=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||(Ce.IdType=t={}))),Ce);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return r.IdType}});var n,i,o=(Te||(Te=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.FinalExecutionStatusBasic=Be.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(n||(Be.ExecutionStatusBasic=n={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(Be.FinalExecutionStatusBasic=i={}))),Be);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(Me)),Me}function je(){return Re||(Re=1,function(e){var t=we&&we.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=we&&we.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),r((ye||(ye=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.Assignable=void 0,Ae.Assignable=class{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}),Ae),e),r((Ee||(Ee=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.Enum=void 0,Se.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}),Se),e),r(function(){if(_e)return Ie;_e=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.ErrorContext=Ie.TypedError=Ie.ArgumentTypeError=Ie.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}Ie.PositionalArgsError=e;class t extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}Ie.ArgumentTypeError=t;class r extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}return Ie.TypedError=r,Ie.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},Ie}(),e),r(Oe(),e)}(we)),we}var Le,Pe={exports:{}};function Fe(){return Le||(Le=1,Pe.exports=function(){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@stellar/stellar-sdk"),t=require("zustand"),r=require("zustand/vanilla"),n=require("@albedo-link/intent"),i=require("@lobstrco/signer-extension-api"),o=require("@ledgerhq/hw-app-str"),s=require("@stellar/freighter-api"),a=require("react"),c=require("react-dom/client"),u=require("react/jsx-runtime"),l=require("@walletconnect/core"),d=require("@walletconnect/sign-client"),f=require("qrcode.react");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var b,m,g,v,y=p(e),x=h(n),w=h(i),A=p(o),E=h(s),S=h(a),_=h(l),I=h(d),N=function(){return N=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},N.apply(this,arguments)};function C(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function M(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function k(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function T(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.Api="API",e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.WalletConnect="Wallet Connect",e.Hot="Hot",e.Klever="Klever",e.Ledger="Ledger",e.Bitget="Bitget",e.Onekey="Onekey"}(b||(b={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(m||(m={})),function(e){e.ONBOARDING="ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.FAILED="FAILED",e.PROFILE="PROFILE",e.SEND_TRANSACTION="SEND_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP",e.RECEIVE="RECEIVE",e.BALANCES="BALANCES",e.SWAP="SWAP",e.BALANCE_DETAILS="BALANCE_DETAILS",e.ABOUT="ABOUT",e.ADD_TOKEN="ADD_TOKEN",e.SIGN_MESSAGE="SIGN_MESSAGE",e.WALLET_CONNECT="WALLET_CONNECT",e.SELECT_ASSET="SELECT_ASSET",e.FUND_ME="FUND_ME",e.FUND_ME_CRYPTO="FUND_ME_CRYPTO",e.ACCEPT_TERMS_AND_PRIVACY="ACCEPT_TERMS_AND_PRIVACY"}(g||(g={})),function(e){e.SmallEmail="smallemail.svg",e.Email="email.svg",e.Albedo="albedo.svg",e.Stellar="stellar.svg"}(v||(v={}));var R,B={assetIssuer:"",assetCode:"XLM",assetBalance:"0",assetType:"native"},j={logo:"",fontFamily:"Manrope",textColor:"#000000",accentColor:"#0c1083",background:"#ffffff",fieldBackground:"#ffffff",borderRadius:"24px",borderColor:"#cdceee",borderWidth:"1px",backdropBlur:"1px",backdropColor:"#00000033",boxShadow:"0px 4px 80px 0px #00000008"},O=r.createStore(function(){return{config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],loginMethods:["wallet"],showWalletUIs:!0,explorer:"stellarchain",isPersistent:!1,promptOnWrongNetwork:!0,appearance:j,walletConnect:{icons:[],url:"",projectId:"",description:""}},user:void 0,authState:{isReady:!1,isAuthenticated:!1},stellar:void 0}}),L=O.getState,P=O.subscribe,F=O.getInitialState;exports.BluxEvent=void 0,(R=exports.BluxEvent||(exports.BluxEvent={})).LoggedIn="blux:logged_in",R.LoggedOut="blux:logged_out",R.NetworkChanged="blux:network_changed",R.ModalOpened="blux:modal_opened",R.ModalClosed="blux:modal_closed";var U=function(){function e(){this.handlers=new Map}return e.prototype.on=function(e,t){var r,n=this,i=null!==(r=this.handlers.get(e))&&void 0!==r?r:new Set;return i.add(t),this.handlers.set(e,i),function(){return n.off(e,t)}},e.prototype.off=function(e,t){var r=this.handlers.get(e);r&&(r.delete(t),0===r.size&&this.handlers.delete(e))},e.prototype.once=function(e,t){var r=this,n=function(i){try{t(i)}finally{r.off(e,n)}};return this.on(e,n)},e.prototype.emit=function(e,t){var r=this.handlers.get(e);if(r)for(var n=0,i=Array.from(r);n<i.length;n++){var o=i[n];try{o(t)}catch(e){}}},e.prototype.clear=function(e){e?this.handlers.delete(e):this.handlers.clear()},e}(),D=new U,z=r.createStore(function(e){return{logos:null,emitter:D,auth:void 0,config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],isPersistent:!1,showWalletUIs:!0,loginMethods:["wallet"],explorer:"stellarchain",promptOnWrongNetwork:!0,appearance:j,walletConnect:{icons:[],url:"",projectId:"",description:""}},login:void 0,stellar:void 0,signMessage:void 0,signAuthEntry:void 0,sendTransaction:void 0,wallets:[],waitingStatus:"login",showAllWallets:!1,modal:{isOpen:!1,route:g.ONBOARDING,dynamicTitle:"",alert:{type:"none",message:""}},authState:{isReady:!1,isAuthenticated:!1},balances:{error:null,loading:!1,balances:[]},apiResponse:void 0,transactions:{error:null,loading:!1,transactions:[]},selectAsset:{field:"send",sendAsset:B,swapToAsset:B,swapFromAsset:B},walletConnectClient:void 0,networkSyncDisabled:!1,setConfig:function(t){return e(function(e){return N(N({},e),{config:t})})},setWallets:function(t){return e(function(e){return N(N({},e),{wallets:t})})},setIsReady:function(t){return e(function(e){return N(N({},e),{authState:N(N({},e.authState),{isReady:t})})})},setShowAllWallets:function(t){return e(function(e){return N(N({},e),{showAllWallets:t})})},setRoute:function(t){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{route:t})})})},setSendTransaction:function(t,r,n){return void 0===n&&(n=g.SEND_TRANSACTION),e(function(e){return N(N({},e),{sendTransaction:t,modal:N(N({},e.modal),{isOpen:r,route:n}),waitingStatus:"sendTransaction"})})},setSignMessage:function(t,r,n){return void 0===n&&(n=g.SIGN_MESSAGE),e(function(e){return N(N({},e),{signMessage:t,modal:N(N({},e.modal),{isOpen:r,route:n}),waitingStatus:"signMessage"})})},setSignAuthEntry:function(t,r,n){return void 0===n&&(n=g.SIGN_MESSAGE),e(function(e){return N(N({},e),{signAuthEntry:t,modal:N(N({},e.modal),{isOpen:r,route:n}),waitingStatus:"signAuthEntry"})})},setStellar:function(t){return e(function(e){return N(N({},e),{stellar:t})})},approveSendTransaction:function(){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{isOpen:!0,route:g.WAITING}),waitingStatus:"sendTransaction"})})},openModal:function(t){e(function(e){return N(N({},e),{modal:N(N({},e.modal),{route:t,isOpen:!0})})}),W().emitter.emit(exports.BluxEvent.ModalOpened,{modal:t,reason:"openModal"})},setDynamicTitle:function(t){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{dynamicTitle:t})})})},setAlert:function(t,r){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{alert:{type:t,message:r}})})})},closeModal:function(){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{isOpen:!1})})})},connectWallet:function(t){var r=t===b.WalletConnect?g.WALLET_CONNECT:g.WAITING;e(function(e){return N(N({},e),{waitingStatus:"login",user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:t},modal:N(N({},e.modal),{isOpen:!0,route:r})})}),W().emitter.emit(exports.BluxEvent.ModalOpened,{modal:r,reason:"connectWallet",meta:{walletName:t}})},setIsAuthenticated:function(t){return e(function(e){return N(N({},e),{authState:N(N({},e.authState),{isAuthenticated:t})})})},connectWalletSuccessful:function(t,r){return e(function(e){var n,i;return N(N({},e),{authState:N({},e.authState),user:N(N({},e.user),{address:t,walletPassphrase:r,authValue:(null===(n=e.user)||void 0===n?void 0:n.authValue)||"",authMethod:(null===(i=e.user)||void 0===i?void 0:i.authMethod)||""})})})},connectEmail:function(t){return e(function(e){return N(N({},e),{waitingStatus:"login",user:{address:"",authValue:t,authMethod:"email",walletPassphrase:""},modal:N(N({},e.modal),{isOpen:!0,route:g.OTP})})})},logoutAction:function(){return e(function(e){return N(N({},e),{user:void 0,waitingStatus:"login",authState:N(N({},e.authState),{isAuthenticated:!1}),modal:N(N({},e.modal),{isOpen:!1})})})},setBalances:function(t){return e(function(e){return N(N({},e),{balances:t})})},setAuth:function(t){return e(function(e){return N(N({},e),{auth:t})})},setTransactions:function(t){return e(function(e){return N(N({},e),{transactions:t})})},setSelectAsset:function(t){return e(function(e){return N(N({},e),{selectAsset:t})})},setWalletConnectClient:function(t,r){return e(function(e){return N(N({},e),{walletConnect:{client:t,connection:r}})})},cleanUp:function(t){return e(function(e){var r;return N(N({},e),((r={})[t]=void 0,r))})},setNetworkSyncDisabled:function(t){return e(function(e){return N(N({},e),{networkSyncDisabled:t})})},setAppearance:function(t){return e(function(e){return N(N({},e),{config:N(N({},e.config),{appearance:N(N({},e.config.appearance),t)})})})},setApiResponse:function(t){return e(function(e){return N(N({},e),{apiResponse:t})})},setLogin:function(t){return e(function(e){return N(N({},e),{login:t})})},setLogos:function(t){return e(function(e){return N(N({},e),{logos:t})})}}}),W=z.getState,$=z.setState;z.subscribe,z.getInitialState;var q,K,V=function(e){return t.useStore(z,e)};K=(q=z).getState(),O.setState({user:K.user,config:K.config,stellar:K.stellar,authState:K.authState}),q.subscribe(function(e){O.setState({user:e.user,config:e.config,stellar:e.stellar,authState:e.authState})});var H="__BLUX__JWT_STORE",G="__BLUX__RECENT_CONNECTION_METHODS",X="stellar:pubnet",Y="stellar:testnet",Z="https://api.blux.cc",J="blux-app-id",Q=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(!e)throw new Error("appId is missing in config.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ec("".concat(Z,"/auth"),{method:"POST",headers:(n={},n[J]=e,n.Accept="application/json",n["Content-Type"]="application/json",n),body:JSON.stringify({wallet:"",auth_method:"email",auth_value:t})})];case 2:if(400===(r=i.sent()).status)throw new Error("invalid inputs");if(500===r.status)throw new Error("server error");if(429===r.status)throw new Error("too many requests");if(200===r.status)return[2,!0];throw new Error("Unexpected response from api");case 3:throw i.sent(),new Error("Unexpected response from api");case 4:return[2]}})})},ee=function(e,t,r){return M(void 0,void 0,void 0,function(){var n,i;return k(this,function(o){switch(o.label){case 0:if(!e)throw new Error("appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Ec("".concat(Z,"/auth/code"),{method:"POST",headers:(i={},i[J]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify({code:r,wallet:"",auth_method:"email",auth_value:t.authValue})})];case 2:if(400===(n=o.sent()).status)throw new Error("invalid inputs");if(500===n.status)throw new Error("server error");if(404===n.status)throw new Error("invalid code");if(429===n.status)throw new Error("too many requests");if(200===n.status)return[2,n.result];throw new Error("Unexpected response from api");case 3:throw o.sent(),new Error("Unexpected response from api");case 4:return[2]}})})},te=function(e){return M(void 0,void 0,void 0,function(){var t;return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Ec("".concat(Z,"/users"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})];case 1:if(401===(t=r.sent()).status)throw new Error("invalid JWT");if(500===t.status)throw new Error("server error");if(404===t.status)throw new Error("user nout found");if(429===t.status)throw new Error("too many requests");if(200===t.status)return[2,t.result];throw new Error("Unexpected response from api");case 2:throw r.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},re=function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Ec("".concat(Z,"/users/sign-message"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({message:t})})];case 1:if(401===(r=n.sent()).status)throw new Error("invalid JWT");if(500===r.status)throw new Error("server error");if(404===r.status)throw new Error("user nout found");if(429===r.status)throw new Error("too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("Unexpected response from api");case 2:throw n.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},ne=function(e,t,r){return M(void 0,void 0,void 0,function(){var n;return k(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ec("".concat(Z,"/users/sign-transaction"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({xdr:t,network:r})})];case 1:if(401===(n=i.sent()).status)throw new Error("invalid JWT");if(500===n.status)throw new Error("server error");if(404===n.status)throw new Error("user nout found");if(429===n.status)throw new Error("too many requests");if(200===n.status&&n.result)return[2,n.result];throw new Error("Unexpected response from api");case 2:throw i.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},ie={name:b.Api,website:"https://blux.cc",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("API wallet is not defined.")})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("API wallet is not defined.")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2,!1]})})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("API does not support the signAuthEntry function")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var t,r,n,i;return k(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),t=W(),!(r=null===(i=t.auth)||void 0===i?void 0:i.JWT))throw new Error("Failed to sign the message from API");return[4,re(r,e)];case 1:if(n=o.sent())return[2,n];throw new Error("Failed to sign the message from API");case 2:throw o.sent(),new Error("Failed to sign the message from API");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i,o;return k(this,function(s){switch(s.label){case 0:if(s.trys.push([0,2,,3]),r=W(),!(n=null===(o=r.auth)||void 0===o?void 0:o.JWT))throw new Error("Failed to sign the transaction from API");return[4,ne(n,e,t.network)];case 1:if(i=s.sent())return[2,i];throw new Error("Failed to sign the transaction from API");case 2:throw s.sent(),new Error("Failed to sign the transaction from API.");case 3:return[2]}})})}},oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ae(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var ce,ue={},le={},de={},fe={},he={};function pe(){return ce||(ce=1,he.__esModule=!0,he.integers=void 0,he.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),he}var be,me={};function ge(){if(be)return me;be=1,me.__esModule=!0,me.DecodeBuffer=me.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();me.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return me.DecodeBuffer=t,me}var ve,ye,xe={};function we(){if(ve)return xe;ve=1;var e,t=xe&&xe.__extends||(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)});xe.__esModule=!0,xe.validate_schema=xe.ErrorSchema=xe.expect_enum=xe.expect_same_size=xe.expect_bigint=xe.expect_type=xe.isArrayLike=void 0;var r=pe();xe.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},xe.expect_type=function(e,t,r){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))},xe.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},xe.expect_same_size=function(e,t,r){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))},xe.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=r.integers.concat(["bool","string"]),i=["option","enum","array","set","map","struct"],o=function(e){function r(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return t(r,e),r}(Error);function s(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&i.includes(t[0])){var r=t[0];if("option"===r)return s(e[r]);if("enum"===r)return function(e){if(!Array.isArray(e))throw new o(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw new Error('The "struct" in each enum must have a single key');s({struct:n.struct})}}(e[r]);if("array"===r)return function(e){if("object"!=typeof e)throw new o(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return s(e.type);throw new o(e,"{ type, len? }")}(e[r]);if("set"===r)return s(e[r]);if("map"===r)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new o(e,"{ key, value }");s(e.key),s(e.value)}(e[r]);if("struct"===r)return function(e){if("object"!=typeof e)throw new o(e,"object");for(var t in e)s(e[t])}(e[r])}}throw new o(e,i.join(", ")+" or "+n.join(", "))}}return xe.ErrorSchema=o,xe.validate_schema=s,xe}var Ae,Ee,Se={};var _e,Ie={exports:{}},Ne=ae(Object.freeze({__proto__:null,default:{}}));var Ce,Me={},ke={};function Te(){return Ce||(Ce=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.KeySize=ke.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(ke.KeyType=e={})),ke.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),ke;var e}var Re,Be={},je={};function Oe(){if(Re)return je;Re=1,Object.defineProperty(je,"__esModule",{value:!0}),je.KeyPairBase=void 0;return je.KeyPairBase=class{},je}var Le,Pe={},Fe={},Ue={};var De,ze={},We={},$e={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function qe(){if(De)return We;De=1;var e=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(We,"__esModule",{value:!0}),We.ErrorMessages=void 0;const t=e($e);return We.ErrorMessages=t.default,We}var Ke,Ve={},He={},Ge={};var Xe,Ye={};var Ze,Je={};var Qe,et={},tt={};var rt,nt,it,ot={};function st(){return nt||(nt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,r=(Qe||(Qe=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||(tt.IdType=t={}))),tt);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return r.IdType}});var n,i,o=(rt||(rt=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.FinalExecutionStatusBasic=ot.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(n||(ot.ExecutionStatusBasic=n={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(ot.FinalExecutionStatusBasic=i={}))),ot);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(et)),et}function at(){return it||(it=1,function(e){var t=He&&He.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=He&&He.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),r((Ke||(Ke=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.Assignable=void 0,Ge.Assignable=class{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}),Ge),e),r((Xe||(Xe=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.Enum=void 0,Ye.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}),Ye),e),r(function(){if(Ze)return Je;Ze=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.ErrorContext=Je.TypedError=Je.ArgumentTypeError=Je.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}Je.PositionalArgsError=e;class t extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}Je.ArgumentTypeError=t;class r extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}return Je.TypedError=r,Je.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},Je}(),e),r(st(),e)}(He)),He}var ct,ut={exports:{}};function lt(){return ct||(ct=1,ut.exports=function(){
|
|
2
2
|
/*!
|
|
3
3
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
4
4
|
* http://github.com/janl/mustache.js
|
|
5
5
|
*/
|
|
6
|
-
var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function c(e,t){return a.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,b=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function v(e,r){if(!e)return[];var n,o,s,a=!1,c=[],u=[],d=[],f=!1,v=!1,A="",E=0;function _(){if(f&&!v)for(;d.length;)delete u[d.pop()];else d=[];f=!1,v=!1}function I(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),s=new RegExp("\\s*"+i("}"+e[1]))}I(r||S.tags);for(var N,M,
|
|
6
|
+
var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function c(e,t){return a.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,b=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function v(e,r){if(!e)return[];var n,o,s,a=!1,c=[],u=[],d=[],f=!1,v=!1,A="",E=0;function _(){if(f&&!v)for(;d.length;)delete u[d.pop()];else d=[];f=!1,v=!1}function I(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);n=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),s=new RegExp("\\s*"+i("}"+e[1]))}I(r||S.tags);for(var N,C,M,k,T,R,B=new w(e);!B.eos();){if(N=B.pos,M=B.scanUntil(n))for(var j=0,O=M.length;j<O;++j)l(k=M.charAt(j))?(d.push(u.length),A+=k):(v=!0,a=!0,A+=" "),u.push(["text",k,N,N+1]),N+=1,"\n"===k&&(_(),A="",E=0,a=!1);if(!B.scan(n))break;if(f=!0,C=B.scan(g)||"name",B.scan(h),"="===C?(M=B.scanUntil(b),B.scan(b),B.scanUntil(o)):"{"===C?(M=B.scanUntil(s),B.scan(m),B.scanUntil(o),C="&"):M=B.scanUntil(o),!B.scan(o))throw new Error("Unclosed tag at "+B.pos);if(T=">"==C?[C,M,N,B.pos,A,E,a]:[C,M,N,B.pos],E++,u.push(T),"#"===C||"^"===C)c.push(T);else if("/"===C){if(!(R=c.pop()))throw new Error('Unopened section "'+M+'" at '+N);if(R[1]!==M)throw new Error('Unclosed section "'+R[1]+'" at '+N)}else"name"===C||"{"===C||"&"===C?v=!0:"="===C&&I(M)}if(_(),R=c.pop())throw new Error('Unclosed section "'+R[1]+'" at '+B.pos);return x(y(u))}function y(e){for(var t,r,n=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(n.push(t),r=t));return n}function x(e){for(var t,r=[],n=r,i=[],o=0,s=e.length;o<s;++o)switch((t=e[o])[0]){case"#":case"^":n.push(t),i.push(t),n=t[4]=[];break;case"/":i.pop()[5]=t[2],n=i.length>0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function w(e){this.string=e,this.tail=e,this.pos=0}function A(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}w.prototype.eos=function(){return""===this.tail},w.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},w.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},A.prototype.push=function(e){return new A(e,this)},A.prototype.lookup=function(e){var t,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var i,a,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,a=e.split("."),c=0;null!=i&&c<a.length;)c===a.length-1&&(l=o(i,a[c])||s(i,a[c])),i=i[a[c++]];else i=u.view[e],l=o(u.view,e);if(l){t=i;break}u=u.parent}n[e]=t}return r(t)&&(t=t.call(this.view)),t},E.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},E.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||S.tags).join(":"),i=void 0!==r,o=i?r.get(n):void 0;return null==o&&(o=v(e,t),i&&r.set(n,o)),o},E.prototype.render=function(e,t,r,n){var i=this.parse(e,n),o=t instanceof A?t:new A(t,void 0);return this.renderTokens(i,o,r,e,n)},E.prototype.renderTokens=function(e,t,r,n,i){for(var o,s,a,c="",u=0,l=e.length;u<l;++u)a=void 0,"#"===(s=(o=e[u])[0])?a=this.renderSection(o,t,r,n):"^"===s?a=this.renderInverted(o,t,r,n):">"===s?a=this.renderPartial(o,t,r,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(c+=a);return c},E.prototype.renderSection=function(e,n,i,o){var s=this,a="",c=n.lookup(e[1]);function u(e){return s.render(e,n,i)}if(c){if(t(c))for(var l=0,d=c.length;l<d;++l)a+=this.renderTokens(e[4],n.push(c[l]),i,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),i,o);else if(r(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(c=c.call(n.view,o.slice(e[3],e[5]),u))&&(a+=c)}else a+=this.renderTokens(e[4],n,i,o);return a}},E.prototype.renderInverted=function(e,r,n,i){var o=r.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],r,n,i)},E.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!r)&&(i[o]=n+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,n,i){if(n){var o=r(n)?n(e[1]):n[e[1]];if(null!=o){var s=e[6],a=e[5],c=e[4],u=o;return 0==a&&c&&(u=this.indentPartial(o,c,s)),this.renderTokens(this.parse(u,i),t,n,u)}}},E.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},E.prototype.escapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return S.escape(r)},E.prototype.rawValue=function(e){return e[1]};var S={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){_.templateCache=e},get templateCache(){return _.templateCache}},_=new E;return S.clearCache=function(){return _.clearCache()},S.parse=function(e,t){return _.parse(e,t)},S.render=function(e,t,r,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return _.render(e,t,r,i)},S.escape=f,S.Scanner=w,S.Context=A,S.Writer=E,S}()),ut.exports}var dt,ft,ht={},pt={};function bt(){return dt||(dt=1,function(e){function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function r(e,...r){if(!t(e))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(e.length))throw new Error("Uint8Array expected of length "+r+", got length="+e.length)}function n(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function i(e){if("function"!=typeof e)throw new Error("function expected");return!0}function o(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function s(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function a(e){if(!Array.isArray(e))throw new Error("array expected")}function c(e,t){if(!n(!0,t))throw new Error(`${e}: array of strings expected`)}function u(e,t){if(!n(!1,t))throw new Error(`${e}: array of numbers expected`)}function l(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function d(e){const t="string"==typeof e?e.split(""):e,r=t.length;c("alphabet",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(a(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(a(t),t.map(t=>{o("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function f(e=""){return o("join",e),{encode:t=>(c("join.decode",t),t.join(e)),decode:t=>(o("join.decode",t),t.split(e))}}function h(e,t="="){return s(e),o("padding",t),{encode(r){for(c("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){c("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function p(e){return i(e),{encode:e=>e,decode:t=>e(t)}}function b(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(a(e),!e.length)return[];let n=0;const i=[],o=Array.from(e,e=>{if(s(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),c=o.length;for(;;){let e=0,s=!0;for(let i=n;i<c;i++){const a=o[i],c=t*e,u=c+a;if(!Number.isSafeInteger(u)||c/t!==e||u-a!==c)throw new Error("convertRadix: carry overflow");const l=u/r;e=u%r;const d=Math.floor(l);if(o[i]=d,!Number.isSafeInteger(d)||d*r+e!==u)throw new Error("convertRadix: carry overflow");s&&(d?s=!1:n=i)}if(i.push(e),s)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}
|
|
7
7
|
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
8
|
-
Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function y(e,t,r,n){if(a(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(g(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${g(t,r)}`);let i=0,o=0;const c=v[t],u=v[r]-1,l=[];for(const n of e){if(s(n),n>=c)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)l.push((i>>o-r&u)>>>0);const e=v[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<r-o&u,!n&&o>=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&l.push(i>>>0),l}function x(e){s(e);return{encode:r=>{if(!t(r))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(r),256,e)},decode:t=>(u("radix.decode",t),Uint8Array.from(b(t,e,256)))}}function w(e,r=!1){if(s(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!t(n))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(n),8,e,!r)},decode:t=>(u("radix2.decode",t),Uint8Array.from(y(t,e,8,r)))}}function A(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function E(e,r){return s(e),i(r),{encode(n){if(!t(n))throw new Error("checksum.encode: input should be Uint8Array");const i=r(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(i,n.length),o},decode(n){if(!t(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-e),o=n.slice(-e),s=r(i).slice(0,e);for(let t=0;t<e;t++)if(s[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:l,checksum:E,convertRadix:b,convertRadix2:y,radix:x,radix2:w,join:f,padding:h},e.base16=l(w(4),d("0123456789ABCDEF"),f("")),e.base32=l(w(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=l(w(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=l(w(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=l(w(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=l(w(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),p(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const S=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),_=(e,t)=>{o("base64",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})};e.base64=S?{encode:e=>(r(e),e.toBase64()),decode:e=>_(e,!1)}:l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=S?{encode:e=>(r(e),e.toBase64({alphabet:"base64url"})),decode:e=>_(e,!0)}:l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const I=e=>l(x(58),d(e),f(""));e.base58=I("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=I("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=I("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const N=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(N[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=N.indexOf(i.length),s=e.base58.decode(i);for(let e=0;e<s.length-o;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>l(E(4,e=>t(t(e))),e.base58),e.base58check=e.createBase58check;const M=l(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),C=[996825010,642813549,513874426,1027748829,705979059];function T(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<C.length;e++)1==(t>>e&1)&&(r^=C[e]);return r}function k(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=T(i)^r>>5}i=T(i);for(let t=0;t<n;t++)i=T(i)^31&e.charCodeAt(t);for(let e of t)i=T(i)^e;for(let e=0;e<6;e++)i=T(i);return i^=r,M.encode(y([i%v[30]],30,5,!1))}function R(e){const r="bech32"===e?1:734539939,n=w(5),i=n.decode,s=n.encode,a=A(i);function c(e,n,i=90){o("bech32.encode prefix",e),t(n)&&(n=Array.from(n)),u("bech32.encode",n);const s=e.length;if(0===s)throw new TypeError(`Invalid prefix length ${s}`);const a=s+7+n.length;if(!1!==i&&a>i)throw new TypeError(`Length ${a} exceeds limit ${i}`);const c=e.toLowerCase(),l=k(c,n,r);return`${c}1${M.encode(n)}${l}`}function l(e,t=90){o("bech32.decode input",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const s=i.lastIndexOf("1");if(0===s||-1===s)throw new Error('Letter "1" must be present between prefix and data only');const a=i.slice(0,s),c=i.slice(s+1);if(c.length<6)throw new Error("Data must be at least 6 characters long");const u=M.decode(c).slice(0,-6),l=k(a,u,r);if(!c.endsWith(l))throw new Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:a,words:u}}return{encode:c,decode:l,encodeFromBytes:function(e,t){return c(e,s(t))},decodeToBytes:function(e){const{prefix:t,words:r}=l(e,!1);return{prefix:t,words:r,bytes:i(r)}},decodeUnsafe:A(l),fromWords:i,fromWordsUnsafe:a,toWords:s}}e.bech32=R("bech32"),e.bech32m=R("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const B=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),O={encode:e=>(r(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=B?O:l(w(4),d("0123456789abcdef"),f(""),p(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const j={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},L="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,r)=>{if("string"!=typeof e||!j.hasOwnProperty(e))throw new TypeError(L);if(!t(r))throw new TypeError("bytesToString() expects Uint8Array");return j[e].encode(r)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!j.hasOwnProperty(e))throw new TypeError(L);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return j[e].decode(t)},e.bytes=e.stringToBytes}(We)),We}function qe(){return De||(De=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=$e();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const r=[];for(let t=0,n=5n;t<e.NEAR_NOMINATION_EXP;t++,n*=10n)r[t]=n;e.formatNearAmount=function(t,n=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(n!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-n-1;t>0&&(i+=r[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",s=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,n);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${s}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const r=(t=t.replace(/,/g,"").trim()).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(n+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(ze)),ze}var Ke,He,Ve={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function Ge(){if(Ke)return xe;Ke=1;var e=xe&&xe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.getErrorTypeFromErrorMessage=xe.formatError=xe.parseResultError=xe.parseRpcError=xe.ServerError=void 0;const t=je(),r=e(Fe()),n=qe(),i=ve(),o=e(Ve),s={formatNear:()=>(e,t)=>(0,n.formatNearAmount)(t(e))};class a extends t.TypedError{}xe.ServerError=a;class c extends a{transaction_outcome}function u(e){const t={},r=d(e,o.default.schema,t,""),n=new a(l(r,t),r);return Object.assign(n,t),n}function l(e,t){return"string"==typeof i.ErrorMessages[e]?r.default.render(i.ErrorMessages[e],{...t,...s}):JSON.stringify(t)}function d(e,t,r,n){let i,o,s;for(const r in t){if(h(e[r]))return e[r];if(f(e[r]))i=e[r],o=t[r],s=r;else{if(!f(e.kind)||!f(e.kind[r]))continue;i=e.kind[r],o=t[r],s=r}}if(i&&o){for(const e of Object.keys(o.props))r[e]=i[e];return d(i,t,r,s)}return r.kind=e,n}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"[object String]"===Object.prototype.toString.call(e)}return xe.parseRpcError=u,xe.parseResultError=function(e){const t=u(e.status.Failure),r=new c;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r},xe.formatError=l,xe.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},xe}function Xe(){return He||(He=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=ve();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var r=Ge();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return r.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return r.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return r.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return r.parseRpcError}})}(be)),be}var Ye,Ze={},Je={},Qe={};function et(){if(Ye)return Qe;Ye=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.ConsoleLogger=void 0;return Qe.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},Qe}var tt,rt,nt,it={};function ot(){return rt||(rt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=et();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var r=function(){if(tt)return it;tt=1,Object.defineProperty(it,"__esModule",{value:!0}),it.Logger=void 0;const e=new(et().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return it.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},it}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return r.Logger}})}(Je)),Je}var st,at={};var ct,ut,lt={};
|
|
8
|
+
Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function y(e,t,r,n){if(a(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(g(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${g(t,r)}`);let i=0,o=0;const c=v[t],u=v[r]-1,l=[];for(const n of e){if(s(n),n>=c)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)l.push((i>>o-r&u)>>>0);const e=v[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<r-o&u,!n&&o>=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&l.push(i>>>0),l}function x(e){s(e);return{encode:r=>{if(!t(r))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(r),256,e)},decode:t=>(u("radix.decode",t),Uint8Array.from(b(t,e,256)))}}function w(e,r=!1){if(s(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!t(n))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(n),8,e,!r)},decode:t=>(u("radix2.decode",t),Uint8Array.from(y(t,e,8,r)))}}function A(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function E(e,r){return s(e),i(r),{encode(n){if(!t(n))throw new Error("checksum.encode: input should be Uint8Array");const i=r(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(i,n.length),o},decode(n){if(!t(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-e),o=n.slice(-e),s=r(i).slice(0,e);for(let t=0;t<e;t++)if(s[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:l,checksum:E,convertRadix:b,convertRadix2:y,radix:x,radix2:w,join:f,padding:h},e.base16=l(w(4),d("0123456789ABCDEF"),f("")),e.base32=l(w(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=l(w(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=l(w(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=l(w(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=l(w(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),p(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const S=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),_=(e,t)=>{o("base64",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})};e.base64=S?{encode:e=>(r(e),e.toBase64()),decode:e=>_(e,!1)}:l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=S?{encode:e=>(r(e),e.toBase64({alphabet:"base64url"})),decode:e=>_(e,!0)}:l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=l(w(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const I=e=>l(x(58),d(e),f(""));e.base58=I("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=I("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=I("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const N=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(N[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=N.indexOf(i.length),s=e.base58.decode(i);for(let e=0;e<s.length-o;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>l(E(4,e=>t(t(e))),e.base58),e.base58check=e.createBase58check;const C=l(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),M=[996825010,642813549,513874426,1027748829,705979059];function k(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<M.length;e++)1==(t>>e&1)&&(r^=M[e]);return r}function T(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=k(i)^r>>5}i=k(i);for(let t=0;t<n;t++)i=k(i)^31&e.charCodeAt(t);for(let e of t)i=k(i)^e;for(let e=0;e<6;e++)i=k(i);return i^=r,C.encode(y([i%v[30]],30,5,!1))}function R(e){const r="bech32"===e?1:734539939,n=w(5),i=n.decode,s=n.encode,a=A(i);function c(e,n,i=90){o("bech32.encode prefix",e),t(n)&&(n=Array.from(n)),u("bech32.encode",n);const s=e.length;if(0===s)throw new TypeError(`Invalid prefix length ${s}`);const a=s+7+n.length;if(!1!==i&&a>i)throw new TypeError(`Length ${a} exceeds limit ${i}`);const c=e.toLowerCase(),l=T(c,n,r);return`${c}1${C.encode(n)}${l}`}function l(e,t=90){o("bech32.decode input",e);const n=e.length;if(n<8||!1!==t&&n>t)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const s=i.lastIndexOf("1");if(0===s||-1===s)throw new Error('Letter "1" must be present between prefix and data only');const a=i.slice(0,s),c=i.slice(s+1);if(c.length<6)throw new Error("Data must be at least 6 characters long");const u=C.decode(c).slice(0,-6),l=T(a,u,r);if(!c.endsWith(l))throw new Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:a,words:u}}return{encode:c,decode:l,encodeFromBytes:function(e,t){return c(e,s(t))},decodeToBytes:function(e){const{prefix:t,words:r}=l(e,!1);return{prefix:t,words:r,bytes:i(r)}},decodeUnsafe:A(l),fromWords:i,fromWordsUnsafe:a,toWords:s}}e.bech32=R("bech32"),e.bech32m=R("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const B=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),j={encode:e=>(r(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=B?j:l(w(4),d("0123456789abcdef"),f(""),p(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const O={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},L="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,r)=>{if("string"!=typeof e||!O.hasOwnProperty(e))throw new TypeError(L);if(!t(r))throw new TypeError("bytesToString() expects Uint8Array");return O[e].encode(r)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!O.hasOwnProperty(e))throw new TypeError(L);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return O[e].decode(t)},e.bytes=e.stringToBytes}(pt)),pt}function mt(){return ft||(ft=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=bt();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const r=[];for(let t=0,n=5n;t<e.NEAR_NOMINATION_EXP;t++,n*=10n)r[t]=n;e.formatNearAmount=function(t,n=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(n!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-n-1;t>0&&(i+=r[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",s=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,n);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${s}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const r=(t=t.replace(/,/g,"").trim()).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(n+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(ht)),ht}var gt,vt,yt={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function xt(){if(gt)return Ve;gt=1;var e=Ve&&Ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getErrorTypeFromErrorMessage=Ve.formatError=Ve.parseResultError=Ve.parseRpcError=Ve.ServerError=void 0;const t=at(),r=e(lt()),n=mt(),i=qe(),o=e(yt),s={formatNear:()=>(e,t)=>(0,n.formatNearAmount)(t(e))};class a extends t.TypedError{}Ve.ServerError=a;class c extends a{transaction_outcome}function u(e){const t={},r=d(e,o.default.schema,t,""),n=new a(l(r,t),r);return Object.assign(n,t),n}function l(e,t){return"string"==typeof i.ErrorMessages[e]?r.default.render(i.ErrorMessages[e],{...t,...s}):JSON.stringify(t)}function d(e,t,r,n){let i,o,s;for(const r in t){if(h(e[r]))return e[r];if(f(e[r]))i=e[r],o=t[r],s=r;else{if(!f(e.kind)||!f(e.kind[r]))continue;i=e.kind[r],o=t[r],s=r}}if(i&&o){for(const e of Object.keys(o.props))r[e]=i[e];return d(i,t,r,s)}return r.kind=e,n}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"[object String]"===Object.prototype.toString.call(e)}return Ve.parseRpcError=u,Ve.parseResultError=function(e){const t=u(e.status.Failure),r=new c;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r},Ve.formatError=l,Ve.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},Ve}function wt(){return vt||(vt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=qe();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var r=xt();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return r.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return r.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return r.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return r.parseRpcError}})}(ze)),ze}var At,Et={},St={},_t={};function It(){if(At)return _t;At=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.ConsoleLogger=void 0;return _t.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},_t}var Nt,Ct,Mt,kt={};function Tt(){return Ct||(Ct=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=It();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var r=function(){if(Nt)return kt;Nt=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.Logger=void 0;const e=new(It().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return kt.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},kt}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return r.Logger}})}(St)),St}var Rt,Bt={};var jt,Ot,Lt={};
|
|
9
9
|
/*!
|
|
10
10
|
* depd
|
|
11
11
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
12
12
|
* MIT Licensed
|
|
13
|
-
*/var
|
|
13
|
+
*/var Pt,Ft,Ut,Dt={};function zt(){if(Pt)return Dt;return Pt=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.sortBigIntAsc=void 0,Dt.sortBigIntAsc=function(e,t){return e<t?-1:e>t?1:0},Dt}function Wt(){if(Ft)return Lt;Ft=1;var e=Lt&&Lt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.diffEpochValidators=Lt.findSeatPrice=void 0;const t=e(function(){if(Ot)return jt;function e(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}return Ot=1,jt=function(r){if(!r)throw new TypeError("argument namespace is required");function n(e){}return n._file=void 0,n._ignored=!0,n._namespace=r,n._traced=!1,n._warned=Object.create(null),n.function=e,n.property=t,n}}()),r=zt();return Lt.findSeatPrice=function(e,n,i,o){if(o&&o<49)return function(e,t){const n=e.map(e=>BigInt(e.stake)).sort(r.sortBigIntAsc),i=BigInt(t),o=n.reduce((e,t)=>e+t);if(o<i)throw new Error("Stakes are below seats");let s=1n,a=o+1n;for(;s!==a-1n;){const e=(s+a)/2n;let t=!1,r=0n;for(let o=0;o<n.length;++o)if(r+=n[o]/e,r>=i){s=e,t=!0;break}t||(a=e)}return s}(e,n);if(!i){(0,t.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),i=[1,6250]}return function(e,t,n){if(2!=n.length)throw Error("minimumStakeRatio should have 2 elements");const i=e.map(e=>BigInt(e.stake)).sort(r.sortBigIntAsc),o=i.reduce((e,t)=>e+t);return e.length<t?o*BigInt(n[0])/BigInt(n[1]):i[0]+1n}(e,n,i)},Lt.diffEpochValidators=function(e,t){const r=new Map;e.forEach(e=>r.set(e.account_id,e));const n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}},Lt}function $t(){return Ut||(Ut=1,function(e){var t=Fe&&Fe.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=Fe&&Fe.__exportStar||function(e,r){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(r,n)||t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),r((Le||(Le=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.DEFAULT_FUNCTION_CALL_GAS=void 0,Ue.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),Ue),e),r(wt(),e),r(mt(),e),r(function(){if(Mt)return Et;Mt=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.printTxOutcomeLogs=Et.printTxOutcomeLogsAndFailures=void 0;const e=wt(),t=Tt();function r({contractId:e,logs:r,prefix:n=""}){for(const i of r)t.Logger.log(`${n}Log [${e}]: ${i}`)}return Et.printTxOutcomeLogsAndFailures=function({contractId:n,outcome:i}){const o=[i.transaction_outcome,...i.receipts_outcome].reduce((t,r)=>{const n="object"==typeof r.outcome.status&&"object"==typeof r.outcome.status.Failure;return r.outcome.logs.length||n?t.concat({receiptIds:r.outcome.receipt_ids,logs:r.outcome.logs,failure:"object"==typeof r.outcome.status&&void 0!==r.outcome.status.Failure?(0,e.parseRpcError)(r.outcome.status.Failure):null}):t},[]);for(const e of o)t.Logger.log(`Receipt${e.receiptIds.length>1?"s":""}: ${e.receiptIds.join(", ")}`),r({contractId:n,logs:e.logs,prefix:"\t"}),e.failure&&t.Logger.warn(`\tFailure [${n}]: ${e.failure}`)},Et.printTxOutcomeLogs=r,Et}(),e),r((Rt||(Rt=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getTransactionLastResult=void 0,Bt.getTransactionLastResult=function(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){const t=Buffer.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}),Bt),e),r(Wt(),e),r(Tt(),e),r(zt(),e)}(Fe)),Fe}var qt,Kt={},Vt={},Ht={},Gt={};function Xt(){if(qt)return Gt;function e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function t(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}return qt=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.anumber=e,Gt.abytes=t,Gt.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");e(t.outputLen),e(t.blockLen)},Gt.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},Gt.aoutput=function(e,r){t(e);const n=r.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},Gt}var Yt,Zt,Jt,Qt={},er={};function tr(){return Zt||(Zt=1,function(e){
|
|
14
14
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
15
|
-
Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=n,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=n(e[t])},e.bytesToHex=function(e){(0,r.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=s(e.charCodeAt(i)),o=s(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=a,e.toBytes=c,e.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];(0,r.abytes)(i),t+=i.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(c(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(St||(St=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.crypto=void 0,Mt.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),Mt),r=Et();function n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>n(e);const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function s(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function c(e){return"string"==typeof e&&(e=a(e)),(0,r.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(Nt)),Nt}function Tt(){if(It)return wt;It=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.HashMD=void 0,wt.setBigUint64=r,wt.Chi=function(e,t,r){return e&t^~e&r},wt.Maj=function(e,t,r){return e&t^e&r^t&r};const e=Et(),t=Ct();function r(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}class n extends t.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(r){(0,e.aexists)(this);const{view:n,buffer:i,blockLen:o}=this,s=(r=(0,t.toBytes)(r)).length;for(let e=0;e<s;){const a=Math.min(o-this.pos,s-e);if(a===o){const n=(0,t.createView)(r);for(;o<=s-e;e+=o)this.process(n,e);continue}i.set(r.subarray(e,e+a),this.pos),this.pos+=a,e+=a,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(n){(0,e.aexists)(this),(0,e.aoutput)(n,this),this.finished=!0;const{buffer:i,view:o,blockLen:s,isLE:a}=this;let{pos:c}=this;i[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(o,0),c=0);for(let e=c;e<s;e++)i[e]=0;r(o,s-8,BigInt(8*this.length),a),this.process(o,0);const u=(0,t.createView)(n),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}return wt.HashMD=n,wt}var kt,Rt,Bt={};function Ot(){if(kt)return Bt;kt=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.add5L=Bt.add5H=Bt.add4H=Bt.add4L=Bt.add3H=Bt.add3L=Bt.rotlBL=Bt.rotlBH=Bt.rotlSL=Bt.rotlSH=Bt.rotr32L=Bt.rotr32H=Bt.rotrBL=Bt.rotrBH=Bt.rotrSL=Bt.rotrSH=Bt.shrSL=Bt.shrSH=Bt.toBig=void 0,Bt.fromBig=r,Bt.split=n,Bt.add=g;const e=BigInt(2**32-1),t=BigInt(32);function r(r,n=!1){return n?{h:Number(r&e),l:Number(r>>t&e)}:{h:0|Number(r>>t&e),l:0|Number(r&e)}}function n(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=r(e[o],t);[n[o],i[o]]=[s,a]}return[n,i]}const i=(e,r)=>BigInt(e>>>0)<<t|BigInt(r>>>0);Bt.toBig=i;const o=(e,t,r)=>e>>>r;Bt.shrSH=o;const s=(e,t,r)=>e<<32-r|t>>>r;Bt.shrSL=s;const a=(e,t,r)=>e>>>r|t<<32-r;Bt.rotrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;Bt.rotrSL=c;const u=(e,t,r)=>e<<64-r|t>>>r-32;Bt.rotrBH=u;const l=(e,t,r)=>e>>>r-32|t<<64-r;Bt.rotrBL=l;const d=(e,t)=>t;Bt.rotr32H=d;const f=(e,t)=>e;Bt.rotr32L=f;const h=(e,t,r)=>e<<r|t>>>32-r;Bt.rotlSH=h;const p=(e,t,r)=>t<<r|e>>>32-r;Bt.rotlSL=p;const b=(e,t,r)=>t<<r-32|e>>>64-r;Bt.rotlBH=b;const m=(e,t,r)=>e<<r-32|t>>>64-r;function g(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}Bt.rotlBL=m;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);Bt.add3L=v;const y=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;Bt.add3H=y;const x=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);Bt.add4L=x;const w=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;Bt.add4H=w;const A=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Bt.add5L=A;const E=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;Bt.add5H=E;const S={fromBig:r,split:n,toBig:i,shrSH:o,shrSL:s,rotrSH:a,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:p,rotlBH:b,rotlBL:m,add:g,add3L:v,add3H:y,add4L:x,add4H:w,add5H:E,add5L:A};return Bt.default=S,Bt}function jt(){if(Rt)return xt;Rt=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.sha384=xt.sha512_256=xt.sha512_224=xt.sha512=xt.SHA384=xt.SHA512_256=xt.SHA512_224=xt.SHA512=void 0;const e=Tt(),t=Ot(),r=Ct(),[n,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),o=new Uint32Array(80),s=new Uint32Array(80);class a extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,b]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,r){for(let t=0;t<16;t++,r+=4)o[t]=e.getUint32(r),s[t]=e.getUint32(r+=4);for(let e=16;e<80;e++){const r=0|o[e-15],n=0|s[e-15],i=t.default.rotrSH(r,n,1)^t.default.rotrSH(r,n,8)^t.default.shrSH(r,n,7),a=t.default.rotrSL(r,n,1)^t.default.rotrSL(r,n,8)^t.default.shrSL(r,n,7),c=0|o[e-2],u=0|s[e-2],l=t.default.rotrSH(c,u,19)^t.default.rotrBH(c,u,61)^t.default.shrSH(c,u,6),d=t.default.rotrSL(c,u,19)^t.default.rotrBL(c,u,61)^t.default.shrSL(c,u,6),f=t.default.add4L(a,d,s[e-7],s[e-16]),h=t.default.add4H(f,i,l,o[e-7],o[e-16]);o[e]=0|h,s[e]=0|f}let{Ah:a,Al:c,Bh:u,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:v,Gh:y,Gl:x,Hh:w,Hl:A}=this;for(let e=0;e<80;e++){const r=t.default.rotrSH(b,m,14)^t.default.rotrSH(b,m,18)^t.default.rotrBH(b,m,41),E=t.default.rotrSL(b,m,14)^t.default.rotrSL(b,m,18)^t.default.rotrBL(b,m,41),S=b&g^~b&y,_=m&v^~m&x,I=t.default.add5L(A,E,_,i[e],s[e]),N=t.default.add5H(I,w,r,S,n[e],o[e]),M=0|I,C=t.default.rotrSH(a,c,28)^t.default.rotrBH(a,c,34)^t.default.rotrBH(a,c,39),T=t.default.rotrSL(a,c,28)^t.default.rotrBL(a,c,34)^t.default.rotrBL(a,c,39),k=a&u^a&d^u&d,R=c&l^c&f^l&f;w=0|y,A=0|x,y=0|g,x=0|v,g=0|b,v=0|m,({h:b,l:m}=t.default.add(0|h,0|p,0|N,0|M)),h=0|d,p=0|f,d=0|u,f=0|l,u=0|a,l=0|c;const B=t.default.add3L(M,T,R);a=t.default.add3H(B,N,C,k),c=0|B}({h:a,l:c}=t.default.add(0|this.Ah,0|this.Al,0|a,0|c)),({h:u,l:l}=t.default.add(0|this.Bh,0|this.Bl,0|u,0|l)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=t.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:v}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|v)),({h:y,l:x}=t.default.add(0|this.Gh,0|this.Gl,0|y,0|x)),({h:w,l:A}=t.default.add(0|this.Hh,0|this.Hl,0|w,0|A)),this.set(a,c,u,l,d,f,h,p,b,m,g,v,y,x,w,A)}roundClean(){o.fill(0),s.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}xt.SHA512=a;class c extends a{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}xt.SHA512_224=c;class u extends a{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}xt.SHA512_256=u;class l extends a{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return xt.SHA384=l,xt.sha512=(0,r.wrapConstructor)(()=>new a),xt.sha512_224=(0,r.wrapConstructor)(()=>new c),xt.sha512_256=(0,r.wrapConstructor)(()=>new u),xt.sha384=(0,r.wrapConstructor)(()=>new l),xt}var Lt,Pt,Ft,Ut={},Dt={},zt={};function Wt(){if(Lt)return zt;Lt=1,
|
|
15
|
+
Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=n,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=n(e[t])},e.bytesToHex=function(e){(0,r.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=s(e.charCodeAt(i)),o=s(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=a,e.toBytes=c,e.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];(0,r.abytes)(i),t+=i.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(c(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(Yt||(Yt=1,Object.defineProperty(er,"__esModule",{value:!0}),er.crypto=void 0,er.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),er),r=Xt();function n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>n(e);const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function s(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function c(e){return"string"==typeof e&&(e=a(e)),(0,r.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(Qt)),Qt}function rr(){if(Jt)return Ht;Jt=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.HashMD=void 0,Ht.setBigUint64=r,Ht.Chi=function(e,t,r){return e&t^~e&r},Ht.Maj=function(e,t,r){return e&t^e&r^t&r};const e=Xt(),t=tr();function r(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}class n extends t.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(r){(0,e.aexists)(this);const{view:n,buffer:i,blockLen:o}=this,s=(r=(0,t.toBytes)(r)).length;for(let e=0;e<s;){const a=Math.min(o-this.pos,s-e);if(a===o){const n=(0,t.createView)(r);for(;o<=s-e;e+=o)this.process(n,e);continue}i.set(r.subarray(e,e+a),this.pos),this.pos+=a,e+=a,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(n){(0,e.aexists)(this),(0,e.aoutput)(n,this),this.finished=!0;const{buffer:i,view:o,blockLen:s,isLE:a}=this;let{pos:c}=this;i[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(o,0),c=0);for(let e=c;e<s;e++)i[e]=0;r(o,s-8,BigInt(8*this.length),a),this.process(o,0);const u=(0,t.createView)(n),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}return Ht.HashMD=n,Ht}var nr,ir,or={};function sr(){if(nr)return or;nr=1,Object.defineProperty(or,"__esModule",{value:!0}),or.add5L=or.add5H=or.add4H=or.add4L=or.add3H=or.add3L=or.rotlBL=or.rotlBH=or.rotlSL=or.rotlSH=or.rotr32L=or.rotr32H=or.rotrBL=or.rotrBH=or.rotrSL=or.rotrSH=or.shrSL=or.shrSH=or.toBig=void 0,or.fromBig=r,or.split=n,or.add=g;const e=BigInt(2**32-1),t=BigInt(32);function r(r,n=!1){return n?{h:Number(r&e),l:Number(r>>t&e)}:{h:0|Number(r>>t&e),l:0|Number(r&e)}}function n(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=r(e[o],t);[n[o],i[o]]=[s,a]}return[n,i]}const i=(e,r)=>BigInt(e>>>0)<<t|BigInt(r>>>0);or.toBig=i;const o=(e,t,r)=>e>>>r;or.shrSH=o;const s=(e,t,r)=>e<<32-r|t>>>r;or.shrSL=s;const a=(e,t,r)=>e>>>r|t<<32-r;or.rotrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;or.rotrSL=c;const u=(e,t,r)=>e<<64-r|t>>>r-32;or.rotrBH=u;const l=(e,t,r)=>e>>>r-32|t<<64-r;or.rotrBL=l;const d=(e,t)=>t;or.rotr32H=d;const f=(e,t)=>e;or.rotr32L=f;const h=(e,t,r)=>e<<r|t>>>32-r;or.rotlSH=h;const p=(e,t,r)=>t<<r|e>>>32-r;or.rotlSL=p;const b=(e,t,r)=>t<<r-32|e>>>64-r;or.rotlBH=b;const m=(e,t,r)=>e<<r-32|t>>>64-r;function g(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}or.rotlBL=m;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);or.add3L=v;const y=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;or.add3H=y;const x=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);or.add4L=x;const w=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;or.add4H=w;const A=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);or.add5L=A;const E=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;or.add5H=E;const S={fromBig:r,split:n,toBig:i,shrSH:o,shrSL:s,rotrSH:a,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:p,rotlBH:b,rotlBL:m,add:g,add3L:v,add3H:y,add4L:x,add4H:w,add5H:E,add5L:A};return or.default=S,or}function ar(){if(ir)return Vt;ir=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.sha384=Vt.sha512_256=Vt.sha512_224=Vt.sha512=Vt.SHA384=Vt.SHA512_256=Vt.SHA512_224=Vt.SHA512=void 0;const e=rr(),t=sr(),r=tr(),[n,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),o=new Uint32Array(80),s=new Uint32Array(80);class a extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,b]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,r){for(let t=0;t<16;t++,r+=4)o[t]=e.getUint32(r),s[t]=e.getUint32(r+=4);for(let e=16;e<80;e++){const r=0|o[e-15],n=0|s[e-15],i=t.default.rotrSH(r,n,1)^t.default.rotrSH(r,n,8)^t.default.shrSH(r,n,7),a=t.default.rotrSL(r,n,1)^t.default.rotrSL(r,n,8)^t.default.shrSL(r,n,7),c=0|o[e-2],u=0|s[e-2],l=t.default.rotrSH(c,u,19)^t.default.rotrBH(c,u,61)^t.default.shrSH(c,u,6),d=t.default.rotrSL(c,u,19)^t.default.rotrBL(c,u,61)^t.default.shrSL(c,u,6),f=t.default.add4L(a,d,s[e-7],s[e-16]),h=t.default.add4H(f,i,l,o[e-7],o[e-16]);o[e]=0|h,s[e]=0|f}let{Ah:a,Al:c,Bh:u,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:v,Gh:y,Gl:x,Hh:w,Hl:A}=this;for(let e=0;e<80;e++){const r=t.default.rotrSH(b,m,14)^t.default.rotrSH(b,m,18)^t.default.rotrBH(b,m,41),E=t.default.rotrSL(b,m,14)^t.default.rotrSL(b,m,18)^t.default.rotrBL(b,m,41),S=b&g^~b&y,_=m&v^~m&x,I=t.default.add5L(A,E,_,i[e],s[e]),N=t.default.add5H(I,w,r,S,n[e],o[e]),C=0|I,M=t.default.rotrSH(a,c,28)^t.default.rotrBH(a,c,34)^t.default.rotrBH(a,c,39),k=t.default.rotrSL(a,c,28)^t.default.rotrBL(a,c,34)^t.default.rotrBL(a,c,39),T=a&u^a&d^u&d,R=c&l^c&f^l&f;w=0|y,A=0|x,y=0|g,x=0|v,g=0|b,v=0|m,({h:b,l:m}=t.default.add(0|h,0|p,0|N,0|C)),h=0|d,p=0|f,d=0|u,f=0|l,u=0|a,l=0|c;const B=t.default.add3L(C,k,R);a=t.default.add3H(B,N,M,T),c=0|B}({h:a,l:c}=t.default.add(0|this.Ah,0|this.Al,0|a,0|c)),({h:u,l:l}=t.default.add(0|this.Bh,0|this.Bl,0|u,0|l)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=t.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:v}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|v)),({h:y,l:x}=t.default.add(0|this.Gh,0|this.Gl,0|y,0|x)),({h:w,l:A}=t.default.add(0|this.Hh,0|this.Hl,0|w,0|A)),this.set(a,c,u,l,d,f,h,p,b,m,g,v,y,x,w,A)}roundClean(){o.fill(0),s.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Vt.SHA512=a;class c extends a{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Vt.SHA512_224=c;class u extends a{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Vt.SHA512_256=u;class l extends a{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Vt.SHA384=l,Vt.sha512=(0,r.wrapConstructor)(()=>new a),Vt.sha512_224=(0,r.wrapConstructor)(()=>new c),Vt.sha512_256=(0,r.wrapConstructor)(()=>new u),Vt.sha384=(0,r.wrapConstructor)(()=>new l),Vt}var cr,ur,lr,dr={},fr={},hr={};function pr(){if(cr)return hr;cr=1,
|
|
16
16
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
17
|
-
Object.defineProperty(
|
|
17
|
+
Object.defineProperty(hr,"__esModule",{value:!0}),hr.notImplemented=hr.bitMask=void 0,hr.isBytes=n,hr.abytes=i,hr.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},hr.bytesToHex=s,hr.numberToHexUnpadded=a,hr.hexToNumber=c,hr.hexToBytes=d,hr.bytesToNumberBE=function(e){return c(s(e))},hr.bytesToNumberLE=function(e){return i(e),c(s(Uint8Array.from(e).reverse()))},hr.numberToBytesBE=f,hr.numberToBytesLE=function(e,t){return f(e,t).reverse()},hr.numberToVarBytesBE=function(e){return d(a(e))},hr.ensureBytes=function(e,t,r){let i;if("string"==typeof t)try{i=d(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!n(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const o=i.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return i},hr.concatBytes=h,hr.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},hr.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},hr.inRange=b,hr.aInRange=function(e,t,r,n){if(!b(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},hr.bitLen=function(r){let n;for(n=0;r>e;r>>=t,n+=1);return n},hr.bitGet=function(e,r){return e>>BigInt(r)&t},hr.bitSet=function(r,n,i){return r|(i?t:e)<<BigInt(n)},hr.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=m(e),i=m(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=m())=>{i=a(g([0]),e),n=a(),0!==e.length&&(i=a(g([1]),e),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return h(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}},hr.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=v[r];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e},hr.memoized=function(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const o=e(r,...n);return t.set(r,o),o}};const e=BigInt(0),t=BigInt(1),r=BigInt(2);function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!n(e))throw new Error("Uint8Array expected")}const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function s(e){i(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t}function a(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?e:BigInt("0x"+t)}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function l(e){return e>=u._0&&e<=u._9?e-u._0:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=l(e.charCodeAt(i)),o=l(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n}function f(e,t){return d(e.toString(16).padStart(2*t,"0"))}function h(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];i(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const p=t=>"bigint"==typeof t&&e<=t;function b(e,t,r){return p(e)&&p(t)&&p(r)&&t<=e&&e<r}hr.bitMask=e=>(r<<BigInt(e-1))-t;const m=e=>new Uint8Array(e),g=e=>Uint8Array.from(e);const v={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||n(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};return hr.notImplemented=()=>{throw new Error("not implemented")},hr}function br(){if(ur)return fr;ur=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.isNegativeLE=void 0,fr.mod=c,fr.pow=u,fr.pow2=function(e,r,n){let i=e;for(;r-- >t;)i*=i,i%=n;return i},fr.invert=l,fr.tonelliShanks=d,fr.FpSqrt=f,fr.validateField=function(t){const r=h.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,e.validateObject)(t,r)},fr.FpPow=p,fr.FpInvertBatch=b,fr.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?l(r,e.ORDER):e.inv(r))},fr.FpLegendre=m,fr.FpIsSquare=function(e){const t=m(e.ORDER);return r=>{const n=t(e,r);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},fr.nLength=g,fr.Field=function(n,i,o=!1,s={}){if(n<=t)throw new Error("invalid field: expected ORDER > 0, got "+n);const{nBitLength:a,nByteLength:u}=g(n,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const h=Object.freeze({ORDER:n,isLE:o,BITS:a,BYTES:u,MASK:(0,e.bitMask)(a),ZERO:t,ONE:r,create:e=>c(e,n),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return t<=e&&e<n},is0:e=>e===t,isOdd:e=>(e&r)===r,neg:e=>c(-e,n),eql:(e,t)=>e===t,sqr:e=>c(e*e,n),add:(e,t)=>c(e+t,n),sub:(e,t)=>c(e-t,n),mul:(e,t)=>c(e*t,n),pow:(e,t)=>p(h,e,t),div:(e,t)=>c(e*l(t,n),n),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>l(e,n),sqrt:s.sqrt||(e=>(d||(d=f(n)),d(h,e))),invertBatch:e=>b(h,e),cmov:(e,t,r)=>r?t:e,toBytes:t=>o?(0,e.numberToBytesLE)(t,u):(0,e.numberToBytesBE)(t,u),fromBytes:t=>{if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);return o?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t)}});return Object.freeze(h)},fr.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},fr.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},fr.hashToPrivateScalar=function(t,n,i=!1){t=(0,e.ensureBytes)("privateHash",t);const o=t.length,s=g(n).nByteLength+8;if(s<24||o<s||o>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+o);const a=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t);return c(a,n-r)+r},fr.getFieldBytesLength=v,fr.getMinHashLength=y,fr.mapHashToField=function(t,n,i=!1){const o=t.length,s=v(n),a=y(n);if(o<16||o<a||o>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+o);const u=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t),l=c(u,n-r)+r;return i?(0,e.numberToBytesLE)(l,s):(0,e.numberToBytesBE)(l,s)};
|
|
18
18
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
19
|
-
const e=
|
|
19
|
+
const e=pr(),t=BigInt(0),r=BigInt(1),n=BigInt(2),i=BigInt(3),o=BigInt(4),s=BigInt(5),a=BigInt(8);function c(e,r){const n=e%r;return n>=t?n:r+n}function u(e,n,i){if(n<t)throw new Error("invalid exponent, negatives unsupported");if(i<=t)throw new Error("invalid modulus");if(i===r)return t;let o=r;for(;n>t;)n&r&&(o=o*e%i),e=e*e%i,n>>=r;return o}function l(e,n){if(e===t)throw new Error("invert: expected non-zero number");if(n<=t)throw new Error("invert: expected positive modulus, got "+n);let i=c(e,n),o=n,s=t,a=r;for(;i!==t;){const e=o%i,t=s-a*(o/i);o=i,i=e,s=a,a=t}if(o!==r)throw new Error("invert: does not exist");return c(s,n)}function d(e){const i=(e-r)/n;let s,a,c;for(s=e-r,a=0;s%n===t;s/=n,a++);for(c=n;c<e&&u(c,i,e)!==e-r;c++)if(c>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===a){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const l=(s+r)/n;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw new Error("Cannot find square root");let n=a,o=e.pow(e.mul(e.ONE,c),s),u=e.pow(t,l),d=e.pow(t,s);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<n&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const i=e.pow(o,r<<BigInt(n-t-1));o=e.sqr(i),u=e.mul(u,i),d=e.mul(d,o),n=t}return u}}function f(e){if(e%o===i){const t=(e+r)/o;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%a===s){const t=(e-s)/a;return function(e,r){const i=e.mul(r,n),o=e.pow(i,t),s=e.mul(r,o),a=e.mul(e.mul(s,n),o),c=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return d(e)}fr.isNegativeLE=(e,t)=>(c(e,t)&r)===r;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p(e,n,i){if(i<t)throw new Error("invalid exponent, negatives unsupported");if(i===t)return e.ONE;if(i===r)return n;let o=e.ONE,s=n;for(;i>t;)i&r&&(o=e.mul(o,s)),s=e.sqr(s),i>>=r;return o}function b(e,t){const r=new Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function m(e){const t=(e-r)/n;return(e,r)=>e.pow(r,t)}function g(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function v(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function y(e){const t=v(e);return t+Math.ceil(t/2)}return fr}function mr(){if(lr)return dr;lr=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.wNAF=function(e,t){return{constTimeNegate:i,hasPrecomputes:e=>1!==d(e),unsafeLadder(t,i,o=e.ZERO){let s=t;for(;i>r;)i&n&&(o=o.add(s)),s=s.double(),i>>=n;return o},precomputeWindow(e,r){const{windows:n,windowSize:i}=s(r,t),o=[];let a=e,c=a;for(let e=0;e<n;e++){c=a,o.push(c);for(let e=1;e<i;e++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,o,a){const{windows:c,windowSize:u}=s(r,t);let l=e.ZERO,d=e.BASE;const f=BigInt(2**r-1),h=2**r,p=BigInt(r);for(let e=0;e<c;e++){const t=e*u;let r=Number(a&f);a>>=p,r>u&&(r-=h,a+=n);const s=t,c=t+Math.abs(r)-1,b=e%2!=0,m=r<0;0===r?d=d.add(i(b,o[s])):l=l.add(i(m,o[c]))}return{p:l,f:d}},wNAFUnsafe(i,o,a,c=e.ZERO){const{windows:u,windowSize:l}=s(i,t),d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let e=0;e<u;e++){const t=e*l;if(a===r)break;let i=Number(a&d);if(a>>=h,i>l&&(i-=f,a+=n),0===i)continue;let s=o[t+Math.abs(i)-1];i<0&&(s=s.negate()),c=c.add(s)}return c},getPrecomputes(e,t,r){let n=u.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&u.set(t,r(n))),n},wNAFCached(e,t,r){const n=d(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=d(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){o(r,t),l.set(e,r),u.delete(e)}}},dr.pippenger=function(e,r,n,i){if(a(n,e),c(i,r),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,s=(0,t.bitLen)(BigInt(n.length)),u=s>12?s-3:s>4?s-2:s?2:1,l=(1<<u)-1,d=new Array(l+1).fill(o),f=Math.floor((r.BITS-1)/u)*u;let h=o;for(let e=f;e>=0;e-=u){d.fill(o);for(let t=0;t<i.length;t++){const r=i[t],o=Number(r>>BigInt(e)&BigInt(l));d[o]=d[o].add(n[t])}let t=o;for(let e=d.length-1,r=o;e>0;e--)r=r.add(d[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<u;e++)h=h.double()}return h},dr.precomputeMSMUnsafe=function(e,t,r,n){o(n,t.BITS),a(r,e);const i=e.ZERO,s=2**n-1,u=Math.ceil(t.BITS/n),l=BigInt((1<<n)-1),d=r.map(e=>{const t=[];for(let r=0,n=e;r<s;r++)t.push(n),n=n.add(e);return t});return e=>{if(c(e,t),e.length>r.length)throw new Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<u;t++){if(o!==i)for(let e=0;e<n;e++)o=o.double();const r=BigInt(u*n-(t+1)*n);for(let t=0;t<e.length;t++){const n=e[t],i=Number(n>>r&l);i&&(o=o.add(d[t][i-1]))}}return o}},dr.validateBasic=function(r){return(0,e.validateField)(r.Fp),(0,t.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})};
|
|
20
20
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
21
|
-
const e
|
|
21
|
+
const e=br(),t=pr(),r=BigInt(0),n=BigInt(1);function i(e,t){const r=t.negate();return e?r:t}function o(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function s(e,t){o(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function a(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}function c(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}const u=new WeakMap,l=new WeakMap;function d(e){return l.get(e)||1}return dr}var gr,vr={};function yr(){if(gr)return vr;gr=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.twistedEdwards=function(u){const l=function(t){const n=(0,e.validateBasic)(t);return r.validateObject(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...n})}(u),{Fp:d,n:f,prehash:h,hash:p,randomBytes:b,nByteLength:m,h:g}=l,v=s<<BigInt(8*m)-o,y=d.create,x=(0,t.Field)(l.n,l.nBitLength),w=l.uvRatio||((e,t)=>{try{return{isValid:!0,value:d.sqrt(e*d.inv(t))}}catch(e){return{isValid:!1,value:i}}}),A=l.adjustScalarBytes||(e=>e),E=l.domain||((e,t,r)=>{if((0,n.abool)("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function S(e,t){r.aInRange("coordinate "+e,t,i,v)}function _(e){if(!(e instanceof C))throw new Error("ExtendedPoint expected")}const I=(0,n.memoized)((e,t)=>{const{ex:r,ey:n,ez:s}=e,c=e.is0();null==t&&(t=c?a:d.inv(s));const u=y(r*t),l=y(n*t),f=y(s*t);if(c)return{x:i,y:o};if(f!==o)throw new Error("invZ was invalid");return{x:u,y:l}}),N=(0,n.memoized)(e=>{const{a:t,d:r}=l;if(e.is0())throw new Error("bad point: ZERO");const{ex:n,ey:i,ez:o,et:s}=e,a=y(n*n),c=y(i*i),u=y(o*o),d=y(u*u),f=y(a*t);if(y(u*y(f+c))!==y(d+y(r*y(a*c))))throw new Error("bad point: equation left != right (1)");if(y(n*i)!==y(o*s))throw new Error("bad point: equation left != right (2)");return!0});class C{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,S("x",e),S("y",t),S("z",r),S("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof C)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return S("x",t),S("y",r),new C(t,r,o,y(t*r))}static normalizeZ(e){const t=d.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(C.fromAffine)}static msm(t,r){return(0,e.pippenger)(C,x,t,r)}_setWindowSize(e){T.setWindowSize(this,e)}assertValidity(){N(this)}equals(e){_(e);const{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=y(t*s),c=y(i*n),u=y(r*s),l=y(o*n);return a===c&&u===l}is0(){return this.equals(C.ZERO)}negate(){return new C(y(-this.ex),this.ey,this.ez,y(-this.et))}double(){const{a:e}=l,{ex:t,ey:r,ez:n}=this,i=y(t*t),o=y(r*r),a=y(s*y(n*n)),c=y(e*i),u=t+r,d=y(y(u*u)-i-o),f=c+o,h=f-a,p=c-o,b=y(d*h),m=y(f*p),g=y(d*p),v=y(h*f);return new C(b,m,v,g)}add(e){_(e);const{a:t,d:r}=l,{ex:n,ey:o,ez:a,et:c}=this,{ex:u,ey:d,ez:f,et:h}=e;if(t===BigInt(-1)){const e=y((o-n)*(d+u)),t=y((o+n)*(d-u)),r=y(t-e);if(r===i)return this.double();const l=y(a*s*h),p=y(c*s*f),b=p+l,m=t+e,g=p-l,v=y(b*r),x=y(m*g),w=y(b*g),A=y(r*m);return new C(v,x,A,w)}const p=y(n*u),b=y(o*d),m=y(c*r*h),g=y(a*f),v=y((n+o)*(u+d)-p-b),x=g-m,w=g+m,A=y(b-t*p),E=y(v*x),S=y(w*A),I=y(v*A),N=y(x*w);return new C(E,S,N,I)}subtract(e){return this.add(e.negate())}wNAF(e){return T.wNAFCached(this,e,C.normalizeZ)}multiply(e){const t=e;r.aInRange("scalar",t,o,f);const{p:n,f:i}=this.wNAF(t);return C.normalizeZ([n,i])[0]}multiplyUnsafe(e,t=C.ZERO){const n=e;return r.aInRange("scalar",n,i,f),n===i?k:this.is0()||n===o?this:T.wNAFCachedUnsafe(this,n,C.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return T.unsafeLadder(this,f).is0()}toAffine(e){return I(this,e)}clearCofactor(){const{h:e}=l;return e===o?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){const{d:s,a:a}=l,c=d.BYTES;e=(0,n.ensureBytes)("pointHex",e,c),(0,n.abool)("zip215",t);const u=e.slice(),f=e[c-1];u[c-1]=-129&f;const h=r.bytesToNumberLE(u),p=t?v:d.ORDER;r.aInRange("pointHex.y",h,i,p);const b=y(h*h),m=y(b-o),g=y(s*b-a);let{isValid:x,value:A}=w(m,g);if(!x)throw new Error("Point.fromHex: invalid y coordinate");const E=(A&o)===o,S=!!(128&f);if(!t&&A===i&&S)throw new Error("Point.fromHex: x=0 and x_0=1");return S!==E&&(A=y(-A)),C.fromAffine({x:A,y:h})}static fromPrivateKey(e){return j(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=r.numberToBytesLE(t,d.BYTES);return n[n.length-1]|=e&o?128:0,n}toHex(){return r.bytesToHex(this.toRawBytes())}}C.BASE=new C(l.Gx,l.Gy,o,y(l.Gx*l.Gy)),C.ZERO=new C(i,o,o,i);const{BASE:M,ZERO:k}=C,T=(0,e.wNAF)(C,8*m);function R(e){return(0,t.mod)(e,f)}function B(e){return R(r.bytesToNumberLE(e))}function j(e){const t=d.BYTES;e=(0,n.ensureBytes)("private key",e,t);const r=(0,n.ensureBytes)("hashed private key",p(e),2*t),i=A(r.slice(0,t)),o=r.slice(t,2*t),s=B(i),a=M.multiply(s),c=a.toRawBytes();return{head:i,prefix:o,scalar:s,point:a,pointBytes:c}}function O(e=new Uint8Array,...t){const i=r.concatBytes(...t);return B(p(E(i,(0,n.ensureBytes)("context",e),!!h)))}const L=c;M._setWindowSize(8);const P={getExtendedPublicKey:j,randomPrivateKey:()=>b(d.BYTES),precompute:(e=8,t=C.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:l,getPublicKey:function(e){return j(e).pointBytes},sign:function(e,t,o={}){e=(0,n.ensureBytes)("message",e),h&&(e=h(e));const{prefix:s,scalar:a,pointBytes:c}=j(t),u=O(o.context,s,e),l=M.multiply(u).toRawBytes(),p=R(u+O(o.context,l,c,e)*a);r.aInRange("signature.s",p,i,f);const b=r.concatBytes(l,r.numberToBytesLE(p,d.BYTES));return(0,n.ensureBytes)("result",b,2*d.BYTES)},verify:function(e,t,i,o=L){const{context:s,zip215:a}=o,c=d.BYTES;e=(0,n.ensureBytes)("signature",e,2*c),t=(0,n.ensureBytes)("message",t),i=(0,n.ensureBytes)("publicKey",i,c),void 0!==a&&(0,n.abool)("zip215",a),h&&(t=h(t));const u=r.bytesToNumberLE(e.slice(c,2*c));let l,f,p;try{l=C.fromHex(i,a),f=C.fromHex(e.slice(0,c),a),p=M.multiplyUnsafe(u)}catch(e){return!1}if(!a&&l.isSmallOrder())return!1;const b=O(s,f.toRawBytes(),l.toRawBytes(),t);return f.add(l.multiplyUnsafe(b)).subtract(p).clearCofactor().equals(C.ZERO)},ExtendedPoint:C,utils:P}};
|
|
22
22
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
23
|
-
const e=
|
|
23
|
+
const e=mr(),t=br(),r=pr(),n=pr(),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(8),c={zip215:!0};return vr}var xr,wr={};function Ar(){if(xr)return wr;xr=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.expand_message_xmd=s,wr.expand_message_xof=a,wr.hash_to_field=c,wr.isogenyMap=function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[i,o,s,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}},wr.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=c(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),u=s.add(a).clearCofactor();return u.assertValidity(),u},encodeToCurve(n,i){const o=c(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const e of r)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const n=e.fromAffine(t(r)).clearCofactor();return n.assertValidity(),n}}};const e=br(),t=pr(),r=t.bytesToNumberBE;function n(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function i(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function o(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function s(e,r,s,a){(0,t.abytes)(e),(0,t.abytes)(r),o(s),r.length>255&&(r=a((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),r)));const{outputLen:c,blockLen:u}=a,l=Math.ceil(s/c);if(s>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,t.concatBytes)(r,n(r.length,1)),f=n(0,u),h=n(s,2),p=new Array(l),b=a((0,t.concatBytes)(f,e,h,n(0,1),d));p[0]=a((0,t.concatBytes)(b,n(1,1),d));for(let e=1;e<=l;e++){const r=[i(b,p[e-1]),n(e+1,1),d];p[e]=a((0,t.concatBytes)(...r))}return(0,t.concatBytes)(...p).slice(0,s)}function a(e,r,i,s,a){if((0,t.abytes)(e),(0,t.abytes)(r),o(i),r.length>255){const e=Math.ceil(2*s/8);r=a.create({dkLen:e}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(r).digest()}if(i>65535||r.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return a.create({dkLen:i}).update(e).update(n(i,2)).update(r).update(n(r.length,1)).digest()}function c(n,i,c){(0,t.validateObject)(c,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:u,k:l,m:d,hash:f,expand:h,DST:p}=c;(0,t.abytes)(n),o(i);const b="string"==typeof p?(0,t.utf8ToBytes)(p):p,m=u.toString(2).length,g=Math.ceil((m+l)/8),v=i*d*g;let y;if("xmd"===h)y=s(n,b,v,f);else if("xof"===h)y=a(n,b,v,l,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');y=n}const x=new Array(i);for(let t=0;t<i;t++){const n=new Array(d);for(let i=0;i<d;i++){const o=g*(i+t*d),s=y.subarray(o,o+g);n[i]=(0,e.mod)(r(s),u)}x[t]=n}return x}return wr}var Er,Sr,_r={};function Ir(){if(Er)return _r;Er=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.montgomery=function(i){const o=function(e){return(0,t.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}(i),{P:s}=o,a=t=>(0,e.mod)(t,s),c=o.montgomeryBits,u=Math.ceil(c/8),l=o.nByteLength,d=o.adjustScalarBytes||(e=>e),f=o.powPminus2||(t=>(0,e.pow)(t,s-BigInt(2),s));function h(e,t,r){const n=a(e*(t-r));return[t=a(t-n),r=a(r+n)]}const p=(o.a-BigInt(2))/BigInt(4);function b(e){return(0,t.numberToBytesLE)(a(e),u)}function m(e,i){const o=function(e){const r=(0,t.ensureBytes)("u coordinate",e,u);return 32===l&&(r[31]&=127),(0,t.bytesToNumberLE)(r)}(i),m=function(e,i){(0,t.aInRange)("u",e,r,s),(0,t.aInRange)("scalar",i,r,s);const o=i,u=e;let l,d=n,b=r,m=e,g=n,v=r;for(let e=BigInt(c-1);e>=r;e--){const t=o>>e&n;v^=t,l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1],v=t;const r=d+b,i=a(r*r),s=d-b,c=a(s*s),f=i-c,y=m+g,x=a((m-g)*r),w=a(y*s),A=x+w,E=x-w;m=a(A*A),g=a(u*a(E*E)),d=a(i*c),b=a(f*(i+a(p*f)))}l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1];const y=f(b);return a(d*y)}(o,function(e){const r=(0,t.ensureBytes)("scalar",e),n=r.length;if(n!==u&&n!==l)throw new Error("invalid scalar, expected "+u+" or "+l+" bytes, got "+n);return(0,t.bytesToNumberLE)(d(r))}(e));if(m===r)throw new Error("invalid private or public key received");return b(m)}const g=b(o.Gu);function v(e){return m(e,g)}return{scalarMult:m,scalarMultBase:v,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>v(e),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:g}};
|
|
24
24
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
25
|
-
const e
|
|
25
|
+
const e=br(),t=pr(),r=BigInt(0),n=BigInt(1);return _r}function Nr(){return Sr||(Sr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=E,e.edwardsToMontgomeryPriv=function(e){const t=w.hash(e.subarray(0,32));return w.adjustScalarBytes(t).subarray(0,32)};
|
|
26
26
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
27
|
-
const t=
|
|
28
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function
|
|
27
|
+
const t=ar(),r=tr(),n=mr(),i=yr(),o=Ar(),s=br(),a=Ir(),c=pr(),u=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt(0),f=BigInt(1),h=BigInt(2),p=BigInt(3),b=BigInt(5),m=BigInt(8);function g(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=u,a=e*e%o*e%o,c=(0,s.pow2)(a,h,o)*a%o,l=(0,s.pow2)(c,f,o)*e%o,d=(0,s.pow2)(l,b,o)*l%o,p=(0,s.pow2)(d,t,o)*d%o,m=(0,s.pow2)(p,r,o)*p%o,g=(0,s.pow2)(m,n,o)*m%o,v=(0,s.pow2)(g,i,o)*g%o,y=(0,s.pow2)(v,i,o)*g%o,x=(0,s.pow2)(y,t,o)*d%o;return{pow_p_5_8:(0,s.pow2)(x,h,o)*e%o,b2:a}}function v(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function y(e,t){const r=u,n=(0,s.mod)(t*t*t,r),i=g(e*(0,s.mod)(n*n*t,r)).pow_p_5_8;let o=(0,s.mod)(e*n*i,r);const a=(0,s.mod)(t*o*o,r),c=o,d=(0,s.mod)(o*l,r),f=a===e,h=a===(0,s.mod)(-e,r),p=a===(0,s.mod)(-e*l,r);return f&&(o=c),(h||p)&&(o=d),(0,s.isNegativeLE)(o,r)&&(o=(0,s.mod)(-o,r)),{isValid:f||h,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const x=(()=>(0,s.Field)(u,void 0,!0))(),w=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:x,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:r.randomBytes,adjustScalarBytes:v,uvRatio:y}))();function A(e,t,n){if(t.length>255)throw new Error("Context is too big");return(0,r.concatBytes)((0,r.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}function E(t){const{y:r}=e.ed25519.ExtendedPoint.fromHex(t),n=BigInt(1);return x.toBytes(x.create((n+r)*x.inv(n-r)))}e.ed25519=(0,i.twistedEdwards)(w),e.ed25519ctx=(0,i.twistedEdwards)({...w,domain:A}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},w,{domain:A,prehash:t.sha512})),e.x25519=(0,a.montgomery)({P:u,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=u,{pow_p_5_8:r,b2:n}=g(e);return(0,s.mod)((0,s.pow2)(r,p,t)*n,t)},adjustScalarBytes:v,randomBytes:r.randomBytes}),e.edwardsToMontgomery=E;const S=(()=>(x.ORDER+p)/m)(),_=(()=>x.pow(h,S))(),I=(()=>x.sqrt(x.neg(x.ONE)))();const N=(()=>(0,s.FpSqrtEven)(x,x.neg(BigInt(486664))))();function C(e){const{xMn:t,xMd:r,yMn:n,yMd:i}=function(e){const t=(x.ORDER-b)/m,r=BigInt(486662);let n=x.sqr(e);n=x.mul(n,h);let i=x.add(n,x.ONE),o=x.neg(r),s=x.sqr(i),a=x.mul(s,i),c=x.mul(n,r);c=x.mul(c,o),c=x.add(c,s),c=x.mul(c,o);let u=x.sqr(a);s=x.sqr(u),u=x.mul(u,a),u=x.mul(u,c),s=x.mul(s,u);let l=x.pow(s,t);l=x.mul(l,u);let d=x.mul(l,I);s=x.sqr(l),s=x.mul(s,a);let p=x.eql(s,c),g=x.cmov(d,l,p),v=x.mul(o,n),y=x.mul(l,e);y=x.mul(y,_);let w=x.mul(y,I),A=x.mul(c,n);s=x.sqr(y),s=x.mul(s,a);let E=x.eql(s,A),S=x.cmov(w,y,E);s=x.sqr(g),s=x.mul(s,a);let N=x.eql(s,c),C=x.cmov(v,o,N),M=x.cmov(S,g,N),k=x.isOdd(M);return M=x.cmov(M,x.neg(M),N!==k),{xMn:C,xMd:i,yMn:M,yMd:f}}(e);let o=x.mul(t,i);o=x.mul(o,N);let s=x.mul(r,n),a=x.sub(t,r),c=x.add(t,r),u=x.mul(s,c),l=x.eql(u,x.ZERO);o=x.cmov(o,x.ZERO,l),s=x.cmov(s,x.ONE,l),a=x.cmov(a,x.ONE,l),c=x.cmov(c,x.ONE,l);const d=x.invertBatch([s,c]);return{x:x.mul(o,d[0]),y:x.mul(a,d[1])}}const M=(()=>(0,o.createHasher)(e.ed25519.ExtendedPoint,e=>C(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:x.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512}))();function k(e){if(!(e instanceof D))throw new Error("RistrettoPoint expected")}e.hashToCurve=M.hashToCurve,e.encodeToCurve=M.encodeToCurve;const T=l,R=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),B=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),j=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),O=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),L=e=>y(f,e),P=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),F=t=>e.ed25519.CURVE.Fp.create((0,c.bytesToNumberLE)(t)&P);function U(t){const{d:r}=e.ed25519.CURVE,n=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(T*t*t),a=i((o+f)*j);let c=BigInt(-1);const u=i((c-r*o)*i(o+r));let{isValid:l,value:d}=y(a,u),h=i(d*t);(0,s.isNegativeLE)(h,n)||(h=i(-h)),l||(d=h),l||(c=o);const p=i(c*(o-f)*O-u),b=d*d,m=i((d+d)*u),g=i(p*R),v=i(f-b),x=i(f+b);return new e.ed25519.ExtendedPoint(i(m*x),i(v*g),i(g*x),i(m*v))}class D{constructor(e){this.ep=e}static fromAffine(t){return new D(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){e=(0,c.ensureBytes)("ristrettoHash",e,64);const t=U(F(e.slice(0,32))),r=U(F(e.slice(32,64)));return new D(t.add(r))}static fromHex(t){t=(0,c.ensureBytes)("ristrettoHex",t,32);const{a:r,d:n}=e.ed25519.CURVE,i=e.ed25519.CURVE.Fp.ORDER,o=e.ed25519.CURVE.Fp.create,a="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",u=F(t);if(!(0,c.equalBytes)((0,c.numberToBytesLE)(u,32),t)||(0,s.isNegativeLE)(u,i))throw new Error(a);const l=o(u*u),h=o(f+r*l),p=o(f-r*l),b=o(h*h),m=o(p*p),g=o(r*n*b-m),{isValid:v,value:y}=L(o(g*m)),x=o(y*p),w=o(y*x*g);let A=o((u+u)*x);(0,s.isNegativeLE)(A,i)&&(A=o(-A));const E=o(h*w),S=o(A*E);if(!v||(0,s.isNegativeLE)(S,i)||E===d)throw new Error(a);return new D(new e.ed25519.ExtendedPoint(A,E,f,S))}static msm(t,r){const i=(0,s.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,n.pippenger)(D,i,t,r)}toRawBytes(){let{ex:t,ey:r,ez:n,et:i}=this.ep;const o=e.ed25519.CURVE.Fp.ORDER,a=e.ed25519.CURVE.Fp.create,u=a(a(n+r)*a(n-r)),l=a(t*r),d=a(l*l),{value:f}=L(a(u*d)),h=a(f*u),p=a(f*l),b=a(h*p*i);let m;if((0,s.isNegativeLE)(i*b,o)){let e=a(r*T),n=a(t*T);t=e,r=n,m=a(h*B)}else m=p;(0,s.isNegativeLE)(t*b,o)&&(r=a(-r));let g=a((n-r)*m);return(0,s.isNegativeLE)(g,o)&&(g=a(-g)),(0,c.numberToBytesLE)(g,32)}toHex(){return(0,c.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){k(t);const{ex:r,ey:n}=this.ep,{ex:i,ey:o}=t.ep,s=e.ed25519.CURVE.Fp.create,a=s(r*o)===s(n*i),c=s(n*o)===s(r*i);return a||c}add(e){return k(e),new D(this.ep.add(e.ep))}subtract(e){return k(e),new D(this.ep.subtract(e.ep))}multiply(e){return new D(this.ep.multiply(e))}multiplyUnsafe(e){return new D(this.ep.multiplyUnsafe(e))}double(){return new D(this.ep.double())}negate(){return new D(this.ep.negate())}}e.RistrettoPoint=(D.BASE||(D.BASE=new D(e.ed25519.ExtendedPoint.BASE)),D.ZERO||(D.ZERO=new D(e.ed25519.ExtendedPoint.ZERO)),D);e.hashToRistretto255=(e,n)=>{const i=n.DST,s="string"==typeof i?(0,r.utf8ToBytes)(i):i,a=(0,o.expand_message_xmd)(e,s,64,t.sha512);return D.hashToCurve(a)},e.hash_to_ristretto255=e.hashToRistretto255}(Kt)),Kt}var Cr,Mr={exports:{}},kr={exports:{}},Tr={},Rr={};var Br,jr,Or,Lr,Pr={};
|
|
28
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Fr(){return Br||(Br=1,Pr.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},Pr.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*b}),Pr}
|
|
29
29
|
/*!
|
|
30
30
|
* The buffer module from node.js, for the browser.
|
|
31
31
|
*
|
|
32
32
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
33
33
|
* @license MIT
|
|
34
|
-
*/function hr(){return cr||(cr=1,function(e){const t=function(){if(rr)return sr;rr=1,sr.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},sr.toByteArray=function(e){var n,i,s=o(e),a=s[0],c=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),l=0,d=c>0?a-4:a;for(i=0;i<d;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[l++]=n>>16&255,u[l++]=n>>8&255,u[l++]=255&n;return 2===c&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[l++]=255&n),1===c&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[l++]=n>>8&255,u[l++]=255&n),u},sr.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,c=0,u=n-i;c<u;c+=s)o.push(a(t,c,c+s>u?u:c+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,sr}(),r=fr(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=o(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(V(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);const i=function(e){if(s.isBuffer(e)){const t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),o(e<0?0:0|f(e))}function l(e){const t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,s.prototype),n}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(G(n))return s;e[r+s]=n}return s}function y(e,t,r,n){return H(q(t,e.length-r),e,r,n)}function x(e,t,r,n){return H(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return H(K(t),e,r,n)}function A(e,t,r,n){return H(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(V(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),V(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=s.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(V(t,Uint8Array))i+t.length>n.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,i){if(V(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const c=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<c;++e)if(u[e]!==l[e]){o=u[e],a=l[e];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function M(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function C(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function B(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,n,i,o){return t=+t,n>>>=0,o||O(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,o){return t=+t,n>>>=0,o||O(e,0,n,8),r.write(e,t,n,i,52,8),n+8}s.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),s.prototype.readBigInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){k(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=Y(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Y(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=Y(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Y(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=s.isBuffer(e)?e:s.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const P={};function F(e,t,r){P[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new P.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!=typeof e)throw new P.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new P.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function V(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}}(or)),or}
|
|
35
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function pr(){if(lr)return nr.exports;lr=1;var e=65536,t=4294967295;var r=(ur||(ur=1,function(e,t){var r=hr(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(ir,ir.exports)),ir.exports).Buffer,n=B.crypto||B.msCrypto;return n&&n.getRandomValues?nr.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var s=r.allocUnsafe(i);if(i>0)if(i>e)for(var a=0;a<i;a+=e)n.getRandomValues(s.slice(a,a+e));else n.getRandomValues(s);if("function"==typeof o)return process.nextTick(function(){o(null,s)});return s}:nr.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},nr.exports}var br,mr,gr={};var vr,yr,xr,wr={},Ar="6.6.1",Er={},Sr={exports:{}},_r=Sr.exports;function Ir(){return vr||(vr=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:te.Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?u[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?b+n:u[f-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],x=8191&y,w=y>>>13,A=0|s[4],E=8191&A,S=A>>>13,_=0|s[5],I=8191&_,N=_>>>13,M=0|s[6],C=8191&M,T=M>>>13,k=0|s[7],R=8191&k,B=k>>>13,O=0|s[8],j=8191&O,L=O>>>13,P=0|s[9],F=8191&P,U=P>>>13,D=0|a[0],z=8191&D,W=D>>>13,$=0|a[1],q=8191&$,K=$>>>13,H=0|a[2],V=8191&H,G=H>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(d,z))|0)+((8191&(i=(i=Math.imul(d,W))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,W))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,W))+Math.imul(b,z)|0,o=Math.imul(b,W);var ge=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,W))+Math.imul(v,z)|0,o=Math.imul(v,W),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,K)|0;var ve=(u+(n=n+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,V)|0))<<13)|0;u=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,W))+Math.imul(w,z)|0,o=Math.imul(w,W),n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,G)|0;var ye=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,z),i=(i=Math.imul(E,W))+Math.imul(S,z)|0,o=Math.imul(S,W),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var xe=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,z),i=(i=Math.imul(I,W))+Math.imul(N,z)|0,o=Math.imul(N,W),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(C,z),i=(i=Math.imul(C,W))+Math.imul(T,z)|0,o=Math.imul(T,W),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ae=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,W))+Math.imul(B,z)|0,o=Math.imul(B,W),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,z),i=(i=Math.imul(j,W))+Math.imul(L,z)|0,o=Math.imul(L,W),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,z),i=(i=Math.imul(F,W))+Math.imul(U,z)|0,o=Math.imul(U,W),n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var _e=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(j,V)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Ie=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,G))+Math.imul(U,V)|0,o=Math.imul(U,G),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,fe)|0;var Ne=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,Z))+Math.imul(U,Y)|0,o=Math.imul(U,Z),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Me=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Te=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var ke=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(B,pe)|0))<<13)|0;u=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,fe))+Math.imul(U,de)|0,o=Math.imul(U,fe);var Be=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Oe=(u+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,be))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,be))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=xe,c[5]=we,c[6]=Ae,c[7]=Ee,c[8]=Se,c[9]=_e,c[10]=Ie,c[11]=Ne,c[12]=Me,c[13]=Ce,c[14]=Te,c[15]=ke,c[16]=Re,c[17]=Be,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,f=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=d*m-f*g;g=d*g+f*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*d-u*f,f=c*f+u*d,d=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,n,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)n[s]=0;r(0===o),r(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=n;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,s=e.length+n;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,c=n.length-o.length;if("mod"!==t){(a=new i(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(o,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(d)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(c)):(n.isub(t),a.isub(o),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,g),n(x,g),n(w,g),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();r(m<p);var g=this.pow(d,new i(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},n(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Sr,_r)),Sr.exports}function Nr(){if(xr)return yr;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return xr=1,yr=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},yr}var Mr,Cr,Tr={};function kr(){return Mr||(Mr=1,function(){var e=Tr;function t(e){return 1===e.length?"0"+e:e}function r(e){for(var r="",n=0;n<e.length;n++)r+=t(e[n].toString(16));return r}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},e.zero2=t,e.toHex=r,e.encode=function(e,t){return"hex"===t?r(e):e}}()),Tr}function Rr(){return Cr||(Cr=1,function(){var e=Er,t=Ir(),r=Nr(),n=kr();e.assert=r,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,s=e.clone();for(n=0;n<i.length;n++){var a,c=s.andln(o-1);s.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,s.isubn(a)):a=0,i[n]=a,s.iushrn(1)}return i},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c:0,r[0].push(s),a=1&u?3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u:0,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),Er}var Br,Or={exports:{}};function jr(){if(Br)return Or.exports;var e;function t(e){this.rand=e}if(Br=1,Or.exports=function(r){return e||(e=new t(null)),e.generate(r)},Or.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=te;if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return Or.exports}var Lr,Pr,Fr={};function Ur(){if(Pr)return Lr;Pr=1;var e=Ir(),t=Rr(),r=t.getNAF,n=t.getJSF,i=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}return Lr=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var n=e._getDoubles(),o=r(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2==0?2:1);s/=3;var a,c,u=[];for(a=0;a<o.length;a+=n.step){c=0;for(var l=a+n.step-1;l>=a;l--)c=(c<<1)+o[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a<u.length;a++)(c=u[a])===h?f=f.mixedAdd(n.points[a]):c===-h&&(f=f.mixedAdd(n.points[a].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var n=4,o=e._getNAFPoints(n);n=o.wnd;for(var s=o.points,a=r(t,n,this._bitLength),c=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=a[u];i(0!==d),c="affine"===e.type?d>0?c.mixedAdd(s[d-1>>1]):c.mixedAdd(s[-d-1>>1].neg()):d>0?c.add(s[d-1>>1]):c.add(s[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},o.prototype._wnafMulAdd=function(e,t,i,o,s){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<o;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=o-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=n(i[b],i[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var x=0|y[0][c],w=0|y[1][c];f[b][c]=v[3*(x+1)+(w+1)],f[m][c]=0,d[b]=g}}else f[b]=r(i[b],l[b],this._bitLength),f[m]=r(i[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var _=!0;for(c=0;c<o;c++)E[c]=0|f[c][a],0!==E[c]&&(_=!1);if(!_)break;S++,a--}if(a>=0&&S++,A=A.dblp(S),a<0)break;for(c=0;c<o;c++){var I=E[c];0!==I&&(I>0?u=d[c][I-1>>1]:I<0&&(u=d[c][-I-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(a=0;a<o;a++)d[a]=null;return s?A:A.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},s.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},Lr}var Dr,zr,Wr,$r,qr,Kr,Hr,Vr,Gr={exports:{}};function Xr(){return Dr||(Dr=1,"function"==typeof Object.create?Gr.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Gr.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Gr.exports}function Yr(){return Vr||(Vr=1,function(e){var t=e;t.base=Ur(),t.short=function(){if(Wr)return zr;Wr=1;var e=Rr(),t=Ir(),r=Xr(),n=Ur(),i=e.assert;function o(e){n.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(e,r,i,o){n.BasePoint.call(this,e,"affine"),null===r&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(e,r,i,o){n.BasePoint.call(this,e,"jacobian"),null===r&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,n),zr=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,n;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)n=new t(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?n=s[0]:(n=s[1],i(0===this.g.mul(n).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(n)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),n=new t(2).toRed(r).redInvm(),i=n.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(n);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,n,i,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new t(1),b=new t(0),m=new t(0),g=new t(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var x=g.sub(y.mul(b));if(!i&&u.cmp(d)<0)r=c.neg(),n=p,i=u.neg(),o=l;else if(i&&2===++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=x}s=u.neg(),a=l;var w=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(w)>=0&&(s=r,a=n),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},r(s,n.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},s.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},s.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},s.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},s.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(a,n.BasePoint),o.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},a.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},a.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)},a.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},a.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},a.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},zr}(),t.mont=function(){if(qr)return $r;qr=1;var e=Ir(),t=Xr(),r=Ur(),n=Rr();function i(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,n,i){r.BasePoint.call(this,t,"projective"),null===n&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(n,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r),$r=i,i.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},t(o,r.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(n.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},$r}(),t.edwards=function(){if(Hr)return Kr;Hr=1;var e=Rr(),t=Ir(),r=Xr(),n=Ur(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,n.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,r,i,o,s){n.BasePoint.call(this,e,"projective"),null===r&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=s&&new t(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,n),Kr=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},r(s,n.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new s(this,e,t,r,n)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)},s.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)},s.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,Kr}()}(Fr)),Fr}var Zr,Jr,Qr={},en={},tn={},rn={exports:{}};function nn(){if(Jr)return tn;Jr=1;var e=Nr(),t=(Zr||(Zr=1,"function"==typeof Object.create?rn.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:rn.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}),rn.exports);function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function n(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return tn.inherits=t,tn.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[i++]=s:s<2048?(n[i++]=s>>6|192,n[i++]=63&s|128):r(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[i++]=s>>18|240,n[i++]=s>>12&63|128,n[i++]=s>>6&63|128,n[i++]=63&s|128):(n[i++]=s>>12|224,n[i++]=s>>6&63|128,n[i++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},tn.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},tn.htonl=n,tn.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var s=e[i];"little"===t&&(s=n(s)),r+=o(s.toString(16))}return r},tn.zero2=i,tn.zero8=o,tn.join32=function(t,r,n,i){var o=n-r;e(o%4==0);for(var s=new Array(o/4),a=0,c=r;a<s.length;a++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=u>>>0}return s},tn.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},tn.rotr32=function(e,t){return e>>>t|e<<32-t},tn.rotl32=function(e,t){return e<<t|e>>>32-t},tn.sum32=function(e,t){return e+t>>>0},tn.sum32_3=function(e,t,r){return e+t+r>>>0},tn.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},tn.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},tn.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},tn.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},tn.sum64_lo=function(e,t,r,n){return t+n>>>0},tn.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},tn.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},tn.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+i+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},tn.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},tn.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},tn.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},tn.shr64_hi=function(e,t,r){return e>>>r},tn.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},tn}var on,sn={};function an(){if(on)return sn;on=1;var e=nn(),t=Nr();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return sn.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n},sn}var cn,un,ln,dn,fn,hn,pn,bn,mn,gn,vn,yn,xn={},wn={};function An(){if(cn)return wn;cn=1;var e=nn().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(e,t,r){return e^t^r}return wn.ft_1=function(e,i,o,s){return 0===e?t(i,o,s):1===e||3===e?n(i,o,s):2===e?r(i,o,s):void 0},wn.ch32=t,wn.maj32=r,wn.p32=n,wn.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},wn.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},wn.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},wn.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},wn}function En(){if(fn)return dn;fn=1;var e=nn(),t=an(),r=An(),n=Nr(),i=e.sum32,o=e.sum32_4,s=e.sum32_5,a=r.ch32,c=r.maj32,u=r.s0_256,l=r.s1_256,d=r.g0_256,f=r.g1_256,h=t.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(b,h),dn=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,h=0;h<16;h++)r[h]=e[t+h];for(;h<r.length;h++)r[h]=o(f(r[h-2]),r[h-7],d(r[h-15]),r[h-16]);var p=this.h[0],b=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],x=this.h[6],w=this.h[7];for(n(this.k.length===r.length),h=0;h<r.length;h++){var A=s(w,l(v),a(v,y,x),this.k[h],r[h]),E=i(u(p),c(p,b,m));w=x,x=y,y=v,v=i(g,A),g=m,m=b,b=p,p=i(A,E)}this.h[0]=i(this.h[0],p),this.h[1]=i(this.h[1],b),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],v),this.h[5]=i(this.h[5],y),this.h[6]=i(this.h[6],x),this.h[7]=i(this.h[7],w)},b.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},dn}function Sn(){if(mn)return bn;mn=1;var e=nn(),t=an(),r=Nr(),n=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,s=e.shr64_lo,a=e.sum64,c=e.sum64_hi,u=e.sum64_lo,l=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function g(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function v(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function y(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function x(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function w(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function S(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function _(e,t){var r=n(e,t,1)^n(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=i(e,t,1)^i(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=n(e,t,19)^n(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=i(e,t,19)^i(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(m,p),bn=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=N(r[n-4],r[n-3]),o=M(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=_(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),f=r[n-32],h=r[n-31];r[n]=l(i,o,s,a,c,u,f,h),r[n+1]=d(i,o,s,a,c,u,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],o=this.h[1],s=this.h[2],l=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],m=this.h[7],_=this.h[8],I=this.h[9],N=this.h[10],M=this.h[11],C=this.h[12],T=this.h[13],k=this.h[14],R=this.h[15];r(this.k.length===n.length);for(var B=0;B<n.length;B+=2){var O=k,j=R,L=E(_,I),P=S(_,I),F=g(_,I,N,M,C),U=v(_,I,N,M,C,T),D=this.k[B],z=this.k[B+1],W=n[B],$=n[B+1],q=f(O,j,L,P,F,U,D,z,W,$),K=h(O,j,L,P,F,U,D,z,W,$);O=w(i,o),j=A(i,o),L=y(i,o,s,l,d),P=x(i,o,s,l,d,p);var H=c(O,j,L,P),V=u(O,j,L,P);k=C,R=T,C=N,T=M,N=_,M=I,_=c(b,m,q,K),I=u(m,m,q,K),b=d,m=p,d=s,p=l,s=i,l=o,i=c(q,K,H,V),o=u(q,K,H,V)}a(this.h,0,i,o),a(this.h,2,s,l),a(this.h,4,d,p),a(this.h,6,b,m),a(this.h,8,_,I),a(this.h,10,N,M),a(this.h,12,C,T),a(this.h,14,k,R)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},bn}function _n(){return yn||(yn=1,xn.sha1=function(){if(ln)return un;ln=1;var e=nn(),t=an(),r=An(),n=e.rotl32,i=e.sum32,o=e.sum32_5,s=r.ft_1,a=t.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(u,a),un=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=n(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var u=this.h[0],l=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),b=o(n(u,5),s(p,l,d,f),h,r[a],c[p]);h=f,f=d,d=n(l,30),l=u,u=b}this.h[0]=i(this.h[0],u),this.h[1]=i(this.h[1],l),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},u.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},un}(),xn.sha224=function(){if(pn)return hn;pn=1;var e=nn(),t=En();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),hn=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},hn}(),xn.sha256=En(),xn.sha384=function(){if(vn)return gn;vn=1;var e=nn(),t=Sn();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),gn=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},gn}(),xn.sha512=Sn()),xn}var In,Nn,Mn,Cn,Tn,kn,Rn,Bn,On,jn,Ln,Pn,Fn,Un,Dn,zn,Wn,$n,qn,Kn,Hn,Vn,Gn,Xn,Yn,Zn,Jn,Qn,ei={};function ti(){return Cn||(Cn=1,function(e){var t=e;t.utils=nn(),t.common=an(),t.sha=_n(),t.ripemd=function(){if(In)return ei;In=1;var e=nn(),t=an(),r=e.rotl32,n=e.sum32,i=e.sum32_3,o=e.sum32_4,s=t.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(a,s),ei.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var s=this.h[0],a=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=s,y=a,x=b,w=m,A=g,E=0;E<80;E++){var S=n(r(o(s,c(E,a,b,m),e[d[E]+t],u(E)),h[E]),g);s=g,g=m,m=r(b,10),b=a,a=S,S=n(r(o(v,c(79-E,y,x,w),e[f[E]+t],l(E)),p[E]),A),v=A,A=w,w=r(x,10),x=y,y=S}S=i(this.h[1],b,w),this.h[1]=i(this.h[2],m,A),this.h[2]=i(this.h[3],g,v),this.h[3]=i(this.h[4],s,y),this.h[4]=i(this.h[0],a,x),this.h[0]=S},a.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ei}(),t.hmac=function(){if(Mn)return Nn;Mn=1;var e=nn(),t=Nr();function r(t,n,i){if(!(this instanceof r))return new r(t,n,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(n,i))}return Nn=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},Nn}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(en)),en}function ri(){return Rn||(Rn=1,function(e){var t,r=e,n=ti(),i=Yr(),o=Rr().assert;function s(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=s,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=kn?Tn:(kn=1,Tn={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(Qr)),Qr}function ni(){if(Dn)return Un;Dn=1;var e=Ir(),t=function(){if(On)return Bn;On=1;var e=ti(),t=kr(),r=Nr();function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),s=t.toArray(e.pers,e.persEnc||"hex");r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,s)}return Bn=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(e,n,i,o){"string"!=typeof n&&(o=i,i=n,n=null),e=t.toArray(e,n),i=t.toArray(i,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},n.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(i=n,n=r,r=null),n&&(n=t.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(n),this._reseed++,t.encode(s,r)},Bn}(),r=Rr(),n=ri(),i=jr(),o=r.assert,s=function(){if(Ln)return jn;Ln=1;var e=Ir(),t=Rr().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return jn=r,r.fromPublic=function(e,t,n){return t instanceof r?t:new r(e,{pub:t,pubEnc:n})},r.fromPrivate=function(e,t,n){return t instanceof r?t:new r(e,{priv:t,privEnc:n})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},jn}(),a=function(){if(Fn)return Pn;Fn=1;var e=Ir(),t=Rr(),r=t.assert;function n(t,i){if(t instanceof n)return t;this._importDER(t,i)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function s(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function a(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return Pn=n,n.prototype._importDER=function(r,n){r=t.toArray(r,n);var s=new i;if(48!==r[s.place++])return!1;var a=o(r,s);if(!1===a)return!1;if(a+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var c=o(r,s);if(!1===c)return!1;if(128&r[s.place])return!1;var u=r.slice(s.place,c+s.place);if(s.place+=c,2!==r[s.place++])return!1;var l=o(r,s);if(!1===l)return!1;if(r.length!==l+s.place)return!1;if(128&r[s.place])return!1;var d=r.slice(s.place,l+s.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(u),this.s=new e(d),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=s(r),n=s(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];a(i,r.length),(i=i.concat(r)).push(2),a(i,n.length);var o=i.concat(n),c=[48];return a(c,o.length),c=c.concat(o),t.encode(c,e)},Pn}();function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return Un=c,c.prototype.keyPair=function(e){return new s(this,e)},c.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},c.prototype.genKeyPair=function(r){r||(r={});for(var n=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||i(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),s=this.n.sub(new e(2));;){var a=new e(n.generate(o));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},c.prototype._truncateToN=function(t,r,n){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof n&&(n=8*i);var s=n-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(r,n,i,s){if("object"==typeof i&&(s=i,i=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var c=0;c<r.length;c++)o((255&r[c])===r[c])}n=this.keyFromPrivate(n,i),r=this._truncateToN(r,!1,s.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var u=this.n.byteLength(),l=n.getPrivate().toArray("be",u),d=r.toArray("be",u);o(new e(d).eq(r),"Can not sign message");for(var f=new t({hash:this.hash,entropy:l,nonce:d,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var b=s.k?s.k(p):new e(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(n.getPrivate()).iadd(r));if(0!==(y=y.umod(this.n)).cmpn(0)){var x=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return s.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),x^=1),new a({r:v,s:y,recoveryParam:x})}}}}}},c.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new a(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var c,u=s.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(l,r.getPublic(),d)).isInfinity()&&c.eqXToP(o):!(c=this.g.mulAdd(l,r.getPublic(),d)).isInfinity()&&0===c.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,r,n,i){o((3&n)===n,"The recovery param is more than two bits"),r=new a(r,i);var s=this.n,c=new e(t),u=r.r,l=r.s,d=1&n,f=n>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");u=f?this.curve.pointFromX(u.add(this.curve.n),d):this.curve.pointFromX(u,d);var h=r.r.invm(s),p=s.sub(c).mul(h).umod(s),b=l.mul(h).umod(s);return this.g.mulAdd(p,u,b)},c.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new a(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")},Un}function ii(){if(Hn)return Kn;Hn=1;var e=ti(),t=ri(),r=Rr(),n=r.assert,i=r.parseBytes,o=function(){if(Wn)return zn;Wn=1;var e=Rr(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},n(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(i,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),n(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},zn=i}(),s=function(){if(qn)return $n;qn=1;var e=Ir(),t=Rr(),r=t.assert,n=t.cachedProperty,i=t.parseBytes;function o(t,n){this.eddsa=t,"object"!=typeof n&&(n=i(n)),Array.isArray(n)&&(r(n.length===2*t.encodingLength,"Signature has invalid size"),n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),r(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof e&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}return n(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},$n=o}();function a(r){if(n("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof a))return new a(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return Kn=a,a.prototype.sign=function(e,t){e=i(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),s=this.encodePoint(o),a=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:c,Rencoded:s})},a.prototype.verify=function(e,t,r){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(s)},a.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},a.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},a.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},a.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},a.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=r.intFromLE(n);return this.curve.pointFromY(o,i)},a.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(e){return r.intFromLE(e)},a.prototype.isPoint=function(e){return e instanceof this.pointClass},Kn}function oi(){if(Xn)return Gn;Xn=1;const e=(Vn||(Vn=1,function(){var e=wr;e.version=Ar,e.utils=Rr(),e.rand=jr(),e.curve=Yr(),e.curves=ri(),e.ec=ni(),e.eddsa=ii()}()),wr).ec,t=new e("secp256k1"),r=t.curve,n=r.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new n(i);if(o.cmp(r.p)>=0)return null;o=o.toRed(r.red);let s=o.redSqr().redIMul(o).redIAdd(r.b).redSqrt();3===e!==s.isOdd()&&(s=s.redNeg());const a=o.redSqr().redIMul(o);return s.redSqr().redISub(a.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:o,y:s}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let s=new n(i),a=new n(o);if(s.cmp(r.p)>=0||a.cmp(r.p)>=0)return null;if(s=s.toRed(r.red),a=a.toRed(r.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:s,y:a}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}return Gn={contextRandomize:()=>0,privateKeyVerify(e){const t=new n(e);return t.cmp(r.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new n(e),i=r.n.sub(t).umod(r.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new n(t);if(i.cmp(r.n)>=0)return 1;if(i.iadd(new n(e)),i.cmp(r.n)>=0&&i.isub(r.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new n(t);if(i.cmp(r.n)>=0||i.isZero())return 1;i.imul(new n(e)),i.cmp(r.n)>=0&&(i=i.umod(r.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const s=new n(i);if(s.cmp(r.n)>=0||s.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const r=i(t);if(null===r)return 1;return o(e,r.getPublic()),0},publicKeyNegate(e,t){const r=i(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),o(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=i(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(o(e,n),0)},publicKeyTweakAdd(e,t,s){const a=i(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0)return 2;const c=a.getPublic().add(r.g.mul(s));return c.isInfinity()?2:(o(e,c),0)},publicKeyTweakMul(e,t,s){const a=i(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0||s.isZero())return 2;return o(e,a.getPublic().mul(s)),0},signatureNormalize(e){const i=new n(e.subarray(0,32)),o=new n(e.subarray(32,64));return i.cmp(r.n)>=0||o.cmp(r.n)>=0?1:(1===o.cmp(t.nh)&&e.set(r.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new n(i).cmp(r.n)>=0)return 1;if(new n(o).cmp(r.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(i,1);let c=33,u=0;for(;c>1&&0===a[u]&&!(128&a[u+1]);--c,++u);if(a=a.subarray(u),128&a[0])return 1;if(c>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(o,1);let d=33,f=0;for(;d>1&&0===l[f]&&!(128&l[f+1]);--d,++f);return l=l.subarray(f),128&l[0]||d>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+d,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+c]=2,s[5+c]=l.length,s.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let s=t.subarray(4,4+i);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+i);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let c=new n(s);c.cmp(r.n)>=0&&(c=new n(0));let u=new n(t.subarray(6+i));return u.cmp(r.n)>=0&&(u=new n(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,s,a){if(a){const e=a;a=t=>{const r=e(i,o,null,s,t);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new n(r)}}const c=new n(o);if(c.cmp(r.n)>=0||c.isZero())return 1;let u;try{u=t.sign(i,o,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,o,s){const a={r:e.subarray(0,32),s:e.subarray(32,64)},c=new n(a.r),u=new n(a.s);if(c.cmp(r.n)>=0||u.cmp(r.n)>=0)return 1;if(1===u.cmp(t.nh)||c.isZero()||u.isZero())return 3;const l=i(s);if(null===l)return 2;const d=l.getPublic();return t.verify(o,a,d)?0:3},ecdsaRecover(e,i,s,a){const c={r:i.slice(0,32),s:i.slice(32,64)},u=new n(c.r),l=new n(c.s);if(u.cmp(r.n)>=0||l.cmp(r.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let d;try{d=t.recoverPubKey(a,c,s)}catch(e){return 2}return o(e,d),0},ecdh(e,o,s,a,c,u,l){const d=i(o);if(null===d)return 1;const f=new n(s);if(f.cmp(r.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===c){const r=h.encode(null,!0),n=t.hash().update(r).digest();for(let t=0;t<32;++t)e[t]=n[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=r[e];const n=c(u,l,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}},Gn}function si(){return Zn||(Zn=1,Yn=function(){if(mr)return br;mr=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",r="The tweak was out of range or equal to zero",n="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",s="Public Key serialization error",a="The sum of the public keys is not valid",c="Signature could not be parsed",u="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,r){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;f(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;f(t.length===r,n)}}function p(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function b(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return br=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(n)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,r){switch(h("private key",e,32),h("tweak",r,32),g.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(r)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,r){switch(h("private key",e,32),p(t),r=b(r,t?33:65),g.publicKeyCreate(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(s)}},publicKeyConvert(e,t=!0,r){switch(h("public key",e,[33,65]),p(t),r=b(r,t?33:65),g.publicKeyConvert(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(s)}},publicKeyNegate(t,r=!0,n){switch(h("public key",t,[33,65]),p(r),n=b(n,r?33:65),g.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(s)}},publicKeyCombine(e,t=!0,r){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),r=b(r,t?33:65),g.publicKeyCombine(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(a);case 3:throw new Error(s)}},publicKeyTweakAdd(e,r,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",r,32),p(n),i=b(i,n?33:65),g.publicKeyTweakAdd(i,e,r)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),p(n),i=b(i,n?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(r)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(t,r){h("signature",t,64);const n={output:r=b(r,72),outputlen:72};switch(g.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(t,r){switch(h("signature",t),r=b(r,64),g.signatureImport(r,t)){case 0:return r;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(t,r,n={},i){h("message",t,32),h("private key",r,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.noncefn&&f("Function"===m(n.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=b(i,64),recid:null};switch(g.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(u);case 2:throw new Error(e)}},ecdsaVerify(e,t,r){switch(h("signature",e,64),h("message",t,32),h("public key",r,[33,65]),g.ecdsaVerify(e,t,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(o)}},ecdsaRecover(t,r,n,i=!0,o){switch(h("signature",t,64),f("Number"===m(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",n,32),p(i),o=b(o,i?33:65),g.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(e)}},ecdh(e,t,r={},n){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.hashfn?(f("Function"===m(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&h("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&h("options.ybuf",r.ybuf,32),h("output",n)):n=b(n,32),g.ecdh(n,e,t,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(d)}}}),br}()(oi())),Yn}function ai(){if(Jn)return gr;Jn=1;var e=gr&&gr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gr,"__esModule",{value:!0}),gr.PublicKey=void 0;const t=gt(),r=tr(),n=e(si()),i=oe();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class s extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?s.fromString(e):e}static fromString(e){const r=e.split(":");let n,o;if(1===r.length)n=r[0];else{if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");n=r[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(r[0])}const a=(0,t.baseDecode)(n);o||(o=a.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const c=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(a.length!==c)throw new Error(`Invalid public key size (${a.length}), must be ${c}`);return new s({keyType:o,data:a})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,s=this.data;switch(o){case i.KeyType.ED25519:return r.ed25519.verify(t,e,s);case i.KeyType.SECP256K1:return n.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...s]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return gr.PublicKey=s,gr}function ci(){if(Qn)return de;Qn=1;var e=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(de,"__esModule",{value:!0}),de.KeyPairEd25519=void 0;const t=gt(),r=tr(),n=e(pr()),i=oe(),o=ue(),s=ai();class a extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),a=r.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new s.PublicKey({keyType:i.KeyType.ED25519,data:a}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.ed25519.getPublicKey(new Uint8Array(e)),s=new Uint8Array([...e,...o]);return new a((0,t.baseEncode)(s))}sign(e){return{signature:r.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return de.KeyPairEd25519=a,de}var ui,li,di,fi,hi={};function pi(){if(ui)return hi;ui=1;var e=hi&&hi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hi,"__esModule",{value:!0}),hi.KeyPairSecp256k1=void 0;const t=gt(),r=e(pr()),n=e(si()),i=oe(),o=ue(),s=ai();class a extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),a=n.default.publicKeyCreate(new Uint8Array(o),!1),c=a.subarray(1,a.length);this.publicKey=new s.PublicKey({keyType:i.KeyType.SECP256K1,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.default.publicKeyCreate(new Uint8Array(e),!1),s=o.subarray(1,o.length),c=new Uint8Array([...e,...s]);return new a((0,t.baseEncode)(c))}sign(e){const{signature:r,recid:i}=n.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...r,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return hi.KeyPairSecp256k1=a,hi}function bi(){return di||(di=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=oe();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var r=function(){if(li)return ae;li=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.KeyPair=void 0;const e=ue(),t=ci(),r=pi();class n extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return r.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const n=e.split(":");if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(n[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(n[1]);case"SECP256K1":return new r.KeyPairSecp256k1(n[1]);default:throw new Error(`Unknown curve: ${n[0]}`)}}}return ae.KeyPair=n,ae}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return r.KeyPair}});var n=ci();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}});var i=pi();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=ai();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(ne)),ne}function mi(){return fi||(fi=1,function(e){var t=F&&F.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=F&&F.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=F&&F.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,r){const n=new u(t),i=o.serialize(e.authPayloadSchema,n),a=Uint8Array.from(s.default.sha256.array(i));let l=new Uint8Array(Buffer.from(r.signature,"base64"));return c.PublicKey.from(r.publicKey).verify(a,l)};const o=n(function(){if(Z)return U;Z=1;var e=U&&U.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=U&&U.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=U&&U.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};U.__esModule=!0,U.deserialize=U.serialize=void 0;var n=function(){if(V)return D;V=1;var e=D&&D.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=D&&D.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=D&&D.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};D.__esModule=!0,D.BorshSerializer=void 0;var n=W(),i=K(),o=r(X()),s=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var s=i[n];this.encode_value(s,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,s=n;i<s.length;i++){var a=s[i];this.encode_value(a,t.map.key),this.encode_value(r?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return D.BorshSerializer=s,D}(),i=function(){if(Y)return J;Y=1,J.__esModule=!0,J.BorshDeserializer=void 0;var e=W(),t=K(),r=function(){function r(e){this.buffer=new t.DecodeBuffer(e)}return r.prototype.decode=function(e){return this.decode_value(e)},r.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},r.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},r.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},r.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},r.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},r.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},r.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},r.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},r.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},r.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},r.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},r}();return J.BorshDeserializer=r,J}(),o=r(X());return U.serialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new n.BorshSerializer(r).encode(t,e)},U.deserialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},U}()),s=i((Q||(Q=1,a=ee,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self,i=!r.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?r=B:n&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&a.exports,s=!r.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(r){return new y(t,!0).update(r)[e]()}},b=function(e){var t=p("hex",e);i&&(t=m(t,e)),t.create=function(){return new y(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=p(n,e)}return t},m=function(t,n){var i,o=te,s=te.Buffer,a=n?"sha224":"sha256";return i=s.from&&!r.JS_SHA256_NO_BUFFER_FROM?s.from:function(e){return new s(e)},function(r){if("string"==typeof r)return o.createHash(a).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===s?o.createHash(a).update(i(r)).digest("hex"):t(r)}},g=function(e,t){return function(r,n){return new x(r,t,!0).update(n)[e]()}},v=function(e){var t=g("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=g(n,e)}return t};function y(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function x(t,r,n){var i,o=typeof t;if("string"===o){var a,c=[],u=t.length,l=0;for(i=0;i<u;++i)(a=t.charCodeAt(i))<128?c[l++]=a:a<2048?(c[l++]=192|a>>>6,c[l++]=128|63&a):a<55296||a>=57344?(c[l++]=224|a>>>12,c[l++]=128|a>>>6&63,c[l++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++i)),c[l++]=240|a>>>18,c[l++]=128|a>>>12&63,c[l++]=128|a>>>6&63,c[l++]=128|63&a);t=c}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new y(r,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}y.call(this,r,n),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}y.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,a=0,c=t.length,u=this.blocks;a<c;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),r)for(o=this.start;a<c&&o<64;++a)u[o>>>2]|=t[a]<<l[3&o++];else for(o=this.start;a<c&&o<64;++a)(i=t.charCodeAt(a))<128?u[o>>>2]|=i<<l[3&o++]:i<2048?(u[o>>>2]|=(192|i>>>6)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(u[o>>>2]|=(224|i>>>12)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++a)),u[o>>>2]|=(240|i>>>18)<<l[3&o++],u[o>>>2]|=(128|i>>>12&63)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=u[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,r,n,i,o,s,a,c,u=this.h0,l=this.h1,f=this.h2,h=this.h3,p=this.h4,b=this.h5,m=this.h6,g=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+r|0;for(c=l&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=v[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=v[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(o=u&l)^u&f^c,g=h+(i=g+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&m)+d[e]+v[e])|0,h=i+(t+n)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&u)^h&l^o,m=f+(i=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&p^~g&b)+d[e+1]+v[e+1])|0,t=((f=i+(t+n)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(a=f&h)^f&u^s,b=l+(i=b+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&p)+d[e+2]+v[e+2])|0,t=((l=i+(t+n)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&f)^l&h^a,p=u+(i=p+(r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&m^~b&g)+d[e+3]+v[e+3])|0,u=i+(t+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+l|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+b|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s];return this.is224||(u+=c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a]),u},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},x.prototype=new y,x.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),y.prototype.finalize.call(this)}};var w=b();w.sha256=w,w.sha224=b(!0),w.sha256.hmac=v(),w.sha224.hmac=v(!0),o?a.exports=w:(r.sha256=w.sha256,r.sha224=w.sha224)}()),ee.exports));var a;const c=bi();class u{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:r}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=r}}e.AuthPayload=u,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(F)),F}var gi={};const vi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function yi(e){return vi.test(e)}function xi(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}xi.valid=yi;var wi,Ai,Ei,Si,_i,Ii,Ni,Mi=j(Object.freeze({__proto__:null,default:xi,uuid4:xi,valid:yi})),Ci={},Ti={exports:{}},ki={exports:{}};function Ri(){return wi||(wi=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var r=0;r<e.length;r++)e[r]=t.endian(e[r]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},ki.exports=t),ki.exports;var e,t}function Bi(){if(Ei)return Ai;Ei=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};return Ai=e}function Oi(){return Si||(Si=1,function(){var e=Ri(),t=Bi().utf8,r=Bi().bin,n=function(n,i){var o=e.wordsToBytes(function(r){r.constructor==String?r=t.stringToBytes(r):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(r)?r=Array.prototype.slice.call(r,0):Array.isArray(r)||(r=r.toString());var n=e.bytesToWords(r),i=8*r.length,o=[],s=1732584193,a=-271733879,c=-1732584194,u=271733878,l=-1009589776;n[i>>5]|=128<<24-i%32,n[15+(i+64>>>9<<4)]=i;for(var d=0;d<n.length;d+=16){for(var f=s,h=a,p=c,b=u,m=l,g=0;g<80;g++){if(g<16)o[g]=n[d+g];else{var v=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=v<<1|v>>>31}var y=(s<<5|s>>>27)+l+(o[g]>>>0)+(g<20?1518500249+(a&c|~a&u):g<40?1859775393+(a^c^u):g<60?(a&c|a&u|c&u)-1894007588:(a^c^u)-899497514);l=u,u=c,c=a<<30|a>>>2,a=s,s=y}s+=f,a+=h,c+=p,u+=b,l+=m}return[s,a,c,u,l]}(n));return i&&i.asBytes?o:i&&i.asString?r.bytesToString(o):e.bytesToHex(o)};n._blocksize=16,n._digestsize=20,Ti.exports=n}()),Ti.exports}function ji(){return Ii||(Ii=1,function(e){var t=gi&&gi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const r=t(Mi),n=gt(),i=(_i||(_i=1,function(e){var t=Ci&&Ci.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const r=t(Oi()),n=t(Mi),i=gt();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const r=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===r.ok)throw Error(await r.text());const{data:n}=await r.json();return JSON.parse(n)},e.deleteRequest=async t=>{const r=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error(await r.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,n.default)()})),o=(0,r.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,r)=>{const{query:n,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:n}),headers:{"content-type":"application/json"},method:"POST",signal:r});if(!1===o.ok)throw Error(await o.text());return i}}(Ci)),Ci);e.wait=e=>new Promise(t=>setTimeout(t,e));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let s;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(s?.remove(),s=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const n=(0,r.default)();return new Promise((r,i)=>{const o=e=>{if(e.data.id===n)return window?.removeEventListener("message",o),e.data.success?r(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:n},"*"),window?.addEventListener("message",o)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,a){if(null!=window.hotExtension)return window.hotExtension.request(t,a);if(this.isInjected)return this.injectedRequest(t,a);const c=(0,r.default)(),u=window?.Telegram?.WebApp,l=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:a,id:c}),d=`${this.walletId}?startapp=hotconnect-${(0,n.baseEncode)(l)}`;if(u)u?.openTelegramLink(d);else{(e=>{s?.remove(),s=document.createElement("div");const t=document.createElement("iframe");s?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),s.style.padding="16px",s.style.zIndex="100000000000000",s.style.position="fixed",s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.background="rgba(0, 0, 0, 0.1)",s.style.backdropFilter="blur(24px)",s.onclick=()=>{s?.remove(),s=void 0},document.body.appendChild(s)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,n.baseEncode)(l)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(l).catch(()=>null);if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return s?.remove(),h}}}(gi)),gi}var Li,Pi=(Ni||(Ni=1,function(e){var t=P&&P.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var r=mi();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return r.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return r.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return r.authPayloadSchema}});var n=ji();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(n).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return n.RequestFailed}})}(P)),P).HOT,Fi={name:b.Hot,website:"https://hot-labs.org/",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Pi.request("stellar:getAddress",{})];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Hana wallet.");case 3:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("HotWallet does not support the getNetwork function")})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2,"undefined"!=typeof window&&!!window.hotExtension]})})},signAuthEntry:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Pi.request("stellar:signAuthEntry",{authEntry:e,accountToSign:t.address})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using HotWallet");case 3:return[2]}})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Pi.request("stellar:signMessage",{message:e,accountToSign:t.address})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using HotWallet");case 3:return[2]}})})},signTransaction:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return C(void 0,k([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Pi.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using HotWallet");case 3:return[2]}})})}},Ui={name:b.Hana,website:"https://www.hanawallet.io/",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,window.hanaWallet.stellar.getPublicKey()];case 1:if(!e.sent())throw new Error("Hana Wallet is not installed or connected.");return[4,window.hanaWallet.stellar.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to HanaWallet.");case 4:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!(null===(t=window.hanaWallet)||void 0===t?void 0:t.stellar))throw new Error("Hana Wallet is not installed.");return[4,window.hanaWallet.stellar.getNetworkDetails()];case 1:return[2,{network:(e=r.sent()).network,passphrase:e.networkPassphrase}];case 2:throw r.sent(),new Error("Failed to getNetwork using HanaWallet");case 3:return[2]}})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return C(void 0,void 0,void 0,function(){var r;return T(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signAuthEntry using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signAuthEntry using HanaWallet");case 4:return[2]}})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var r;return T(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signMessage using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signMessage({message:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signMessage using HanaWallet");case 4:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){var r,n,i,o;return T(this,function(s){switch(s.label){case 0:if(!("undefined"!=typeof window&&!!(null===(n=window.hanaWallet)||void 0===n?void 0:n.stellar)))throw new Error("Failed to signTransaction using HanaWallet");s.label=1;case 1:if(s.trys.push([1,3,,4]),"function"!=typeof(r=null===(o=null===(i=null===window||void 0===window?void 0:window.hanaWallet)||void 0===i?void 0:i.stellar)||void 0===o?void 0:o.signTransaction))throw new Error("Failed to signTransaction using HanaWallet");return[4,r({xdr:e,address:t.address,networkPassphrase:t.network})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to signTransaction using HanaWallet");case 4:return[2]}})})}},Di={name:b.Rabet,website:"https://rabet.io",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.connect()];case 1:return[2,e.sent().publicKey];case 2:throw e.sent(),new Error("Failed to connect to Rabet.");case 3:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){}return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.getNetwork()];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("Failed to getNetwork from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){return e("undefined"!=typeof window&&!!window.rabet)},150)})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Rabet does not support the signAuthEntry function")})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.signMessage(e)];case 1:if(!(t=r.sent()).message||t.error)throw new Error("Failed to signMessage from Rabet");return[2,t.message];case 2:throw r.sent(),new Error("Failed to signMessage from Rabet");case 3:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.sign(e,t.network===m.PUBLIC?"mainnet":"testnet")];case 1:return[2,r.sent().xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Rabet.");case 3:return[2]}})})}},zi={name:b.Xbull,website:"https://xbull.app",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:if(e.trys.push([0,3,,4]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0})];case 1:return e.sent(),[4,window.xBullSDK.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to xBull");case 4:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Error getting network from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){e("undefined"!=typeof window&&!!window.xBullSDK)},150)})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("xBull does not support the signAuthEntry function")})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var r;return T(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if((r=n.sent()).error)throw new Error("Failed to signMessage using xBull");return[2,r.signedMessage];case 2:throw n.sent(),new Error("Failed to signMessage using xBull");case 3:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed.");return[4,window.xBullSDK.signXDR(e,{network:t.network,publicKey:t.address})];case 1:return[2,r.sent()];case 2:throw r.sent(),new Error("Failed to sign the transaction with xBull.");case 3:return[2]}})})}},Wi={name:b.Albedo,website:"https://albedo.link",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,x.default.publicKey({token:"Connect to Albedo"})];case 1:return[2,e.sent().pubkey];case 2:throw e.sent(),new Error("Failed to connect to Albedo.");case 3:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Albedo does not support the getNetwork function")})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2,!0]})})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Albedo does not support the signAuthEntry function")})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return[4,x.default.signMessage({message:e,pubkey:t.address})];case 1:return[2,r.sent().signed_message]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,x.default.tx({xdr:e,pubkey:t.address,network:t.network})];case 1:return[2,r.sent().signed_envelope_xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Albedo.");case 3:return[2]}})})}},$i={name:b.Klever,website:"https://klever.io",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getAddress()];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Klever");case 3:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Failed to getNetwork from Klever");case 3:return[2]}})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.kleverWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using Klever");case 3:return[2]}})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using Klever");case 3:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signTransaction(e,t)];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using Klever");case 3:return[2]}})})}},qi={name:b.Lobstr,website:"https://lobstr.co",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,w.default.isConnected()];case 1:if(!e.sent())throw new Error("LOBSTR Wallet is not installed or connected.");return[4,w.default.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to LOBSTR.");case 4:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Failed to get network from LOBSTR")})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return[4,w.default.isConnected()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("LOBSTR does not support the signAuthEntry function")})})},signMessage:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("LOBSTR does not support the signMessage function")})})},signTransaction:function(e){return C(void 0,void 0,void 0,function(){return T(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!w.default.signTransaction)throw new Error("LOBSTR Wallet does not support signing transactions.");return[4,w.default.signTransaction(e)];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("Failed to sign the transaction with LOBSTR.");case 3:return[2]}})})}},Ki={name:b.Freighter,website:"https://freighter.app",connect:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,6]),[4,n.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,n.requestAccess()];case 2:if((e=t.sent()).error&&"The user rejected this request."===e.error.message)throw new Error("Failed to connect to Freighter");if(""===e.address.trim())throw new Error("Failed to connect to Freighter.");return[2,e.address];case 3:return"Failed to connect to Freighter."!==t.sent().message?[3,5]:[4,Ki.connect()];case 4:return[2,t.sent()];case 5:throw new Error("Failed to connect to Freighter.");case 6:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,n.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,A.default.getNetwork()];case 2:if((e=t.sent()).error)throw new Error("Failed to get network from Freighter");return[2,{network:e.network,passphrase:e.networkPassphrase}];case 3:throw t.sent(),new Error("Failed to disconnect from Rabet.");case 4:return[2]}})})},isAvailable:function(){return new Promise(function(e){var t=setTimeout(function(){e(!1)},700);setTimeout(function(){return C(void 0,void 0,void 0,function(){return T(this,function(r){try{n.isConnected().then(function(r){var i=r.isConnected,o=r.error;i?(clearTimeout(t),e(!o&&i)):setTimeout(function(){n.isConnected().then(function(r){var n=r.isConnected,i=r.error;clearTimeout(t),e(!i&&n)})},350)}).catch(function(){clearTimeout(t),e(!1)})}catch(t){e(!1)}return[2]})})},450)})},signAuthEntry:function(e,t){return C(void 0,void 0,void 0,function(){var r,i,o;return T(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,n.isConnected()];case 1:if(!s.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,n.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 2:if(r=s.sent(),i=r.error,o=r.signedAuthEntry,i||!o)throw new Error("Could not signedAuthEntry using Freighter");return[2,Buffer.from(o).toString("base64")];case 3:throw s.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var r,i;return T(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if(r=o.sent(),i=r.signedMessage,r.error||!i)throw new Error("Failed to sign message using Freighter");return[2,"string"==typeof i?i:Buffer.from(i).toString("base64")];case 2:throw o.sent(),new Error("Failed to sign message using Freighter");case 3:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,n.isConnected()];case 1:if(!r.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,n.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 2:return[2,r.sent().signedTxXdr];case 3:throw r.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})}},Hi={logo:"",fontFamily:"Manrope",textColor:"#000000",accentColor:"#0c1083",background:"#ffffff",fieldBackground:"#ffffff",borderRadius:"24px",borderColor:"#cdceee",borderWidth:"1px",backdropBlur:"1px",backdropColor:"#00000033",boxShadow:"0px 4px 80px 0px #00000008"},Vi=o.createStore(function(){return{config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],loginMethods:["wallet"],showWalletUIs:!0,explorer:"stellarchain",isPersistent:!1,promptOnWrongNetwork:!0,appearance:Hi,walletConnect:{icons:[],url:"",projectId:"",description:""}},user:void 0,authState:{isReady:!1,isAuthenticated:!1},stellar:void 0}}),Gi=Vi.getState,Xi=Vi.subscribe,Yi=Vi.getInitialState;exports.BluxEvent=void 0,(Li=exports.BluxEvent||(exports.BluxEvent={})).LoggedIn="blux:logged_in",Li.LoggedOut="blux:logged_out",Li.NetworkChanged="blux:network_changed",Li.ModalOpened="blux:modal_opened",Li.ModalClosed="blux:modal_closed";var Zi=function(){function e(){this.handlers=new Map}return e.prototype.on=function(e,t){var r,n=this,i=null!==(r=this.handlers.get(e))&&void 0!==r?r:new Set;return i.add(t),this.handlers.set(e,i),function(){return n.off(e,t)}},e.prototype.off=function(e,t){var r=this.handlers.get(e);r&&(r.delete(t),0===r.size&&this.handlers.delete(e))},e.prototype.once=function(e,t){var r=this,n=function(i){try{t(i)}finally{r.off(e,n)}};return this.on(e,n)},e.prototype.emit=function(e,t){var r=this.handlers.get(e);if(r)for(var n=0,i=Array.from(r);n<i.length;n++){var o=i[n];try{o(t)}catch(e){}}},e.prototype.clear=function(e){e?this.handlers.delete(e):this.handlers.clear()},e}(),Ji=new Zi,Qi=o.createStore(function(e){return{logos:null,emitter:Ji,auth:void 0,config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],isPersistent:!1,showWalletUIs:!0,loginMethods:["wallet"],explorer:"stellarchain",promptOnWrongNetwork:!0,appearance:Hi,walletConnect:{icons:[],url:"",projectId:"",description:""}},login:void 0,stellar:void 0,signMessage:void 0,sendTransaction:void 0,wallets:[],waitingStatus:"login",showAllWallets:!1,modal:{isOpen:!1,route:g.ONBOARDING,dynamicTitle:"",alert:{type:"none",message:""}},authState:{isReady:!1,isAuthenticated:!1},balances:{error:null,loading:!1,balances:[]},apiResponse:void 0,transactions:{error:null,loading:!1,transactions:[]},selectAsset:{field:"send",sendAsset:R,swapToAsset:R,swapFromAsset:R},walletConnectClient:void 0,networkSyncDisabled:!1,setConfig:function(t){return e(function(e){return N(N({},e),{config:t})})},setWallets:function(t){return e(function(e){return N(N({},e),{wallets:t})})},setIsReady:function(t){return e(function(e){return N(N({},e),{authState:N(N({},e.authState),{isReady:t})})})},setShowAllWallets:function(t){return e(function(e){return N(N({},e),{showAllWallets:t})})},setRoute:function(t){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{route:t})})})},setSendTransaction:function(t,r,n){return void 0===n&&(n=g.SEND_TRANSACTION),e(function(e){return N(N({},e),{sendTransaction:t,modal:N(N({},e.modal),{isOpen:r,route:n}),waitingStatus:"sendTransaction"})})},setSignMessage:function(t,r,n){return void 0===n&&(n=g.SIGN_MESSAGE),e(function(e){return N(N({},e),{signMessage:t,modal:N(N({},e.modal),{isOpen:r,route:n}),waitingStatus:"signMessage"})})},setStellar:function(t){return e(function(e){return N(N({},e),{stellar:t})})},approveSendTransaction:function(){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{isOpen:!0,route:g.WAITING}),waitingStatus:"sendTransaction"})})},openModal:function(t){e(function(e){return N(N({},e),{modal:N(N({},e.modal),{route:t,isOpen:!0})})}),eo().emitter.emit(exports.BluxEvent.ModalOpened,{modal:t,reason:"openModal"})},setDynamicTitle:function(t){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{dynamicTitle:t})})})},setAlert:function(t,r){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{alert:{type:t,message:r}})})})},closeModal:function(){return e(function(e){return N(N({},e),{modal:N(N({},e.modal),{isOpen:!1})})})},connectWallet:function(t){var r=t===b.WalletConnect?g.WALLET_CONNECT:g.WAITING;e(function(e){return N(N({},e),{waitingStatus:"login",user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:t},modal:N(N({},e.modal),{isOpen:!0,route:r})})}),eo().emitter.emit(exports.BluxEvent.ModalOpened,{modal:r,reason:"connectWallet",meta:{walletName:t}})},setIsAuthenticated:function(t){return e(function(e){return N(N({},e),{authState:N(N({},e.authState),{isAuthenticated:t})})})},connectWalletSuccessful:function(t,r){return e(function(e){var n,i;return N(N({},e),{authState:N({},e.authState),user:N(N({},e.user),{address:t,walletPassphrase:r,authValue:(null===(n=e.user)||void 0===n?void 0:n.authValue)||"",authMethod:(null===(i=e.user)||void 0===i?void 0:i.authMethod)||""})})})},connectEmail:function(t){return e(function(e){return N(N({},e),{waitingStatus:"login",user:{address:"",authValue:t,authMethod:"email",walletPassphrase:""},modal:N(N({},e.modal),{isOpen:!0,route:g.OTP})})})},logoutAction:function(){return e(function(e){return N(N({},e),{user:void 0,waitingStatus:"login",authState:N(N({},e.authState),{isAuthenticated:!1}),modal:N(N({},e.modal),{isOpen:!1})})})},setBalances:function(t){return e(function(e){return N(N({},e),{balances:t})})},setAuth:function(t){return e(function(e){return N(N({},e),{auth:t})})},setTransactions:function(t){return e(function(e){return N(N({},e),{transactions:t})})},setSelectAsset:function(t){return e(function(e){return N(N({},e),{selectAsset:t})})},setWalletConnectClient:function(t,r){return e(function(e){return N(N({},e),{walletConnect:{client:t,connection:r}})})},cleanUp:function(t){return e(function(e){var r;return N(N({},e),((r={})[t]=void 0,r))})},setNetworkSyncDisabled:function(t){return e(function(e){return N(N({},e),{networkSyncDisabled:t})})},setAppearance:function(t){return e(function(e){return N(N({},e),{config:N(N({},e.config),{appearance:N(N({},e.config.appearance),t)})})})},setApiResponse:function(t){return e(function(e){return N(N({},e),{apiResponse:t})})},setLogin:function(t){return e(function(e){return N(N({},e),{login:t})})},setLogos:function(t){return e(function(e){return N(N({},e),{logos:t})})}}}),eo=Qi.getState,to=Qi.setState;Qi.subscribe,Qi.getInitialState;var ro,no,io=function(e){return i.useStore(Qi,e)};no=(ro=Qi).getState(),Vi.setState({user:no.user,config:no.config,stellar:no.stellar,authState:no.authState}),ro.subscribe(function(e){Vi.setState({user:e.user,config:e.config,stellar:e.stellar,authState:e.authState})});var oo,so="__BLUX__JWT_STORE",ao="__BLUX__RECENT_CONNECTION_METHODS",co="stellar:pubnet",uo="stellar:testnet",lo="https://api.blux.cc",fo="blux-app-id",ho={name:b.WalletConnect,website:"https://walletconnect.com",isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2,!!eo().config.walletConnect]})})},connect:function(){return C(void 0,void 0,void 0,function(){var e,t,r;return T(this,function(n){switch(n.label){case 0:if(!(e=eo().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up. Please check your store configuration.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.connection.approval()];case 2:if(t=n.sent(),!(r=t.namespaces.stellar)||!r.accounts[0])throw new Error("Wallet did not approve the required Stellar namespace/account.");return[2,r.accounts[0].split(":").pop()];case 3:throw n.sent(),new Error("Failed to connect to Wallet. Ensure your wallet supports Stellar WalletConnect.");case 4:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:if(!(e=eo().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up.");r.label=1;case 1:return r.trys.push([1,3,,4]),0===(t=e.client.session.getAll()).length?[2]:[4,e.client.disconnect({topic:t[0].topic,reason:{code:6e3,message:"User explicitly disconnected."}})];case 2:return r.sent(),[3,4];case 3:throw r.sent(),new Error("Failed to disconnect from Wallet Connect. Try closing the session in your mobile wallet.");case 4:return[2]}})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Cannot reliably get the active network from WalletConnect without a specific session request.")})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){var r,n,i,o;return T(this,function(s){switch(s.label){case 0:if(!(r=eo().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");s.label=1;case 1:if(s.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return i=n[0],o=t.network===m.PUBLIC?co:uo,[4,r.client.request({topic:i.topic,chainId:o,request:{method:"stellar_signXDR",params:{xdr:e}}})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to sign and submit the transaction with Wallet Connect.");case 4:return[2]}})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var r,n,i,o,s,a;return T(this,function(c){switch(c.label){case 0:if(!(r=eo().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");c.label=1;case 1:if(c.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return i=n[0],o=t.network===m.PUBLIC?co:uo,s=(null===(a=i.namespaces.stellar.chains)||void 0===a?void 0:a[0])||o,[4,r.client.request({topic:i.topic,chainId:s,request:{method:"stellar_signMessage",params:{message:e}}})];case 2:return[2,c.sent()];case 3:throw c.sent(),new Error("Failed to sign message with Wallet Connect.");case 4:return[2]}})})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Stellar Auth Entry signing is not supported via standard WalletConnect methods.")})})}},po={exports:{}};var bo=function(){if(oo)return po.exports;oo=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}po.exports=i,po.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,c,u;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),c=o[t]),void 0===c)c=o[t]=r,++e._eventsCount;else if("function"==typeof c?c=o[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},po.exports}(),mo=O(bo);const go=e=>{class t extends Error{cause;constructor(r,n,i){if(super(r||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,n)for(const e in n)this[e]=n[e];if(i&&"object"==typeof i&&"cause"in i&&!this.cause){const e=i.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return t};const vo=go("DisconnectedDevice"),yo=go("DisconnectedDeviceDuringOperation"),xo=go("TransportOpenUserCancelled"),wo=go("TransportInterfaceNotAvailable"),Ao=go("TransportRaceCondition"),Eo=go("TransportWebUSBGestureRequired");var So;!function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(So||(So={}));class _o extends Error{id;constructor(e,t){const r="TransportError";super(e||r),this.name=r,this.message=e,this.stack=new Error(e).stack,this.id=t}}const Io={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,TRUSTCHAIN_WRONG_SEED:45063};class No extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){const r=Object.keys(Io).find(t=>Io[t]===e)||"UNKNOWN_ERROR",n=`Ledger device: ${function(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=e&&e<=28671)return"Internal error, please report"}(e)||r} (0x${e.toString(16)})`;if(super(n),this.name="TransportStatusError",this.statusCode=e,this.statusText=r,Object.setPrototypeOf(this,No.prototype),t&&e===Io.LOCKED_DEVICE)return new Mo(n)}}class Mo extends No{constructor(e){super(Io.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,Mo.prototype)}}let Co=0;const To=[],ko=(e,t,r)=>{const n={type:e,id:String(++Co),date:new Date};t&&(n.message=t),r&&(n.data=r),Oo(n)};class Ro{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:r,context:n})=>{const i={type:e,id:String(++Co),date:new Date};t&&(i.message=t),r&&(i.data=r),n&&(i.context=n),Oo(i)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new Ro(e,this.context)}withContext(e){return new Ro(this.type,e)}withUpdatedContext(e){return new Ro(this.type,{...this.context,...e})}}const Bo=e=>(To.push(e),()=>{const t=To.indexOf(e);-1!==t&&(To[t]=To[To.length-1],To.pop())});function Oo(e){for(let t=0;t<To.length;t++)try{To[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=Bo);class jo{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new Ro(t??"transport",e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let r=!1;return(async()=>{if(!r)for(const n of e){const e=await this.exchange(n);if(r)return;const i=e.readUInt16BE(e.length-2);if(i!==Io.OK)throw new No(i);t.next(e)}})().then(()=>!r&&t.complete(),e=>!r&&t.error(e)),{unsubscribe:()=>{r=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new mo;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,r,n,i=hr().Buffer.alloc(0),o=[Io.OK],{abortTimeoutMs:s}={})=>{const a=this.tracer.withUpdatedContext({function:"send"});if(i.length>=256)throw a.trace("data.length exceeded 256 bytes limit",{dataLength:i.length}),new _o("data.length exceed 256 bytes limit. Got: "+i.length,"DataLengthTooBig");a.trace("Starting an exchange",{abortTimeoutMs:s});const c=await this.exchange(hr().Buffer.concat([Buffer.from([e,t,r,n]),Buffer.from([i.length]),i]),{abortTimeoutMs:s});a.trace("Received response from exchange");const u=c.readUInt16BE(c.length-2);if(!o.some(e=>e===u))throw new No(u);return c};static create(e=3e3,t){return new Promise((r,n)=>{let i=!1;const o=this.listen({next:t=>{i=!0,o&&o.unsubscribe(),s&&clearTimeout(s),this.open(t.descriptor,e).then(r,n)},error:e=>{s&&clearTimeout(s),n(e)},complete:()=>{s&&clearTimeout(s),i||n(new _o(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),s=t?setTimeout(()=>{o.unsubscribe(),n(new _o(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new Ao("An action was already pending on the Ledger device. Please deny or reconnect.");let r;const n=new Promise(e=>{r=e});this.exchangeBusyPromise=n;let i=!1;const o=setTimeout(()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const r=await e();return i&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),r}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(o),r&&r(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,r){for(const n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}_appAPIlock=null;decorateAppAPIMethod(e,t,r,n){return async(...i)=>{const{_appAPIlock:o}=this;if(o)return Promise.reject(new _o("Ledger Device is busy (lock "+o+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),await t.apply(r,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}function Lo(e){const t=hr().Buffer.alloc(2);return t.writeUInt16BE(e,0),t}const Po={data:hr().Buffer.alloc(0),dataLength:0,sequence:0};var Fo,Uo,Do,zo,Wo,$o,qo,Ko,Ho,Vo,Go,Xo,Yo,Zo,Jo,Qo,es,ts,rs,ns,is,os,ss,as,cs,us,ls,ds,fs,hs,ps,bs,ms,gs,vs,ys,xs,ws,As,Es,Ss,_s,Is,Ns,Ms,Cs,Ts,ks,Rs,Bs,Os,js,Ls,Ps,Fs,Us,Ds,zs,Ws,$s,qs,Ks,Hs,Vs,Gs,Xs,Ys,Zs,Js,Qs,ea,ta,ra,na,ia,oa,sa,aa,ca,ua,la,da,fa,ha,pa,ba,ma,ga,va,ya={exports:{}};function xa(){if(Uo)return Fo;Uo=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return Fo={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function wa(){if(zo)return Do;zo=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Do=e}function Aa(){return Wo||(Wo=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=xa(),o=wa(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,n]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=d++;o(e,i,t),l[e]=i,c[i]=t,u[i]=n,s[i]=new RegExp(t,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ya,ya.exports)),ya.exports}function Ea(){if(qo)return $o;qo=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return $o=r=>r?"object"!=typeof r?e:r:t}function Sa(){if(Ho)return Ko;Ho=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};return Ko={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}function _a(){if(Go)return Vo;Go=1;const e=wa(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=xa(),{safeRe:n,safeSrc:i,t:o}=Aa(),s=Ea(),{compareIdentifiers:a}=Sa();class c{constructor(i,a){if(a=s(a),i instanceof c){if(i.loose===!!a.loose&&i.includePrerelease===!!a.includePrerelease)return i;i=i.version}else if("string"!=typeof i)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",i,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const u=i.trim().match(a.loose?n[o.LOOSE]:n[o.FULL]);if(!u)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof c)){if("string"==typeof t&&t===this.version)return 0;t=new c(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),a(this.major,e.major)||a(this.minor,e.minor)||a(this.patch,e.patch)}comparePre(t){if(t instanceof c||(t=new c(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(e("prerelease compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return a(n,i)}while(++r)}compareBuild(t){t instanceof c||(t=new c(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(e("build compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return a(n,i)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=new RegExp(`^${this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]}$`),r=`-${t}`.match(e);if(!r||r[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Vo=c}function Ia(){if(Yo)return Xo;Yo=1;const e=_a();return Xo=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}},Xo}function Na(){if(ps)return hs;ps=1;const e=_a();return hs=(t,r,n)=>new e(t,n).compare(new e(r,n))}function Ma(){if(xs)return ys;xs=1;const e=_a();return ys=(t,r,n)=>{const i=new e(t,n),o=new e(r,n);return i.compare(o)||i.compareBuild(o)}}function Ca(){if(Is)return _s;Is=1;const e=Na();return _s=(t,r,n)=>e(t,r,n)>0}function Ta(){if(Ms)return Ns;Ms=1;const e=Na();return Ns=(t,r,n)=>e(t,r,n)<0}function ka(){if(Ts)return Cs;Ts=1;const e=Na();return Cs=(t,r,n)=>0===e(t,r,n)}function Ra(){if(Rs)return ks;Rs=1;const e=Na();return ks=(t,r,n)=>0!==e(t,r,n)}function Ba(){if(Os)return Bs;Os=1;const e=Na();return Bs=(t,r,n)=>e(t,r,n)>=0}function Oa(){if(Ls)return js;Ls=1;const e=Na();return js=(t,r,n)=>e(t,r,n)<=0}function ja(){if(Fs)return Ps;Fs=1;const e=ka(),t=Ra(),r=Ca(),n=Ba(),i=Ta(),o=Oa();return Ps=(s,a,c,u)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,u);case"!=":return t(s,c,u);case">":return r(s,c,u);case">=":return n(s,c,u);case"<":return i(s,c,u);case"<=":return o(s,c,u);default:throw new TypeError(`Invalid operator: ${a}`)}}}function La(){if(qs)return $s;qs=1;const e=/\s+/g;class t{constructor(r,n){if(n=i(n),r instanceof t)return r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease?r:new t(r.raw,n);if(r instanceof o)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const i=this.options.loose,a=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(a,M(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],l),s("comparator trim",e),e=e.replace(c[u.TILDETRIM],d),s("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),s("caret trim",e);let m=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>N(e,this.options));i&&(m=m.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),s("range list",m);const g=new Map,y=m.map(e=>new o(e,this.options));for(const e of y){if(b(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const x=[...g.values()];return n.set(t,x),x}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,r)&&e.set.some(e=>g(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(C(this.set[t],e,this.options))return!0;return!1}}$s=t;const r=(Ws||(Ws=1,zs=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),zs),n=new r,i=Ea(),o=Pa(),s=wa(),a=_a(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:d,caretTrimReplace:f}=Aa(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=xa(),b=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},v=(e,t)=>(s("comp",e,t),e=A(e,t),s("caret",e),e=x(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=I(e,t),s("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return s("tilde",e,t,r,n,i,o),y(r)?a="":y(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:y(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",a),a})},A=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let c;return s("caret",e,t,r,i,o,a),y(r)?c="":y(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:y(o)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),c="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(s("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),s("caret return",c),c})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>_(e,t)).join(" ")),_=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,(r,n,i,o,a,c)=>{s("xRange",e,r,n,i,o,a,c);const u=y(i),l=u||y(o),d=l||y(a),f=d;return"="===n&&f&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(l&&(o=0),a=0,">"===n?(n=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+i}.${o}.${a}${c}`):l?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),s("xRange return",r),r})},I=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),N=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),M=e=>(t,r,n,i,o,s,a,c,u,l,d,f)=>`${r=y(n)?"":y(i)?`>=${n}.0.0${e?"-0":""}`:y(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),C=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return $s}function Pa(){if(Hs)return Ks;Hs=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){if(i=r(i),n instanceof t){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],o=t.match(r);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Ks=t;const r=Ea(),{safeRe:n,t:i}=Aa(),o=ja(),s=wa(),a=_a(),c=La();return Ks}function Fa(){if(Gs)return Vs;Gs=1;const e=La();return Vs=(t,r,n)=>{try{r=new e(r,n)}catch(e){return!1}return r.test(t)},Vs}function Ua(){if(ia)return na;ia=1;const e=La();return na=(t,r)=>{try{return new e(t,r).range||"*"}catch(e){return null}},na}function Da(){if(sa)return oa;sa=1;const e=_a(),t=Pa(),{ANY:r}=t,n=La(),i=Fa(),o=Ca(),s=Ta(),a=Oa(),c=Ba();return oa=(u,l,d,f)=>{let h,p,b,m,g;switch(u=new e(u,f),l=new n(l,f),d){case">":h=o,p=a,b=s,m=">",g=">=";break;case"<":h=s,p=c,b=o,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,l,f))return!1;for(let e=0;e<l.set.length;++e){const n=l.set[e];let i=null,o=null;if(n.forEach(e=>{e.semver===r&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:b(e.semver,o.semver,f)&&(o=e)}),i.operator===m||i.operator===g)return!1;if((!o.operator||o.operator===m)&&p(u,o.semver))return!1;if(o.operator===g&&b(u,o.semver))return!1}return!0},oa}var za,Wa=function(){if(va)return ga;va=1;const e=Aa(),t=xa(),r=_a(),n=Sa(),i=Ia(),o=function(){if(Jo)return Zo;Jo=1;const e=Ia();return Zo=(t,r)=>{const n=e(t,r);return n?n.version:null},Zo}(),s=function(){if(es)return Qo;es=1;const e=Ia();return Qo=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null},Qo}(),a=function(){if(rs)return ts;rs=1;const e=_a();return ts=(t,r,n,i,o)=>{"string"==typeof n&&(o=i,i=n,n=void 0);try{return new e(t instanceof e?t.version:t,n).inc(r,i,o).version}catch(e){return null}},ts}(),c=function(){if(is)return ns;is=1;const e=Ia();return ns=(t,r)=>{const n=e(t,null,!0),i=e(r,null,!0),o=n.compare(i);if(0===o)return null;const s=o>0,a=s?n:i,c=s?i:n,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"}}(),u=function(){if(ss)return os;ss=1;const e=_a();return os=(t,r)=>new e(t,r).major}(),l=function(){if(cs)return as;cs=1;const e=_a();return as=(t,r)=>new e(t,r).minor}(),d=function(){if(ls)return us;ls=1;const e=_a();return us=(t,r)=>new e(t,r).patch}(),f=function(){if(fs)return ds;fs=1;const e=Ia();return ds=(t,r)=>{const n=e(t,r);return n&&n.prerelease.length?n.prerelease:null},ds}(),h=Na(),p=function(){if(ms)return bs;ms=1;const e=Na();return bs=(t,r,n)=>e(r,t,n)}(),b=function(){if(vs)return gs;vs=1;const e=Na();return gs=(t,r)=>e(t,r,!0)}(),m=Ma(),g=function(){if(As)return ws;As=1;const e=Ma();return ws=(t,r)=>t.sort((t,n)=>e(t,n,r))}(),v=function(){if(Ss)return Es;Ss=1;const e=Ma();return Es=(t,r)=>t.sort((t,n)=>e(n,t,r))}(),y=Ca(),x=Ta(),w=ka(),A=Ra(),E=Ba(),S=Oa(),_=ja(),I=function(){if(Ds)return Us;Ds=1;const e=_a(),t=Ia(),{safeRe:r,t:n}=Aa();return Us=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let s=null;if((o=o||{}).rtl){const e=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let t;for(;(t=e.exec(i))&&(!s||s.index+s[0].length!==i.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=i.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);if(null===s)return null;const a=s[2],c=s[3]||"0",u=s[4]||"0",l=o.includePrerelease&&s[5]?`-${s[5]}`:"",d=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${c}.${u}${l}${d}`,o)},Us}(),N=Pa(),M=La(),C=Fa(),T=function(){if(Ys)return Xs;Ys=1;const e=La();return Xs=(t,r)=>new e(t,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),Xs}(),k=function(){if(Js)return Zs;Js=1;const e=_a(),t=La();return Zs=(r,n,i)=>{let o=null,s=null,a=null;try{a=new t(n,i)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new e(o,i)))}),o},Zs}(),R=function(){if(ea)return Qs;ea=1;const e=_a(),t=La();return Qs=(r,n,i)=>{let o=null,s=null,a=null;try{a=new t(n,i)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new e(o,i)))}),o},Qs}(),B=function(){if(ra)return ta;ra=1;const e=_a(),t=La(),r=Ca();return ta=(n,i)=>{n=new t(n,i);let o=new e("0.0.0");if(n.test(o))return o;if(o=new e("0.0.0-0"),n.test(o))return o;o=null;for(let t=0;t<n.set.length;++t){const i=n.set[t];let s=null;i.forEach(t=>{const n=new e(t.semver.version);switch(t.operator){case">":0===n.prerelease.length?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":s&&!r(n,s)||(s=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!s||o&&!r(o,s)||(o=s)}return o&&n.test(o)?o:null},ta}(),O=Ua(),j=Da(),L=function(){if(ca)return aa;ca=1;const e=Da();return aa=(t,r,n)=>e(t,r,">",n),aa}(),P=function(){if(la)return ua;la=1;const e=Da();return ua=(t,r,n)=>e(t,r,"<",n),ua}(),F=function(){if(fa)return da;fa=1;const e=La();return da=(t,r,n)=>(t=new e(t,n),r=new e(r,n),t.intersects(r,n))}(),U=function(){if(pa)return ha;pa=1;const e=Fa(),t=Na();return ha=(r,n,i)=>{const o=[];let s=null,a=null;const c=r.sort((e,r)=>t(e,r,i));for(const t of c)e(t,n,i)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof n.raw?n.raw:String(n);return l.length<d.length?l:n},ha}(),D=function(){if(ma)return ba;ma=1;const e=La(),t=Pa(),{ANY:r}=t,n=Fa(),i=Na(),o=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===r){if(1===t.length&&t[0].semver===r)return!0;e=a.includePrerelease?o:s}if(1===t.length&&t[0].semver===r){if(a.includePrerelease)return!0;t=s}const l=new Set;let d,f,h,p,b,m,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,a):"<"===t.operator||"<="===t.operator?f=u(f,t,a):l.add(t.semver);if(l.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,a),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of l){if(d&&!n(e,String(d),a))return null;if(f&&!n(e,String(f),a))return null;for(const r of t)if(!n(e,String(r),a))return!1;return!0}let v=!(!f||a.includePrerelease||!f.semver.prerelease.length)&&f.semver,y=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=c(d,e,a),p===e&&p!==d)return!1}else if(">="===d.operator&&!n(d.semver,String(e),a))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(b=u(f,e,a),b===e&&b!==f)return!1}else if("<="===f.operator&&!n(f.semver,String(e),a))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&m&&!f&&0!==h||f&&g&&!d&&0!==h||y||v)},c=(e,t,r)=>{if(!e)return t;const n=i(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,r)=>{if(!e)return t;const n=i(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};return ba=(t,r,n={})=>{if(t===r)return!0;t=new e(t,n),r=new e(r,n);let i=!1;e:for(const e of t.set){for(const t of r.set){const r=a(e,t,n);if(i=i||null!==r,r)continue e}if(i)return!1}return!0}}();return ga={parse:i,valid:o,clean:s,inc:a,diff:c,major:u,minor:l,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:b,compareBuild:m,sort:g,rsort:v,gt:y,lt:x,eq:w,neq:A,gte:E,lte:S,cmp:_,coerce:I,Comparator:N,Range:M,satisfies:C,toComparators:T,maxSatisfying:k,minSatisfying:R,minVersion:B,validRange:O,outside:j,gtr:L,ltr:P,intersects:F,simplifyRange:U,subset:D,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}}(),$a=O(Wa);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(za||(za={}));const qa={[za.blue]:{id:za.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[za.nanoS]:{id:za.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>$a.lt($a.coerce(e)??"","2.0.0")?4096:2048},[za.nanoX]:{id:za.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[za.nanoSP]:{id:za.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[za.apex]:{id:za.apex,productName:"Ledger Apex",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[za.stax]:{id:za.stax,productName:"Ledger Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[za.europa]:{id:za.europa,productName:"Ledger Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};za.blue,za.nanoS,za.nanoSP,za.nanoX,za.stax,za.europa;const Ka=Object.values(qa),Ha=e=>{const t=Ka.find(t=>t.legacyUsbProductId===e);if(t)return t;const r=e>>8;return Ka.find(e=>e.productIdMM===r)},Va=[],Ga={};for(const e in qa){const t=qa[e],{bluetoothSpec:r}=t;if(r)for(let e=0;e<r.length;e++){const n=r[e];Va.push(n.serviceUuid),Ga[n.serviceUuid]=Ga[n.serviceUuid.replace(/-/g,"")]={deviceModel:t,...n}}}const Xa=[{vendorId:11415}];async function Ya(){return await navigator.usb.requestDevice({filters:Xa})}async function Za(){return(await navigator.usb.getDevices()).filter(e=>11415===e.vendorId)}const Ja=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices);class Qa extends jo{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Ha(e.productId)}static isSupported=Ja;static list=Za;static listen=e=>{let t=!1;return async function(){const e=await Za();return e.length>0?e[0]:Ya()}().then(r=>{if(!t){const t=Ha(r.productId);e.next({type:"add",descriptor:r,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&18===t.code?e.error(new Eo(t.message)):e.error(new xo(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){const e=await Ya();return Qa.open(e)}static async openConnected(){const e=await Za();return 0===e.length?null:Qa.open(e[0])}static async open(e){await e.open(),null===e.configuration&&await e.selectConfiguration(1),await ec(e);const t=e.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>255===e.interfaceClass));if(!t)throw new wo("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const r=t.interfaceNumber;try{await e.claimInterface(r)}catch(t){throw await e.close(),new wo(t.message)}const n=new Qa(e,r),i=t=>{e===t.device&&(navigator.usb.removeEventListener("disconnect",i),n._emitDisconnect(new vo))};return navigator.usb.addEventListener("disconnect",i),n}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await ec(this.device),await this.device.close()}async exchange(e){const t=await this.exchangeAtomicImpl(async()=>{const{channel:t,packetSize:r}=this;ko("apdu","=> "+e.toString("hex"));const n=((e,t)=>({makeBlocks(r){let n=hr().Buffer.concat([Lo(r.length),r]);const i=t-5,o=Math.ceil(n.length/i);n=hr().Buffer.concat([n,hr().Buffer.alloc(o*i-n.length+1).fill(0)]);const s=[];for(let t=0;t<o;t++){const r=hr().Buffer.alloc(5);r.writeUInt16BE(e,0),r.writeUInt8(5,2),r.writeUInt16BE(t,3);const o=n.slice(t*i,(t+1)*i);s.push(hr().Buffer.concat([r,o]))}return s},reduceResponse(t,r){let{data:n,dataLength:i,sequence:o}=t||Po;if(r.readUInt16BE(0)!==e)throw new _o("Invalid channel","InvalidChannel");if(5!==r.readUInt8(2))throw new _o("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==o)throw new _o("Invalid sequence","InvalidSequence");t||(i=r.readUInt16BE(5)),o++;const s=r.slice(t?5:7);return n=hr().Buffer.concat([n,s]),n.length>i&&(n=n.slice(0,i)),{data:n,dataLength:i,sequence:o}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}))(t,r),i=n.makeBlocks(e);for(let e=0;e<i.length;e++)await this.device.transferOut(3,i[e]);let o,s;for(;!(o=n.getReducedResult(s));){const e=await this.device.transferIn(3,r),t=Buffer.from(e.data.buffer);s=n.reduceResponse(s,t)}return ko("apdu","<= "+o.toString("hex")),o}).catch(e=>{if(e&&e.message&&e.message.includes("disconnected"))throw this._emitDisconnect(e),new yo(e.message);throw e});return t}setScrambleKey(){}}async function ec(e){try{await e.reset()}catch(e){console.warn(e)}}var tc,rc,nc,ic,oc,sc,ac={name:b.Ledger,website:"https://www.ledger.com",connect:function(){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,Qa.create()];case 1:return t=n.sent(),[4,new E.default(t).getPublicKey("44'/148'/0'")];case 2:return r=n.sent().rawPublicKey,[2,e.StrKey.encodeEd25519PublicKey(r)];case 3:throw n.sent(),new Error("Failed to connect to Ledger.");case 4:return[2]}})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Failed to get network from ledger")})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return[4,Qa.isSupported()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("ledger does not support the signAuthEntry function")})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("Failed to sign the transaction with Ledger.")})})},signTransaction:function(t,r){return C(void 0,void 0,void 0,function(){var n,i,o,s,a,c;return T(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),n=new e.Transaction(t,r.network),[4,Qa.create()];case 1:return i=u.sent(),[4,new E.default(i).signTransaction("44'/148'/0'",n.signatureBase())];case 2:return o=u.sent().signature,s=e.Keypair.fromPublicKey(r.address),a=s.signatureHint(),c=new e.xdr.DecoratedSignature({hint:a,signature:o}),n.signatures.push(c),[2,n.toXDR()];case 3:throw u.sent(),new Error("Failed to sign the transaction with Ledger.");case 4:return[2]}})})}},cc=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:if(!e)throw new Error("appId is missing in config.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,wc("".concat(lo,"/auth"),{method:"POST",headers:(n={},n[fo]=e,n.Accept="application/json",n["Content-Type"]="application/json",n),body:JSON.stringify({wallet:"",auth_method:"email",auth_value:t})})];case 2:if(400===(r=i.sent()).status)throw new Error("invalid inputs");if(500===r.status)throw new Error("server error");if(429===r.status)throw new Error("too many requests");if(200===r.status)return[2,!0];throw new Error("Unexpected response from api");case 3:throw i.sent(),new Error("Unexpected response from api");case 4:return[2]}})})},uc=function(e,t,r){return C(void 0,void 0,void 0,function(){var n,i;return T(this,function(o){switch(o.label){case 0:if(!e)throw new Error("appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,wc("".concat(lo,"/auth/code"),{method:"POST",headers:(i={},i[fo]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify({code:r,wallet:"",auth_method:"email",auth_value:t.authValue})})];case 2:if(400===(n=o.sent()).status)throw new Error("invalid inputs");if(500===n.status)throw new Error("server error");if(404===n.status)throw new Error("invalid code");if(429===n.status)throw new Error("too many requests");if(200===n.status)return[2,n.result];throw new Error("Unexpected response from api");case 3:throw o.sent(),new Error("Unexpected response from api");case 4:return[2]}})})},lc=function(e){return C(void 0,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,wc("".concat(lo,"/users"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})];case 1:if(401===(t=r.sent()).status)throw new Error("invalid JWT");if(500===t.status)throw new Error("server error");if(404===t.status)throw new Error("user nout found");if(429===t.status)throw new Error("too many requests");if(200===t.status)return[2,t.result];throw new Error("Unexpected response from api");case 2:throw r.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},dc=function(e,t){return C(void 0,void 0,void 0,function(){var r;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,wc("".concat(lo,"/users/sign-message"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({message:t})})];case 1:if(401===(r=n.sent()).status)throw new Error("invalid JWT");if(500===r.status)throw new Error("server error");if(404===r.status)throw new Error("user nout found");if(429===r.status)throw new Error("too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("Unexpected response from api");case 2:throw n.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},fc=function(e,t,r){return C(void 0,void 0,void 0,function(){var n;return T(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,wc("".concat(lo,"/users/sign-transaction"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({xdr:t,network:r})})];case 1:if(401===(n=i.sent()).status)throw new Error("invalid JWT");if(500===n.status)throw new Error("server error");if(404===n.status)throw new Error("user nout found");if(429===n.status)throw new Error("too many requests");if(200===n.status&&n.result)return[2,n.result];throw new Error("Unexpected response from api");case 2:throw i.sent(),new Error("Unexpected response from api");case 3:return[2]}})})},hc={name:b.Api,website:"https://blux.cc",connect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("API wallet is not defined.")})})},disconnect:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2]})})},getNetwork:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("API wallet is not defined.")})})},isAvailable:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return[2,!1]})})},signAuthEntry:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){throw new Error("API does not support the signAuthEntry function")})})},signMessage:function(e,t){return C(void 0,void 0,void 0,function(){var t,r,n,i;return T(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),t=eo(),!(r=null===(i=t.auth)||void 0===i?void 0:i.JWT))throw new Error("Failed to sign the message from API");return[4,dc(r,e)];case 1:if(n=o.sent())return[2,n];throw new Error("Failed to sign the message from API");case 2:throw o.sent(),new Error("Failed to sign the message from API");case 3:return[2]}})})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){var r,n,i,o;return T(this,function(s){switch(s.label){case 0:if(s.trys.push([0,2,,3]),r=eo(),!(n=null===(o=r.auth)||void 0===o?void 0:o.JWT))throw new Error("Failed to sign the transaction from API");return[4,fc(n,e,t.network)];case 1:if(i=s.sent())return[2,i];throw new Error("Failed to sign the transaction from API");case 2:throw s.sent(),new Error("Failed to sign the transaction from API.");case 3:return[2]}})})}},pc=((tc={})[b.Freighter]=Ki,tc[b.Rabet]=Di,tc[b.WalletConnect]=ho,tc[b.Xbull]=zi,tc[b.Hot]=Fi,tc[b.Api]=hc,tc[b.Hana]=Ui,tc[b.Lobstr]=qi,tc[b.Ledger]=ac,tc[b.Albedo]=Wi,tc[b.Klever]=$i,tc),bc={mainnet:e.Networks.PUBLIC,testnet:e.Networks.TESTNET,sandbox:e.Networks.SANDBOX,futurenet:e.Networks.FUTURENET,standalone:e.Networks.STANDALONE},mc=((rc={})[bc.mainnet]={name:"Mainnet",horizon:"https://horizon.stellar.org",soroban:"https://mainnet.sorobanrpc.com"},rc[bc.testnet]={name:"Testnet",horizon:"https://horizon-testnet.stellar.org",soroban:"https://soroban-testnet.stellar.org"},rc[bc.futurenet]={name:"Futurenet",horizon:"https://horizon-futurenet.stellar.org",soroban:"https://rpc-futurenet.stellar.org"},rc),gc={steexp:(nc={},nc[bc.mainnet]="https://steexp.com",nc[bc.testnet]="https://testnet.steexp.com",nc.ledgerUrl="ledger",nc.transactionUrl="tx",nc.accountUrl="account",nc),stellarexpert:(ic={},ic[bc.mainnet]="https://stellar.expert/explorer/public",ic[bc.testnet]="https://stellar.expert/explorer/testnet",ic.ledgerUrl="ledger",ic.accountUrl="account",ic.transactionUrl="tx",ic),lumenscan:(oc={},oc[bc.mainnet]="https://lumenscan.io",oc[bc.testnet]="https://testnet.lumenscan.io",oc.ledgerUrl="ledgers",oc.accountUrl="account",oc.operationUrl="ops",oc.transactionUrl="txns",oc),stellarchain:(sc={},sc[bc.mainnet]="https://stellarchain.io",sc[bc.testnet]="https://testnet.stellarchain.io",sc[bc.futurenet]="https://futurenet.stellarchain.io",sc.ledgerUrl="ledgers",sc.accountUrl="accounts",sc.operationUrl="operations",sc.transactionUrl="transactions",sc)},vc={logInOrSignUp:{en:"Log in or Sign up"},profile:{en:"Profile"},confirmation:{en:"Confirmation"},send:{en:"Send"},activity:{en:"Activity"},swap:{en:"Swap"},receive:{en:"Receive"},wrongNetwork:{en:"Wrong Network"},balances:{en:"Balances"},whatIsBlux:{en:"What is Blux"},addToken:{en:"Add Token"},signMessage:{en:"Sign Message"},selectAsset:{en:"Select Asset"},walletConnect:{en:"Wallet Connect"},acceptTermsAndPrivacy:{en:"Terms & Privacy"},loading:{en:"Loading"},tryAgain:{en:"Try again"},connecting:{en:"Connecting"},signing:{en:"Signing"},or:{en:"or"},recent:{en:"Recent"},allStellarWallets:{en:"All Stellar wallets"},email:{en:"Email"},logInWithPasskey:{en:"Log in with Passkey"},submit:{en:"Submit"},poweredByBlux:{en:"Powered by Blux.cc"},reviewAndAcceptPrompt:{en:"Review the documents below, then agree to continue."},termsOfService:{en:"Terms of Service"},privacyPolicy:{en:"Privacy Policy"},openLink:{en:"Open link"},noLegalLinksProvided:{en:"No legal links were provided for this app."},iAgree:{en:"I agree"},connectionSuccessfulTitle:{en:"Connection Successful"},transactionSuccessfulTitle:{en:"Transaction Successful"},connectionSuccessfulMessage:{en:"Your account has been successfully connected to ${appName}"},transactionSuccessfulMessage:{en:"Your transaction was successfully completed"},seeInExplorer:{en:"See in explorer"},loggingIn:{en:"Logging In"},done:{en:"Done"},signTransactionPrompt:{en:"wants your permission to approve the following transaction."},invalidXdr:{en:"Invalid XDR"},lobstrWarning:{en:"Ensure that your LOBSTR wallet is set to the ${network} network. Otherwise, the transaction will definitely fail."},yourWallet:{en:"Your wallet"},noAddressFound:{en:"No address found"},approve:{en:"Approve"},loadingActivity:{en:"Loading activity..."},noActivityFound:{en:"No activity found"},multiOperation:{en:"Multi Operation"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}"},seeAllInExplorer:{en:"See all in explorer"},enterConfirmationCodeTitle:{en:"Enter confirmation code"},enterConfirmationCodeHelp:{en:"Please check your email and enter confirmation code below"},invalidCodeError:{en:"Invalid code, please try again."},resendCode:{en:"Resend code"},copied:{en:"Copied!"},logout:{en:"Logout"},search:{en:"Search"},noAssetsFound:{en:"No assets found"},amount:{en:"Amount"},max:{en:"Max"},to:{en:"To"},enterAddress:{en:"Enter address"},addressRequired:{en:"Address is required"},addressInvalid:{en:"Address is invalid"},inactiveAccount:{en:"Account is inActive"},memo:{en:"Memo"},enterMemo:{en:"Enter Memo"},optional:{en:"optional"},paste:{en:"Paste"},amountRequired:{en:"Amount is required"},amountExceedsBalance:{en:"Amount is greater than max balance"},sendButton:{en:"Send"},loginFailed:{en:"Login failed"},signingFailed:{en:"Signing with ${walletName} failed"},waitingFor:{en:"Waiting for ${walletName}"},signingWith:{en:"Signing with ${walletName}"},loginRetryMessage:{en:"Please try logging in again."},signingRetryMessage:{en:"Please try signing again."},acceptConnection:{en:"Accept connection"},signRequestInWallet:{en:"Sign the request in your wallet"},wrongNetworkMessage:{en:"You’re currently connected to the Stellar ${currentNetwork}. Please switch to the Stellar ${switchNetwork} to continue using this app."},wallet_infra:{en:"Wallet Infrastructure for Stellar dapps"},blux_gateway:{en:"Blux is your gateway to Stellar. Create a wallet, manage assets, and sign transactions easily and securely."},enter_token_address:{en:"Enter token address"},enter_address:{en:"enter address"},check:{en:"Check"},cancel:{en:"Cancel"},add_token:{en:"Add token"},network:{en:"Network"},address:{en:"Address"},market_cap:{en:"Market cap"},total_volume:{en:"Total volume"},all_time_high:{en:"All time high"},copy_address:{en:"Copy address"},address_copied:{en:"Address copied"},add_new_token:{en:"Add new token"},assets:{en:"Assets"},tokens:{en:"Tokens"},nfts:{en:"NFTs"},no_balance_message:{en:"Looks like there’s nothing here yet."},sign_permission:{en:"wants your permission to sign the following message:"}},yc=function(e){return"native"===e.asset_type?"native":"credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type?Lc(e.asset_issuer,4):"liquidity_pool_shares"===e.asset_type?Lc(e.liquidity_pool_id,4):""},xc=function(t){return"native"===t.assetType?e.Asset.native():new e.Asset(t.assetCode,t.assetIssuer)},wc=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:return[4,fetch(e,t)];case 1:return[4,(r=i.sent()).json()];case 2:return n=i.sent(),[2,N({status:r.status},n)]}})})},Ac=function(e){var t={valueInCurrency:"0",assetBalance:e.balance||"0",assetType:e.asset_type};return"native"===e.asset_type?(t.assetCode="XLM",t.assetIssuer=""):"liquidity_pool_shares"===e.asset_type?(t.assetCode="LiquidtyPool",t.assetIssuer=""):(t.assetCode=e.asset_code,t.assetIssuer=e.asset_issuer),t},Ec=function(e){var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1))},Sc=function(e){return navigator.clipboard.writeText(e)},_c=function(e){return"send"===e?g.SEND:g.SWAP},Ic=function(e){var t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},Nc=function(e,t,r,n){var i=gc[t];i||(i=gc.stellarchain);var o=i[e];return o?"".concat(o,"/").concat(i[r],"/").concat(n):null},Mc=function(){var e=localStorage.getItem(ao);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Cc=function(e){var t=Object.entries(m).find(function(t){return t[1]===e});if(!t)throw new Error("Unknown network passphrase: ".concat(e));return t[0].toLowerCase()},Tc=function(e,t){var r=mc[e],n=t[e];if(!r&&!n)throw new Error("BLUX: Custom network has no transports.");return!r&&n&&(r={name:"Custom Network",horizon:"",soroban:""}),n&&(n.horizon&&(r.horizon=n.horizon),n.soroban&&(r.soroban=n.soroban)),r},kc=function(e){return C(void 0,void 0,void 0,function(){return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.getNetwork()];case 1:return[2,t.sent().passphrase];case 2:return t.sent(),[2,""];case 3:return[2]}})})},Rc=function(e,t){var r,n,i;if(void 0===t&&(t=1),3===(e=e.replace(/^#/,"")).length)r=parseInt(e[0]+e[0],16),n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16);else{if(6!==e.length&&8!==e.length)throw new Error("Invalid hex color: ".concat(e));r=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)}return"rgba(".concat(r,", ").concat(n,", ").concat(i,", ").concat(t,")")},Bc=function(e,t){void 0===t&&(t=!1);var r="number"==typeof e?e:parseFloat(e);if(isNaN(r)||0===r)return"0";if(r<1e-6)return e.toString();if(t){if(r>=1e6)return"".concat((r/1e6).toFixed(2),"m");if(r>=1e3)return"".concat((r/1e3).toFixed(2),"k")}return zc(Dc(r))},Oc=function(e){var t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},jc=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return o=function(e){"https://mobile.rabet.io"===e.origin&&"RABET/INSTALL"===e.data.type&&(new Function(e.data.message)(),window.removeEventListener("message",o))},window.addEventListener("message",o),[4,(i=e,C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(pc).map(function(e){return C(void 0,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),i.includes(e.name.toLowerCase())?[2,{wallet:e,isAvailable:!1}]:[4,e.isAvailable()];case 1:return t=r.sent(),[2,{wallet:e,isAvailable:t}];case 2:return r.sent(),[2,{wallet:e,isAvailable:!1}];case 3:return[2]}})})}))];case 1:return[2,e.sent().filter(function(e){return!!e.isAvailable}).map(function(e){return e.wallet})]}})}))];case 1:return t=n.sent(),r=function(e){for(var t=Mc(),r=new Map(e.map(function(e){return[e.name,e]})),n=[],i=new Set,o=0,s=t;o<s.length;o++){var a=s[o],c=r.get(a);c&&(n.push(c),i.add(a))}var u=e.filter(function(e){return!i.has(e.name)});return k(k([],n,!0),u,!0).map(function(e,t){return N(N({},e),{isRecent:0===t})})}(t),[2,r]}var i,o})})},Lc=function(e,t){return void 0===t&&(t=8),e.slice(0,t)+"..."+e.slice(-t)},Pc=function(e){return new Promise(function(t){return setTimeout(t,e)})},Fc=function(e){return e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,function(e){return e.toUpperCase()})},Uc=function(e,t){return void 0===t&&(t={}),e.replace(/\$\{(\w+)\}/g,function(e,r){return t[r]||""})},Dc=function(e){var t,r=e.toString().split("."),n=r[0],i=r[1],o=void 0===i?"":i;if(!o)return n;var s=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[n.length])&&void 0!==t?t:0;if(s>0){var a="".concat(n,".").concat(o.slice(0,s)),c=parseFloat(a);return Number.isInteger(c)?n:c.toFixed(2)}return n},zc=function(e){var t=e.split("."),r=t[0],n=t[1];return n?"".concat(r.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(n):r.replace(/\B(?=(\d{3})+(?!\d))/g,",")},Wc=function(e,t){return"email"===e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):""!==t.trim()},$c=function(e,t,r,n){return C(void 0,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signMessage))throw new Error("Wallet does not support signMessage.");return[4,e.signMessage(t,{address:r,network:n})];case 1:return[2,i.sent()]}})})},qc=function(t,r){try{var n=new e.Transaction(t,r),i=n.operations[0],o=null;return o="payment"===i.type||"pathPaymentStrictSend"===i.type||"pathPaymentStrictReceive"===i.type?i.destination:"",{action:i.type,operations:n.operations.length,sender:n.source,receiver:o,estimatedFee:Number(n.fee)/1e7}}catch(e){return null}},Kc=function(e,t,r,n){return C(void 0,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signTransaction))throw new Error("Wallet does not support transaction signing.");return[4,e.signTransaction(t,{network:n,address:r})];case 1:return[2,i.sent()]}})})};function Hc(t,r,n){return C(this,void 0,void 0,function(){var i,o,s;return T(this,function(a){switch(a.label){case 0:if(!(i=Tc(r,n).horizon))throw new Error("Horizon RPC was not found.");return o=new e.Horizon.Server(i),s=new e.Transaction(t,r),[4,o.submitTransaction(s)];case 1:return[2,a.sent()]}})})}var Vc=function(e,t,r,n,i,o){return C(void 0,void 0,void 0,function(){var s;return T(this,function(a){switch(a.label){case 0:return[4,Kc(e,t,r,n)];case 1:return s=a.sent(),o?[4,Hc(s,n,i||{})]:[3,3];case 2:return[2,a.sent()];case 3:return[2,s]}})})},Gc="__BLUX__RECENT_LOGIN_CONFIG",Xc=function(e,t,r){void 0===r&&(r=Date.now()),"undefined"!=typeof window&&localStorage.setItem(Gc,JSON.stringify({authMethod:e,authValue:t,timestamp:r}))},Yc=function(){"undefined"!=typeof window&&localStorage.removeItem(Gc)},Zc=function(){return C(void 0,void 0,void 0,function(){var e,t,r,n,i,o;return T(this,function(s){switch(s.label){case 0:if((e=eo()).authState.isAuthenticated&&e.user)return[2,!0];if(!((t=function(){if("undefined"==typeof window)return null;var e=localStorage.getItem(Gc);if(!e)return null;try{var t=JSON.parse(e);return"string"!=typeof t.authMethod||"string"!=typeof t.authValue||"number"!=typeof t.timestamp?null:t}catch(e){return null}}())&&(a=t.timestamp,Date.now()-a<=6048e5)))return[2,!1];if("wallet"!==t.authMethod)return[2,!1];if(!(r=e.wallets.find(function(e){return e.name===t.authValue})))return[2,!1];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,r.connect()];case 2:return(n=s.sent())&&""!==n.trim()?(to(function(e){return N(N({},e),{user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:r.name}})}),[4,kc(r)]):[2,!1];case 3:return i=s.sent(),e.connectWalletSuccessful(n,i),e.setIsAuthenticated(!0),(o=eo().user)&&eo().emitter.emit(exports.BluxEvent.LoggedIn,{user:o}),Xc("wallet",r.name),[2,!0];case 4:return s.sent(),[2,!1];case 5:return[2]}var a})})},Jc=function(e){var t,r,n=eo();if(n.user&&n.user.address)return Promise.resolve(n.user);var i=new Promise(function(e,n){t=e,r=n});return n.setLogin({promise:i,isSilent:e,resolver:t,rejecter:r}),e?(Zc().then(function(){var e=eo().user;e&&t(e)}).catch(function(){}).finally(function(){n.setLogin(void 0)}),i):(C(void 0,void 0,void 0,function(){var e,r,i;return T(this,function(o){switch(o.label){case 0:if(e=eo(),!(null===(i=e.login)||void 0===i?void 0:i.isSilent)||!e.login.promise)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.login.promise];case 2:case 3:return o.sent(),[3,4];case 4:if(eo().user)return t(eo().user),n.setLogin(void 0),[2];o.label=5;case 5:return(r=eo()).modal.isOpen||r.openModal(g.ONBOARDING),[2]}})}).catch(function(e){r(e),n.setLogin(void 0)}),i)},Qc=function(e,t,r){return new Promise(function(n,i){var o=eo();if(o.authState.isAuthenticated&&o.stellar&&o.user)if(o.modal.isOpen)i(new Error("Blux modal is open elsewhere."));else{var s=o.stellar.activeNetwork;if(r&&r.network&&(s=r.network),qc(e,s)){var a=o.wallets.find(function(e){return e.name===o.user.authValue});if(!a)throw new Error("Could not find the connected wallet.");var c={xdr:e,rejecter:i,resolver:n,result:void 0,options:N({network:s},r),shouldSubmit:t};o.setSendTransaction(c,o.config.showWalletUIs),o.config.showWalletUIs||Vc(a,e,o.user.address,s,o.config.transports||{},c.shouldSubmit).then(function(e){n(e)}).catch(function(e){i(e)})}else i("Invalid XDR")}else i(new Error("User is not authenticated."))})},eu=function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return[4,Qc(e,!0,t)];case 1:return[2,r.sent()]}})})},tu={login:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return eo().authState.isReady?[3,2]:[4,Pc(50)];case 1:return e.sent(),[3,0];case 2:return[2,Jc(!1)]}})})},logout:function(){(0,eo().logoutAction)(),localStorage.removeItem(so),Yc(),eo().emitter.emit(exports.BluxEvent.LoggedOut,void 0)},fundMe:function(){var e=eo();if(!e.authState.isAuthenticated||!e.stellar||!e.user)throw new Error("Blux: user is not authenticated yet.");if(e.modal.isOpen)throw new Error("Blux modal is open elsewhere.");e.modal.isOpen||e.openModal(g.FUND_ME)},profile:function(){var e=eo(),t=e.openModal,r=e.authState,n=e.modal;if(!r.isAuthenticated)throw new Error("User is not authenticated.");n.isOpen||t(g.PROFILE)},signMessage:function(e,t){return new Promise(function(r,n){var i=eo();if(i.authState.isAuthenticated&&i.stellar&&i.user)if(i.modal.isOpen)n(new Error("Blux modal is open elsewhere."));else{var o=i.stellar.activeNetwork;t&&t.network&&(o=t.network);var s=i.wallets.find(function(e){return e.name===i.user.authValue});if(!s)throw new Error("Could not find the connected wallet.");var a={message:e,options:t||{network:o},rejecter:n,resolver:r,result:void 0};i.setSignMessage(a,i.config.showWalletUIs),i.config.showWalletUIs||$c(s,e,i.user.address,o).then(function(e){r(e)}).catch(function(e){n(e)})}else n(new Error("User is not authenticated."))})},signTransaction:function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){switch(r.label){case 0:return[4,Qc(e,!1,t)];case 1:return[2,r.sent()]}})})},sendTransaction:eu,get isReady(){return eo().authState.isReady},get isAuthenticated(){return eo().authState.isAuthenticated},get user(){return eo().user}},ru="logos",nu=function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,ou("https://cdn2.blux.cc/core-assets/logos.json.gz")];case 1:return e=t.sent(),[4,su(e)];case 2:return[2,t.sent().files]}})})},iu=function(){return C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,nu()];case 1:return e=r.sent(),[4,au()];case 2:return t=r.sent(),[4,cu(t,e)];case 3:case 4:return r.sent(),[3,5];case 5:return[2]}})})},ou=function(e){return C(void 0,void 0,void 0,function(){var t;return T(this,function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:if(!(t=r.sent()).ok)throw new Error("Failed to fetch: ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,r.sent()]}})})},su=function(e){return C(void 0,void 0,void 0,function(){var t,r,n;return T(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),r=new Blob([e]).stream().pipeThrough(t),[4,new Response(r).text()];case 1:return n=i.sent(),[2,JSON.parse(n)]}})})},au=function(){return new Promise(function(e,t){var r=indexedDB.open("blux-cache",1);r.onupgradeneeded=function(){var e=r.result;e.objectStoreNames.contains(ru)||e.createObjectStore(ru,{keyPath:"id"})},r.onsuccess=function(){return e(r.result)},r.onerror=function(){return t(r.error)}})},cu=function(e,t){return C(void 0,void 0,void 0,function(){return T(this,function(r){return[2,new Promise(function(r,n){var i=e.transaction(ru,"readwrite"),o=i.objectStore(ru);o.clear(),t.forEach(function(e){return o.put(e)}),i.oncomplete=function(){return r()},i.onerror=function(){return n(i.error)}})]})})},uu=function(e){return C(void 0,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,r){var n=e.transaction(ru,"readonly").objectStore(ru).getAll();n.onsuccess=function(){t(n.result||[])},n.onerror=function(){return r(n.error)}})]})})},lu=function(){return!!eo().stellar},du=function(e){var t=eo().user;if(!t&&!e)throw new Error("Address not found");return e||(null==t?void 0:t.address)},fu=function(t){var r,n=eo(),i=n.stellar,o=n.config;if(!t){if(i)return{horizon:i.servers.horizon,soroban:i.servers.soroban,networkPassphrase:i.activeNetwork};throw new Error("Custom network has no transports.")}var s=Tc(t,null!==(r=o.transports)&&void 0!==r?r:{}),a=s.horizon,c=s.soroban;return{networkPassphrase:t,soroban:new e.rpc.Server(c),horizon:new e.Horizon.Server(a)}},hu=function(e){var t,r,n=eo(),i=(null===(t=n.stellar)||void 0===t?void 0:t.activeNetwork)||"";if(0===n.config.networks.length)throw new Error("switchNetwork must be called after createConfig");if(!n.config.networks.includes(e))throw new Error("New network must be defined in config.networks");if(!n.stellar)throw new Error("Could not find the current activeNetwork");n.setStellar({activeNetwork:e,servers:null===(r=n.stellar)||void 0===r?void 0:r.servers}),i&&i!==e&&eo().emitter.emit(exports.BluxEvent.NetworkChanged,{previousNetwork:i,network:e})},pu=function(e,t,r){var n=fu(r.network).horizon,i=n[e].apply(n,t);return r.cursor&&i.cursor(r.cursor),r.limit&&i.limit(r.limit),r.order&&i.order(r.order),i},bu=function(t){return C(void 0,void 0,void 0,function(){var r,n,i,o,s,a;return T(this,function(c){switch(c.label){case 0:if(lu(),r=du(t.address),n=fu(t.network).horizon,!e.StrKey.isValidEd25519PublicKey(r))throw new Error("Invalid address");c.label=1;case 1:return c.trys.push([1,3,,4]),[4,n.loadAccount(r)];case 2:return i=c.sent(),t.includeZeroBalances?[2,i.balances]:(o=i.balances.filter(function(e){return 0!==Number(e.balance)}),s=o.find(function(e){return"native"===e.asset_type}),a=o.filter(function(e){return"native"!==e.asset_type}),s?[2,k([s],a,!0)]:[2,a]);case 3:return c.sent(),[2,[]];case 4:return[2]}})})},mu=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:return lu(),[4,(r=pu("strictReceivePaths",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},gu=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:return lu(),[4,(r=pu("strictSendPaths",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},vu=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("transactions",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},yu={mainnet:e.Networks.PUBLIC,testnet:e.Networks.TESTNET,sandbox:e.Networks.SANDBOX,futurenet:e.Networks.FUTURENET,standalone:e.Networks.STANDALONE},xu=function(e,t){return"string"===t?e.toString():"number"===t?Number(e):BigInt(e)},wu=function(e,t,r){var n=t/8,i=BigInt(e).toString(16);r&&e<BigInt(0)&&(i=((BigInt(1)<<BigInt(t))+e).toString(16).replace(/^-/,""));i.length%2!=0&&(i="0".concat(i));for(var o=2*n;i.length<o;)i="0".concat(i);if(i.length>o)throw new Error("BigNumber ".concat(e," overflows ").concat(t,"-bit representation"));for(var s=new Uint8Array(n),a=0,c=0;a<n;)s[a]=parseInt(i.slice(c,c+2),16),a+=1,c+=2;return r&&e<BigInt(0)&&(s[0]|=128),Buffer.from(s)},Au=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=BigInt(0),i=0,o=t;i<o.length;i++){var s=o[i];n<<=BigInt(8),n|=BigInt(s)}if(e&&0!==(void 0!==t[0]?128&t[0]:0)){var a=BigInt(8*t.length);n-=BigInt(1)<<a}return n},Eu=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error("BigInt ".concat(e," is outside the safe integer range for Number type."));return Number(e)},Su=function(t){var r=t,n=Eu(r&BigInt(4294967295)),i=Number(r>>BigInt(32)&BigInt(4294967295));return i>=2147483648&&(i-=4294967296),new e.xdr.Int64([n,i])},_u=function(t){var r=Eu(t&BigInt(4294967295)),n=Eu(t>>BigInt(32)&BigInt(4294967295));return new e.xdr.Uint64([r,n])};function Iu(e){return"object"!=typeof e||null===e||Array.isArray(e)}var Nu=function(t){if(!t)return e.xdr.ScVal.scvMap(null);for(var r=[],n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],a=o[1],c="string"==typeof s?Mu.symbol(s):s;"object"!=typeof a||null===a||Iu(a)?r.push(new e.xdr.ScMapEntry({key:c,val:a})):r.push(new e.xdr.ScMapEntry({key:c,val:Nu(a)}))}return e.xdr.ScVal.scvMap(r)},Mu=function(){function t(){}return t.i32=function(t){var r=xu(t,"number");return e.xdr.ScVal.scvI32(r)},t.i64=function(t){var r=xu(t,"bigint");return e.xdr.ScVal.scvI64(Su(r))},t.i128=function(t){return function(t){var r=wu(t,128,!0),n=r.subarray(0,8),i=r.subarray(8,16),o=Su(Au.apply(void 0,k([!0],n,!1))),s=_u(Au.apply(void 0,k([!1],i,!1)));return e.xdr.ScVal.scvI128(new e.xdr.Int128Parts({lo:s,hi:o}))}(xu(t,"bigint"))},t.i256=function(t){return function(t){var r=wu(t,256,!0),n=r.subarray(0,8),i=r.subarray(8,16),o=r.subarray(16,24),s=r.subarray(24,32),a=Su(Au.apply(void 0,k([!0],n,!1))),c=_u(Au.apply(void 0,k([!1],i,!1))),u=_u(Au.apply(void 0,k([!1],o,!1))),l=_u(Au.apply(void 0,k([!1],s,!1)));return e.xdr.ScVal.scvI256(new e.xdr.Int256Parts({hiHi:a,hiLo:c,loHi:u,loLo:l}))}(xu(t,"bigint"))},t.u32=function(t){var r=xu(t,"number");return e.xdr.ScVal.scvU32(r)},t.u64=function(t){var r=xu(t,"bigint");return e.xdr.ScVal.scvU64(_u(r))},t.u128=function(t){return function(t){var r=wu(t,128,!1),n=r.subarray(0,8),i=r.subarray(8,16),o=_u(Au.apply(void 0,k([!1],n,!1))),s=_u(Au.apply(void 0,k([!1],i,!1)));return e.xdr.ScVal.scvU128(new e.xdr.UInt128Parts({hi:o,lo:s}))}(xu(t,"bigint"))},t.u256=function(t){return function(t){var r=wu(t,256,!1),n=r.subarray(0,8),i=r.subarray(8,16),o=r.subarray(16,24),s=r.subarray(24,32),a=_u(Au.apply(void 0,k([!1],n,!1))),c=_u(Au.apply(void 0,k([!1],i,!1))),u=_u(Au.apply(void 0,k([!1],o,!1))),l=_u(Au.apply(void 0,k([!1],s,!1)));return e.xdr.ScVal.scvU256(new e.xdr.UInt256Parts({hiHi:a,hiLo:c,loHi:u,loLo:l}))}(xu(t,"bigint"))},t.error=function(t){return e.xdr.ScVal.scvError(t)},t.duration=function(t){var r=xu(t,"bigint"),n=_u(r);return e.xdr.ScVal.scvDuration(n)},t.timepoint=function(t){var r=xu(t,"bigint"),n=_u(r);return e.xdr.ScVal.scvTimepoint(n)},t.ledgerKeyNonce=function(t){return e.xdr.ScVal.scvLedgerKeyNonce(t)},t.contractInstance=function(t){return e.xdr.ScVal.scvContractInstance(t)},t.scvMap=function(t){return e.xdr.ScVal.scvMap(t)},t.map=function(e){return Nu(e)},t.string=function(t){return e.xdr.ScVal.scvString(t)},t.vec=function(t){return e.xdr.ScVal.scvVec(t)},t.void=function(){return e.xdr.ScVal.scvVoid()},t.bytes=function(t){return e.xdr.ScVal.scvBytes(t)},t.ledgerKeyContractInstance=function(){return e.xdr.ScVal.scvLedgerKeyContractInstance()},t.symbol=function(t){return e.xdr.ScVal.scvSymbol(t)},t.boolean=function(t){return e.xdr.ScVal.scvBool(t)},t.address=function(t){return e.Address.fromString(t).toScVal()},t}(),Cu=eo().setAppearance,Tu={on:function(e,t){return eo().emitter.on(e,t)},off:function(e,t){return eo().emitter.off(e,t)},once:function(e,t){return eo().emitter.once(e,t)}};var ku,Ru=function(e){var t,r,n,i,o=e.isOpen,s=e.onClose,c=void 0===s?function(){}:s,l=e.children,d=e.isSticky,f=void 0!==d&&d,h=e.appearance,p=e.isPersistent,b=a.useRef(null),m=a.useState(!1),g=m[0],v=m[1],y=function(e){void 0===e&&(e=460);var t=a.useState(!1),r=t[0],n=t[1];return a.useEffect(function(){var t=function(){return n(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),r}(),x=function(e,t){void 0===t&&(t=300);var r=a.useState({isOpening:!1,isClosing:!1}),n=r[0],i=r[1];return a.useEffect(function(){if(e){i({isOpening:!0,isClosing:!1});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1})},t);return function(){return clearTimeout(r)}}},[e,t]),N(N({},n),{handleClose:function(e){i({isOpening:!1,isClosing:!0});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1}),e()},t);return function(){return clearTimeout(r)}}})}(o,250),w=x.isClosing,A=x.handleClose,E=function(e,t){void 0===t&&(t=[]);var r=a.useState("auto"),n=r[0],i=r[1],o=a.useState(!1),s=o[0],c=o[1],u=a.useState(!1),l=u[0],d=u[1];return a.useEffect(function(){var t=e.current;if(t){var r=!1,n=function(){r||t.offsetParent&&(i(t.offsetHeight),c(!0))},o=Array.from(t.getElementsByTagName("img")).filter(function(e){return!(e.complete&&e.naturalHeight>0)});if(0!==o.length){var s=o.length,a=function(){0==(s-=1)&&requestAnimationFrame(function(){return requestAnimationFrame(n)})};return o.forEach(function(e){e.addEventListener("load",a),e.addEventListener("error",a)}),function(){r=!0,o.forEach(function(e){e.removeEventListener("load",a),e.removeEventListener("error",a)})}}requestAnimationFrame(function(){return requestAnimationFrame(n)})}},k(k([],t,!0),[l],!1)),{height:n,isHeightReady:s,reset:function(){c(!1),i("auto"),d(function(e){return!e})}}}(b,[o,l]),S=E.height,_=E.isHeightReady,I=E.reset;return a.useEffect(function(){if(o&&y){v(!1);var e=requestAnimationFrame(function(){v(!0)});return function(){return cancelAnimationFrame(e)}}},[o,y]),i=o,a.useEffect(function(){return document.body.style.overflow=i?"hidden":"",function(){document.body.style.overflow=""}},[i]),a.useEffect(function(){o||I()},[o]),o?u.jsxs(u.Fragment,{children:[!p&&u.jsx("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-40 ".concat(w&&!f?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),style:{backdropFilter:"blur(".concat(h.backdropBlur,")"),WebkitBackdropFilter:"blur(".concat(h.backdropBlur,")"),backgroundColor:h.backdropColor},onClick:f?function(){}:c}),u.jsx("div",{className:"bluxcc:absolute bluxcc:inset-0 bluxcc:z-9999999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ".concat(w&&!f&&"bluxcc:animate-fadeOut"),onClick:function(e){e.target!==e.currentTarget||f||A(c)},children:u.jsx("div",{id:"bluxcc-modal",className:"bluxcc:box-border ".concat(y?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:w-full bluxcc:rounded-b-none!":"bluxcc:relative bluxcc:w-90!"),style:{height:"number"==typeof S?"".concat(y?S+20:S,"px"):S,transition:_?"height 250ms ease-in-out, border-radius 250ms, opacity 250ms ease-out, outline 250ms ease-out, color 250ms ease-out".concat(y?", transform 250ms ease-out":""):"border-radius 250ms, opacity 250ms ease-out".concat(y?", transform 250ms ease-out":""),transform:y?w?"translateY(100%)":g?"translateY(0%)":"translateY(80%)":"",background:h.background,opacity:w&&!f?"0":"1",color:h.textColor,fontFamily:h.fontFamily,letterSpacing:"-0.04px",borderRadius:null!==(t=h.outlineRadius)&&void 0!==t?t:h.borderRadius,outline:"".concat(null!==(r=h.outlineWidth)&&void 0!==r?r:h.borderWidth," solid ").concat(null!==(n=h.outlineColor)&&void 0!==n?n:h.borderColor),overflow:"hidden",boxShadow:h.boxShadow},children:u.jsx("div",{ref:b,className:"bluxcc:px-6 bluxcc:pb-4",style:{fontFamily:h.fontFamily,opacity:_?1:0,transition:"opacity 200ms ease-in-out"},children:l})})})]}):null},Bu=function(e){var t=e.className,r=e.name,n=e.props,i=void 0===n?{}:n,o=M(e,["className","name","props"]),s=io(function(e){return e.logos}),c=a.useState(""),l=c[0],d=c[1],f=a.useMemo(function(){return null==s?void 0:s.find(function(e){return e.name===r})},[s,r]);if(!s||!f){var h="".concat("https://cdn.blux.cc/files","/").concat(encodeURIComponent(r)),p=Object.entries(i).map(function(e){return"".concat(encodeURIComponent(e[0]),"=").concat(encodeURIComponent(e[1]))}).join("&"),b="".concat(h,"?").concat(p);return u.jsx("img",{src:b,alt:r})}return a.useEffect(function(){var e=f.content,t=new Map;(f.default_values||[]).forEach(function(e){var r=e.name,n=e.value;t.set(r,n)}),Object.entries(i).forEach(function(e){var r=e[0],n=e[1];t.set(r,n)}),t.forEach(function(t,r){var n=new RegExp("{{".concat(r,"}}"),"g");e=e.replace(n,t)}),d(e)},[f,i]),l?u.jsx("div",N({className:t,dangerouslySetInnerHTML:{__html:l}},o)):u.jsx("div",{style:{width:50,height:50,background:"#f0f0f0"}})};!function(e){e.Blux="blux.svg",e.SmallBlux="smallblux.svg",e.About="about.svg",e.ArrowRight="arrowright.svg",e.ArrowLeft="arrowleft.svg",e.Close="close.svg",e.Loading="loading.svg",e.Search="search.svg",e.GreenCheck="greencheck.svg",e.LogOut="logout.svg",e.Copy="copy.svg",e.LargeCopy="largecopy.svg",e.History="history.svg",e.Send="send.svg",e.ArrowDropUp="arrowdropup.svg",e.ArrowDropDown="arrowdropdown.svg",e.RedAlert="redalert.svg",e.Upstream="upstream.svg",e.MultiOperation="multioperation.svg",e.Downstream="downstream.svg",e.Globe="globe.svg",e.SmallEmail="smallemail.svg",e.Email="email.svg",e.RedExclamation="redexclamation.svg",e.WrongNetwork="wrongnetwork.svg",e.Swap="swap.svg",e.SmallSwap="smallswap.svg",e.Receive="receive.svg",e.Balances="balances.svg",e.NFTs="nfts.svg",e.Assets="assets.svg",e.Token="token.svg",e.Plus="plus.svg",e.OpenEye="openeye.svg",e.CloseEye="closeeye.svg",e.Warn="warn.svg",e.Error="error.svg",e.CopyIcon="copyicon.svg",e.Success="success.svg",e.Key="key.svg",e.Chip="chip.svg",e.Shield="shield.svg",e.Wallet="wallet.svg",e.QuestionMark="questionmark.svg",e.SmallQuestionMark="smallquestionmark.svg",e.GrayCube="graycube.svg",e.Albedo="albedo.svg",e.Hana="hana.svg",e.Hot="hot.svg",e.Rabet="rabet.svg",e.Freighter="freighter.svg",e.DarkFreighter="darkfreighter.svg",e.XBull="xbull.svg",e.Lobstr="lobstr.svg",e.Stellar="stellar.svg",e.StellarSmall="stellarsmall.svg",e.Google="google.svg",e.WalletConnect="walletconnect.svg",e.Klever="klever.svg",e.Ledger="ledger.svg"}(ku||(ku={}));var Ou=ku,ju={error:{baseBg:"bluxcc:bg-light-red-50",darkBg:"bluxcc:bg-[#D6000033]",container:"bluxcc:border bluxcc:border-alert-error",text:"bluxcc:text-alert-error",icon:u.jsx(Bu,{name:Ou.Error})},success:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#00D66E33]",container:"bluxcc:border bluxcc:border-alert-success",text:"bluxcc:text-alert-success",icon:u.jsx(Bu,{name:Ou.Success})},copy:{baseBg:"bluxcc:bg-light-blue-50",darkBg:"bluxcc:bg-[#005DF333]",container:"bluxcc:border bluxcc:border-alert-info",text:"bluxcc:text-alert-info",icon:u.jsx(Bu,{name:Ou.CopyIcon})},warn:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#FA8F0233]",container:"bluxcc:border bluxcc:border-alert-warning",text:"bluxcc:text-alert-warning",icon:u.jsx(Bu,{name:Ou.Warn})},none:{baseBg:"",darkBg:"",container:"",text:"",icon:null}},Lu=function(e){var t=e.type,r=e.message,n=e.className,i=void 0===n?"":n,o=io(function(e){return e.config.appearance}),s=Oc(o.background),a=ju[t],c=a.baseBg,l=a.darkBg,d=a.container,f=a.text,h=a.icon,p=s?l:c;return u.jsxs("div",{style:{borderRadius:o.borderRadius,fontFamily:o.fontFamily},className:"\n bluxcc:flex bluxcc:items-center bluxcc:gap-2\n bluxcc:px-3 bluxcc:h-10 bluxcc:max-w-46\n ".concat(p,"\n ").concat(d,"\n ").concat(f,"\n ").concat(i,"\n "),children:[h,u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:r})]})},Pu=function(){return function(e,t){return function(e,t,r){var n,i;void 0===r&&(r={});var o=(null===(n=vc[e])||void 0===n?void 0:n[t])||(null===(i=vc[e])||void 0===i?void 0:i.en)||"";return Uc(o,r)}(e,"en",t||{})}},Fu=function(e){var t=e.icon,r=e.onInfo,n=e.onBack,i=e.title,o=void 0===i?" ":i,s=e.closeButton,a=void 0!==s&&s,c=e.onClose,l=e.isPersistent,d=io(function(e){return e.config}),f=io(function(e){return e.modal}),h=Pu(),p=Rc(d.appearance.textColor,.7),b="none"!==f.alert.type,m=function(e){var t=e.onClick,r=e.children;return u.jsx("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:r})};return u.jsxs("header",{className:"bluxcc:flex bluxcc:h-16 bluxcc:w-full bluxcc:items-center bluxcc:justify-between",style:{fontFamily:d.appearance.fontFamily},children:["info"===t?u.jsx(m,{onClick:r,children:u.jsx(Bu,{name:Ou.About,props:{fill:p}})}):"back"===t?u.jsx(m,{onClick:n,children:u.jsx(Bu,{name:Ou.ArrowLeft,props:{fill:p}})}):u.jsx("div",{className:"bluxcc:size-5"}),u.jsx("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:b?u.jsx(Lu,{type:f.alert.type,message:f.alert.message}):u.jsx("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium",children:h(o)})}),!a||l?u.jsx("div",{className:"bluxcc:size-5"}):u.jsx(m,{onClick:c,children:u.jsx(Bu,{name:Ou.Close,props:{fill:p}})})]})},Uu=function(){var e=io(function(e){return e.config.appearance});return u.jsx("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:e.borderWidth,borderTopColor:e.borderColor}})})},Du=function(e){var t,r=e.startIcon,n=e.onChange,i=e.onEnter,o=e.onSubmit,s=e.inputType,c=void 0===s?"text":s,l=io(function(e){return e}).config.appearance,d=Pu(),f=a.useState(!1),h=f[0],p=f[1],b=a.useState(""),m=b[0],g=b[1],v=a.useState(!1),y=v[0],x=v[1];return u.jsxs("div",{className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300 bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2",style:{fontFamily:l.fontFamily,borderRadius:l.borderRadius,borderColor:h?l.accentColor:l.borderColor,backgroundColor:l.fieldBackground,borderWidth:l.borderWidth,color:l.textColor},onMouseEnter:function(e){h||(e.currentTarget.style.borderColor=l.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){h||(e.currentTarget.style.borderColor=l.borderColor)},children:[u.jsx("span",{style:{background:l.background,borderRadius:l.borderRadius,borderColor:l.borderColor,borderWidth:l.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:r}),u.jsxs("div",{style:{cursor:"text"},className:"bluxcc:ml-4 bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center",children:[u.jsx("input",{id:"bluxcc-input",type:c,value:m,onChange:function(e){var t=e.target.value;g(t);var r=Wc(c,t);x(r),null==n||n(t)},onKeyDown:function(e){"Enter"===e.key&&y&&(null==i||i(m))},placeholder:d("email"),className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden\n bluxcc:focus:outline-hidden bluxcc:text-base bluxcc:placeholder:text-base!",style:(t={color:l.textColor,fontFamily:l.fontFamily},t["--input-text-color"]=l.textColor,t),onFocus:function(){return p(!0)},onBlur:function(){p(!1),Wc("email",m)||x(!1)}}),u.jsx("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-25 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:u.jsx("button",{id:"bluxcc-button",disabled:!y,onClick:function(){return null==o?void 0:o(m)},className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-17! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-200",style:{background:l.fieldBackground,borderRadius:l.borderRadius,fontFamily:l.fontFamily,borderColor:y?l.accentColor:l.borderColor,color:y?l.accentColor:"#999999",borderWidth:l.borderWidth},children:d("submit")})})]})]})},zu=function(e){var t=e.size,r=void 0===t?"medium":t,n=e.startIcon,i=e.endArrow,o=e.isRecent,s=void 0!==o&&o,c=e.label,l=e.onClick,d=io(function(e){return e}),f=a.useState(!1),h=f[0],p=f[1],b=d.config.appearance,m=Pu();return u.jsxs("button",{type:"button",id:"bluxcc-button",onClick:l,className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300\n ".concat("small"===r?"bluxcc:size-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4":"bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2","\n "),style:{fontFamily:b.fontFamily,borderRadius:b.borderRadius,borderColor:h?b.accentColor:b.borderColor,backgroundColor:b.fieldBackground,borderWidth:b.borderWidth,color:b.textColor},onMouseEnter:function(e){p(!0),h||(e.currentTarget.style.borderColor=b.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){p(!1),h||(e.currentTarget.style.borderColor=b.borderColor)},children:[u.jsx("span",{style:{background:b.background,borderRadius:b.borderRadius,borderColor:b.borderColor,borderWidth:b.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:n}),u.jsx("div",{className:"".concat("small"===r?"bluxcc:mt-0":"bluxcc:ml-4"," bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"),children:u.jsx("span",{className:"".concat("small"===r?"bluxcc:text-sm bluxcc:leading-4":"bluxcc:text-base"," bluxcc:font-medium bluxcc:select-none"),children:c})}),s&&u.jsx("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:b.accentColor,borderRadius:b.borderRadius,backgroundColor:"".concat(Rc(b.accentColor,.15))},children:m("recent")}),i&&"medium"===r&&u.jsx("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center",children:u.jsx(Bu,{name:Ou.ArrowRight,props:{fill:"".concat(Rc(b.textColor,.7))}})})]})},Wu=function(e){var t=e.variant,r=void 0===t?"default":t,n=e.size,i=void 0===n?"medium":n,o=e.startIcon,s=e.endArrow,a=e.isRecent,c=void 0!==a&&a,l=e.label,d=e.onClick,f=e.onChange,h=e.onEnter,p=e.onSubmit,b=e.inputType,m=void 0===b?"text":b;return"input"===r?u.jsx(Du,{onEnter:h,onSubmit:p,onChange:f,inputType:m,startIcon:o}):u.jsx(zu,{size:i,label:l,onClick:d,isRecent:c,endArrow:s,startIcon:o})},$u=function(){var e,t=Pu(),r=a.useState(!0),n=r[0],i=r[1],o=io(function(e){return e}),s=o.setRoute,c=o.logoutAction,l=o.setAlert,d=o.config.appearance,f=null===(e=o.user)||void 0===e?void 0:e.address,h=0!==o.balances.balances.length?o.balances.balances.find(function(e){return"native"===e.asset_type}).balance:"0";return u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:mb-6 bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[u.jsxs("div",{className:"bluxcc:text-center bluxcc:text-2xl bluxcc:h-8 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",style:{color:d.accentColor,fontFamily:d.fontFamily},children:[u.jsx("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:u.jsx("p",{className:"bluxcc:select-none",style:{verticalAlign:"middle",paddingTop:n?"0px":"8px",fontFamily:d.fontFamily},children:h?n?"".concat(Bc(h)," XLM"):"******":t("loading")})}),u.jsx("div",{className:"bluxcc:transition-all",children:n?u.jsx("button",{id:"bluxcc-button",onClick:function(){return i(!1)},className:"bluxcc:bg-transparent",children:u.jsx(Bu,{name:Ou.OpenEye,props:{fill:d.accentColor}})}):u.jsx("button",{id:"bluxcc-button",onClick:function(){return i(!0)},className:"bluxcc:bg-transparent",children:u.jsx(Bu,{name:Ou.CloseEye,props:{fill:d.accentColor}})})})]}),u.jsx("button",{id:"bluxcc-button",className:"bluxcc:mt-4! bluxcc:leading-4 bluxcc:inline-flex bluxcc:bg-transparent bluxcc:text-sm bluxcc:select-none",onClick:function(){Sc(f).then(function(){Sc(f),l("copy","Address Copied"),setTimeout(function(){l("none","")},1e3)}).catch(function(){})},style:{color:Rc(d.textColor,.7),fontFamily:d.fontFamily},children:u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[f?Lc(f,5):"",u.jsx(Bu,{name:Ou.Copy,props:{fill:Rc(d.textColor,.7)}})]})})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:space-x-3",children:[u.jsx(Wu,{size:"small",label:t("send"),startIcon:u.jsx(Bu,{name:Ou.Send,props:{fill:d.textColor}}),onClick:function(){s(g.SEND)}}),u.jsx(Wu,{size:"small",label:t("receive"),startIcon:u.jsx(Bu,{name:Ou.Receive,props:{fill:d.textColor}}),onClick:function(){s(g.RECEIVE)}}),u.jsx(Wu,{size:"small",label:t("swap"),startIcon:u.jsx(Bu,{name:Ou.Swap,props:{fill:d.textColor}}),onClick:function(){s(g.SWAP)}})]}),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:w-full bluxcc:space-y-2",children:[u.jsx(Wu,{endArrow:!0,label:t("balances"),startIcon:u.jsx(Bu,{name:Ou.Balances,props:{fill:d.textColor}}),onClick:function(){s(g.BALANCES)}}),u.jsx(Wu,{endArrow:!0,label:t("activity"),startIcon:u.jsx(Bu,{name:Ou.History,props:{fill:d.textColor}}),onClick:function(){s(g.ACTIVITY)}})]}),u.jsx(Uu,{}),u.jsxs("button",{style:{color:Rc(d.textColor,.9),fontFamily:d.fontFamily},onClick:function(){c(),Yc(),o.emitter.emit(exports.BluxEvent.LoggedOut,void 0)},className:"bluxcc:flex bluxcc:h-12 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[u.jsx(Bu,{name:Ou.LogOut,props:{fill:Rc(d.textColor,.9)}}),t("logout")]})]})},qu={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-1",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-1"},Ku=function(e){var t=e.size,r=void 0===t?"large":t,n=e.disabled,i=void 0!==n&&n,o=e.variant,s=void 0===o?"outline":o,a=e.state,c=void 0===a?"enabled":a,l=e.children,d=e.startIcon,f=e.endIcon,h=e.onClick,p=e.style,b=e.className,m=e.type,g=io(function(e){return e.config.appearance}),v=N({borderRadius:g.borderRadius,fontFamily:g.fontFamily,pointerEvents:"disabled"===c?"none":void 0},p);return"outline"===s?Object.assign(v,{border:"1px solid ".concat(g.borderColor),color:g.accentColor,backgroundColor:g.fieldBackground,borderWidth:g.borderWidth}):"fill"===s?Object.assign(v,{backgroundColor:g.accentColor,fontWeight:"500",color:Ic(g.accentColor)}):"text"===s?Object.assign(v,{color:g.accentColor,backgroundColor:"transparent"}):"tonal"===s&&Object.assign(v,{color:g.accentColor,backgroundColor:Rc(g.accentColor,.1)}),"selected"===c&&(v.boxShadow="0 0 0 2px ".concat(g.accentColor)),u.jsxs("button",{type:m||"button",id:"bluxcc-button",onClick:h,disabled:"disabled"===c&&i,className:"".concat("bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full"," ").concat(qu[r]," ").concat(null!=b?b:""," bluxcc:transition-all bluxcc:duration-300"),style:v,children:[d&&u.jsx("span",{children:d}),u.jsx("span",{children:l}),f&&u.jsx("span",{children:f})]})},Hu=function(e,t){switch(e){case"Rabet":return u.jsx(Bu,{name:Ou.Rabet,props:{fill:t?"#ffffff":"#B8BAC4"}});case"Freighter":return t?u.jsx(Bu,{name:Ou.DarkFreighter,props:{}}):u.jsx(Bu,{name:Ou.Freighter,props:{fill:"#310CCC"}});case"Albedo":return u.jsx(Bu,{name:Ou.Albedo,props:{}});case"LOBSTR":return u.jsx(Bu,{name:Ou.Lobstr,props:{fill:t?"#ffffff":"#1a8da0"}});case"xBull":return u.jsx(Bu,{name:Ou.XBull,props:{fill:t?"#ffffff":"#C19CFC"}});case"Hana":return u.jsx(Bu,{name:Ou.Hana,props:{fill:t?"#E6E0F7":"#221542"}});case"Hot":return u.jsx(Bu,{name:Ou.Hot,props:{}});case"Wallet Connect":return u.jsx(Bu,{name:Ou.WalletConnect,props:{fill:t?"#ffffff":"#0988f1"}});case"Klever":return u.jsx(Bu,{name:Ou.Klever,props:{}});case"Ledger":return u.jsx(Bu,{name:Ou.Ledger,props:{fill:t?"#ffffff":"#000000"}});default:return null}},Vu=function(){var e,t,r,n=Pu(),i=io(function(e){return e}),o=i.user,s=i.waitingStatus,a=i.config.appearance;return u.jsxs("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{borderColor:a.borderColor,borderWidth:a.borderWidth},children:Hu(null!==(e=null==o?void 0:o.authValue)&&void 0!==e?e:"",Oc(a.background))}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:"login"===s?n("waitingFor",{walletName:null!==(t=null==o?void 0:o.authValue)&&void 0!==t?t:"wallet"}):n("signingWith",{walletName:null!==(r=null==o?void 0:o.authValue)&&void 0!==r?r:"wallet"})}),u.jsx("p",{className:"bluxcc:text-sm",children:n("login"===s?"acceptConnection":"signRequestInWallet")})]}),u.jsx(Uu,{}),u.jsx(Ku,{state:"disabled",variant:"outline",startIcon:u.jsx(Bu,{className:"bluxcc:animate-spin",name:Ou.Loading,props:{fill:a.accentColor}}),children:n("login"===s?"connecting":"signing")})]})},Gu=function(e){var t=e.handleOpenAssets,r=e.asset,n=io(function(e){return e.config.appearance});return u.jsxs("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:p-1 bluxcc:max-h-12",style:{fontFamily:n.fontFamily,borderColor:n.borderColor,borderWidth:n.borderWidth,borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:[u.jsx("div",{style:{fontFamily:n.fontFamily,background:n.background,borderRadius:n.borderRadius,borderColor:n.borderColor,borderWidth:n.borderWidth,color:n.textColor},className:"bluxcc:flex bluxcc:mr-0.5 bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:"native"===r.assetType?u.jsx(Bu,{name:Ou.Stellar,props:{fill:Ic(n.fieldBackground)}}):u.jsx(Bu,{name:Ou.QuestionMark,props:{fill:Ic(n.fieldBackground)}})}),u.jsx("span",{children:r.assetCode}),u.jsx(Bu,{name:Ou.ArrowDropDown,props:{fill:n.accentColor}})]})},Xu=function(t,r,n,i,o,s,a,c,u,l){return C(void 0,void 0,void 0,function(){var d,f,h,p,b;return T(this,function(m){switch(m.label){case 0:d=Number(Number(t).toFixed(5)).toString(),f=Number((Number(r)/100*99.5).toFixed(5)).toString(),h=null,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.loadAccount(a)];case 2:return h=m.sent(),[3,4];case 3:return m.sent(),[3,4];case 4:if(!h)throw new Error("Inactive account cannot send a transaction.");return p=new e.TransactionBuilder(h,{fee:"70000",networkPassphrase:u}),l&&(p=p.addOperation(e.Operation.changeTrust({limit:"999999999999",asset:xc(o)}))),b=k([],s.slice(1,s.length-1),!0).map(xc),p="from"===n?p.addOperation(e.Operation.pathPaymentStrictSend({sendAsset:xc(i),sendAmount:d,destination:a,destAsset:xc(o),destMin:f,path:b})):p.addOperation(e.Operation.pathPaymentStrictReceive({sendAsset:xc(i),sendMax:d,destination:a,destAsset:xc(o),destAmount:f,path:b})),[2,p.setTimeout(180).build().toXDR()]}})})},Yu=function(){var e=Pu(),t=a.useState("0"),r=t[0],n=t[1],i=a.useState("0"),o=i[0],s=i[1],c=a.useState(0),l=c[0],d=c[1],f=a.useState(0),h=f[0],p=f[1],b=io(function(e){return e}),m=a.useState(!1),v=m[0],y=m[1],x=a.useState([]),w=x[0],A=x[1],E=a.useState({field:"",message:""}),S=E[0],_=E[1],I=a.useState(!1),M=I[0],R=I[1],B=a.useState({rate:0,isInverted:!1}),O=B[0],j=B[1],L=a.useState("from"),P=L[0],F=L[1],U=function(e){b.setSelectAsset(N(N({},b.selectAsset),{field:e})),b.setRoute(g.SELECT_ASSET)},D=function(e,t){"from"===t?s(e.target.value):n(e.target.value),F(t),R(!M)};a.useEffect(function(){A([]),y(!1),_({field:"",message:""}),j({rate:0,isInverted:!1}),isNaN(Number(o))||""===o||Number(o)<0?_({field:"from",message:"Invalid value for FROM field."}):isNaN(Number(r))||""===r||Number(r)<0?_({field:"to",message:"Invalid value for TO field."}):b.selectAsset.swapFromAsset.assetCode!==b.selectAsset.swapToAsset.assetCode||b.selectAsset.swapFromAsset.assetIssuer!==b.selectAsset.swapToAsset.assetIssuer?isNaN(Number(b.selectAsset.swapFromAsset.assetBalance))?_({field:"from",message:"FROM asset has invalid balance."}):Number(o)>Number(b.selectAsset.swapFromAsset.assetBalance)?_({field:"from",message:"Insufficient balance."}):0===Number(o)&&0===Number(r)||(_({field:"",message:""}),C(void 0,void 0,void 0,function(){var e,t,i;return T(this,function(a){switch(a.label){case 0:if(y(!0),"from"!==P)return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,gu([xc(b.selectAsset.swapFromAsset),o,[xc(b.selectAsset.swapToAsset)]],{})];case 2:return e=a.sent(),y(!1),0===(t=e.response.records.filter(function(e){return e.path.length<2})).length?_({field:"both",message:"Could not find path. Try again."}):(i=t[0],j({rate:Number(i.destination_amount)/Number(i.source_amount),isInverted:!1}),A(k(k([b.selectAsset.swapFromAsset],i.path.map(Ac),!0),[b.selectAsset.swapToAsset],!1)),n(i.destination_amount)),[3,4];case 3:return a.sent(),y(!1),_({field:"both",message:"Could not find path. Try again."}),[3,4];case 4:return[3,8];case 5:return a.trys.push([5,7,,8]),[4,mu([[xc(b.selectAsset.swapFromAsset)],xc(b.selectAsset.swapToAsset),r],{})];case 6:return e=a.sent(),y(!1),0===(t=e.response.records.filter(function(e){return e.path.length<2})).length?_({field:"both",message:"Could not find path. Try again."}):(i=t[0],j({rate:Number(i.destination_amount)/Number(i.source_amount),isInverted:!1}),A(k(k([b.selectAsset.swapFromAsset],i.path.map(Ac),!0),[b.selectAsset.swapToAsset],!1)),s(i.source_amount)),[3,8];case 7:return a.sent(),y(!1),_({field:"both",message:"Could not find path. Try again."}),[3,8];case 8:return[2]}})})):_({field:"both",message:"FROM and TO assets are the same."})},[b.selectAsset,M]);var z=b.config.appearance,W="";0!==O.rate&&(W=O.isInverted?"1 ".concat(b.selectAsset.swapToAsset.assetCode," = ").concat((1/O.rate).toFixed(5)," ").concat(b.selectAsset.swapFromAsset.assetCode):"1 ".concat(b.selectAsset.swapFromAsset.assetCode," = ").concat(Bc(O.rate)," ").concat(b.selectAsset.swapToAsset.assetCode));var $="",q=""!==o&&"0"!==o&&Number(o)>=0&&!isNaN(Number(o)),K=""!==r&&"0"!==r&&Number(r)>=0&&!isNaN(Number(r));q&&K&&!v&&($="".concat((Number(r)/100*99.5).toFixed(5)," ").concat(b.selectAsset.swapToAsset.assetCode));var H=[{label:"Rate",value:0!==O.rate&&K?u.jsxs("span",{className:"bluxcc:flex bluxcc:gap-1.5 bluxcc:items-center",children:[W,u.jsx("button",{id:"bluxcc-button",onClick:function(){p(function(e){return e+180}),j(N(N({},O),{isInverted:!O.isInverted}))},className:"bluxcc:transition-transform bluxcc:duration-300 bluxcc:bg-transparent",style:{transform:"rotate(".concat(h,"deg)"),fontFamily:z.fontFamily},children:u.jsx(Bu,{name:Ou.SmallSwap,props:{fill:Rc(z.textColor,.7)}})})]}):"—"},{label:"Path",value:(null==w?void 0:w.length)?w.map(function(e){return e.assetCode}).join(" > "):"—"},{label:"Minimum Received",value:K?$:"—"}];return u.jsxs("form",{onSubmit:function(e){return C(void 0,void 0,void 0,function(){var t,n,i,s,a;return T(this,function(c){switch(c.label){case 0:if(e.preventDefault(),""!==S.message)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),t=function(e,t,r){var n=r.find(function(e){return"native"===e.asset_type});return"native"!==t.assetType&&(n=r.find(function(e){return e.asset_type===t.assetType&&e.asset_code===t.assetCode&&e.asset_issuer===t.assetIssuer})),!n||Number(n.balance)+Number(e)>=Number(n.limit)}(r,b.selectAsset.swapToAsset,b.balances.balances),[4,Xu(o,r,P,b.selectAsset.swapFromAsset,b.selectAsset.swapToAsset,w,null===(i=b.user)||void 0===i?void 0:i.address,null===(s=b.stellar)||void 0===s?void 0:s.servers.horizon,(null===(a=b.stellar)||void 0===a?void 0:a.activeNetwork)||"",t)];case 2:return n=c.sent(),setTimeout(function(){try{eu(n)}catch(e){}},150),[3,4];case 3:return c.sent(),_({field:"both",message:"Failed to make transaction."}),[3,4];case 4:return[2]}})})},children:[u.jsxs("div",{className:"bluxcc:relative bluxcc:w-full bluxcc:p-4",style:{backgroundColor:z.fieldBackground,borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth,fontFamily:z.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",children:[u.jsx("span",{style:{color:Rc(z.textColor,.7)},children:"From"}),u.jsxs("span",{style:{fontFamily:z.fontFamily},children:[u.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent bluxcc:border-none",style:{color:Rc(z.textColor,.7),fontFamily:z.fontFamily},children:Bc(b.selectAsset.swapFromAsset.assetBalance)}),u.jsxs("button",{id:"bluxcc-button",onClick:function(){F("from"),R(!M),s(b.selectAsset.swapFromAsset.assetBalance)},style:{color:z.accentColor,fontFamily:z.fontFamily},className:"bluxcc:mr-2 bluxcc:ml-1.5 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",u.jsx(Bu,{name:Ou.ArrowDropUp,props:{fill:z.accentColor}})]})]})]}),u.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsx("input",{name:"from",type:"number",value:o,onChange:function(e){D(e,"from")},id:"bluxcc-input",className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"from"===S.field||"both"===S.field?"#ec2929":z.textColor,fontFamily:z.fontFamily}}),u.jsx(Gu,{asset:b.selectAsset.swapFromAsset,handleOpenAssets:function(){U("swapFrom")}})]}),u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Rc(z.textColor,.7)}}),u.jsxs("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:[u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:z.borderWidth,borderTopStyle:"solid",borderTopColor:z.borderColor}}),u.jsx("div",{onClick:function(){var e=b.selectAsset.swapFromAsset,t=b.selectAsset.swapToAsset;d(function(e){return e+180}),b.setSelectAsset(N(N({},b.selectAsset),{swapFromAsset:t,swapToAsset:e}))},className:"bluxcc:z-20 bluxcc:p-2 bluxcc:transition-all bluxcc:duration-200",style:{backgroundColor:z.fieldBackground,borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth},children:u.jsx("div",{className:"bluxcc:transition-transform bluxcc:duration-300",style:{transform:"rotate(".concat(l,"deg)")},children:u.jsx(Bu,{name:Ou.Swap,props:{fill:z.accentColor}})})})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",style:{color:Rc(z.textColor,.7)},children:[u.jsx("span",{children:"To"}),u.jsx("span",{className:"bluxcc:mr-2",children:Bc(b.selectAsset.swapToAsset.assetBalance)})]}),u.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsx("input",{name:"to",id:"bluxcc-input",type:"number",value:r,onChange:function(e){D(e,"to")},className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"to"===S.field||"both"===S.field?"#ec2929":z.textColor,fontFamily:z.fontFamily}}),u.jsx(Gu,{asset:b.selectAsset.swapToAsset,handleOpenAssets:function(){U("swapTo")}})]}),u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Rc(z.textColor,.7)}})]}),u.jsx("div",{className:"bluxcc:h-3.5 bluxcc:my-1.25 bluxcc:mx-3 bluxcc:text-left bluxcc:text-xs bluxcc:text-alert-error",children:S.message}),u.jsx("div",{style:{borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth},className:"bluxcc:w-full bluxcc:py-3 bluxcc:px-4",children:H.map(function(e,t,r){return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:items-center bluxcc:text-xs bluxcc:font-medium",children:[u.jsx("span",{style:{color:Rc(z.textColor,.8)},children:e.label}),u.jsx("span",{style:{color:Rc(z.textColor,.7)},children:v?"LOADING...":e.value})]}),t!==r.length-1&&u.jsx("div",{className:"bluxcc:my-2",style:{borderRadius:z.borderRadius,borderTop:"".concat(z.borderWidth," dashed ").concat(z.borderColor)}})]},e.label)})}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",state:"enabled",variant:"outline",type:"submit",disabled:""!==S.message,children:"Swap"})]})},Zu=function(e){var t=e.button,r=e.onButtonClick,n=e.appearance;return u.jsx("button",{onClick:r,id:"bluxcc-button",style:{borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,background:n.background,borderWidth:n.borderWidth},className:"bluxcc:border bluxcc:px-3! bluxcc:py-1! bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",children:t})},Ju=function(e){var t=e.label,r=e.autoFocus,n=e.type,i=void 0===n?"text":n,o=e.placeholder,s=void 0===o?"Input":o,c=e.error,l=e.iconRight,d=e.iconLeft,f=e.button,h=e.optionalField,p=void 0!==h&&h,b=e.onButtonClick,m=e.customLabel,g=e.value,v=e.className,y=e.onChange,x=io(function(e){return e.config.appearance}),w=a.useState(!1),A=w[0],E=w[1],S=Pu(),_=function(){return c?"#ec2929":A?x.accentColor:x.borderColor};return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col",style:{fontFamily:x.fontFamily},children:[t&&u.jsxs("label",{style:{color:c?"#ec2929":x.textColor},className:"bluxcc:mb-2 bluxcc:ml-4 bluxcc:flex bluxcc:justify-between bluxcc:text-xs",children:[u.jsxs("span",{children:[t," ",p&&u.jsxs("span",{style:{color:Rc(x.textColor,.7)},className:"bluxcc:text-[10px]",children:["(",S("optional"),")"]})]}),u.jsx("span",{children:m})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ".concat(v),onFocus:function(){return E(!0)},onBlur:function(){return E(!1)},onMouseEnter:function(e){A||c||(e.currentTarget.style.borderColor=x.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){A||(e.currentTarget.style.borderColor=c?"#ec2929":x.borderColor)},style:{"--tw-ring-color":_(),border:"".concat(x.borderWidth," solid ").concat(_()),borderRadius:x.borderRadius,backgroundColor:x.fieldBackground},children:[d&&u.jsx("div",{className:"bluxcc:mr-2",children:d}),u.jsx("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===i?1:void 0,type:i,autoFocus:r,value:g,placeholder:s,className:"bluxcc:mr-2! bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base bluxcc:font-medium",style:{fontFamily:x.fontFamily,color:x.textColor,width:f?"90%":"100%"},onChange:y}),f&&u.jsx(Zu,{button:f,onButtonClick:b,appearance:x}),l&&u.jsx("div",{className:"bluxcc:ml-4",children:l})]}),!p&&u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-xs bluxcc:ml-4 bluxcc:h-4",children:c?u.jsx("p",{className:"bluxcc:text-alert-error",children:c}):""})]})},Qu=function(){var t=Pu(),r=io(function(e){return e}),n=a.useState({}),i=n[0],o=n[1],s=a.useState({memo:"",amount:"",address:""}),c=s[0],l=s[1],d=function(e){return function(t){l(function(r){var n;return N(N({},r),((n={})[e]=t.target.value,n))}),o(function(t){var r;return N(N({},t),((r={})[e]="",r))})}};return u.jsx(u.Fragment,{children:u.jsxs("div",{children:[u.jsx("div",{className:"bluxcc:relative bluxcc:mb-1",children:u.jsx(Ju,{autoFocus:!0,type:"number",label:t("amount"),placeholder:"0.00",value:c.amount,onChange:d("amount"),error:i.amount,customLabel:u.jsxs("button",{id:"bluxcc-button",onClick:function(){var e=Number(r.selectAsset.sendAsset.assetBalance).toString();l(function(t){return N(N({},t),{amount:e})})},style:{color:r.config.appearance.accentColor,fontFamily:r.config.appearance.fontFamily},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:bg-transparent",children:[t("max")," ",u.jsx(Bu,{name:Ou.ArrowDropUp,props:{fill:r.config.appearance.accentColor}})]}),onButtonClick:function(){r.setSelectAsset(N(N({},r.selectAsset),{field:"send"})),r.setRoute(g.SELECT_ASSET)},button:u.jsxs("span",{className:"bluxcc:flex bluxcc:justify-between bluxcc:gap-1!",children:[u.jsx("span",{className:"bluxcc:flex bluxcc:items-center",children:"native"===r.selectAsset.sendAsset.assetType?u.jsx(Bu,{name:Ou.StellarSmall,props:{fill:Ic(r.config.appearance.fieldBackground)}}):u.jsx(Bu,{name:Ou.SmallQuestionMark,props:{fill:Ic(r.config.appearance.fieldBackground)}})}),r.selectAsset.sendAsset.assetCode]})})}),u.jsx("div",{className:"bluxcc:mb-1",children:u.jsx(Ju,{label:t("to"),placeholder:t("enterAddress"),value:c.address,onChange:d("address"),error:i.address,button:t("paste"),onButtonClick:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return e=t.sent(),l(function(t){return N(N({},t),{address:e})}),[2]}})})}})}),u.jsx("div",{children:u.jsx(Ju,{optionalField:!0,label:t("memo"),placeholder:t("enterMemo"),value:c.memo,onChange:d("memo")})}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",variant:"outline",state:"enabled",onClick:function(){return C(void 0,void 0,void 0,function(){var n,i,s,a,u,l;return T(this,function(d){switch(d.label){case 0:if(n={},c.amount?Number(c.amount)>Number(r.selectAsset.sendAsset.assetBalance||"0")&&(n.amount=t("amountExceedsBalance")):n.amount=t("amountRequired"),c.address?e.StrKey.isValidEd25519PublicKey(c.address)||(n.address=t("addressInvalid")):n.address=t("addressRequired"),o(n),0!==Object.keys(n).length)return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,(f=c.memo,h=c.amount,p=c.address,b=r.selectAsset.sendAsset,m=null===(a=r.user)||void 0===a?void 0:a.address,g=null===(u=r.stellar)||void 0===u?void 0:u.servers.horizon,v=(null===(l=r.stellar)||void 0===l?void 0:l.activeNetwork)||"",C(void 0,void 0,void 0,function(){var t,r,n,i;return T(this,function(o){switch(o.label){case 0:t=null,r=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,g.loadAccount(p)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return o.trys.push([4,6,,7]),[4,g.loadAccount(m)];case 5:return t=o.sent(),[3,7];case 6:return o.sent(),[3,7];case 7:if(!t)throw new Error("Inactive account cannot send a transaction.");if(!r&&"native"!==b.assetType)throw new Error("Cannot send non-native asset to an inactive account.");return n=new e.TransactionBuilder(t,{fee:"50000",networkPassphrase:v}),r?(i=e.Asset.native(),"native"!==b.assetType&&(i=new e.Asset(b.assetCode,b.assetIssuer)),n=n.addOperation(e.Operation.payment({amount:h,destination:p,asset:i}))):n=n.addOperation(e.Operation.createAccount({startingBalance:h,destination:p})),f&&(n=n.addMemo(e.Memo.text(f))),[2,n.setTimeout(180).build().toXDR()]}})}))];case 2:return i=d.sent(),setTimeout(function(){var e;eu(i,{network:(null===(e=r.stellar)||void 0===e?void 0:e.activeNetwork)||""})},150),[3,4];case 3:return s=d.sent(),n.address=s.message,o(n),[3,4];case 4:return[2]}var f,h,p,b,m,g,v})})},children:t("sendButton")})]})})},el=function(e){var t=e.otp,r=e.setOtp,n=e.error,i=t.length,o=a.useRef([]),s=io(function(e){return e.config.appearance});a.useEffect(function(){n&&setTimeout(function(){var e;return null===(e=o.current[0])||void 0===e?void 0:e.focus()},1001)},[n]);var c=function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,i);if(t){var n=k(k([],t.split(""),!0),Array(i-t.length).fill(""),!0);r(n),setTimeout(function(){var e;return null===(e=o.current[i-1])||void 0===e?void 0:e.focus()},0)}},l=function(e){return{fontFamily:s.fontFamily,borderRadius:s.borderRadius,color:s.accentColor,background:s.fieldBackground,"--tw-ring-color":n?"#FF6666":s.accentColor,borderColor:n?"#FF6666":e?s.accentColor:s.borderColor,borderWidth:s.borderWidth}};return u.jsx("div",{className:"bluxcc:flex bluxcc:gap-1",children:t.map(function(e,n){return u.jsx("input",{autoFocus:0===n,ref:function(e){o.current[n]=e},type:"text",inputMode:"numeric",maxLength:1,value:e,onChange:function(e){return function(e,n){var s,a=n.target.value.replace(/\D/g,"");if(a){var c=k([],t,!0);c[e]=a[0],r(c),e<i-1&&a&&(null===(s=o.current[e+1])||void 0===s||s.focus())}}(n,e)},onPaste:c,onKeyDown:function(e){return function(e,n){var i;if("Backspace"===n.key){var s=k([],t,!0);s[e]?(s[e]="",r(s)):e>0&&(null===(i=o.current[e-1])||void 0===i||i.focus(),s[e-1]="",r(s))}}(n,e)},className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:l(e)},n)})})},tl=function(){var e=eo();e.login&&(e.user&&e.user.address&&e.authState.isAuthenticated?e.login.resolver(e.user):e.login.rejecter("BLUX: Failed to login!"),e.setLogin(void 0))},rl=function(){eo().setRoute(g.ACCEPT_TERMS_AND_PRIVACY)},nl=function(){var e=Pu(),t=io(function(e){return e}),r=t.user,n=t.config.appearance,i=null==r?void 0:r.authValue,o=a.useState(Array(6).fill("")),s=o[0],c=o[1],l=a.useState(!1),d=l[0],f=l[1];return a.useEffect(function(){var e,r=s.join("");6===r.length&&(e=r,C(void 0,void 0,void 0,function(){var r,n,i,o;return T(this,function(s){switch(s.label){case 0:f(!1),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,uc(t.config.appId,t.user,e)];case 2:return(r=s.sent())?(f(!1),localStorage.setItem(so,r),Xc("email",(null===(i=t.user)||void 0===i?void 0:i.authValue)||""),t.setAuth({isAuthenticated:!0,JWT:r}),[4,lc(r)]):[3,4];case 3:n=s.sent(),t.connectWalletSuccessful(n.public_key,(null===(o=t.stellar)||void 0===o?void 0:o.activeNetwork)||""),setTimeout(function(){eo().modal.isOpen&&(t.setRoute(g.SUCCESSFUL),setTimeout(function(){eo().modal.isOpen&&rl()},1e3))}),s.label=4;case 4:return[3,6];case 5:return s.sent(),f(!0),setTimeout(function(){return c(Array(6).fill(""))},1e3),[3,6];case 6:return[2]}})}))},[s,i]),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{style:{borderColor:n.borderColor,borderWidth:n.borderWidth},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2",children:u.jsx(Bu,{name:Ou.Email,props:{fill:n.textColor}})}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center",children:[u.jsx("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:e("enterConfirmationCodeTitle")}),d?u.jsx("p",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error",children:e("invalidCodeError")}):u.jsx("p",{className:"bluxcc:h-10 bluxcc:text-sm",children:e("enterConfirmationCodeHelp")})]}),u.jsx("div",{className:"bluxcc:mt-6 bluxcc:text-center",children:u.jsx(el,{otp:s,setOtp:c,error:d})}),u.jsx(Uu,{}),u.jsx(Ku,{size:"medium",state:"enabled",variant:"text",onClick:function(){return C(void 0,void 0,void 0,function(){var e;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,cc(t.config.appId,(null===(e=t.user)||void 0===e?void 0:e.authValue)||"")];case 1:case 2:return r.sent(),[3,3];case 3:return[2]}})})},style:{color:n.accentColor},children:e("resendCode")})]})},il=function(){var e,t,r,n=Pu(),i=io(function(e){return e}),o="";"object"==typeof(null===(e=i.sendTransaction)||void 0===e?void 0:e.result)&&(o=i.sendTransaction.result.hash);var s=(null===(r=null===(t=i.sendTransaction)||void 0===t?void 0:t.options)||void 0===r?void 0:r.network)||"",a=o?Nc(s,i.config.explorer,"transactionUrl",o):null;return u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{style:{background:Rc(i.config.appearance.accentColor,.1)},className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",children:u.jsx(Bu,{name:Ou.GreenCheck,props:{fill:i.config.appearance.accentColor}})}),u.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:"login"===i.waitingStatus?n("connectionSuccessfulTitle"):n("transactionSuccessfulTitle")}),u.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5",children:"login"===i.waitingStatus?n("connectionSuccessfulMessage",{appName:Ec(i.config.appName)}):n("transactionSuccessfulMessage")})]}),"sendTransaction"===i.waitingStatus&&o&&"string"==typeof a&&u.jsx(Ku,{state:"enabled",variant:"outline",size:"small",className:"bluxcc:mt-4",onClick:function(){a&&window.open(a,"_blank","noopener,noreferrer")},children:n("seeInExplorer")}),u.jsx(Uu,{}),"login"===i.waitingStatus?u.jsx(Ku,{state:"disabled",variant:"outline",children:n("loggingIn")}):u.jsx(Ku,{state:"enabled",variant:"fill",size:"large",onClick:function(){if(i.closeModal(),"sendTransaction"===i.waitingStatus){if(!i.sendTransaction)return;var e=i.sendTransaction,t=e.resolver,r=e.result;t&&r&&(t(r),setTimeout(function(){i.cleanUp("signMessage")},150))}else if("signMessage"===i.waitingStatus){if(!i.signMessage)return;var n=i.signMessage;t=n.resolver,r=n.result;t&&r&&(t(r),setTimeout(function(){i.cleanUp("signMessage")},150))}},children:n("done")})]})},ol=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:e.connectWallet(t.name),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,t.connect()];case 2:return(r=i.sent())&&""!==r.trim()?[4,kc(t)]:[3,4];case 3:n=i.sent(),(o=e.config.appId,s=t.name,a=r,C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:if(!o)throw new Error("appId is missing in config.");if(!a)throw new Error("wallet address is missing.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,wc("".concat(lo,"/auth"),{method:"POST",headers:(t={},t[fo]=o,t.Accept="application/json",t["Content-Type"]="application/json",t),body:JSON.stringify({wallet:a,auth_method:"wallet",auth_value:s})})];case 2:if(400===(e=r.sent()).status)throw new Error("invalid inputs");if(500===e.status)throw new Error("server error");if(429===e.status)throw new Error("too many requests");if(200===e.status)return[2,!0];throw new Error("Unexpected response from api");case 3:throw r.sent(),new Error("Unexpected response from api");case 4:return[2]}})})).catch(function(){}),function(e){var t=Mc(),r=k([e],t.filter(function(t){return t!==e}),!0);localStorage.setItem(ao,JSON.stringify(r))}(t.name),Xc("wallet",t.name),setTimeout(function(){eo().modal.isOpen&&(e.connectWalletSuccessful(r,n),e.setRoute(g.SUCCESSFUL),setTimeout(function(){eo().modal.isOpen&&rl()},1e3))},500),i.label=4;case 4:return[3,6];case 5:return i.sent(),e.setRoute(g.FAILED),[3,6];case 6:return[2]}var o,s,a})})},sl=!1,al=function(e){return C(void 0,void 0,void 0,function(){return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[co,uo],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},cl=function(){var e=Pu(),t=io(function(e){return e}),r=a.useState(""),n=r[0],i=r[1],o=t.config,s=t.wallets,c=t.connectEmail,l=t.setShowAllWallets,d=o.appearance,f=o.loginMethods||[],h=f.includes("passkey"),p=a.useMemo(function(){var e=k([],f,!0).filter(function(e){return"passkey"!==e});return k(k([],e,!0),h?["passkey"]:[],!0)},[f,h]),m=a.useMemo(function(){return s.length>3?s.slice(2):[]},[s]),v=a.useMemo(function(){return s.length<=3?s:t.showAllWallets?s.slice(2,s.length):s.slice(0,2)},[s,t.showAllWallets]);a.useEffect(function(){t.walletConnect&&al(t.walletConnect.client).then(function(e){t.setWalletConnectClient(t.walletConnect.client,e)}).catch(function(e){})},[]);var y=function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),c(n),[4,cc(o.appId,n)];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}})})},x=function(){return u.jsxs("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(d.borderWidth," dashed ").concat(d.borderColor)}}),u.jsx("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:d.background,color:d.borderColor},children:e("or")})]})};return u.jsxs("div",{className:"bluxcc:w-full",children:[d.logo&&u.jsx("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:u.jsx("img",{src:d.logo,alt:o.appName,width:152,height:60,className:"bluxcc:max-h-20 bluxcc:max-w-45 bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),u.jsx("div",{className:"",children:p.map(function(r,n){var o=p[n+1],s=p[n-1],a=p.includes("wallet"),c=a&&!t.showAllWallets&&"wallet"===r&&"email"===o||a&&"email"===r&&"wallet"!==s;return"wallet"===r?u.jsx(S.default.Fragment,{children:u.jsxs("div",{className:"bluxcc:max-h-81 bluxcc:space-y-2 bluxcc:overflow-y-auto overflowStyle",children:[v.map(function(e){return u.jsx(Wu,N({},e,{label:e.name,startIcon:Hu(e.name,Oc(d.background)),onClick:function(){return r=e,C(void 0,void 0,void 0,function(){return T(this,function(e){return r.name===b.WalletConnect?t.setRoute(g.WALLET_CONNECT):ol(t,r),[2]})});var r}}),e.name)}),m.length>0&&!t.showAllWallets&&u.jsx(Wu,{endArrow:!0,label:e("allStellarWallets"),startIcon:u.jsx(Bu,{name:Ou.Stellar,props:{fill:Ic(d.background)}}),onClick:function(){l(!0)}}),c&&x()]})},"wallet"):t.showAllWallets||"email"!==r?t.showAllWallets||"passkey"!==r?null:u.jsx("button",{className:"bluxcc:mt-6! bluxcc:w-full bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:d.accentColor,fontFamily:d.fontFamily},children:e("logInWithPasskey")},"passkey"):u.jsx(S.default.Fragment,{children:u.jsxs(u.Fragment,{children:[u.jsx(Wu,{inputType:"email",variant:"input",startIcon:u.jsx(Bu,{name:Ou.SmallEmail,props:{fill:d.textColor}}),onChange:function(e){return i(e)},onEnter:y,onSubmit:y}),c&&x()]})},"email")})}),u.jsx("footer",{className:"bluxcc:w-full bluxcc:pt-4.25 bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:u.jsx("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:d.textColor,fontFamily:d.fontFamily},children:e("poweredByBlux")})})]})},ul=function(e){var t=e.value,r=e.title,n=void 0===r?"":r,i=e.size,o=void 0===i?184:i,s=e.bgColor,a=void 0===s?"#ffffff":s,c=e.fgColor,l=void 0===c?"#00020f":c,d=e.level,h=void 0===d?"Q":d,p=e.imgSize,b=void 0===p?51:p,m=M(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return u.jsx(f.QRCodeCanvas,N({className:"bluxcc:z-10",value:t,title:n,size:o,bgColor:a,fgColor:l,level:h,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:b,width:b,opacity:1,excavate:!0}},m))},ll=function(){var e,t=Pu(),r=io(function(e){return e}),n=io(function(e){return e}).setAlert,i=r.config.appearance,o=null===(e=r.user)||void 0===e?void 0:e.address;return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:[u.jsx(ul,{size:184,value:o,bgColor:i.fieldBackground,fgColor:i.accentColor,level:"Q"}),u.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:i.background},children:u.jsx(Bu,{name:Ou.SmallBlux,props:{fill:i.accentColor,background:i.fieldBackground}})})]}),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-lg",children:"Your Address"}),u.jsx("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:u.jsx("p",{className:"bluxcc:w-73 bluxcc:text-sm bluxcc:leading-4! bluxcc:break-all",style:{color:Rc(i.textColor,.7)},children:o})})]}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",state:"enabled",variant:"tonal",style:{color:i.accentColor},onClick:function(){Sc(o),n("copy",t("address_copied")),setTimeout(function(){n("none","")},1e3)},endIcon:u.jsx(Bu,{name:Ou.LargeCopy,props:{fill:i.accentColor}}),children:t("copy_address")})]})},dl=function(){var e,t,r=Pu(),n=io(function(e){return e}),i=(t=n.config.networks,Object.entries(bc).filter(function(e){return t.includes(e[1])}).map(function(e){return Ec(e[0])}));return u.jsxs("div",{style:{fontFamily:n.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:u.jsx(Bu,{name:Ou.WrongNetwork,props:{}})}),u.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-2xl",children:r("wrongNetwork")}),u.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:r("wrongNetworkMessage",{currentNetwork:Ec(Cc(null===(e=n.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},fl=function(e){var t,r=e.tabs,n=io(function(e){return e.config.appearance}),i=a.useState(0),o=i[0],s=i[1];return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",style:{fontFamily:n.fontFamily},children:r.map(function(e,t){var r=o===t;return u.jsxs("button",{role:"tab",onClick:function(){return s(t)},"aria-label":e.label,id:"bluxcc-button","aria-selected":o===t,tabIndex:o===t?0:-1,className:"bluxcc:flex bluxcc:gap-2 bluxcc:h-20 bluxcc:w-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:px-7 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:r?Rc(n.accentColor,.1):n.background,color:r?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[u.jsx("span",{children:r?e.activeIcon:e.inActiveIcon}),u.jsx("span",{children:e.label})]},t)})}),u.jsx("div",{className:"bluxcc:max-h-78 bluxcc:h-78 w-full bluxcc:overflow-auto overflowStyle",role:"tabpanel","aria-labelledby":"tab-".concat(o),children:u.jsx("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0 bluxcc:max-h-78 bluxcc:h-78 bluxcc:overflow-auto overflowStyle",children:null===(t=r[o])||void 0===t?void 0:t.content})})]})},hl=function(e){var t=e.assets,r=a.useState(null),n=r[0],i=r[1],o=io(function(e){return e.config.appearance}),s=Pu();return u.jsxs("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto overflowStyle",children:[t.map(function(e,r){return u.jsxs("button",{id:"bluxcc-button",onMouseEnter:function(){return i(r)},onMouseLeave:function(){return i(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:n===r?o.fieldBackground:"transparent",color:o.textColor,borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?o.borderWidth:"0px",borderBottomColor:o.borderColor,transition:"all 0.2s ease-in-out",fontFamily:o.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[u.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:o.borderRadius,background:o.fieldBackground,border:"".concat(o.borderWidth," solid ").concat(o.borderColor)},children:"native"===e.assetType?u.jsx(Bu,{name:Ou.Stellar,props:{fill:Ic(o.fieldBackground)}}):u.jsx(Bu,{name:Ou.QuestionMark,props:{fill:Ic(o.fieldBackground)}})}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.title}),u.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Rc(o.textColor,.7)},children:e.subtitle})]})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[u.jsx("span",{className:"bluxcc:font-medium",children:Bc(e.assetBalance)}),u.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Rc(o.textColor,.7)},children:!1})]})]},e.assetType+e.assetIssuer)}),0===t.length&&u.jsx("div",{style:{color:Rc(o.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},pl=function(){var e=Pu(),t=io(function(e){return e.config.appearance}),r=io(function(e){return e.balances}),n=r.loading,i=r.error,o=r.balances,s=o.map(function(e){return N(N({},Ac(e)),{title:(t=e,"native"===t.asset_type?"XLM":"credit_alphanum4"===t.asset_type||"credit_alphanum12"===t.asset_type?t.asset_code:"liquidity_pool_shares"===t.asset_type?"LiquidtyPool":""),subtitle:yc(e),logo:u.jsx(Bu,{name:Ou.Stellar,props:{}})});var t}),a=function(){return u.jsxs("div",{className:"bluxcc:w-full bluxcc:mt-22 bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:flex-col bluxcc:gap-2",children:[u.jsx(Bu,{name:Ou.GrayCube,props:{}}),u.jsx("p",{className:"bluxcc:font-medium",style:{color:Rc(t.textColor,.7)},children:e("no_balance_message")})]})},c=[{label:e("assets"),activeIcon:u.jsx(Bu,{name:Ou.Assets,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Bu,{name:Ou.Assets,props:{fill:t.textColor}}),content:o.length?u.jsx(hl,{assets:s}):u.jsx(a,{})},{label:e("tokens"),activeIcon:u.jsx(Bu,{name:Ou.Token,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Bu,{name:Ou.Token,props:{fill:t.textColor}}),content:u.jsx(a,{})},{label:e("nfts"),activeIcon:u.jsx(Bu,{name:Ou.NFTs,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Bu,{name:Ou.NFTs,props:{fill:t.textColor}}),content:u.jsx(a,{})}];return n?"Loading":i?"Error, try again.":u.jsx(fl,{tabs:c})},bl=S.default.memo(function(e){var t,r,n,i,o,s=e.tx,a=io(function(e){return e}),c=a.config.appearance,l=Nc((null===(t=a.stellar)||void 0===t?void 0:t.activeNetwork)||"",a.config.explorer,"transactionUrl",s.hash);return u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[u.jsx("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:c.background},children:function(e){switch(e){case"Receive":return u.jsx(Bu,{name:Ou.Downstream});case"Send":return u.jsx(Bu,{name:Ou.Upstream});default:return u.jsx(Bu,{name:Ou.MultiOperation})}}(s.title)}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[u.jsx("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:c.textColor},children:s.title}),u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:s.description})]})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:Rc(c.textColor,.7)},children:[(r=s.date,n=new Date(r),i=n.getUTCDate(),o=n.toLocaleString("en-US",{month:"short"}),"".concat(i," ").concat(o)),u.jsx("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:function(){l&&window.open(l,"_blank","noopener,noreferrer")},style:{background:c.fieldBackground},children:u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:[u.jsx(Bu,{name:Ou.Globe}),";"]})})]})]})}),ml=function(e){return"native"===e.asset_type?"XLM":e.asset_code||"Pool"},gl=function(){var t,r,n=Pu(),i=io(function(e){return e}),o=io(function(e){return e.transactions}),s=o.loading,c=o.transactions,l=a.useState([]),d=l[0],f=l[1],h=i.config.appearance,p=null===(t=i.user)||void 0===t?void 0:t.address,b=Nc(null===(r=i.stellar)||void 0===r?void 0:r.activeNetwork,i.config.explorer,"accountUrl",p);a.useEffect(function(){if(c){for(var t=[],r=0,i=c;r<i.length;r++){var o=i[r],s=o.operations[0],a={hash:o.hash,description:"",date:o.created_at,title:Fc(s.type)};if(o.operations.length>1)a.title=n("multiOperation");else if("payment"===s.type){var u=n("send");s.to.toLowerCase()===p.toLowerCase()&&(u=n("receive")),a.title=u,a.description="".concat(Bc(s.amount)," ").concat(ml(s))}else s.type!==e.Horizon.HorizonApi.OperationResponseType.pathPaymentStrictSend&&s.type!==e.Horizon.HorizonApi.OperationResponseType.pathPayment||(a.title=n("swap"),a.description="Received ".concat(ml(s)));t.push(a)}f(t)}},[c]);var m=!s&&0===d.length;return u.jsxs("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[s?u.jsx("div",{style:{color:Rc(h.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("loadingActivity")}):m?u.jsx("div",{style:{color:Rc(h.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("noActivityFound")}):d.map(function(e,t){return u.jsx("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<d.length-1?h.borderWidth:"0px",borderBottomColor:h.borderColor},className:"bluxcc:p-2",children:u.jsx(bl,{tx:e})},t)}),d.length>0&&b&&u.jsx("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:u.jsx(Ku,{state:"enabled",variant:"outline",size:"medium",onClick:function(){b&&window.open(b,"_blank","noopener,noreferrer")},children:n("seeAllInExplorer")})})]})},vl=function(e){var t=e.operationsCount,r=e.sender,n=e.receiver,i=e.network,o=e.estimatedFee,s=e.action,a=io(function(e){return e.config.appearance}),c=io(function(e){return e}).setAlert,l=[{label:"Action",value:Ec(s)},{label:"Operations",value:t.toString()},{label:"Sender",value:Lc(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:"Network",value:mc[i].name},{label:"Estimated Fee",value:"".concat(o," XLM")}];return n&&l.splice(3,0,{label:"To",value:Lc(n,5),isHighlighted:!0,isCopyable:!0,copyValue:n}),u.jsx("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",style:{fontFamily:a.fontFamily},children:l.map(function(e,t){var r=e.label,n=e.value,i=e.isHighlighted,o=e.isCopyable,s=e.copyValue;return u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===l.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.borderWidth},children:[u.jsx("span",{style:{color:a.textColor},children:r}),o?u.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:i?a.accentColor:a.textColor},onClick:function(){return s&&(Sc(s),c("copy","Address Copied"),void setTimeout(function(){c("none","")},1e3))},children:n}):u.jsx("span",{style:{color:i?a.accentColor:a.textColor},children:n})]},t)})})},yl=function(e){return C(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a;return T(this,function(c){switch(c.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(g.FAILED),[2];if(e.setRoute(g.WAITING),!e.user)return e.setRoute(g.FAILED),[2];if(r=e.user,n=r.authMethod,i=r.authValue,"wallet"!==n)return e.setRoute(g.FAILED),[2];if(!(o=pc[i]))return e.setRoute(g.FAILED),[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Vc(o,t.xdr,null===(a=e.user)||void 0===a?void 0:a.address,t.options.network,e.config.transports||{},t.shouldSubmit)];case 2:return s=c.sent(),e.setSendTransaction(N(N({},t),{result:s}),!0,g.WAITING),setTimeout(function(){e.setRoute(g.SUCCESSFUL)},400),[3,4];case 3:return c.sent(),setTimeout(function(){e.setRoute(g.FAILED)},200),[3,4];case 4:return[2]}})})},xl=function(){var e,t=Pu(),r=io(function(e){return e}),n=r.config.appearance,i=r.user,o=r.stellar,s=r.sendTransaction;if(!s||!i||!o)return u.jsx("div",{children:u.jsx("p",{children:t("invalidXdr")})});var a=s.xdr,c=s.options,l=qc(a,c.network);if(!l)return u.jsx("div",{children:u.jsx("p",{children:t("invalidXdr")})});var d,f,h=0===r.balances.balances.length?"0":r.balances.balances.find(function(e){return"native"===e.asset_type}).balance,p=i.authValue===b.Lobstr,m=(d=o.activeNetwork,(f=Object.entries(bc).find(function(e){return e[1]===d}))?f[0].toUpperCase():"MAINNET");return u.jsxs("div",{className:"bluxcc:w-full",style:{fontFamily:n.fontFamily},children:[u.jsxs("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[u.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),t("signTransactionPrompt")]}),u.jsx(vl,{operationsCount:l.operations,sender:l.sender,receiver:l.receiver,network:c.network,estimatedFee:l.estimatedFee.toString(),action:l.action}),p&&u.jsx("p",{className:"bluxcc:my-2! bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-xs! bluxcc:text-alert-error",children:t("lobstrWarning",{network:m})}),u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:p?"0px":"16px",borderRadius:n.borderRadius,borderColor:n.borderColor},children:[u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),u.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Rc(n.textColor,.8))},children:i.address?Lc(null===(e=r.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),u.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-2.5 bluxcc:py-2",style:{borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:u.jsxs("p",{className:"bluxcc:max-w-22.5 bluxcc:text-xs bluxcc:font-normal",children:[h?Bc(h):"0"," XLM"]})})]}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",state:"enabled",variant:"fill",onClick:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return yl(r),[2]})})},children:t("approve")})]})},wl=function(){var e=Pu(),t=io(function(e){return e.config.appearance}),r={logo:u.jsx(Bu,{name:Ou.Stellar,props:{}}),assetBalance:.43332,valueInCurrency:203},n=[{label:e("network"),value:"Stellar",link:!0},{label:e("address"),value:"GFGE...MKLW",copyable:!0},{label:e("market_cap"),value:"2.45M"},{label:e("total_volume"),value:323},{label:e("all_time_high"),value:323}];return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:my-4",children:[u.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:r.logo}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[u.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:t.accentColor},children:["$",Bc(r.valueInCurrency)]}),u.jsxs("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:{color:Rc(t.textColor,.7)},children:[Bc(r.assetBalance)," XLM"]})]})]}),u.jsx("div",{className:"bluxcc:space-y-1",children:n.map(function(e,r){return u.jsxs("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-8 bluxcc:px-4",style:{borderBottom:r<n.length-1?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[u.jsx("span",{children:e.label}),u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",style:{color:e.copyable||e.link?t.accentColor:Rc(t.textColor,.7)},children:[e.link?u.jsx("a",{href:"#",target:"_blank",rel:"noreferrer",style:{color:t.accentColor,fontFamily:t.fontFamily},className:"bluxcc:no-underline",children:e.value}):e.value,e.copyable&&u.jsx(Bu,{name:Ou.Copy,props:{fill:t.accentColor}})]})]},r)})})]})},Al={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},El=function(e){var t,r=e.theme,n=void 0===r?"purple":r,i=e.className,o=void 0===i?"":i,s=e.children,c=e.animationSpeed,l=void 0===c?1:c,d=e.onClick,f=e.style,h=e.size,p=void 0===h?"100%":h,b=a.useRef(null),m=a.useRef(null);return a.useEffect(function(){var e=b.current;if(e){var t=e.getContext("webgl");if(t){var r=e.getBoundingClientRect();e.width=r.width,e.height=r.height;var i=function(e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS),n},o=t.createProgram(),s=i("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),a=i("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(o,s),t.attachShader(o,a),t.linkProgram(o),t.useProgram(o);var c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var u=t.getAttribLocation(o,"aPos");t.enableVertexAttribArray(u),t.vertexAttribPointer(u,2,t.FLOAT,!1,0,0);var d=t.getUniformLocation(o,"uTime"),f=t.getUniformLocation(o,"uResolution"),h=t.getUniformLocation(o,"uColor1"),p=t.getUniformLocation(o,"uColor2"),g=t.getUniformLocation(o,"uColor3"),v=t.getUniformLocation(o,"uColor4"),y=Al[n].colors;t.uniform2f(f,r.width,r.height),t.uniform3fv(h,y[0]),t.uniform3fv(p,y[1]),t.uniform3fv(g,y[2]),t.uniform3fv(v,y[3]);var x=0,w=function(){m.current=requestAnimationFrame(w),x+=.015*l,t.uniform1f(d,x),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return w(),function(){m.current&&cancelAnimationFrame(m.current),t.deleteProgram(o),t.deleteBuffer(c)}}}},[n,l]),u.jsxs("div",{onClick:d,className:"relative overflow-hidden ".concat(o),style:f,"data-gradient-id":(null===(t=Al[n])||void 0===t?void 0:t.id)||"unknown_gradient",children:[u.jsx("canvas",{ref:b,className:"absolute inset-0 z-0",style:{width:p,height:p}}),s&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:s})]})},Sl=function(){var e=Pu(),t=io(function(e){return e.config.appearance}),r=[Ou.Shield,Ou.Key,Ou.Wallet,Ou.Chip];return u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[u.jsx(El,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-[264px] bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:u.jsx("div",{className:"bluxcc:marquee_outer",children:u.jsx("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:k(k(k(k([],r,!0),r,!0),r,!0),r,!0).map(function(e,r){return u.jsx("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-[82px] bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:u.jsx(Bu,{name:e,props:{fill:"#fff"}})},r)})})})}),u.jsx("p",{className:"bluxcc:text-2xl bluxcc:mt-[26px] bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),u.jsx("p",{className:"bluxcc:text-sm text-center",children:e("blux_gateway")})]})},_l=function(){var e=Pu(),t=a.useState({address:""}),r=t[0],n=t[1],i=a.useState({});i[0];var o,s=i[1],c={logo:u.jsx(Bu,{name:Ou.Stellar,props:{}}),name:"xlm",valueInCurrency:203},l=io(function(e){return e.config.appearance});return u.jsxs("div",{children:[u.jsx(Ju,{autoFocus:!0,type:"text",label:e("enter_token_address"),placeholder:e("enter_address"),value:r.address,onChange:(o="address",function(e){n(function(t){var r;return N(N({},t),((r={})[o]=e.target.value,r))}),s(function(e){var t;return N(N({},e),((t={})[o]="",t))})}),onButtonClick:function(){},button:u.jsx("span",{style:{color:l.accentColor},className:"bluxcc:flex bluxcc:justify-between",children:e("check")})}),u.jsx("div",{className:"bluxcc:h-56 bluxcc:my-4",style:{borderRadius:l.borderRadius,border:"".concat(l.borderWidth," solid ").concat(l.borderColor)},children:u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[u.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:l.borderColor,borderWidth:l.borderWidth},children:c.logo}),c.name,u.jsx("div",{className:"bluxcc:flex bluxcc:flex-col",children:u.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:l.accentColor},children:["$",Bc(c.valueInCurrency)]})})]})}),u.jsx(Uu,{}),u.jsxs("div",{className:"bluxcc:flex bluxcc:gap-4",children:[u.jsx(Ku,{state:"disabled",variant:"outline",children:e("cancel")}),u.jsx(Ku,{state:"enabled",variant:"fill",size:"large",children:e("add_token")})]})]})},Il=function(e){return C(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a;return T(this,function(c){switch(c.label){case 0:if(!(t=e.signMessage))return e.setRoute(g.FAILED),[2];if(e.setRoute(g.WAITING),!e.user)return e.setRoute(g.FAILED),[2];if(r=e.user,n=r.authMethod,i=r.authValue,"wallet"!==n)return e.setRoute(g.FAILED),[2];if(!(o=pc[i]))return e.setRoute(g.FAILED),[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,$c(o,t.message,null===(a=e.user)||void 0===a?void 0:a.address,t.options.network)];case 2:return s=c.sent(),e.setSignMessage(N(N({},t),{result:s}),!0,g.WAITING),setTimeout(function(){e.setRoute(g.SUCCESSFUL)},400),[3,4];case 3:return c.sent(),setTimeout(function(){e.setRoute(g.FAILED)},200),[3,4];case 4:return[2]}})})},Nl=function(){var e,t,r=Pu(),n=io(function(e){return e}),i=n.config.appearance,o=n.signMessage;if(!o)return null;return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[u.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),r("sign_permission")]}),u.jsx("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(i.borderWidth," solid ").concat(i.borderColor),borderRadius:i.borderRadius},children:o.message}),u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:i.borderRadius,borderColor:i.borderColor},children:[u.jsx("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:r("yourWallet")})}),u.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:i.borderRadius,backgroundColor:i.fieldBackground,color:i.textColor},children:u.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Rc(i.textColor,.8))},children:(null===(e=n.user)||void 0===e?void 0:e.address)?Lc(null===(t=n.user)||void 0===t?void 0:t.address,5):r("noAddressFound")})})]}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",state:"enabled",variant:"fill",onClick:function(){return C(void 0,void 0,void 0,function(){return T(this,function(e){return Il(n),[2]})})},children:r("approve")})]})},Ml=function(){var e,t,r=Pu(),n=io(function(e){return e});return u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:u.jsx(Bu,{name:Ou.RedExclamation,props:{}})}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:"login"===n.waitingStatus?r("loginFailed"):r("signingFailed",{walletName:null!==(t=null===(e=n.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),u.jsx("p",{className:"bluxcc:text-sm",children:"login"===n.waitingStatus?r("loginRetryMessage"):r("signingRetryMessage")})]}),u.jsx(Uu,{}),u.jsx(Ku,{onClick:function(){var e;"signMessage"===n.waitingStatus?Il(n):"sendTransaction"===n.waitingStatus?yl(n):"login"===n.waitingStatus&&ol(n,pc[(null===(e=n.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:r("tryAgain")})]})},Cl=function(){var e=Pu(),t=io(function(e){return e}),r=t.config.appearance;a.useEffect(function(){C(void 0,void 0,void 0,function(){return T(this,function(e){return ol(t,pc[b.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var n=t.walletConnect.connection.uri;return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.fieldBackground,borderWidth:r.borderWidth},children:[u.jsx(ul,{size:184,value:n,bgColor:r.fieldBackground,fgColor:r.accentColor,level:"Q",imgSize:40}),u.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:r.background},children:u.jsx(Bu,{name:Ou.WalletConnect,props:{fill:r.accentColor,background:r.fieldBackground}})})]}),u.jsx("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:u.jsx("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",state:"enabled",variant:"tonal",style:{color:r.accentColor},onClick:function(){return function(r){Sc(r),t.setAlert("copy",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(n)},children:"Copy URI"})]})},Tl=function(){var e,t=Pu(),r=a.useState(!1),n=r[0],i=r[1],o=a.useState(""),s=o[0],c=o[1],l=io(function(e){return e}),d=a.useState(null),f=d[0],h=d[1],p=l.config.appearance,b=l.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),m=0!==(e=b).length?e:[R],g=function(){return n?p.accentColor:p.borderColor};return u.jsxs("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[u.jsx("div",{children:u.jsxs("div",{onFocus:function(){return i(!0)},onBlur:function(){return i(!1)},onMouseEnter:function(e){n||(e.currentTarget.style.borderColor=p.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){n||(e.currentTarget.style.borderColor=p.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:p.fieldBackground,borderWidth:p.borderWidth,"--tw-ring-color":g(),borderRadius:p.borderRadius,borderColor:g(),color:p.textColor},children:[u.jsx(Bu,{name:Ou.Search,props:{fill:p.textColor}}),u.jsx("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:t("search"),value:s,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{fontFamily:p.fontFamily,color:p.textColor}})]})}),u.jsxs("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto overflowStyle bluxcc:max-h-[300px]",children:[m.map(function(e,t){return u.jsxs("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,r="sendAsset";"swapTo"===l.selectAsset.field?r="swapToAsset":"swapFrom"===l.selectAsset.field&&(r="swapFromAsset"),l.setSelectAsset(N(N({},l.selectAsset),((t={})[r]=e,t)));var n=_c(l.selectAsset.field);l.setRoute(n)}(e)},onMouseEnter:function(){return h(t)},onMouseLeave:function(){return h(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:f===t?p.fieldBackground:"transparent",color:p.textColor,borderBottomStyle:"dashed",borderBottomWidth:t<m.length-1?p.borderWidth:"0px",borderBottomColor:p.borderColor,transition:"all 0.2s ease-in-out",fontFamily:p.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[u.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:p.borderRadius,background:p.fieldBackground,border:"".concat(p.borderWidth," solid ").concat(p.borderColor)},children:"native"===e.assetType?u.jsx(Bu,{name:Ou.Stellar,props:{fill:Ic(p.fieldBackground)}}):u.jsx(Bu,{name:Ou.QuestionMark,props:{fill:Ic(p.fieldBackground)}})}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),u.jsx("span",{className:"bluxcc:text-xs",style:{color:Rc(p.textColor,.7)},children:e.assetCode})]})]}),u.jsx("span",{className:"bluxcc:font-medium",children:Bc(e.assetBalance)})]},e.assetType+e.assetIssuer)}),0===m.length&&u.jsx("div",{style:{color:p.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:t("noAssetsFound")})]})]})};function kl(){return u.jsx(ll,{})}function Rl(){var e,t=io(function(e){return e}),r=t.config.appearance,n=null===(e=t.user)||void 0===e?void 0:e.address,i=n?"https://buy.moonpay.com?".concat(new URLSearchParams({currencyCode:"xlm",network:"stellar",walletAddress:n}).toString()):void 0,o=[{id:"moonpay",logo:Ou.Globe,title:"Moonpay",description:i?"Buy XLM instantly with card or bank transfer.":"Connect a wallet address to continue with MoonPay.",url:i,disabled:!i},{id:"crypto",logo:Ou.Receive,title:"Get fund by crypto",description:"Receive XLM directly from another wallet.",route:g.FUND_ME_CRYPTO}];return u.jsxs("div",{className:"bluxcc:w-full bluxcc:space-y-3",children:[u.jsxs("div",{className:"bluxcc:space-y-1 bluxcc:px-4 bluxcc:py-3",style:{fontFamily:r.fontFamily,borderRadius:r.borderRadius,borderColor:r.borderColor,borderWidth:r.borderWidth,background:"linear-gradient(135deg, ".concat(Rc(r.accentColor,.12),", ").concat(r.fieldBackground,")")},children:[u.jsx("p",{className:"bluxcc:text-base bluxcc:font-semibold bluxcc:leading-5 bluxcc:select-none",style:{color:r.textColor},children:"Top up your wallet"}),u.jsx("p",{className:"bluxcc:text-sm bluxcc:leading-4 bluxcc:select-none",style:{color:Rc(r.textColor,.72)},children:"Choose a funding method to add XLM quickly and safely."})]}),u.jsx("div",{className:"bluxcc:space-y-2",children:o.map(function(e){return u.jsxs("button",{type:"button",id:"bluxcc-button",disabled:e.disabled,onClick:function(){return function(e){e.disabled||(e.url?window.open(e.url,"_blank","noopener,noreferrer"):e.route&&t.openModal(e.route))}(e)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:gap-3 bluxcc:px-3 bluxcc:py-3 bluxcc:text-left bluxcc:transition-all bluxcc:duration-300",style:{opacity:e.disabled?.65:1,fontFamily:r.fontFamily,borderRadius:r.borderRadius,borderColor:r.borderColor,borderWidth:r.borderWidth,backgroundColor:r.fieldBackground,color:r.textColor},children:[u.jsx("span",{className:"bluxcc:flex bluxcc:size-11 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-xl",style:{background:Rc(r.accentColor,.12)},children:u.jsx(Bu,{name:e.logo,props:{fill:r.accentColor}})}),u.jsxs("span",{className:"bluxcc:flex bluxcc:min-w-0 bluxcc:flex-1 bluxcc:flex-col",children:[u.jsx("span",{className:"bluxcc:text-base bluxcc:font-medium bluxcc:leading-5 bluxcc:select-none",children:e.title}),u.jsx("span",{className:"bluxcc:text-sm bluxcc:leading-4 bluxcc:select-none",style:{color:Rc(r.textColor,.72)},children:e.description})]}),u.jsx("span",{className:"bluxcc:flex bluxcc:size-8 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:Rc(r.textColor,.08)},children:u.jsx(Bu,{name:Ou.ArrowRight,props:{fill:Rc(r.textColor,.75)}})})]},e.id)})}),u.jsx("p",{className:"bluxcc:px-1 bluxcc:text-xs bluxcc:leading-4 bluxcc:select-none",style:{fontFamily:r.fontFamily,color:Rc(r.textColor,.62)},children:"Third-party providers may charge separate fees based on payment method and region."})]})}var Bl=function(){var e,t,r=Pu(),n=io(function(e){return e}),i=n.config.appearance,o=[],s=null===(e=n.apiResponse)||void 0===e?void 0:e.terms,a=null===(t=n.apiResponse)||void 0===t?void 0:t.privacyPolicy;s&&o.push({id:"terms",logo:Ou.Shield,title:r("termsOfService"),subtitle:r("openLink"),url:s}),a&&o.push({id:"privacy",logo:Ou.Globe,title:r("privacyPolicy"),subtitle:r("openLink"),url:a});return u.jsxs("div",{className:"bluxcc:mt-1 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Rc(i.accentColor,.12)},children:u.jsx(Bu,{name:Ou.Shield,props:{fill:i.accentColor}})}),u.jsxs("div",{className:"bluxcc:mb-4 bluxcc:w-full bluxcc:space-y-1 bluxcc:text-center",children:[u.jsx("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:r("acceptTermsAndPrivacy")}),u.jsx("p",{className:"bluxcc:text-sm bluxcc:leading-5",style:{color:Rc(i.textColor,.76)},children:r("reviewAndAcceptPrompt")})]}),u.jsx("div",{className:"bluxcc:w-full bluxcc:space-y-2",children:o.map(function(e){return u.jsxs("button",{type:"button",id:"bluxcc-button",onClick:function(){return t=e.url,void window.open(t,"_blank","noopener,noreferrer");var t},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:gap-3 bluxcc:px-3 bluxcc:py-3 bluxcc:text-left bluxcc:transition-colors bluxcc:duration-300",style:{borderRadius:i.borderRadius,borderColor:i.borderColor,borderWidth:i.borderWidth,backgroundColor:i.fieldBackground,fontFamily:i.fontFamily},children:[u.jsx("span",{className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-xl",style:{background:Rc(i.accentColor,.1)},children:u.jsx(Bu,{name:e.logo,props:{fill:i.accentColor}})}),u.jsxs("span",{className:"bluxcc:flex bluxcc:flex-1 bluxcc:flex-col bluxcc:items-start",children:[u.jsx("span",{className:"bluxcc:text-base bluxcc:font-medium",children:e.title}),u.jsx("span",{className:"bluxcc:text-sm",style:{color:Rc(i.textColor,.7)},children:e.subtitle})]}),u.jsx(Bu,{name:Ou.ArrowRight,props:{fill:Rc(i.textColor,.65)}})]},e.id)})}),0===o.length&&u.jsx("p",{className:"bluxcc:mt-2 bluxcc:text-center bluxcc:text-sm",style:{color:Rc(i.textColor,.75)},children:r("noLegalLinksProvided")}),u.jsx(Uu,{}),u.jsx(Ku,{size:"large",variant:"fill",state:"enabled",onClick:function(){!function(){var e=eo();e.setIsAuthenticated(!0),e.closeModal(),tl();var t=eo();t.user&&t.emitter.emit(exports.BluxEvent.LoggedIn,{user:t.user})}()},children:r("iAgree")})]})},Ol=function(){var e=io(function(e){return e}),t=function(){var e,t,r=io(function(e){return e}),n=a.useState({error:null,loading:!0,balances:[]}),i=n[0],o=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return a.useEffect(function(){o({error:null,loading:!0,balances:[]}),bu({address:s}).then(function(e){o({error:null,loading:!1,balances:e})}).catch(function(e){o({error:e,loading:!1,balances:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),r=function(){var e,t,r=io(function(e){return e}),n=a.useState({error:null,loading:!0,transactions:[]}),i=n[0],o=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return a.useEffect(function(){o({error:null,loading:!0,transactions:[]}),vu({limit:5,order:"desc",forAccount:s}).then(function(e){for(var t=e.response,r=[],n=0,i=t.records;n<i.length;n++){var s=i[n];r.push(s.operations())}Promise.all(r).then(function(e){var r=t.records.map(function(t,r){return N(N({},t),{operations:e[r].records})});o({error:null,loading:!1,transactions:r})})}).catch(function(e){o({error:e,loading:!1,transactions:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),n=function(){e.setBalances(t),e.setTransactions(r),i()},i=function(){var r=t.balances,n=r.find(function(e){return"native"===e.asset_type});if(e.modal.route!==g.SEND&&e.modal.route!==g.SWAP&&e.modal.route!==g.SELECT_ASSET&&0!==r.length&&n){var i=Ac(n);r.length>1&&(i=Ac(r[1])),e.setSelectAsset(N(N({},e.selectAsset),{swapToAsset:i,sendAsset:Ac(n),swapFromAsset:Ac(n)}))}};a.useEffect(function(){n();var e=setInterval(function(){n()},1e4);return function(){clearInterval(e)}},[t,r,e.modal.route])},jl=function(){var t,r,n;Ol();var i=io(function(e){return e});!function(e){var t,r,n=a.useState(!1),i=n[0],o=n[1];a.useEffect(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?kc(pc[e.user.authValue]).then(function(t){var r;t&&e.config.networks.includes(t)&&(null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork)!==t&&!e.networkSyncDisabled?hu(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),o(!0)):o(!1)}).catch(function(){o(!1)}):o(!1)},1e3);return function(){clearInterval(t),o(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork]),a.useEffect(function(){e.modal.isOpen?i||e.modal.route!==g.WRONG_NETWORK||e.closeModal():setTimeout(function(){i&&e.config.promptOnWrongNetwork?e.openModal(g.WRONG_NETWORK):e.closeModal()},300)},[i,e.modal.isOpen])}(i);var o=i.modal,s=i.closeModal,c=i.setShowAllWallets,l=o.route,d=function(){var e;return(e={})[g.ONBOARDING]={title:"logInOrSignUp",Component:u.jsx(cl,{})},e[g.PROFILE]={title:"profile",Component:u.jsx($u,{})},e[g.WAITING]={title:"",Component:u.jsx(Vu,{})},e[g.SUCCESSFUL]={title:"",Component:u.jsx(il,{})},e[g.FAILED]={title:"",Component:u.jsx(Ml,{})},e[g.SEND_TRANSACTION]={title:"confirmation",Component:u.jsx(xl,{})},e[g.SEND]={title:"send",Component:u.jsx(Qu,{})},e[g.ACTIVITY]={title:"activity",Component:u.jsx(gl,{})},e[g.RECEIVE]={title:"receive",Component:u.jsx(ll,{})},e[g.SWAP]={title:"swap",Component:u.jsx(Yu,{})},e[g.BALANCES]={title:"balances",Component:u.jsx(pl,{})},e[g.BALANCE_DETAILS]={title:"",Component:u.jsx(wl,{})},e[g.OTP]={title:"",Component:u.jsx(nl,{})},e[g.WRONG_NETWORK]={title:"",Component:u.jsx(dl,{})},e[g.ABOUT]={title:"whatIsBlux",Component:u.jsx(Sl,{})},e[g.ADD_TOKEN]={title:"addToken",Component:u.jsx(_l,{})},e[g.SIGN_MESSAGE]={title:"signMessage",Component:u.jsx(Nl,{})},e[g.SELECT_ASSET]={title:"selectAsset",Component:u.jsx(Tl,{})},e[g.WALLET_CONNECT]={title:"walletConnect",Component:u.jsx(Cl,{})},e[g.FUND_ME]={title:"Fund Me",Component:u.jsx(Rl,{})},e[g.FUND_ME_CRYPTO]={title:"Fund Me Crypto",Component:u.jsx(kl,{})},e[g.ACCEPT_TERMS_AND_PRIVACY]={title:"acceptTermsAndPrivacy",Component:u.jsx(Bl,{})},e}()[l],f=l===g.WRONG_NETWORK,h=l===g.WAITING,p=l===g.SUCCESSFUL,b=l===g.SIGN_MESSAGE||l===g.SEND_TRANSACTION||l===g.FAILED,m=l===g.WRONG_NETWORK||h||p,v=h&&"sendTransaction"!==i.waitingStatus||l===g.ONBOARDING&&i.showAllWallets||[g.ACTIVITY,g.SEND,g.OTP,g.BALANCES,g.RECEIVE,g.SWAP,g.BALANCE_DETAILS,g.ABOUT,g.ADD_TOKEN,g.WALLET_CONNECT].includes(l)?"back":l===g.ONBOARDING?"info":void 0,y=i.modal.dynamicTitle||d.title,x=function(){if(!f){s(),c(!1);var e=i.waitingStatus,t="signMessage"===e,r="sendTransaction"===e;if(tl(),t||r){var n=t?i.signMessage:i.sendTransaction;if(n){var o=n.resolver,a=n.rejecter,u=n.result;p&&o&&u?(o(u),setTimeout(function(){i.cleanUp(e)},200)):b&&a&&(a("User rejected the transaction"),setTimeout(function(){i.cleanUp(e)},200))}}}};return a.useEffect(function(){i.authState.isAuthenticated||(i.signMessage&&(i.cleanUp("signMessage"),i.signMessage.rejecter("User logged out during the process.")),i.sendTransaction&&(i.cleanUp("sendTransaction"),i.sendTransaction.rejecter("User logged out during the process.")))},[i.authState]),a.useEffect(function(){var t,r,n,o=Tc((null===(t=i.stellar)||void 0===t?void 0:t.activeNetwork)||"",null!==(r=i.config.transports)&&void 0!==r?r:{}),s=o.horizon,a=o.soroban;i.setStellar({activeNetwork:(null===(n=i.stellar)||void 0===n?void 0:n.activeNetwork)||"",servers:{horizon:new e.Horizon.Server(s),soroban:new e.rpc.Server(a)}})},[i.config.transports,i.config.networks,null===(t=i.stellar)||void 0===t?void 0:t.activeNetwork]),u.jsxs(Ru,{isOpen:o.isOpen,isSticky:f||i.config.isPersistent,onClose:x,isPersistent:null!==(r=i.config.isPersistent)&&void 0!==r&&r,appearance:i.config.appearance,children:[u.jsx(Fu,{icon:v,onBack:function(){if(l===g.WAITING||l===g.OTP&&!i.authState.isAuthenticated||l===g.ABOUT||l===g.WALLET_CONNECT)i.setRoute(g.ONBOARDING);else if(i.showAllWallets)c(!1);else if([g.SEND,g.ACTIVITY,g.BALANCES,g.RECEIVE,g.SWAP].includes(l))i.setRoute(g.PROFILE);else if([g.BALANCE_DETAILS,g.ADD_TOKEN].includes(l))i.setRoute(g.BALANCES);else if(l===g.SELECT_ASSET){var e=_c(i.selectAsset.field);i.setRoute(e)}},onInfo:function(){i.setRoute(g.ABOUT)},onClose:x,title:y,closeButton:!m,isPersistent:null!==(n=i.config.isPersistent)&&void 0!==n&&n}),d.Component]})};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-radius-xl:0.75rem;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-3{bottom:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-40{z-index:40!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-1\\.25{margin-block:calc(var(--bluxcc-spacing)*1.25)!important}.bluxcc\\:my-2,.bluxcc\\:my-2\\!{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-22{margin-top:calc(var(--bluxcc-spacing)*22)!important}.bluxcc\\:mt-\\[26px\\]{margin-top:26px!important}.bluxcc\\:mr-0\\.5{margin-right:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2,.bluxcc\\:mr-2\\!{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-4{margin-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-11{height:calc(var(--bluxcc-spacing)*11)!important;width:calc(var(--bluxcc-spacing)*11)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-17{height:calc(var(--bluxcc-spacing)*17)!important;width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-52{height:calc(var(--bluxcc-spacing)*52)!important;width:calc(var(--bluxcc-spacing)*52)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:size-\\[82px\\]{height:82px!important;width:82px!important}.bluxcc\\:size-\\[264px\\]{height:264px!important;width:264px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-56{height:calc(var(--bluxcc-spacing)*56)!important}.bluxcc\\:h-78{height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-78{max-height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:max-h-81{max-height:calc(var(--bluxcc-spacing)*81)!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-17\\!{width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-25{width:calc(var(--bluxcc-spacing)*25)!important}.bluxcc\\:w-73{width:calc(var(--bluxcc-spacing)*73)!important}.bluxcc\\:w-90\\!{width:calc(var(--bluxcc-spacing)*90)!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-22\\.5{max-width:calc(var(--bluxcc-spacing)*22.5)!important}.bluxcc\\:max-w-45{max-width:calc(var(--bluxcc-spacing)*45)!important}.bluxcc\\:max-w-46{max-width:calc(var(--bluxcc-spacing)*46)!important}.bluxcc\\:min-w-0{min-width:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:items-start{align-items:flex-start!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1,.bluxcc\\:gap-1\\!{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:gap-4{gap:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-3{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-xl{border-radius:var(--bluxcc-radius-xl)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-\\[\\#00D66E33\\]{background-color:#00d66e33!important}.bluxcc\\:bg-\\[\\#005DF333\\]{background-color:#005df333!important}.bluxcc\\:bg-\\[\\#D6000033\\]{background-color:#d6000033!important}.bluxcc\\:bg-\\[\\#FA8F0233\\]{background-color:#fa8f0233!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-1{padding-inline:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3,.bluxcc\\:px-3\\!{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:py-1,.bluxcc\\:py-1\\!{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pt-4\\.25{padding-top:calc(var(--bluxcc-spacing)*4.25)!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm,.bluxcc\\:text-sm\\!{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs,.bluxcc\\:text-xs\\!{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:leading-4,.bluxcc\\:leading-4\\!{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .3s ease-in-out}@keyframes marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var Ll=!1,Pl=null,Fl=null,Ul=function(e){void 0===e&&(e=document.body),Ll&&Pl&&Fl&&Fl.contains(Pl)&&Fl.removeChild(Pl),Fl=e,Pl=document.createElement("div"),e.appendChild(Pl),c.createRoot(Pl).render(a.createElement(jl))};C(void 0,void 0,void 0,function(){var e,t,r,n;return T(this,function(i){switch(i.label){case 0:if((e=eo().logos)&&e.length>0)return[2];i.label=1;case 1:return i.trys.push([1,6,,7]),[4,C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,au()];case 1:return e=r.sent(),[4,uu(e)];case 2:return[2,(t=r.sent()).length?t:null];case 3:return r.sent(),[2,null];case 4:return[2]}})})];case 2:return(t=i.sent())?(eo().setLogos(t),iu(),[2]):[4,nu()];case 3:return r=i.sent(),eo().setLogos(r),[4,au()];case 4:return n=i.sent(),[4,cu(n,r)];case 5:case 6:return i.sent(),[3,7];case 7:return[2]}})}),C(void 0,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return eo().authState.isReady?[3,2]:[4,Pc(50)];case 1:return e.sent(),[3,0];case 2:return Jc(!0),[2]}})}),Object.defineProperty(exports,"Asset",{enumerable:!0,get:function(){return e.Asset}}),exports.StellarSdk=y,exports.ToScVal=Mu,exports.blux=tu,exports.createConfig=function(t,r){var n,i;if(Ll=!0,!t||0===Object.keys(t).length)throw new Error("BLUX: createConfig must take a config object");if(!t.appId)throw new Error("BLUX: createConfig config object must have the appId property.");if(!t.appName)throw new Error("BLUX: createConfig config object must have the appName property.");if(!t.networks)throw new Error("BLUX: createConfig config object must have the networks property.");t.lang&&"en"!==t.lang.trim().toLowerCase()&&console.warn("BLUX: Only EN is currently supported. Falling back to default language."),Ul(r);var o=t.excludeWallets||["lobstr"];o=o.map(function(e){return e.toLowerCase()});var s=!0;void 0!==t.promptOnWrongNetwork&&(s=t.promptOnWrongNetwork);var a=N(N(N({},t),{excludeWallets:o,appearance:N(N({},Hi),null==t?void 0:t.appearance),defaultNetwork:"",promptOnWrongNetwork:s,lang:"en",explorer:t.explorer||"stellarchain",loginMethods:t.loginMethods||["wallet"],showWalletUIs:void 0===t.showWalletUIs||t.showWalletUIs}),(null==t?void 0:t.walletConnect)?{walletConnect:t.walletConnect}:{});!function(e,t,r){if(!e||0===e.length)throw new Error("BLUX: No network is set in config.networks.");var n=null!=t?t:e[0];if(!e.includes(n))throw new Error("BLUX: config.defaultNetwork is not listed in config.networks.");for(var i=0,o=e;i<o.length;i++){var s=o[i];if(!(mc[s]||r&&r[s]))throw new Error("BLUX: Must set transports for custom network ".concat(s))}}(t.networks,t.defaultNetwork,t.transports),a.defaultNetwork=null!==(n=t.defaultNetwork)&&void 0!==n?n:t.networks[0];var c,u,l,d,f=Tc(a.defaultNetwork,null!==(i=t.transports)&&void 0!==i?i:{}),h=f.horizon,p=f.soroban,b=eo(),m=b.setConfig,g=b.setWallets,v=b.setIsReady,y=b.setStellar,x=b.setApiResponse;y({activeNetwork:a.defaultNetwork,servers:{horizon:new e.Horizon.Server(h),soroban:new e.rpc.Server(p)}}),m(a),(c=o,new Promise(function(e){"complete"===document.readyState?jc(c).then(function(t){e(t)}):window.addEventListener("load",function(){jc(c).then(function(t){e(t)})})})).then(function(e){var t=e.filter(function(e){return!o.includes(e.name.toLowerCase())});g(t),v(!0)}),t.walletConnect&&(u=t.walletConnect,l=t.appName,C(void 0,void 0,void 0,function(){var e,t,r,n;return T(this,function(i){switch(i.label){case 0:if(sl)return[2];sl=!0,i.label=1;case 1:return i.trys.push([1,4,,5]),e=eo(),t=new _.default({projectId:u.projectId}),[4,I.default.init({core:t,metadata:{name:l,url:u.url,icons:u.icons,description:u.description}})];case 2:return r=i.sent(),e.setWalletConnectClient(r,null),[4,al(r)];case 3:return n=i.sent(),e.setWalletConnectClient(r,n),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}})})),(d=t.appId,C(void 0,void 0,void 0,function(){var e,t;return T(this,function(r){switch(r.label){case 0:if(!d)throw new Error("appId is missing in config.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,wc("".concat(lo,"/auth/validate"),{method:"POST",headers:(t={},t[fo]=d,t)})];case 2:return 200===(e=r.sent()).status?[2,{isValid:!0,message:e.message,terms:e.result.terms,privacyPolicy:e.result.privacy_policy}]:404===e.status?[2,{isValid:!1,message:e.error,terms:"",privacyPolicy:""}]:[2,{isValid:!1,message:"Unexpected response from api.",terms:"",privacyPolicy:""}];case 3:return[2,{isValid:!1,message:"Unexpected response from api. "+r.sent().message,terms:"",privacyPolicy:""}];case 4:return[2]}})})).then(function(e){if(x(e),!e.isValid&&a.loginMethods.includes("email")||a.loginMethods.includes("passkey"))throw new Error("BLUX: config.appId is invalid.")})},exports.events=Tu,exports.getAccount=function(t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:if(lu(),r=du(t.address),n=fu(t.network).horizon,!e.StrKey.isValidEd25519PublicKey(r))throw new Error("Invalid address");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.loadAccount(r)];case 2:return[2,i.sent()];case 3:return i.sent(),[2,null];case 4:return[2]}})})},exports.getAccounts=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("accounts",[],e),e.forSigner&&(t=t.forSigner(e.forSigner)),e.forAsset&&(t=t.forAsset(e.forAsset)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getAssets=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getBalances=bu,exports.getClaimableBalances=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("claimableBalances",[],e),e.asset&&(t=t.asset(e.asset)),e.claimant&&(t=t.claimant(e.claimant)),e.sponsor&&(t=t.sponsor(e.sponsor)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getEffects=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("effects",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getInitialState=Yi,exports.getLedgers=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getLiquidityPools=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("liquidityPools",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getNetwork=function(){var e,t=eo();if(0===t.config.networks.length)throw new Error("getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},exports.getOffers=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("offers",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.buying&&(t=t.buying(e.buying)),e.selling&&(t=t.selling(e.selling)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.seller&&(t=t.seller(e.seller)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getOperations=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("operations",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getOrderbook=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:return lu(),[4,(r=pu("orderbook",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},exports.getPayments=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("payments",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getState=Gi,exports.getStrictReceivePaths=mu,exports.getStrictSendPaths=gu,exports.getTradeAggregation=function(e,t){return C(void 0,void 0,void 0,function(){var r,n;return T(this,function(i){switch(i.label){case 0:return lu(),[4,(r=pu("tradeAggregation",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},exports.getTrades=function(e){return C(void 0,void 0,void 0,function(){var t,r;return T(this,function(n){switch(n.label){case 0:return lu(),t=pu("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(e.forAssetPair[0],e.forAssetPair[1])),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getTransactions=vu,exports.networks=yu,exports.numberish=xu,exports.setAppearance=Cu,exports.subscribe=Xi,exports.switchNetwork=function(e){var t=eo();hu(e),t.setNetworkSyncDisabled(!0)},exports.useExportedStore=function(e){return i.useStore(Vi,e)};
|
|
34
|
+
*/function Ur(){return jr||(jr=1,function(e){const t=function(){if(Cr)return Rr;Cr=1,Rr.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},Rr.toByteArray=function(e){var n,i,s=o(e),a=s[0],c=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),l=0,d=c>0?a-4:a;for(i=0;i<d;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[l++]=n>>16&255,u[l++]=n>>8&255,u[l++]=255&n;return 2===c&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[l++]=255&n),1===c&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[l++]=n>>8&255,u[l++]=255&n),u},Rr.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,c=0,u=n-i;c<u;c+=s)o.push(a(t,c,c+s>u?u:c+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,Rr}(),r=Fr(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let n=o(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);const i=function(e){if(s.isBuffer(e)){const t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),o(e<0?0:0|f(e))}function l(e){const t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,s.prototype),n}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(G(n))return s;e[r+s]=n}return s}function y(e,t,r,n){return V(q(t,e.length-r),e,r,n)}function x(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return V(K(t),e,r,n)}function A(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(H(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=s.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(H(t,Uint8Array))i+t.length>n.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,i){if(H(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const c=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<c;++e)if(u[e]!==l[e]){o=u[e],a=l[e];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function B(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,n,i,o){return t=+t,n>>>=0,o||j(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function L(e,t,n,i,o){return t=+t,n>>>=0,o||j(e,0,n,8),r.write(e,t,n,i,52,8),n+8}s.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),s.prototype.readBigInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=Y(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Y(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=Y(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Y(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=s.isBuffer(e)?e:s.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const P={};function F(e,t,r){P[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new P.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!=typeof e)throw new P.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new P.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const $=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}}(Tr)),Tr}
|
|
35
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function Dr(){if(Lr)return Mr.exports;Lr=1;var e=65536,t=4294967295;var r=(Or||(Or=1,function(e,t){var r=Ur(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(kr,kr.exports)),kr.exports).Buffer,n=oe.crypto||oe.msCrypto;return n&&n.getRandomValues?Mr.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var s=r.allocUnsafe(i);if(i>0)if(i>e)for(var a=0;a<i;a+=e)n.getRandomValues(s.slice(a,a+e));else n.getRandomValues(s);if("function"==typeof o)return process.nextTick(function(){o(null,s)});return s}:Mr.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},Mr.exports}var zr,Wr,$r={};var qr,Kr,Vr,Hr={},Gr="6.6.1",Xr={},Yr={exports:{}},Zr=Yr.exports;function Jr(){return qr||(qr=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Ne.Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?u[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?b+n:u[f-b.length]+b+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],x=8191&y,w=y>>>13,A=0|s[4],E=8191&A,S=A>>>13,_=0|s[5],I=8191&_,N=_>>>13,C=0|s[6],M=8191&C,k=C>>>13,T=0|s[7],R=8191&T,B=T>>>13,j=0|s[8],O=8191&j,L=j>>>13,P=0|s[9],F=8191&P,U=P>>>13,D=0|a[0],z=8191&D,W=D>>>13,$=0|a[1],q=8191&$,K=$>>>13,V=0|a[2],H=8191&V,G=V>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(d,z))|0)+((8191&(i=(i=Math.imul(d,W))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,W))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,W))+Math.imul(b,z)|0,o=Math.imul(b,W);var ge=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,W))+Math.imul(v,z)|0,o=Math.imul(v,W),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,K)|0;var ve=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,W))+Math.imul(w,z)|0,o=Math.imul(w,W),n=n+Math.imul(g,q)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,G)|0;var ye=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,z),i=(i=Math.imul(E,W))+Math.imul(S,z)|0,o=Math.imul(S,W),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var xe=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,z),i=(i=Math.imul(I,W))+Math.imul(N,z)|0,o=Math.imul(N,W),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(M,z),i=(i=Math.imul(M,W))+Math.imul(k,z)|0,o=Math.imul(k,W),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ae=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,W))+Math.imul(B,z)|0,o=Math.imul(B,W),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,z),i=(i=Math.imul(O,W))+Math.imul(L,z)|0,o=Math.imul(L,W),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,z),i=(i=Math.imul(F,W))+Math.imul(U,z)|0,o=Math.imul(U,W),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var _e=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Ie=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(U,H)|0,o=Math.imul(U,G),n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,fe)|0;var Ne=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,Z))+Math.imul(U,Y)|0,o=Math.imul(U,Z),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ce=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var Me=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(M,de)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var ke=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,fe)|0;var Te=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(B,pe)|0))<<13)|0;u=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,fe))+Math.imul(U,de)|0,o=Math.imul(U,fe);var Be=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var je=(u+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,be))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,be))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=xe,c[5]=we,c[6]=Ae,c[7]=Ee,c[8]=Se,c[9]=_e,c[10]=Ie,c[11]=Ne,c[12]=Ce,c[13]=Me,c[14]=ke,c[15]=Te,c[16]=Re,c[17]=Be,c[18]=je,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,f=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=d*m-f*g;g=d*g+f*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*d-u*f,f=c*f+u*d,d=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,n,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)n[s]=0;r(0===o),r(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=n;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,s=e.length+n;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,c=n.length-o.length;if("mod"!==t){(a=new i(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(o,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(d)),o.iushrn(1),s.iushrn(1);for(var p=0,b=1;0===(n.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(c)):(n.isub(t),a.isub(o),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,g),n(x,g),n(w,g),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();r(m<p);var g=this.pow(d,new i(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},n(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Yr,Zr)),Yr.exports}function Qr(){if(Vr)return Kr;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return Vr=1,Kr=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},Kr}var en,tn,rn={};function nn(){return en||(en=1,function(){var e=rn;function t(e){return 1===e.length?"0"+e:e}function r(e){for(var r="",n=0;n<e.length;n++)r+=t(e[n].toString(16));return r}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},e.zero2=t,e.toHex=r,e.encode=function(e,t){return"hex"===t?r(e):e}}()),rn}function on(){return tn||(tn=1,function(){var e=Xr,t=Jr(),r=Qr(),n=nn();e.assert=r,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode,e.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,s=e.clone();for(n=0;n<i.length;n++){var a,c=s.andln(o-1);s.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,s.isubn(a)):a=0,i[n]=a,s.iushrn(1)}return i},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c:0,r[0].push(s),a=1&u?3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u:0,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),Xr}var sn,an={exports:{}};function cn(){if(sn)return an.exports;var e;function t(e){this.rand=e}if(sn=1,an.exports=function(r){return e||(e=new t(null)),e.generate(r)},an.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=Ne;if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return an.exports}var un,ln,dn={};function fn(){if(ln)return un;ln=1;var e=Jr(),t=on(),r=t.getNAF,n=t.getJSF,i=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}return un=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var n=e._getDoubles(),o=r(t,1,this._bitLength),s=(1<<n.step+1)-(n.step%2==0?2:1);s/=3;var a,c,u=[];for(a=0;a<o.length;a+=n.step){c=0;for(var l=a+n.step-1;l>=a;l--)c=(c<<1)+o[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a<u.length;a++)(c=u[a])===h?f=f.mixedAdd(n.points[a]):c===-h&&(f=f.mixedAdd(n.points[a].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var n=4,o=e._getNAFPoints(n);n=o.wnd;for(var s=o.points,a=r(t,n,this._bitLength),c=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=a[u];i(0!==d),c="affine"===e.type?d>0?c.mixedAdd(s[d-1>>1]):c.mixedAdd(s[-d-1>>1].neg()):d>0?c.add(s[d-1>>1]):c.add(s[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},o.prototype._wnafMulAdd=function(e,t,i,o,s){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<o;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=o-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=n(i[b],i[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var x=0|y[0][c],w=0|y[1][c];f[b][c]=v[3*(x+1)+(w+1)],f[m][c]=0,d[b]=g}}else f[b]=r(i[b],l[b],this._bitLength),f[m]=r(i[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var _=!0;for(c=0;c<o;c++)E[c]=0|f[c][a],0!==E[c]&&(_=!1);if(!_)break;S++,a--}if(a>=0&&S++,A=A.dblp(S),a<0)break;for(c=0;c<o;c++){var I=E[c];0!==I&&(I>0?u=d[c][I-1>>1]:I<0&&(u=d[c][-I-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(a=0;a<o;a++)d[a]=null;return s?A:A.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},s.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},un}var hn,pn,bn,mn,gn,vn,yn,xn,wn={exports:{}};function An(){return hn||(hn=1,"function"==typeof Object.create?wn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:wn.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),wn.exports}function En(){return xn||(xn=1,function(e){var t=e;t.base=fn(),t.short=function(){if(bn)return pn;bn=1;var e=on(),t=Jr(),r=An(),n=fn(),i=e.assert;function o(e){n.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(e,r,i,o){n.BasePoint.call(this,e,"affine"),null===r&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(e,r,i,o){n.BasePoint.call(this,e,"jacobian"),null===r&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,n),pn=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,n;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)n=new t(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?n=s[0]:(n=s[1],i(0===this.g.mul(n).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(n)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),n=new t(2).toRed(r).redInvm(),i=n.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(n);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,n,i,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new t(1),b=new t(0),m=new t(0),g=new t(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var x=g.sub(y.mul(b));if(!i&&u.cmp(d)<0)r=c.neg(),n=p,i=u.neg(),o=l;else if(i&&2===++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=x}s=u.neg(),a=l;var w=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(w)>=0&&(s=r,a=n),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},r(s,n.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},s.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},s.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},s.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},s.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(a,n.BasePoint),o.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},a.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},a.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)},a.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},a.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},a.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},pn}(),t.mont=function(){if(gn)return mn;gn=1;var e=Jr(),t=An(),r=fn(),n=on();function i(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,n,i){r.BasePoint.call(this,t,"projective"),null===n&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(n,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r),mn=i,i.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},t(o,r.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(n.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mn}(),t.edwards=function(){if(yn)return vn;yn=1;var e=on(),t=Jr(),r=An(),n=fn(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,n.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,r,i,o,s){n.BasePoint.call(this,e,"projective"),null===r&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=s&&new t(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,n),vn=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(e,a)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},r(s,n.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new s(this,e,t,r,n)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)},s.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)},s.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,vn}()}(dn)),dn}var Sn,_n,In={},Nn={},Cn={},Mn={exports:{}};function kn(){if(_n)return Cn;_n=1;var e=Qr(),t=(Sn||(Sn=1,"function"==typeof Object.create?Mn.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Mn.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}),Mn.exports);function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function n(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return Cn.inherits=t,Cn.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[i++]=s:s<2048?(n[i++]=s>>6|192,n[i++]=63&s|128):r(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[i++]=s>>18|240,n[i++]=s>>12&63|128,n[i++]=s>>6&63|128,n[i++]=63&s|128):(n[i++]=s>>12|224,n[i++]=s>>6&63|128,n[i++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},Cn.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t},Cn.htonl=n,Cn.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var s=e[i];"little"===t&&(s=n(s)),r+=o(s.toString(16))}return r},Cn.zero2=i,Cn.zero8=o,Cn.join32=function(t,r,n,i){var o=n-r;e(o%4==0);for(var s=new Array(o/4),a=0,c=r;a<s.length;a++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=u>>>0}return s},Cn.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},Cn.rotr32=function(e,t){return e>>>t|e<<32-t},Cn.rotl32=function(e,t){return e<<t|e>>>32-t},Cn.sum32=function(e,t){return e+t>>>0},Cn.sum32_3=function(e,t,r){return e+t+r>>>0},Cn.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},Cn.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},Cn.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},Cn.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},Cn.sum64_lo=function(e,t,r,n){return t+n>>>0},Cn.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},Cn.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},Cn.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+i+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},Cn.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},Cn.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},Cn.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Cn.shr64_hi=function(e,t,r){return e>>>r},Cn.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Cn}var Tn,Rn={};function Bn(){if(Tn)return Rn;Tn=1;var e=kn(),t=Qr();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return Rn.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n},Rn}var jn,On,Ln,Pn,Fn,Un,Dn,zn,Wn,$n,qn,Kn,Vn={},Hn={};function Gn(){if(jn)return Hn;jn=1;var e=kn().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function n(e,t,r){return e^t^r}return Hn.ft_1=function(e,i,o,s){return 0===e?t(i,o,s):1===e||3===e?n(i,o,s):2===e?r(i,o,s):void 0},Hn.ch32=t,Hn.maj32=r,Hn.p32=n,Hn.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},Hn.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},Hn.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},Hn.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},Hn}function Xn(){if(Fn)return Pn;Fn=1;var e=kn(),t=Bn(),r=Gn(),n=Qr(),i=e.sum32,o=e.sum32_4,s=e.sum32_5,a=r.ch32,c=r.maj32,u=r.s0_256,l=r.s1_256,d=r.g0_256,f=r.g1_256,h=t.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(b,h),Pn=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,h=0;h<16;h++)r[h]=e[t+h];for(;h<r.length;h++)r[h]=o(f(r[h-2]),r[h-7],d(r[h-15]),r[h-16]);var p=this.h[0],b=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],x=this.h[6],w=this.h[7];for(n(this.k.length===r.length),h=0;h<r.length;h++){var A=s(w,l(v),a(v,y,x),this.k[h],r[h]),E=i(u(p),c(p,b,m));w=x,x=y,y=v,v=i(g,A),g=m,m=b,b=p,p=i(A,E)}this.h[0]=i(this.h[0],p),this.h[1]=i(this.h[1],b),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],v),this.h[5]=i(this.h[5],y),this.h[6]=i(this.h[6],x),this.h[7]=i(this.h[7],w)},b.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Pn}function Yn(){if(Wn)return zn;Wn=1;var e=kn(),t=Bn(),r=Qr(),n=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,s=e.shr64_lo,a=e.sum64,c=e.sum64_hi,u=e.sum64_lo,l=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function g(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function v(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function y(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function x(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function w(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function S(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function _(e,t){var r=n(e,t,1)^n(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=i(e,t,1)^i(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=n(e,t,19)^n(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=i(e,t,19)^i(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(m,p),zn=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=N(r[n-4],r[n-3]),o=C(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=_(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),f=r[n-32],h=r[n-31];r[n]=l(i,o,s,a,c,u,f,h),r[n+1]=d(i,o,s,a,c,u,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,i=this.h[0],o=this.h[1],s=this.h[2],l=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],m=this.h[7],_=this.h[8],I=this.h[9],N=this.h[10],C=this.h[11],M=this.h[12],k=this.h[13],T=this.h[14],R=this.h[15];r(this.k.length===n.length);for(var B=0;B<n.length;B+=2){var j=T,O=R,L=E(_,I),P=S(_,I),F=g(_,I,N,C,M),U=v(_,I,N,C,M,k),D=this.k[B],z=this.k[B+1],W=n[B],$=n[B+1],q=f(j,O,L,P,F,U,D,z,W,$),K=h(j,O,L,P,F,U,D,z,W,$);j=w(i,o),O=A(i,o),L=y(i,o,s,l,d),P=x(i,o,s,l,d,p);var V=c(j,O,L,P),H=u(j,O,L,P);T=M,R=k,M=N,k=C,N=_,C=I,_=c(b,m,q,K),I=u(m,m,q,K),b=d,m=p,d=s,p=l,s=i,l=o,i=c(q,K,V,H),o=u(q,K,V,H)}a(this.h,0,i,o),a(this.h,2,s,l),a(this.h,4,d,p),a(this.h,6,b,m),a(this.h,8,_,I),a(this.h,10,N,C),a(this.h,12,M,k),a(this.h,14,T,R)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},zn}function Zn(){return Kn||(Kn=1,Vn.sha1=function(){if(Ln)return On;Ln=1;var e=kn(),t=Bn(),r=Gn(),n=e.rotl32,i=e.sum32,o=e.sum32_5,s=r.ft_1,a=t.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(u,a),On=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=n(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var u=this.h[0],l=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),b=o(n(u,5),s(p,l,d,f),h,r[a],c[p]);h=f,f=d,d=n(l,30),l=u,u=b}this.h[0]=i(this.h[0],u),this.h[1]=i(this.h[1],l),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},u.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},On}(),Vn.sha224=function(){if(Dn)return Un;Dn=1;var e=kn(),t=Xn();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),Un=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},Un}(),Vn.sha256=Xn(),Vn.sha384=function(){if(qn)return $n;qn=1;var e=kn(),t=Yn();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),$n=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},$n}(),Vn.sha512=Yn()),Vn}var Jn,Qn,ei,ti,ri,ni,ii,oi,si,ai,ci,ui,li,di,fi,hi,pi,bi,mi,gi,vi,yi,xi,wi,Ai,Ei,Si,_i,Ii={};function Ni(){return ti||(ti=1,function(e){var t=e;t.utils=kn(),t.common=Bn(),t.sha=Zn(),t.ripemd=function(){if(Jn)return Ii;Jn=1;var e=kn(),t=Bn(),r=e.rotl32,n=e.sum32,i=e.sum32_3,o=e.sum32_4,s=t.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(a,s),Ii.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var s=this.h[0],a=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=s,y=a,x=b,w=m,A=g,E=0;E<80;E++){var S=n(r(o(s,c(E,a,b,m),e[d[E]+t],u(E)),h[E]),g);s=g,g=m,m=r(b,10),b=a,a=S,S=n(r(o(v,c(79-E,y,x,w),e[f[E]+t],l(E)),p[E]),A),v=A,A=w,w=r(x,10),x=y,y=S}S=i(this.h[1],b,w),this.h[1]=i(this.h[2],m,A),this.h[2]=i(this.h[3],g,v),this.h[3]=i(this.h[4],s,y),this.h[4]=i(this.h[0],a,x),this.h[0]=S},a.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return Ii}(),t.hmac=function(){if(ei)return Qn;ei=1;var e=kn(),t=Qr();function r(t,n,i){if(!(this instanceof r))return new r(t,n,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(n,i))}return Qn=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},Qn}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(Nn)),Nn}function Ci(){return ii||(ii=1,function(e){var t,r=e,n=Ni(),i=En(),o=on().assert;function s(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=s,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=ni?ri:(ni=1,ri={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(In)),In}function Mi(){if(fi)return di;fi=1;var e=Jr(),t=function(){if(si)return oi;si=1;var e=Ni(),t=nn(),r=Qr();function n(e){if(!(this instanceof n))return new n(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),s=t.toArray(e.pers,e.persEnc||"hex");r(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,s)}return oi=n,n.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},n.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},n.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},n.prototype.reseed=function(e,n,i,o){"string"!=typeof n&&(o=i,i=n,n=null),e=t.toArray(e,n),i=t.toArray(i,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},n.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(i=n,n=r,r=null),n&&(n=t.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(n),this._reseed++,t.encode(s,r)},oi}(),r=on(),n=Ci(),i=cn(),o=r.assert,s=function(){if(ci)return ai;ci=1;var e=Jr(),t=on().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return ai=r,r.fromPublic=function(e,t,n){return t instanceof r?t:new r(e,{pub:t,pubEnc:n})},r.fromPrivate=function(e,t,n){return t instanceof r?t:new r(e,{priv:t,privEnc:n})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},ai}(),a=function(){if(li)return ui;li=1;var e=Jr(),t=on(),r=t.assert;function n(t,i){if(t instanceof n)return t;this._importDER(t,i)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function s(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function a(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return ui=n,n.prototype._importDER=function(r,n){r=t.toArray(r,n);var s=new i;if(48!==r[s.place++])return!1;var a=o(r,s);if(!1===a)return!1;if(a+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var c=o(r,s);if(!1===c)return!1;if(128&r[s.place])return!1;var u=r.slice(s.place,c+s.place);if(s.place+=c,2!==r[s.place++])return!1;var l=o(r,s);if(!1===l)return!1;if(r.length!==l+s.place)return!1;if(128&r[s.place])return!1;var d=r.slice(s.place,l+s.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(u),this.s=new e(d),this.recoveryParam=null,!0},n.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=s(r),n=s(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];a(i,r.length),(i=i.concat(r)).push(2),a(i,n.length);var o=i.concat(n),c=[48];return a(c,o.length),c=c.concat(o),t.encode(c,e)},ui}();function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),e instanceof n.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return di=c,c.prototype.keyPair=function(e){return new s(this,e)},c.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},c.prototype.genKeyPair=function(r){r||(r={});for(var n=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||i(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),s=this.n.sub(new e(2));;){var a=new e(n.generate(o));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},c.prototype._truncateToN=function(t,r,n){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof n&&(n=8*i);var s=n-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(r,n,i,s){if("object"==typeof i&&(s=i,i=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var c=0;c<r.length;c++)o((255&r[c])===r[c])}n=this.keyFromPrivate(n,i),r=this._truncateToN(r,!1,s.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var u=this.n.byteLength(),l=n.getPrivate().toArray("be",u),d=r.toArray("be",u);o(new e(d).eq(r),"Can not sign message");for(var f=new t({hash:this.hash,entropy:l,nonce:d,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var b=s.k?s.k(p):new e(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(n.getPrivate()).iadd(r));if(0!==(y=y.umod(this.n)).cmpn(0)){var x=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return s.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),x^=1),new a({r:v,s:y,recoveryParam:x})}}}}}},c.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new a(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var c,u=s.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(l,r.getPublic(),d)).isInfinity()&&c.eqXToP(o):!(c=this.g.mulAdd(l,r.getPublic(),d)).isInfinity()&&0===c.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,r,n,i){o((3&n)===n,"The recovery param is more than two bits"),r=new a(r,i);var s=this.n,c=new e(t),u=r.r,l=r.s,d=1&n,f=n>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");u=f?this.curve.pointFromX(u.add(this.curve.n),d):this.curve.pointFromX(u,d);var h=r.r.invm(s),p=s.sub(c).mul(h).umod(s),b=l.mul(h).umod(s);return this.g.mulAdd(p,u,b)},c.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new a(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")},di}function ki(){if(vi)return gi;vi=1;var e=Ni(),t=Ci(),r=on(),n=r.assert,i=r.parseBytes,o=function(){if(pi)return hi;pi=1;var e=on(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},n(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(i,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),n(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},hi=i}(),s=function(){if(mi)return bi;mi=1;var e=Jr(),t=on(),r=t.assert,n=t.cachedProperty,i=t.parseBytes;function o(t,n){this.eddsa=t,"object"!=typeof n&&(n=i(n)),Array.isArray(n)&&(r(n.length===2*t.encodingLength,"Signature has invalid size"),n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),r(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof e&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}return n(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},bi=o}();function a(r){if(n("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof a))return new a(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return gi=a,a.prototype.sign=function(e,t){e=i(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),s=this.encodePoint(o),a=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:c,Rencoded:s})},a.prototype.verify=function(e,t,r){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(s)},a.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},a.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},a.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},a.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},a.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=r.intFromLE(n);return this.curve.pointFromY(o,i)},a.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(e){return r.intFromLE(e)},a.prototype.isPoint=function(e){return e instanceof this.pointClass},gi}function Ti(){if(wi)return xi;wi=1;const e=(yi||(yi=1,function(){var e=Hr;e.version=Gr,e.utils=on(),e.rand=cn(),e.curve=En(),e.curves=Ci(),e.ec=Mi(),e.eddsa=ki()}()),Hr).ec,t=new e("secp256k1"),r=t.curve,n=r.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new n(i);if(o.cmp(r.p)>=0)return null;o=o.toRed(r.red);let s=o.redSqr().redIMul(o).redIAdd(r.b).redSqrt();3===e!==s.isOdd()&&(s=s.redNeg());const a=o.redSqr().redIMul(o);return s.redSqr().redISub(a.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:o,y:s}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let s=new n(i),a=new n(o);if(s.cmp(r.p)>=0||a.cmp(r.p)>=0)return null;if(s=s.toRed(r.red),a=a.toRed(r.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(r.b)).isZero()?t.keyPair({pub:{x:s,y:a}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}return xi={contextRandomize:()=>0,privateKeyVerify(e){const t=new n(e);return t.cmp(r.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new n(e),i=r.n.sub(t).umod(r.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new n(t);if(i.cmp(r.n)>=0)return 1;if(i.iadd(new n(e)),i.cmp(r.n)>=0&&i.isub(r.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new n(t);if(i.cmp(r.n)>=0||i.isZero())return 1;i.imul(new n(e)),i.cmp(r.n)>=0&&(i=i.umod(r.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const s=new n(i);if(s.cmp(r.n)>=0||s.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const r=i(t);if(null===r)return 1;return o(e,r.getPublic()),0},publicKeyNegate(e,t){const r=i(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),o(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=i(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(o(e,n),0)},publicKeyTweakAdd(e,t,s){const a=i(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0)return 2;const c=a.getPublic().add(r.g.mul(s));return c.isInfinity()?2:(o(e,c),0)},publicKeyTweakMul(e,t,s){const a=i(t);if(null===a)return 1;if((s=new n(s)).cmp(r.n)>=0||s.isZero())return 2;return o(e,a.getPublic().mul(s)),0},signatureNormalize(e){const i=new n(e.subarray(0,32)),o=new n(e.subarray(32,64));return i.cmp(r.n)>=0||o.cmp(r.n)>=0?1:(1===o.cmp(t.nh)&&e.set(r.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new n(i).cmp(r.n)>=0)return 1;if(new n(o).cmp(r.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(i,1);let c=33,u=0;for(;c>1&&0===a[u]&&!(128&a[u+1]);--c,++u);if(a=a.subarray(u),128&a[0])return 1;if(c>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(o,1);let d=33,f=0;for(;d>1&&0===l[f]&&!(128&l[f+1]);--d,++f);return l=l.subarray(f),128&l[0]||d>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+d,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+c]=2,s[5+c]=l.length,s.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let s=t.subarray(4,4+i);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+i);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let c=new n(s);c.cmp(r.n)>=0&&(c=new n(0));let u=new n(t.subarray(6+i));return u.cmp(r.n)>=0&&(u=new n(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,s,a){if(a){const e=a;a=t=>{const r=e(i,o,null,s,t);if(!(r instanceof Uint8Array&&32===r.length))throw new Error("This is the way");return new n(r)}}const c=new n(o);if(c.cmp(r.n)>=0||c.isZero())return 1;let u;try{u=t.sign(i,o,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,o,s){const a={r:e.subarray(0,32),s:e.subarray(32,64)},c=new n(a.r),u=new n(a.s);if(c.cmp(r.n)>=0||u.cmp(r.n)>=0)return 1;if(1===u.cmp(t.nh)||c.isZero()||u.isZero())return 3;const l=i(s);if(null===l)return 2;const d=l.getPublic();return t.verify(o,a,d)?0:3},ecdsaRecover(e,i,s,a){const c={r:i.slice(0,32),s:i.slice(32,64)},u=new n(c.r),l=new n(c.s);if(u.cmp(r.n)>=0||l.cmp(r.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let d;try{d=t.recoverPubKey(a,c,s)}catch(e){return 2}return o(e,d),0},ecdh(e,o,s,a,c,u,l){const d=i(o);if(null===d)return 1;const f=new n(s);if(f.cmp(r.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===c){const r=h.encode(null,!0),n=t.hash().update(r).digest();for(let t=0;t<32;++t)e[t]=n[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=r[e];const n=c(u,l,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}},xi}function Ri(){return Ei||(Ei=1,Ai=function(){if(Wr)return zr;Wr=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",r="The tweak was out of range or equal to zero",n="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",s="Public Key serialization error",a="The sum of the public keys is not valid",c="Signature could not be parsed",u="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,r){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;f(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;f(t.length===r,n)}}function p(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function b(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return zr=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(n)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,r){switch(h("private key",e,32),h("tweak",r,32),g.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(r)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,r){switch(h("private key",e,32),p(t),r=b(r,t?33:65),g.publicKeyCreate(r,e)){case 0:return r;case 1:throw new Error(i);case 2:throw new Error(s)}},publicKeyConvert(e,t=!0,r){switch(h("public key",e,[33,65]),p(t),r=b(r,t?33:65),g.publicKeyConvert(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(s)}},publicKeyNegate(t,r=!0,n){switch(h("public key",t,[33,65]),p(r),n=b(n,r?33:65),g.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(s)}},publicKeyCombine(e,t=!0,r){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),r=b(r,t?33:65),g.publicKeyCombine(r,e)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(a);case 3:throw new Error(s)}},publicKeyTweakAdd(e,r,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",r,32),p(n),i=b(i,n?33:65),g.publicKeyTweakAdd(i,e,r)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,n=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),p(n),i=b(i,n?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(r)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(t,r){h("signature",t,64);const n={output:r=b(r,72),outputlen:72};switch(g.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(t,r){switch(h("signature",t),r=b(r,64),g.signatureImport(r,t)){case 0:return r;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(t,r,n={},i){h("message",t,32),h("private key",r,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.noncefn&&f("Function"===m(n.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=b(i,64),recid:null};switch(g.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(u);case 2:throw new Error(e)}},ecdsaVerify(e,t,r){switch(h("signature",e,64),h("message",t,32),h("public key",r,[33,65]),g.ecdsaVerify(e,t,r)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(o)}},ecdsaRecover(t,r,n,i=!0,o){switch(h("signature",t,64),f("Number"===m(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",n,32),p(i),o=b(o,i?33:65),g.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(e)}},ecdh(e,t,r={},n){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.hashfn?(f("Function"===m(r.hashfn),"Expected options.hashfn to be a Function"),void 0!==r.xbuf&&h("options.xbuf",r.xbuf,32),void 0!==r.ybuf&&h("options.ybuf",r.ybuf,32),h("output",n)):n=b(n,32),g.ecdh(n,e,t,r.data,r.hashfn,r.xbuf,r.ybuf)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(d)}}}),zr}()(Ti())),Ai}function Bi(){if(Si)return $r;Si=1;var e=$r&&$r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($r,"__esModule",{value:!0}),$r.PublicKey=void 0;const t=$t(),r=Nr(),n=e(Ri()),i=Te();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class s extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?s.fromString(e):e}static fromString(e){const r=e.split(":");let n,o;if(1===r.length)n=r[0];else{if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");n=r[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(r[0])}const a=(0,t.baseDecode)(n);o||(o=a.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const c=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(a.length!==c)throw new Error(`Invalid public key size (${a.length}), must be ${c}`);return new s({keyType:o,data:a})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,s=this.data;switch(o){case i.KeyType.ED25519:return r.ed25519.verify(t,e,s);case i.KeyType.SECP256K1:return n.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...s]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return $r.PublicKey=s,$r}function ji(){if(_i)return Pe;_i=1;var e=Pe&&Pe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.KeyPairEd25519=void 0;const t=$t(),r=Nr(),n=e(Dr()),i=Te(),o=Oe(),s=Bi();class a extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),a=r.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new s.PublicKey({keyType:i.KeyType.ED25519,data:a}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.ed25519.getPublicKey(new Uint8Array(e)),s=new Uint8Array([...e,...o]);return new a((0,t.baseEncode)(s))}sign(e){return{signature:r.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return Pe.KeyPairEd25519=a,Pe}var Oi,Li,Pi,Fi,Ui={};function Di(){if(Oi)return Ui;Oi=1;var e=Ui&&Ui.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.KeyPairSecp256k1=void 0;const t=$t(),r=e(Dr()),n=e(Ri()),i=Te(),o=Oe(),s=Bi();class a extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),a=n.default.publicKeyCreate(new Uint8Array(o),!1),c=a.subarray(1,a.length);this.publicKey=new s.PublicKey({keyType:i.KeyType.SECP256K1,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.default.publicKeyCreate(new Uint8Array(e),!1),s=o.subarray(1,o.length),c=new Uint8Array([...e,...s]);return new a((0,t.baseEncode)(c))}sign(e){const{signature:r,recid:i}=n.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...r,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return Ui.KeyPairSecp256k1=a,Ui}function zi(){return Pi||(Pi=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=Te();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var r=function(){if(Li)return Be;Li=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.KeyPair=void 0;const e=Oe(),t=ji(),r=Di();class n extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return r.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const n=e.split(":");if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(n[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(n[1]);case"SECP256K1":return new r.KeyPairSecp256k1(n[1]);default:throw new Error(`Unknown curve: ${n[0]}`)}}}return Be.KeyPair=n,Be}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return r.KeyPair}});var n=ji();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}});var i=Di();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=Bi();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(Me)),Me}function Wi(){return Fi||(Fi=1,function(e){var t=le&&le.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=le&&le.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=le&&le.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,r){const n=new u(t),i=o.serialize(e.authPayloadSchema,n),a=Uint8Array.from(s.default.sha256.array(i));let l=new Uint8Array(Buffer.from(r.signature,"base64"));return c.PublicKey.from(r.publicKey).verify(a,l)};const o=n(function(){if(Ee)return de;Ee=1;var e=de&&de.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=de&&de.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};de.__esModule=!0,de.deserialize=de.serialize=void 0;var n=function(){if(ye)return fe;ye=1;var e=fe&&fe.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),t=fe&&fe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=fe&&fe.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(null!=r)for(var i in r)"default"!==i&&Object.prototype.hasOwnProperty.call(r,i)&&e(n,r,i);return t(n,r),n};fe.__esModule=!0,fe.BorshSerializer=void 0;var n=pe(),i=ge(),o=r(we()),s=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var s=i[n];this.encode_value(s,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,s=n;i<s.length;i++){var a=s[i];this.encode_value(a,t.map.key),this.encode_value(r?e.get(a):e[a],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return fe.BorshSerializer=s,fe}(),i=function(){if(Ae)return Se;Ae=1,Se.__esModule=!0,Se.BorshDeserializer=void 0;var e=pe(),t=ge(),r=function(){function r(e){this.buffer=new t.DecodeBuffer(e)}return r.prototype.decode=function(e){return this.decode_value(e)},r.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},r.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},r.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},r.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},r.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},r.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},r.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw new Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},r.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},r.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},r.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},r.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},r}();return Se.BorshDeserializer=r,Se}(),o=r(we());return de.serialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new n.BorshSerializer(r).encode(t,e)},de.deserialize=function(e,t,r){return void 0===r&&(r=!0),r&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},de}()),s=i((_e||(_e=1,a=Ie,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self,i=!r.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?r=oe:n&&(r=self);var o=!r.JS_SHA256_NO_COMMON_JS&&a.exports,s=!r.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!r.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(r){return new y(t,!0).update(r)[e]()}},b=function(e){var t=p("hex",e);i&&(t=m(t,e)),t.create=function(){return new y(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=p(n,e)}return t},m=function(t,n){var i,o=Ne,s=Ne.Buffer,a=n?"sha224":"sha256";return i=s.from&&!r.JS_SHA256_NO_BUFFER_FROM?s.from:function(e){return new s(e)},function(r){if("string"==typeof r)return o.createHash(a).update(r,"utf8").digest("hex");if(null==r)throw new Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===s?o.createHash(a).update(i(r)).digest("hex"):t(r)}},g=function(e,t){return function(r,n){return new x(r,t,!0).update(n)[e]()}},v=function(e){var t=g("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var n=f[r];t[n]=g(n,e)}return t};function y(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function x(t,r,n){var i,o=typeof t;if("string"===o){var a,c=[],u=t.length,l=0;for(i=0;i<u;++i)(a=t.charCodeAt(i))<128?c[l++]=a:a<2048?(c[l++]=192|a>>>6,c[l++]=128|63&a):a<55296||a>=57344?(c[l++]=224|a>>>12,c[l++]=128|a>>>6&63,c[l++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++i)),c[l++]=240|a>>>18,c[l++]=128|a>>>12&63,c[l++]=128|a>>>6&63,c[l++]=128|63&a);t=c}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new y(r,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}y.call(this,r,n),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}y.prototype.update=function(t){if(!this.finalized){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(s&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||s&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,a=0,c=t.length,u=this.blocks;a<c;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),r)for(o=this.start;a<c&&o<64;++a)u[o>>>2]|=t[a]<<l[3&o++];else for(o=this.start;a<c&&o<64;++a)(i=t.charCodeAt(a))<128?u[o>>>2]|=i<<l[3&o++]:i<2048?(u[o>>>2]|=(192|i>>>6)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(u[o>>>2]|=(224|i>>>12)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++a)),u[o>>>2]|=(240|i>>>18)<<l[3&o++],u[o>>>2]|=(128|i>>>12&63)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=u[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,r,n,i,o,s,a,c,u=this.h0,l=this.h1,f=this.h2,h=this.h3,p=this.h4,b=this.h5,m=this.h6,g=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+r|0;for(c=l&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=v[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=v[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(o=u&l)^u&f^c,g=h+(i=g+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&m)+d[e]+v[e])|0,h=i+(t+n)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&u)^h&l^o,m=f+(i=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&p^~g&b)+d[e+1]+v[e+1])|0,t=((f=i+(t+n)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(a=f&h)^f&u^s,b=l+(i=b+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&p)+d[e+2]+v[e+2])|0,t=((l=i+(t+n)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&f)^l&h^a,p=u+(i=p+(r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&m^~b&g)+d[e+3]+v[e+3])|0,u=i+(t+n)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+l|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+b|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s];return this.is224||(u+=c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a]),u},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},x.prototype=new y,x.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),y.prototype.finalize.call(this)}};var w=b();w.sha256=w,w.sha224=b(!0),w.sha256.hmac=v(),w.sha224.hmac=v(!0),o?a.exports=w:(r.sha256=w.sha256,r.sha224=w.sha224)}()),Ie.exports));var a;const c=zi();class u{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:r}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=r}}e.AuthPayload=u,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(le)),le}var $i={};const qi=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Ki(e){return qi.test(e)}function Vi(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}Vi.valid=Ki;var Hi,Gi,Xi,Yi,Zi,Ji,Qi,eo=ae(Object.freeze({__proto__:null,default:Vi,uuid4:Vi,valid:Ki})),to={},ro={exports:{}},no={exports:{}};function io(){return Hi||(Hi=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var r=0;r<e.length;r++)e[r]=t.endian(e[r]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?r.push(e.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(n))>>>6-2*i);return r}},no.exports=t),no.exports;var e,t}function oo(){if(Xi)return Gi;Xi=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};return Gi=e}function so(){return Yi||(Yi=1,function(){var e=io(),t=oo().utf8,r=oo().bin,n=function(n,i){var o=e.wordsToBytes(function(r){r.constructor==String?r=t.stringToBytes(r):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(r)?r=Array.prototype.slice.call(r,0):Array.isArray(r)||(r=r.toString());var n=e.bytesToWords(r),i=8*r.length,o=[],s=1732584193,a=-271733879,c=-1732584194,u=271733878,l=-1009589776;n[i>>5]|=128<<24-i%32,n[15+(i+64>>>9<<4)]=i;for(var d=0;d<n.length;d+=16){for(var f=s,h=a,p=c,b=u,m=l,g=0;g<80;g++){if(g<16)o[g]=n[d+g];else{var v=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=v<<1|v>>>31}var y=(s<<5|s>>>27)+l+(o[g]>>>0)+(g<20?1518500249+(a&c|~a&u):g<40?1859775393+(a^c^u):g<60?(a&c|a&u|c&u)-1894007588:(a^c^u)-899497514);l=u,u=c,c=a<<30|a>>>2,a=s,s=y}s+=f,a+=h,c+=p,u+=b,l+=m}return[s,a,c,u,l]}(n));return i&&i.asBytes?o:i&&i.asString?r.bytesToString(o):e.bytesToHex(o)};n._blocksize=16,n._digestsize=20,ro.exports=n}()),ro.exports}function ao(){return Ji||(Ji=1,function(e){var t=$i&&$i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const r=t(eo),n=$t(),i=(Zi||(Zi=1,function(e){var t=to&&to.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const r=t(so()),n=t(eo),i=$t();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const r=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===r.ok)throw Error(await r.text());const{data:n}=await r.json();return JSON.parse(n)},e.deleteRequest=async t=>{const r=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error(await r.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,n.default)()})),o=(0,r.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,r)=>{const{query:n,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:n}),headers:{"content-type":"application/json"},method:"POST",signal:r});if(!1===o.ok)throw Error(await o.text());return i}}(to)),to);e.wait=e=>new Promise(t=>setTimeout(t,e));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let s;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(s?.remove(),s=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const n=(0,r.default)();return new Promise((r,i)=>{const o=e=>{if(e.data.id===n)return window?.removeEventListener("message",o),e.data.success?r(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:n},"*"),window?.addEventListener("message",o)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,a){if(null!=window.hotExtension)return window.hotExtension.request(t,a);if(this.isInjected)return this.injectedRequest(t,a);const c=(0,r.default)(),u=window?.Telegram?.WebApp,l=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:a,id:c}),d=`${this.walletId}?startapp=hotconnect-${(0,n.baseEncode)(l)}`;if(u)u?.openTelegramLink(d);else{(e=>{s?.remove(),s=document.createElement("div");const t=document.createElement("iframe");s?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),s.style.padding="16px",s.style.zIndex="100000000000000",s.style.position="fixed",s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.background="rgba(0, 0, 0, 0.1)",s.style.backdropFilter="blur(24px)",s.onclick=()=>{s?.remove(),s=void 0},document.body.appendChild(s)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,n.baseEncode)(l)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(l).catch(()=>null);if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return s?.remove(),h}}}($i)),$i}var co,uo=(Qi||(Qi=1,function(e){var t=ue&&ue.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var r=Wi();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return r.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return r.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return r.authPayloadSchema}});var n=ao();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(n).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return n.RequestFailed}})}(ue)),ue).HOT,lo={name:b.Hot,website:"https://hot-labs.org/",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,uo.request("stellar:getAddress",{})];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Hana wallet.");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("HotWallet does not support the getNetwork function")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2,"undefined"!=typeof window&&!!window.hotExtension]})})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,uo.request("stellar:signAuthEntry",{authEntry:e,accountToSign:t.address})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using HotWallet");case 3:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,uo.request("stellar:signMessage",{message:e,accountToSign:t.address})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using HotWallet");case 3:return[2]}})})},signTransaction:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return M(void 0,T([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,uo.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using HotWallet");case 3:return[2]}})})}},fo={name:b.Hana,website:"https://www.hanawallet.io/",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,window.hanaWallet.stellar.getPublicKey()];case 1:if(!e.sent())throw new Error("Hana Wallet is not installed or connected.");return[4,window.hanaWallet.stellar.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to HanaWallet.");case 4:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!(null===(t=window.hanaWallet)||void 0===t?void 0:t.stellar))throw new Error("Hana Wallet is not installed.");return[4,window.hanaWallet.stellar.getNetworkDetails()];case 1:return[2,{network:(e=r.sent()).network,passphrase:e.networkPassphrase}];case 2:throw r.sent(),new Error("Failed to getNetwork using HanaWallet");case 3:return[2]}})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signAuthEntry using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signAuthEntry using HanaWallet");case 4:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("Failed to signMessage using HanaWallet");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signMessage({message:e,accountToSign:t.address})];case 2:return[2,n.sent()];case 3:throw n.sent(),new Error("Failed to signMessage using HanaWallet");case 4:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i,o;return k(this,function(s){switch(s.label){case 0:if(!("undefined"!=typeof window&&!!(null===(n=window.hanaWallet)||void 0===n?void 0:n.stellar)))throw new Error("Failed to signTransaction using HanaWallet");s.label=1;case 1:if(s.trys.push([1,3,,4]),"function"!=typeof(r=null===(o=null===(i=null===window||void 0===window?void 0:window.hanaWallet)||void 0===i?void 0:i.stellar)||void 0===o?void 0:o.signTransaction))throw new Error("Failed to signTransaction using HanaWallet");return[4,r({xdr:e,address:t.address,networkPassphrase:t.network})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to signTransaction using HanaWallet");case 4:return[2]}})})}},ho={name:b.Rabet,website:"https://rabet.io",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.connect()];case 1:return[2,e.sent().publicKey];case 2:throw e.sent(),new Error("Failed to connect to Rabet.");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){try{if(!window.rabet)throw new Error("Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){}return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.getNetwork()];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("Failed to getNetwork from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){return e("undefined"!=typeof window&&!!window.rabet)},150)})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Rabet does not support the signAuthEntry function")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var t;return k(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.signMessage(e)];case 1:if(!(t=r.sent()).message||t.error)throw new Error("Failed to signMessage from Rabet");return[2,t.message];case 2:throw r.sent(),new Error("Failed to signMessage from Rabet");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.rabet)throw new Error("Rabet Wallet is not installed.");return[4,window.rabet.sign(e,t.network===m.PUBLIC?"mainnet":"testnet")];case 1:return[2,r.sent().xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Rabet.");case 3:return[2]}})})}},po={name:b.Xbull,website:"https://xbull.app",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:if(e.trys.push([0,3,,4]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0})];case 1:return e.sent(),[4,window.xBullSDK.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to xBull");case 4:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Error getting network from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){e("undefined"!=typeof window&&!!window.xBullSDK)},150)})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("xBull does not support the signAuthEntry function")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed");return[4,window.xBullSDK.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if((r=n.sent()).error)throw new Error("Failed to signMessage using xBull");return[2,r.signedMessage];case 2:throw n.sent(),new Error("Failed to signMessage using xBull");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("xBull Wallet is not installed.");return[4,window.xBullSDK.signXDR(e,{network:t.network,publicKey:t.address})];case 1:return[2,r.sent()];case 2:throw r.sent(),new Error("Failed to sign the transaction with xBull.");case 3:return[2]}})})}},bo={name:b.Albedo,website:"https://albedo.link",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,x.default.publicKey({token:"Connect to Albedo"})];case 1:return[2,e.sent().pubkey];case 2:throw e.sent(),new Error("Failed to connect to Albedo.");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Albedo does not support the getNetwork function")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2,!0]})})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Albedo does not support the signAuthEntry function")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,x.default.signMessage({message:e,pubkey:t.address})];case 1:return[2,r.sent().signed_message]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,x.default.tx({xdr:e,pubkey:t.address,network:t.network})];case 1:return[2,r.sent().signed_envelope_xdr];case 2:throw r.sent(),new Error("Failed to sign the transaction with Albedo.");case 3:return[2]}})})}},mo={name:b.Klever,website:"https://klever.io",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getAddress()];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("Failed to connect to Klever");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("Failed to getNetwork from Klever");case 3:return[2]}})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.kleverWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("Failed to signAuthEntry using Klever");case 3:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("Failed to signMessage using Klever");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signTransaction(e,t)];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("Failed to signTransaction using Klever");case 3:return[2]}})})}},go={name:b.Lobstr,website:"https://lobstr.co",connect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,w.default.isConnected()];case 1:if(!e.sent())throw new Error("LOBSTR Wallet is not installed or connected.");return[4,w.default.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("Failed to connect to LOBSTR.");case 4:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Failed to get network from LOBSTR")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return[4,w.default.isConnected()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("LOBSTR does not support the signAuthEntry function")})})},signMessage:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("LOBSTR does not support the signMessage function")})})},signTransaction:function(e){return M(void 0,void 0,void 0,function(){return k(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!w.default.signTransaction)throw new Error("LOBSTR Wallet does not support signing transactions.");return[4,w.default.signTransaction(e)];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("Failed to sign the transaction with LOBSTR.");case 3:return[2]}})})}},vo={name:b.Onekey,website:"https://onekey.so",connect:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar))throw new Error("Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.getPublicKey()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("Failed to connect to Onekey.");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Failed to get network from Onekey")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(r=window.$onekey)||void 0===r?void 0:r.stellar))throw new Error("Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedAuthEntry];case 2:throw n.sent(),new Error("Failed to sign auth entry with Onekey.");case 3:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(r=window.$onekey)||void 0===r?void 0:r.stellar))throw new Error("Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedMessage];case 2:throw n.sent(),new Error("Failed to sign message with Onekey.");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(r=window.$onekey)||void 0===r?void 0:r.stellar))throw new Error("Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signTransaction(e,{submit:!1,address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("Failed to sign the transaction with Onekey.");case 3:return[2]}})})}},yo={name:b.Bitget,website:"https://bitget.com",connect:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar))throw new Error("Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.connect()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("Failed to connect to Bitget.");case 3:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return[4,window.bitkeep.stellar.network()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}]}})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Failed to sign auth entry with Bitget")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i;return k(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(i=window.bitkeep)||void 0===i?void 0:i.stellar))throw new Error("Bitkeep Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signMessage(e,t.address)];case 1:return r=o.sent(),n=new Uint8Array(r.match(/.{1,2}/g).map(function(e){return parseInt(e,16)})),[2,btoa(String.fromCharCode.apply(String,n))];case 2:throw o.sent(),new Error("Failed to sign message with Bitkeep.");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){var r;return k(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(r=window.bitkeep)||void 0===r?void 0:r.stellar))throw new Error("Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent()];case 2:throw n.sent(),new Error("Failed to sign the transaction with Bitget.");case 3:return[2]}})})}},xo={exports:{}};var wo=function(){if(co)return xo.exports;co=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}xo.exports=i,xo.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,c,u;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),c=o[t]),void 0===c)c=o[t]=r,++e._eventsCount;else if("function"==typeof c?c=o[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},xo.exports}(),Ao=se(wo);const Eo=e=>{class t extends Error{cause;constructor(r,n,i){if(super(r||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,n)for(const e in n)this[e]=n[e];if(i&&"object"==typeof i&&"cause"in i&&!this.cause){const e=i.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return t};const So=Eo("DisconnectedDevice"),_o=Eo("DisconnectedDeviceDuringOperation"),Io=Eo("TransportOpenUserCancelled"),No=Eo("TransportInterfaceNotAvailable"),Co=Eo("TransportRaceCondition"),Mo=Eo("TransportWebUSBGestureRequired");var ko;!function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(ko||(ko={}));class To extends Error{id;constructor(e,t){const r="TransportError";super(e||r),this.name=r,this.message=e,this.stack=new Error(e).stack,this.id=t}}const Ro={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,TRUSTCHAIN_WRONG_SEED:45063};class Bo extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){const r=Object.keys(Ro).find(t=>Ro[t]===e)||"UNKNOWN_ERROR",n=`Ledger device: ${function(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=e&&e<=28671)return"Internal error, please report"}(e)||r} (0x${e.toString(16)})`;if(super(n),this.name="TransportStatusError",this.statusCode=e,this.statusText=r,Object.setPrototypeOf(this,Bo.prototype),t&&e===Ro.LOCKED_DEVICE)return new jo(n)}}class jo extends Bo{constructor(e){super(Ro.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,jo.prototype)}}let Oo=0;const Lo=[],Po=(e,t,r)=>{const n={type:e,id:String(++Oo),date:new Date};t&&(n.message=t),r&&(n.data=r),Do(n)};class Fo{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:r,context:n})=>{const i={type:e,id:String(++Oo),date:new Date};t&&(i.message=t),r&&(i.data=r),n&&(i.context=n),Do(i)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new Fo(e,this.context)}withContext(e){return new Fo(this.type,e)}withUpdatedContext(e){return new Fo(this.type,{...this.context,...e})}}const Uo=e=>(Lo.push(e),()=>{const t=Lo.indexOf(e);-1!==t&&(Lo[t]=Lo[Lo.length-1],Lo.pop())});function Do(e){for(let t=0;t<Lo.length;t++)try{Lo[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=Uo);class zo{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new Fo(t??"transport",e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let r=!1;return(async()=>{if(!r)for(const n of e){const e=await this.exchange(n);if(r)return;const i=e.readUInt16BE(e.length-2);if(i!==Ro.OK)throw new Bo(i);t.next(e)}})().then(()=>!r&&t.complete(),e=>!r&&t.error(e)),{unsubscribe:()=>{r=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new Ao;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,r,n,i=Ur().Buffer.alloc(0),o=[Ro.OK],{abortTimeoutMs:s}={})=>{const a=this.tracer.withUpdatedContext({function:"send"});if(i.length>=256)throw a.trace("data.length exceeded 256 bytes limit",{dataLength:i.length}),new To("data.length exceed 256 bytes limit. Got: "+i.length,"DataLengthTooBig");a.trace("Starting an exchange",{abortTimeoutMs:s});const c=await this.exchange(Ur().Buffer.concat([Buffer.from([e,t,r,n]),Buffer.from([i.length]),i]),{abortTimeoutMs:s});a.trace("Received response from exchange");const u=c.readUInt16BE(c.length-2);if(!o.some(e=>e===u))throw new Bo(u);return c};static create(e=3e3,t){return new Promise((r,n)=>{let i=!1;const o=this.listen({next:t=>{i=!0,o&&o.unsubscribe(),s&&clearTimeout(s),this.open(t.descriptor,e).then(r,n)},error:e=>{s&&clearTimeout(s),n(e)},complete:()=>{s&&clearTimeout(s),i||n(new To(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),s=t?setTimeout(()=>{o.unsubscribe(),n(new To(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new Co("An action was already pending on the Ledger device. Please deny or reconnect.");let r;const n=new Promise(e=>{r=e});this.exchangeBusyPromise=n;let i=!1;const o=setTimeout(()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const r=await e();return i&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),r}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(o),r&&r(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,r){for(const n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}_appAPIlock=null;decorateAppAPIMethod(e,t,r,n){return async(...i)=>{const{_appAPIlock:o}=this;if(o)return Promise.reject(new To("Ledger Device is busy (lock "+o+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),await t.apply(r,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}function Wo(e){const t=Ur().Buffer.alloc(2);return t.writeUInt16BE(e,0),t}const $o={data:Ur().Buffer.alloc(0),dataLength:0,sequence:0};var qo,Ko,Vo,Ho,Go,Xo,Yo,Zo,Jo,Qo,es,ts,rs,ns,is,os,ss,as,cs,us,ls,ds,fs,hs,ps,bs,ms,gs,vs,ys,xs,ws,As,Es,Ss,_s,Is,Ns,Cs,Ms,ks,Ts,Rs,Bs,js,Os,Ls,Ps,Fs,Us,Ds,zs,Ws,$s,qs,Ks,Vs,Hs,Gs,Xs,Ys,Zs,Js,Qs,ea,ta,ra,na,ia,oa,sa,aa,ca,ua,la,da,fa,ha,pa,ba,ma,ga,va,ya,xa,wa,Aa,Ea,Sa,_a={exports:{}};function Ia(){if(Ko)return qo;Ko=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return qo={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function Na(){if(Ho)return Vo;Ho=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Vo=e}function Ca(){return Go||(Go=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Ia(),o=Na(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,n]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=d++;o(e,i,t),l[e]=i,c[i]=t,u[i]=n,s[i]=new RegExp(t,r?"g":void 0),a[i]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_a,_a.exports)),_a.exports}function Ma(){if(Yo)return Xo;Yo=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Xo=r=>r?"object"!=typeof r?e:r:t}function ka(){if(Jo)return Zo;Jo=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};return Zo={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}function Ta(){if(es)return Qo;es=1;const e=Na(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Ia(),{safeRe:n,safeSrc:i,t:o}=Ca(),s=Ma(),{compareIdentifiers:a}=ka();class c{constructor(i,a){if(a=s(a),i instanceof c){if(i.loose===!!a.loose&&i.includePrerelease===!!a.includePrerelease)return i;i=i.version}else if("string"!=typeof i)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",i,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const u=i.trim().match(a.loose?n[o.LOOSE]:n[o.FULL]);if(!u)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof c)){if("string"==typeof t&&t===this.version)return 0;t=new c(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),a(this.major,e.major)||a(this.minor,e.minor)||a(this.patch,e.patch)}comparePre(t){if(t instanceof c||(t=new c(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(e("prerelease compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return a(n,i)}while(++r)}compareBuild(t){t instanceof c||(t=new c(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(e("build compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return a(n,i)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=new RegExp(`^${this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]}$`),r=`-${t}`.match(e);if(!r||r[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Qo=c}function Ra(){if(rs)return ts;rs=1;const e=Ta();return ts=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}},ts}function Ba(){if(xs)return ys;xs=1;const e=Ta();return ys=(t,r,n)=>new e(t,n).compare(new e(r,n))}function ja(){if(Is)return _s;Is=1;const e=Ta();return _s=(t,r,n)=>{const i=new e(t,n),o=new e(r,n);return i.compare(o)||i.compareBuild(o)}}function Oa(){if(Rs)return Ts;Rs=1;const e=Ba();return Ts=(t,r,n)=>e(t,r,n)>0}function La(){if(js)return Bs;js=1;const e=Ba();return Bs=(t,r,n)=>e(t,r,n)<0}function Pa(){if(Ls)return Os;Ls=1;const e=Ba();return Os=(t,r,n)=>0===e(t,r,n)}function Fa(){if(Fs)return Ps;Fs=1;const e=Ba();return Ps=(t,r,n)=>0!==e(t,r,n)}function Ua(){if(Ds)return Us;Ds=1;const e=Ba();return Us=(t,r,n)=>e(t,r,n)>=0}function Da(){if(Ws)return zs;Ws=1;const e=Ba();return zs=(t,r,n)=>e(t,r,n)<=0}function za(){if(qs)return $s;qs=1;const e=Pa(),t=Fa(),r=Oa(),n=Ua(),i=La(),o=Da();return $s=(s,a,c,u)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,u);case"!=":return t(s,c,u);case">":return r(s,c,u);case">=":return n(s,c,u);case"<":return i(s,c,u);case"<=":return o(s,c,u);default:throw new TypeError(`Invalid operator: ${a}`)}}}function Wa(){if(Ys)return Xs;Ys=1;const e=/\s+/g;class t{constructor(r,n){if(n=i(n),r instanceof t)return r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease?r:new t(r.raw,n);if(r instanceof o)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=r.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const i=this.options.loose,a=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(a,C(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],l),s("comparator trim",e),e=e.replace(c[u.TILDETRIM],d),s("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),s("caret trim",e);let m=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>N(e,this.options));i&&(m=m.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),s("range list",m);const g=new Map,y=m.map(e=>new o(e,this.options));for(const e of y){if(b(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const x=[...g.values()];return n.set(t,x),x}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,r)&&e.set.some(e=>g(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}Xs=t;const r=(Gs||(Gs=1,Hs=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),Hs),n=new r,i=Ma(),o=$a(),s=Na(),a=Ta(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:d,caretTrimReplace:f}=Ca(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=Ia(),b=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},v=(e,t)=>(s("comp",e,t),e=A(e,t),s("caret",e),e=x(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=I(e,t),s("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return s("tilde",e,t,r,n,i,o),y(r)?a="":y(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:y(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",a),a})},A=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let c;return s("caret",e,t,r,i,o,a),y(r)?c="":y(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:y(o)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),c="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(s("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),s("caret return",c),c})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>_(e,t)).join(" ")),_=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,(r,n,i,o,a,c)=>{s("xRange",e,r,n,i,o,a,c);const u=y(i),l=u||y(o),d=l||y(a),f=d;return"="===n&&f&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(l&&(o=0),a=0,">"===n?(n=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+i}.${o}.${a}${c}`):l?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),s("xRange return",r),r})},I=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),N=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),C=e=>(t,r,n,i,o,s,a,c,u,l,d,f)=>`${r=y(n)?"":y(i)?`>=${n}.0.0${e?"-0":""}`:y(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),M=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0};return Xs}function $a(){if(Js)return Zs;Js=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){if(i=r(i),n instanceof t){if(n.loose===!!i.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),s("comparator",n,i),this.options=i,this.loose=!!i.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],o=t.match(r);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=r(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Zs=t;const r=Ma(),{safeRe:n,t:i}=Ca(),o=za(),s=Na(),a=Ta(),c=Wa();return Zs}function qa(){if(ea)return Qs;ea=1;const e=Wa();return Qs=(t,r,n)=>{try{r=new e(r,n)}catch(e){return!1}return r.test(t)},Qs}function Ka(){if(la)return ua;la=1;const e=Wa();return ua=(t,r)=>{try{return new e(t,r).range||"*"}catch(e){return null}},ua}function Va(){if(fa)return da;fa=1;const e=Ta(),t=$a(),{ANY:r}=t,n=Wa(),i=qa(),o=Oa(),s=La(),a=Da(),c=Ua();return da=(u,l,d,f)=>{let h,p,b,m,g;switch(u=new e(u,f),l=new n(l,f),d){case">":h=o,p=a,b=s,m=">",g=">=";break;case"<":h=s,p=c,b=o,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,l,f))return!1;for(let e=0;e<l.set.length;++e){const n=l.set[e];let i=null,o=null;if(n.forEach(e=>{e.semver===r&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:b(e.semver,o.semver,f)&&(o=e)}),i.operator===m||i.operator===g)return!1;if((!o.operator||o.operator===m)&&p(u,o.semver))return!1;if(o.operator===g&&b(u,o.semver))return!1}return!0},da}var Ha,Ga=function(){if(Sa)return Ea;Sa=1;const e=Ca(),t=Ia(),r=Ta(),n=ka(),i=Ra(),o=function(){if(is)return ns;is=1;const e=Ra();return ns=(t,r)=>{const n=e(t,r);return n?n.version:null},ns}(),s=function(){if(ss)return os;ss=1;const e=Ra();return os=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null},os}(),a=function(){if(cs)return as;cs=1;const e=Ta();return as=(t,r,n,i,o)=>{"string"==typeof n&&(o=i,i=n,n=void 0);try{return new e(t instanceof e?t.version:t,n).inc(r,i,o).version}catch(e){return null}},as}(),c=function(){if(ls)return us;ls=1;const e=Ra();return us=(t,r)=>{const n=e(t,null,!0),i=e(r,null,!0),o=n.compare(i);if(0===o)return null;const s=o>0,a=s?n:i,c=s?i:n,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"}}(),u=function(){if(fs)return ds;fs=1;const e=Ta();return ds=(t,r)=>new e(t,r).major}(),l=function(){if(ps)return hs;ps=1;const e=Ta();return hs=(t,r)=>new e(t,r).minor}(),d=function(){if(ms)return bs;ms=1;const e=Ta();return bs=(t,r)=>new e(t,r).patch}(),f=function(){if(vs)return gs;vs=1;const e=Ra();return gs=(t,r)=>{const n=e(t,r);return n&&n.prerelease.length?n.prerelease:null},gs}(),h=Ba(),p=function(){if(As)return ws;As=1;const e=Ba();return ws=(t,r,n)=>e(r,t,n)}(),b=function(){if(Ss)return Es;Ss=1;const e=Ba();return Es=(t,r)=>e(t,r,!0)}(),m=ja(),g=function(){if(Cs)return Ns;Cs=1;const e=ja();return Ns=(t,r)=>t.sort((t,n)=>e(t,n,r))}(),v=function(){if(ks)return Ms;ks=1;const e=ja();return Ms=(t,r)=>t.sort((t,n)=>e(n,t,r))}(),y=Oa(),x=La(),w=Pa(),A=Fa(),E=Ua(),S=Da(),_=za(),I=function(){if(Vs)return Ks;Vs=1;const e=Ta(),t=Ra(),{safeRe:r,t:n}=Ca();return Ks=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let s=null;if((o=o||{}).rtl){const e=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let t;for(;(t=e.exec(i))&&(!s||s.index+s[0].length!==i.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=i.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);if(null===s)return null;const a=s[2],c=s[3]||"0",u=s[4]||"0",l=o.includePrerelease&&s[5]?`-${s[5]}`:"",d=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${c}.${u}${l}${d}`,o)},Ks}(),N=$a(),C=Wa(),M=qa(),k=function(){if(ra)return ta;ra=1;const e=Wa();return ta=(t,r)=>new e(t,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),ta}(),T=function(){if(ia)return na;ia=1;const e=Ta(),t=Wa();return na=(r,n,i)=>{let o=null,s=null,a=null;try{a=new t(n,i)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new e(o,i)))}),o},na}(),R=function(){if(sa)return oa;sa=1;const e=Ta(),t=Wa();return oa=(r,n,i)=>{let o=null,s=null,a=null;try{a=new t(n,i)}catch(e){return null}return r.forEach(t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new e(o,i)))}),o},oa}(),B=function(){if(ca)return aa;ca=1;const e=Ta(),t=Wa(),r=Oa();return aa=(n,i)=>{n=new t(n,i);let o=new e("0.0.0");if(n.test(o))return o;if(o=new e("0.0.0-0"),n.test(o))return o;o=null;for(let t=0;t<n.set.length;++t){const i=n.set[t];let s=null;i.forEach(t=>{const n=new e(t.semver.version);switch(t.operator){case">":0===n.prerelease.length?n.patch++:n.prerelease.push(0),n.raw=n.format();case"":case">=":s&&!r(n,s)||(s=n);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!s||o&&!r(o,s)||(o=s)}return o&&n.test(o)?o:null},aa}(),j=Ka(),O=Va(),L=function(){if(pa)return ha;pa=1;const e=Va();return ha=(t,r,n)=>e(t,r,">",n),ha}(),P=function(){if(ma)return ba;ma=1;const e=Va();return ba=(t,r,n)=>e(t,r,"<",n),ba}(),F=function(){if(va)return ga;va=1;const e=Wa();return ga=(t,r,n)=>(t=new e(t,n),r=new e(r,n),t.intersects(r,n))}(),U=function(){if(xa)return ya;xa=1;const e=qa(),t=Ba();return ya=(r,n,i)=>{const o=[];let s=null,a=null;const c=r.sort((e,r)=>t(e,r,i));for(const t of c)e(t,n,i)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof n.raw?n.raw:String(n);return l.length<d.length?l:n},ya}(),D=function(){if(Aa)return wa;Aa=1;const e=Wa(),t=$a(),{ANY:r}=t,n=qa(),i=Ba(),o=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===r){if(1===t.length&&t[0].semver===r)return!0;e=a.includePrerelease?o:s}if(1===t.length&&t[0].semver===r){if(a.includePrerelease)return!0;t=s}const l=new Set;let d,f,h,p,b,m,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,a):"<"===t.operator||"<="===t.operator?f=u(f,t,a):l.add(t.semver);if(l.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,a),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of l){if(d&&!n(e,String(d),a))return null;if(f&&!n(e,String(f),a))return null;for(const r of t)if(!n(e,String(r),a))return!1;return!0}let v=!(!f||a.includePrerelease||!f.semver.prerelease.length)&&f.semver,y=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=c(d,e,a),p===e&&p!==d)return!1}else if(">="===d.operator&&!n(d.semver,String(e),a))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(b=u(f,e,a),b===e&&b!==f)return!1}else if("<="===f.operator&&!n(f.semver,String(e),a))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&m&&!f&&0!==h||f&&g&&!d&&0!==h||y||v)},c=(e,t,r)=>{if(!e)return t;const n=i(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,r)=>{if(!e)return t;const n=i(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};return wa=(t,r,n={})=>{if(t===r)return!0;t=new e(t,n),r=new e(r,n);let i=!1;e:for(const e of t.set){for(const t of r.set){const r=a(e,t,n);if(i=i||null!==r,r)continue e}if(i)return!1}return!0}}();return Ea={parse:i,valid:o,clean:s,inc:a,diff:c,major:u,minor:l,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:b,compareBuild:m,sort:g,rsort:v,gt:y,lt:x,eq:w,neq:A,gte:E,lte:S,cmp:_,coerce:I,Comparator:N,Range:C,satisfies:M,toComparators:k,maxSatisfying:T,minSatisfying:R,minVersion:B,validRange:j,outside:O,gtr:L,ltr:P,intersects:F,simplifyRange:U,subset:D,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}}(),Xa=se(Ga);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(Ha||(Ha={}));const Ya={[Ha.blue]:{id:Ha.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[Ha.nanoS]:{id:Ha.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>Xa.lt(Xa.coerce(e)??"","2.0.0")?4096:2048},[Ha.nanoX]:{id:Ha.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[Ha.nanoSP]:{id:Ha.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[Ha.apex]:{id:Ha.apex,productName:"Ledger Apex",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[Ha.stax]:{id:Ha.stax,productName:"Ledger Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[Ha.europa]:{id:Ha.europa,productName:"Ledger Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};Ha.blue,Ha.nanoS,Ha.nanoSP,Ha.nanoX,Ha.stax,Ha.europa;const Za=Object.values(Ya),Ja=e=>{const t=Za.find(t=>t.legacyUsbProductId===e);if(t)return t;const r=e>>8;return Za.find(e=>e.productIdMM===r)},Qa=[],ec={};for(const e in Ya){const t=Ya[e],{bluetoothSpec:r}=t;if(r)for(let e=0;e<r.length;e++){const n=r[e];Qa.push(n.serviceUuid),ec[n.serviceUuid]=ec[n.serviceUuid.replace(/-/g,"")]={deviceModel:t,...n}}}const tc=[{vendorId:11415}];async function rc(){return await navigator.usb.requestDevice({filters:tc})}async function nc(){return(await navigator.usb.getDevices()).filter(e=>11415===e.vendorId)}const ic=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices);class oc extends zo{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Ja(e.productId)}static isSupported=ic;static list=nc;static listen=e=>{let t=!1;return async function(){const e=await nc();return e.length>0?e[0]:rc()}().then(r=>{if(!t){const t=Ja(r.productId);e.next({type:"add",descriptor:r,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&18===t.code?e.error(new Mo(t.message)):e.error(new Io(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){const e=await rc();return oc.open(e)}static async openConnected(){const e=await nc();return 0===e.length?null:oc.open(e[0])}static async open(e){await e.open(),null===e.configuration&&await e.selectConfiguration(1),await sc(e);const t=e.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>255===e.interfaceClass));if(!t)throw new No("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const r=t.interfaceNumber;try{await e.claimInterface(r)}catch(t){throw await e.close(),new No(t.message)}const n=new oc(e,r),i=t=>{e===t.device&&(navigator.usb.removeEventListener("disconnect",i),n._emitDisconnect(new So))};return navigator.usb.addEventListener("disconnect",i),n}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await sc(this.device),await this.device.close()}async exchange(e){const t=await this.exchangeAtomicImpl(async()=>{const{channel:t,packetSize:r}=this;Po("apdu","=> "+e.toString("hex"));const n=((e,t)=>({makeBlocks(r){let n=Ur().Buffer.concat([Wo(r.length),r]);const i=t-5,o=Math.ceil(n.length/i);n=Ur().Buffer.concat([n,Ur().Buffer.alloc(o*i-n.length+1).fill(0)]);const s=[];for(let t=0;t<o;t++){const r=Ur().Buffer.alloc(5);r.writeUInt16BE(e,0),r.writeUInt8(5,2),r.writeUInt16BE(t,3);const o=n.slice(t*i,(t+1)*i);s.push(Ur().Buffer.concat([r,o]))}return s},reduceResponse(t,r){let{data:n,dataLength:i,sequence:o}=t||$o;if(r.readUInt16BE(0)!==e)throw new To("Invalid channel","InvalidChannel");if(5!==r.readUInt8(2))throw new To("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==o)throw new To("Invalid sequence","InvalidSequence");t||(i=r.readUInt16BE(5)),o++;const s=r.slice(t?5:7);return n=Ur().Buffer.concat([n,s]),n.length>i&&(n=n.slice(0,i)),{data:n,dataLength:i,sequence:o}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}))(t,r),i=n.makeBlocks(e);for(let e=0;e<i.length;e++)await this.device.transferOut(3,i[e]);let o,s;for(;!(o=n.getReducedResult(s));){const e=await this.device.transferIn(3,r),t=Buffer.from(e.data.buffer);s=n.reduceResponse(s,t)}return Po("apdu","<= "+o.toString("hex")),o}).catch(e=>{if(e&&e.message&&e.message.includes("disconnected"))throw this._emitDisconnect(e),new _o(e.message);throw e});return t}setScrambleKey(){}}async function sc(e){try{await e.reset()}catch(e){console.warn(e)}}var ac,cc,uc,lc,dc,fc,hc={name:b.Ledger,website:"https://www.ledger.com",connect:function(){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,oc.create()];case 1:return t=n.sent(),[4,new A.default(t).getPublicKey("44'/148'/0'")];case 2:return r=n.sent().rawPublicKey,[2,e.StrKey.encodeEd25519PublicKey(r)];case 3:throw n.sent(),new Error("Failed to connect to Ledger.");case 4:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Failed to get network from ledger")})})},isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return[4,oc.isSupported()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("ledger does not support the signAuthEntry function")})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Failed to sign the transaction with Ledger.")})})},signTransaction:function(t,r){return M(void 0,void 0,void 0,function(){var n,i,o,s,a,c;return k(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),n=new e.Transaction(t,r.network),[4,oc.create()];case 1:return i=u.sent(),[4,new A.default(i).signTransaction("44'/148'/0'",n.signatureBase())];case 2:return o=u.sent().signature,s=e.Keypair.fromPublicKey(r.address),a=s.signatureHint(),c=new e.xdr.DecoratedSignature({hint:a,signature:o}),n.signatures.push(c),[2,n.toXDR()];case 3:throw u.sent(),new Error("Failed to sign the transaction with Ledger.");case 4:return[2]}})})}},pc={name:b.Freighter,website:"https://freighter.app",connect:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,6]),[4,s.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,s.requestAccess()];case 2:if((e=t.sent()).error&&"The user rejected this request."===e.error.message)throw new Error("Failed to connect to Freighter");if(""===e.address.trim())throw new Error("Failed to connect to Freighter.");return[2,e.address];case 3:return"Failed to connect to Freighter."!==t.sent().message?[3,5]:[4,pc.connect()];case 4:return[2,t.sent()];case 5:throw new Error("Failed to connect to Freighter.");case 6:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2]})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,s.isConnected()];case 1:if(!t.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,E.default.getNetwork()];case 2:if((e=t.sent()).error)throw new Error("Failed to get network from Freighter");return[2,{network:e.network,passphrase:e.networkPassphrase}];case 3:throw t.sent(),new Error("Failed to disconnect from Rabet.");case 4:return[2]}})})},isAvailable:function(){return new Promise(function(e){var t=setTimeout(function(){e(!1)},700);setTimeout(function(){return M(void 0,void 0,void 0,function(){return k(this,function(r){try{s.isConnected().then(function(r){var n=r.isConnected,i=r.error;n?(clearTimeout(t),e(!i&&n)):setTimeout(function(){s.isConnected().then(function(r){var n=r.isConnected,i=r.error;clearTimeout(t),e(!i&&n)})},350)}).catch(function(){clearTimeout(t),e(!1)})}catch(t){e(!1)}return[2]})})},450)})},signAuthEntry:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i;return k(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,s.isConnected()];case 1:if(!o.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,s.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 2:if(r=o.sent(),n=r.error,i=r.signedAuthEntry,n||!i)throw new Error("Could not signedAuthEntry using Freighter");return[2,Buffer.from(i).toString("base64")];case 3:throw o.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,s.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if(r=i.sent(),n=r.signedMessage,r.error||!n)throw new Error("Failed to sign message using Freighter");return[2,"string"==typeof n?n:Buffer.from(n).toString("base64")];case 2:throw i.sent(),new Error("Failed to sign message using Freighter");case 3:return[2]}})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,s.isConnected()];case 1:if(!r.sent())throw new Error("Freighter Wallet is not installed or connected.");return[4,s.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 2:return[2,r.sent().signedTxXdr];case 3:throw r.sent(),new Error("Failed to sign the transaction with Freighter.");case 4:return[2]}})})}},bc={name:b.WalletConnect,website:"https://walletconnect.com",isAvailable:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return[2,!!W().config.walletConnect]})})},connect:function(){return M(void 0,void 0,void 0,function(){var e,t,r;return k(this,function(n){switch(n.label){case 0:if(!(e=W().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up. Please check your store configuration.");n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.connection.approval()];case 2:if(t=n.sent(),!(r=t.namespaces.stellar)||!r.accounts[0])throw new Error("Wallet did not approve the required Stellar namespace/account.");return[2,r.accounts[0].split(":").pop()];case 3:throw n.sent(),new Error("Failed to connect to Wallet. Ensure your wallet supports Stellar WalletConnect.");case 4:return[2]}})})},disconnect:function(){return M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:if(!(e=W().walletConnect)||!e.client)throw new Error("WalletConnect client is not set up.");r.label=1;case 1:return r.trys.push([1,3,,4]),0===(t=e.client.session.getAll()).length?[2]:[4,e.client.disconnect({topic:t[0].topic,reason:{code:6e3,message:"User explicitly disconnected."}})];case 2:return r.sent(),[3,4];case 3:throw r.sent(),new Error("Failed to disconnect from Wallet Connect. Try closing the session in your mobile wallet.");case 4:return[2]}})})},getNetwork:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Cannot reliably get the active network from WalletConnect without a specific session request.")})})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i,o;return k(this,function(s){switch(s.label){case 0:if(!(r=W().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");s.label=1;case 1:if(s.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return i=n[0],o=t.network===m.PUBLIC?X:Y,[4,r.client.request({topic:i.topic,chainId:o,request:{method:"stellar_signXDR",params:{xdr:e}}})];case 2:return[2,s.sent()];case 3:throw s.sent(),new Error("Failed to sign and submit the transaction with Wallet Connect.");case 4:return[2]}})})},signMessage:function(e,t){return M(void 0,void 0,void 0,function(){var r,n,i,o,s,a;return k(this,function(c){switch(c.label){case 0:if(!(r=W().walletConnect)||!r.client)throw new Error("WalletConnect client is not set up.");c.label=1;case 1:if(c.trys.push([1,3,,4]),0===(n=r.client.session.getAll()).length)throw new Error("WalletConnect not connected. Please connect first.");return i=n[0],o=t.network===m.PUBLIC?X:Y,s=(null===(a=i.namespaces.stellar.chains)||void 0===a?void 0:a[0])||o,[4,r.client.request({topic:i.topic,chainId:s,request:{method:"stellar_signMessage",params:{message:e}}})];case 2:return[2,c.sent()];case 3:throw c.sent(),new Error("Failed to sign message with Wallet Connect.");case 4:return[2]}})})},signAuthEntry:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){throw new Error("Stellar Auth Entry signing is not supported via standard WalletConnect methods.")})})}},mc=((ac={})[b.Freighter]=pc,ac[b.Rabet]=ho,ac[b.WalletConnect]=bc,ac[b.Hot]=lo,ac[b.Api]=ie,ac[b.Hana]=fo,ac[b.Xbull]=po,ac[b.Lobstr]=go,ac[b.Ledger]=hc,ac[b.Albedo]=bo,ac[b.Klever]=mo,ac[b.Bitget]=yo,ac[b.Onekey]=vo,ac),gc={mainnet:e.Networks.PUBLIC,testnet:e.Networks.TESTNET,sandbox:e.Networks.SANDBOX,futurenet:e.Networks.FUTURENET,standalone:e.Networks.STANDALONE},vc=((cc={})[gc.mainnet]={name:"Mainnet",horizon:"https://horizon.stellar.org",soroban:"https://mainnet.sorobanrpc.com"},cc[gc.testnet]={name:"Testnet",horizon:"https://horizon-testnet.stellar.org",soroban:"https://soroban-testnet.stellar.org"},cc[gc.futurenet]={name:"Futurenet",horizon:"https://horizon-futurenet.stellar.org",soroban:"https://rpc-futurenet.stellar.org"},cc),yc={steexp:(uc={},uc[gc.mainnet]="https://steexp.com",uc[gc.testnet]="https://testnet.steexp.com",uc.ledgerUrl="ledger",uc.transactionUrl="tx",uc.accountUrl="account",uc),stellarexpert:(lc={},lc[gc.mainnet]="https://stellar.expert/explorer/public",lc[gc.testnet]="https://stellar.expert/explorer/testnet",lc.ledgerUrl="ledger",lc.accountUrl="account",lc.transactionUrl="tx",lc),lumenscan:(dc={},dc[gc.mainnet]="https://lumenscan.io",dc[gc.testnet]="https://testnet.lumenscan.io",dc.ledgerUrl="ledgers",dc.accountUrl="account",dc.operationUrl="ops",dc.transactionUrl="txns",dc),stellarchain:(fc={},fc[gc.mainnet]="https://stellarchain.io",fc[gc.testnet]="https://testnet.stellarchain.io",fc[gc.futurenet]="https://futurenet.stellarchain.io",fc.ledgerUrl="ledgers",fc.accountUrl="accounts",fc.operationUrl="operations",fc.transactionUrl="transactions",fc)},xc={logInOrSignUp:{en:"Log in or Sign up"},profile:{en:"Profile"},confirmation:{en:"Confirmation"},send:{en:"Send"},activity:{en:"Activity"},swap:{en:"Swap"},receive:{en:"Receive"},wrongNetwork:{en:"Wrong Network"},balances:{en:"Balances"},whatIsBlux:{en:"What is Blux"},addToken:{en:"Add Token"},signMessage:{en:"Sign Message"},selectAsset:{en:"Select Asset"},walletConnect:{en:"Wallet Connect"},acceptTermsAndPrivacy:{en:"By signing in or creating an account, you agree to our Terms and Conditions and Privacy Policy."},receiveFunds:{en:"Receive Funds"},addFunds:{en:"Add Funds"},termsAndConditions:{en:"Terms and Conditions"},loading:{en:"Loading"},tryAgain:{en:"Try again"},connecting:{en:"Connecting"},signing:{en:"Signing"},or:{en:"or"},recent:{en:"Recent"},allStellarWallets:{en:"All Stellar wallets"},email:{en:"Email"},logInWithPasskey:{en:"Log in with Passkey"},submit:{en:"Submit"},poweredByBlux:{en:"Powered by Blux.cc"},reviewAndAcceptPrompt:{en:"Review the documents below, then agree to continue."},termsOfService:{en:"Terms of Service"},privacyPolicy:{en:"Privacy Policy"},openLink:{en:"Open link"},noLegalLinksProvided:{en:"No legal links were provided for this app."},agree:{en:"Accept & Continue"},disagree:{en:"No thanks"},connectionSuccessfulTitle:{en:"Connection Successful"},connectionSuccessfulMessage:{en:"Your account has been successfully connected to ${appName}"},transactionSuccessfulTitle:{en:"Transaction Successful"},transactionSuccessfulMessage:{en:"Your transaction was successfully completed"},messageSignedTitle:{en:"Message Signed"},messageSignedMessage:{en:"Your message has been signed successfully."},authEntrySignedTitle:{en:"Authorization Signed"},authEntrySignedMessage:{en:"Authorization has been signed successfully."},seeInExplorer:{en:"See in explorer"},loggingIn:{en:"Logging In"},done:{en:"Done"},signTransactionPrompt:{en:"wants your permission to approve the following transaction."},invalidXdr:{en:"Invalid XDR"},lobstrWarning:{en:"Ensure that your LOBSTR wallet is set to the ${network} network. Otherwise, the transaction will definitely fail."},yourWallet:{en:"Your wallet"},noAddressFound:{en:"No address found"},approve:{en:"Approve"},loadingActivity:{en:"Loading activity..."},noActivityFound:{en:"No activity found"},multiOperation:{en:"Multi Operation"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}"},seeAllInExplorer:{en:"See all in explorer"},enterConfirmationCodeTitle:{en:"Enter confirmation code"},enterConfirmationCodeHelp:{en:"Please check your email and enter confirmation code below"},invalidCodeError:{en:"Invalid code, please try again."},resendCode:{en:"Resend code"},copied:{en:"Copied!"},logout:{en:"Logout"},search:{en:"Search"},noAssetsFound:{en:"No assets found"},amount:{en:"Amount"},max:{en:"Max"},to:{en:"To"},enterAddress:{en:"Enter address"},addressRequired:{en:"Address is required"},addressInvalid:{en:"Address is invalid"},inactiveAccount:{en:"Account is inActive"},memo:{en:"Memo"},enterMemo:{en:"Enter Memo"},optional:{en:"optional"},paste:{en:"Paste"},amountRequired:{en:"Amount is required"},amountExceedsBalance:{en:"Amount is greater than max balance"},sendButton:{en:"Send"},loginFailed:{en:"Login failed"},signingFailed:{en:"Signing with ${walletName} failed"},waitingFor:{en:"Waiting for ${walletName}"},signingWith:{en:"Signing with ${walletName}"},loginRetryMessage:{en:"Please try logging in again."},signingRetryMessage:{en:"Please try signing again."},acceptConnection:{en:"Accept connection"},signRequestInWallet:{en:"Sign the request in your wallet"},wrongNetworkMessage:{en:"You’re currently connected to the Stellar ${currentNetwork}. Please switch to the Stellar ${switchNetwork} to continue using this app."},wallet_infra:{en:"Wallet Infrastructure for Stellar dapps"},blux_gateway:{en:"Blux is your gateway to Stellar. Create a wallet, manage assets, and sign transactions easily and securely."},enter_token_address:{en:"Enter token address"},enter_address:{en:"enter address"},check:{en:"Check"},cancel:{en:"Cancel"},add_token:{en:"Add token"},network:{en:"Network"},address:{en:"Address"},market_cap:{en:"Market cap"},total_volume:{en:"Total volume"},all_time_high:{en:"All time high"},copy_address:{en:"Copy address"},address_copied:{en:"Address copied"},add_new_token:{en:"Add new token"},assets:{en:"Assets"},tokens:{en:"Tokens"},nfts:{en:"NFTs"},no_balance_message:{en:"Looks like there’s nothing here yet."},sign_permission:{en:"wants your permission to sign the following message:"}},wc=function(e){return"native"===e.asset_type?"native":"credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type?Fc(e.asset_issuer,4):"liquidity_pool_shares"===e.asset_type?Fc(e.liquidity_pool_id,4):""},Ac=function(t){return"native"===t.assetType?e.Asset.native():new e.Asset(t.assetCode,t.assetIssuer)},Ec=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return[4,fetch(e,t)];case 1:return[4,(r=i.sent()).json()];case 2:return n=i.sent(),[2,N({status:r.status},n)]}})})},Sc=function(e){var t={valueInCurrency:"0",assetBalance:e.balance||"0",assetType:e.asset_type};return"native"===e.asset_type?(t.assetCode="XLM",t.assetIssuer=""):"liquidity_pool_shares"===e.asset_type?(t.assetCode="LiquidtyPool",t.assetIssuer=""):(t.assetCode=e.asset_code,t.assetIssuer=e.asset_issuer),t},_c=function(e){var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1))},Ic=function(e){return navigator.clipboard.writeText(e)},Nc=function(e){return"send"===e?g.SEND:g.SWAP},Cc=function(e){var t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},Mc=function(e,t,r,n){var i=yc[t];i||(i=yc.stellarchain);var o=i[e];return o?"".concat(o,"/").concat(i[r],"/").concat(n):null},kc=function(){var e=localStorage.getItem(G);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Tc=function(e){var t=Object.entries(m).find(function(t){return t[1]===e});if(!t)throw new Error("Unknown network passphrase: ".concat(e));return t[0].toLowerCase()},Rc=function(e,t){var r=vc[e],n=t[e];if(!r&&!n)throw new Error("BLUX: Custom network has no transports.");return!r&&n&&(r={name:"Custom Network",horizon:"",soroban:""}),n&&(n.horizon&&(r.horizon=n.horizon),n.soroban&&(r.soroban=n.soroban)),r},Bc=function(e){return M(void 0,void 0,void 0,function(){return k(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.getNetwork()];case 1:return[2,t.sent().passphrase];case 2:return t.sent(),[2,""];case 3:return[2]}})})},jc=function(e,t){var r,n,i;if(void 0===t&&(t=1),3===(e=e.replace(/^#/,"")).length)r=parseInt(e[0]+e[0],16),n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16);else{if(6!==e.length&&8!==e.length)throw new Error("Invalid hex color: ".concat(e));r=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)}return"rgba(".concat(r,", ").concat(n,", ").concat(i,", ").concat(t,")")},Oc=function(e,t){void 0===t&&(t=!1);var r="number"==typeof e?e:parseFloat(e);if(isNaN(r)||0===r)return"0";if(r<1e-6)return e.toString();if(t){if(r>=1e6)return"".concat((r/1e6).toFixed(2),"m");if(r>=1e3)return"".concat((r/1e3).toFixed(2),"k")}return $c(Wc(r))},Lc=function(e){var t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},Pc=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return o=function(e){"https://mobile.rabet.io"===e.origin&&"RABET/INSTALL"===e.data.type&&(new Function(e.data.message)(),window.removeEventListener("message",o))},window.addEventListener("message",o),[4,(i=e,M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(mc).map(function(e){return M(void 0,void 0,void 0,function(){var t;return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),i.includes(e.name.toLowerCase())?[2,{wallet:e,isAvailable:!1}]:[4,e.isAvailable()];case 1:return t=r.sent(),[2,{wallet:e,isAvailable:t}];case 2:return r.sent(),[2,{wallet:e,isAvailable:!1}];case 3:return[2]}})})}))];case 1:return[2,e.sent().filter(function(e){return!!e.isAvailable}).map(function(e){return e.wallet})]}})}))];case 1:return t=n.sent(),r=function(e){for(var t=kc(),r=new Map(e.map(function(e){return[e.name,e]})),n=[],i=new Set,o=0,s=t;o<s.length;o++){var a=s[o],c=r.get(a);c&&(n.push(c),i.add(a))}var u=e.filter(function(e){return!i.has(e.name)});return T(T([],n,!0),u,!0).map(function(e,t){return N(N({},e),{isRecent:0===t})})}(t),[2,r]}var i,o})})},Fc=function(e,t){return void 0===t&&(t=8),e.slice(0,t)+"..."+e.slice(-t)},Uc=function(e){return new Promise(function(t){return setTimeout(t,e)})},Dc=function(e){return e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,function(e){return e.toUpperCase()})},zc=function(e,t){return void 0===t&&(t={}),e.replace(/\$\{(\w+)\}/g,function(e,r){return t[r]||""})},Wc=function(e){var t,r=e.toString().split("."),n=r[0],i=r[1],o=void 0===i?"":i;if(!o)return n;var s=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[n.length])&&void 0!==t?t:0;if(s>0){var a="".concat(n,".").concat(o.slice(0,s)),c=parseFloat(a);return Number.isInteger(c)?n:c.toFixed(2)}return n},$c=function(e){var t=e.split("."),r=t[0],n=t[1];return n?"".concat(r.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(n):r.replace(/\B(?=(\d{3})+(?!\d))/g,",")},qc=function(e,t){return"email"===e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):""!==t.trim()},Kc=function(e,t,r,n){return M(void 0,void 0,void 0,function(){return k(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signMessage))throw new Error("Wallet does not support signMessage.");return[4,e.signMessage(t,{address:r,network:n})];case 1:return[2,i.sent()]}})})},Vc=function(t,r){try{var n=new e.Transaction(t,r),i=n.operations[0],o=null;return o="payment"===i.type||"pathPaymentStrictSend"===i.type||"pathPaymentStrictReceive"===i.type?i.destination:"",{action:i.type,operations:n.operations.length,sender:n.source,receiver:o,estimatedFee:Number(n.fee)/1e7}}catch(e){return null}},Hc=function(e,t,r,n){return M(void 0,void 0,void 0,function(){return k(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signTransaction))throw new Error("Wallet does not support transaction signing.");return[4,e.signTransaction(t,{network:n,address:r})];case 1:return[2,i.sent()]}})})};function Gc(t,r,n){return M(this,void 0,void 0,function(){var i,o,s;return k(this,function(a){switch(a.label){case 0:if(!(i=Rc(r,n).horizon))throw new Error("Horizon RPC was not found.");return o=new e.Horizon.Server(i),s=new e.Transaction(t,r),[4,o.submitTransaction(s)];case 1:return[2,a.sent()]}})})}var Xc=function(e,t,r,n,i,o){return M(void 0,void 0,void 0,function(){var s;return k(this,function(a){switch(a.label){case 0:return[4,Hc(e,t,r,n)];case 1:return s=a.sent(),o?[4,Gc(s,n,i||{})]:[3,3];case 2:return[2,a.sent()];case 3:return[2,s]}})})},Yc="__BLUX__RECENT_LOGIN_CONFIG",Zc=function(e,t){return Date.now()-e<=t},Jc=function(e,t,r,n){void 0===r&&(r=Date.now()),"undefined"!=typeof window&&localStorage.setItem(Yc,JSON.stringify({authMethod:e,authValue:t,timestamp:r,jwt:n}))},Qc=function(){"undefined"!=typeof window&&localStorage.removeItem(Yc)},eu=function(){return M(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s,a,c,u;return k(this,function(l){switch(l.label){case 0:if((e=W()).authState.isAuthenticated&&e.user)return[2,!0];if(!(t=function(){if("undefined"==typeof window)return null;var e=localStorage.getItem(Yc);if(!e)return null;try{var t=JSON.parse(e);return"string"!=typeof t.authMethod||"string"!=typeof t.authValue||"number"!=typeof t.timestamp?null:t}catch(e){return null}}())||!Zc(t.timestamp,216e5))return[2,!1];if("email"!==t.authMethod||!t.jwt)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,te(t.jwt)];case 2:return r=l.sent(),$(function(e){return N(N({},e),{user:{address:r.public_key,walletPassphrase:"",authMethod:"email",authValue:r.auth_value}})}),e.connectWalletSuccessful(r.public_key,(null===(c=e.stellar)||void 0===c?void 0:c.activeNetwork)||""),e.setIsAuthenticated(!0),(n=W().user)&&W().emitter.emit(exports.BluxEvent.LoggedIn,{user:n}),Jc("email",(null===(u=e.user)||void 0===u?void 0:u.authValue)||"",Date.now(),t.jwt),[2,!0];case 3:return l.sent(),[2,!1];case 4:if(!t||!Zc(t.timestamp,24e5))return[2,!1];if(!(i=e.wallets.find(function(e){return e.name===t.authValue})))return[2,!1];l.label=5;case 5:return l.trys.push([5,11,,12]),[4,i.connect()];case 6:if(!(o=l.sent())||""===o.trim())return[2,!1];$(function(e){return N(N({},e),{user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:i.name}})}),s="",l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Bc(i)];case 8:return s=l.sent(),[3,10];case 9:return l.sent(),[3,10];case 10:return e.connectWalletSuccessful(o,s),e.setIsAuthenticated(!0),(a=W().user)&&W().emitter.emit(exports.BluxEvent.LoggedIn,{user:a}),Jc("wallet",i.name,Date.now(),""),[2,!0];case 11:return l.sent(),[2,!1];case 12:return[2]}})})},tu=function(e,t,r,n){return M(void 0,void 0,void 0,function(){return k(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signAuthEntry))throw new Error("Wallet does not support signAuthEntry.");return[4,e.signAuthEntry(t,{address:r,network:n})];case 1:return[2,i.sent()]}})})},ru=function(e){var t,r,n=W();if(n.user&&n.user.address)return Promise.resolve(n.user);var i=new Promise(function(e,n){t=e,r=n});return n.setLogin({promise:i,isSilent:e,resolver:t,rejecter:r}),e?(eu().then(function(){var e=W().user;e&&t(e)}).catch(function(){}).finally(function(){n.setLogin(void 0)}),i):(M(void 0,void 0,void 0,function(){var e,r,i;return k(this,function(o){switch(o.label){case 0:if(e=W(),!(null===(i=e.login)||void 0===i?void 0:i.isSilent)||!e.login.promise)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.login.promise];case 2:case 3:return o.sent(),[3,4];case 4:if(W().user)return t(W().user),n.setLogin(void 0),[2];o.label=5;case 5:return(r=W()).modal.isOpen||r.openModal(g.ONBOARDING),[2]}})}).catch(function(e){r(e),n.setLogin(void 0)}),i)},nu=function(e,t,r){return new Promise(function(n,i){var o=W();if(o.authState.isAuthenticated&&o.stellar&&o.user)if(o.modal.isOpen)i(new Error("Blux modal is open elsewhere."));else{var s=o.stellar.activeNetwork;if(r&&r.network&&(s=r.network),Vc(e,s)){var a=o.wallets.find(function(e){return e.name===o.user.authValue});if(!a)throw new Error("Could not find the connected wallet.");var c={xdr:e,rejecter:i,resolver:n,result:void 0,options:N({network:s},r),shouldSubmit:t};o.setSendTransaction(c,o.config.showWalletUIs),o.config.showWalletUIs||Xc(a,e,o.user.address,s,o.config.transports||{},c.shouldSubmit).then(function(e){n(e)}).catch(function(e){i(e)})}else i("Invalid XDR")}else i(new Error("User is not authenticated."))})},iu=function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,nu(e,!0,t)];case 1:return[2,r.sent()]}})})},ou={login:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return W().authState.isReady?[3,2]:[4,Uc(50)];case 1:return e.sent(),[3,0];case 2:return[2,ru(!1)]}})})},logout:function(){(0,W().logoutAction)(),localStorage.removeItem(H),Qc(),W().emitter.emit(exports.BluxEvent.LoggedOut,void 0)},fundMe:function(){var e=W();if(!e.authState.isAuthenticated||!e.stellar||!e.user)throw new Error("Blux: user is not authenticated yet.");if(e.modal.isOpen)throw new Error("Blux modal is open elsewhere.");e.modal.isOpen||e.openModal(g.FUND_ME)},profile:function(){var e=W(),t=e.openModal,r=e.authState,n=e.modal;if(!r.isAuthenticated)throw new Error("User is not authenticated.");n.isOpen||t(g.PROFILE)},signMessage:function(e,t){return new Promise(function(r,n){var i=W();if(i.authState.isAuthenticated&&i.stellar&&i.user)if(i.modal.isOpen)n(new Error("Blux modal is open elsewhere."));else{var o=i.stellar.activeNetwork;t&&t.network&&(o=t.network);var s=i.wallets.find(function(e){return e.name===i.user.authValue});if(!s)throw new Error("Could not find the connected wallet.");var a={message:e,options:t||{network:o},rejecter:n,resolver:r,result:void 0};i.setSignMessage(a,i.config.showWalletUIs),i.config.showWalletUIs||Kc(s,e,i.user.address,o).then(function(e){r(e)}).catch(function(e){n(e)})}else n(new Error("User is not authenticated."))})},signAuthEntry:function(e,t){return new Promise(function(r,n){var i=W();if(i.authState.isAuthenticated&&i.stellar&&i.user)if(i.modal.isOpen)n(new Error("Blux modal is open elsewhere."));else{var o=i.stellar.activeNetwork;t&&t.network&&(o=t.network);var s=i.wallets.find(function(e){return e.name===i.user.authValue});if(!s)throw new Error("Could not find the connected wallet.");var a={authEntry:e,options:t||{network:o},rejecter:n,resolver:r,result:void 0};i.setSignAuthEntry(a,i.config.showWalletUIs),i.config.showWalletUIs||tu(s,e,i.user.address,o).then(function(e){r(e)}).catch(function(e){n(e)})}else n(new Error("User is not authenticated."))})},signTransaction:function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,nu(e,!1,t)];case 1:return[2,r.sent()]}})})},sendTransaction:iu,get isReady(){return W().authState.isReady},get isAuthenticated(){return W().authState.isAuthenticated},get user(){return W().user}},su="logos",au=function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return[4,uu("https://cdn2.blux.cc/core-assets/logos2.json.gz")];case 1:return e=t.sent(),[4,lu(e)];case 2:return[2,t.sent().files]}})})},cu=function(){return M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,au()];case 1:return e=r.sent(),[4,du()];case 2:return t=r.sent(),[4,fu(t,e)];case 3:case 4:return r.sent(),[3,5];case 5:return[2]}})})},uu=function(e){return M(void 0,void 0,void 0,function(){var t;return k(this,function(r){switch(r.label){case 0:return[4,fetch(e)];case 1:if(!(t=r.sent()).ok)throw new Error("Failed to fetch: ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,r.sent()]}})})},lu=function(e){return M(void 0,void 0,void 0,function(){var t,r,n;return k(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),r=new Blob([e]).stream().pipeThrough(t),[4,new Response(r).text()];case 1:return n=i.sent(),[2,JSON.parse(n)]}})})},du=function(){return new Promise(function(e,t){var r=indexedDB.open("blux-cache",1);r.onupgradeneeded=function(){var e=r.result;e.objectStoreNames.contains(su)||e.createObjectStore(su,{keyPath:"id"})},r.onsuccess=function(t){e(r.result)},r.onerror=function(){t(r.error)},r.onblocked=function(e){}})},fu=function(e,t){return M(void 0,void 0,void 0,function(){return k(this,function(r){return[2,new Promise(function(r,n){var i=e.transaction(su,"readwrite"),o=i.objectStore(su);o.clear(),t.forEach(function(e){return o.put(e)}),i.oncomplete=function(){return r()},i.onerror=function(){return n(i.error)}})]})})},hu=function(e){return M(void 0,void 0,void 0,function(){return k(this,function(t){return[2,new Promise(function(t,r){var n=e.transaction(su,"readonly").objectStore(su).getAll();n.onsuccess=function(){t(n.result||[])},n.onerror=function(){return r(n.error)}})]})})},pu=function(){return!!W().stellar},bu=function(e){var t=W().user;if(!t&&!e)throw new Error("Address not found");return e||(null==t?void 0:t.address)},mu=function(t){var r,n=W(),i=n.stellar,o=n.config;if(!t){if(i)return{horizon:i.servers.horizon,soroban:i.servers.soroban,networkPassphrase:i.activeNetwork};throw new Error("Custom network has no transports.")}var s=Rc(t,null!==(r=o.transports)&&void 0!==r?r:{}),a=s.horizon,c=s.soroban;return{networkPassphrase:t,soroban:new e.rpc.Server(c),horizon:new e.Horizon.Server(a)}},gu=function(e){var t,r,n=W(),i=(null===(t=n.stellar)||void 0===t?void 0:t.activeNetwork)||"";if(0===n.config.networks.length)throw new Error("switchNetwork must be called after createConfig");if(!n.config.networks.includes(e))throw new Error("New network must be defined in config.networks");if(!n.stellar)throw new Error("Could not find the current activeNetwork");n.setStellar({activeNetwork:e,servers:null===(r=n.stellar)||void 0===r?void 0:r.servers}),i&&i!==e&&W().emitter.emit(exports.BluxEvent.NetworkChanged,{previousNetwork:i,network:e})},vu=function(e,t,r){var n=mu(r.network).horizon,i=n[e].apply(n,t);return r.cursor&&i.cursor(r.cursor),r.limit&&i.limit(r.limit),r.order&&i.order(r.order),i},yu=function(t){return M(void 0,void 0,void 0,function(){var r,n,i,o,s,a;return k(this,function(c){switch(c.label){case 0:if(pu(),r=bu(t.address),n=mu(t.network).horizon,!e.StrKey.isValidEd25519PublicKey(r))throw new Error("Invalid address");c.label=1;case 1:return c.trys.push([1,3,,4]),[4,n.loadAccount(r)];case 2:return i=c.sent(),t.includeZeroBalances?[2,i.balances]:(o=i.balances.filter(function(e){return 0!==Number(e.balance)}),s=o.find(function(e){return"native"===e.asset_type}),a=o.filter(function(e){return"native"!==e.asset_type}),s?[2,T([s],a,!0)]:[2,a]);case 3:return c.sent(),[2,[]];case 4:return[2]}})})},xu=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return pu(),[4,(r=vu("strictReceivePaths",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},wu=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return pu(),[4,(r=vu("strictSendPaths",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},Au=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("transactions",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},Eu={mainnet:e.Networks.PUBLIC,testnet:e.Networks.TESTNET,sandbox:e.Networks.SANDBOX,futurenet:e.Networks.FUTURENET,standalone:e.Networks.STANDALONE},Su=function(e,t){return"string"===t?e.toString():"number"===t?Number(e):BigInt(e)},_u=function(e,t,r){var n=t/8,i=BigInt(e).toString(16);r&&e<BigInt(0)&&(i=((BigInt(1)<<BigInt(t))+e).toString(16).replace(/^-/,""));i.length%2!=0&&(i="0".concat(i));for(var o=2*n;i.length<o;)i="0".concat(i);if(i.length>o)throw new Error("BigNumber ".concat(e," overflows ").concat(t,"-bit representation"));for(var s=new Uint8Array(n),a=0,c=0;a<n;)s[a]=parseInt(i.slice(c,c+2),16),a+=1,c+=2;return r&&e<BigInt(0)&&(s[0]|=128),Buffer.from(s)},Iu=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=BigInt(0),i=0,o=t;i<o.length;i++){var s=o[i];n<<=BigInt(8),n|=BigInt(s)}if(e&&0!==(void 0!==t[0]?128&t[0]:0)){var a=BigInt(8*t.length);n-=BigInt(1)<<a}return n},Nu=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error("BigInt ".concat(e," is outside the safe integer range for Number type."));return Number(e)},Cu=function(t){var r=t,n=Nu(r&BigInt(4294967295)),i=Number(r>>BigInt(32)&BigInt(4294967295));return i>=2147483648&&(i-=4294967296),new e.xdr.Int64([n,i])},Mu=function(t){var r=Nu(t&BigInt(4294967295)),n=Nu(t>>BigInt(32)&BigInt(4294967295));return new e.xdr.Uint64([r,n])};function ku(e){return"object"!=typeof e||null===e||Array.isArray(e)}var Tu=function(t){if(!t)return e.xdr.ScVal.scvMap(null);for(var r=[],n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],a=o[1],c="string"==typeof s?Ru.symbol(s):s;"object"!=typeof a||null===a||ku(a)?r.push(new e.xdr.ScMapEntry({key:c,val:a})):r.push(new e.xdr.ScMapEntry({key:c,val:Tu(a)}))}return e.xdr.ScVal.scvMap(r)},Ru=function(){function t(){}return t.i32=function(t){var r=Su(t,"number");return e.xdr.ScVal.scvI32(r)},t.i64=function(t){var r=Su(t,"bigint");return e.xdr.ScVal.scvI64(Cu(r))},t.i128=function(t){return function(t){var r=_u(t,128,!0),n=r.subarray(0,8),i=r.subarray(8,16),o=Cu(Iu.apply(void 0,T([!0],n,!1))),s=Mu(Iu.apply(void 0,T([!1],i,!1)));return e.xdr.ScVal.scvI128(new e.xdr.Int128Parts({lo:s,hi:o}))}(Su(t,"bigint"))},t.i256=function(t){return function(t){var r=_u(t,256,!0),n=r.subarray(0,8),i=r.subarray(8,16),o=r.subarray(16,24),s=r.subarray(24,32),a=Cu(Iu.apply(void 0,T([!0],n,!1))),c=Mu(Iu.apply(void 0,T([!1],i,!1))),u=Mu(Iu.apply(void 0,T([!1],o,!1))),l=Mu(Iu.apply(void 0,T([!1],s,!1)));return e.xdr.ScVal.scvI256(new e.xdr.Int256Parts({hiHi:a,hiLo:c,loHi:u,loLo:l}))}(Su(t,"bigint"))},t.u32=function(t){var r=Su(t,"number");return e.xdr.ScVal.scvU32(r)},t.u64=function(t){var r=Su(t,"bigint");return e.xdr.ScVal.scvU64(Mu(r))},t.u128=function(t){return function(t){var r=_u(t,128,!1),n=r.subarray(0,8),i=r.subarray(8,16),o=Mu(Iu.apply(void 0,T([!1],n,!1))),s=Mu(Iu.apply(void 0,T([!1],i,!1)));return e.xdr.ScVal.scvU128(new e.xdr.UInt128Parts({hi:o,lo:s}))}(Su(t,"bigint"))},t.u256=function(t){return function(t){var r=_u(t,256,!1),n=r.subarray(0,8),i=r.subarray(8,16),o=r.subarray(16,24),s=r.subarray(24,32),a=Mu(Iu.apply(void 0,T([!1],n,!1))),c=Mu(Iu.apply(void 0,T([!1],i,!1))),u=Mu(Iu.apply(void 0,T([!1],o,!1))),l=Mu(Iu.apply(void 0,T([!1],s,!1)));return e.xdr.ScVal.scvU256(new e.xdr.UInt256Parts({hiHi:a,hiLo:c,loHi:u,loLo:l}))}(Su(t,"bigint"))},t.error=function(t){return e.xdr.ScVal.scvError(t)},t.duration=function(t){var r=Su(t,"bigint"),n=Mu(r);return e.xdr.ScVal.scvDuration(n)},t.timepoint=function(t){var r=Su(t,"bigint"),n=Mu(r);return e.xdr.ScVal.scvTimepoint(n)},t.ledgerKeyNonce=function(t){return e.xdr.ScVal.scvLedgerKeyNonce(t)},t.contractInstance=function(t){return e.xdr.ScVal.scvContractInstance(t)},t.scvMap=function(t){return e.xdr.ScVal.scvMap(t)},t.map=function(e){return Tu(e)},t.string=function(t){return e.xdr.ScVal.scvString(t)},t.vec=function(t){return e.xdr.ScVal.scvVec(t)},t.void=function(){return e.xdr.ScVal.scvVoid()},t.bytes=function(t){return e.xdr.ScVal.scvBytes(t)},t.ledgerKeyContractInstance=function(){return e.xdr.ScVal.scvLedgerKeyContractInstance()},t.symbol=function(t){return e.xdr.ScVal.scvSymbol(t)},t.boolean=function(t){return e.xdr.ScVal.scvBool(t)},t.address=function(t){return e.Address.fromString(t).toScVal()},t}(),Bu=W().setAppearance,ju={on:function(e,t){return W().emitter.on(e,t)},off:function(e,t){return W().emitter.off(e,t)},once:function(e,t){return W().emitter.once(e,t)}};var Ou,Lu=function(e){var t,r,n,i,o=e.isOpen,s=e.onClose,c=void 0===s?function(){}:s,l=e.children,d=e.isSticky,f=void 0!==d&&d,h=e.appearance,p=e.isPersistent,b=a.useRef(null),m=a.useState(!1),g=m[0],v=m[1],y=function(e){void 0===e&&(e=460);var t=a.useState(!1),r=t[0],n=t[1];return a.useEffect(function(){var t=function(){return n(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),r}(),x=function(e,t){void 0===t&&(t=300);var r=a.useState({isOpening:!1,isClosing:!1}),n=r[0],i=r[1];return a.useEffect(function(){if(e){i({isOpening:!0,isClosing:!1});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1})},t);return function(){return clearTimeout(r)}}},[e,t]),N(N({},n),{handleClose:function(e){i({isOpening:!1,isClosing:!0});var r=setTimeout(function(){i({isOpening:!1,isClosing:!1}),e()},t);return function(){return clearTimeout(r)}}})}(o,250),w=x.isClosing,A=x.handleClose,E=function(e,t){void 0===t&&(t=[]);var r=a.useState("auto"),n=r[0],i=r[1],o=a.useState(!1),s=o[0],c=o[1],u=a.useState(!1),l=u[0],d=u[1];return a.useEffect(function(){var t=e.current;if(t){var r=!1,n=function(){r||t.offsetParent&&(i(t.offsetHeight),c(!0))},o=Array.from(t.getElementsByTagName("img")).filter(function(e){return!(e.complete&&e.naturalHeight>0)});if(0!==o.length){var s=o.length,a=function(){0==(s-=1)&&requestAnimationFrame(function(){return requestAnimationFrame(n)})};return o.forEach(function(e){e.addEventListener("load",a),e.addEventListener("error",a)}),function(){r=!0,o.forEach(function(e){e.removeEventListener("load",a),e.removeEventListener("error",a)})}}requestAnimationFrame(function(){return requestAnimationFrame(n)})}},T(T([],t,!0),[l],!1)),{height:n,isHeightReady:s,reset:function(){c(!1),i("auto"),d(function(e){return!e})}}}(b,[o,l]),S=E.height,_=E.isHeightReady,I=E.reset;return a.useEffect(function(){if(o&&y){v(!1);var e=requestAnimationFrame(function(){v(!0)});return function(){return cancelAnimationFrame(e)}}},[o,y]),i=o,a.useEffect(function(){return document.body.style.overflow=i?"hidden":"",function(){document.body.style.overflow=""}},[i]),a.useEffect(function(){o||I()},[o]),o?u.jsxs(u.Fragment,{children:[!p&&u.jsx("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-40 ".concat(w&&!f?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),style:{backdropFilter:"blur(".concat(h.backdropBlur,")"),WebkitBackdropFilter:"blur(".concat(h.backdropBlur,")"),backgroundColor:h.backdropColor},onClick:f?function(){}:c}),u.jsx("div",{className:"bluxcc:absolute bluxcc:inset-0 bluxcc:z-9999999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ".concat(w&&!f&&"bluxcc:animate-fadeOut"),onClick:function(e){e.target!==e.currentTarget||f||A(c)},children:u.jsx("div",{id:"bluxcc-modal",className:"bluxcc:box-border ".concat(y?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:w-full bluxcc:rounded-b-none!":"bluxcc:relative bluxcc:w-90!"),style:{height:"number"==typeof S?"".concat(y?S+20:S,"px"):S,transition:_?"height 250ms ease-in-out, border-radius 250ms, opacity 250ms ease-out, outline 250ms ease-out, color 250ms ease-out".concat(y?", transform 250ms ease-out":""):"border-radius 250ms, opacity 250ms ease-out".concat(y?", transform 250ms ease-out":""),transform:y?w?"translateY(100%)":g?"translateY(0%)":"translateY(80%)":"",background:h.background,opacity:w&&!f?"0":"1",color:h.textColor,fontFamily:h.fontFamily,letterSpacing:"-0.04px",borderRadius:null!==(t=h.outlineRadius)&&void 0!==t?t:h.borderRadius,outline:"".concat(null!==(r=h.outlineWidth)&&void 0!==r?r:h.borderWidth," solid ").concat(null!==(n=h.outlineColor)&&void 0!==n?n:h.borderColor),overflow:"hidden",boxShadow:h.boxShadow},children:u.jsx("div",{ref:b,className:"bluxcc:px-6 bluxcc:pb-4",style:{fontFamily:h.fontFamily,opacity:_?1:0,transition:"opacity 200ms ease-in-out"},children:l})})})]}):null},Pu=function(e){var t=e.className,r=e.name,n=e.props,i=void 0===n?{}:n,o=C(e,["className","name","props"]),s=V(function(e){return e.logos}),c=a.useState(""),l=c[0],d=c[1],f=a.useMemo(function(){return null==s?void 0:s.find(function(e){return e.name===r})},[s,r]);if(!s||!f){var h="".concat("https://cdn.blux.cc/files","/").concat(encodeURIComponent(r)),p=Object.entries(i).map(function(e){return"".concat(encodeURIComponent(e[0]),"=").concat(encodeURIComponent(e[1]))}).join("&"),b="".concat(h,"?").concat(p);return u.jsx("img",{src:b,alt:r})}return a.useEffect(function(){var e=f.content,t=new Map;(f.default_values||[]).forEach(function(e){var r=e.name,n=e.value;t.set(r,n)}),Object.entries(i).forEach(function(e){var r=e[0],n=e[1];t.set(r,n)}),t.forEach(function(t,r){var n=new RegExp("{{".concat(r,"}}"),"g");e=e.replace(n,t)}),d(e)},[f,i]),l?u.jsx("div",N({dangerouslySetInnerHTML:{__html:l}},o,{className:t})):u.jsx("div",{style:{width:50,height:50,background:"transparent",objectFit:"contain"}})};!function(e){e.Blux="blux.svg",e.SmallBlux="smallblux.svg",e.About="about.svg",e.ArrowRight="arrowright.svg",e.ArrowLeft="arrowleft.svg",e.Close="close.svg",e.Loading="loading.svg",e.Search="search.svg",e.GreenCheck="greencheck.svg",e.LogOut="logout.svg",e.Copy="copy.svg",e.LargeCopy="largecopy.svg",e.History="history.svg",e.Send="send.svg",e.ArrowDropUp="arrowdropup.svg",e.ArrowDropDown="arrowdropdown.svg",e.RedAlert="redalert.svg",e.Upstream="upstream.svg",e.MultiOperation="multioperation.svg",e.Downstream="downstream.svg",e.Globe="globe.svg",e.SmallEmail="smallemail.svg",e.MoonPayLogo="moonpaylogo.svg",e.Email="email.svg",e.RedExclamation="redexclamation.svg",e.WrongNetwork="wrongnetwork.svg",e.Swap="swap.svg",e.SmallSwap="smallswap.svg",e.Receive="receive.svg",e.Balances="balances.svg",e.NFTs="nfts.svg",e.Assets="assets.svg",e.Token="token.svg",e.Plus="plus.svg",e.OpenEye="openeye.svg",e.CloseEye="closeeye.svg",e.Warn="warn.svg",e.Error="error.svg",e.CopyIcon="copyicon.svg",e.Success="success.svg",e.Key="key.svg",e.Chip="chip.svg",e.Shield="shield.svg",e.Wallet="wallet.svg",e.QuestionMark="questionmark.svg",e.SmallQuestionMark="smallquestionmark.svg",e.GrayCube="graycube.svg",e.Albedo="albedo.svg",e.Hana="hana.svg",e.Hot="hot.svg",e.Rabet="rabet.svg",e.Freighter="freighter.svg",e.DarkFreighter="darkfreighter.svg",e.XBull="xbull.svg",e.Lobstr="lobstr.svg",e.Stellar="stellar.svg",e.StellarSmall="stellarsmall.svg",e.Google="google.svg",e.WalletConnect="walletconnect.svg",e.Klever="klever.svg",e.Ledger="ledger.svg"}(Ou||(Ou={}));var Fu=Ou,Uu={error:{baseBg:"bluxcc:bg-light-red-50",darkBg:"bluxcc:bg-[#D6000033]",container:"bluxcc:border bluxcc:border-alert-error",text:"bluxcc:text-alert-error",icon:u.jsx(Pu,{name:Fu.Error})},success:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#00D66E33]",container:"bluxcc:border bluxcc:border-alert-success",text:"bluxcc:text-alert-success",icon:u.jsx(Pu,{name:Fu.Success})},copy:{baseBg:"bluxcc:bg-light-blue-50",darkBg:"bluxcc:bg-[#005DF333]",container:"bluxcc:border bluxcc:border-alert-info",text:"bluxcc:text-alert-info",icon:u.jsx(Pu,{name:Fu.CopyIcon})},warn:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#FA8F0233]",container:"bluxcc:border bluxcc:border-alert-warning",text:"bluxcc:text-alert-warning",icon:u.jsx(Pu,{name:Fu.Warn})},none:{baseBg:"",darkBg:"",container:"",text:"",icon:null}},Du=function(e){var t=e.type,r=e.message,n=e.className,i=void 0===n?"":n,o=V(function(e){return e.config.appearance}),s=Lc(o.background),a=Uu[t],c=a.baseBg,l=a.darkBg,d=a.container,f=a.text,h=a.icon,p=s?l:c;return u.jsxs("div",{style:{borderRadius:o.borderRadius,fontFamily:o.fontFamily},className:"\n bluxcc:flex bluxcc:items-center bluxcc:gap-2\n bluxcc:px-3 bluxcc:h-10 bluxcc:max-w-46\n ".concat(p,"\n ").concat(d,"\n ").concat(f,"\n ").concat(i,"\n "),children:[h,u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:r})]})},zu=function(){return function(e,t){return function(e,t,r){var n,i;void 0===r&&(r={});var o=(null===(n=xc[e])||void 0===n?void 0:n[t])||(null===(i=xc[e])||void 0===i?void 0:i.en)||"";return zc(o,r)}(e,"en",t||{})}},Wu=function(e){var t=e.icon,r=e.onInfo,n=e.onBack,i=e.title,o=void 0===i?" ":i,s=e.closeButton,a=void 0!==s&&s,c=e.onClose,l=e.isPersistent,d=V(function(e){return e.config}),f=V(function(e){return e.modal}),h=zu(),p=jc(d.appearance.textColor,.7),b="none"!==f.alert.type,m=function(e){var t=e.onClick,r=e.children;return u.jsx("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:r})};return u.jsxs("header",{className:"bluxcc:flex bluxcc:h-16 bluxcc:w-full bluxcc:items-center bluxcc:justify-between",style:{fontFamily:d.appearance.fontFamily},children:["info"===t?u.jsx(m,{onClick:r,children:u.jsx(Pu,{name:Fu.About,props:{fill:p}})}):"back"===t?u.jsx(m,{onClick:n,children:u.jsx(Pu,{name:Fu.ArrowLeft,props:{fill:p}})}):u.jsx("div",{className:"bluxcc:size-5"}),u.jsx("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:b?u.jsx(Du,{type:f.alert.type,message:f.alert.message}):u.jsx("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium",children:h(o)})}),!a||l?u.jsx("div",{className:"bluxcc:size-5"}):u.jsx(m,{onClick:c,children:u.jsx(Pu,{name:Fu.Close,props:{fill:p}})})]})},$u=function(){var e=V(function(e){return e.config.appearance});return u.jsx("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:e.borderWidth,borderTopColor:e.borderColor}})})},qu=function(e){var t,r=e.startIcon,n=e.onChange,i=e.onEnter,o=e.onSubmit,s=e.inputType,c=void 0===s?"text":s,l=V(function(e){return e}).config.appearance,d=zu(),f=a.useState(!1),h=f[0],p=f[1],b=a.useState(""),m=b[0],g=b[1],v=a.useState(!1),y=v[0],x=v[1];return u.jsxs("div",{className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300 bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2",style:{fontFamily:l.fontFamily,borderRadius:l.borderRadius,borderColor:h?l.accentColor:l.borderColor,backgroundColor:l.fieldBackground,borderWidth:l.borderWidth,color:l.textColor},onMouseEnter:function(e){h||(e.currentTarget.style.borderColor=l.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){h||(e.currentTarget.style.borderColor=l.borderColor)},children:[u.jsx("span",{style:{background:l.background,borderRadius:l.borderRadius,borderColor:l.borderColor,borderWidth:l.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:r}),u.jsxs("div",{style:{cursor:"text"},className:"bluxcc:ml-4 bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center",children:[u.jsx("input",{id:"bluxcc-input",type:c,value:m,autoComplete:"off",placeholder:d("email"),onKeyDown:function(e){"Enter"===e.key&&y&&(null==i||i(m))},onChange:function(e){var t=e.target.value;g(t);var r=qc(c,t);x(r),null==n||n(t)},className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden\n bluxcc:focus:outline-hidden bluxcc:text-base bluxcc:placeholder:text-base!",style:(t={color:l.textColor,fontFamily:l.fontFamily},t["--input-text-color"]=l.textColor,t),onFocus:function(){return p(!0)},onBlur:function(){p(!1),qc("email",m)||x(!1)}}),u.jsx("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-25 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:u.jsx("button",{id:"bluxcc-button",disabled:!y,onClick:function(){return null==o?void 0:o(m)},className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-17! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-200",style:{background:l.fieldBackground,borderRadius:l.borderRadius,fontFamily:l.fontFamily,borderColor:y?l.accentColor:l.borderColor,color:y?l.accentColor:"#999999",borderWidth:l.borderWidth},children:d("submit")})})]})]})},Ku=function(e){var t=e.size,r=void 0===t?"medium":t,n=e.startIcon,i=e.endArrow,o=e.isRecent,s=void 0!==o&&o,c=e.label,l=e.onClick,d=V(function(e){return e}),f=a.useState(!1),h=f[0],p=f[1],b=d.config.appearance,m=zu();return u.jsxs("button",{type:"button",id:"bluxcc-button",onClick:l,className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300\n ".concat("small"===r?"bluxcc:size-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4":"bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2","\n "),style:{fontFamily:b.fontFamily,borderRadius:b.borderRadius,borderColor:h?b.accentColor:b.borderColor,backgroundColor:b.fieldBackground,borderWidth:b.borderWidth,color:b.textColor},onMouseEnter:function(e){p(!0),h||(e.currentTarget.style.borderColor=b.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){p(!1),h||(e.currentTarget.style.borderColor=b.borderColor)},children:[u.jsx("span",{style:{background:b.background,borderRadius:b.borderRadius,borderColor:b.borderColor,borderWidth:b.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:n}),u.jsx("div",{className:"".concat("small"===r?"bluxcc:mt-0":"bluxcc:ml-4"," bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"),children:u.jsx("span",{className:"".concat("small"===r?"bluxcc:text-sm bluxcc:leading-4":"bluxcc:text-base"," bluxcc:font-medium bluxcc:select-none"),children:c})}),s&&u.jsx("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:b.accentColor,borderRadius:b.borderRadius,backgroundColor:"".concat(jc(b.accentColor,.15))},children:m("recent")}),i&&"medium"===r&&u.jsx("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center",children:u.jsx(Pu,{name:Fu.ArrowRight,props:{fill:"".concat(jc(b.textColor,.7))}})})]})},Vu=function(e){var t=e.variant,r=void 0===t?"default":t,n=e.size,i=void 0===n?"medium":n,o=e.startIcon,s=e.endArrow,a=e.isRecent,c=void 0!==a&&a,l=e.label,d=e.onClick,f=e.onChange,h=e.onEnter,p=e.onSubmit,b=e.inputType,m=void 0===b?"text":b;return"input"===r?u.jsx(qu,{onEnter:h,onSubmit:p,onChange:f,inputType:m,startIcon:o}):u.jsx(Ku,{size:i,label:l,onClick:d,isRecent:c,endArrow:s,startIcon:o})},Hu=function(){var e,t=zu(),r=a.useState(!0),n=r[0],i=r[1],o=V(function(e){return e}),s=o.setRoute,c=o.logoutAction,l=o.setAlert,d=o.config.appearance,f=null===(e=o.user)||void 0===e?void 0:e.address,h=0!==o.balances.balances.length?o.balances.balances.find(function(e){return"native"===e.asset_type}).balance:"0";return u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:mb-6 bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[u.jsxs("div",{className:"bluxcc:text-center bluxcc:text-2xl bluxcc:h-8 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",style:{color:d.accentColor,fontFamily:d.fontFamily},children:[u.jsx("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:u.jsx("p",{className:"bluxcc:select-none",style:{verticalAlign:"middle",paddingTop:n?"0px":"8px",fontFamily:d.fontFamily},children:h?n?"".concat(Oc(h)," XLM"):"******":t("loading")})}),u.jsx("div",{className:"bluxcc:transition-all",children:n?u.jsx("button",{id:"bluxcc-button",onClick:function(){return i(!1)},className:"bluxcc:bg-transparent",children:u.jsx(Pu,{name:Fu.OpenEye,props:{fill:d.accentColor}})}):u.jsx("button",{id:"bluxcc-button",onClick:function(){return i(!0)},className:"bluxcc:bg-transparent",children:u.jsx(Pu,{name:Fu.CloseEye,props:{fill:d.accentColor}})})})]}),u.jsx("button",{id:"bluxcc-button",className:"bluxcc:mt-4! bluxcc:leading-4 bluxcc:inline-flex bluxcc:bg-transparent bluxcc:text-sm bluxcc:select-none",onClick:function(){Ic(f).then(function(){Ic(f),l("copy","Address Copied"),setTimeout(function(){l("none","")},1e3)}).catch(function(){})},style:{color:jc(d.textColor,.7),fontFamily:d.fontFamily},children:u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[f?Fc(f,5):"",u.jsx(Pu,{name:Fu.Copy,props:{fill:jc(d.textColor,.7)}})]})})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:space-x-3",children:[u.jsx(Vu,{size:"small",label:t("send"),startIcon:u.jsx(Pu,{name:Fu.Send,props:{fill:d.textColor}}),onClick:function(){s(g.SEND)}}),u.jsx(Vu,{size:"small",label:t("receive"),startIcon:u.jsx(Pu,{name:Fu.Receive,props:{fill:d.textColor}}),onClick:function(){s(g.RECEIVE)}}),u.jsx(Vu,{size:"small",label:t("swap"),startIcon:u.jsx(Pu,{name:Fu.Swap,props:{fill:d.textColor}}),onClick:function(){s(g.SWAP)}})]}),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:w-full bluxcc:space-y-2",children:[u.jsx(Vu,{endArrow:!0,label:t("balances"),startIcon:u.jsx(Pu,{name:Fu.Balances,props:{fill:d.textColor}}),onClick:function(){s(g.BALANCES)}}),u.jsx(Vu,{endArrow:!0,label:t("activity"),startIcon:u.jsx(Pu,{name:Fu.History,props:{fill:d.textColor}}),onClick:function(){s(g.ACTIVITY)}})]}),u.jsx($u,{}),u.jsxs("button",{style:{color:jc(d.textColor,.9),fontFamily:d.fontFamily},id:"bluxcc-button",onClick:function(){c(),Qc(),o.emitter.emit(exports.BluxEvent.LoggedOut,void 0)},className:"bluxcc:flex bluxcc:h-12 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[u.jsx(Pu,{name:Fu.LogOut,props:{fill:jc(d.textColor,.9)}}),t("logout")]})]})},Gu={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-1",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-1"},Xu=function(e){var t=e.size,r=void 0===t?"large":t,n=e.disabled,i=void 0!==n&&n,o=e.variant,s=void 0===o?"outline":o,a=e.state,c=void 0===a?"enabled":a,l=e.children,d=e.startIcon,f=e.endIcon,h=e.onClick,p=e.style,b=e.className,m=e.type,g=V(function(e){return e.config.appearance}),v=N({borderRadius:g.borderRadius,fontFamily:g.fontFamily,pointerEvents:"disabled"===c?"none":void 0},p);return"outline"===s?Object.assign(v,{border:"1px solid ".concat(g.borderColor),color:g.accentColor,backgroundColor:g.fieldBackground,borderWidth:g.borderWidth}):"fill"===s?Object.assign(v,{backgroundColor:g.accentColor,fontWeight:"500",color:Cc(g.accentColor)}):"text"===s?Object.assign(v,{color:g.accentColor,backgroundColor:"transparent"}):"tonal"===s&&Object.assign(v,{color:g.accentColor,backgroundColor:jc(g.accentColor,.1)}),"selected"===c&&(v.boxShadow="0 0 0 2px ".concat(g.accentColor)),u.jsxs("button",{type:m||"button",id:"bluxcc-button",onClick:h,disabled:"disabled"===c&&i,className:"".concat("bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full"," ").concat(Gu[r]," ").concat(null!=b?b:""," bluxcc:transition-all bluxcc:duration-300"),style:v,children:[d&&u.jsx("span",{children:d}),u.jsx("span",{children:l}),f&&u.jsx("span",{children:f})]})},Yu=function(e){var t=e.fill,r=void 0===t?"#999999":t;return u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_4197_4537",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),u.jsx("g",{mask:"url(#mask0_4197_4537)",children:u.jsx("path",{d:"M6.29425 17.6443L5.25 16.6L15.0905 6.75H6.14425V5.25H17.6443V16.75H16.1443V7.80375L6.29425 17.6443Z",fill:r})})]})},Zu=function(e){var t=e.fill,r=void 0===t?"#0C1083":t;return u.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_3683_34744",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40",children:u.jsx("rect",{width:"40",height:"40",fill:"#D9D9D9"})}),u.jsx("g",{mask:"url(#mask0_3683_34744)",children:u.jsx("path",{d:"M20 37.3069L7.5 27.9319V4.16602H32.5V27.9319L20 37.3069ZM20 34.166L30 26.6819V6.66602H10V26.6819L20 34.166ZM18.25 24.4223L27.0896 15.5827L25.3333 13.7752L18.25 20.8585L14.7179 17.3264L12.9104 19.0827L18.25 24.4223Z",fill:r})})]})},Ju=function(e){var t=e.fill,r=void 0===t?"#05C3DD":t;return u.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M37.1737 32.0256H51.2086L65.5665 46.3274C66.5004 47.2576 66.5052 48.7708 65.5759 49.706L47.1629 68.2582H32.7051L37.076 63.9982L53.1242 48.0114L37.2796 32.0244",fill:r}),u.jsx("path",{d:"M42.9419 47.9755H28.907L14.5492 33.6739C13.6152 32.7435 13.6104 31.2303 14.5397 30.2951L32.9527 11.7417H47.4106L43.0397 16.0018L26.9914 31.9887L42.8358 47.9755",fill:r})]})},Qu=function(){return u.jsxs("svg",{width:"144",height:"144",viewBox:"0 0 144 144",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsxs("g",{clipPath:"url(#clip0_617_11734)",children:[u.jsx("path",{d:"M0 0H144V144H0V0Z",fill:"#44D62C"}),u.jsx("path",{d:"M78.5049 30.5303H58.4749L54.9609 41.156H66.0861V63.5379H78.5049V30.5303Z",fill:"black"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.8428 90.626C94.8428 103.242 84.6155 113.469 71.9995 113.469C59.3835 113.469 49.1562 103.242 49.1562 90.626C49.1562 78.01 59.3835 67.7827 71.9995 67.7827C84.6155 67.7827 94.8428 78.01 94.8428 90.626ZM84.4722 90.6259C84.4722 97.5144 78.8879 103.099 71.9995 103.099C65.111 103.099 59.5267 97.5144 59.5267 90.6259C59.5267 83.7374 65.111 78.1532 71.9995 78.1532C78.8879 78.1532 84.4722 83.7374 84.4722 90.6259Z",fill:"black"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_617_11734",children:u.jsx("rect",{width:"144",height:"144",fill:"white"})})})]})},el=function(){return u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("g",{clipPath:"url(#clip0_4355_16345)",children:u.jsx("path",{d:"M17.9507 8.43559C18.4879 8.43559 19.0133 8.27633 19.4601 7.97795C19.9069 7.67956 20.2552 7.25543 20.4611 6.75915C20.6669 6.26287 20.7211 5.71671 20.6167 5.18966C20.5123 4.66262 20.254 4.17835 19.8744 3.79803C19.4949 3.41771 19.0112 3.15842 18.4844 3.05292C17.9575 2.94741 17.4112 3.00042 16.9146 3.20526C16.4178 3.41009 15.993 3.75755 15.6936 4.20375C15.3944 4.64993 15.234 5.17483 15.2329 5.71212C15.2322 6.06951 15.3019 6.42353 15.4382 6.75392C15.5744 7.08431 15.7745 7.38459 16.0269 7.63756C16.2794 7.89053 16.5792 8.09123 16.9093 8.22816C17.2394 8.3651 17.5933 8.43559 17.9507 8.43559ZM9.61576 20.6742C8.30665 20.6731 7.02725 20.2839 5.93923 19.5559C4.85121 18.8279 4.0034 17.7937 3.50294 16.584C3.00249 15.3743 2.87184 14.0435 3.12751 12.7596C3.38318 11.4757 4.01369 10.2964 4.93938 9.37069C5.86506 8.445 7.04436 7.81449 8.32826 7.55882C9.61217 7.30315 10.943 7.43379 12.1527 7.93425C13.3624 8.43471 14.3966 9.28252 15.1246 10.3705C15.8526 11.4586 16.2417 12.738 16.2429 14.0471C16.2436 14.9176 16.0727 15.7797 15.74 16.584C15.4071 17.3884 14.919 18.1192 14.3035 18.7348C13.688 19.3503 12.9571 19.8385 12.1527 20.1712C11.3483 20.504 10.4862 20.675 9.61576 20.6742Z",fill:"#7D00FF"})}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_4355_16345",children:u.jsx("rect",{width:"24",height:"24",fill:"white"})})})]})},tl=function(e,t,r){void 0===r&&(r="small");var n="bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:size-10!";switch(e){case"Rabet":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Rabet,props:{fill:t?"#ffffff":"#B8BAC4"}});case"Freighter":return t?u.jsx(Pu,{className:"small"===r?n:"",name:Fu.DarkFreighter,props:{}}):u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Freighter,props:{fill:"#310CCC"}});case"Albedo":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Albedo,props:{}});case"LOBSTR":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Lobstr,props:{fill:t?"#ffffff":"#1a8da0"}});case"xBull":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.XBull,props:{fill:t?"#ffffff":"#C19CFC"}});case"Hana":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Hana,props:{fill:t?"#E6E0F7":"#221542"}});case"Hot":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Hot,props:{}});case"Wallet Connect":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.WalletConnect,props:{fill:t?"#ffffff":"#0988f1"}});case"Klever":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Klever,props:{}});case"Bitget":return u.jsx(Ju,{fill:t?"#05C3DD":"#00F0FF"});case"Onekey":return u.jsx(Qu,{});case"Ledger":return u.jsx(Pu,{className:"small"===r?n:"",name:Fu.Ledger,props:{fill:t?"#ffffff":"#000000"}});default:return null}},rl=function(){var e,t,r,n=zu(),i=V(function(e){return e}),o=i.user,s=i.waitingStatus,a=i.config.appearance;return u.jsxs("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{borderColor:a.borderColor,borderWidth:a.borderWidth},children:tl(null!==(e=null==o?void 0:o.authValue)&&void 0!==e?e:"",Lc(a.background),"large")}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:"login"===s?n("waitingFor",{walletName:null!==(t=null==o?void 0:o.authValue)&&void 0!==t?t:"wallet"}):n("signingWith",{walletName:null!==(r=null==o?void 0:o.authValue)&&void 0!==r?r:"wallet"})}),u.jsx("p",{className:"bluxcc:text-sm",children:n("login"===s?"acceptConnection":"signRequestInWallet")})]}),u.jsx($u,{}),u.jsx(Xu,{state:"disabled",variant:"outline",startIcon:u.jsx(Pu,{className:"bluxcc:animate-spin",name:Fu.Loading,props:{fill:a.accentColor}}),children:n("login"===s?"connecting":"signing")})]})},nl=function(e){var t=e.handleOpenAssets,r=e.asset,n=V(function(e){return e.config.appearance});return u.jsxs("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:p-1 bluxcc:max-h-12",style:{fontFamily:n.fontFamily,borderColor:n.borderColor,borderWidth:n.borderWidth,borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:[u.jsx("div",{style:{fontFamily:n.fontFamily,background:n.background,borderRadius:n.borderRadius,borderColor:n.borderColor,borderWidth:n.borderWidth,color:n.textColor},className:"bluxcc:flex bluxcc:mr-0.5 bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:"native"===r.assetType?u.jsx(Pu,{name:Fu.Stellar,props:{fill:Cc(n.fieldBackground)}}):u.jsx(Pu,{name:Fu.QuestionMark,props:{fill:Cc(n.fieldBackground)}})}),u.jsx("span",{children:r.assetCode}),u.jsx(Pu,{name:Fu.ArrowDropDown,props:{fill:n.accentColor}})]})},il=function(t,r,n,i,o,s,a,c,u,l){return M(void 0,void 0,void 0,function(){var d,f,h,p,b;return k(this,function(m){switch(m.label){case 0:d=Number(Number(t).toFixed(5)).toString(),f=Number((Number(r)/100*99.5).toFixed(5)).toString(),h=null,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.loadAccount(a)];case 2:return h=m.sent(),[3,4];case 3:return m.sent(),[3,4];case 4:if(!h)throw new Error("Inactive account cannot send a transaction.");return p=new e.TransactionBuilder(h,{fee:"70000",networkPassphrase:u}),l&&(p=p.addOperation(e.Operation.changeTrust({limit:"999999999999",asset:Ac(o)}))),b=T([],s.slice(1,s.length-1),!0).map(Ac),p="from"===n?p.addOperation(e.Operation.pathPaymentStrictSend({sendAsset:Ac(i),sendAmount:d,destination:a,destAsset:Ac(o),destMin:f,path:b})):p.addOperation(e.Operation.pathPaymentStrictReceive({sendAsset:Ac(i),sendMax:d,destination:a,destAsset:Ac(o),destAmount:f,path:b})),[2,p.setTimeout(180).build().toXDR()]}})})},ol=function(){var e=zu(),t=a.useState("0"),r=t[0],n=t[1],i=a.useState("0"),o=i[0],s=i[1],c=a.useState(0),l=c[0],d=c[1],f=a.useState(0),h=f[0],p=f[1],b=V(function(e){return e}),m=a.useState(!1),v=m[0],y=m[1],x=a.useState([]),w=x[0],A=x[1],E=a.useState({field:"",message:""}),S=E[0],_=E[1],I=a.useState(!1),C=I[0],R=I[1],B=a.useState({rate:0,isInverted:!1}),j=B[0],O=B[1],L=a.useState("from"),P=L[0],F=L[1],U=function(e){b.setSelectAsset(N(N({},b.selectAsset),{field:e})),b.setRoute(g.SELECT_ASSET)},D=function(e,t){"from"===t?s(e.target.value):n(e.target.value),F(t),R(!C)};a.useEffect(function(){A([]),y(!1),_({field:"",message:""}),O({rate:0,isInverted:!1}),isNaN(Number(o))||""===o||Number(o)<0?_({field:"from",message:"Invalid value for FROM field."}):isNaN(Number(r))||""===r||Number(r)<0?_({field:"to",message:"Invalid value for TO field."}):b.selectAsset.swapFromAsset.assetCode!==b.selectAsset.swapToAsset.assetCode||b.selectAsset.swapFromAsset.assetIssuer!==b.selectAsset.swapToAsset.assetIssuer?isNaN(Number(b.selectAsset.swapFromAsset.assetBalance))?_({field:"from",message:"FROM asset has invalid balance."}):Number(o)>Number(b.selectAsset.swapFromAsset.assetBalance)?_({field:"from",message:"Insufficient balance."}):0===Number(o)&&0===Number(r)||(_({field:"",message:""}),M(void 0,void 0,void 0,function(){var e,t,i;return k(this,function(a){switch(a.label){case 0:if(y(!0),"from"!==P)return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,wu([Ac(b.selectAsset.swapFromAsset),o,[Ac(b.selectAsset.swapToAsset)]],{})];case 2:return e=a.sent(),y(!1),0===(t=e.response.records.filter(function(e){return e.path.length<2})).length?_({field:"both",message:"Could not find path. Try again."}):(i=t[0],O({rate:Number(i.destination_amount)/Number(i.source_amount),isInverted:!1}),A(T(T([b.selectAsset.swapFromAsset],i.path.map(Sc),!0),[b.selectAsset.swapToAsset],!1)),n(i.destination_amount)),[3,4];case 3:return a.sent(),y(!1),_({field:"both",message:"Could not find path. Try again."}),[3,4];case 4:return[3,8];case 5:return a.trys.push([5,7,,8]),[4,xu([[Ac(b.selectAsset.swapFromAsset)],Ac(b.selectAsset.swapToAsset),r],{})];case 6:return e=a.sent(),y(!1),0===(t=e.response.records.filter(function(e){return e.path.length<2})).length?_({field:"both",message:"Could not find path. Try again."}):(i=t[0],O({rate:Number(i.destination_amount)/Number(i.source_amount),isInverted:!1}),A(T(T([b.selectAsset.swapFromAsset],i.path.map(Sc),!0),[b.selectAsset.swapToAsset],!1)),s(i.source_amount)),[3,8];case 7:return a.sent(),y(!1),_({field:"both",message:"Could not find path. Try again."}),[3,8];case 8:return[2]}})})):_({field:"both",message:"FROM and TO assets are the same."})},[b.selectAsset,C]);var z=b.config.appearance,W="";0!==j.rate&&(W=j.isInverted?"1 ".concat(b.selectAsset.swapToAsset.assetCode," = ").concat((1/j.rate).toFixed(5)," ").concat(b.selectAsset.swapFromAsset.assetCode):"1 ".concat(b.selectAsset.swapFromAsset.assetCode," = ").concat(Oc(j.rate)," ").concat(b.selectAsset.swapToAsset.assetCode));var $="",q=""!==o&&"0"!==o&&Number(o)>=0&&!isNaN(Number(o)),K=""!==r&&"0"!==r&&Number(r)>=0&&!isNaN(Number(r));q&&K&&!v&&($="".concat((Number(r)/100*99.5).toFixed(5)," ").concat(b.selectAsset.swapToAsset.assetCode));var H=[{label:"Rate",value:0!==j.rate&&K?u.jsxs("span",{className:"bluxcc:flex bluxcc:gap-1.5 bluxcc:items-center",children:[W,u.jsx("button",{id:"bluxcc-button",onClick:function(){p(function(e){return e+180}),O(N(N({},j),{isInverted:!j.isInverted}))},className:"bluxcc:transition-transform bluxcc:duration-300 bluxcc:bg-transparent",style:{transform:"rotate(".concat(h,"deg)"),fontFamily:z.fontFamily},children:u.jsx(Pu,{name:Fu.SmallSwap,props:{fill:jc(z.textColor,.7)}})})]}):"—"},{label:"Path",value:(null==w?void 0:w.length)?w.map(function(e){return e.assetCode}).join(" > "):"—"},{label:"Minimum Received",value:K?$:"—"}];return u.jsxs("form",{onSubmit:function(e){return M(void 0,void 0,void 0,function(){var t,n,i,s,a;return k(this,function(c){switch(c.label){case 0:if(e.preventDefault(),""!==S.message)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),t=function(e,t,r){var n=r.find(function(e){return"native"===e.asset_type});return"native"!==t.assetType&&(n=r.find(function(e){return e.asset_type===t.assetType&&e.asset_code===t.assetCode&&e.asset_issuer===t.assetIssuer})),!n||Number(n.balance)+Number(e)>=Number(n.limit)}(r,b.selectAsset.swapToAsset,b.balances.balances),[4,il(o,r,P,b.selectAsset.swapFromAsset,b.selectAsset.swapToAsset,w,null===(i=b.user)||void 0===i?void 0:i.address,null===(s=b.stellar)||void 0===s?void 0:s.servers.horizon,(null===(a=b.stellar)||void 0===a?void 0:a.activeNetwork)||"",t)];case 2:return n=c.sent(),setTimeout(function(){try{iu(n)}catch(e){}},150),[3,4];case 3:return c.sent(),_({field:"both",message:"Failed to make transaction."}),[3,4];case 4:return[2]}})})},children:[u.jsxs("div",{className:"bluxcc:relative bluxcc:w-full bluxcc:p-4",style:{backgroundColor:z.fieldBackground,borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth,fontFamily:z.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",children:[u.jsx("span",{style:{color:jc(z.textColor,.7)},children:"From"}),u.jsxs("span",{style:{fontFamily:z.fontFamily},children:[u.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent bluxcc:border-none",style:{color:jc(z.textColor,.7),fontFamily:z.fontFamily},children:Oc(b.selectAsset.swapFromAsset.assetBalance)}),u.jsxs("button",{id:"bluxcc-button",onClick:function(){F("from"),R(!C),s(b.selectAsset.swapFromAsset.assetBalance)},style:{color:z.accentColor,fontFamily:z.fontFamily},className:"bluxcc:mr-2 bluxcc:ml-1.5 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",u.jsx(Pu,{name:Fu.ArrowDropUp,props:{fill:z.accentColor}})]})]})]}),u.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsx("input",{name:"from",type:"number",value:o,onChange:function(e){D(e,"from")},id:"bluxcc-input",className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"from"===S.field||"both"===S.field?"#ec2929":z.textColor,fontFamily:z.fontFamily}}),u.jsx(nl,{asset:b.selectAsset.swapFromAsset,handleOpenAssets:function(){U("swapFrom")}})]}),u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:jc(z.textColor,.7)}}),u.jsxs("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:[u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:z.borderWidth,borderTopStyle:"solid",borderTopColor:z.borderColor}}),u.jsx("div",{onClick:function(){var e=b.selectAsset.swapFromAsset,t=b.selectAsset.swapToAsset;d(function(e){return e+180}),b.setSelectAsset(N(N({},b.selectAsset),{swapFromAsset:t,swapToAsset:e}))},className:"bluxcc:z-20 bluxcc:p-2 bluxcc:transition-all bluxcc:duration-200",style:{backgroundColor:z.fieldBackground,borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth},children:u.jsx("div",{className:"bluxcc:transition-transform bluxcc:duration-300",style:{transform:"rotate(".concat(l,"deg)")},children:u.jsx(Pu,{name:Fu.Swap,props:{fill:z.accentColor}})})})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",style:{color:jc(z.textColor,.7)},children:[u.jsx("span",{children:"To"}),u.jsx("span",{className:"bluxcc:mr-2",children:Oc(b.selectAsset.swapToAsset.assetBalance)})]}),u.jsxs("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsx("input",{name:"to",id:"bluxcc-input",type:"number",value:r,onChange:function(e){D(e,"to")},className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"to"===S.field||"both"===S.field?"#ec2929":z.textColor,fontFamily:z.fontFamily}}),u.jsx(nl,{asset:b.selectAsset.swapToAsset,handleOpenAssets:function(){U("swapTo")}})]}),u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:jc(z.textColor,.7)}})]}),u.jsx("div",{className:"bluxcc:h-3.5 bluxcc:my-1.25 bluxcc:mx-3 bluxcc:text-left bluxcc:text-xs bluxcc:text-alert-error",children:S.message}),u.jsx("div",{style:{borderColor:z.borderColor,borderRadius:z.borderRadius,borderWidth:z.borderWidth},className:"bluxcc:w-full bluxcc:py-3 bluxcc:px-4",children:H.map(function(e,t,r){return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:items-center bluxcc:text-xs bluxcc:font-medium",children:[u.jsx("span",{style:{color:jc(z.textColor,.8)},children:e.label}),u.jsx("span",{style:{color:jc(z.textColor,.7)},children:v?"LOADING...":e.value})]}),t!==r.length-1&&u.jsx("div",{className:"bluxcc:my-2",style:{borderRadius:z.borderRadius,borderTop:"".concat(z.borderWidth," dashed ").concat(z.borderColor)}})]},e.label)})}),u.jsx($u,{}),u.jsx(Xu,{size:"large",state:"enabled",variant:"outline",type:"submit",disabled:""!==S.message,children:"Swap"})]})},sl=function(e){var t=e.button,r=e.onButtonClick,n=e.appearance;return u.jsx("button",{onClick:r,id:"bluxcc-button",style:{borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,background:n.background,borderWidth:n.borderWidth},className:"bluxcc:border bluxcc:px-3! bluxcc:py-1! bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",children:t})},al=function(e){var t=e.label,r=e.autoFocus,n=e.type,i=void 0===n?"text":n,o=e.placeholder,s=void 0===o?"Input":o,c=e.error,l=e.iconRight,d=e.iconLeft,f=e.button,h=e.optionalField,p=void 0!==h&&h,b=e.onButtonClick,m=e.customLabel,g=e.value,v=e.className,y=e.onChange,x=V(function(e){return e.config.appearance}),w=a.useState(!1),A=w[0],E=w[1],S=zu(),_=function(){return c?"#ec2929":A?x.accentColor:x.borderColor};return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col",style:{fontFamily:x.fontFamily},children:[t&&u.jsxs("label",{style:{color:c?"#ec2929":x.textColor},className:"bluxcc:mb-2 bluxcc:ml-4 bluxcc:flex bluxcc:justify-between bluxcc:text-xs",children:[u.jsxs("span",{children:[t," ",p&&u.jsxs("span",{style:{color:jc(x.textColor,.7)},className:"bluxcc:text-[10px]",children:["(",S("optional"),")"]})]}),u.jsx("span",{children:m})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ".concat(v),onFocus:function(){return E(!0)},onBlur:function(){return E(!1)},onMouseEnter:function(e){A||c||(e.currentTarget.style.borderColor=x.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){A||(e.currentTarget.style.borderColor=c?"#ec2929":x.borderColor)},style:{"--tw-ring-color":_(),border:"".concat(x.borderWidth," solid ").concat(_()),borderRadius:x.borderRadius,backgroundColor:x.fieldBackground},children:[d&&u.jsx("div",{className:"bluxcc:mr-2",children:d}),u.jsx("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===i?1:void 0,type:i,autoFocus:r,value:g,placeholder:s,className:"bluxcc:mr-2! bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base bluxcc:font-medium",style:{fontFamily:x.fontFamily,color:x.textColor,width:f?"90%":"100%"},onChange:y}),f&&u.jsx(sl,{button:f,onButtonClick:b,appearance:x}),l&&u.jsx("div",{className:"bluxcc:ml-4",children:l})]}),!p&&u.jsx("div",{className:"bluxcc:mt-1 bluxcc:text-xs bluxcc:ml-4 bluxcc:h-4",children:c?u.jsx("p",{className:"bluxcc:text-alert-error",children:c}):""})]})},cl=function(){var t=zu(),r=V(function(e){return e}),n=a.useState({}),i=n[0],o=n[1],s=a.useState({memo:"",amount:"",address:""}),c=s[0],l=s[1],d=function(e){return function(t){l(function(r){var n;return N(N({},r),((n={})[e]=t.target.value,n))}),o(function(t){var r;return N(N({},t),((r={})[e]="",r))})}};return u.jsx(u.Fragment,{children:u.jsxs("div",{children:[u.jsx("div",{className:"bluxcc:relative bluxcc:mb-1",children:u.jsx(al,{autoFocus:!0,type:"number",label:t("amount"),placeholder:"0.00",value:c.amount,onChange:d("amount"),error:i.amount,customLabel:u.jsxs("button",{id:"bluxcc-button",onClick:function(){var e=Number(r.selectAsset.sendAsset.assetBalance).toString();l(function(t){return N(N({},t),{amount:e})})},style:{color:r.config.appearance.accentColor,fontFamily:r.config.appearance.fontFamily},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:bg-transparent",children:[t("max")," ",u.jsx(Pu,{name:Fu.ArrowDropUp,props:{fill:r.config.appearance.accentColor}})]}),onButtonClick:function(){r.setSelectAsset(N(N({},r.selectAsset),{field:"send"})),r.setRoute(g.SELECT_ASSET)},button:u.jsxs("span",{className:"bluxcc:flex bluxcc:justify-between bluxcc:gap-1!",children:[u.jsx("span",{className:"bluxcc:flex bluxcc:items-center",children:"native"===r.selectAsset.sendAsset.assetType?u.jsx(Pu,{name:Fu.StellarSmall,props:{fill:Cc(r.config.appearance.fieldBackground)}}):u.jsx(Pu,{name:Fu.SmallQuestionMark,props:{fill:Cc(r.config.appearance.fieldBackground)}})}),r.selectAsset.sendAsset.assetCode]})})}),u.jsx("div",{className:"bluxcc:mb-1",children:u.jsx(al,{label:t("to"),placeholder:t("enterAddress"),value:c.address,onChange:d("address"),error:i.address,button:t("paste"),onButtonClick:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return e=t.sent(),l(function(t){return N(N({},t),{address:e})}),[2]}})})}})}),u.jsx("div",{children:u.jsx(al,{optionalField:!0,label:t("memo"),placeholder:t("enterMemo"),value:c.memo,onChange:d("memo")})}),u.jsx($u,{}),u.jsx(Xu,{size:"large",variant:"outline",state:"enabled",onClick:function(){return M(void 0,void 0,void 0,function(){var n,i,s,a,u,l;return k(this,function(d){switch(d.label){case 0:if(n={},c.amount?Number(c.amount)>Number(r.selectAsset.sendAsset.assetBalance||"0")&&(n.amount=t("amountExceedsBalance")):n.amount=t("amountRequired"),c.address?e.StrKey.isValidEd25519PublicKey(c.address)||(n.address=t("addressInvalid")):n.address=t("addressRequired"),o(n),0!==Object.keys(n).length)return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,(f=c.memo,h=c.amount,p=c.address,b=r.selectAsset.sendAsset,m=null===(a=r.user)||void 0===a?void 0:a.address,g=null===(u=r.stellar)||void 0===u?void 0:u.servers.horizon,v=(null===(l=r.stellar)||void 0===l?void 0:l.activeNetwork)||"",M(void 0,void 0,void 0,function(){var t,r,n,i;return k(this,function(o){switch(o.label){case 0:t=null,r=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,g.loadAccount(p)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return o.trys.push([4,6,,7]),[4,g.loadAccount(m)];case 5:return t=o.sent(),[3,7];case 6:return o.sent(),[3,7];case 7:if(!t)throw new Error("Inactive account cannot send a transaction.");if(!r&&"native"!==b.assetType)throw new Error("Cannot send non-native asset to an inactive account.");return n=new e.TransactionBuilder(t,{fee:"50000",networkPassphrase:v}),r?(i=e.Asset.native(),"native"!==b.assetType&&(i=new e.Asset(b.assetCode,b.assetIssuer)),n=n.addOperation(e.Operation.payment({amount:h,destination:p,asset:i}))):n=n.addOperation(e.Operation.createAccount({startingBalance:h,destination:p})),f&&(n=n.addMemo(e.Memo.text(f))),[2,n.setTimeout(180).build().toXDR()]}})}))];case 2:return i=d.sent(),setTimeout(function(){var e;iu(i,{network:(null===(e=r.stellar)||void 0===e?void 0:e.activeNetwork)||""})},150),[3,4];case 3:return s=d.sent(),n.address=s.message,o(n),[3,4];case 4:return[2]}var f,h,p,b,m,g,v})})},children:t("sendButton")})]})})},ul=function(e){var t=e.otp,r=e.setOtp,n=e.error,i=t.length,o=a.useRef([]),s=V(function(e){return e.config.appearance});a.useEffect(function(){n&&setTimeout(function(){var e;return null===(e=o.current[0])||void 0===e?void 0:e.focus()},1001)},[n]);var c=function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,i);if(t){var n=T(T([],t.split(""),!0),Array(i-t.length).fill(""),!0);r(n),setTimeout(function(){var e;return null===(e=o.current[i-1])||void 0===e?void 0:e.focus()},0)}},l=function(e){return{fontFamily:s.fontFamily,borderRadius:s.borderRadius,color:s.accentColor,background:s.fieldBackground,"--tw-ring-color":n?"#FF6666":s.accentColor,borderColor:n?"#FF6666":e?s.accentColor:s.borderColor,borderWidth:s.borderWidth}};return u.jsx("div",{className:"bluxcc:flex bluxcc:gap-1",children:t.map(function(e,n){return u.jsx("input",{autoFocus:0===n,ref:function(e){o.current[n]=e},type:"text",inputMode:"numeric",maxLength:1,value:e,onChange:function(e){return function(e,n){var s,a=n.target.value.replace(/\D/g,"");if(a){var c=T([],t,!0);c[e]=a[0],r(c),e<i-1&&a&&(null===(s=o.current[e+1])||void 0===s||s.focus())}}(n,e)},onPaste:c,onKeyDown:function(e){return function(e,n){var i;if("Backspace"===n.key){var s=T([],t,!0);s[e]?(s[e]="",r(s)):e>0&&(null===(i=o.current[e-1])||void 0===i||i.focus(),s[e-1]="",r(s))}}(n,e)},className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:l(e)},n)})})},ll=function(){var e=W();e.login&&(e.user&&e.user.address&&e.authState.isAuthenticated?e.login.resolver(e.user):e.login.rejecter("BLUX: Failed to login!"),e.setLogin(void 0))},dl=function(){var e=W();e.setIsAuthenticated(!0),e.closeModal(),ll();var t=W();t.user&&t.emitter.emit(exports.BluxEvent.LoggedIn,{user:t.user})},fl=function(){var e=W();e.apiResponse&&(e.apiResponse.privacyPolicy||e.apiResponse.terms)?e.setRoute(g.ACCEPT_TERMS_AND_PRIVACY):dl()},hl=function(){var e=zu(),t=V(function(e){return e}),r=t.user,n=t.config.appearance,i=null==r?void 0:r.authValue,o=a.useState(Array(6).fill("")),s=o[0],c=o[1],l=a.useState(!1),d=l[0],f=l[1];return a.useEffect(function(){var e,r=s.join("");6===r.length&&(e=r,M(void 0,void 0,void 0,function(){var r,n,i,o;return k(this,function(s){switch(s.label){case 0:f(!1),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,ee(t.config.appId,t.user,e)];case 2:return(r=s.sent())?(f(!1),localStorage.setItem(H,r),Jc("email",(null===(i=t.user)||void 0===i?void 0:i.authValue)||"",Date.now(),r),t.setAuth({isAuthenticated:!0,JWT:r}),[4,te(r)]):[3,4];case 3:n=s.sent(),t.connectWalletSuccessful(n.public_key,(null===(o=t.stellar)||void 0===o?void 0:o.activeNetwork)||""),setTimeout(function(){W().modal.isOpen&&(t.setRoute(g.SUCCESSFUL),setTimeout(function(){W().modal.isOpen&&fl()},1e3))}),s.label=4;case 4:return[3,6];case 5:return s.sent(),f(!0),setTimeout(function(){return c(Array(6).fill(""))},1e3),[3,6];case 6:return[2]}})}))},[s,i]),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{style:{borderColor:n.borderColor,borderWidth:n.borderWidth},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2",children:u.jsx(Pu,{name:Fu.Email,props:{fill:n.textColor}})}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center",children:[u.jsx("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:e("enterConfirmationCodeTitle")}),d?u.jsx("p",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error",children:e("invalidCodeError")}):u.jsx("p",{className:"bluxcc:h-10 bluxcc:text-sm",children:e("enterConfirmationCodeHelp")})]}),u.jsx("div",{className:"bluxcc:mt-6 bluxcc:text-center",children:u.jsx(ul,{otp:s,setOtp:c,error:d})}),u.jsx($u,{}),u.jsx(Xu,{size:"medium",state:"enabled",variant:"text",onClick:function(){return M(void 0,void 0,void 0,function(){var e;return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Q(t.config.appId,(null===(e=t.user)||void 0===e?void 0:e.authValue)||"")];case 1:case 2:return r.sent(),[3,3];case 3:return[2]}})})},style:{color:n.accentColor},children:e("resendCode")})]})},pl=function(){var e,t,r,n=zu(),i=V(function(e){return e}),o="";"object"==typeof(null===(e=i.sendTransaction)||void 0===e?void 0:e.result)&&i.sendTransaction.result.hash&&(o=i.sendTransaction.result.hash);var s=(null===(r=null===(t=i.sendTransaction)||void 0===t?void 0:t.options)||void 0===r?void 0:r.network)||"",a=o?Mc(s,i.config.explorer,"transactionUrl",o):null,c=function(){switch(i.waitingStatus){case"login":return{title:n("connectionSuccessfulTitle"),message:n("connectionSuccessfulMessage",{appName:_c(i.config.appName)})};case"signMessage":return{title:n("messageSignedTitle")||"Message Signed",message:n("messageSignedMessage")||"Your message has been signed successfully."};case"signAuthEntry":return{title:n("authEntrySignedTitle")||"Authorization Signed",message:n("authEntrySignedMessage")||"Authorization has been signed successfully."};default:return{title:n("transactionSuccessfulTitle"),message:n("transactionSuccessfulMessage")}}}(),l=c.title,d=c.message;return u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{style:{background:jc(i.config.appearance.accentColor,.1)},className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",children:u.jsx(Pu,{name:Fu.GreenCheck,props:{fill:i.config.appearance.accentColor}})}),u.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:l}),u.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5",children:d})]}),"sendTransaction"===i.waitingStatus&&o&&"string"==typeof a&&u.jsx(Xu,{state:"enabled",variant:"outline",size:"small",className:"bluxcc:mt-4",onClick:function(){a&&window.open(a,"_blank","noopener,noreferrer")},children:n("seeInExplorer")}),u.jsx($u,{}),"login"===i.waitingStatus?u.jsx(Xu,{state:"disabled",variant:"outline",children:n("loggingIn")}):u.jsx(Xu,{state:"enabled",variant:"fill",size:"large",onClick:function(){var e=i.waitingStatus;if("sendTransaction"===e&&i.sendTransaction){var t=i.sendTransaction,r=t.resolver,n=t.result;r&&n&&r(n)}else if("signMessage"===e&&i.signMessage){var o=i.signMessage;r=o.resolver,n=o.result;r&&n&&r(n)}else if("signAuthEntry"===e&&i.signAuthEntry){var s=i.signAuthEntry;r=s.resolver,n=s.result;r&&n&&r(n)}setTimeout(function(){i.cleanUp(e),i.closeModal()},150)},children:n("done")})]})},bl=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:e.connectWallet(t.name),i.label=1;case 1:return i.trys.push([1,5,,6]),[4,t.connect()];case 2:return(r=i.sent())&&""!==r.trim()?[4,Bc(t)]:[3,4];case 3:n=i.sent(),(o=e.config.appId,s=t.name,a=r,M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:if(!o)throw new Error("appId is missing in config.");if(!a)throw new Error("wallet address is missing.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ec("".concat(Z,"/auth"),{method:"POST",headers:(t={},t[J]=o,t.Accept="application/json",t["Content-Type"]="application/json",t),body:JSON.stringify({wallet:a,auth_method:"wallet",auth_value:s})})];case 2:if(400===(e=r.sent()).status)throw new Error("invalid inputs");if(500===e.status)throw new Error("server error");if(429===e.status)throw new Error("too many requests");if(200===e.status)return[2,!0];throw new Error("Unexpected response from api");case 3:throw r.sent(),new Error("Unexpected response from api");case 4:return[2]}})})).catch(function(){}),function(e){var t=kc(),r=T([e],t.filter(function(t){return t!==e}),!0);localStorage.setItem(G,JSON.stringify(r))}(t.name),Jc("wallet",t.name,Date.now(),""),setTimeout(function(){W().modal.isOpen&&(e.connectWalletSuccessful(r,n),e.setRoute(g.SUCCESSFUL),setTimeout(function(){W().modal.isOpen&&fl()},1e3))},500),i.label=4;case 4:return[3,6];case 5:return i.sent(),e.setRoute(g.FAILED),[3,6];case 6:return[2]}var o,s,a})})},ml=!1,gl=function(e){return M(void 0,void 0,void 0,function(){return k(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[X,Y],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},vl=function(){var e=zu(),t=V(function(e){return e}),r=a.useState(""),n=r[0],i=r[1],o=t.config,s=t.wallets,c=t.connectEmail,l=t.setShowAllWallets,d=o.appearance,f=o.loginMethods||[],h=f.includes("passkey"),p=a.useMemo(function(){var e=T([],f,!0).filter(function(e){return"passkey"!==e});return T(T([],e,!0),h?["passkey"]:[],!0)},[f,h]),m=a.useMemo(function(){return s.length>3?s.slice(2):[]},[s]),v=a.useMemo(function(){return s.length<=3?s:t.showAllWallets?s.slice(2,s.length):s.slice(0,2)},[s,t.showAllWallets]);a.useEffect(function(){t.walletConnect&&gl(t.walletConnect.client).then(function(e){t.setWalletConnectClient(t.walletConnect.client,e)}).catch(function(e){})},[]);var y=function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),c(n),[4,Q(o.appId,n)];case 1:case 2:return e.sent(),[3,3];case 3:return[2]}})})},x=function(){return u.jsxs("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[u.jsx("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(d.borderWidth," dashed ").concat(d.borderColor)}}),u.jsx("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:d.background,color:d.borderColor},children:e("or")})]})};return u.jsxs("div",{className:"bluxcc:w-full",children:[d.logo&&u.jsx("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:u.jsx("img",{src:d.logo,alt:o.appName,width:152,height:60,className:"bluxcc:max-h-20 bluxcc:max-w-45 bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),u.jsx("div",{className:"",children:p.map(function(r,n){var o=p[n+1],s=p[n-1],a=p.includes("wallet"),c=a&&!t.showAllWallets&&"wallet"===r&&"email"===o||a&&"email"===r&&"wallet"!==s;return"wallet"===r?u.jsx(S.default.Fragment,{children:u.jsxs("div",{className:"bluxcc:max-h-81 bluxcc:space-y-2 bluxcc:overflow-y-auto overflowStyle",children:[v.map(function(e){return u.jsx(Vu,N({},e,{label:e.name,startIcon:tl(e.name,Lc(d.background)),onClick:function(){return r=e,M(void 0,void 0,void 0,function(){return k(this,function(e){return r.name===b.WalletConnect?t.setRoute(g.WALLET_CONNECT):bl(t,r),[2]})});var r}}),e.name)}),m.length>0&&!t.showAllWallets&&u.jsx(Vu,{endArrow:!0,label:e("allStellarWallets"),startIcon:u.jsx(Pu,{name:Fu.Stellar,props:{fill:Cc(d.background)}}),onClick:function(){l(!0)}}),c&&x()]})},"wallet"):t.showAllWallets||"email"!==r?t.showAllWallets||"passkey"!==r?null:u.jsx("button",{className:"bluxcc:mt-6! bluxcc:w-full bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:d.accentColor,fontFamily:d.fontFamily},children:e("logInWithPasskey")},"passkey"):u.jsx(S.default.Fragment,{children:u.jsxs(u.Fragment,{children:[u.jsx(Vu,{inputType:"email",variant:"input",startIcon:u.jsx(Pu,{name:Fu.SmallEmail,props:{fill:d.textColor}}),onChange:function(e){return i(e)},onEnter:y,onSubmit:y}),c&&x()]})},"email")})}),u.jsx("footer",{className:"bluxcc:w-full bluxcc:pt-4.25 bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:u.jsx("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:d.textColor,fontFamily:d.fontFamily},children:e("poweredByBlux")})})]})},yl=function(e){var t=e.value,r=e.title,n=void 0===r?"":r,i=e.size,o=void 0===i?184:i,s=e.bgColor,a=void 0===s?"#ffffff":s,c=e.fgColor,l=void 0===c?"#00020f":c,d=e.level,h=void 0===d?"Q":d,p=e.imgSize,b=void 0===p?51:p,m=C(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return u.jsx(f.QRCodeCanvas,N({className:"bluxcc:z-10",value:t,title:n,size:o,bgColor:a,fgColor:l,level:h,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:b,width:b,opacity:1,excavate:!0}},m))},xl=function(){var e,t=zu(),r=V(function(e){return e}),n=V(function(e){return e}).setAlert,i=r.config.appearance,o=null===(e=r.user)||void 0===e?void 0:e.address;return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:[u.jsx(yl,{size:184,value:o,bgColor:i.fieldBackground,fgColor:i.accentColor,level:"Q"}),u.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:i.background},children:u.jsx(Pu,{name:Fu.SmallBlux,props:{fill:i.accentColor,background:i.fieldBackground}})})]}),u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-lg",children:"Your Address"}),u.jsx("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:u.jsx("p",{className:"bluxcc:w-73 bluxcc:text-sm bluxcc:leading-4! bluxcc:break-all",style:{color:jc(i.textColor,.7)},children:o})})]}),u.jsx($u,{}),u.jsx(Xu,{size:"large",state:"enabled",variant:"tonal",style:{color:i.accentColor},onClick:function(){Ic(o),n("copy",t("address_copied")),setTimeout(function(){n("none","")},1e3)},endIcon:u.jsx(Pu,{name:Fu.LargeCopy,props:{fill:i.accentColor}}),children:t("copy_address")})]})},wl=function(){var e,t,r=zu(),n=V(function(e){return e}),i=(t=n.config.networks,Object.entries(gc).filter(function(e){return t.includes(e[1])}).map(function(e){return _c(e[0])}));return u.jsxs("div",{style:{fontFamily:n.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:u.jsx(Pu,{name:Fu.WrongNetwork,props:{}})}),u.jsxs("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-2xl",children:r("wrongNetwork")}),u.jsx("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:r("wrongNetworkMessage",{currentNetwork:_c(Tc(null===(e=n.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},Al=function(e){var t,r=e.tabs,n=V(function(e){return e.config.appearance}),i=a.useState(0),o=i[0],s=i[1];return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",style:{fontFamily:n.fontFamily},children:r.map(function(e,t){var r=o===t;return u.jsxs("button",{role:"tab",onClick:function(){return s(t)},"aria-label":e.label,id:"bluxcc-button","aria-selected":o===t,tabIndex:o===t?0:-1,className:"bluxcc:flex bluxcc:gap-2 bluxcc:h-20 bluxcc:w-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:px-7 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:r?jc(n.accentColor,.1):n.background,color:r?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[u.jsx("span",{children:r?e.activeIcon:e.inActiveIcon}),u.jsx("span",{children:e.label})]},t)})}),u.jsx("div",{className:"bluxcc:max-h-78 bluxcc:h-78 w-full bluxcc:overflow-auto overflowStyle",role:"tabpanel","aria-labelledby":"tab-".concat(o),children:u.jsx("div",{className:"bluxcc:absolute bluxcc:left-0 bluxcc:right-0 bluxcc:max-h-78 bluxcc:h-78 bluxcc:overflow-auto overflowStyle",children:null===(t=r[o])||void 0===t?void 0:t.content})})]})},El=function(e){var t=e.assets,r=a.useState(null),n=r[0],i=r[1],o=V(function(e){return e.config.appearance}),s=zu();return u.jsxs("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto overflowStyle",children:[t.map(function(e,r){return u.jsxs("button",{id:"bluxcc-button",onMouseEnter:function(){return i(r)},onMouseLeave:function(){return i(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:n===r?o.fieldBackground:"transparent",color:o.textColor,borderBottomStyle:"dashed",borderBottomWidth:r<t.length-1?o.borderWidth:"0px",borderBottomColor:o.borderColor,transition:"all 0.2s ease-in-out",fontFamily:o.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[u.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:o.borderRadius,background:o.fieldBackground,border:"".concat(o.borderWidth," solid ").concat(o.borderColor)},children:"native"===e.assetType?u.jsx(Pu,{name:Fu.Stellar,props:{fill:Cc(o.fieldBackground)}}):u.jsx(Pu,{name:Fu.QuestionMark,props:{fill:Cc(o.fieldBackground)}})}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.title}),u.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:jc(o.textColor,.7)},children:e.subtitle})]})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[u.jsx("span",{className:"bluxcc:font-medium",children:Oc(e.assetBalance)}),u.jsx("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:jc(o.textColor,.7)},children:!1})]})]},e.assetType+e.assetIssuer)}),0===t.length&&u.jsx("div",{style:{color:jc(o.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},Sl=function(){var e=zu(),t=V(function(e){return e.config.appearance}),r=V(function(e){return e.balances}),n=r.loading,i=r.error,o=r.balances,s=o.map(function(e){return N(N({},Sc(e)),{title:(t=e,"native"===t.asset_type?"XLM":"credit_alphanum4"===t.asset_type||"credit_alphanum12"===t.asset_type?t.asset_code:"liquidity_pool_shares"===t.asset_type?"LiquidtyPool":""),subtitle:wc(e),logo:u.jsx(Pu,{name:Fu.Stellar,props:{}})});var t}),a=function(){return u.jsxs("div",{className:"bluxcc:w-full bluxcc:mt-22 bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:flex-col bluxcc:gap-2",children:[u.jsx(Pu,{name:Fu.GrayCube,props:{}}),u.jsx("p",{className:"bluxcc:font-medium",style:{color:jc(t.textColor,.7)},children:e("no_balance_message")})]})},c=[{label:e("assets"),activeIcon:u.jsx(Pu,{name:Fu.Assets,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Pu,{name:Fu.Assets,props:{fill:t.textColor}}),content:o.length?u.jsx(El,{assets:s}):u.jsx(a,{})},{label:e("tokens"),activeIcon:u.jsx(Pu,{name:Fu.Token,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Pu,{name:Fu.Token,props:{fill:t.textColor}}),content:u.jsx(a,{})},{label:e("nfts"),activeIcon:u.jsx(Pu,{name:Fu.NFTs,props:{fill:t.accentColor}}),inActiveIcon:u.jsx(Pu,{name:Fu.NFTs,props:{fill:t.textColor}}),content:u.jsx(a,{})}];return n?"Loading":i?"Error, try again.":u.jsx(Al,{tabs:c})},_l=S.default.memo(function(e){var t,r,n,i,o,s=e.tx,a=V(function(e){return e}),c=a.config.appearance,l=Mc((null===(t=a.stellar)||void 0===t?void 0:t.activeNetwork)||"",a.config.explorer,"transactionUrl",s.hash);return u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[u.jsx("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:c.background},children:function(e){switch(e){case"Receive":return u.jsx(Pu,{name:Fu.Downstream});case"Send":return u.jsx(Pu,{name:Fu.Upstream});default:return u.jsx(Pu,{name:Fu.MultiOperation})}}(s.title)}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[u.jsx("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:c.textColor},children:s.title}),u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:s.description})]})]}),u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:jc(c.textColor,.7)},children:[(r=s.date,n=new Date(r),i=n.getUTCDate(),o=n.toLocaleString("en-US",{month:"short"}),"".concat(i," ").concat(o)),u.jsx("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:"View transaction details",onClick:function(){l&&window.open(l,"_blank","noopener,noreferrer")},style:{background:c.fieldBackground},children:u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:[u.jsx(Pu,{name:Fu.Globe}),";"]})})]})]})}),Il=function(e){return"native"===e.asset_type?"XLM":e.asset_code||"Pool"},Nl=function(){var t,r,n=zu(),i=V(function(e){return e}),o=V(function(e){return e.transactions}),s=o.loading,c=o.transactions,l=a.useState([]),d=l[0],f=l[1],h=i.config.appearance,p=null===(t=i.user)||void 0===t?void 0:t.address,b=Mc(null===(r=i.stellar)||void 0===r?void 0:r.activeNetwork,i.config.explorer,"accountUrl",p);a.useEffect(function(){if(c){for(var t=[],r=0,i=c;r<i.length;r++){var o=i[r],s=o.operations[0],a={hash:o.hash,description:"",date:o.created_at,title:Dc(s.type)};if(o.operations.length>1)a.title=n("multiOperation");else if("payment"===s.type){var u=n("send");s.to.toLowerCase()===p.toLowerCase()&&(u=n("receive")),a.title=u,a.description="".concat(Oc(s.amount)," ").concat(Il(s))}else s.type!==e.Horizon.HorizonApi.OperationResponseType.pathPaymentStrictSend&&s.type!==e.Horizon.HorizonApi.OperationResponseType.pathPayment||(a.title=n("swap"),a.description="Received ".concat(Il(s)));t.push(a)}f(t)}},[c]);var m=!s&&0===d.length;return u.jsxs("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[s?u.jsx("div",{style:{color:jc(h.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("loadingActivity")}):m?u.jsx("div",{style:{color:jc(h.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("noActivityFound")}):d.map(function(e,t){return u.jsx("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<d.length-1?h.borderWidth:"0px",borderBottomColor:h.borderColor},className:"bluxcc:p-2",children:u.jsx(_l,{tx:e})},t)}),d.length>0&&b&&u.jsx("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:u.jsx(Xu,{state:"enabled",variant:"outline",size:"medium",onClick:function(){b&&window.open(b,"_blank","noopener,noreferrer")},children:n("seeAllInExplorer")})})]})},Cl=function(e){var t=e.operationsCount,r=e.sender,n=e.receiver,i=e.network,o=e.estimatedFee,s=e.action,a=V(function(e){return e.config.appearance}),c=V(function(e){return e}).setAlert,l=[{label:"Action",value:_c(s)},{label:"Operations",value:t.toString()},{label:"Sender",value:Fc(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:"Network",value:vc[i].name},{label:"Estimated Fee",value:"".concat(o," XLM")}];return n&&l.splice(3,0,{label:"To",value:Fc(n,5),isHighlighted:!0,isCopyable:!0,copyValue:n}),u.jsx("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",style:{fontFamily:a.fontFamily},children:l.map(function(e,t){var r=e.label,n=e.value,i=e.isHighlighted,o=e.isCopyable,s=e.copyValue;return u.jsxs("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===l.length-1?{}:{borderBottomColor:a.borderColor,borderBottomStyle:"dashed",borderBottomWidth:a.borderWidth},children:[u.jsx("span",{style:{color:a.textColor},children:r}),o?u.jsx("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:i?a.accentColor:a.textColor},onClick:function(){return s&&(Ic(s),c("copy","Address Copied"),void setTimeout(function(){c("none","")},1e3))},children:n}):u.jsx("span",{style:{color:i?a.accentColor:a.textColor},children:n})]},t)})})},Ml=function(e){return M(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a;return k(this,function(c){switch(c.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(g.FAILED),[2];if(e.setRoute(g.WAITING),!e.user)return e.setRoute(g.FAILED),[2];if(r=e.user,n=r.authMethod,i=r.authValue,"wallet"!==n)return e.setRoute(g.FAILED),[2];if(!(o=mc[i]))return e.setRoute(g.FAILED),[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Xc(o,t.xdr,null===(a=e.user)||void 0===a?void 0:a.address,t.options.network,e.config.transports||{},t.shouldSubmit)];case 2:return s=c.sent(),e.setSendTransaction(N(N({},t),{result:s}),!0,g.WAITING),setTimeout(function(){e.setRoute(g.SUCCESSFUL)},400),[3,4];case 3:return c.sent(),setTimeout(function(){e.setRoute(g.FAILED)},200),[3,4];case 4:return[2]}})})},kl=function(){var e,t=zu(),r=V(function(e){return e}),n=r.config.appearance,i=r.user,o=r.stellar,s=r.sendTransaction;if(!s||!i||!o)return u.jsx("div",{children:u.jsx("p",{children:t("invalidXdr")})});var a=s.xdr,c=s.options,l=Vc(a,c.network);if(!l)return u.jsx("div",{children:u.jsx("p",{children:t("invalidXdr")})});var d,f,h=0===r.balances.balances.length?"0":r.balances.balances.find(function(e){return"native"===e.asset_type}).balance,p=i.authValue===b.Lobstr,m=(d=o.activeNetwork,(f=Object.entries(gc).find(function(e){return e[1]===d}))?f[0].toUpperCase():"MAINNET");return u.jsxs("div",{className:"bluxcc:w-full",style:{fontFamily:n.fontFamily},children:[u.jsxs("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[u.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),t("signTransactionPrompt")]}),u.jsx(Cl,{operationsCount:l.operations,sender:l.sender,receiver:l.receiver,network:c.network,estimatedFee:l.estimatedFee.toString(),action:l.action}),p&&u.jsx("p",{className:"bluxcc:my-2! bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-xs! bluxcc:text-alert-error",children:t("lobstrWarning",{network:m})}),u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:p?"0px":"16px",borderRadius:n.borderRadius,borderColor:n.borderColor},children:[u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),u.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(jc(n.textColor,.8))},children:i.address?Fc(null===(e=r.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),u.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-2.5 bluxcc:py-2",style:{borderRadius:n.borderRadius,backgroundColor:n.fieldBackground,color:n.textColor},children:u.jsxs("p",{className:"bluxcc:max-w-22.5 bluxcc:text-xs bluxcc:font-normal",children:[h?Oc(h):"0"," XLM"]})})]}),u.jsx($u,{}),u.jsx(Xu,{size:"large",state:"enabled",variant:"fill",onClick:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return Ml(r),[2]})})},children:t("approve")})]})},Tl=function(){var e=zu(),t=V(function(e){return e.config.appearance}),r={logo:u.jsx(Pu,{name:Fu.Stellar,props:{}}),assetBalance:.43332,valueInCurrency:203},n=[{label:e("network"),value:"Stellar",link:!0},{label:e("address"),value:"GFGE...MKLW",copyable:!0},{label:e("market_cap"),value:"2.45M"},{label:e("total_volume"),value:323},{label:e("all_time_high"),value:323}];return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:my-4",children:[u.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:r.logo}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[u.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:t.accentColor},children:["$",Oc(r.valueInCurrency)]}),u.jsxs("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:{color:jc(t.textColor,.7)},children:[Oc(r.assetBalance)," XLM"]})]})]}),u.jsx("div",{className:"bluxcc:space-y-1",children:n.map(function(e,r){return u.jsxs("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-8 bluxcc:px-4",style:{borderBottom:r<n.length-1?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[u.jsx("span",{children:e.label}),u.jsxs("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",style:{color:e.copyable||e.link?t.accentColor:jc(t.textColor,.7)},children:[e.link?u.jsx("a",{href:"#",target:"_blank",rel:"noreferrer",style:{color:t.accentColor,fontFamily:t.fontFamily},className:"bluxcc:no-underline",children:e.value}):e.value,e.copyable&&u.jsx(Pu,{name:Fu.Copy,props:{fill:t.accentColor}})]})]},r)})})]})},Rl={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},Bl=function(e){var t,r=e.theme,n=void 0===r?"purple":r,i=e.className,o=void 0===i?"":i,s=e.children,c=e.animationSpeed,l=void 0===c?1:c,d=e.onClick,f=e.style,h=e.size,p=void 0===h?"100%":h,b=a.useRef(null),m=a.useRef(null);return a.useEffect(function(){var e=b.current;if(e){var t=e.getContext("webgl");if(t){var r=e.getBoundingClientRect();e.width=r.width,e.height=r.height;var i=function(e,r){var n=t.createShader(r);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS),n},o=t.createProgram(),s=i("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),a=i("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(o,s),t.attachShader(o,a),t.linkProgram(o),t.useProgram(o);var c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var u=t.getAttribLocation(o,"aPos");t.enableVertexAttribArray(u),t.vertexAttribPointer(u,2,t.FLOAT,!1,0,0);var d=t.getUniformLocation(o,"uTime"),f=t.getUniformLocation(o,"uResolution"),h=t.getUniformLocation(o,"uColor1"),p=t.getUniformLocation(o,"uColor2"),g=t.getUniformLocation(o,"uColor3"),v=t.getUniformLocation(o,"uColor4"),y=Rl[n].colors;t.uniform2f(f,r.width,r.height),t.uniform3fv(h,y[0]),t.uniform3fv(p,y[1]),t.uniform3fv(g,y[2]),t.uniform3fv(v,y[3]);var x=0,w=function(){m.current=requestAnimationFrame(w),x+=.015*l,t.uniform1f(d,x),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return w(),function(){m.current&&cancelAnimationFrame(m.current),t.deleteProgram(o),t.deleteBuffer(c)}}}},[n,l]),u.jsxs("div",{onClick:d,className:"relative overflow-hidden ".concat(o),style:f,"data-gradient-id":(null===(t=Rl[n])||void 0===t?void 0:t.id)||"unknown_gradient",children:[u.jsx("canvas",{ref:b,className:"absolute inset-0 z-0",style:{width:p,height:p}}),s&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:s})]})},jl=function(){var e=zu(),t=V(function(e){return e.config.appearance}),r=[Fu.Shield,Fu.Key,Fu.Wallet,Fu.Chip];return u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[u.jsx(Bl,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-66 bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:u.jsx("div",{className:"bluxcc:marquee_outer",children:u.jsx("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:T(T(T(T([],r,!0),r,!0),r,!0),r,!0).map(function(e,r){return u.jsx("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-20.5 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:u.jsx(Pu,{name:e,props:{fill:"#fff"}})},r)})})})}),u.jsx("p",{className:"bluxcc:text-2xl bluxcc:mt-6.5 bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),u.jsx("p",{className:"bluxcc:text-sm text-center",children:e("blux_gateway")})]})},Ol=function(){var e=zu(),t=a.useState({address:""}),r=t[0],n=t[1],i=a.useState({});i[0];var o,s=i[1],c={logo:u.jsx(Pu,{name:Fu.Stellar,props:{}}),name:"xlm",valueInCurrency:203},l=V(function(e){return e.config.appearance});return u.jsxs("div",{children:[u.jsx(al,{autoFocus:!0,type:"text",label:e("enter_token_address"),placeholder:e("enter_address"),value:r.address,onChange:(o="address",function(e){n(function(t){var r;return N(N({},t),((r={})[o]=e.target.value,r))}),s(function(e){var t;return N(N({},e),((t={})[o]="",t))})}),onButtonClick:function(){},button:u.jsx("span",{style:{color:l.accentColor},className:"bluxcc:flex bluxcc:justify-between",children:e("check")})}),u.jsx("div",{className:"bluxcc:h-56 bluxcc:my-4",style:{borderRadius:l.borderRadius,border:"".concat(l.borderWidth," solid ").concat(l.borderColor)},children:u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[u.jsx("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:l.borderColor,borderWidth:l.borderWidth},children:c.logo}),c.name,u.jsx("div",{className:"bluxcc:flex bluxcc:flex-col",children:u.jsxs("span",{className:"bluxcc:text-2xl bluxcc:font-medium",style:{color:l.accentColor},children:["$",Oc(c.valueInCurrency)]})})]})}),u.jsx($u,{}),u.jsxs("div",{className:"bluxcc:flex bluxcc:gap-4",children:[u.jsx(Xu,{state:"disabled",variant:"outline",children:e("cancel")}),u.jsx(Xu,{state:"enabled",variant:"fill",size:"large",children:e("add_token")})]})]})},Ll=function(e){return M(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a;return k(this,function(c){switch(c.label){case 0:if(!(t=e.signMessage))return e.setRoute(g.FAILED),[2];if(e.setRoute(g.WAITING),!e.user)return e.setRoute(g.FAILED),[2];if(r=e.user,n=r.authMethod,i=r.authValue,"wallet"!==n)return e.setRoute(g.FAILED),[2];if(!(o=mc[i]))return e.setRoute(g.FAILED),[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Kc(o,t.message,null===(a=e.user)||void 0===a?void 0:a.address,t.options.network)];case 2:return s=c.sent(),e.setSignMessage(N(N({},t),{result:s}),!0,g.WAITING),setTimeout(function(){e.setRoute(g.SUCCESSFUL)},400),[3,4];case 3:return c.sent(),setTimeout(function(){e.setRoute(g.FAILED)},200),[3,4];case 4:return[2]}})})},Pl=function(){var e,t,r=zu(),n=V(function(e){return e}),i=n.config.appearance;if("signMessage"!==n.waitingStatus&&"signAuthEntry"!==n.waitingStatus)return n.setRoute(g.FAILED),null;var o="signMessage"===n.waitingStatus,s=o?n.signMessage:n.signAuthEntry;if(!s)return null;var a=o?s.message:s.authEntry;return u.jsxs("div",{children:[u.jsxs("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[u.jsxs("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),r("sign_permission")]}),u.jsx("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(i.borderWidth," solid ").concat(i.borderColor),borderRadius:i.borderRadius},children:a}),u.jsxs("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:i.borderRadius,borderColor:i.borderColor},children:[u.jsx("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:u.jsx("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:r("yourWallet")})}),u.jsx("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:i.borderRadius,backgroundColor:i.fieldBackground,color:i.textColor},children:u.jsx("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(jc(i.textColor,.8))},children:(null===(e=n.user)||void 0===e?void 0:e.address)?Fc(null===(t=n.user)||void 0===t?void 0:t.address,5):r("noAddressFound")})})]}),u.jsx($u,{}),u.jsx(Xu,{size:"large",state:"enabled",variant:"fill",onClick:function(){return M(void 0,void 0,void 0,function(){return k(this,function(e){return o?Ll(n):function(e){M(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a;return k(this,function(c){switch(c.label){case 0:if(!(t=e.signAuthEntry))return e.setRoute(g.FAILED),[2];if(e.setRoute(g.WAITING),!e.user)return e.setRoute(g.FAILED),[2];if(r=e.user,n=r.authMethod,i=r.authValue,"wallet"!==n)return e.setRoute(g.FAILED),[2];if(!(o=mc[i]))return e.setRoute(g.FAILED),[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,tu(o,t.authEntry,null===(a=e.user)||void 0===a?void 0:a.address,t.options.network)];case 2:return s=c.sent(),e.setSignAuthEntry(N(N({},t),{result:s}),!0,g.WAITING),setTimeout(function(){e.setRoute(g.SUCCESSFUL)},400),[3,4];case 3:return c.sent(),setTimeout(function(){e.setRoute(g.FAILED)},200),[3,4];case 4:return[2]}})})}(n),[2]})})},children:r("approve")})]})},Fl=function(){var e,t,r=zu(),n=V(function(e){return e});return u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:u.jsx(Pu,{name:Fu.RedExclamation,props:{}})}),u.jsxs("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[u.jsx("p",{className:"bluxcc:text-xl",children:"login"===n.waitingStatus?r("loginFailed"):r("signingFailed",{walletName:null!==(t=null===(e=n.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),u.jsx("p",{className:"bluxcc:text-sm",children:"login"===n.waitingStatus?r("loginRetryMessage"):r("signingRetryMessage")})]}),u.jsx($u,{}),u.jsx(Xu,{onClick:function(){var e;"signMessage"===n.waitingStatus?Ll(n):"sendTransaction"===n.waitingStatus?Ml(n):"login"===n.waitingStatus&&bl(n,mc[(null===(e=n.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:r("tryAgain")})]})},Ul=function(){var e=zu(),t=V(function(e){return e}),r=t.config.appearance;a.useEffect(function(){M(void 0,void 0,void 0,function(){return k(this,function(e){return bl(t,mc[b.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var n=t.walletConnect.connection.uri;return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.fieldBackground,borderWidth:r.borderWidth},children:[u.jsx(yl,{size:184,value:n,bgColor:r.fieldBackground,fgColor:r.accentColor,level:"Q",imgSize:40}),u.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:r.background},children:u.jsx(Pu,{name:Fu.WalletConnect,props:{fill:r.accentColor,background:r.fieldBackground}})})]}),u.jsx("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:u.jsx("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),u.jsx($u,{}),u.jsx(Xu,{size:"large",state:"enabled",variant:"tonal",style:{color:r.accentColor},onClick:function(){return function(r){Ic(r),t.setAlert("copy",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(n)},children:"Copy URI"})]})},Dl=function(){var e,t=zu(),r=a.useState(!1),n=r[0],i=r[1],o=a.useState(""),s=o[0],c=o[1],l=V(function(e){return e}),d=a.useState(null),f=d[0],h=d[1],p=l.config.appearance,b=l.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),m=0!==(e=b).length?e:[B],g=function(){return n?p.accentColor:p.borderColor};return u.jsxs("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[u.jsx("div",{children:u.jsxs("div",{onFocus:function(){return i(!0)},onBlur:function(){return i(!1)},onMouseEnter:function(e){n||(e.currentTarget.style.borderColor=p.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){n||(e.currentTarget.style.borderColor=p.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:p.fieldBackground,borderWidth:p.borderWidth,"--tw-ring-color":g(),borderRadius:p.borderRadius,borderColor:g(),color:p.textColor},children:[u.jsx(Pu,{name:Fu.Search,props:{fill:p.textColor}}),u.jsx("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:t("search"),value:s,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{fontFamily:p.fontFamily,color:p.textColor}})]})}),u.jsxs("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto overflowStyle bluxcc:max-h-[300px]",children:[m.map(function(e,t){return u.jsxs("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,r="sendAsset";"swapTo"===l.selectAsset.field?r="swapToAsset":"swapFrom"===l.selectAsset.field&&(r="swapFromAsset"),l.setSelectAsset(N(N({},l.selectAsset),((t={})[r]=e,t)));var n=Nc(l.selectAsset.field);l.setRoute(n)}(e)},onMouseEnter:function(){return h(t)},onMouseLeave:function(){return h(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:f===t?p.fieldBackground:"transparent",color:p.textColor,borderBottomStyle:"dashed",borderBottomWidth:t<m.length-1?p.borderWidth:"0px",borderBottomColor:p.borderColor,transition:"all 0.2s ease-in-out",fontFamily:p.fontFamily},children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[u.jsx("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:p.borderRadius,background:p.fieldBackground,border:"".concat(p.borderWidth," solid ").concat(p.borderColor)},children:"native"===e.assetType?u.jsx(Pu,{name:Fu.Stellar,props:{fill:Cc(p.fieldBackground)}}):u.jsx(Pu,{name:Fu.QuestionMark,props:{fill:Cc(p.fieldBackground)}})}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col",children:[u.jsx("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),u.jsx("span",{className:"bluxcc:text-xs",style:{color:jc(p.textColor,.7)},children:e.assetCode})]})]}),u.jsx("span",{className:"bluxcc:font-medium",children:Oc(e.assetBalance)})]},e.assetType+e.assetIssuer)}),0===m.length&&u.jsx("div",{style:{color:p.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:t("noAssetsFound")})]})]})},zl=function(){var e,t=V(function(e){return e}),r=t.config.appearance,n=null===(e=t.user)||void 0===e?void 0:e.address,i=t.balances.balances,o=t.setAlert,s=i.find(function(e){return"native"===e.asset_type});s&&s.balance;return u.jsxs("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[u.jsxs("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,backgroundColor:r.fieldBackground,borderWidth:r.borderWidth},children:[u.jsx(yl,{size:184,value:n,bgColor:r.fieldBackground,fgColor:r.accentColor,level:"Q"}),u.jsx("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:r.background},children:u.jsx(Pu,{name:Fu.SmallBlux,props:{fill:r.accentColor,background:r.fieldBackground}})})]}),u.jsx("p",{style:{color:r.textColor},className:"bluxcc:my-4",children:"Scan this QR code or copy your wallet address to receive payments"}),u.jsxs("div",{className:"bluxcc:px-2.5 bluxcc:py-3 bluxcc:w-full",style:{color:r.textColor,borderColor:r.borderColor,borderWidth:r.borderWidth,borderRadius:r.borderRadius,backgroundColor:r.fieldBackground},children:[u.jsxs("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[u.jsx("span",{className:"",children:"Your Address"}),u.jsxs("span",{className:"bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:gap-1 bluxcc:text-[15px]",style:{color:jc(r.accentColor,.7)},onClick:function(){Ic(n).then(function(){Ic(n),o("copy","Address Copied"),setTimeout(function(){o("none","")},1e3)}).catch(function(){})},children:[n?Fc(n,5):"",u.jsx(Pu,{name:Fu.Copy,props:{fill:jc(r.accentColor,.7)}})]})]}),u.jsx("div",{className:"bluxcc:my-2",style:{borderRadius:r.borderRadius,borderTop:"".concat(r.borderWidth," dashed ").concat(r.borderColor)}}),u.jsxs("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[u.jsx("span",{className:"",children:"Your Balance"}),u.jsxs("span",{style:{color:jc(r.textColor,.7)},children:[Oc(null==s?void 0:s.balance)," XLM"]})]})]})]})};function Wl(){var e,t=V(function(e){return e}),r=t.config.appearance,n=null===(e=t.user)||void 0===e?void 0:e.address,i=n?"https://buy.moonpay.com?".concat(new URLSearchParams({currencyCode:"xlm",network:"stellar",walletAddress:n}).toString()):void 0,o=[{id:"moonpay",logoElement:u.jsx(el,{}),title:"Moonpay",url:i,disabled:!i},{id:"crypto",logo:Fu.Receive,title:"Receive Funds",route:g.FUND_ME_CRYPTO}];return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"bluxcc:space-y-2",children:[u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:w-full",children:[u.jsx("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:mb-2 bluxcc:size-17 bluxcc:rounded-full",style:{background:jc(r.accentColor,.12)},children:u.jsx(Zu,{fill:r.accentColor})}),u.jsx("div",{className:"bluxcc:mb-8 bluxcc:w-2/3 bluxcc:text-center",children:u.jsxs("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:jc(r.textColor,.7)},children:["Choose how you’d like to fund your wallet."," "]})})]}),o.map(function(e){return u.jsx(Vu,{endArrow:!0,label:e.title,startIcon:e.logo?u.jsx(Pu,{name:e.logo,props:{fill:r.accentColor}}):u.jsx(el,{}),onClick:function(){return function(e){e.disabled||(e.url?window.open(e.url,"_blank","noopener,noreferrer"):e.route&&t.openModal(e.route))}(e)}},e.id)})]})})}var $l=function(e){var t=e.label,r=e.icon,n=e.href;e.onClick;var i=V(function(e){return e}).config.appearance;return u.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"bluxcc:flex bluxcc:no-underline bluxcc:items-center bluxcc:justify-between bluxcc:w-full bluxcc:h-12 bluxcc:px-4 bluxcc:py-3 bluxcc:my-1 bluxcc:text-sm bluxcc:font-medium bluxcc:cursor-pointer",style:{color:i.textColor,fontFamily:i.fontFamily,borderColor:i.borderColor,borderWidth:i.borderWidth,borderRadius:i.borderRadius,backgroundColor:i.fieldBackground},children:[u.jsx("span",{children:t}),r]})},ql=function(){var e,t,r=zu(),n=V(function(e){return e}),i=n.config.appearance,o=null===(e=n.apiResponse)||void 0===e?void 0:e.terms,s=null===(t=n.apiResponse)||void 0===t?void 0:t.privacyPolicy,a=[];o&&a.push({label:"Terms of Service",icon:u.jsx(Yu,{}),href:o}),s&&a.push({label:"Privacy Policy",icon:u.jsx(Yu,{}),href:s});var c=function(){dl()};return u.jsxs("div",{className:"bluxcc:mt-1 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[u.jsx("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:jc(i.accentColor,.12)},children:u.jsx(Zu,{fill:i.accentColor})}),u.jsx("div",{className:"bluxcc:mb-10 bluxcc:w-full bluxcc:text-center",children:u.jsx("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:jc(i.textColor,.7)},children:r("acceptTermsAndPrivacy")})}),a.map(function(e){return u.jsx($l,N({},e),e.label)}),u.jsx($u,{}),u.jsxs("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:gap-2 bluxcc:w-full",children:[u.jsx(Xu,{size:"large",variant:"fill",state:"enabled",onClick:c,children:r("agree")}),u.jsx("button",{style:{color:jc(i.textColor,.9),fontFamily:i.fontFamily},id:"bluxcc-button",onClick:c,className:"bluxcc:flex bluxcc:h-11 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center",children:r("disagree")})]})]})},Kl=function(){var e=V(function(e){return e}),t=function(){var e,t,r=V(function(e){return e}),n=a.useState({error:null,loading:!0,balances:[]}),i=n[0],o=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return a.useEffect(function(){o({error:null,loading:!0,balances:[]}),yu({address:s}).then(function(e){o({error:null,loading:!1,balances:e})}).catch(function(e){o({error:e,loading:!1,balances:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),r=function(){var e,t,r=V(function(e){return e}),n=a.useState({error:null,loading:!0,transactions:[]}),i=n[0],o=n[1],s=null===(e=r.user)||void 0===e?void 0:e.address;return a.useEffect(function(){o({error:null,loading:!0,transactions:[]}),Au({limit:5,order:"desc",forAccount:s}).then(function(e){for(var t=e.response,r=[],n=0,i=t.records;n<i.length;n++){var s=i[n];r.push(s.operations())}Promise.all(r).then(function(e){var r=t.records.map(function(t,r){return N(N({},t),{operations:e[r].records})});o({error:null,loading:!1,transactions:r})})}).catch(function(e){o({error:e,loading:!1,transactions:[]})})},[s,null===(t=r.stellar)||void 0===t?void 0:t.servers]),i}(),n=function(){e.setBalances(t),e.setTransactions(r),i()},i=function(){var r=t.balances,n=r.find(function(e){return"native"===e.asset_type});if(e.modal.route!==g.SEND&&e.modal.route!==g.SWAP&&e.modal.route!==g.SELECT_ASSET&&0!==r.length&&n){var i=Sc(n);r.length>1&&(i=Sc(r[1])),e.setSelectAsset(N(N({},e.selectAsset),{swapToAsset:i,sendAsset:Sc(n),swapFromAsset:Sc(n)}))}};a.useEffect(function(){n();var e=setInterval(function(){n()},1e4);return function(){clearInterval(e)}},[t,r,e.modal.route])},Vl=function(){var t,r,n;Kl();var i=V(function(e){return e});!function(e){var t,r,n=a.useState(!1),i=n[0],o=n[1];a.useEffect(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?Bc(mc[e.user.authValue]).then(function(t){var r;t&&e.config.networks.includes(t)&&(null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork)!==t&&!e.networkSyncDisabled?gu(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),o(!0)):o(!1)}).catch(function(){o(!1)}):o(!1)},1e3);return function(){clearInterval(t),o(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(r=e.stellar)||void 0===r?void 0:r.activeNetwork]),a.useEffect(function(){e.modal.isOpen?i||e.modal.route!==g.WRONG_NETWORK||e.closeModal():setTimeout(function(){i&&e.config.promptOnWrongNetwork?e.openModal(g.WRONG_NETWORK):e.closeModal()},300)},[i,e.modal.isOpen])}(i);var o=i.modal,s=i.closeModal,c=i.setShowAllWallets,l=o.route,d=function(){var e;return(e={})[g.ONBOARDING]={title:"logInOrSignUp",Component:u.jsx(vl,{})},e[g.PROFILE]={title:"profile",Component:u.jsx(Hu,{})},e[g.WAITING]={title:"",Component:u.jsx(rl,{})},e[g.SUCCESSFUL]={title:"",Component:u.jsx(pl,{})},e[g.FAILED]={title:"",Component:u.jsx(Fl,{})},e[g.SEND_TRANSACTION]={title:"confirmation",Component:u.jsx(kl,{})},e[g.SEND]={title:"send",Component:u.jsx(cl,{})},e[g.ACTIVITY]={title:"activity",Component:u.jsx(Nl,{})},e[g.RECEIVE]={title:"receive",Component:u.jsx(xl,{})},e[g.SWAP]={title:"swap",Component:u.jsx(ol,{})},e[g.BALANCES]={title:"balances",Component:u.jsx(Sl,{})},e[g.BALANCE_DETAILS]={title:"",Component:u.jsx(Tl,{})},e[g.OTP]={title:"",Component:u.jsx(hl,{})},e[g.WRONG_NETWORK]={title:"",Component:u.jsx(wl,{})},e[g.ABOUT]={title:"whatIsBlux",Component:u.jsx(jl,{})},e[g.ADD_TOKEN]={title:"addToken",Component:u.jsx(Ol,{})},e[g.SIGN_MESSAGE]={title:"signMessage",Component:u.jsx(Pl,{})},e[g.SELECT_ASSET]={title:"selectAsset",Component:u.jsx(Dl,{})},e[g.WALLET_CONNECT]={title:"walletConnect",Component:u.jsx(Ul,{})},e[g.FUND_ME]={title:"addFunds",Component:u.jsx(Wl,{})},e[g.FUND_ME_CRYPTO]={title:"receiveFunds",Component:u.jsx(zl,{})},e[g.ACCEPT_TERMS_AND_PRIVACY]={title:"termsAndConditions",Component:u.jsx(ql,{})},e}()[l],f=l===g.WRONG_NETWORK,h=l===g.WAITING,p=l===g.SUCCESSFUL,b=l===g.SIGN_MESSAGE||l===g.SEND_TRANSACTION||l===g.FAILED,m=l===g.WRONG_NETWORK||h||p,v=h&&"sendTransaction"!==i.waitingStatus||l===g.ONBOARDING&&i.showAllWallets||[g.ACTIVITY,g.SEND,g.OTP,g.BALANCES,g.RECEIVE,g.SWAP,g.BALANCE_DETAILS,g.ABOUT,g.ADD_TOKEN,g.WALLET_CONNECT,g.FUND_ME_CRYPTO].includes(l)?"back":l===g.ONBOARDING?"info":void 0,y=i.modal.dynamicTitle||d.title,x=function(){if(!f){s(),c(!1);var e=i.waitingStatus,t="signMessage"===e,r="sendTransaction"===e;if(ll(),t||r){var n=t?i.signMessage:i.sendTransaction;if(n){var o=n.resolver,a=n.rejecter,u=n.result;p&&o&&u?(o(u),setTimeout(function(){i.cleanUp(e)},200)):b&&a&&(a("User rejected the transaction"),setTimeout(function(){i.cleanUp(e)},200))}}}};return a.useEffect(function(){i.authState.isAuthenticated||(i.signMessage&&(i.cleanUp("signMessage"),i.signMessage.rejecter("User logged out during the process.")),i.sendTransaction&&(i.cleanUp("sendTransaction"),i.sendTransaction.rejecter("User logged out during the process.")))},[i.authState]),a.useEffect(function(){var t,r,n,o=Rc((null===(t=i.stellar)||void 0===t?void 0:t.activeNetwork)||"",null!==(r=i.config.transports)&&void 0!==r?r:{}),s=o.horizon,a=o.soroban;i.setStellar({activeNetwork:(null===(n=i.stellar)||void 0===n?void 0:n.activeNetwork)||"",servers:{horizon:new e.Horizon.Server(s),soroban:new e.rpc.Server(a)}})},[i.config.transports,i.config.networks,null===(t=i.stellar)||void 0===t?void 0:t.activeNetwork]),u.jsxs(Lu,{isOpen:o.isOpen,isSticky:f||i.config.isPersistent,onClose:x,isPersistent:null!==(r=i.config.isPersistent)&&void 0!==r&&r,appearance:i.config.appearance,children:[u.jsx(Wu,{icon:v,onBack:function(){if(l===g.WAITING||l===g.OTP&&!i.authState.isAuthenticated||l===g.ABOUT||l===g.WALLET_CONNECT)i.setRoute(g.ONBOARDING);else if(i.showAllWallets)c(!1);else if([g.SEND,g.ACTIVITY,g.BALANCES,g.RECEIVE,g.SWAP].includes(l))i.setRoute(g.PROFILE);else if([g.BALANCE_DETAILS,g.ADD_TOKEN].includes(l))i.setRoute(g.BALANCES);else if(l!==g.FUND_ME_CRYPTO){if(l===g.SELECT_ASSET){var e=Nc(i.selectAsset.field);i.setRoute(e)}}else i.setRoute(g.FUND_ME)},onInfo:function(){i.setRoute(g.ABOUT)},onClose:x,title:y,closeButton:!m,isPersistent:null!==(n=i.config.isPersistent)&&void 0!==n&&n}),d.Component]})};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-3{bottom:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-40{z-index:40!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-1\\.25{margin-block:calc(var(--bluxcc-spacing)*1.25)!important}.bluxcc\\:my-2,.bluxcc\\:my-2\\!{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-6\\.5{margin-top:calc(var(--bluxcc-spacing)*6.5)!important}.bluxcc\\:mt-22{margin-top:calc(var(--bluxcc-spacing)*22)!important}.bluxcc\\:mr-0\\.5{margin-right:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2,.bluxcc\\:mr-2\\!{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-8{margin-bottom:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10,.bluxcc\\:size-10\\!{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-17{height:calc(var(--bluxcc-spacing)*17)!important;width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-20\\.5{height:calc(var(--bluxcc-spacing)*20.5)!important;width:calc(var(--bluxcc-spacing)*20.5)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-52{height:calc(var(--bluxcc-spacing)*52)!important;width:calc(var(--bluxcc-spacing)*52)!important}.bluxcc\\:size-66{height:calc(var(--bluxcc-spacing)*66)!important;width:calc(var(--bluxcc-spacing)*66)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-11{height:calc(var(--bluxcc-spacing)*11)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-56{height:calc(var(--bluxcc-spacing)*56)!important}.bluxcc\\:h-78{height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-78{max-height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:max-h-81{max-height:calc(var(--bluxcc-spacing)*81)!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:w-2\\/3{width:66.66667%!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-17\\!{width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-25{width:calc(var(--bluxcc-spacing)*25)!important}.bluxcc\\:w-73{width:calc(var(--bluxcc-spacing)*73)!important}.bluxcc\\:w-90\\!{width:calc(var(--bluxcc-spacing)*90)!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-22\\.5{max-width:calc(var(--bluxcc-spacing)*22.5)!important}.bluxcc\\:max-w-45{max-width:calc(var(--bluxcc-spacing)*45)!important}.bluxcc\\:max-w-46{max-width:calc(var(--bluxcc-spacing)*46)!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:cursor-pointer{cursor:pointer!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:items-start{align-items:flex-start!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1,.bluxcc\\:gap-1\\!{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:gap-4{gap:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-\\[\\#00D66E33\\]{background-color:#00d66e33!important}.bluxcc\\:bg-\\[\\#005DF333\\]{background-color:#005df333!important}.bluxcc\\:bg-\\[\\#D6000033\\]{background-color:#d6000033!important}.bluxcc\\:bg-\\[\\#FA8F0233\\]{background-color:#fa8f0233!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3,.bluxcc\\:px-3\\!{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:py-1,.bluxcc\\:py-1\\!{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pt-4\\.25{padding-top:calc(var(--bluxcc-spacing)*4.25)!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm,.bluxcc\\:text-sm\\!{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs,.bluxcc\\:text-xs\\!{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:text-\\[15px\\]{font-size:15px!important}.bluxcc\\:leading-4,.bluxcc\\:leading-4\\!{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:fadeOut .3s ease-in-out}@keyframes marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var Hl=!1,Gl=null,Xl=null,Yl=function(e){void 0===e&&(e=document.body),Hl&&Gl&&Xl&&Xl.contains(Gl)&&Xl.removeChild(Gl),Xl=e,Gl=document.createElement("div"),e.appendChild(Gl),c.createRoot(Gl).render(a.createElement(Vl))};M(void 0,void 0,void 0,function(){var e,t,r,n;return k(this,function(i){switch(i.label){case 0:if((e=W().logos)&&e.length>0)return[2];i.label=1;case 1:return i.trys.push([1,6,,7]),[4,M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,du()];case 1:return e=r.sent(),[4,hu(e)];case 2:return[2,(t=r.sent()).length?t:null];case 3:return r.sent(),[2,null];case 4:return[2]}})})];case 2:return(t=i.sent())?(W().setLogos(t),cu(),[2]):[4,au()];case 3:return r=i.sent(),W().setLogos(r),[4,du()];case 4:return n=i.sent(),[4,fu(n,r)];case 5:case 6:return i.sent(),[3,7];case 7:return[2]}})}),M(void 0,void 0,void 0,function(){return k(this,function(e){switch(e.label){case 0:return W().authState.isReady?[3,2]:[4,Uc(50)];case 1:return e.sent(),[3,0];case 2:return ru(!0),[2]}})}),Object.defineProperty(exports,"Asset",{enumerable:!0,get:function(){return e.Asset}}),exports.StellarSdk=y,exports.ToScVal=Ru,exports.blux=ou,exports.createConfig=function(t,r){var n,i;if(Hl=!0,!t||0===Object.keys(t).length)throw new Error("BLUX: createConfig must take a config object");if(!t.appId)throw new Error("BLUX: createConfig config object must have the appId property.");if(!t.appName)throw new Error("BLUX: createConfig config object must have the appName property.");if(!t.networks)throw new Error("BLUX: createConfig config object must have the networks property.");t.lang&&"en"!==t.lang.trim().toLowerCase()&&console.warn("BLUX: Only EN is currently supported. Falling back to default language."),Yl(r);var o=t.excludeWallets||["lobstr"];o=o.map(function(e){return e.toLowerCase()});var s=!0;void 0!==t.promptOnWrongNetwork&&(s=t.promptOnWrongNetwork);var a=N(N(N({},t),{excludeWallets:o,appearance:N(N({},j),null==t?void 0:t.appearance),defaultNetwork:"",promptOnWrongNetwork:s,lang:"en",explorer:t.explorer||"stellarchain",loginMethods:t.loginMethods||["wallet"],showWalletUIs:void 0===t.showWalletUIs||t.showWalletUIs}),(null==t?void 0:t.walletConnect)?{walletConnect:t.walletConnect}:{});!function(e,t,r){if(!e||0===e.length)throw new Error("BLUX: No network is set in config.networks.");var n=null!=t?t:e[0];if(!e.includes(n))throw new Error("BLUX: config.defaultNetwork is not listed in config.networks.");for(var i=0,o=e;i<o.length;i++){var s=o[i];if(!(vc[s]||r&&r[s]))throw new Error("BLUX: Must set transports for custom network ".concat(s))}}(t.networks,t.defaultNetwork,t.transports),a.defaultNetwork=null!==(n=t.defaultNetwork)&&void 0!==n?n:t.networks[0];var c,u,l,d,f=Rc(a.defaultNetwork,null!==(i=t.transports)&&void 0!==i?i:{}),h=f.horizon,p=f.soroban,b=W(),m=b.setConfig,g=b.setWallets,v=b.setIsReady,y=b.setStellar,x=b.setApiResponse;y({activeNetwork:a.defaultNetwork,servers:{horizon:new e.Horizon.Server(h),soroban:new e.rpc.Server(p)}}),m(a),(c=o,new Promise(function(e){"complete"===document.readyState?Pc(c).then(function(t){e(t)}):window.addEventListener("load",function(){Pc(c).then(function(t){e(t)})})})).then(function(e){var t=e.filter(function(e){return!o.includes(e.name.toLowerCase())});g(t),v(!0)}),t.walletConnect&&(u=t.walletConnect,l=t.appName,M(void 0,void 0,void 0,function(){var e,t,r,n;return k(this,function(i){switch(i.label){case 0:if(ml)return[2];ml=!0,i.label=1;case 1:return i.trys.push([1,4,,5]),e=W(),t=new _.default({projectId:u.projectId}),[4,I.default.init({core:t,metadata:{name:l,url:u.url,icons:u.icons,description:u.description}})];case 2:return r=i.sent(),e.setWalletConnectClient(r,null),[4,gl(r)];case 3:return n=i.sent(),e.setWalletConnectClient(r,n),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}})})),(d=t.appId,M(void 0,void 0,void 0,function(){var e,t;return k(this,function(r){switch(r.label){case 0:if(!d)throw new Error("appId is missing in config.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ec("".concat(Z,"/auth/validate"),{method:"POST",headers:(t={},t[J]=d,t)})];case 2:return 200===(e=r.sent()).status?[2,{isValid:!0,message:e.message,terms:e.result.terms,privacyPolicy:e.result.privacy_policy}]:404===e.status?[2,{isValid:!1,message:e.error,terms:"",privacyPolicy:""}]:[2,{isValid:!1,message:"Unexpected response from api.",terms:"",privacyPolicy:""}];case 3:return[2,{isValid:!1,message:"Unexpected response from api. "+r.sent().message,terms:"",privacyPolicy:""}];case 4:return[2]}})})).then(function(e){if(x(e),!e.isValid&&a.loginMethods.includes("email")||a.loginMethods.includes("passkey"))throw new Error("BLUX: config.appId is invalid.")})},exports.events=ju,exports.getAccount=function(t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:if(pu(),r=bu(t.address),n=mu(t.network).horizon,!e.StrKey.isValidEd25519PublicKey(r))throw new Error("Invalid address");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.loadAccount(r)];case 2:return[2,i.sent()];case 3:return i.sent(),[2,null];case 4:return[2]}})})},exports.getAccounts=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("accounts",[],e),e.forSigner&&(t=t.forSigner(e.forSigner)),e.forAsset&&(t=t.forAsset(e.forAsset)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getAssets=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getBalances=yu,exports.getClaimableBalances=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("claimableBalances",[],e),e.asset&&(t=t.asset(e.asset)),e.claimant&&(t=t.claimant(e.claimant)),e.sponsor&&(t=t.sponsor(e.sponsor)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getEffects=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("effects",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getInitialState=F,exports.getLedgers=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getLiquidityPools=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("liquidityPools",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getNetwork=function(){var e,t=W();if(0===t.config.networks.length)throw new Error("getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},exports.getOffers=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("offers",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.buying&&(t=t.buying(e.buying)),e.selling&&(t=t.selling(e.selling)),e.sponsor&&(t=t.sponsor(e.sponsor)),e.seller&&(t=t.seller(e.seller)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getOperations=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("operations",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getOrderbook=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return pu(),[4,(r=vu("orderbook",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},exports.getPayments=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("payments",[],e),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getState=L,exports.getStrictReceivePaths=xu,exports.getStrictSendPaths=wu,exports.getTradeAggregation=function(e,t){return M(void 0,void 0,void 0,function(){var r,n;return k(this,function(i){switch(i.label){case 0:return pu(),[4,(r=vu("tradeAggregation",e,t)).call()];case 1:return n=i.sent(),[2,{builder:r,response:n}]}})})},exports.getTrades=function(e){return M(void 0,void 0,void 0,function(){var t,r;return k(this,function(n){switch(n.label){case 0:return pu(),t=vu("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(e.forAssetPair[0],e.forAssetPair[1])),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),e.forAccount&&(t=t.forAccount(e.forAccount)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 1:return r=n.sent(),[2,{builder:t,response:r}]}})})},exports.getTransactions=Au,exports.networks=Eu,exports.numberish=Su,exports.setAppearance=Bu,exports.subscribe=P,exports.switchNetwork=function(e){var t=W();gu(e),t.setNetworkSyncDisabled(!0)},exports.useExportedStore=function(e){return t.useStore(O,e)};
|