UNPKG

@jordiamez/ui

Version:
2 lines 680 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(5554),a=r(n(7847)),i=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,i.serializeCause)(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return(0,a.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),a=n(7962);function i(e,t){const[n,o]=l(t);return new r.JsonRpcError(e,n??(0,a.getMessageFromCode)(e),o)}function s(e,t){const[n,o]=l(t);return new r.EthereumProviderError(e,n??(0,a.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=>i(o.errorCodes.rpc.parse,e),invalidRequest:e=>i(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>i(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>i(o.errorCodes.rpc.methodNotFound,e),internal:e=>i(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 i(t,e)},invalidInput:e=>i(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>i(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>i(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>i(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>i(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>i(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(5554),o=n(5191),a=o.errorCodes.rpc.internal,i={code:a,message:s(a)};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=i,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},2875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;const r=n(6686);function o(e,t){return n=e,Boolean("string"==typeof(null===(o=null===(r=null==n?void 0:n.prototype)||void 0===r?void 0:r.constructor)||void 0===o?void 0:o.name))?new e({message:t}):e({message:t});var n,r,o}class a extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}t.AssertionError=a,t.assert=function(e,t="Assertion failed.",n=a){if(!e){if(t instanceof Error)throw t;throw o(n,t)}},t.assertStruct=function(e,t,n="Assertion failed",i=a){try{(0,r.assert)(e,t)}catch(e){throw o(i,`${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)}.`)}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},7552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;const r=n(6686),o=n(2875);t.base64=(e,t={})=>{var n,a;const i=null!==(n=t.paddingRequired)&&void 0!==n&&n,s=null!==(a=t.characterSet)&&void 0!==a?a:"base64";let l,c;return"base64"===s?l=String.raw`[A-Za-z0-9+\/]`:((0,o.assert)("base64url"===s),l=String.raw`[-_A-Za-z0-9]`),c=i?new RegExp(`^(?:${l}{4})*(?:${l}{3}=|${l}{2}==)?$`,"u"):new RegExp(`^(?:${l}{4})*(?:${l}{2,3}|${l}{3}=|${l}{2}==)?$`,"u"),(0,r.pattern)(e,c)}},638:(e,t,n)=>{"use strict";var r=n(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;const o=n(2875),a=n(7657),i=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,a.add0x)(n.join(""))}function p(e){d(e);const t=f(e);return BigInt(t)}function A(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,a.assertIsHexString)(e);const n=(0,a.remove0x)(e).toLowerCase(),r=n.length%2==0?n:`0${n}`,o=new Uint8Array(r.length/2);for(let e=0;e<o.length;e++){const t=r.charCodeAt(2*e),n=r.charCodeAt(2*e+1),a=t-(t<s?i:l),c=n-(n<s?i:l);o[e]=16*a+c}return o}function h(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."),A(e.toString(16))}function g(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."),A(e.toString(16))}function m(e){return(0,o.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function w(e){if("bigint"==typeof e)return h(e);if("number"==typeof e)return g(e);if("string"==typeof e)return e.startsWith("0x")?A(e):m(e);if(u(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}t.isBytes=u,t.assertIsBytes=d,t.bytesToHex=f,t.bytesToBigInt=p,t.bytesToSignedBigInt=function(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)},t.bytesToNumber=function(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)},t.bytesToString=function(e){return d(e),(new TextDecoder).decode(e)},t.hexToBytes=A,t.bigIntToBytes=h,t.signedBigIntToBytes=function(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()},t.numberToBytes=g,t.stringToBytes=m,t.valueToBytes=w,t.concatBytes=function(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const o=w(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},t.createDataView=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)}},2793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;const r=n(6686),o=n(7552);t.ChecksumStruct=(0,r.size)((0,o.base64)((0,r.string)(),{paddingRequired:!0}),44,44)},5740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;const r=n(6686),o=n(2875),a=n(638),i=n(7657),s=(0,r.union)([(0,r.number)(),(0,r.bigint)(),(0,r.string)(),i.StrictHexStruct]),l=(0,r.coerce)((0,r.number)(),s,Number),c=(0,r.coerce)((0,r.bigint)(),s,BigInt),u=((0,r.union)([i.StrictHexStruct,(0,r.instance)(Uint8Array)]),(0,r.coerce)((0,r.instance)(Uint8Array),(0,r.union)([i.StrictHexStruct]),a.hexToBytes)),d=(0,r.coerce)(i.StrictHexStruct,(0,r.instance)(Uint8Array),a.bytesToHex);t.createNumber=function(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}},t.createBigInt=function(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}},t.createBytes=function(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}},t.createHex=function(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}}},6618:function(e,t){"use strict";var n,r,o=this&&this.__classPrivateFieldSet||function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},a=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class i{constructor(e){n.set(this,void 0),o(this,n,new Map(e),"f"),Object.freeze(this)}get size(){return a(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return a(this,n,"f")[Symbol.iterator]()}entries(){return a(this,n,"f").entries()}forEach(e,t){return a(this,n,"f").forEach(((n,r,o)=>e.call(t,n,r,this)))}get(e){return a(this,n,"f").get(e)}has(e){return a(this,n,"f").has(e)}keys(){return a(this,n,"f").keys()}values(){return a(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}t.FrozenMap=i;class s{constructor(e){r.set(this,void 0),o(this,r,new Set(e),"f"),Object.freeze(this)}get size(){return a(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return a(this,r,"f")[Symbol.iterator]()}entries(){return a(this,r,"f").entries()}forEach(e,t){return a(this,r,"f").forEach(((n,r,o)=>e.call(t,n,r,this)))}has(e){return a(this,r,"f").has(e)}keys(){return a(this,r,"f").keys()}values(){return a(this,r,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}t.FrozenSet=s,Object.freeze(i),Object.freeze(i.prototype),Object.freeze(s),Object.freeze(s.prototype)},4559:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7657:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const r=n(6686),o=n(2875);function a(e){return(0,r.is)(e,t.HexStruct)}function i(e){return(0,r.is)(e,t.StrictHexStruct)}t.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=a,t.isStrictHexString=i,t.assertIsHexString=function(e){(0,o.assert)(a(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,o.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},5554:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(2875),t),o(n(7552),t),o(n(638),t),o(n(2793),t),o(n(5740),t),o(n(6618),t),o(n(4559),t),o(n(7657),t),o(n(9545),t),o(n(8183),t),o(n(3621),t),o(n(758),t),o(n(4030),t),o(n(368),t),o(n(2968),t),o(n(7717),t),o(n(3191),t)},9545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const r=n(6686),o=n(2875);t.UnsafeJsonStruct=(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)((()=>t.UnsafeJsonStruct))),(0,r.record)((0,r.string)(),(0,r.lazy)((()=>t.UnsafeJsonStruct)))]),t.JsonStruct=(0,r.define)("Json",((e,n)=>{function r(e,t){const r=[...t.validator(e,n)];return!(r.length>0)||r}try{const n=r(e,t.UnsafeJsonStruct);return!0!==n?n:r(JSON.parse(JSON.stringify(e)),t.UnsafeJsonStruct)}catch(e){return e instanceof RangeError&&"Circular reference detected"}})),t.isValidJson=function(e){return(0,r.is)(e,t.JsonStruct)},t.getJsonSize=function(e){(0,o.assertStruct)(e,t.JsonStruct,"Invalid JSON value");const n=JSON.stringify(e);return(new TextEncoder).encode(n).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,r.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),t.JsonRpcErrorStruct=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(t.JsonStruct),stack:(0,r.optional)((0,r.string)())}),t.JsonRpcParamsStruct=(0,r.optional)((0,r.union)([(0,r.record)((0,r.string)(),t.JsonStruct),(0,r.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,r.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,r.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,r.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(e){return(0,r.is)(e,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,n){(0,o.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},t.isJsonRpcRequest=function(e){return(0,r.is)(e,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,n){(0,o.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},t.PendingJsonRpcResponseStruct=(0,r.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,r.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,r.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,r.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(e){return(0,r.is)(e,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,n){(0,o.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},t.isJsonRpcResponse=function(e){return(0,r.is)(e,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,n){(0,o.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},t.isJsonRpcSuccess=function(e){return(0,r.is)(e,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,n){(0,o.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},t.isJsonRpcFailure=function(e){return(0,r.is)(e,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,n){(0,o.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},t.isJsonRpcError=function(e){return(0,r.is)(e,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,n){(0,o.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},t.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:n,permitNull:r}=Object.assign({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)}},8183:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3621: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.createModuleLogger=t.createProjectLogger=void 0;const o=(0,r(n(5130)).default)("metamask");t.createProjectLogger=function(e){return o.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},758:(e,t)=>{"use strict";function n(e){return e.charCodeAt(0)<=127}var r;Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null==e},t.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)},t.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(r=t.JsonSize||(t.JsonSize={}))[r.Null=4]="Null",r[r.Comma=1]="Comma",r[r.Wrapper=1]="Wrapper",r[r.True=4]="True",r[r.False=5]="False",r[r.Quote=1]="Quote",r[r.Colon=1]="Colon",r[r.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(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}},t.isASCII=n,t.calculateStringSize=function(e){var r;return e.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(null!==(r=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==r?r:[]).length},t.calculateNumberSize=function(e){return e.toString().length}},4030:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;const r=n(2875),o=n(7657);t.numberToHex=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))),t.bigIntToHex=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))),t.hexToNumber=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},t.hexToBigInt=e=>((0,o.assertIsHexString)(e),BigInt((0,o.add0x)(e)))},368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2968:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(n=t.Duration||(t.Duration={}))[n.Millisecond=1]="Millisecond",n[n.Second=1e3]="Second",n[n.Minute=6e4]="Minute",n[n.Hour=36e5]="Hour",n[n.Day=864e5]="Day",n[n.Week=6048e5]="Week",n[n.Year=31536e6]="Year";const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.inMilliseconds=function(e,t){return r(e,"count"),e*t},t.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}},7717:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const r=n(1011),o=n(6686),a=n(2875);t.VersionStruct=(0,o.refine)((0,o.string)(),"Version",(e=>null!==(0,r.valid)(e)||`Expected SemVer version, got "${e}"`)),t.VersionRangeStruct=(0,o.refine)((0,o.string)(),"Version range",(e=>null!==(0,r.validRange)(e)||`Expected SemVer range, got "${e}"`)),t.isValidSemVerVersion=function(e){return(0,o.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,o.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,a.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,a.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,r.gt)(e,t)},t.gtRange=function(e,t){return(0,r.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}},9121:(e,t,n)=>{"use strict";const r=n(2497),o=Symbol("max"),a=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),A=()=>1,h=(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[a]>e[o])for(let t=e[d].tail;e[a]>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[a]-=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||A;if(this[i]="function"!=typeof t?A: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=A),e!==this[i]&&(this[i]=e,this[a]=0,this[d].forEach((e=>{e.length=this[i](e.value,e.key),this[a]+=e.length}))),m(this)}get lengthCalculator(){return this[i]}get length(){return this[a]}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[a]=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[i](t,e);if(this[f].has(e)){if(s>this[o])return w(this,this[f].get(e)),!1;const i=this[f].get(e).value;return this[c]&&(this[u]||this[c](e,i.value)),i.now=r,i.maxAge=n,i.value=t,this[a]+=s-i.length,i.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[a]+=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 h(this,e,!0)}peek(e){return h(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)=>h(this,t,!1)))}}},6574:(e,t,n)=>{const r=Symbol("SemVer ANY");class o{static get ANY(){return r}constructor(e,t){if(t=a(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?i[s.COMPARATORLOOSE]:i[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=a(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 a=n(3611),{safeRe:i,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=a(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof i)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&&A)|(this.options.loose&&h))+":"+e,n=o.get(t);if(n)return n;const r=this.options.loose,a=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(a,_(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=>B(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 i(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}),a=n(3611),i=n(6574),s=n(9446),l=n(3238),{safeRe:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:p}=n(9954),{FLAG_INCLUDE_PRERELEASE:A,FLAG_LOOSE:h}=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=M(e,t),s("xrange",e),e=S(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,a)=>{let i;return s("tilde",e,t,n,r,o,a),b(n)?i="":b(r)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:b(o)?i=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(s("replaceTilde pr",a),i=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):i=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",i),i}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>k(e,t))).join(" "),k=(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,a,i)=>{let l;return s("caret",e,t,n,o,a,i),b(n)?l="":b(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(a)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:i?(s("replaceCaret pr",i),l="0"===n?"0"===o?`>=${n}.${o}.${a}-${i} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${i} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),s("caret return",l),l}))},M=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,((n,r,o,a,i,l)=>{s("xRange",e,n,r,o,a,i,l);const c=b(o),u=c||b(a),d=u||b(i),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(a=0),i=0,">"===r?(r=">=",u?(o=+o+1,a=0,i=0):(a=+a+1,i=0)):"<="===r&&(r="<",u?o=+o+1:a=+a+1),"<"===r&&(l="-0"),n=`${r+o}.${a}.${i}${l}`):u?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${a}.0${l} <${o}.${+a+1}.0-0`),s("xRange return",n),n}))},S=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),B=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),_=e=>(t,n,r,o,a,i,s,l,c,u,d,f,p)=>`${n=b(r)?"":b(o)?`>=${r}.0.0${e?"-0":""}`:b(a)?`>=${r}.${o}.0${e?"-0":""}`:i?`>=${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!==i.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:a}=n(5532),{safeRe:i,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?i[s.LOOSE]:i[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>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||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<a)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),a=n(9288),i=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 a(e,n,c);case">=":return i(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:a,t:i}=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=a[i.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),a[i.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;a[i.COERCERTL].lastIndex=-1}else n=e.match(a[i.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),a=new r(t,n);return o.compare(a)||o.compareBuild(a)}},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),a=n.compare(o);if(0===a)return null;const i=a>0,s=i?n:o,l=i?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,a)=>{"string"==typeof n&&(a=o,o=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,o,a).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),a=n(3238),i=n(9964),s=n(5716),l=n(9749),c=n(8315),u=n(4506),d=n(5913),f=n(2301),p=n(3684),A=n(7257),h=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),k=n(8596),M=n(89),C=n(3573),S=n(3782),B=n(6619),_=n(655),N=n(6574),I=n(1256),j=n(6818),O=n(8662),T=n(2740),D=n(7408),L=n(7248),R=n(8029),z=n(1572),U=n(9211),P=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:A,prerelease:h,compare:g,rcompare:m,compareLoose:w,compareBuild:y,sort:b,rsort:v,gt:E,lt:x,eq:k,neq:M,gte:C,lte:S,cmp:B,coerce:_,Comparator:N,Range:I,satisfies:j,toComparators:O,maxSatisfying:T,minSatisfying:D,minVersion:L,validRange:R,outside:z,gtr:U,ltr:P,intersects:F,simplifyRange:$,subset:W,SemVer:a,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.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:a}=n(5532),i=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",a],[f,o]],A=(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++;i(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)};A("NUMERICIDENTIFIER","0|[1-9]\\d*"),A("NUMERICIDENTIFIERLOOSE","\\d+"),A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),A("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),A("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),A("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),A("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),A("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),A("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),A("BUILDIDENTIFIER",`${f}+`),A("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),A("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),A("FULL",`^${c[u.FULLPLAIN]}$`),A("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),A("LOOSE",`^${c[u.LOOSEPLAIN]}$`),A("GTLT","((?:<|>)?=?)"),A("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),A("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),A("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),A("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),A("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),A("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),A("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),A("COERCERTL",c[u.COERCE],!0),A("LONETILDE","(?:~>?)"),A("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",A("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),A("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),A("LONECARET","(?:\\^)"),A("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",A("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),A("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),A("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),A("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),A("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",A("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),A("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),A("STAR","(<|>)?=?\\s*\\*"),A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9211:(e,t,n)=>{const r=n(1572);e.exports=(e,t,n)=>r(e,t,">",n)},1591:(e,t,n)=>{const r=n(1256);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t,n))},4821:(e,t,n)=>{const r=n(1572);e.exports=(e,t,n)=>r(e,t,"<",n)},2740:(e,t,n)=>{const r=n(3238),o=n(1256);e.exports=(e,t,n)=>{let a=null,i=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&-1!==i.compare(e)||(a=e,i=new r(a,n)))})),a}},7408:(e,t,n)=>{const r=n(3238),o=n(1256);e.exports=(e,t,n)=>{let a=null,i=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&1!==i.compare(e)||(a=e,i=new r(a,n)))})),a}},7248:(e,t,n)=>{const r=n(3238),o=n(1256),a=n(9288);e.exports=(e,t)=>{e=new o(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let i=null;o.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!a(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!a(n,i)||(n=i)}return n&&e.test(n)?n:null}},1572:(e,t,n)=>{const r=n(3238),o=n(6574),{ANY:a}=o,i=n(1256),s=n(6818),l=n(9288),c=n(4008),u=n(3782),d=n(3573);e.exports=(e,t,n,f)=>{let p,A,h,g,m;switch(e=new r(e,f),t=new i(t,f),n){case">":p=l,A=u,h=c,g=">",m=">=";break;case"<":p=c,A=d,h=l,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,f))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let i=null,s=null;if(r.forEach((e=>{e.semver===a&&(e=new o(">=0.0.0")),i=i||e,s=s||e,p(e.semver,i.semver,f)?i=e:h(e.semver,s.semver,f)&&(s=e)})),i.operator===g||i.operator===m)return!1;if((!s.operator||s.operator===g)&&A(e,s.semver))return!1;if(s.operator===m&&h(e,s.semver))return!1}return!0}},2185:(e,t,n)=>{const r=n(6818),o=n(3239);e.exports=(e,t,n)=>{const a=[];let i=