UNPKG

jcc-ethereum-utils

Version:

Toolkit of crossing chain from Ethereum to SWTC chain

1 lines 2.25 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.jcc_ethereum_utils=e():t.jcc_ethereum_utils=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=149)}([function(t,e,r){"use strict";r.r(e),r.d(e,"ethUnitMap",(function(){return n.d})),r.d(e,"bytesToUint8Array",(function(){return n.c})),r.d(e,"bytesToHex",(function(){return n.b})),r.d(e,"hexToBytes",(function(){return n.j})),r.d(e,"hexToNumber",(function(){return n.k})),r.d(e,"toDecimal",(function(){return n.u})),r.d(e,"numberToHex",(function(){return n.o})),r.d(e,"fromDecimal",(function(){return n.f})),r.d(e,"hexToNumberString",(function(){return n.l})),r.d(e,"utf8ToHex",(function(){return n.A})),r.d(e,"fromUtf8",(function(){return n.g})),r.d(e,"stringToHex",(function(){return n.p})),r.d(e,"hexToUtf8",(function(){return n.n})),r.d(e,"toUtf8",(function(){return n.x})),r.d(e,"utf8ToBytes",(function(){return n.z})),r.d(e,"hexToString",(function(){return n.m})),r.d(e,"asciiToHex",(function(){return n.a})),r.d(e,"fromAscii",(function(){return n.e})),r.d(e,"hexToAscii",(function(){return n.i})),r.d(e,"toAscii",(function(){return n.q})),r.d(e,"toHex",(function(){return n.v})),r.d(e,"toNumber",(function(){return n.w})),r.d(e,"toBigInt",(function(){return n.r})),r.d(e,"fromWei",(function(){return n.h})),r.d(e,"toWei",(function(){return n.y})),r.d(e,"toChecksumAddress",(function(){return n.t})),r.d(e,"toBool",(function(){return n.s})),r.d(e,"EventEmitter",(function(){return h})),r.d(e,"isHexStrict",(function(){return d.h})),r.d(e,"isHex",(function(){return d.g})),r.d(e,"checkAddressCheckSum",(function(){return d.a})),r.d(e,"isAddress",(function(){return d.c})),r.d(e,"isBloom",(function(){return d.d})),r.d(e,"isInBloom",(function(){return d.i})),r.d(e,"isUserEthereumAddressInBloom",(function(){return d.m})),r.d(e,"isContractAddressInBloom",(function(){return d.e})),r.d(e,"isTopic",(function(){return d.k})),r.d(e,"isTopicInBloom",(function(){return d.l})),r.d(e,"compareBlockNumbers",(function(){return d.b})),r.d(e,"isContractInitOptions",(function(){return d.f})),r.d(e,"isNullish",(function(){return d.j})),r.d(e,"isDataFormat",(function(){return B})),r.d(e,"convertScalarValue",(function(){return C})),r.d(e,"convert",(function(){return F})),r.d(e,"format",(function(){return D})),r.d(e,"keccak256Wrapper",(function(){return q})),r.d(e,"keccak256",(function(){return q})),r.d(e,"sha3",(function(){return K})),r.d(e,"sha3Raw",(function(){return W})),r.d(e,"processSolidityEncodePackedArgs",(function(){return Q})),r.d(e,"encodePacked",(function(){return J})),r.d(e,"soliditySha3",(function(){return $})),r.d(e,"soliditySha3Raw",(function(){return tt})),r.d(e,"getStorageSlotNumForLongString",(function(){return et})),r.d(e,"randomBytes",(function(){return rt.a})),r.d(e,"randomHex",(function(){return rt.b})),r.d(e,"padLeft",(function(){return w})),r.d(e,"padRight",(function(){return E})),r.d(e,"rightPad",(function(){return O})),r.d(e,"leftPad",(function(){return x})),r.d(e,"toTwosComplement",(function(){return k})),r.d(e,"fromTwosComplement",(function(){return S})),r.d(e,"mergeDeep",(function(){return g})),r.d(e,"isPromise",(function(){return at})),r.d(e,"waitWithTimeout",(function(){return ut})),r.d(e,"pollTillDefinedAndReturnIntervalId",(function(){return ct})),r.d(e,"pollTillDefined",(function(){return st})),r.d(e,"rejectIfTimeout",(function(){return ft})),r.d(e,"rejectIfConditionAtInterval",(function(){return lt})),r.d(e,"isResponseRpcError",(function(){return ht.isResponseRpcError})),r.d(e,"isResponseWithResult",(function(){return ht.isResponseWithResult})),r.d(e,"isResponseWithError",(function(){return ht.isResponseWithError})),r.d(e,"isResponseWithNotification",(function(){return ht.isResponseWithNotification})),r.d(e,"isSubscriptionResult",(function(){return ht.isSubscriptionResult})),r.d(e,"validateResponse",(function(){return ht.validateResponse})),r.d(e,"isValidResponse",(function(){return ht.isValidResponse})),r.d(e,"isBatchResponse",(function(){return ht.isBatchResponse})),r.d(e,"setRequestIdStart",(function(){return ht.setRequestIdStart})),r.d(e,"toPayload",(function(){return ht.toPayload})),r.d(e,"toBatchPayload",(function(){return ht.toBatchPayload})),r.d(e,"isBatchRequest",(function(){return ht.isBatchRequest})),r.d(e,"jsonRpc",(function(){return ht})),r.d(e,"Web3DeferredPromise",(function(){return dt.a})),r.d(e,"ChunkResponseParser",(function(){return pt.a})),r.d(e,"uuidV4",(function(){return yt.a})),r.d(e,"Eip1193Provider",(function(){return vt.a})),r.d(e,"SocketProvider",(function(){return mt.a})),r.d(e,"isUint8Array",(function(){return A.a})),r.d(e,"uint8ArrayConcat",(function(){return A.b})),r.d(e,"uint8ArrayEquals",(function(){return A.c}));var n=r(10),o=r(76),i=r.n(o);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==a(e)?e:e+""}function s(t,e,r){return e=f(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return!!t}()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var h=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=s(this,e,arguments)).maxListeners=Number.MAX_SAFE_INTEGER,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(e,i.a),r=e,(n=[{key:"setMaxListeners",value:function(t){return this.maxListeners=t,this}},{key:"getMaxListeners",value:function(){return this.maxListeners}}])&&u(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(),d=r(56),p=r(2),y=r(3),v=r(1);function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var b=function(t){return!("object"!==m(t)||Object(v.isNullish)(t)||Array.isArray(t)||t instanceof y.TypedArray)},g=function(t){if(!b(t))return t;for(var e=Object.assign({},t),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0,a=n;i<a.length;i++){var u=a[i];for(var c in u)b(u[c])?(e[c]||(e[c]={}),e[c]=g(e[c],u[c])):!Object(v.isNullish)(u[c])&&Object.hasOwnProperty.call(u,c)&&(Array.isArray(u[c])||u[c]instanceof y.TypedArray?e[c]=u[c].slice(0):e[c]=u[c])}return e},w=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";return"string"==typeof t?Object(v.isHexStrict)(t)?v.utils.padLeft(t,e,r):t.padStart(e,r):(v.validator.validate(["int"],[t]),v.utils.padLeft(t,e,r))},E=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0";if("string"==typeof t&&!Object(v.isHexStrict)(t))return t.padEnd(e,r);var o="string"==typeof t&&Object(v.isHexStrict)(t)?t:Object(n.o)(t),i=o.startsWith("-")?3:2;return v.validator.validate([o.startsWith("-")?"int":"uint"],[t]),o.padEnd(e+i,r)},O=E,x=w,k=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64;v.validator.validate(["int"],[t]);var r=Object(n.w)(t);if(r>=0)return w(Object(n.v)(r),e);var o=Object(v.bigintPower)(BigInt(2),BigInt(4*e));if(-r>=o)throw new p.NibbleWidthError("value: ".concat(t,", nibbleWidth: ").concat(e));var i=BigInt(r)+o;return w(Object(n.o)(i),e)},S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64;v.validator.validate(["int"],[t]);var r=Object(n.w)(t);if(r<0)return r;var o=Math.ceil(Math.log(Number(r))/Math.log(2));if(o>4*e)throw new p.NibbleWidthError('value: "'.concat(t,'", nibbleWidth: "').concat(e,'"'));if(4*e!==o)return r;var i=Object(v.bigintPower)(BigInt(2),BigInt(e)*BigInt(4));return Object(n.w)(BigInt(r)-i)},A=r(36);function _(t){return function(t){if(Array.isArray(t))return L(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||T(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||T(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=T(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function T(t,e){if(t){if("string"==typeof t)return L(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var R=v.utils.parseBaseType,B=function(t){return"object"===I(t)&&!Object(v.isNullish)(t)&&"number"in t&&"bytes"in t},N=function(t,e){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=Object.assign({},t),a=P(e);try{var u,c=function(){var t=n.value;if(i.oneOf&&r){var e=r,a=o.find((function(t){return j(t,1)[0]===e}));a&&a[0]===r&&(i=i.oneOf[a[1]])}if(!i.properties&&!i.items)return{v:void 0};if(i.properties)i=i.properties[t];else if(i.items&&i.items.properties){var u=i.items.properties;i=u[t]}else i.items&&Object(v.isObject)(i.items)?i=i.items:i.items&&Array.isArray(i.items)&&(i=i.items[parseInt(t,10)]);i&&t&&(r=t)};for(a.s();!(n=a.n()).done;)if(u=c())return u.v}catch(t){a.e(t)}finally{a.f()}return i},C=function(t,e,r){try{var o,i=R(e),a=i.baseType,u=i.baseTypeSize;if("int"===a||"uint"===a)switch(r.number){case y.FMT_NUMBER.NUMBER:return Number(Object(n.r)(t));case y.FMT_NUMBER.HEX:return Object(n.o)(Object(n.r)(t));case y.FMT_NUMBER.STR:return Object(n.r)(t).toString();case y.FMT_NUMBER.BIGINT:return Object(n.r)(t);default:throw new p.FormatterError("Invalid format: ".concat(String(r.number)))}if("bytes"===a)switch(u?"string"==typeof t?o=w(t,2*u):Object(A.a)(t)&&(o=Object(A.b)(new Uint8Array(u-t.length),t)):o=t,r.bytes){case y.FMT_BYTES.HEX:return Object(n.b)(Object(n.c)(o));case y.FMT_BYTES.UINT8ARRAY:return Object(n.c)(o);default:throw new p.FormatterError("Invalid format: ".concat(String(r.bytes)))}if("string"===a)return String(t)}catch(e){return t}return t},M=function(t){var e,r,n=t.value,o=t.schemaProp,i=t.schema,a=t.object,u=t.key,c=t.dataPath,s=t.format,f=t.oneOfPath,l=void 0===f?[]:f;if(Array.isArray(n)){var h=o;if(void 0!==(null==o?void 0:o.oneOf)&&o.oneOf.forEach((function(t,e){var r,i;!Array.isArray(null==o?void 0:o.items)&&("object"===I(n[0])&&"object"===(null===(r=null==t?void 0:t.items)||void 0===r?void 0:r.type)||"string"==typeof n[0]&&"object"!==(null===(i=null==t?void 0:t.items)||void 0===i?void 0:i.type))&&(h=t,l.push([u,e]))})),Object(v.isNullish)(null==h?void 0:h.items))return delete a[u],c.pop(),!0;if(Object(v.isObject)(h.items)&&!Object(v.isNullish)(h.items.format)){for(var d=0;d<n.length;d+=1)a[u][d]=C(n[d],null===(e=null==h?void 0:h.items)||void 0===e?void 0:e.format,s);return c.pop(),!0}if(!Array.isArray(null==h?void 0:h.items)&&"object"===(null===(r=null==h?void 0:h.items)||void 0===r?void 0:r.type)){var p,y=P(n);try{for(y.s();!(p=y.n()).done;){var m=p.value;F(m,i,c,s,l)}}catch(t){y.e(t)}finally{y.f()}return c.pop(),!0}if(Array.isArray(null==h?void 0:h.items)){for(var b=0;b<n.length;b+=1)a[u][b]=C(n[b],h.items[b].format,s);return c.pop(),!0}}return!1},F=function(t,e,r,n){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!Object(v.isObject)(t)&&!Array.isArray(t))return C(t,null==e?void 0:e.format,n);var a=t;if(Array.isArray(a)&&"array"===(null==e?void 0:e.type)&&"object"===(null===(o=null==e?void 0:e.items)||void 0===o?void 0:o.type))M({value:a,schemaProp:e,schema:e,object:a,key:"",dataPath:r,format:n,oneOfPath:i});else for(var u=0,c=Object.entries(a);u<c.length;u++){var s=j(c[u],2),f=s[0],l=s[1];r.push(f);var h=N(e,r,i);if(Object(v.isNullish)(h))delete a[f],r.pop();else if(Object(v.isObject)(l))F(l,e,r,n,i),r.pop();else if(!M({value:l,schemaProp:h,schema:e,object:a,key:f,dataPath:r,format:n,oneOfPath:i})){if(void 0===(null==h?void 0:h.format)&&void 0!==(null==h?void 0:h.oneOf)){var d,p=P(h.oneOf.entries());try{for(p.s();!(d=p.n()).done;){var y=j(d.value,2),m=(y[0],y[1]);if(void 0!==(null==m?void 0:m.format)){h=m;break}}}catch(t){p.e(t)}finally{p.f()}}a[f]=C(l,h.format,n),r.pop()}}return a},D=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.DEFAULT_RETURN_FORMAT;r=Object(v.isObject)(e)?g({},e):Array.isArray(e)?_(e):e;var o=Object(v.isObject)(t)?t:v.utils.ethAbiToJsonSchema(t);if(!o.properties&&!o.items&&!o.format)throw new p.FormatterError("Invalid json schema for formatting");return F(r,o,[],n)},H=r(12),U=r(19);function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var V="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",q=function(t){var e;return e="bigint"==typeof t||"number"==typeof t?Object(U.utf8ToBytes)(t.toString()):Array.isArray(t)?new Uint8Array(t):"string"!=typeof t||Object(v.isHexStrict)(t)?Object(n.c)(t):Object(U.utf8ToBytes)(t),Object(n.b)(Object(H.keccak256)(v.utils.ensureIfUint8Array(e)))},K=function(t){var e;e="string"==typeof t?t.startsWith("0x")&&Object(v.isHexStrict)(t)?Object(n.j)(t):Object(U.utf8ToBytes)(t):t;var r=q(e);return r===V?void 0:r},W=function(t){var e=K(t);return Object(v.isNullish)(e)?V:e},Z=function(t,e){var r=/^(\d+).*$/.exec(t.slice(e));return r?parseInt(r[1],10):0},X=function(t){return t.toString(2).length},Y=function(t,e){var r=e.toString();if("string"===t){if("string"==typeof e)return Object(n.A)(e);throw new p.InvalidStringError(e)}if("bool"===t||"boolean"===t){if("boolean"==typeof e)return e?"01":"00";throw new p.InvalidBooleanError(e)}if("address"===t){if(!Object(v.isAddress)(r))throw new p.InvalidAddressError(r);return r}var o=function(t){return t.startsWith("int[")?"int256".concat(t.slice(3)):"int"===t?"int256":t.startsWith("uint[")?"uint256'".concat(t.slice(4)):"uint"===t?"uint256":t}(t);if(t.startsWith("uint")){var i=Z(o,"uint".length);if(i%8||i<8||i>256)throw new p.InvalidSizeError(r);var a=Object(n.w)(r);if(X(a)>i)throw new p.InvalidLargeValueError(r);if(a<BigInt(0))throw new p.InvalidUnsignedIntegerError(r);return i?x(a.toString(16),i/8*2):a.toString(16)}if(t.startsWith("int")){var u=Z(o,"int".length);if(u%8||u<8||u>256)throw new p.InvalidSizeError(t);var c=Object(n.w)(r);if(X(c)>u)throw new p.InvalidLargeValueError(r);return c<BigInt(0)?k(c.toString(),u/8*2):u?x(c.toString(16),u/4):c.toString(16)}if("bytes"===o){if(r.replace(/^0x/i,"").length%2!=0)throw new p.InvalidBytesError(r);return r}if(t.startsWith("bytes")){if(r.replace(/^0x/i,"").length%2!=0)throw new p.InvalidBytesError(r);var s=Z(t,"bytes".length);if(!s||s<1||s>64||s<r.replace(/^0x/i,"").length/2)throw new p.InvalidBytesError(r);return O(r,2*s)}return""},Q=function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(function(t){if(Array.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r;if("object"===z(t)&&("t"in t||"type"in t)&&("v"in t||"value"in t))e="t"in t?t.t:t.type,r="v"in t?t.v:t.value,e="bigint"===e.toLowerCase()?"int":e;else{if("bigint"==typeof t)return["int",t];e=Object(n.v)(t,!0),r=Object(n.v)(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")}return!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof r||/^(-)?0x/i.test(r)||(r=Object(n.r)(r)),[e,r]}(t),2),r=e[0],o=e[1];return Array.isArray(o)?o.map((function(t){return Y(r,t).replace("0x","")})).join(""):Y(r,o).replace("0x","")},J=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=e.map(Q);return"0x".concat(n.join("").toLowerCase())},$=function(){return K(J.apply(void 0,arguments))},tt=function(){return W(J.apply(void 0,arguments))},et=function(t){return K("0x".concat(("number"==typeof t?t.toString():t).padStart(64,"0")))},rt=r(66);function nt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */nt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(n||[]);return o(a,"_invoke",{value:S(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",d="executing",p="completed",y={};function v(){}function m(){}function b(){}var g={};s(g,a,(function(){return this}));var w=Object.getPrototypeOf,E=w&&w(w(T([])));E&&E!==r&&n.call(E,a)&&(g=E);var O=b.prototype=v.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,u){var c=l(t[o],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==ot(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=A(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=l(e,r,n);if("normal"===s.type){if(o=n.done?p:"suspendedYield",s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=p,n.method="throw",n.arg=s.arg)}}}function A(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=l(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ot(e)+" is not iterable")}return m.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},x(k.prototype),s(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(O),s(O,c,"Generator"),s(O,a,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function ot(t){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var it=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))};function at(t){return("object"===ot(t)||"function"==typeof t)&&"function"==typeof t.then}function ut(t,e,r){return it(this,void 0,void 0,nt().mark((function n(){var o,i;return nt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Promise.race([t instanceof Promise?t:t(),new Promise((function(t,n){o=setTimeout((function(){return r?n(r):t(void 0)}),e)}))]);case 2:if(i=n.sent,o&&clearTimeout(o),!(i instanceof Error)){n.next=6;break}throw i;case 6:return n.abrupt("return",i);case 7:case"end":return n.stop()}}),n)})))}function ct(t,e){var r;return[new Promise((function(n,o){r=setInterval(function i(){return it(this,void 0,void 0,nt().mark((function i(){var a;return nt().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,ut(t,e);case 3:a=i.sent,Object(v.isNullish)(a)||(clearInterval(r),n(a)),i.next=11;break;case 7:i.prev=7,i.t0=i.catch(0),clearInterval(r),o(i.t0);case 11:case"end":return i.stop()}}),i,null,[[0,7]])}))),i}(),e)})),r]}function st(t,e){return it(this,void 0,void 0,nt().mark((function r(){return nt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",ct(t,e)[0]);case 1:case"end":return r.stop()}}),r)})))}function ft(t,e){var r,n=new Promise((function(n,o){r=setTimeout((function(){o(e)}),t)}));return[r,n]}function lt(t,e){var r,n=this,o=new Promise((function(o,i){r=setInterval((function(){it(n,void 0,void 0,nt().mark((function e(){var n;return nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:(n=e.sent)&&(clearInterval(r),i(n));case 4:case"end":return e.stop()}}),e)})))}),e)}));return[r,o]}var ht=r(20),dt=r(68),pt=r(69),yt=r(67),vt=r(70),mt=r(136)},function(t,e,r){"use strict";r.r(e),r.d(e,"Web3Validator",(function(){return In})),r.d(e,"validator",(function(){return Rn})),r.d(e,"utils",(function(){return n})),r.d(e,"Web3ValidatorError",(function(){return er})),r.d(e,"VALID_ETH_BASE_TYPES",(function(){return or})),r.d(e,"checkAddressCheckSum",(function(){return qr})),r.d(e,"isAddress",(function(){return Kr})),r.d(e,"isBlockNumber",(function(){return tn})),r.d(e,"isBlockTag",(function(){return en})),r.d(e,"isBlockNumberOrTag",(function(){return rn})),r.d(e,"isBloom",(function(){return nn})),r.d(e,"isInBloom",(function(){return on})),r.d(e,"isUserEthereumAddressInBloom",(function(){return an})),r.d(e,"isContractAddressInBloom",(function(){return un})),r.d(e,"isBoolean",(function(){return sn})),r.d(e,"isUint8Array",(function(){return zr})),r.d(e,"isBytes",(function(){return Vr})),r.d(e,"isValidEthBaseType",(function(){return Bn})),r.d(e,"isFilterObject",(function(){return vn})),r.d(e,"isBigInt",(function(){return Xr})),r.d(e,"bigintPower",(function(){return Yr})),r.d(e,"isUInt",(function(){return Qr})),r.d(e,"isInt",(function(){return Jr})),r.d(e,"isNumber",(function(){return $r})),r.d(e,"isString",(function(){return fr})),r.d(e,"isHexStrict",(function(){return lr})),r.d(e,"isHexString",(function(){return hr})),r.d(e,"isHex",(function(){return dr})),r.d(e,"isHexString8Bytes",(function(){return pr})),r.d(e,"isHexString32Bytes",(function(){return yr})),r.d(e,"isHexPrefixed",(function(){return vr})),r.d(e,"validateNoLeadingZeroes",(function(){return mr})),r.d(e,"isTopic",(function(){return dn})),r.d(e,"isTopicInBloom",(function(){return pn})),r.d(e,"isNullish",(function(){return ln})),r.d(e,"isObject",(function(){return hn}));var n={};r.r(n),r.d(n,"parseBaseType",(function(){return xr})),r.d(n,"abiSchemaToJsonSchema",(function(){return Sr})),r.d(n,"ethAbiToJsonSchema",(function(){return Ar})),r.d(n,"fetchArrayElement",(function(){return _r})),r.d(n,"transformJsonDataToAbiFormat",(function(){return jr})),r.d(n,"codePointToInt",(function(){return Pr})),r.d(n,"hexToNumber",(function(){return Tr})),r.d(n,"numberToHex",(function(){return Lr})),r.d(n,"padLeft",(function(){return Ir})),r.d(n,"uint8ArrayToHexString",(function(){return Rr})),r.d(n,"hexToUint8Array",(function(){return Ur})),r.d(n,"ensureIfUint8Array",(function(){return Gr}));var o,i,a=r(2);function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new L(n||[]);return o(a,"_invoke",{value:_(t,r,u)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};f(w,a,(function(){return this}));var O=Object.getPrototypeOf,x=O&&O(O(I([])));x&&x!==r&&n.call(x,a)&&(w=x);var k=g.prototype=m.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,u){var c=h(t[o],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==E(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function _(e,r,n){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?y:"suspendedYield",s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(E(e)+" is not iterable")}return b.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=f(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},S(A.prototype),f(A.prototype,u,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(k),f(k,s,"Generator"),f(k,a,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function s(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,u,"next",t)}function u(t){s(i,n,o,a,u,"throw",t)}a(void 0)}))}}function l(t){return function(t){if(Array.isArray(t))return j(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S(n.key),n)}}function p(t,e,r){return e&&d(t.prototype,e),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e,r){return e=w(e),function(t,e){if(e&&("object"==E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,b()?Reflect.construct(e,r||[],w(t).constructor):e.apply(t,r))}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}function m(t){var e="function"==typeof Map?new Map:void 0;return(m=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(b())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&g(o,r.prototype),o}(t,arguments,w(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,t)})(t)}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(b=function(){return!!t})()}function g(t,e){return(g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return(e=S(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t){var e=function(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==E(e)?e:e+""}function A(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function _(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}!function(t){t.assertEqual=function(t){return t},t.assertIs=function(t){},t.assertNever=function(t){throw new Error},t.arrayToEnum=function(t){var e,r={},n=A(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r[o]=o}}catch(t){n.e(t)}finally{n.f()}return r},t.getValidEnumValues=function(e){var r,n={},o=A(t.objectKeys(e).filter((function(t){return"number"!=typeof e[e[t]]})));try{for(o.s();!(r=o.n()).done;){var i=r.value;n[i]=e[i]}}catch(t){o.e(t)}finally{o.f()}return t.objectValues(n)},t.objectValues=function(e){return t.objectKeys(e).map((function(t){return e[t]}))},t.objectKeys="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e},t.find=function(t,e){var r,n=A(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(e(o))return o}}catch(t){n.e(t)}finally{n.f()}},t.isInteger="function"==typeof Number.isInteger?function(t){return Number.isInteger(t)}:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},t.joinValues=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return t.map((function(t){return"string"==typeof t?"'".concat(t,"'"):t})).join(e)},t.jsonStringifyReplacer=function(t,e){return"bigint"==typeof e?e.toString():e}}(o||(o={})),function(t){t.mergeShapes=function(t,e){return x(x({},t),e)}}(i||(i={}));var P=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),T=function(t){switch(E(t)){case"undefined":return P.undefined;case"string":return P.string;case"number":return isNaN(t)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":return Array.isArray(t)?P.array:null===t?P.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?P.promise:"undefined"!=typeof Map&&t instanceof Map?P.map:"undefined"!=typeof Set&&t instanceof Set?P.set:"undefined"!=typeof Date&&t instanceof Date?P.date:P.object;default:return P.unknown}},L=o.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),I=function(t){function e(t){var r;h(this,e),(r=y(this,e)).issues=[],r.addIssue=function(t){r.issues=[].concat(l(r.issues),[t])},r.addIssues=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];r.issues=[].concat(l(r.issues),l(t))};var n=(this instanceof e?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(r,n):r.__proto__=n,r.name="ZodError",r.issues=t,r}return v(e,m(Error)),p(e,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(t){var e=t||function(t){return t.message},r={_errors:[]},n=function(t){var o,i=A(t.issues);try{for(i.s();!(o=i.n()).done;){var a=o.value;if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(e(a));else for(var u=r,c=0;c<a.path.length;){var s=a.path[c];c===a.path.length-1?(u[s]=u[s]||{_errors:[]},u[s]._errors.push(e(a))):u[s]=u[s]||{_errors:[]},u=u[s],c++}}}catch(t){i.e(t)}finally{i.f()}};return n(this),r}},{key:"toString",value:function(){return this.message}},{key:"message",get:function(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function(){return 0===this.issues.length}},{key:"flatten",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t.message},r={},n=[],o=A(this.issues);try{for(o.s();!(t=o.n()).done;){var i=t.value;i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i))}}catch(t){o.e(t)}finally{o.f()}return{formErrors:n,fieldErrors:r}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(t){if(!(t instanceof e))throw new Error("Not a ZodError: ".concat(t))}}])}();I.create=function(t){return new I(t)};var R=function(t,e){var r;switch(t.code){case L.invalid_type:r=t.received===P.undefined?"Required":"Expected ".concat(t.expected,", received ").concat(t.received);break;case L.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(t.expected,o.jsonStringifyReplacer));break;case L.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(o.joinValues(t.keys,", "));break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(o.joinValues(t.options));break;case L.invalid_enum_value:r="Invalid enum value. Expected ".concat(o.joinValues(t.options),", received '").concat(t.received,"'");break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:"object"===E(t.validation)?"includes"in t.validation?(r='Invalid input: must include "'.concat(t.validation.includes,'"'),"number"==typeof t.validation.position&&(r="".concat(r," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?r='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?r='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):o.assertNever(t.validation):r="regex"!==t.validation?"Invalid ".concat(t.validation):"Invalid";break;case L.too_small:r="array"===t.type?"Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):"string"===t.type?"String