@web3auth/metamask-adapter
Version:
metamask wallet adapter for web3auth
2 lines • 260 kB
JavaScript
/*! For license information please see metamaskAdapter.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.MetamaskAdapter=t():e.MetamaskAdapter=t()}(self,(()=>(()=>{var e={3190:e=>{"use strict";e.exports=function({mustBeMetaMask:e=!1,silent:t=!1,timeout:r=3e3}={}){!function(){if("boolean"!=typeof e)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!=typeof t)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!=typeof r)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();let n=!1;return new Promise((o=>{function i(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",i);const{ethereum:r}=window;if(!r||e&&!r.isMetaMask){const n=e&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!t&&console.error("@metamask/detect-provider:",n),o(null)}else o(r)}window.ethereum?i():(window.addEventListener("ethereum#initialized",i,{once:!0}),setTimeout((()=>{i()}),r))}))}},5385:function(e,t,r){"use strict";var n=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=r(170),i=n(r(3641)),s=r(7317);class a extends Error{constructor(e,t,r){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!==r&&(this.data=r)}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,s.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=a,t.EthereumProviderError=class extends a{constructor(e,t,r){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,r)}}},8231:(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."}}},4968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerErrors=t.rpcErrors=void 0;const n=r(5385),o=r(8231),i=r(7317);function s(e,t){const[r,o]=l(t);return new n.JsonRpcError(e,r??(0,i.getMessageFromCode)(e),o)}function a(e,t){const[r,o]=l(t);return new n.EthereumProviderError(e,r??(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:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}t.rpcErrors={parse:e=>s(o.errorCodes.rpc.parse,e),invalidRequest:e=>s(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(o.errorCodes.rpc.methodNotFound,e),internal:e=>s(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 s(t,e)},invalidInput:e=>s(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(o.errorCodes.rpc.limitExceeded,e)},t.providerErrors={userRejectedRequest:e=>a(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(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:r,data:o}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,o)}}},9137:(e,t,r)=>{"use strict";r(5385),r(7317),r(4968),r(8231)},7317:(e,t,r)=>{"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 n=r(170),o=r(8231),i=o.errorCodes.rpc.internal,s={code:i,message:a(i)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(l(e)){const r=e.toString();if((0,n.hasProperty)(o.errorValues,r))return o.errorValues[r].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function l(e){return Number.isInteger(e)}function c(e){return Array.isArray(e)?e.map((e=>(0,n.isValidJson)(e)?e:(0,n.isObject)(e)?u(e):null)):(0,n.isObject)(e)?u(e):(0,n.isValidJson)(e)?e:null}function u(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const o=e[r];return(0,n.isValidJson)(o)&&(t[r]=o),t}),{})}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=l,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!0}={}){if(!(0,n.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,n.isJsonRpcError)(e))return e;return{...t,data:{cause:c(e)}}}(e,t);return r||delete o.stack,o},t.serializeCause=c},6732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=((n=r(5977))&&n.__esModule?n:{default:n}).default.call(void 0,"metamask");t.createProjectLogger=function(e){return o.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},9734:()=>{},4090:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};t.__privateGet=(e,t,n)=>(r(e,t,"read from private field"),n?n.call(e):t.get(e)),t.__privateAdd=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},t.__privateSet=(e,t,n,o)=>(r(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n)},8352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7856),o=r(3649),i=r(8621),s=i.refine.call(void 0,i.string.call(void 0),"Version",(e=>null!==o.valid.call(void 0,e)||`Expected SemVer version, got "${e}"`)),a=i.refine.call(void 0,i.string.call(void 0),"Version range",(e=>null!==o.validRange.call(void 0,e)||`Expected SemVer range, got "${e}"`));t.VersionStruct=s,t.VersionRangeStruct=a,t.isValidSemVerVersion=function(e){return i.is.call(void 0,e,s)},t.isValidSemVerRange=function(e){return i.is.call(void 0,e,a)},t.assertIsSemVerVersion=function(e){n.assertStruct.call(void 0,e,s)},t.assertIsSemVerRange=function(e){n.assertStruct.call(void 0,e,a)},t.gtVersion=function(e,t){return o.gt.call(void 0,e,t)},t.gtRange=function(e,t){return o.gtr.call(void 0,e,t)},t.satisfiesVersionRange=function(e,t){return o.satisfies.call(void 0,e,t,{includePrerelease:!0})}},8441:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(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",e))(r||{}),n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.Duration=r,t.inMilliseconds=function(e,t){return n(e,"count"),e*t},t.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}},5455:(e,t,r)=>{"use strict";function n(e,t){return null!=e?e:t()}Object.defineProperty(t,"__esModule",{value:!0});var o=r(7856),i=r(8621);t.base64=(e,t={})=>{const r=n(t.paddingRequired,(()=>!1)),s=n(t.characterSet,(()=>"base64"));let a,l;return"base64"===s?a=String.raw`[A-Za-z0-9+\/]`:(o.assert.call(void 0,"base64url"===s),a=String.raw`[-_A-Za-z0-9]`),l=r?new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),i.pattern.call(void 0,e,l)}},7856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1181),o=r(8621);function i(e,t){return Boolean("string"==typeof function(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}([e,"optionalAccess",e=>e.prototype,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name]))?new e({message:t}):e({message:t})}var s=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};t.AssertionError=s,t.assert=function(e,t="Assertion failed.",r=s){if(!e){if(t instanceof Error)throw t;throw i(r,t)}},t.assertStruct=function(e,t,r="Assertion failed",a=s){try{o.assert.call(void 0,e,t)}catch(e){throw i(a,`${r}: ${function(e){return n.getErrorMessage.call(void 0,e).replace(/\.$/u,"")}(e)}.`)}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},3984:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2375),o=r(7856),i=r(8621),s=i.union.call(void 0,[i.number.call(void 0),i.bigint.call(void 0),i.string.call(void 0),n.StrictHexStruct]),a=i.coerce.call(void 0,i.number.call(void 0),s,Number),l=i.coerce.call(void 0,i.bigint.call(void 0),s,BigInt),c=(i.union.call(void 0,[n.StrictHexStruct,i.instance.call(void 0,Uint8Array)]),i.coerce.call(void 0,i.instance.call(void 0,Uint8Array),i.union.call(void 0,[n.StrictHexStruct]),n.hexToBytes)),u=i.coerce.call(void 0,n.StrictHexStruct,i.instance.call(void 0,Uint8Array),n.bytesToHex);t.createNumber=function(e){try{const t=i.create.call(void 0,e,a);return o.assert.call(void 0,Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof i.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return i.create.call(void 0,e,l)}catch(e){if(e instanceof i.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 i.create.call(void 0,e,c)}catch(e){if(e instanceof i.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 i.create.call(void 0,e,u)}catch(e){if(e instanceof i.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},8290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5455),o=r(8621),i=o.size.call(void 0,n.base64.call(void 0,o.string.call(void 0),{paddingRequired:!0}),44,44);t.ChecksumStruct=i},9019:()=>{},1181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9873),o=r(5903);function i(e){return"object"==typeof e&&null!==e&&"code"in e}function s(e){return"object"==typeof e&&null!==e&&"message"in e}t.isErrorWithCode=i,t.isErrorWithMessage=s,t.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},t.getErrorMessage=function(e){return s(e)&&"string"==typeof e.message?e.message:n.isNullOrUndefined.call(void 0,e)?"":String(e)},t.wrapError=function(e,t){if((r=e)instanceof Error||n.isObject.call(void 0,r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(t,{cause:e}):new(0,o.ErrorWithCause)(t,{cause:e}),i(e)&&(r.code=e.code),r}var r;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}},2049:()=>{},7287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7856),o=r(9873),i=r(8621),s=e=>i.object.call(void 0,e);function a({path:e,branch:t}){const r=e[e.length-1];return o.hasProperty.call(void 0,t[t.length-2],r)}function l(e){return new(0,i.Struct)({...e,type:`optional ${e.type}`,validator:(t,r)=>!a(r)||e.validator(t,r),refiner:(t,r)=>!a(r)||e.refiner(t,r)})}var c=i.union.call(void 0,[i.literal.call(void 0,null),i.boolean.call(void 0),i.define.call(void 0,"finite number",(e=>i.is.call(void 0,e,i.number.call(void 0))&&Number.isFinite(e))),i.string.call(void 0),i.array.call(void 0,i.lazy.call(void 0,(()=>c))),i.record.call(void 0,i.string.call(void 0),i.lazy.call(void 0,(()=>c)))]),u=i.coerce.call(void 0,c,i.any.call(void 0),(e=>(n.assertStruct.call(void 0,e,c),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function f(e){return i.create.call(void 0,e,u)}var d=i.literal.call(void 0,"2.0"),h=i.nullable.call(void 0,i.union.call(void 0,[i.number.call(void 0),i.string.call(void 0)])),p=s({code:i.integer.call(void 0),message:i.string.call(void 0),data:l(u),stack:l(i.string.call(void 0))}),g=i.union.call(void 0,[i.record.call(void 0,i.string.call(void 0),u),i.array.call(void 0,u)]),y=s({id:h,jsonrpc:d,method:i.string.call(void 0),params:l(g)}),b=s({jsonrpc:d,method:i.string.call(void 0),params:l(g)}),m=i.object.call(void 0,{id:h,jsonrpc:d,result:i.optional.call(void 0,i.unknown.call(void 0)),error:i.optional.call(void 0,p)}),v=s({id:h,jsonrpc:d,result:u}),w=s({id:h,jsonrpc:d,error:p}),E=i.union.call(void 0,[v,w]);t.object=s,t.exactOptional=l,t.UnsafeJsonStruct=c,t.JsonStruct=u,t.isValidJson=function(e){try{return f(e),!0}catch(e){return!1}},t.getSafeJson=f,t.getJsonSize=function(e){n.assertStruct.call(void 0,e,u,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=d,t.JsonRpcIdStruct=h,t.JsonRpcErrorStruct=p,t.JsonRpcParamsStruct=g,t.JsonRpcRequestStruct=y,t.JsonRpcNotificationStruct=b,t.isJsonRpcNotification=function(e){return i.is.call(void 0,e,b)},t.assertIsJsonRpcNotification=function(e,t){n.assertStruct.call(void 0,e,b,"Invalid JSON-RPC notification",t)},t.isJsonRpcRequest=function(e){return i.is.call(void 0,e,y)},t.assertIsJsonRpcRequest=function(e,t){n.assertStruct.call(void 0,e,y,"Invalid JSON-RPC request",t)},t.PendingJsonRpcResponseStruct=m,t.JsonRpcSuccessStruct=v,t.JsonRpcFailureStruct=w,t.JsonRpcResponseStruct=E,t.isPendingJsonRpcResponse=function(e){return i.is.call(void 0,e,m)},t.assertIsPendingJsonRpcResponse=function(e,t){n.assertStruct.call(void 0,e,m,"Invalid pending JSON-RPC response",t)},t.isJsonRpcResponse=function(e){return i.is.call(void 0,e,E)},t.assertIsJsonRpcResponse=function(e,t){n.assertStruct.call(void 0,e,E,"Invalid JSON-RPC response",t)},t.isJsonRpcSuccess=function(e){return i.is.call(void 0,e,v)},t.assertIsJsonRpcSuccess=function(e,t){n.assertStruct.call(void 0,e,v,"Invalid JSON-RPC success response",t)},t.isJsonRpcFailure=function(e){return i.is.call(void 0,e,w)},t.assertIsJsonRpcFailure=function(e,t){n.assertStruct.call(void 0,e,w,"Invalid JSON-RPC failure response",t)},t.isJsonRpcError=function(e){return i.is.call(void 0,e,p)},t.assertIsJsonRpcError=function(e,t){n.assertStruct.call(void 0,e,p,"Invalid JSON-RPC error",t)},t.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}},2375:(e,t,r)=>{"use strict";var n=r(5291).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var o=r(7856),i=r(8129),s=r(8621),a=r(9139),l=48,c=58,u=87,f=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 d(e){return e instanceof Uint8Array}function h(e){o.assert.call(void 0,d(e),"Value must be a Uint8Array.")}function p(e){if(h(e),0===e.length)return"0x";const t=f(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return T(r.join(""))}function g(e){h(e);const t=p(e);return BigInt(t)}function y(e){if("0x"===function(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}([e,"optionalAccess",e=>e.toLowerCase,"optionalCall",e=>e()]))return new Uint8Array;C(e);const t=O(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),o=r.charCodeAt(2*e+1),i=t-(t<c?l:u),s=o-(o<c?l:u);n[e]=16*i+s}return n}function b(e){return o.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),o.assert.call(void 0,e>=BigInt(0),"Value must be a non-negative bigint."),y(e.toString(16))}function m(e){return o.assert.call(void 0,"number"==typeof e,"Value must be a number."),o.assert.call(void 0,e>=0,"Value must be a non-negative number."),o.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),y(e.toString(16))}function v(e){return o.assert.call(void 0,"string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function w(e){if("bigint"==typeof e)return b(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?y(e):v(e);if(d(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}var E=s.pattern.call(void 0,s.string.call(void 0),/^(?:0x)?[0-9a-f]+$/iu),_=s.pattern.call(void 0,s.string.call(void 0),/^0x[0-9a-f]+$/iu),S=s.pattern.call(void 0,s.string.call(void 0),/^0x[0-9a-f]{40}$/u),R=s.pattern.call(void 0,s.string.call(void 0),/^0x[0-9a-fA-F]{40}$/u);function A(e){return s.is.call(void 0,e,E)}function I(e){return s.is.call(void 0,e,_)}function C(e){o.assert.call(void 0,A(e),"Value must be a hexadecimal string.")}function N(e){o.assert.call(void 0,s.is.call(void 0,e,R),"Invalid hex address.");const t=O(e.toLowerCase()),r=O(p(i.keccak_256.call(void 0,t)));return`0x${t.split("").map(((e,t)=>{const n=r[t];return o.assert.call(void 0,s.is.call(void 0,n,s.string.call(void 0)),"Hash shorter than address."),parseInt(n,16)>7?e.toUpperCase():e})).join("")}`}function x(e){return!!s.is.call(void 0,e,R)&&N(e)===e}function T(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function O(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}t.HexStruct=E,t.StrictHexStruct=_,t.HexAddressStruct=S,t.HexChecksumAddressStruct=R,t.isHexString=A,t.isStrictHexString=I,t.assertIsHexString=C,t.assertIsStrictHexString=function(e){o.assert.call(void 0,I(e),'Value must be a hexadecimal string, starting with "0x".')},t.isValidHexAddress=function(e){return s.is.call(void 0,e,S)||x(e)},t.getChecksumAddress=N,t.isValidChecksumAddress=x,t.add0x=T,t.remove0x=O,t.isBytes=d,t.assertIsBytes=h,t.bytesToHex=p,t.bytesToBigInt=g,t.bytesToSignedBigInt=function(e){h(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},t.bytesToNumber=function(e){h(e);const t=g(e);return o.assert.call(void 0,t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},t.bytesToString=function(e){return h(e),(new TextDecoder).decode(e)},t.bytesToBase64=function(e){return h(e),a.base64.encode(e)},t.hexToBytes=y,t.bigIntToBytes=b,t.signedBigIntToBytes=function(e,t){o.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),o.assert.call(void 0,"number"==typeof t,"Byte length must be a number."),o.assert.call(void 0,t>0,"Byte length must be greater than 0."),o.assert.call(void 0,function(e,t){o.assert.call(void 0,t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},t.numberToBytes=m,t.stringToBytes=v,t.base64ToBytes=function(e){return o.assert.call(void 0,"string"==typeof e,"Value must be a string."),a.base64.decode(e)},t.valueToBytes=w,t.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const o=w(e[n]);t[n]=o,r+=o.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},t.createDataView=function(e){if(void 0!==n&&e instanceof n){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},9873:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(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",e))(r||{}),n=/"|\\|\n|\r|\t/gu;function o(e){return e.charCodeAt(0)<=127}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),t.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},t.JsonSize=r,t.ESCAPE_CHARACTERS_REGEXP=n,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=o,t.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>o(t)?e+1:e+2),0)+(t=e.match(n),()=>[],null!=t?t:[]).length;var t},t.calculateNumberSize=function(e){return e.toString().length}},5939:()=>{},182:(e,t,r)=>{"use strict";function n(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}Object.defineProperty(t,"__esModule",{value:!0});var o=r(8621),i=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,s=/^[-a-z0-9]{3,8}$/u,a=/^[-_a-zA-Z0-9]{1,32}$/u,l=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,c=/^[-.%a-zA-Z0-9]{1,128}$/u,u=o.pattern.call(void 0,o.string.call(void 0),i),f=o.pattern.call(void 0,o.string.call(void 0),s),d=o.pattern.call(void 0,o.string.call(void 0),a),h=o.pattern.call(void 0,o.string.call(void 0),l),p=o.pattern.call(void 0,o.string.call(void 0),c);t.CAIP_CHAIN_ID_REGEX=i,t.CAIP_NAMESPACE_REGEX=s,t.CAIP_REFERENCE_REGEX=a,t.CAIP_ACCOUNT_ID_REGEX=l,t.CAIP_ACCOUNT_ADDRESS_REGEX=c,t.CaipChainIdStruct=u,t.CaipNamespaceStruct=f,t.CaipReferenceStruct=d,t.CaipAccountIdStruct=h,t.CaipAccountAddressStruct=p,t.isCaipChainId=function(e){return o.is.call(void 0,e,u)},t.isCaipNamespace=function(e){return o.is.call(void 0,e,f)},t.isCaipReference=function(e){return o.is.call(void 0,e,d)},t.isCaipAccountId=function(e){return o.is.call(void 0,e,h)},t.isCaipAccountAddress=function(e){return o.is.call(void 0,e,p)},t.parseCaipChainId=function(e){const t=i.exec(e);if(!n([t,"optionalAccess",e=>e.groups]))throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}},t.parseCaipAccountId=function(e){const t=l.exec(e);if(!n([t,"optionalAccess",e=>e.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}}}},5866:()=>{},6225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2375),o=r(7856);t.numberToHex=e=>(o.assert.call(void 0,"number"==typeof e,"Value must be a number."),o.assert.call(void 0,e>=0,"Value must be a non-negative number."),o.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),n.add0x.call(void 0,e.toString(16))),t.bigIntToHex=e=>(o.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),o.assert.call(void 0,e>=0,"Value must be a non-negative bigint."),n.add0x.call(void 0,e.toString(16))),t.hexToNumber=e=>{n.assertIsHexString.call(void 0,e);const t=parseInt(e,16);return o.assert.call(void 0,Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},t.hexToBigInt=e=>(n.assertIsHexString.call(void 0,e),BigInt(n.add0x.call(void 0,e)))},8032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o,i=r(4090),s=class{constructor(e){i.__privateAdd.call(void 0,this,n,void 0),i.__privateSet.call(void 0,this,n,new Map(e)),Object.freeze(this)}get size(){return i.__privateGet.call(void 0,this,n).size}[Symbol.iterator](){return i.__privateGet.call(void 0,this,n)[Symbol.iterator]()}entries(){return i.__privateGet.call(void 0,this,n).entries()}forEach(e,t){return i.__privateGet.call(void 0,this,n).forEach(((r,n,o)=>e.call(t,r,n,this)))}get(e){return i.__privateGet.call(void 0,this,n).get(e)}has(e){return i.__privateGet.call(void 0,this,n).has(e)}keys(){return i.__privateGet.call(void 0,this,n).keys()}values(){return i.__privateGet.call(void 0,this,n).values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}};n=new WeakMap;var a=class{constructor(e){i.__privateAdd.call(void 0,this,o,void 0),i.__privateSet.call(void 0,this,o,new Set(e)),Object.freeze(this)}get size(){return i.__privateGet.call(void 0,this,o).size}[Symbol.iterator](){return i.__privateGet.call(void 0,this,o)[Symbol.iterator]()}entries(){return i.__privateGet.call(void 0,this,o).entries()}forEach(e,t){return i.__privateGet.call(void 0,this,o).forEach(((r,n,o)=>e.call(t,r,n,this)))}has(e){return i.__privateGet.call(void 0,this,o).has(e)}keys(){return i.__privateGet.call(void 0,this,o).keys()}values(){return i.__privateGet.call(void 0,this,o).values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}};o=new WeakMap,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(a),Object.freeze(a.prototype),t.FrozenMap=s,t.FrozenSet=a},170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(9734);var n=r(6225);r(2049);var o=r(8441);r(5866);var i=r(8352),s=r(7287);r(5939);var a=r(6732),l=r(182),c=r(8290),u=r(5455),f=r(3984),d=r(2375),h=r(7856),p=r(1181),g=r(9873),y=r(8032);r(4090),r(9019),t.AssertionError=h.AssertionError,t.CAIP_ACCOUNT_ADDRESS_REGEX=l.CAIP_ACCOUNT_ADDRESS_REGEX,t.CAIP_ACCOUNT_ID_REGEX=l.CAIP_ACCOUNT_ID_REGEX,t.CAIP_CHAIN_ID_REGEX=l.CAIP_CHAIN_ID_REGEX,t.CAIP_NAMESPACE_REGEX=l.CAIP_NAMESPACE_REGEX,t.CAIP_REFERENCE_REGEX=l.CAIP_REFERENCE_REGEX,t.CaipAccountAddressStruct=l.CaipAccountAddressStruct,t.CaipAccountIdStruct=l.CaipAccountIdStruct,t.CaipChainIdStruct=l.CaipChainIdStruct,t.CaipNamespaceStruct=l.CaipNamespaceStruct,t.CaipReferenceStruct=l.CaipReferenceStruct,t.ChecksumStruct=c.ChecksumStruct,t.Duration=o.Duration,t.ESCAPE_CHARACTERS_REGEXP=g.ESCAPE_CHARACTERS_REGEXP,t.FrozenMap=y.FrozenMap,t.FrozenSet=y.FrozenSet,t.HexAddressStruct=d.HexAddressStruct,t.HexChecksumAddressStruct=d.HexChecksumAddressStruct,t.HexStruct=d.HexStruct,t.JsonRpcErrorStruct=s.JsonRpcErrorStruct,t.JsonRpcFailureStruct=s.JsonRpcFailureStruct,t.JsonRpcIdStruct=s.JsonRpcIdStruct,t.JsonRpcNotificationStruct=s.JsonRpcNotificationStruct,t.JsonRpcParamsStruct=s.JsonRpcParamsStruct,t.JsonRpcRequestStruct=s.JsonRpcRequestStruct,t.JsonRpcResponseStruct=s.JsonRpcResponseStruct,t.JsonRpcSuccessStruct=s.JsonRpcSuccessStruct,t.JsonRpcVersionStruct=s.JsonRpcVersionStruct,t.JsonSize=g.JsonSize,t.JsonStruct=s.JsonStruct,t.PendingJsonRpcResponseStruct=s.PendingJsonRpcResponseStruct,t.StrictHexStruct=d.StrictHexStruct,t.UnsafeJsonStruct=s.UnsafeJsonStruct,t.VersionRangeStruct=i.VersionRangeStruct,t.VersionStruct=i.VersionStruct,t.add0x=d.add0x,t.assert=h.assert,t.assertExhaustive=h.assertExhaustive,t.assertIsBytes=d.assertIsBytes,t.assertIsHexString=d.assertIsHexString,t.assertIsJsonRpcError=s.assertIsJsonRpcError,t.assertIsJsonRpcFailure=s.assertIsJsonRpcFailure,t.assertIsJsonRpcNotification=s.assertIsJsonRpcNotification,t.assertIsJsonRpcRequest=s.assertIsJsonRpcRequest,t.assertIsJsonRpcResponse=s.assertIsJsonRpcResponse,t.assertIsJsonRpcSuccess=s.assertIsJsonRpcSuccess,t.assertIsPendingJsonRpcResponse=s.assertIsPendingJsonRpcResponse,t.assertIsSemVerRange=i.assertIsSemVerRange,t.assertIsSemVerVersion=i.assertIsSemVerVersion,t.assertIsStrictHexString=d.assertIsStrictHexString,t.assertStruct=h.assertStruct,t.base64=u.base64,t.base64ToBytes=d.base64ToBytes,t.bigIntToBytes=d.bigIntToBytes,t.bigIntToHex=n.bigIntToHex,t.bytesToBase64=d.bytesToBase64,t.bytesToBigInt=d.bytesToBigInt,t.bytesToHex=d.bytesToHex,t.bytesToNumber=d.bytesToNumber,t.bytesToSignedBigInt=d.bytesToSignedBigInt,t.bytesToString=d.bytesToString,t.calculateNumberSize=g.calculateNumberSize,t.calculateStringSize=g.calculateStringSize,t.concatBytes=d.concatBytes,t.createBigInt=f.createBigInt,t.createBytes=f.createBytes,t.createDataView=d.createDataView,t.createHex=f.createHex,t.createModuleLogger=a.createModuleLogger,t.createNumber=f.createNumber,t.createProjectLogger=a.createProjectLogger,t.exactOptional=s.exactOptional,t.getChecksumAddress=d.getChecksumAddress,t.getErrorMessage=p.getErrorMessage,t.getJsonRpcIdValidator=s.getJsonRpcIdValidator,t.getJsonSize=s.getJsonSize,t.getKnownPropertyNames=g.getKnownPropertyNames,t.getSafeJson=s.getSafeJson,t.gtRange=i.gtRange,t.gtVersion=i.gtVersion,t.hasProperty=g.hasProperty,t.hexToBigInt=n.hexToBigInt,t.hexToBytes=d.hexToBytes,t.hexToNumber=n.hexToNumber,t.inMilliseconds=o.inMilliseconds,t.isASCII=g.isASCII,t.isBytes=d.isBytes,t.isCaipAccountAddress=l.isCaipAccountAddress,t.isCaipAccountId=l.isCaipAccountId,t.isCaipChainId=l.isCaipChainId,t.isCaipNamespace=l.isCaipNamespace,t.isCaipReference=l.isCaipReference,t.isErrorWithCode=p.isErrorWithCode,t.isErrorWithMessage=p.isErrorWithMessage,t.isErrorWithStack=p.isErrorWithStack,t.isHexString=d.isHexString,t.isJsonRpcError=s.isJsonRpcError,t.isJsonRpcFailure=s.isJsonRpcFailure,t.isJsonRpcNotification=s.isJsonRpcNotification,t.isJsonRpcRequest=s.isJsonRpcRequest,t.isJsonRpcResponse=s.isJsonRpcResponse,t.isJsonRpcSuccess=s.isJsonRpcSuccess,t.isNonEmptyArray=g.isNonEmptyArray,t.isNullOrUndefined=g.isNullOrUndefined,t.isObject=g.isObject,t.isPendingJsonRpcResponse=s.isPendingJsonRpcResponse,t.isPlainObject=g.isPlainObject,t.isStrictHexString=d.isStrictHexString,t.isValidChecksumAddress=d.isValidChecksumAddress,t.isValidHexAddress=d.isValidHexAddress,t.isValidJson=s.isValidJson,t.isValidSemVerRange=i.isValidSemVerRange,t.isValidSemVerVersion=i.isValidSemVerVersion,t.jsonrpc2=s.jsonrpc2,t.numberToBytes=d.numberToBytes,t.numberToHex=n.numberToHex,t.object=s.object,t.parseCaipAccountId=l.parseCaipAccountId,t.parseCaipChainId=l.parseCaipChainId,t.remove0x=d.remove0x,t.satisfiesVersionRange=i.satisfiesVersionRange,t.signedBigIntToBytes=d.signedBigIntToBytes,t.stringToBytes=d.stringToBytes,t.timeSince=o.timeSince,t.valueToBytes=d.valueToBytes,t.wrapError=p.wrapError},6455:(e,t,r)=>{"use strict";const n=r(274),o=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(m(e,n),!e[a])return}else r&&(e[h]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},b=e=>{if(e[i]>e[o])for(let t=e[f].tail;e[i]>e[o]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[i]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class v{constructor(e,t,r,n,o){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=o||0}}const w=(e,t,r,n)=>{let o=r.value;y(e,o)&&(m(e,r),e[a]||(o=void 0)),o&&t.call(n,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||p;if(this[s]="function"!=typeof t?p:t,this[a]=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[h]=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,b(this)}get max(){return this[o]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,b(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[i]=0,this[f].forEach((e=>{e.length=this[s](e.value,e.key),this[i]+=e.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[f].toArray().map((e=>e.key))}values(){return this[f].toArray().map((e=>e.value))}reset(){this[c]&&this[f]&&this[f].length&&this[f].forEach((e=>this[c](e.key,e.value))),this[d]=new Map,this[f]=new n,this[i]=0}dump(){return this[f].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[o])return m(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[i]+=a-s.length,s.length=a,this.get(e),b(this),!0}const h=new v(e,t,a,n,r);return h.length>this[o]?(this[c]&&this[c](e,t),!1):(this[i]+=h.length,this[f].unshift(h),this[d].set(e,this[f].head),b(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[f].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const e=o-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},705:(e,t,r)=>{const n=Symbol("SemVer ANY");class o{static get ANY(){return n}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===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)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 f(e.value,t).test(this.value):""===e.operator?""===e.value||new f(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=r(9469),{safeRe:s,t:a}=r(5632),l=r(5659),c=r(789),u=r(8246),f=r(9302)},9302:(e,t,r)=>{class n{constructor(e,t){if(t=i(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)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=>!y(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&&b(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&&p)|(this.options.loose&&g))+":"+e,r=o.get(t);if(r)return r;const n=this.options.loose,i=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(i,x(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],f),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],d),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],h),a("caret trim",e);let l=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));n&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),a("range list",l);const b=new Map,m=l.map((e=>new s(e,this.options)));for(const e of m){if(y(e))return[e];b.set(e.value,e)}b.size>1&&b.has("")&&b.delete("");const w=[...b.values()];return o.set(t,w),w}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>m(r,t)&&e.set.some((e=>m(e,t)&&r.every((r=>e.every((e=>r.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(T(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const o=new(r(6455))({max:1e3}),i=r(9469),s=r(705),a=r(789),l=r(8246),{safeRe:c,t:u,comparatorTrimReplace:f,tildeTrimReplace:d,caretTrimReplace:h}=r(5632),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:g}=r(5852),y=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,m=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},v=(e,t)=>(a("comp",e,t),e=S(e,t),a("caret",e),e=E(e,t),a("tildes",e),e=A(e,t),a("xrange",e),e=C(e,t),a("stars",e),e),w=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,((t,r,n,o,i)=>{let s;return a("tilde",e,t,r,n,o,i),w(r)?s="":w(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:w(o)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(a("replaceTilde pr",i),s=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>R(e,t))).join(" "),R=(e,t)=>{a("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,o,i,s)=>{let l;return a("caret",e,t,r,o,i,s),w(r)?l="":w(o)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:w(i)?l="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===r?"0"===o?`>=${r}.${o}.${i}-${s} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${s} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===o?`>=${r}.${o}.${i}${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),a("caret return",l),l}))},A=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,((r,n,o,i,s,l)=>{a("xRange",e,r,n,o,i,s,l);const c=w(o),u=c||w(i),f=u||w(s),d=f;return"="===n&&d&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(u&&(i=0),s=0,">"===n?(n=">=",u?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",u?o=+o+1:i=+i+1),"<"===n&&(l="-0"),r=`${n+o}.${i}.${s}${l}`):u?r=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(r=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),a("xRange return",r),r}))},C=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),N=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),x=e=>(t,r,n,o,i,s,a,l,c,u,f,d,h)=>`${r=w(n)?"":w(o)?`>=${n}.0.0${e?"-0":""}`:w(i)?`>=${n}.${o}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=w(c)?"":w(u)?`<${+c+1}.0.0-0`:w(f)?`<${c}.${+u+1}.0-0`:d?`<=${c}.${u}.${f}-${d}`:e?`<${c}.${u}.${+f+1}-0`:`<=${l}`}`.trim(),T=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},8246:(e,t,r)=>{const n=r(789),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=r(5852),{safeRe:s,t:a}=r(5632),l=r(9469),{compareIdentifiers:c}=r(2975);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`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>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");r[4]?this.prerelease=r[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=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("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 r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return c(r,o)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return c(r,o)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},9021:(e,t,r)=>{const n=r(5017);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5659:(e,t,r)=>{const n=r(5131),o=r(108),i=r(6365),s=r(4829),a=r(9295),l=r(5747);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return o(e,r,c);case">":return i(e,r,c);case">=":return s(e,r,c);case"<":return a(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},5928:(e,t,r)=>{const n=r(8246),o=r(5017),{safeRe:i,t:s}=r(5632);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=i[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),i[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[s.COERCERTL].lastIndex=-1}else r=e.match(i[s.COERCE]);return null===r?null:o(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},4027:(e,t,r)=>{const n=r(8246);e.exports=(e,t,r)=>{const o=new n(e,r),i=new n(t,r);return o.compare(i)||o.compareBuild(i)}},7395:(e,t,r)=>{const n=r(6146);e.exports=(e,t)=>n(e,t,!0)},6146:(e,t,r)=>{const n=r(8246);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3644:(e,t,r)=>{const n=r(5017);e.exports=(e,t)=>{const r=n(e,null,!0),o=n(t,null,!0),i=r.compare(o);if(0===i)return null;const s=i>0,a=s?r:o,l=s?o:r,c=!!a.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==o.major?u+"major":r.minor!==o.minor?u+"minor":r.patch!==o.patch?u+"patch":"prerelease"}},5131:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>0===n(e,t,r)},6365:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>n(e,t,r)>0},4829:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>n(e,t,r)>=0},2654:(e,t,r)=>{const n=r(8246);e.exports=(e,t,r,o,i)=>{"string"==typeof r&&(i=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,i).version}catch(e){return null}}},9295:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>n(e,t,r)<0},5747:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>n(e,t,r)<=0},1880:(e,t,r)=>{const n=r(8246);e.exports=(e,t)=>new n(e,t).major},9743:(e,t,r)=>{const n=r(8246);e.exports=(e,t)=>new n(e,t).minor},108:(e,t,r)=>{const n=r(6146);e.exports=(e,t,r)=>0!==n(e,t,r)},5017:(e,t,r)=>{const n=r(8246);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)retu