UNPKG

@web3auth-mpc/ui

Version:
2 lines 756 kB
/*! For license information please see ui.umd.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Ui=t():e.Ui=t()}(self,(()=>(()=>{var e,t,n={8856:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.JsonRpcError=void 0;const o=n(1791),i=r(n(7847)),a=n(7962);class s extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,(0,o.isPlainObject)(this.data)&&(e.data.cause=(0,a.serializeCause)(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return(0,i.default)(this.serialize(),l,2)}}function l(e,t){if("[Circular]"!==t)return t}t.JsonRpcError=s,t.EthereumProviderError=class extends s{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}},5191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},6748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerErrors=t.rpcErrors=void 0;const r=n(8856),o=n(5191),i=n(7962);function a(e,t){const[n,o]=l(t);return new r.JsonRpcError(e,n??(0,i.getMessageFromCode)(e),o)}function s(e,t){const[n,o]=l(t);return new r.EthereumProviderError(e,n??(0,i.getMessageFromCode)(e),o)}function l(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,n]}}return[]}t.rpcErrors={parse:e=>a(o.errorCodes.rpc.parse,e),invalidRequest:e=>a(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>a(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>a(o.errorCodes.rpc.methodNotFound,e),internal:e=>a(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return a(t,e)},invalidInput:e=>a(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>a(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>a(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>a(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>a(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>a(o.errorCodes.rpc.limitExceeded,e)},t.providerErrors={userRejectedRequest:e=>s(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>s(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>s(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>s(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>s(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:o}=e;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(t,n,o)}}},774:(e,t,n)=>{"use strict";n(8856),n(7962),n(6748),n(5191)},7962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeCause=t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=n(1791),o=n(5191),i=o.errorCodes.rpc.internal,a={code:i,message:s(i)};function s(e,n="Unspecified error message. This is a bug, please report it."){if(l(e)){const n=e.toString();if((0,r.hasProperty)(o.errorValues,n))return o.errorValues[n].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function l(e){return Number.isInteger(e)}function c(e){return Array.isArray(e)?e.map((e=>(0,r.isValidJson)(e)?e:(0,r.isObject)(e)?u(e):null)):(0,r.isObject)(e)?u(e):(0,r.isValidJson)(e)?e:null}function u(e){return Object.getOwnPropertyNames(e).reduce(((t,n)=>{const o=e[n];return(0,r.isValidJson)(o)&&(t[n]=o),t}),{})}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=l,t.serializeError=function(e,{fallbackError:t=a,shouldIncludeStack:n=!0}={}){if(!(0,r.isJsonRpcError)(t))throw new Error("Must provide fallback error with integer number code and string message.");const o=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if((0,r.isJsonRpcError)(e))return e;return{...t,data:{cause:c(e)}}}(e,t);return n||delete o.stack,o},t.serializeCause=c},9336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AssertionError:function(){return i},assert:function(){return a},assertStruct:function(){return s},assertExhaustive:function(){return l}});const r=n(9249);function o(e,t){return n=e,Boolean("string"==typeof n?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var n}class i extends Error{constructor(e){var t,n;super(e.message),n="ERR_ASSERTION",(t="code")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n}}function a(e,t="Assertion failed.",n=i){if(!e){if(t instanceof Error)throw t;throw o(n,t)}}function s(e,t,n="Assertion failed",a=i){try{(0,r.assert)(e,t)}catch(e){throw o(a,`${n}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}}function l(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},8007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"base64",{enumerable:!0,get:function(){return i}});const r=n(9249),o=n(9336),i=(e,t={})=>{const n=t.paddingRequired??!1,i=t.characterSet??"base64";let a,s;return"base64"===i?a=String.raw`[A-Za-z0-9+\/]`:((0,o.assert)("base64url"===i),a=String.raw`[-_A-Za-z0-9]`),s=n?new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,r.pattern)(e,s)}},8948:(e,t,n)=>{"use strict";var r=n(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isBytes:function(){return u},assertIsBytes:function(){return d},bytesToHex:function(){return f},bytesToBigInt:function(){return p},bytesToSignedBigInt:function(){return h},bytesToNumber:function(){return A},bytesToString:function(){return g},hexToBytes:function(){return m},bigIntToBytes:function(){return w},signedBigIntToBytes:function(){return y},numberToBytes:function(){return b},stringToBytes:function(){return v},valueToBytes:function(){return E},concatBytes:function(){return x},createDataView:function(){return _}});const o=n(9336),i=n(9965),a=48,s=58,l=87,c=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function u(e){return e instanceof Uint8Array}function d(e){(0,o.assert)(u(e),"Value must be a Uint8Array.")}function f(e){if(d(e),0===e.length)return"0x";const t=c(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return(0,i.add0x)(n.join(""))}function p(e){d(e);const t=f(e);return BigInt(t)}function h(e){d(e);let t=BigInt(0);for(const n of e)t=(t<<BigInt(8))+BigInt(n);return BigInt.asIntN(8*e.length,t)}function A(e){d(e);const t=p(e);return(0,o.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}function g(e){return d(e),(new TextDecoder).decode(e)}function m(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,i.assertIsHexString)(e);const t=(0,i.remove0x)(e).toLowerCase(),n=t.length%2==0?t:`0${t}`,r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=n.charCodeAt(2*e),o=n.charCodeAt(2*e+1),i=t-(t<s?a:l),c=o-(o<s?a:l);r[e]=16*i+c}return r}function w(e){return(0,o.assert)("bigint"==typeof e,"Value must be a bigint."),(0,o.assert)(e>=BigInt(0),"Value must be a non-negative bigint."),m(e.toString(16))}function y(e,t){(0,o.assert)("bigint"==typeof e,"Value must be a bigint."),(0,o.assert)("number"==typeof t,"Byte length must be a number."),(0,o.assert)(t>0,"Byte length must be greater than 0."),(0,o.assert)(function(e,t){(0,o.assert)(t>0);const n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let n=e;const r=new Uint8Array(t);for(let e=0;e<r.length;e++)r[e]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}function b(e){return(0,o.assert)("number"==typeof e,"Value must be a number."),(0,o.assert)(e>=0,"Value must be a non-negative number."),(0,o.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),m(e.toString(16))}function v(e){return(0,o.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function E(e){if("bigint"==typeof e)return w(e);if("number"==typeof e)return b(e);if("string"==typeof e)return e.startsWith("0x")?m(e):v(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}function x(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const o=E(e[r]);t[r]=o,n+=o.length}const r=new Uint8Array(n);for(let e=0,n=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r}function _(e){if(void 0!==r&&e instanceof r){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},6601:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{CAIP_CHAIN_ID_REGEX:function(){return o},CAIP_NAMESPACE_REGEX:function(){return i},CAIP_REFERENCE_REGEX:function(){return a},CAIP_ACCOUNT_ID_REGEX:function(){return s},CAIP_ACCOUNT_ADDRESS_REGEX:function(){return l},CaipChainIdStruct:function(){return c},CaipNamespaceStruct:function(){return u},CaipReferenceStruct:function(){return d},CaipAccountIdStruct:function(){return f},CaipAccountAddressStruct:function(){return p},isCaipChainId:function(){return h},isCaipNamespace:function(){return A},isCaipReference:function(){return g},isCaipAccountId:function(){return m},isCaipAccountAddress:function(){return w},parseCaipChainId:function(){return y},parseCaipAccountId:function(){return b}});const r=n(9249),o=RegExp("^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$","u"),i=/^[-a-z0-9]{3,8}$/u,a=/^[-_a-zA-Z0-9]{1,32}$/u,s=RegExp("^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$","u"),l=/^[-.%a-zA-Z0-9]{1,128}$/u,c=(0,r.pattern)((0,r.string)(),o),u=(0,r.pattern)((0,r.string)(),i),d=(0,r.pattern)((0,r.string)(),a),f=(0,r.pattern)((0,r.string)(),s),p=(0,r.pattern)((0,r.string)(),l);function h(e){return(0,r.is)(e,c)}function A(e){return(0,r.is)(e,u)}function g(e){return(0,r.is)(e,d)}function m(e){return(0,r.is)(e,f)}function w(e){return(0,r.is)(e,p)}function y(e){const t=o.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}}function b(e){const t=s.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}},3100:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ChecksumStruct",{enumerable:!0,get:function(){return i}});const r=n(9249),o=n(8007),i=(0,r.size)((0,o.base64)((0,r.string)(),{paddingRequired:!0}),44,44)},3161:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createNumber:function(){return f},createBigInt:function(){return p},createBytes:function(){return h},createHex:function(){return A}});const r=n(9249),o=n(9336),i=n(8948),a=n(9965),s=(0,r.union)([(0,r.number)(),(0,r.bigint)(),(0,r.string)(),a.StrictHexStruct]),l=(0,r.coerce)((0,r.number)(),s,Number),c=(0,r.coerce)((0,r.bigint)(),s,BigInt),u=((0,r.union)([a.StrictHexStruct,(0,r.instance)(Uint8Array)]),(0,r.coerce)((0,r.instance)(Uint8Array),(0,r.union)([a.StrictHexStruct]),i.hexToBytes)),d=(0,r.coerce)(a.StrictHexStruct,(0,r.instance)(Uint8Array),i.bytesToHex);function f(e){try{const t=(0,r.create)(e,l);return(0,o.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof r.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}}function p(e){try{return(0,r.create)(e,c)}catch(e){if(e instanceof r.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}}function h(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,r.create)(e,u)}catch(e){if(e instanceof r.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}function A(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,r.create)(e,d)}catch(e){if(e instanceof r.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},4945:(e,t)=>{"use strict";function n(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function r(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,n(e,t,"get"))}function o(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function i(e,t,r){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,n(e,t,"set"),r),r}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{FrozenMap:function(){return l},FrozenSet:function(){return d}});var a=new WeakMap;let s=Symbol.iterator;class l{get size(){return r(this,a).size}[s](){return r(this,a)[Symbol.iterator]()}entries(){return r(this,a).entries()}forEach(e,t){return r(this,a).forEach(((n,r,o)=>e.call(t,n,r,this)))}get(e){return r(this,a).get(e)}has(e){return r(this,a).has(e)}keys(){return r(this,a).keys()}values(){return r(this,a).values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}constructor(e){o(this,a,{writable:!0,value:void 0}),i(this,a,new Map(e)),Object.freeze(this)}}var c=new WeakMap;let u=Symbol.iterator;class d{get size(){return r(this,c).size}[u](){return r(this,c)[Symbol.iterator]()}entries(){return r(this,c).entries()}forEach(e,t){return r(this,c).forEach(((n,r,o)=>e.call(t,n,r,this)))}has(e){return r(this,c).has(e)}keys(){return r(this,c).keys()}values(){return r(this,c).values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}constructor(e){o(this,c,{writable:!0,value:void 0}),i(this,c,new Set(e)),Object.freeze(this)}}Object.freeze(l),Object.freeze(l.prototype),Object.freeze(d),Object.freeze(d.prototype)},870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9965:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{HexStruct:function(){return s},StrictHexStruct:function(){return l},HexAddressStruct:function(){return c},HexChecksumAddressStruct:function(){return u},isHexString:function(){return d},isStrictHexString:function(){return f},assertIsHexString:function(){return p},assertIsStrictHexString:function(){return h},isValidHexAddress:function(){return A},getChecksumAddress:function(){return g},isValidChecksumAddress:function(){return m},add0x:function(){return w},remove0x:function(){return y}});const r=n(125),o=n(9249),i=n(9336),a=n(8948),s=(0,o.pattern)((0,o.string)(),/^(?:0x)?[0-9a-f]+$/iu),l=(0,o.pattern)((0,o.string)(),/^0x[0-9a-f]+$/iu),c=(0,o.pattern)((0,o.string)(),/^0x[0-9a-f]{40}$/u),u=(0,o.pattern)((0,o.string)(),/^0x[0-9a-fA-F]{40}$/u);function d(e){return(0,o.is)(e,s)}function f(e){return(0,o.is)(e,l)}function p(e){(0,i.assert)(d(e),"Value must be a hexadecimal string.")}function h(e){(0,i.assert)(f(e),'Value must be a hexadecimal string, starting with "0x".')}function A(e){return(0,o.is)(e,c)||m(e)}function g(e){(0,i.assert)((0,o.is)(e,u),"Invalid hex address.");const t=y(e.toLowerCase()),n=y((0,a.bytesToHex)((0,r.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const r=n[t];return(0,i.assert)((0,o.is)(r,(0,o.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function m(e){return!!(0,o.is)(e,u)&&g(e)===e}function w(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function y(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},1791:(e,t,n)=>{"use strict";function r(e,t){return Object.keys(e).forEach((function(n){"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})})),e}Object.defineProperty(t,"__esModule",{value:!0}),r(n(9336),t),r(n(8007),t),r(n(8948),t),r(n(6601),t),r(n(3100),t),r(n(3161),t),r(n(4945),t),r(n(870),t),r(n(9965),t),r(n(4081),t),r(n(8982),t),r(n(6280),t),r(n(8554),t),r(n(6596),t),r(n(2485),t),r(n(8435),t),r(n(1080),t),r(n(6717),t)},4081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{UnsafeJsonStruct:function(){return i},JsonStruct:function(){return a},isValidJson:function(){return s},getSafeJson:function(){return l},getJsonSize:function(){return c},jsonrpc2:function(){return u},JsonRpcVersionStruct:function(){return d},JsonRpcIdStruct:function(){return f},JsonRpcErrorStruct:function(){return p},JsonRpcParamsStruct:function(){return h},JsonRpcRequestStruct:function(){return A},JsonRpcNotificationStruct:function(){return g},isJsonRpcNotification:function(){return m},assertIsJsonRpcNotification:function(){return w},isJsonRpcRequest:function(){return y},assertIsJsonRpcRequest:function(){return b},PendingJsonRpcResponseStruct:function(){return v},JsonRpcSuccessStruct:function(){return E},JsonRpcFailureStruct:function(){return x},JsonRpcResponseStruct:function(){return _},isPendingJsonRpcResponse:function(){return S},assertIsPendingJsonRpcResponse:function(){return M},isJsonRpcResponse:function(){return k},assertIsJsonRpcResponse:function(){return C},isJsonRpcSuccess:function(){return B},assertIsJsonRpcSuccess:function(){return N},isJsonRpcFailure:function(){return I},assertIsJsonRpcFailure:function(){return j},isJsonRpcError:function(){return T},assertIsJsonRpcError:function(){return O},getJsonRpcIdValidator:function(){return L}});const r=n(9249),o=n(9336),i=(0,r.union)([(0,r.literal)(null),(0,r.boolean)(),(0,r.define)("finite number",(e=>(0,r.is)(e,(0,r.number)())&&Number.isFinite(e))),(0,r.string)(),(0,r.array)((0,r.lazy)((()=>i))),(0,r.record)((0,r.string)(),(0,r.lazy)((()=>i)))]),a=(0,r.coerce)(i,(0,r.any)(),(e=>((0,o.assertStruct)(e,i),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function s(e){try{return l(e),!0}catch{return!1}}function l(e){return(0,r.create)(e,a)}function c(e){(0,o.assertStruct)(e,a,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength}const u="2.0",d=(0,r.literal)(u),f=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),p=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(a),stack:(0,r.optional)((0,r.string)())}),h=(0,r.union)([(0,r.record)((0,r.string)(),a),(0,r.array)(a)]),A=(0,r.object)({id:f,jsonrpc:d,method:(0,r.string)(),params:(0,r.optional)(h)}),g=(0,r.object)({jsonrpc:d,method:(0,r.string)(),params:(0,r.optional)(h)});function m(e){return(0,r.is)(e,g)}function w(e,t){(0,o.assertStruct)(e,g,"Invalid JSON-RPC notification",t)}function y(e){return(0,r.is)(e,A)}function b(e,t){(0,o.assertStruct)(e,A,"Invalid JSON-RPC request",t)}const v=(0,r.object)({id:f,jsonrpc:d,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(p)}),E=(0,r.object)({id:f,jsonrpc:d,result:a}),x=(0,r.object)({id:f,jsonrpc:d,error:p}),_=(0,r.union)([E,x]);function S(e){return(0,r.is)(e,v)}function M(e,t){(0,o.assertStruct)(e,v,"Invalid pending JSON-RPC response",t)}function k(e){return(0,r.is)(e,_)}function C(e,t){(0,o.assertStruct)(e,_,"Invalid JSON-RPC response",t)}function B(e){return(0,r.is)(e,E)}function N(e,t){(0,o.assertStruct)(e,E,"Invalid JSON-RPC success response",t)}function I(e){return(0,r.is)(e,x)}function j(e,t){(0,o.assertStruct)(e,x,"Invalid JSON-RPC failure response",t)}function T(e){return(0,r.is)(e,p)}function O(e,t){(0,o.assertStruct)(e,p,"Invalid JSON-RPC error",t)}function L(e){const{permitEmptyString:t,permitFractions:n,permitNull:r}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(n||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||r&&null===e)}},8982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6280:(e,t,n)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createProjectLogger:function(){return i},createModuleLogger:function(){return a}});const o=(0,r(n(5130)).default)("metamask");function i(e){return o.extend(e)}function a(e,t){return e.extend(t)}},8554:(e,t)=>{"use strict";function n(e){return Array.isArray(e)&&e.length>0}function r(e){return null==e}function o(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{JsonSize:function(){return s},isNonEmptyArray:function(){return n},isNullOrUndefined:function(){return r},isObject:function(){return o},hasProperty:function(){return i},getKnownPropertyNames:function(){return a},ESCAPE_CHARACTERS_REGEXP:function(){return l},isPlainObject:function(){return c},isASCII:function(){return u},calculateStringSize:function(){return d},calculateNumberSize:function(){return f}});const i=(e,t)=>Object.hasOwnProperty.call(e,t);function a(e){return Object.getOwnPropertyNames(e)}var s;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(s||(s={}));const l=/"|\\|\n|\r|\t/gu;function c(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}function u(e){return e.charCodeAt(0)<=127}function d(e){return e.split("").reduce(((e,t)=>u(t)?e+1:e+2),0)+(e.match(l)??[]).length}function f(e){return e.toString().length}},6596:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{numberToHex:function(){return i},bigIntToHex:function(){return a},hexToNumber:function(){return s},hexToBigInt:function(){return l}});const r=n(9336),o=n(9965),i=e=>((0,r.assert)("number"==typeof e,"Value must be a number."),(0,r.assert)(e>=0,"Value must be a non-negative number."),(0,r.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,o.add0x)(e.toString(16))),a=e=>((0,r.assert)("bigint"==typeof e,"Value must be a bigint."),(0,r.assert)(e>=0,"Value must be a non-negative bigint."),(0,o.add0x)(e.toString(16))),s=e=>{(0,o.assertIsHexString)(e);const t=parseInt(e,16);return(0,r.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},l=e=>((0,o.assertIsHexString)(e),BigInt((0,o.add0x)(e)))},2485:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8435:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Duration:function(){return n},inMilliseconds:function(){return o},timeSince:function(){return i}}),function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(n||(n={}));const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};function o(e,t){return r(e,"count"),e*t}function i(e){return r(e,"timestamp"),Date.now()-e}},1080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6717:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VersionStruct:function(){return a},VersionRangeStruct:function(){return s},isValidSemVerVersion:function(){return l},isValidSemVerRange:function(){return c},assertIsSemVerVersion:function(){return u},assertIsSemVerRange:function(){return d},gtVersion:function(){return f},gtRange:function(){return p},satisfiesVersionRange:function(){return h}});const r=n(1011),o=n(9249),i=n(9336),a=(0,o.refine)((0,o.string)(),"Version",(e=>null!==(0,r.valid)(e)||`Expected SemVer version, got "${e}"`)),s=(0,o.refine)((0,o.string)(),"Version range",(e=>null!==(0,r.validRange)(e)||`Expected SemVer range, got "${e}"`));function l(e){return(0,o.is)(e,a)}function c(e){return(0,o.is)(e,s)}function u(e){(0,i.assertStruct)(e,a)}function d(e){(0,i.assertStruct)(e,s)}function f(e,t){return(0,r.gt)(e,t)}function p(e,t){return(0,r.gtr)(e,t)}function h(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}},9121:(e,t,n)=>{"use strict";const r=n(2497),o=Symbol("max"),i=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),h=()=>1,A=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(g(e,t)){if(w(e,r),!e[s])return}else n&&(e[p]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},m=e=>{if(e[i]>e[o])for(let t=e[d].tail;e[i]>e[o]&&null!==t;){const n=t.prev;w(e,t),t=n}},w=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[i]-=n.length,e[f].delete(n.key),e[d].removeNode(t)}};class y{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const b=(e,t,n,r)=>{let o=n.value;g(e,o)&&(w(e,n),e[s]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||h;if(this[a]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,m(this)}get max(){return this[o]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[i]=0,this[d].forEach((e=>{e.length=this[a](e.value,e.key),this[i]+=e.length}))),m(this)}get lengthCalculator(){return this[a]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;b(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;b(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[f]=new Map,this[d]=new r,this[i]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[o])return w(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[c]&&(this[u]||this[c](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[i]+=s-a.length,a.length=s,this.get(e),m(this),!0}const p=new y(e,t,s,r,n);return p.length>this[o]?(this[c]&&this[c](e,t),!1):(this[i]+=p.length,this[d].unshift(p),this[f].set(e,this[d].head),m(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!g(this,t)}get(e){return A(this,e,!0)}peek(e){return A(this,e,!1)}pop(){const e=this[d].tail;return e?(w(this,e),e.value):null}del(e){w(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach(((e,t)=>A(this,t,!1)))}}},6574:(e,t,n)=>{const r=Symbol("SemVer ANY");class o{static get ANY(){return r}constructor(e,t){if(t=i(t),e instanceof o){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new u(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.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("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=o;const i=n(3611),{safeRe:a,t:s}=n(9954),l=n(6619),c=n(9446),u=n(3238),d=n(1256)},1256:(e,t,n)=>{class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),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=>!g(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.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&A))+":"+e,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(i,B(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],d),s("comparator trim",e),e=e.replace(c[u.TILDETRIM],f),s("tilde trim",e),e=e.replace(c[u.CARETTRIM],p),s("caret trim",e);let l=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));r&&(l=l.filter((e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),s("range list",l);const m=new Map,w=l.map((e=>new a(e,this.options)));for(const e of w){if(g(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const b=[...m.values()];return o.set(t,b),b}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>w(n,t)&&e.set.some((e=>w(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(9121))({max:1e3}),i=n(3611),a=n(6574),s=n(9446),l=n(3238),{safeRe:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=n(9954),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:A}=n(5532),g=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,w=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every((e=>o.intersects(e,t))),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=x(e,t),s("caret",e),e=v(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=k(e,t),s("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{const n=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,((t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),b(n)?a="":b(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:b(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{s("caret",e,t);const n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),b(n)?l="":b(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l}))},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>M(e,t))).join(" ")),M=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,((n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const c=b(o),u=c||b(i),d=u||b(a),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(i=0),a=0,">"===r?(r=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",u?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):u?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n}))},k=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),C=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),B=e=>(t,n,r,o,i,a,s,l,c,u,d,f,p)=>`${n=b(r)?"":b(o)?`>=${r}.0.0${e?"-0":""}`:b(i)?`>=${r}.${o}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=b(c)?"":b(u)?`<${+c+1}.0.0-0`:b(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),N=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},3238:(e,t,n)=>{const r=n(9446),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=n(5532),{safeRe:a,t:s}=n(9954),l=n(3611),{compareIdentifiers:c}=n(9964);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw new TypeError(`version is longer than ${o} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],o=e.prerelease[t];if(r("prerelease compare",t,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return c(n,o)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const n=this.build[t],o=e.build[t];if(r("prerelease compare",t,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return c(n,o)}while(++t)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);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(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},8315:(e,t,n)=>{const r=n(5716);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},6619:(e,t,n)=>{const r=n(8596),o=n(89),i=n(9288),a=n(3573),s=n(4008),l=n(3782);e.exports=(e,t,n,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return o(e,n,c);case">":return i(e,n,c);case">=":return a(e,n,c);case"<":return s(e,n,c);case"<=":return l(e,n,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},655:(e,t,n)=>{const r=n(3238),o=n(5716),{safeRe:i,t:a}=n(9954);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=i[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),i[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[a.COERCERTL].lastIndex=-1}else n=e.match(i[a.COERCE]);return null===n?null:o(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},2053:(e,t,n)=>{const r=n(3238);e.exports=(e,t,n)=>{const o=new r(e,n),i=new r(t,n);return o.compare(i)||o.compareBuild(i)}},6926:(e,t,n)=>{const r=n(3239);e.exports=(e,t)=>r(e,t,!0)},3239:(e,t,n)=>{const r=n(3238);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},5913:(e,t,n)=>{const r=n(5716);e.exports=(e,t)=>{const n=r(e,null,!0),o=r(t,null,!0),i=n.compare(o);if(0===i)return null;const a=i>0,s=a?n:o,l=a?o:n,c=!!s.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return n.major!==o.major?u+"major":n.minor!==o.minor?u+"minor":n.patch!==o.patch?u+"patch":"prerelease"}},8596:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>0===r(e,t,n)},9288:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>r(e,t,n)>0},3573:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>r(e,t,n)>=0},4506:(e,t,n)=>{const r=n(3238);e.exports=(e,t,n,o,i)=>{"string"==typeof n&&(i=o,o=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,o,i).version}catch(e){return null}}},4008:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>r(e,t,n)<0},3782:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>r(e,t,n)<=0},2301:(e,t,n)=>{const r=n(3238);e.exports=(e,t)=>new r(e,t).major},3684:(e,t,n)=>{const r=n(3238);e.exports=(e,t)=>new r(e,t).minor},89:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>0!==r(e,t,n)},5716:(e,t,n)=>{const r=n(3238);e.exports=(e,t,n=!1)=>{if(e instanceof r)return e;try{return new r(e,t)}catch(e){if(!n)return null;throw e}}},7257:(e,t,n)=>{const r=n(3238);e.exports=(e,t)=>new r(e,t).patch},5734:(e,t,n)=>{const r=n(5716);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},9529:(e,t,n)=>{const r=n(3239);e.exports=(e,t,n)=>r(t,e,n)},8779:(e,t,n)=>{const r=n(2053);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},6818:(e,t,n)=>{const r=n(1256);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},6680:(e,t,n)=>{const r=n(2053);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},9749:(e,t,n)=>{const r=n(5716);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},1011:(e,t,n)=>{const r=n(9954),o=n(5532),i=n(3238),a=n(9964),s=n(5716),l=n(9749),c=n(8315),u=n(4506),d=n(5913),f=n(2301),p=n(3684),h=n(7257),A=n(5734),g=n(3239),m=n(9529),w=n(6926),y=n(2053),b=n(6680),v=n(8779),E=n(9288),x=n(4008),_=n(8596),S=n(89),M=n(3573),k=n(3782),C=n(6619),B=n(655),N=n(6574),I=n(1256),j=n(6818),T=n(8662),O=n(2740),L=n(7408),D=n(7248),R=n(8029),U=n(1572),P=n(9211),z=n(4821),F=n(1591),$=n(2185),W=n(2669);e.exports={parse:s,valid:l,clean:c,inc:u,diff:d,major:f,minor:p,patch:h,prerelease:A,compare:g,rcompare:m,compareLoose:w,compareBuild:y,sort:b,rsort:v,gt:E,lt:x,eq:_,neq:S,gte:M,lte:k,cmp:C,coerce:B,Comparator:N,Range:I,satisfies:j,toComparators:T,maxSatisfying:O,minSatisfying:L,minVersion:D,validRange:R,outside:U,gtr:P,ltr:z,intersects:F,simplifyRange:$,subset:W,SemVer:i,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},5532:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},9446:(e,t,n)=>{var r=n(4406);const o="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=o},9964:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),o=t.test(n);return r&&o&&(e=+e,n=+n),e===n?0:r&&!o?-1:o&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},3611:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},9954:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=n(5532),a=n(9446),s=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.t={};let d=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[f,o]],h=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),o=d++;a(e,o,t),u[e]=o,c[o]=t,s[o]=new RegExp(t,n?"g":void 0),l[o]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h("FULL",`^${c[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h("LOOSE",`^${c[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),h("COERCERTL",c[u.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN